Unit 3 Topic 2 Propositional Logic
Unit 3 Topic 2 Propositional Logic
1
Basic
• The central component of a knowledge-based agent is its knowledge base, or KB.
• It is related but not identical to the sentences of English and other natural languages.)
• When the sentence is taken as being given without being derived from other sentences,
we call it an axiom.
Logic
These sentences are expressed according to the syntax of the representation language, which
specifies all the sentences that are well formed. The notion of syntax is clear enough in
ordinary arithmetic:
3
Logic (Contd..)
A logic must also define the semantics, or meaning, of sentences. The semantics defines the
truth of each sentence with respect to each possible world. For example, the semantics for
arithmetic specifies that the sentence “x + y= 4” is true in a world where x is 2 and y is 2,
but false in a world where x is 1 and y is 1. In standard logics, every sentence must be either
true or false in each possible world—there is no “in between.”
4
Propositional Logic
• Each such symbol stands for a proposition that can be true or false.
5
A BNF (Backus–Naur Form) grammar of sentences in
propositional logic, along with operator precedence's, from
highest to lowest.
6
Basic Facts
• In propositional logic, we use symbolic variables to represent the logic, and we can use
any symbol for a representing a proposition, such A, B, C, P, Q, R, etc.
7
Contd…
• The propositions and connectives are the basic elements of the propositional logic.
• A proposition formula which is always true is called tautology, and it is also called a
valid sentence.
• A proposition formula which has both true and false values is called
• Statements which are questions, commands, or opinions are not propositions such as
"Where is ABC", "How are you", "What is your name", are not propositions.
Conti…
• Atomic Proposition: Atomic propositions are the simple propositions. It consists of a single proposition symbol.
These are the sentences which must be either true or false.
Example:
• Compound proposition: Compound propositions are constructed by combining simpler or atomic propositions,
using parenthesis and logical connectives.
Example:
• Negation: A sentence such as ¬ P is called negation of P. A literal can be either Positive literal
or negative literal.
P= ABC is intelligent,
Q= ABC is hardworking.
→ P∧ Q.
10
Conti…
11
Propositional Logic Connectives
12
Properties
Satisfiable
Tautology:
Contradiction
Contingent
• A propositional logic can be contingent which means it can be neither a tautology nor a
contradiction.
13
Truth Table
• A truth table is a tabular representation of all the combinations of values for inputs and
their corresponding outputs. It is a mathematical table that shows all possible outcomes
that would occur from all possible scenarios that are considered factual, hence the name.
Truth tables are usually used for logic problems as in Boolean algebra and electronic
circuits.
Truth Table
15
Properties of Operators
• Commutativity:
• P∧ Q= Q ∧ P, or
• P ∨ Q = Q ∨ P.
• Associativity:
• (P ∧ Q) ∧ R= P ∧ (Q ∧ R),
• (P ∨ Q) ∨ R= P ∨ (Q ∨ R)
• Identity element:
• P ∧ True = P,
• P ∨ True= True.
• Distributive:
• P∧ (Q ∨ R) = (P ∧ Q) ∨ (P ∧ R).
• P ∨ (Q ∧ R) = (P ∨ Q) ∧ (P ∨ R).
• DE Morgan's Law:
• ¬ (P ∧ Q) = (¬P) ∨ (¬Q)
• ¬ (P ∨ Q) = (¬ P) ∧ (¬Q).
• Double-negation elimination:
• ¬ (¬P) = P.
16
Limitations of Propositional logic
• We cannot represent relations like ALL, some, or
none with propositional logic.
Example:
• All the girls are intelligent.
• Some apples are sweet.
17
Thanks
18