Last time Proof-system search ( ` ) Interpretation search ( ² ) Quantifiers Equality Decision procedures Induction Cross-cutting aspectsMain search strategy.

Slides:



Advertisements
Similar presentations
Exploiting SAT solvers in unbounded model checking
Advertisements

Automated Theorem Proving
Completeness and Expressiveness
10 October 2006 Foundations of Logic and Constraint Programming 1 Unification ­An overview Need for Unification Ranked alfabeths and terms. Substitutions.
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 
Proofs from SAT Solvers Yeting Ge ACSys NYU Nov
Automated Reasoning Systems For first order Predicate Logic.
First Order Logic Resolution
Methods of Proof Chapter 7, second half.. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound)
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 1: (Part 2): The Foundations: Logic and Proofs.
© The McGraw-Hill Companies, Inc., Chapter 8 The Theory of NP-Completeness.
Outline Recap Knowledge Representation I Textbook: Chapters 6, 7, 9 and 10.
Plan for today Proof-system search ( ` ) Interpretation search ( ² ) Quantifiers Equality Decision procedures Induction Cross-cutting aspectsMain search.
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
Last time Proof-system search ( ` ) Interpretation search ( ² ) Quantifiers Equality Decision procedures Induction Cross-cutting aspectsMain search strategy.
1 Boolean Satisfiability in Electronic Design Automation (EDA ) By Kunal P. Ganeshpure.
Automated Theorem Proving Lecture 4.   Formula := A |  |    A  Atom := b | t = 0 | t < 0 | t  0 t  Term := c | x | t + t | t – t | ct | Select(m,t)
Search in the semantic domain. Some definitions atomic formula: smallest formula possible (no sub- formulas) literal: atomic formula or negation of an.
Review: forward E { P } { P && E } TF { P && ! E } { P 1 } { P 2 } { P 1 || P 2 } x = E { P } { \exists … }
Review: forward E { P } { P && E } TF { P && ! E } { P 1 } { P 2 } { P 1 || P 2 } x = E { P } { \exists … }
Plan for the rest of the quarter TuesdayThursday Week 7ResolutionProof carrying code Week 8No class (Sorin in DC for workshop) Predicate abstraction (Mystery.
10/28 Homework 3 returned Homework 4 socket opened (No office hours today) Where hard problems are Phase Transition.
Daniel Kroening and Ofer Strichman 1 Decision Procedures in First Order Logic Decision Procedures for Equality Logic.
Deciding a Combination of Theories - Decision Procedure - Changki pswlab Combination of Theories Daniel Kroening, Ofer Strichman Presented by Changki.
The Theory of NP-Completeness 1. What is NP-completeness? Consider the circuit satisfiability problem Difficult to answer the decision problem in polynomial.
Satisfiability Introduction to Artificial Intelligence COS302 Michael L. Littman Fall 2001.
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.
INTRODUCTION TO ARTIFICIAL INTELLIGENCE COS302 MICHAEL L. LITTMAN FALL 2001 Satisfiability.
Solvers for the Problem of Boolean Satisfiability (SAT) Will Klieber Aug 31, 2011 TexPoint fonts used in EMF. Read the TexPoint manual before you.
1 Section 7.2 Equivalent Formulas Two wffs A and B are equivalent, written A  B, if they have the same truth value for every interpretation. Property:
First Order Predicate Logic
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
CS344: Introduction to Artificial Intelligence Lecture: Herbrand’s Theorem Proving satisfiability of logic formulae using semantic trees (from Symbolic.
CS621: Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 28– Interpretation; Herbrand Interpertation 30 th Sept, 2010.
Lazy Annotation for Program Testing and Verification Speaker: Chen-Hsuan Adonis Lin Advisor: Jie-Hong Roland Jiang November 26,
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.
On the Relation between SAT and BDDs for Equivalence Checking Sherief Reda Rolf Drechsler Alex Orailoglu Computer Science & Engineering Dept. University.
Automated Reasoning Systems For first order Predicate Logic.
First-Order Logic and Inductive Logic Programming.
© Copyright 2008 STI INNSBRUCK Intelligent Systems Propositional Logic.
Nikolaj Bjørner Microsoft Research DTU Winter course January 2 nd 2012 Organized by Flemming Nielson & Hanne Riis Nielson.
Semantics of Predicate Calculus For the propositional calculus, an interpretation was simply an assignment of truth values to the proposition letters of.
Daniel Kroening and Ofer Strichman Decision Procedures An Algorithmic Point of View Deciding Combined Theories.
First-Order Logic Semantics Reading: Chapter 8, , FOL Syntax and Semantics read: FOL Knowledge Engineering read: FOL.
Web Science & Technologies University of Koblenz ▪ Landau, Germany Models in First Order Logics.
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
Answer Extraction To use resolution to answer questions, for example a query of the form  X C(X), we must keep track of the substitutions made during.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View Basic Concepts and Background.
Proof Methods for Propositional Logic CIS 391 – Intro to Artificial Intelligence.
Section 1.4. Propositional Functions Propositional functions become propositions (and have truth values) when their variables are each replaced by a value.
Knowledge Repn. & Reasoning Lecture #9: Propositional Logic UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2005.
1 Section 7.1 First-Order Predicate Calculus Predicate calculus studies the internal structure of sentences where subjects are applied to predicates existentially.
Satisfiability Modulo Theories and DPLL(T) Andrew Reynolds March 18, 2015.
CS.462 Artificial Intelligence SOMCHAI THANGSATHITYANGKUL Lecture 04 : Logic.
Introduction to Logic for Artificial Intelligence Lecture 2
Knowledge Representation and Reasoning
Gábor Kusper University of Linz RISC Austria
ARTIFICIAL INTELLIGENCE
First-Order Logic and Inductive Logic Programming
Lecture 2 Propositional Logic
Logics for Data and Knowledge Representation
MA/CSSE 474 More Math Review Theory of Computation
Search techniques.
Bottom Up: Soundness and Completeness
Herbrand Semantics Computational Logic Lecture 15
Presentation transcript:

Last time Proof-system search ( ` ) Interpretation search ( ² ) Quantifiers Equality Decision procedures Induction Cross-cutting aspectsMain search strategy Today

