Plan for today Proof-system search ( ` ) Interpretation search ( ² ) Quantifiers Equality Decision procedures Induction Cross-cutting aspectsMain search.

Slides:



Advertisements
Similar presentations
SMELS: Sat Modulo Equality with Lazy Superposition Christopher Lynch – Clarkson Duc-Khanh Tran - MPI.
Advertisements

Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
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
Artificial Intelligence
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.
We have seen that we can use Generalized Modus Ponens (GMP) combined with search to see if a fact is entailed from a Knowledge Base. Unfortunately, there.
13 Automated Reasoning 13.0 Introduction to Weak Methods in Theorem Proving 13.1 The General Problem Solver and Difference Tables 13.2 Resolution.
Logic.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View SAT.
What’s left in the course. The course in a nutshell Logics Techniques Applications.
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.
Nikolaj Bjørner Microsoft Research Lecture 3. DayTopicsLab 1Overview of SMT and applications. SAT solving, Z3 Encoding combinatorial problems with Z3.
1 Boolean Satisfiability in Electronic Design Automation (EDA ) By Kunal P. Ganeshpure.
1 Satisfiability Modulo Theories Sinan Hanay. 2 Boolean Satisfiability (SAT) Is there an assignment to the p 1, p 2, …, p n variables such that  evaluates.
Proof-system search ( ` ) Interpretation search ( ² ) Main search strategy DPLL Backtracking Incremental SAT Natural deduction Sequents Resolution Main.
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)
1 Deciding separation formulas with SAT Ofer Strichman Sanjit A. Seshia Randal E. Bryant School of Computer Science, Carnegie Mellon University.
Prof. Necula CS Lecture 121 Decision-Procedure Based Theorem Provers Tactic-Based Theorem Proving Inferring Loop Invariants CS Lecture 12.
Existential Graphs and Davis-Putnam April 3, 2002 Bram van Heuveln Department of Cognitive Science.
` ² Q E D I Nelson-Oppen review
The Simplify Theorem Prover Greg Nelson, Dave Detlefs and Jim Saxe Mooly Sagiv.
Search in the semantic domain. Some definitions atomic formula: smallest formula possible (no sub- formulas) literal: atomic formula or negation of an.
Some administrative stuff Class mailing list: –send to with the command “subscribe”
Administrative stuff On Thursday, we will start class at 11:10, and finish at 11:55 This means that each project will get a 10 minute presentation + 5.
Last time Proof-system search ( ` ) Interpretation search ( ² ) Quantifiers Equality Decision procedures Induction Cross-cutting aspectsMain search strategy.
Review: forward E { P } { P && E } TF { P && ! E } { P 1 } { P 2 } { P 1 || P 2 } x = E { P } { \exists … }
Artificial Intelligence
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.
1 A propositional world Ofer Strichman School of Computer Science, Carnegie Mellon University.
After today Week 9 –Tu: Pat Rondon –Th: Ravi/Nathan Week 10 –Tu: Nathan/Ravi –Th: Class canceled Finals week –Th: Zach, John.
Prof. Necula CS Lecture 111 Theorem Proving for FOL Satisfiability Procedures CS Lecture 11.
Course eval results More applications Last question –Luging: 0.5 –Curling: 1.5 –Figure skating: 2 –Ice fishing: 6.5 –Foosball: 0.5.
On Solving Presburger and Linear Arithmetic with SAT Ofer Strichman Carnegie Mellon University.
Going back to techniques Proof-system search ( ` ) Interpretation search ( ² ) Quantifiers Equality Decision procedures Induction Cross-cutting aspectsMain.
Ofer Strichman, Technion Deciding Combined Theories.
Daniel Kroening and Ofer Strichman 1 Decision Procedures in First Order Logic Decision Procedures for Equality Logic.
1 First order theories. 2 Satisfiability The classic SAT problem: given a propositional formula , is  satisfiable ? Example:  Let x 1,x 2 be propositional.
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 4: SMT-based Bounded Model Checking of Concurrent Software.
Deciding a Combination of Theories - Decision Procedure - Changki pswlab Combination of Theories Daniel Kroening, Ofer Strichman Presented by Changki.
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.
SAT and SMT solvers Ayrat Khalimov (based on Georg Hofferek‘s slides) AKDV 2014.
CHAPTERS 7, 8 Oliver Schulte Logical Inference: Through Proof to Truth.
Introduction to Satisfiability Modulo Theories
Slide 1 Propositional Definite Clause Logic: Syntax, Semantics and Bottom-up Proofs Jim Little UBC CS 322 – CSP October 20, 2014.
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
Unification Algorithm Input: a finite set Σ of simple expressions Output: a mgu for Σ (if Σ is unifiable) 1. Set k = 0 and  0 = . 2. If Σ  k is a singleton,
Automated Theorem Proving: Resolution and Davis-Putnam Intermediate Logic.
LDK R Logics for Data and Knowledge Representation Propositional Logic: Reasoning First version by Alessandro Agostini and Fausto Giunchiglia Second version.
Solving Non-linear Arithmetic Dejan Jovanovic and Leonadro de Moura Presented by Boris Trayvas.
CS6133 Software Specification and Verification
© 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.
1 First order theories (Chapter 1, Sections 1.4 – 1.5) From the slides for the book “Decision procedures” by D.Kroening and O.Strichman.
Daniel Kroening and Ofer Strichman Decision Procedures An Algorithmic Point of View Deciding Combined Theories.
Complexity 24-1 Complexity Andrei Bulatov Interactive Proofs.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View Basic Concepts and Background.
Selected Decision Procedures and Techniques for SMT More on combination – theories sharing sets – convex theory Un-interpreted function symbols (quantifier-free.
1 A framework for eager encoding Daniel Kroening ETH, Switzerland Ofer Strichman Technion, Israel (Executive summary) (submitted to: Formal Aspects of.
Deciding Combined Theories Presented by Adi Sosnovich Based on presentation from: Decision Procedures An Algorithmic Point of View Daniel Kroening and.
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:
Computer Systems Laboratory Stanford University Clark W. Barrett David L. Dill Aaron Stump A Framework for Cooperating Decision Procedures.
Daniel Kroening and Ofer Strichman 1 Decision Procedures in First Order Logic Decision Procedures for Equality Logic.
Satisfiability Modulo Theories and DPLL(T) Andrew Reynolds March 18, 2015.
Decision Procedures An Algorithmic Point of View
Presentation transcript:

Plan for today Proof-system search ( ` ) Interpretation search ( ² ) Quantifiers Equality Decision procedures Induction Cross-cutting aspectsMain search strategy 1. Recap example showing the integration of backtracking search, E-graph, and matching heuristic 2.Decision procedures

