Professional Documents
Culture Documents
Resolution Theorem Proving: Propositional Logic Propositional Resolution
Resolution Theorem Proving: Propositional Logic Propositional Resolution
Lecture 7 • 1 Lecture 7 • 2
Lecture 7 • 3 Lecture 7 • 4
Lecture 7 • 5 Lecture 7 • 6
1
Example Problem Example Problem
Convert to CNF Convert to CNF
Prove R Prove R
• ¬(¬ P v Q) v Q • ¬(¬ P v Q) v Q
(P → Q) → Q • (P ¬ Q) v Q (P → Q) → Q • (P ¬ Q) v Q
1 1
• (P v Q) (¬ Q v Q) • (P v Q) (¬ Q v Q)
2 (P → P) → R 2 (P → P) → R
• (P v Q) • (P v Q)
3 (R → S) → ¬(S → Q) 3 (R → S) → ¬(S → Q)
• ¬(¬ P v P) v R
• (P ¬ P) v R
• (P v R) (¬ P v R)
Lecture 7 • 7 Lecture 7 • 8
1 (P → Q) → Q • (P ¬ Q) v Q 1 (P → Q) → Q 3 ¬PvR
• (P v Q) (¬ Q v Q) 4 RvS
2 (P → P) → R 2 (P → P) → R
• (P v Q) 5 Rv¬Q
(R → S)
3 (R → S) → ¬(S → Q)
• ¬(¬ P v P) v R 3 → ¬←(S →
6 ¬Sv¬Q
• (P ¬ P) v R Q)
7 ¬R Neg
• (P v R) (¬ P v R)
• ¬(¬ R v S) v ¬ (¬ S v Q)
• (R ¬ S) v (S ¬ Q)
• (R v S) (¬ S v S) ←(R v ¬ Q) ←←(¬ S v ¬ Q)
• (R v S) (R v ¬ Q) ←←(¬ S v ¬ Q)
Lecture 7 • 9 Lecture 7 • 10
2
Recitation Problems First-Order Resolution
uppercase letters:
Using resolution refutation, prove the last sentence in ∀ x. P(x) → Q(x) Syllogism: constants
each group from the rest of the sentences in the All men are mortal
lowercase letters:
P(A) Socrates is a man
group. Socrates is mortal
variables
Q(A)
ÿ(P ŸÿQ) ⁄ÿ(ÿS ŸÿT )
P ÆQ (P Æ Q) ⁄ (R Æ S)
ÿ(T ⁄ Q)
ÿP Æ R (P Æ S) ⁄ (R Æ Q) ∀ x. ¬ P(x) v Q(x)
U Æ (ÿT Æ (ÿS Ÿ P)) Equivalent by
ÿQ ÆÿR
P(A) definition of
ÿU The key is finding
implication
Q(A) the correct
substitutions for
Use resolution refutation to do problem 6.5 from R&N. the variables.
Substitute A for
¬ P(A) v Q(A) x, still true
P(A) then
Q(A) Propositional
Lecture 7 • 13 resolution Lecture 7 • 14
Substitutions Unification
P(x, F(y), B) : an atomic sentence • Expressions w1 and w2 are unifiable iff there exists a
Substitution Substitution Comment substitution s such that w1 s = w2 s
instances {v1 /t1,…, vn /tn} • Let w1 = x and w2 = y, the following are unifiers
P(z, F(w), B) {x/z, y/w} Alphabetic
variant
P(x, F(A), B) {y/A} s w1 s w2 s
{y/x} x x
P(G(z), F(A), B) {x/G(z), y/A}
†
{x/y} y y
P(C, F(A), B) {x/C, y/A} Ground instance †
{x/F(F(A)), y/F(F(A))} F(F(A))
† F(F(A))
Lecture 7 • 17 Lecture 7 • 18
3
Unify-var subroutine Unification Problems
Substitute in for var and x as long as possible, then add new For each pair of sentences, give an MGU.
binding
Color(Tweety, Yellow) Color(x,y)
unify-var(Variable var, Expr x, Subst s){
if var is bound to val in s, Color(Tweety, Yellow) Color(x,x)
return unify(val, x, s) Color(Hat(John), Blue) Color(Hat(y), x)
else if x is bound to val in s, R(F(x), B) R(y,z)
return unify-var(var, val, s)
R(F(y), x) R(x, F(B))
else if var occurs anywhere in x, return fail
else return add({var/x}, s)
R(F(y), y, x) R(x, F(A), F(v))
} Loves(x, y) Loves(y, x)
F(G(w), H(w, J(x, y))) F(G(v), H(u, v))
Note: last line incorrect in book! F(G(w), H(w, J(x, u))) F(G(v), H(u, v))
F(x, F(u, x)) F(F(y, A), F(z, F(B,z)))
Lecture 7 • 19 Lecture 7 • 20
P(A)
Q(A)
Lecture 7 • 21