` ² Q E D I Last time Proof-system search ( ` ) Interpretation search ( ² ) Quantifiers Equality Decision procedures Induction Cross-cutting aspectsMain search strategy Today

Search in the semantic domain ` ² Q E D I

Some definitions atomic formula: smallest formula possible (no sub- formulas) literal: atomic formula or negation of an atomic formula clause: disjunction of literals CNF: Conjunction of clauses (A Ç : B Ç C) Æ (D Ç B Ç E) Æ atomic literal clause ` ² Q E D I

DPLL backtracking search algorithm David-Puttnam-Logemann-Loveland Algorithm: given a formula, return SAT or UNSAT –SAT: there some truth assignment that makes the formula true –UNSAT: formula is false on all truth assignments Key idea –Pick a literal –Assign literal to true, simplify the formula, and recurse –Assign literal to false, simplify the formula, and recurse ` ² Q E D I

In more detail If formula is false, return UNSAT else If formula is true, return SAT else: –Pick a literal –Assign literal to true, simplify the formula, and recurse If recursive call returns SAT, return SAT –Assign literal to false, simplify the formula, and recurse If recursive call returns SAT, return SAT –If both recursive calls return UNSAT, return UNSAT ` ² Q E D I

Example simplification (A Ç : B Ç C) Æ (D Ç B Ç E) Æ ( : A Ç D Ç : E) A to true (A Ç : B Ç C) Æ (D Ç B Ç E) Æ ( : A Ç D Ç : E) (A Ç : B Ç C) Æ (D Ç B Ç E) Æ ( : A Ç D Ç : E) A to false (A Ç : B Ç C) Æ (D Ç B Ç E) Æ ( : A Ç D Ç : E) ` ² Q E D I

How do formulas become T or F? Formula becomes true –when conjunction becomes empty Formula becomes false –when clause becomes empty ` ² Q E D I

Search tree (A Ç B) Æ (A Ç : B) ` ² Q E D I

Search tree (A Ç B) Æ (A Ç : B) ` ² Q E D I

Choice of literal matters C Æ (B Ç : C) Æ (A Ç : B) Æ : A ` ² Q E D I

Choice of literal matters C Æ (B Ç : C) Æ (A Ç : B) Æ : A ` ² Q E D I

Choice of literal matters C Æ (B Ç : C) Æ (A Ç : B) Æ : A ` ² Q E D I

Some heuristics for picking literal Pick literals that appear in unit clauses (called unit propagation) Pick literals that always appear in the same polarity (A or : A) C Æ (B Ç : C) Æ (A Ç : B) Æ : A (A Ç B) Æ (A Ç : B) Æ (C Ç B) Æ ( : C Ç : B) Why? Because of the following optimization: if literal is A, then pick A, don’t explore : A branch if literal is : A, then pick : A, don’t explore A branch ` ² Q E D I

Some heuristics for picking literal Pick literals for which the formula can be expressed as (R Ç A) Æ (Q Ç : A) Æ S –Can then merge both subtrees into just one subtree that checks (R Ç Q) Æ S These are just a few simple heuristics –Many other heuristics have been developed –Decades of research on this ` ² Q E D I

Extending backtracking search Let’s assume we also have equality with uninterpreted function symbols, for example: ( f(f(a)) = a Ç : (f(a) = f(b)) ) Æ ( a = b Æ f(a) = f(f(b)) ) Some observations –We can still simplify a formula based on a literal being T or F –But we can only simplify that literal –For instance, in the example above, once we’ve assumed a = b, how do we know that : (f(a) = f(b)) is false? ` ² Q I E D

Keep an environment ` ² Q I E D

` ² Q I E D

( f(f(a)) = a Ç : (f(a) = f(b)) ) Æ ( a = b Æ f(a) = f(f(b)) ) ` ² Q I E D

Keep an environment ( f(f(a)) = a Ç : (f(a) = f(b)) ) Æ ( a = b Æ f(a) = f(f(b)) ) ` ² Q I E D