Plan for rest of the quarter Topics still left: –Search in the proof domain: 2 lectures –Equality part II (rewrite systems): 1 lecture –Constructive logic: 1 lecture –Automating induction: 1 lecture

A recap example define fact hasConstValue(X:Var,C:Const) with meaning « X == C ¬ if Æ currStmt == [X = Y] then transform to [X = C] if currStmt == [X = C] then if Æ currStmt == [Y = X] then

VC for the trans rule if Æ currStmt == [X = Y] then transform to [X = C] Show that if statements x := y and x := c are executed in a state where y == c, then the resulting states are the same.

VC for the trans rule Show that if statements x := y and x := c are executed in a state where y == c, then the resulting states are the same. Show: 8 x,y,c, .  [y] = c 8 v. step(x := y,  )[v] = step(x := c,  )[v] )

Background axioms Show: 8 x,y,c, .  [y] = c 8 v. step(x := y,  )[v] = step(x := c,  )[v] ) If a := k gets stepped in store , the resulting store is  with “a” updated to “k”. If a := b gets stepped in store , the resulting store is  with “a” updated to the value of “b”.

Background axioms Show: 8 x,y,c, .  [y] = c 8 v. step(x := y,  )[v] = step(x := c,  )[v] ) ` ² Q E D I Axioms: 8 a,k, . step(a := k,  ) = store( , a, k) 8 a,b, . step(a := b,  ) = store( , a,  [b])

Expand Axioms: 8 a,k, . step(a := k,  ) = store( , a, k) 8 a,b, . step(a := b,  ) = store( , a,  [b]) 8 x,y,c, .  [y] = c 8 v. step(x := y,  )[v] = step(x := c,  )[v] ) Show: ` ² Q E D I

Expand Ç : ) 8 x,y,c, .  [y] = c 8 v. step(x := y,  )[v] = step(x := c,  )[v] ` ² Q E D I

Skolemize Ç 8 x,y,c, .  [y] = c 8 v. step(x := y,  )[v] = step(x := c,  )[v] ` ² E D I Q :

Skolemize :  [y] = c Ç step(x := y,  )[v] = step(x := c,  )[v] ` ² E D I Q

Refutation Negate formula and show that the negation is unsatisfiable ` ² Q E D I :  [y] = c Ç step(x := y,  )[v] = step(x := c,  )[v]

