Week 3Propositional Logic
Week 3Propositional Logic
Propositional Logic
Deepak Khemani
Department of Computer Science & Engineering
IIT Madras
Expressivity: Complete Sets of Connectives Recap
It can be shown that the following sets of connectives are sufficient to express
whatever can be expressed with other connectives.
{∧, ¬}, {∨, ¬}
{⊃, ¬} Gottlob Frege used this set in his Propositional Calculus
In practice we often use the set {∧, ∨, ¬} in our implementations.
Interestingly there are two singleton sets that are complete. They are,
https://en.wikipedia.org/wiki/Frege_propositional_calculus
Deepak Khemani Artificial Intelligence: Knowledge Representation and Reasoning
Completeness
• Frege proved that his Propositional Calculus is complete.
• Completeness proofs are beyond the scope of this course.
• Frege’s logic is an Axiomatic System.
• This means that the KB is a set of axioms.
• Axioms are statements that are accepted as true.
• Exercise: Verify that the six axioms in Frege’s calculus are tautologies.
• Therefore, Frege’s calculus can prove all tautologies.
• Recall the Deduction Theorem:
• A, B, C, D ⊨ E iff ⊨ ((A ∧ B ∧ C ∧ D) ⊃ E)
• IF ⊨ ((A ∧ B ∧ C ∧ D) ⊃ E) then ⊢ ((A ∧ B ∧ C ∧ D) ⊃ E)
from Completeness of Frege’s Calculus
after eliminating the ∧ connective
• IF ⊢ ((A ∧ B ∧ C ∧ D) ⊃ E) THEN A, B, C, D ⊢ E
• This means that if A, B, C, D ⊨ E then A, B, C, D ⊢ E
Base: Every proposition symbol is a formula. These are the atomic formulas.
If 𝛂 ∈ ℙ then 𝛂 ∈ 𝔽
Unary connective:
If α ∈ 𝔽 then ¬α ∈ 𝔽
Often, the input KB has a collection of atomic and compound formulas, and the
task is to determine the valuation of some other specific formulas.
Given the valuation function we can lift it to all the formulas 𝕍 : 𝔽 → {true, false}
using the semantics of the logical connectives. For example,
There are many algorithms for theorem proving. We shall look at a few.
P Simplification Q
MP R S DS
Conjunction R ∧ S
T MP
The proof is the product that is published.
Finding the proof is a search process that logicians do not publish!
Deepak Khemani Artificial Intelligence: Knowledge Representation and Reasoning
Finding Proofs
The proof of α is the end product,
that is a justification of the sentence α being true
Forward Chaining
Pick a rule with matching facts
Add the consequent to the KB
Till the goal is added to the KB
Given (P ∧ Q)
(P ⊃ R)
((R ∧ S) ⊃ T)
(¬Q ∨ S)
To prove T
1. ((P ∧ Q) ⊃ R) Assumption
2. P Assumption
3. Q Assumption
4. (P ∧ Q) 2, 3, Conjunction
5. R 1, 4, MP
6. (Q ⊃ R) 3, 5, Deduction theorem
7. (P ⊃ (Q ⊃ R)) 2, 6, Deduction theorem
If ¬𝛂 has a model then 𝛂 may have a model too (for example, ¬(P ⊃ Q)).
If ¬𝛂 does not have a model (is unsatisfiable) then 𝛂 is a tautology.
For example,
• In a model for (P ∧ Q) both P and Q must be present.
• In a model for (P ⊃ Q) either Q must be present or ¬P must be present.
• There are two possibilities of finding a model.
Connective ¬ ∧ ∨ ⊃
¬X (X ∧ Y) (X ∨ Y) (X ⊃ Y)
Formula
¬X X ¬X Y
X Y
Y
2 (P ∧ (P ⊃ Q))
¬Q
P
3 (P ⊃ Q))
¬P Q
2 (Q ∧ (P ⊃ Q))
¬P
Q
3 (P ⊃ Q))
¬P Q
No more connectives to eliminate
{¬P, Q} is a model for ¬[(Q ∧ (P ⊃ Q)) ⊃ P)]
Abduction is not a sound rule of inference
Deepak Khemani Artificial Intelligence: Knowledge Representation and Reasoning
Will Alice go to college?
Processing the formulas in
1. (P ∧ Q) premise the order presented.
2. (P ⊃ R) premise
3. ((R ∧ S) ⊃ T) premise We are unable to find an
4. (¬Q ∨ S) premise interpretation in which the
premises are true and the
¬T negated conclusion
conclusion is false.
P
Q
¬P R
T 5. ¬(R ∧ S) S
¬Q ¬R ¬S
3 P∨Q 1 P∨Q
R∨S 2 R∨S
1 ¬P ∧ ¬S 3 ¬P ∧ ¬R
2 ¬(Q ∨ S) ¬(Q ∨ S)
4
¬P
¬R P Q
¬Q
¬S R S R S
¬P ¬P ¬P ¬P
P Q ¬R ¬R ¬R ¬R
¬Q
The tree on the left is smaller! ¬S
Deepak Khemani Artificial Intelligence: Knowledge Representation and Reasoning
Proving Frege’s THEN-2 Axiom
1. ¬[(P ⊃ (Q ⊃ R))] ⊃ [(P ⊃ Q) ⊃ (P ⊃ R)] Negated axiom
2. (P ⊃ (Q ⊃ R)) After 1
3. ¬[(P ⊃ Q) ⊃ (P ⊃ R)] After 1
10. ¬P 4 11. Q 4
12.¬Q 9 13. R 9