Davis-Putnam paper Semi-algorithm for first-order logic Refutation based: negation formula, and show that formula is unsatisfiable Uses successive SAT instances ` ² Q E D I

Prenex normal form Prenex normal form: all quantifiers on the outside Some example conversions: – 8 x. P(x) Æ 8 x. Q(x) – 9 x.P(x) Ç 9 x. Q(x) – 8 x. P(x) Ç 8 x. Q(x) In general can convert any formula into prenex normal form (might possibly strengthen) ` ² E D I Q

Getting rid of existentials Replace existential with a function symbol that takes as parameters the enclosing universally quantified variables Transform: 8 x 1. 9 x 2. 8 x 3. 9 x 4 R(x 1, x 2,x 3,x 4 ) Into 8 x 1. 8 x 3. R(x 1, f 2 (x 1 ),x 3,f 4 (x 1, x 3 )) ` ² E D I Q

Herbrand’s universe of a formula Given a formula F, we call H F the Herbrand universe of the formula –All constants in F belong to H F (if F does not have constants, then H F includes a fresh constant a) –For any function symbol of arity n occurring in F, and for any t 1, …, t n belonging to H F, f(t 1, …, t n ) also belongs to H F –H F is the minimal set that satisfies these constraints ` ² E D I Q

Quantifier free lines Instantiate body of a formula F with elements of H F Suppose F = 8 x 1, x 2 R(x 1, f(x 1 ), x 2 ) H F = { a, f(a), f(f(a)), … } Quantifier free lines: –R(a, f(a), a) –R(a, f(a), f(a)) –R(f(a), f(f(a)), a) –… Each line is implied by original formula As a result, if the conjunction of some quantifier free lines is inconsistent, so is the original formula ` ² E D I Q

Quantifier free lines Each quantifier free line is implied by original formula As a result, if the conjunction of some quantifier free lines is inconsistent, so is the original formula If the conjunction of the first n quantifier free lines is consistent, for any n, then the original formula is consistent –Follows from the fact that an infinite set of quantifier- free formulas is inconsistent iff some finite subset is inconsistent ` ² E D I Q

Example 8 x. : P(x) Ç 9 x. P(x) ` ² E D I Q

Example 8 x. : P(x) Ç 9 x. P(x) ` ² E D I Q

ATP using Lazy Proof Explication a = b Æ ( : (f(a) = f(b)) Ç b = c) Æ : (f(a) = f(c)) ` ² Q E D I

ATP using Lazy Proof Explication a = b Æ ( : (f(a) = f(b)) Ç b = c) Æ : (f(a) = f(c)) Assign proxies: –x 1 Æ ( : x 2 Ç x 3 ) Æ : x 4 Use SAT solver: if SAT solver says unsatisfiable, then original formula is unsatisfiable ` ² Q E D I

ATP using Lazy Proof Explication In this case, say SAT solver comes back with x 1 set to true, and x 2, x 3, and x 4 set to false In the propositional world, this is a valid truth assignment But when considering the underlying meaning of the proxies, we notice that x 1 being true and x 2 being false is an inconsistency If the backtracking search is not aware of this, it will continue considering truth assignments with this same inconsistency (for example x 1 = x 3 = true, x 2 = x 4 = false) ` ² Q E D I

Key idea Have decision procedures return an explicating proof as to why the inconsistency occurred. –The new formula becomes: F Æ proof –The proof reflects the decision procedure’s knowledge back into the propositional world, and can then be used in the prop world to prune the search In the example, the proof is: a = b ) f(a) = f(b) ` ² Q E D I

Example continued Formula becomes: x 1 Æ ( : x 2 Ç x 3 ) Æ : x 4 Æ ( : x 1 Ç x 2 ) Note that SAT solver cannot find the original satisfying assignment (x 1 set to true, and x 2, x 3, and x 4 set to false) Nor can it come back with any assignment that has x 1 set to true and x 2 set to false ` ² Q E D I

Example continued So SAT solver comes back with: x 1, x 2, x 3 set to true, and x 4 set to false This assignment is also inconsistent when considering the underlying meaning of proxies Explicating proof: (a = b Æ b = c) ) f(a) = f(c) ` ² Q E D I

Example continued New formula: x 1 Æ ( : x 2 Ç x 3 ) Æ : x 4 Æ ( : x 1 Ç x 2 ) Æ ( : x 1 Ç : x 3 Ç x 4 ) SAT solver returns unsatisfiable, and so we know the original formula is unsatisfiable. ` ² Q E D I

Algorithm in more detail function satisfy(Formula F): Monome { while (true) “allocate proxy prop vars for atomic formulas in F, and create mapping  from proxies to atomic formulas” TruthAssignment A := SAT-solve(  -1 (F)); if (A = null) { // F is unsatisfiable return null } else Monome M :=  (A); Formula E := check(M); if (E = null) { // M is satisfiable, then so is F return M; } else { F := F Æ E; } ` ² Q E D I