Refutation Negate formula and show that the negation is unsatisfiable  [y] = c Æ step(x := y,  )[v]  step(x := c,  )[v] ` ² Q E D I

 [y] = c Æ step(x := y,  )[v]  step(x := c,  )[v] Exhaustive interpretation search L1L1 L2L2 ` Q E D I ²

L1L1 Æ L2L2 L1L1 T L2L2 F T F Trivially false ` Q E D I ² ?

Exhaustive interpretation search L1L1 Æ L2L2 L1L1 T L2L2 F T F Trivially false ` Q E D I ² Two ways to refute: Formula becomes trivially false Set of assumed literals is inconsistent Search Context ? L1L1 L2L2 ? ?

Exhaustive interpretation search L1L1 Æ L2L2 L1L1 T L2L2 F T F Search Context ` Q E D I ² L1L1 L2L2 ? ? ?  [y] = c step(x := y,  )[v]  step(x := c,  )[v] L1,L2,L1,L2,

Equality using E-graph  [y] = c step(x := y,  )[v]  step(x := c,  )[v] L1,L2,L1,L2, ` ² QD I E

Equality using E-graph  [y] c ` ² QD I E  [y] = c step(x := y,  )[v]  step(x := c,  )[v]

Equality using E-graph step(x := c,  ) select v ` ² QD I E  [y] = c step(x := y,  )[v]  step(x := c,  )[v]  [y] c

Equality using E-graph step(x := y,  ) select step(x := c,  ) select v ` ² QD I E  [y] c  [y] = c step(x := y,  )[v]  step(x := c,  )[v]

Equality using E-graph step(x := y,  ) select step(x := c,  ) select v  ` ² QD I E  [y] c  [y] = c step(x := y,  )[v]  step(x := c,  )[v]

Matching 8 a,k, . step(a := k,  ) = store( , a, k) Pick a trigger If trigger appears in E-graph, instantiate quantifier body step(x := c,  ) = store( , x, c) ` ² E D I Q  [y] c step(x := y,  ) select step(x := c,  ) select v 

8 a,k, . step(a := k,  ) = store( , a, k) 8 a,b, . step(a := b,  ) = store( , a,  [b]) Matching Pick a trigger If trigger appears in E-graph, instantiate quantifier body ` ² E D I Q  [y] c step(x := y,  ) select step(x := c,  ) select v 

Matching Pick a trigger If trigger appears in E-graph, instantiate quantifier body 8 a,b, . step(a := b,  ) = store( , a,  [b]) step(x := y,  ) = store( , x,  [y]) ` ² E D I Q  [y] c step(x := y,  ) select step(x := c,  ) select v 

Matching In summary, add: step(x := c,  ) = store( , x, c) step(x := y,  ) = store( , x,  [y]) step(x := y,  ) select step(x := c,  ) select  v ` ² E D I Q  [y] c

In summary, add: step(x := c,  ) = store( , x, c) step(x := y,  ) = store( , x,  [y]) step(x := y,  ) select step(x := c,  ) select  v ` ² E D I Q  [y] c

 x store In summary, add: step(x := c,  ) = store( , x, c) step(x := y,  ) = store( , x,  [y]) step(x := y,  ) select step(x := c,  ) select  v ` ² QD I E  [y] c

 x store c ` ² QD I E In summary, add: step(x := c,  ) = store( , x, c) step(x := y,  ) = store( , x,  [y]) step(x := y,  ) select step(x := c,  ) select  v

 x  [y] store c ` ² QD I E In summary, add: step(x := c,  ) = store( , x, c) step(x := y,  ) = store( , x,  [y]) step(x := y,  ) select step(x := c,  ) select  v

 x  [y] store c ` ² QD I E In summary, add: step(x := c,  ) = store( , x, c) step(x := y,  ) = store( , x,  [y]) step(x := y,  ) select step(x := c,  ) select  v

 x  [y] store c Compute congruence closure step(x := y,  ) select step(x := c,  ) select  v ` ² QD I E

