Professional Documents
Culture Documents
CS 228: Logic in Computer Science: Krishna. S
CS 228: Logic in Computer Science: Krishna. S
Krishna. S
1/17
Recap
2/17
Completeness
ϕ1 , . . . , ϕn |= ψ ⇒ ϕ1 , . . . , ϕn ` ψ
3/17
Completeness : 3 steps
I Given ϕ1 , . . . , ϕn |= ψ
4/17
Completeness : 3 steps
I Given ϕ1 , . . . , ϕn |= ψ
I Step 1: Show that |= ϕ1 → (ϕ2 → (. . . (ϕn → ψ) . . . ))
4/17
Completeness : 3 steps
I Given ϕ1 , . . . , ϕn |= ψ
I Step 1: Show that |= ϕ1 → (ϕ2 → (. . . (ϕn → ψ) . . . ))
I Step 2: Show that ` ϕ1 → (ϕ2 → (. . . (ϕn → ψ) . . . ))
4/17
Completeness : 3 steps
I Given ϕ1 , . . . , ϕn |= ψ
I Step 1: Show that |= ϕ1 → (ϕ2 → (. . . (ϕn → ψ) . . . ))
I Step 2: Show that ` ϕ1 → (ϕ2 → (. . . (ϕn → ψ) . . . ))
I Step 3: Show that ϕ1 , . . . , ϕn ` ψ
4/17
Completeness : Step 1
5/17
Completeness : Step 1
5/17
Completeness : Step 1
5/17
Completeness : Step 2
6/17
Completeness : Step 2
6/17
Completeness : Step 2
6/17
Completeness : Step 2
7/17
Completeness : Step 2
I p̂ = p, q̂ = q ` p ∧ q
I p̂ = ¬p, q̂ = q ` ¬(p ∧ q)
I p̂ = p, q̂ = ¬q ` ¬(p ∧ q)
I p̂ = ¬p, q̂ = ¬q ` ¬(p ∧ q)
7/17
Truth Table to Proof
I Structural Induction on ϕ.
8/17
Truth Table to Proof
I Structural Induction on ϕ.
I Base : If ϕ = p, a proposition, then we have p ` p and ¬p ` ¬p.
8/17
Truth Table to Proof
I Structural Induction on ϕ.
I Base : If ϕ = p, a proposition, then we have p ` p and ¬p ` ¬p.
I Assume for formulae of size 6 k − 1 (size=height of the parse
tree). What is a parse tree?
8/17
Truth Table to Proof
I Structural Induction on ϕ.
I Base : If ϕ = p, a proposition, then we have p ` p and ¬p ` ¬p.
I Assume for formulae of size 6 k − 1 (size=height of the parse
tree). What is a parse tree?
I Case Negation : ϕ = ¬ϕ1
8/17
Truth Table to Proof
I Structural Induction on ϕ.
I Base : If ϕ = p, a proposition, then we have p ` p and ¬p ` ¬p.
I Assume for formulae of size 6 k − 1 (size=height of the parse
tree). What is a parse tree?
I Case Negation : ϕ = ¬ϕ1
I Assume ϕ evaluates to true in line l of T . Then ϕ1 evaluates to
false in line l. By inductive hypothesis, p̂1 , . . . , p̂n ` ¬ϕ1 .
8/17
Truth Table to Proof
I Structural Induction on ϕ.
I Base : If ϕ = p, a proposition, then we have p ` p and ¬p ` ¬p.
I Assume for formulae of size 6 k − 1 (size=height of the parse
tree). What is a parse tree?
I Case Negation : ϕ = ¬ϕ1
I Assume ϕ evaluates to true in line l of T . Then ϕ1 evaluates to
false in line l. By inductive hypothesis, p̂1 , . . . , p̂n ` ¬ϕ1 .
I Assume ϕ evaluates to false in line l of T . Then ϕ1 evaluates to
true in line l. By inductive hypothesis, p̂1 , . . . , p̂n ` ϕ1 . Use the ¬¬i
rule to obtain a proof of p̂1 , . . . , p̂n ` ¬¬ϕ1 .
8/17
Truth Table to Proof
I Case → : ϕ = ϕ1 → ϕ2 .
9/17
Truth Table to Proof
I Case → : ϕ = ϕ1 → ϕ2 .
I If ϕ evaluates to false in line l, then ϕ1 evaluates to true and ϕ2 to
false. Let {q1 , . . . , qk } be the variables of ϕ1 and let {r1 , . . . , rj } be
the variables in ϕ2 . {q1 , . . . , qk } ∪ {r1 , . . . , rj } = {p1 , . . . , pn }.
9/17
Truth Table to Proof
I Case → : ϕ = ϕ1 → ϕ2 .
I If ϕ evaluates to false in line l, then ϕ1 evaluates to true and ϕ2 to
false. Let {q1 , . . . , qk } be the variables of ϕ1 and let {r1 , . . . , rj } be
the variables in ϕ2 . {q1 , . . . , qk } ∪ {r1 , . . . , rj } = {p1 , . . . , pn }.
I By inductive hypothesis, qˆ1 , . . . , qˆk |= ϕ1 and rˆ1 , . . . , rˆj |= ¬ϕ2 .
Then, pˆ1 , . . . , pˆn |= ϕ1 ∧ ¬ϕ2 .
9/17
Truth Table to Proof
I Case → : ϕ = ϕ1 → ϕ2 .
I If ϕ evaluates to false in line l, then ϕ1 evaluates to true and ϕ2 to
false. Let {q1 , . . . , qk } be the variables of ϕ1 and let {r1 , . . . , rj } be
the variables in ϕ2 . {q1 , . . . , qk } ∪ {r1 , . . . , rj } = {p1 , . . . , pn }.
I By inductive hypothesis, qˆ1 , . . . , qˆk |= ϕ1 and rˆ1 , . . . , rˆj |= ¬ϕ2 .
Then, pˆ1 , . . . , pˆn |= ϕ1 ∧ ¬ϕ2 .
I Prove that ϕ1 ∧ ¬ϕ2 ` ¬(ϕ1 → ϕ2 ).
9/17
Truth Table to Proof
I Case → : ϕ = ϕ1 → ϕ2 .
10/17
Truth Table to Proof
I Case → : ϕ = ϕ1 → ϕ2 .
I If ϕ evaluates to true in line l, then there are 3 possibilities. If both
ϕ1 , ϕ2 evaluate to true, then we have pˆ1 , . . . , pˆn |= ϕ1 ∧ ϕ2 . Proving
ϕ1 ∧ ϕ2 ` ϕ1 → ϕ2 , we are done.
10/17
Truth Table to Proof
I Case → : ϕ = ϕ1 → ϕ2 .
I If ϕ evaluates to true in line l, then there are 3 possibilities. If both
ϕ1 , ϕ2 evaluate to true, then we have pˆ1 , . . . , pˆn |= ϕ1 ∧ ϕ2 . Proving
ϕ1 ∧ ϕ2 ` ϕ1 → ϕ2 , we are done.
I If both ϕ1 , ϕ2 evaluate to false, then we have
pˆ1 , . . . , pˆn |= ¬ϕ1 ∧ ¬ϕ2 . Proving ¬ϕ1 ∧ ¬ϕ2 ` ϕ1 → ϕ2 , we are
done.
10/17
Truth Table to Proof
I Case → : ϕ = ϕ1 → ϕ2 .
I If ϕ evaluates to true in line l, then there are 3 possibilities. If both
ϕ1 , ϕ2 evaluate to true, then we have pˆ1 , . . . , pˆn |= ϕ1 ∧ ϕ2 . Proving
ϕ1 ∧ ϕ2 ` ϕ1 → ϕ2 , we are done.
I If both ϕ1 , ϕ2 evaluate to false, then we have
pˆ1 , . . . , pˆn |= ¬ϕ1 ∧ ¬ϕ2 . Proving ¬ϕ1 ∧ ¬ϕ2 ` ϕ1 → ϕ2 , we are
done.
I Last, if ϕ1 evaluates to false and ϕ2 evaluates to true, then we have
pˆ1 , . . . , pˆn |= ¬ϕ1 ∧ ϕ2 . Proving ¬ϕ1 ∧ ϕ2 ` ϕ1 → ϕ2 , we are done.
10/17
Truth Table to Proof
11/17
On An Example
12/17
Completeness : Steps 2, 3
13/17
Completeness : Steps 2, 3
13/17
Completeness : Steps 2, 3
13/17
Completeness : Steps 2, 3
13/17
Summary
14/17
Normal Forms
15/17
Normal Forms
15/17
Normal Forms
15/17
Normal Forms
16/17
Normal Forms
16/17
CNF Algorithm
17/17
CNF Algorithm
17/17
CNF Algorithm
17/17