Soundness Completeness Conjuctive Normal Form Horn Clauses
Soundness Completeness Conjuctive Normal Form Horn Clauses
Soundness
Completeness
Horn Clauses
Suppose Φ1 Φn Ψ holds.
Technical problem:
– Chopping a proof may nod lead to correct sub-proofs, since some boxes
may still be open.
– However, a chopped proof (a prefix of the sequence of formulas rep-
resenting a proof) may form a correct proof if the assumptions of the
open boxes are added to the premises.
Slide 2 CS4231 — Logic and Formal Systems — Lecture 02 — 19/08/04
Soundness (2)
1 p q r premise 1 0/ p q r premise
2 p assumption 2 2 p assumption
3 q assumption 3 2 3 q assumption
4 p q i 2,3 4 2 3 p q i 2,3
5 r e 1,4 5 2 3 r e 1,4
6 q r i 3–5 6 2 q r i 3–5
7 p q r i 2–6 7 0/ p q r i 2–6
Note: The set at the right of a formula in a proof line grows and shrinks
as a stack, reflecting the way boxes are opened and closed.
Just for the purpose of proving soundness, we formally change the defi-
nition of the proof as follows.
Definition: A proof of the sequent Γ Ψ is a sequence of pairs
d1 χ1 dk χk where:
(1) d1
0; /
(2) each di is a subset of 1 i ;
Base case k
1: the proof has length 1, hence it is of the form
1 0/ χ premise
1 0/ χ1 premise
..
.
k d k χk justi f ication k
Φ Ψ Φ
Φ Ψ
. . e
. .
. .
Φ Ψ χ χ Φ
i1 i2 e
Φ Ψ Φ Ψ χ
Φ
.
.
.
Ψ Φ Φ Ψ
i e
Φ Ψ Ψ
Φ
.
.
.
Φ
i e
Φ Φ
therefore, using the induction hypothesis, they have the truth value
T . Using the truth table for , we conclude that the truth value of
χ is T .
proof, and that we have two boxes with assumptions χ1 and χ2 and
conclusion χ. The proof of χ1 χ2 is shorter hence, according to
Step 1:
Φ1 Φ2 Φn Ψ
Step 2: Φ1 Φ2 Φn Ψ
Step 3: Φ1 Φn Ψ
Step 1:
Φ1 Φ2 Φn Ψ
assignment of truth values to its atoms that results in all Φ1 Φn having the truth
value T and Ψ having the truth value F; — but this is impossible, as it contradicts
the hypothesis.
Step 3: Φ1 Φn Ψ
This step is also easy. Suppose Φ1
Φ1
Φ2 Φn Ψ holds, i.e.
..
.
has a natural deduction proof Π. Then
Φn
we augment this proof by adding the ..
premises Φ1 Φn to the front, and then Π
.
Φ1 Φ2 Φn Ψ
using the rule e at the end to produce
Ψ
e
Ψ. In other words, we produce the proof:
The core of the completeness proof is Step 2, which requires to show the
following:
If
Φ holds, then Φ holds. In other words, if
Phi is a tautology, then Φ is a theorem.
Suppose
Φ holds.
Induction case: The height of Φ is greater than 1. Then, we have the following cases.
Φ is of the form Φ1 .
p1 pn .
(left as an exercise)
The other two cases are similar, requiring the following proofs:
Φ1 Φ2 Φ1 Φ2
Φ1 Φ2 Φ1 Φ2
If Φ is of the form Φ1 Φ2 , we can reduce the proof to the search for the
following proofs.
Φ1 Φ2 Φ1 Φ2
Φ1 Φ2 Φ1 Φ2
Φ1 Φ2 Φ1 Φ2
Φ1 Φ2 Φ1 Φ2
Φ1 Φ2 Φ1 Φ2
Φ1 Φ2 Φ1 Φ2
Φ1 Φ2 Φ1 Φ2
The last piece of the puzzle is to assemble these proofs of the form
p̂1 p̂n Φ
each representing a line in the truth table, into a proof of Φ, without
premises.
We use the disjunction rules to generate the lines of the truth table, then
we appropriately insert the above proofs.
We exemplify this procedure for the case of two atoms, for the tautology
p q p.
2 p ass p ass
3 q q LEM q q LEM
7 p q p p q p p q p p q p
8 p q p e p q p e
9 p q p e
Definitions:
Φ is valid iff
Φ.
Remarks:
Our aim is to transform formulas into equivalent ones for which check-
ing validity is easier.
Definitions:
Examples of CNFs:
q p r p r q
p r p r p r
Not in CNF:
q p r p r q
1 i j n, such that Li is L j .
Proof:
to be true.)
– Hence, there exist i, j such that Li is L j .
Proof:
Φ Φ Φ Φ Ψ η Φ Ψ Φ η
Φ Φ Φ Φ Ψ η Φ Ψ Φ η
Φ Ψ Ψ Φ F Φ F Φ Φ F
Φ Ψ Ψ Φ T Φ T Φ Φ T
Φ Ψ η Φ Ψ η Φ Ψ Φ Ψ
Φ Ψ η Φ Ψ η Φ Ψ Φ Ψ
Φ Φ η Φ Φ Φ
Φ Φ η Φ
CNF(NNF(IMPL FREE(Φ)))
for a given formula Φ. The CNF, NNF, and IMPL FREE functions shall
be discussed shortly.
end case
end function
Let Φ
p q p r q .
IMPL FREE Φ
IMPL FREE p q IMPL FREE p r q
IMPL FREE p IMPL FREE q IMPL FREE p r q
p q p r q
function NNF(Φ) :
/* precondition: Φ is implication free */
/* postcondition: returns an NNF formula equivalent to Φ */
begin function
case
Φ is a literal: return Φ
Φ is Φ1 : return NNF Φ1
Φ is Φ1 Φ2 : return NNF Φ1 NNF Φ2
Φ is Φ1 Φ2 : return NNF Φ1 NNF Φ2
Φ is Φ1 Φ2 : return NNF Φ1 Φ2
Φ is Φ1 Φ2 : return NNF Φ1 Φ2
end case
end function
Let Φ
p q p r q .
NNF Φ
NNF p q NNF p r q
p q NNF p r q
p q p NNF r q
p q p r NNF q
p q p r q
function CNF(Φ) :
/* precondition: Φ is implication and in NNF */
/* postcondition: returns an CNF formula equivalent to Φ */
begin function
case
Φ is a literal: return Φ
Φ is Φ1 Φ2 : return CNF Φ1 CNF Φ2
Φ is Φ1 Φ2 : return DISTR CNF Φ1 CNF Φ2
end case
end function
begin function
case
Φ1 is Φ11 Φ12 : return DISTR Φ11 Φ2 DISTR Φ12 Φ2
Φ2 is Φ21 Φ22 : return DISTR Φ1 Φ21 DISTR Φ1 Φ22
otherwise: return Φ1 Φ2
end case
end function
Let Φ
p q p r q .
CNF Φ
CNF p q p r q
DISTR p q p r q
DISTR p q p DISTR p q r q
p q p p q r q
Definitions:
Examples (yes)
p q s p q r
p p s s
p q s q r p s
p1 p3 p5 p13
p5 p5 p11
Examples (no)
p q s p q r
p p s s
p q s q r
p s
p1 p3 p5 p13 p27 p5 p5 p11