Exhaustive Interpretation search L1L1 Æ L2L2 L1L1 T L2L2 F T F Search ` Q E D I ² Context L1L1 L2L2 ? ?  [y] = c step(x := y,  )[v]  step(x := c,  )[v] L1,L2,L1,L2,

Decision procedures

Decision procedures are complete algorithms for determining the validity of a formula in a given logic Decision procedures exist for many logics –EUF –Theory of lists –Theory of arrays –Theory of linear arithmetic over reals or integers –Theory of bit-vectors –…

Decision procedures Decision procedures can be used as standalone provers But we are more concerned with how decision procedures can be used within the context of a “heuristic” theorem prover –A heuristic theorem prover is a theorem prover for an undecidable logic that uses heuristics to guide its search –We use the term “heuristic” to avoid confusion between the larger heuristic prover and the decision procedures that are being integrated into this larger prover

Decision procedures Why incorporate decision procedures into a heuristic prover? Because once the search reaches a formula in a decidable subset of the original logic, the strategies of the heuristic prover may be inefficient and incomplete

Issues There are two issues to consider when incorporating decision procedures into a heuristic prover –Communication between decision procedures and the heuristic prover –Communication between decision procedures

In Simplify-- Communication between decision procedures –Don’t have to deal with this, because Simplify-- has only one decision procedure, namely EUF

In Simplify-- Communication form heuristic prover to decision procedures Communication from decision procedures to the heuristic prover

In Simplify-- Communication form heuristic prover to decision procedures –Push equalities into the E-graph incrementally Does not require the decision procedure to expose its internal details Communication from decision procedures to the heuristic prover –Matching heuristic looks into E-graph Motivation is to improve the heuristic of the prover For efficiency, expose details of the decision procedure’s data structures –Explicating proofs used to guide the backtracking search Motivation is efficiency

Issues again Communication between decision procedure and the heuristic prover –We’ve seen how this works in Simplify-- Communication between decision procedures –This is what’s next

Combining decision procedures Efficient decision procedures exist for many decidable logics, but some formulas do not belong to any of these logics Instead, they belong to a combination of these logics For example: if currStmt == [X = Y] then

Nelson-Oppen example x · y Æ y · x + car(cons(0,x)) Æ P(h(x) – h(y)) Æ : P(0)

Nelson-Oppen example x · y Æ y · x + car(cons(0,x)) Æ P(h(x) – h(y)) Æ : P(0)

Correctness If a contradiction is found, return UNSAT –This is clearly sound, if each decision procedure is sound If there are no more equalities to be found by any of the decision procedures, return SAT –Is this complete? Have the decision procedures exchanged enough info? –Each decision procedure has found its own satisfying assignments, but how do we know that these satisfying assignments are compatible (ie: don’t contradict each other)

Convex theories A theory is convex if whenever a satisfiable conjunction of literals entails a disjunction of equalities of variables, then it entails one of the equalities Example: –Theory of linear arithmetic with equalities For convex theories: –If no equalities can be found, then it is impossible for there to be a disjunction of equalities that can be found; therefore, no missed equalities

Nonconvex theories Example: –Reals under multiplication xy = 0 Æ z = 0 entails x = z Ç y = z –Integers under + and · x = 1 Æ y = 2 Æ 1 · z Æ z · 2 entails x = z Ç y = z –Theory of sets –Theory of arrays For such theories, must perform a case split when a disjunction of equalities is entailed –Try each disjunct recusively. –If any one returns SAT, return SAT –If all disjuncts return UNSAT, return UNSAT

Algorithm Given a formula F that is a conjunction of literals over theories S and T, returns whether F is SAT or UNSAT 1.Assign conjunctions to F S and F T so that F S is a conjunction of S-literals and F T is a conjunction of T-literals 2.If either F S or F T is unsatisfiable, return UNSAT 3.If either F S or F T entails some equality between variables not entailed by the other, then add the equality as a new conjunct to the one that does not entail it. Goto step 2. 4.If either F S or F T entails a disjunction x 1 Ç … x k of equalities between variables, then for each i from 1 to k, apply the procedure recursively to F S Æ F T Æ x i. If any recursive call returns SAT, return SAT. Otherwise return UNSAT. 5.Return SAT

Adding Nelson-Oppen to Simplify-- Each decision procedure keeps track of its own information Decision procedure for theory T exports a function assert(F), where F is a literal in T While performing the backtracking search, if a literal is asserted, add that literal (using assert) to the decision procedure for the theory the literal belongs to –If the literal belongs to a combination of theories, split the literal into a conjunction of literals, each one belonging to only one theory

Adding Nelson-Oppen to Simplify-- Calling assert on a decision procedure may cause a whole bunch of equalities to be propagated, all of which are added to the E- graph Case splitting falls naturally out of the backtracking search algorithm –If a disjunction of equalities is implied in one of the decision procedures, then add the disjunction as a new clause in the current formula

Example xy = 0 Æ z = 0 Æ f(f(x) – f(z))  f(z) Æ f(f(y) – f(z))  f(z)

Example xy = 0 Æ z = 0 Æ f(f(x) – f(z))  f(z) Æ f(f(y) – f(z))  f(z)