Download presentation
Presentation is loading. Please wait.
Published byEmery McDonald Modified over 9 years ago
1
Automated Theorem Proving: Resolution and Davis-Putnam Intermediate Logic
2
Resolution Resolution is, like the tree method, a method to check for the logical consistency of a set of statements. Resolution requires all sentences to be put into CNF. A set of sentences in CNF is made into a clause set: a set of clauses, where a clause is a set of literals. Clauses are resolved using the resolution rule, and the resulting clause (the resolvent) is added to the clause set: L C 1 L’ C 2 C NEW = C 1 /L C 2 /L’
3
Putting into CNF (P Q) ((P Q) (Q P)) (( P Q) ( Q P)) ( P Q) ( Q P) (P Q) (Q P) ((P Q) Q) ((P Q) P) (P Q) ( Q Q) (P P) ( Q P) (Equiv) (Impl) (DeM) (DeM, DN) (Dist)
4
Resolution Graph (P Q) (Q R) (P R) (P Q) ( P Q)(Q R) ( Q R)(P R) ( P R) { P, Q} {P, Q}{Q, R} { Q, R} {P, R} { P, R} { P, R} { P} {P} {} {P, Q}
5
Satisfiability A clause is satisfied by a truth-value assignment if and only if that assignment makes at least one literal in that clause true. A clause set is satisfiable if and only if there is a truth- value assignment that satisfies all clauses in that clause set. Figuring out whether some clause set is satisfiable is the satisfiability problem. Note how the satisfiability problem relates directly to the consistency problem: figuring out whether some set of statements is consistent. A set of sentences is consistent if and only if the corresponding clause set is satisfiable.
6
Soundness and Completeness of Resolution The rule of Resolution is sound, making the method of resolution sound as well (so, if the empty clause (which is a generalized disjunction of 0 disjuncts, which is a contradiction) can be resolved from a clause set, then that means that that clause set is indeed unsatisfiable. It can be shown that resolution is complete, i.e. that the empty clause can be resolved from any unsatisfiable clause set.
7
Resolutions as Derivations {A, B} {A, C} { A, D, E} { B, D, E} { E} { A} { C, D} {B} {C} {D, E} {D} {D}{D} {} 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. A (B C) (A B) (D E) AA EE (C D) (A B) (A C) C D (A B) (D E)( A B) (D E) ( A D E) ( B D E) 1,6 2,6 4,8 5,10 7,9 11,12 17.42 from LPL: A (B C) E (A B) (D E) A C D
8
Resolutions as Decision Procedures Resolution can be made into a decision procedure by systematically exhausting all possible resolvents (of which there are finitely many). This will not be very efficient unless we add some resolution strategies.
9
Resolution Strategies Clause Elimination Strategies –Tautology Elimination –Subsumption Elimination –Pure Literal Elimination Resolving Strategies –Unit Preference Resolution –Linear Resolution –Ordered Resolution –Etc.
10
Tautology Elimination A tautologous clause is a clause that contains an atomic statement as well as the negation of that atomic statement. Obviously, for any tautologous clause C, any truth-value assignment is going to satisfy C. Hence, with S any clause set, and with S’ the clause set S with all tautologous clauses removed: S is satisfiable if and only if S’ is satisfiable.
11
Subsumption Elimination A clause C 1 subsumes a clause C 2 if and only if every literal contained in C 1 is contained in C 1, i.e. C 1 C 2. Obviously, if C 1 subsumes C 2, then any truth- value assignment that satisfies C 1 will satisfy C 2. Hence, with S any clause set, and S’ the clause set S with all subsumed clauses removed: S is satisfiable if and only if S’ is satisfiable.
12
Pure Literal Elimination A literal L is pure with regard to a clause set S if and only if L is contained in at least one clause in S, but L’ is not. A clause is pure with regard to a clause set S if and only if it contains a pure literal. Obviously, with S any clause set, and with S’ the clause set S with all pure clauses removed: S is satisfiable if and only if S’ is satisfiable.
13
Unit Preference Resolution A unit clause is a clause that contains one literal. Unit preference resolution tries to resolve using unit clauses first.
14
Unit Literal Deletion and Splitting For any clause set S, S L is the clause set that is generated from S as follows: –Remove all clauses from S that contain L. –Remove all instances of L’ from all other clauses Obviously, with C = {L} S, S is satisfiable if and only if S L is satisfiable. It is also easy to see that for any clause set S, and any literal L: S is satisfiable if and only if S L is satisfiable or S L’ is satisfiable. The last observation suggests a splitting strategy that forms the basis of Davis-Putnam.
15
Davis-Putnam Recursive routine Satisfiable(S) returns true iff S is satisfiable: boolean Satisfiable(S) begin if S = {} return true; if S = {{}} return false; select L lit(S); return Satisfiable(S L ) || Satisfiable(S L’ ); end
16
Making Davis-Putnam Efficient: Adding Bells and Whistles The routine on the previous slide is not very efficient. However, we can easily make it more efficient: –return false as soon as {} S –add the unit rule: if {L} S return Satisfiable(S L ) –strategically add deletion strategies –strategically choose the literal on which to split As far as I have gathered from the ATP literature, such efficient Davis-Putnam routines are credited to do well in comparison to other ATP routines.
17
Davis-Putnam as Trees {P, Q} {P, Q} { P, Q} { P, Q} (P) ( P) {Q} { Q} ( Q) {} (Q) {} {Q} { Q} ( Q) {} (Q) {}
18
Davis-Putnam vs Truth-Trees How does Davis-Putnam differ from Truth-Trees? –Davis-Putnam can be seen as an ‘inside-out’ approach: it assigns a truth-value to atomic statements and determines the consequences of that assignment for the complex statements involved. –Truth-Trees are more of an ‘outside-in’ approach: it assigns truth-values to complex statements as a whole, and decomposes them accordingly until they have been decomposed to literals. How does the Davis-Putnam procedure stack up against the Truth-Tree procedure in terms of efficiency? –No idea … project!
19
Can we do DP without CNF? Sure, simply consider a set of statements, and see what happens to each of the statements when some atomic claim is set to true or false, respectively. For example, when we set A to True in (A B) (D E), the claim becomes (True B) (D E), which becomes True (D E), which becomes D E. Possible project: Investigate efficiency of this method
20
Rules for DP without CNF True False False True True P P False P False P True P P False False True P True False P P P True True P False P True P P False P True P True True P False P True P P False P P P True P P False P
21
Example: Doing DP without CNF 17.42 from LPL: A (B C) E (A B) (D E) A C D A (B C) E (A B) (D E) A (C D) A AA E D E False (C D) × B C E B (D E) (C D) E EE B C False (C D) B C B D (C D) × Etc.
22
Can DP and TT be combined? DP really starts to look like a tree method, even though DP works ‘inside-out’ and TT ‘outside-in’. Can these two methods be combined into one method? Sure! In fact, you can do some things to make this efficient, e.g: –Use ‘inheritance’ to keep from copying statements that are unaffected. Project: Investigate efficiency of this method Project: Do the KE rules add any further efficiency?
23
Example: DP and TT Combo 17.42 from LPL: A B C (D E) D C A E C B × A B C (D E) D C A E (C B) C B D E D A A E E (you’ll probably have to reconstruct this one to follow it; it would help if it were annotated with justifications!)
24
EG and ATP EGTT: Applying Truth-Trees to EG EGDP: Applying Davis-Putnam to EG EGTTDP: Applying both TT and DP to EG
25
EGTT: Applying Truth-Trees to EG Applying the idea of truth-trees to EG is simple: –Two decomposition rules: –Close any branch that contains a literal and its complement, or that contains an empty cut. –Rest remains the same 11 22 11 22
26
EGTT: A Satisfiability Procedure boolean Satisfiable(G) begin if G = Satisfiable( end else return true; return false; if G = 11 22 ) || Satisfiable( 11 ); 22 if G = return Satisfiable( ); return if G =return false; LL
27
EGDP: Literal Reduction For any graph , L is the graph that is generated from as follows: –Remove all instances of L –Replace all instances of L’ with an empty cut
28
Example Literal Reduction DEAE D With G = G E’ =A
29
EGDP: Satisfiability Decision Procedure boolean Satisfiable(G) begin if G = end return true; return false; select L lit(G); return Satisfiable(G L ) || Satisfiable(G L’ );
30
Adding Bells and Whistles Again, this procedure can be made a lot more efficient by dealing with empty cuts, double cuts, and duplicates more efficiently, by various other tautology, subsumption, and pure literal deletion strategies, and by strategically picking the literal on which to split.
31
Tautology Elimination in EG Any subgraph of the following form (i.e. a cut containing an empty cut) is a tautology, and can therefore be eliminated: Note: This can be incorporated into the reduction routine. That is, rather than replacing any complement of a literal with an empty cut, we can remove any cut containing the complement.
32
Subsumption Elimination in EG If a graph of the form: exists at a nested level with regard to: then the first graph is said to be subsumed by the second (subsuming) graph, and can therefore be removed.
33
Pure-Literal Elimination in EG A literal that exists at even levels only is said to be a pure literal, and can be eliminated for satisfiability purposes. A literal that exists at odd levels only is also a pure literal, and can be replaced with the empty cut for satisfiability purposes.
34
Satisfiability Example A DE E CD BC AB D CD BC B A DCD) = Sat( Sat( ) = Sat() = Sat(D) = Sat(B BC ) = FalseD
35
Advantage of EGDP over DP? The alleged advantage of EGDP over DP is that there is no need to put statements into clauses. This not only improves efficiency in that this preliminary step can eliminated, but by avoiding clauses, the algorithm actually becomes inherently more efficient in that 1) it leaves statements compact, and 2) it eliminates literals at any level. Project: Investigate to see whether this is true!
36
Example: Gaining Efficiency by Avoiding Clauses ABCA AB A AC B C BC BC BC DE (2x!)DC (2x!) DE DC Clausifying No Clausifying! So, by keeping statements compact, less steps need to be taken!
37
EGTTDP Can EG be combined with both TT and DP? Yes, the characteristic rule of TT is the decomposition rule, and the characteristic rule for DP is the splitting rule. We can use both rules in a satisfiability procedure. Question: When is a good time to use decomposition, and when is a good time to use splitting? … Project!
38
EGTTDP: A Satisfiability Procedure boolean Sat(G) begin if G = Sat( end return false; if G = 11 22 ) || Sat( 11 ); 22 return if G =return Sat(L LL ); if G =return true; remove double cuts; select L lit(G); return Sat(G L ) || Sat(G L’ ); (TT) (DP)
39
HW 9 Show the argument below to be valid using: –1. Resolution –2. Davis-Putnam (on clauses) –3. Davis-Putnam (on original statements) –4. Davis-Putnam and Truth-Tree combo –5. EGTT, EGDP, and EGTTDP Q S (P Q) R S R ---- P (Q S)
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.