Upload
clara-webster
View
217
Download
0
Embed Size (px)
Citation preview
Discussion #18 1/13
Discussion #18
Resolution withPropositional Calculus;Prenex Normal Form
Discussion #18 2/13
Topics
• Motivation for resolution
• Resolution
• Why resolution works
• Examples
• Prenex normal form
Discussion #18 3/13
Programming a Computer to do Proofs
Too much work to program all the possibilities we have considered. We need a better way.
1. Better = more uniform not so many cases (even though it may sometimes be longer).
2. Better = fewer rules of inference.
3. Better = a heuristic guide to lead us to the conclusion.
4. Better = easier to convert to an algorithm.
Discussion #18 4/13
ResolutionResolution answers these “demands:”
Uniform: Only disjunctions of literals in every ruleFewer Rules: Only one inference ruleHeuristic Guide: Reduce the number of literals with the goal
of reaching FalseAlgorithmic:
1. Negate the conclusion and add it as a premise.2. Convert the premises to CNF (conjunction of disjunction of
literals).3. Write each premise (which is a disjunction of literals) as a line
of the proof.4. Repeatedly apply resolution (the one inference rule) & simplify
as needed.5. Success iff F is reached.
Discussion #18 5/13
Resolution Rule
This says: In two disjunctive clauses, if we have complementary literals, we can discard them and “OR” the remaining clauses.
P AP BA B
literalsclauses: A and B will always be disjunctions of literals or just a literal or possibly missing.
Discussion #18 6/13
Resolution is Valid
F
T
T
T
F
T
T
T
T
T
T
T
T
T
T
T
T
T
T
T
F
T
F
T
T
T
T
T
F
F
F
F
F
F
T
T
F
T
F
T
F
F
T
T
T
T
T
T
FFF
TFF
FTF
TTF
FFT
TFT
FTT
TTT
A B B)(P (P A)BAP
Discussion #18 7/13
Resolution Subsumes “the big 3” Inference Rules
PP QQ
P FP QQ F
PQ PQ
P FQ PQ F
P QQ RP R
P QQ RP R
Modus ponens Modus tollens Hypothetical syllogism
We now have one rule to rule them all!
Discussion #18 8/13
Example #1If P Q, Q R, P then R.
1. Negate the conclusion (R becomes another premise).2. Convert to CNF: (P Q) (Q R) P R3. Write the premises as the first lines of the proof.4. Do resolution.
1. P Q premise2. Q R premise3. P premise4. R premise5. P R resolution 1,26. R resolution 3,57. resolution 4,6
} Sometimes calledthe support.
empty = F
Discussion #18 9/13
Example #2If P (Q R), R Q then P.1. Negate conclusion: P P2. Convert to CNF: (P Q) (P R) R Q P
1. P Q premise (not used could discard)2. P R premise3. R premise4. Q premise (not used could
discard)5. P premise6. R resolution 2,57. F resolution 3,6
Also, resolution 1,5 yields Q, which need not be added to the derivation already there.
Do we always need to use all the premises? If not, we can discard them from the statement to be proved.
Discussion #18 10/13
Example #3
If P Q, Q P, P Q then P Q.
1. Negate conclusion: (P Q) (P Q)2. CNF: (P Q) (Q P) (P Q) (P Q)
1. P Q premise2. Q P premise3. P Q premise4. P Q premise5. P resolution 1,2 (idemp. P P
P)6. Q resolution 3,57. Q resolution 4,58. F resolution 6,7
Discussion #18 11/13
Example #4If (P Q) (P R), P then Q R.1. Negate conclusion: (Q R) (Q R)2. CNF: ((P Q) (P R)) P (Q R)
(P Q R) P Q R
1. P Q R premise2. P premise3. Q premise4. R premise5. Q R resolution 1,26. R resolution 3,57. resolution 4,6
Discussion #18 12/13
Prenex Normal Form• Prenex Normal Form preparation to do
resolution in predicate calculus– All quantifiers in front
– More formally: No quantifier in the scope of any logical connector (, , , , )
• Algorithm to obtain prenex normal form:1. Remove and 2. Move in
3. Rectify (standardize all variables apart)
4. Move quantifiers to the front
Discussion #18 13/13
Prenex Normal Form – Example
y(xP(x) xQ(x, y)) y(xP(x) xQ(x, y)) implication
y(xP(x) xQ(x, y)) xA xA (de Morgan’s)
y(xP(x) xQ(x, y)) de Morgan’s, double neg.
y(xP(x) xQ(x, y)) xA xA (de Morgan’s)
y(xP(x) zQ(z, y)) rectification
yx(P(x) zQ(z, y)) xAB x(AB) (x not free in B)
yxz(P(x) Q(z, y)) AzB z(AB) (z not free in A)