Automated Theorem Proving: Resolution and Davis-Putnam Intermediate Logic.

Slides:



Advertisements
Similar presentations
Logic & Critical Reasoning
Advertisements

Inference Rules Universal Instantiation Existential Generalization
UIUC CS 497: Section EA Lecture #2 Reasoning in Artificial Intelligence Professor: Eyal Amir Spring Semester 2004.
Propositional and First Order Reasoning. Terminology Propositional variable: boolean variable (p) Literal: propositional variable or its negation p 
First Order Logic Resolution
Inference and Reasoning. Basic Idea Given a set of statements, does a new statement logically follow from this. For example If an animal has wings and.
Methods of Proof Chapter 7, second half.. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound)
Methods of Proof Chapter 7, Part II. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound) generation.
Resolution Theorem Proving
Propositional Logic Russell and Norvig: Chapter 6 Chapter 7, Sections 7.1—7.4 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2003/home.htm.
Deduction In addition to being able to represent facts, or real- world statements, as formulas, we want to be able to manipulate facts, e.g., derive new.
Logic.
Logic Concepts Lecture Module 11.
Truth Trees Intermediate Logic.
Formal Logic Proof Methods Direct Proof / Natural Deduction Conditional Proof (Implication Introduction) Reductio ad Absurdum Resolution Refutation.
Proof methods Proof methods divide into (roughly) two kinds: –Application of inference rules Legitimate (sound) generation of new sentences from old Proof.
Willis Lemasters Grant Conklin. Searching a tree recursively one branch at a time, abandoning any branch which does not satisfy the search constraints.
Plan for today Proof-system search ( ` ) Interpretation search ( ² ) Quantifiers Equality Decision procedures Induction Cross-cutting aspectsMain search.
Automated Proof Generation for EG Bram van Heuveln Spring 2003 AI & Reasoning Lab, RPI.
Using Existential Graphs for Automated Theorem Proving
Formalizing Alpha: Soundness and Completeness Bram van Heuveln Dept. of Cognitive Science RPI.
Inference and Resolution for Problem Solving
Existential Graphs and Davis-Putnam April 3, 2002 Bram van Heuveln Department of Cognitive Science.
Methods of Proof Chapter 7, second half.
Knoweldge Representation & Reasoning
Alpha: Symbolization and Inference Bram van Heuveln Minds and Machines Lab RPI.
Proof by Deduction. Deductions and Formal Proofs A deduction is a sequence of logic statements, each of which is known or assumed to be true A formal.
CS1502 Formal Methods in Computer Science Lecture Notes 10 Resolution and Horn Sentences.
Propositional Logic Review
Proof Systems KB |- Q iff there is a sequence of wffs D1,..., Dn such that Dn is Q and for each Di in the sequence: a) either Di is in KB or b) Di can.
Logics for Data and Knowledge Representation Propositional Logic: Reasoning Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto.
Boolean Satisfiability and SAT Solvers
SAT and SMT solvers Ayrat Khalimov (based on Georg Hofferek‘s slides) AKDV 2014.
Lecture 22 More NPC problems
CHAPTERS 7, 8 Oliver Schulte Logical Inference: Through Proof to Truth.
Conjunctive normal form: any formula of the predicate calculus can be transformed into a conjunctive normal form. Def. A formula is said to be in conjunctive.
Marriage Problem Your the sovereign in a small kingdom. One of your jobs is to marry off the people in kingdom. There are three rules that apply.
Advanced Topics in Propositional Logic Chapter 17 Language, Proof and Logic.
Existential Graphs Intermediate Logic. Existential Graphs A graphical logic system developed by C.S. Peirce almost 100 years ago. Peirce studied semiotics:
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View BDDs.
CS Introduction to AI Tutorial 8 Resolution Tutorial 8 Resolution.
Logical Agents Chapter 7. Knowledge bases Knowledge base (KB): set of sentences in a formal language Inference: deriving new sentences from the KB. E.g.:
LDK R Logics for Data and Knowledge Representation Propositional Logic: Reasoning First version by Alessandro Agostini and Fausto Giunchiglia Second version.
Chapter Five Conditional and Indirect Proofs. 1. Conditional Proofs A conditional proof is a proof in which we assume the truth of one of the premises.
Automated Reasoning Early AI explored how to automated several reasoning tasks – these were solved by what we might call weak problem solving methods as.
On the Relation between SAT and BDDs for Equivalence Checking Sherief Reda Rolf Drechsler Alex Orailoglu Computer Science & Engineering Dept. University.
Extra slides for Chapter 3: Propositional Calculus & Normal Forms Based on Prof. Lila Kari’s slides For CS2209A, 2009 By Dr. Charles Ling;
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View BDDs.
First-Order Logic and Inductive Logic Programming.
Automated reasoning with propositional and predicate logics Spring 2007, Juris Vīksna.
AI Lecture 17 Planning Noémie Elhadad (substituting for Prof. McKeown)
© Copyright 2008 STI INNSBRUCK Intelligent Systems Propositional Logic.
Dr. Shazzad Hosain Department of EECS North South Universtiy Lecture 04 – Part B Propositional Logic.
Lecture 9a: Resolution Strategies Heshaam Faili University of Tehran Restriction strategies for resolution Horn clauses.
1 Propositional Logic Limits The expressive power of propositional logic is limited. The assumption is that everything can be expressed by simple facts.
Solving the Logic Satisfiability problem Solving the Logic Satisfiability problem Jesus De Loera.
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
Proof Methods for Propositional Logic CIS 391 – Intro to Artificial Intelligence.
Knowledge Repn. & Reasoning Lecture #9: Propositional Logic UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2005.
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
Sound Arguments and Derivations. Topics Sound Arguments Derivations Proofs –Inference rules –Deduction.
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
EA C461 Artificial Intelligence
Knowledge Representation and Reasoning
First-Order Logic and Inductive Logic Programming
Elementary Metamathematics
Automated Proof Generation for EG
Artificial Intelligence: Agents and Propositional Logic.
Methods of Proof Chapter 7, second half.
Instructor: Aaron Roth
Presentation transcript:

Automated Theorem Proving: Resolution and Davis-Putnam Intermediate Logic

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’

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)

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}  

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.

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.

Resolutions as Derivations {A, B} {A, C} {  A, D, E} {  B, D, E} {  E} {  A} {  C,  D} {B} {C} {D, E} {D} {D}{D} {} A  (B  C) (A  B)  (D  E) AA EE  (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, from LPL: A  (B  C)  E (A  B)  (D  E)  A  C  D

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.

Resolution Strategies Clause Elimination Strategies –Tautology Elimination –Subsumption Elimination –Pure Literal Elimination Resolving Strategies –Unit Preference Resolution –Linear Resolution –Ordered Resolution –Etc.

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.

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.

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.

Unit Preference Resolution A unit clause is a clause that contains one literal. Unit preference resolution tries to resolve using unit clauses first.

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.

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

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.

Davis-Putnam as Trees {P,  Q} {P, Q} {  P, Q} {  P,  Q} (P) (  P) {Q} {  Q} (  Q) {} (Q) {} {Q} {  Q} (  Q) {} (Q) {}

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!

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

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

Example: Doing DP without CNF 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 AA  E D  E False  (C  D) × B  C  E B  (D  E)  (C  D) E EE B  C False  (C  D) B  C B  D  (C  D) × Etc.

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?

Example: DP and TT Combo 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!)

EG and ATP EGTT: Applying Truth-Trees to EG EGDP: Applying Davis-Putnam to EG EGTTDP: Applying both TT and DP to EG

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  11 22 11 22 

EGTT: A Satisfiability Procedure boolean Satisfiable(G) begin if G = Satisfiable( end else return true; return false; if G = 11 22  ) || Satisfiable( 11  ); 22  if G =  return Satisfiable(  ); return  if G =return false;  LL

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

Example Literal Reduction DEAE D With G = G E’ =A

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’ );

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.

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.

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.

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.

Satisfiability Example A DE E CD BC AB D CD BC B A DCD) = Sat( Sat( ) = Sat() = Sat(D) = Sat(B BC ) = FalseD

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!

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!

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!

EGTTDP: A Satisfiability Procedure boolean Sat(G) begin if G = Sat( end return false; if G = 11 22  ) || Sat( 11  ); 22  return  if G =return Sat(L LL ); if G =return true; remove double cuts; select L  lit(G); return Sat(G L ) || Sat(G L’ ); (TT) (DP)

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)