Propositional Logic
Propositional Logic
Biconditional ⇔ :
A sentence such as P⇔ Q is a Biconditional sentence, example I will eat lunch if and only if
my mood improves. P= I will eat lunch, Q= if my mood improves, it can be represented as
P ⇔ Q.
Truth tables
Negation:
p ¬p
Disjunction:
Truth False
p q p∨q
False Truth
true true true
true false true
Conjunction:
false true true
P Q P∧Q
false false true
true true true
true false false
false true false
false false false
Truth Tables
Implication: Biconditional:
p q p→q p q p⇔ q
Precedence Operators
First Precedence Parenthesis
Second Precedence Negation
Third Precedence Conjunction(AND)
Forth Precedence Disjunction(OR)
Fifth Precedence Implication
Sixth Precedence Biconditional
Properties of Operators
Commutativity: Distributive:
P ∧ Q= Q ∧ P, or P ∧ (Q ∨ R) = (P ∧ Q) ∨ (P ∧ R).
P ∨ Q = Q ∨ P. P ∨ (Q ∧ R) = (P ∨ Q) ∧ (P ∨ R).
Associativity: DE Morgan's Law:
(P ∧ Q) ∧ R = P ∧ (Q ∧ R), ¬(P ∧ Q) = (¬P) ∨ (¬Q),
(P ∨ Q) ∨ R= P ∨ (Q ∨ R). ¬(P ∨ Q) = (¬ P) ∧ (¬Q).
Identity element: Double-negation elimination:
P ∧ True = P, ¬(¬P) = P.
P ∨ True= True.
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.
Modus Ponens:
The Modus Ponens rule is one of the most important rules of
inference, and it states that if P and P → Q is true, then we can infer
that Q will be true. It can be represented as:
Example:
Statement-1: "If I am sleepy then I go to bed" ==> P→ Q
Statement-2: "I am sleepy" ==> P
Conclusion: "I go to bed." ==> Q.
Hence, we can say that, if P→ Q is true and P is true then Q will be true.
Modus Tollens:
The Modus Tollens rule state that if P→ Q is true and ¬ Q is true, then ¬ P
will also true. It can be represented as:
Example:
Statement-1: "If I am sleepy then I go to bed" ==> P→ Q
Statement-2: "I do not go to the bed."==> ~Q
Statement-3: Which infers that "I am not sleepy" => ~P
Hypothetical Syllogism:
The Hypothetical Syllogism rule state that if P→R is true whenever P→Q is
true, and Q→R is true.
Example:
Statement-1: If you have my home key then you can unlock
my home. P→Q
Statement-2: If you can unlock my home then you can take my
money. Q→R
Conclusion: If you have my home key then you can take my
money. P→R
Disjunctive Syllogism:
The Disjunctive syllogism rule state that if P∨Q is true, and ¬P is true, then Q
will be true. It can be represented as:
Example:
Statement-1: Today is Sunday or Monday. ==>P∨Q
Statement-2: Today is not Sunday. ==> ¬P
Conclusion: Today is Monday. ==> Q
Addition:
The Addition rule is one the common inference rule, and it states
that If P is true, then P∨Q will be true.
Example:
Statement: I have a vanilla ice-cream. ==> P
Statement-2: I have Chocolate ice-cream.
Conclusion: I have vanilla or chocolate ice-cream. ==> (P∨Q)
Simplification:
The simplification rule state that if P∧ Q is true, then Q or P will
also be true. It can be represented as:
Resolution:
The Resolution rule state that if P∨Q and ¬ P∧R is true, then
Q∨R will also be true. It can be represented as:
Uses of PL
Propositional logic forms the basis of inference engines in rule-based
expert systems.
Rule 1: If a patient has a fever and sore throat, then they may have the flu.
Rule 2: If a patient has a cough and fatigue, then they may have the flu.
Observed Symptoms:
A patient reports having a fever and sore throat.
Inference Using Modus Ponens:
• The AI "knows" Rule 1: If a patient has a fever and sore throat, then
they may have the flu.
• It also observes the fever and sore throat (i.e., "A is true").
• By applying modus ponens, the AI infers that the patient may indeed
have the flu ("B is true").
Uses of PL