Decision Procedures An Algorithmic Point of View

Slides:



Advertisements
Similar presentations
Automated abstraction refinement II Heuristic aspects Ken McMillan Cadence Berkeley Labs.
Advertisements

The behavior of SAT solvers in model checking applications K. L. McMillan Cadence Berkeley Labs.
Exploiting SAT solvers in unbounded model checking
Exploiting SAT solvers in unbounded model checking K. L. McMillan Cadence Berkeley Labs.
Automated Theorem Proving
The Project Problem formulation (one page) Literature review –“Related work" section of final paper, –Go to writing center, –Present paper(s) to class.
Chaff: Engineering an Efficient SAT Solver Matthew W.Moskewicz, Concor F. Madigan, Ying Zhao, Lintao Zhang, Sharad Malik Princeton University Modified.
Presented by Monissa Mohan 1.  A highly optimized BCP algorithm  Two watched literals  Fast Backtracking  Efficient Decision Heuristic  Focused on.
Chaff: Engineering an Efficient SAT Solver Matthew W.Moskewicz, Concor F. Madigan, Ying Zhao, Lintao Zhang, Sharad Malik Princeton University Presenting:
Introduction to MiniSat v1.14 Presented by Yunho Kim Provable Software Lab, KAIST.
UIUC CS 497: Section EA Lecture #2 Reasoning in Artificial Intelligence Professor: Eyal Amir Spring Semester 2004.
Proofs from SAT Solvers Yeting Ge ACSys NYU Nov
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View SAT.
Heuristics for Efficient SAT Solving As implemented in GRASP, Chaff and GSAT.
1/30 SAT Solver Changki PSWLAB SAT Solver Daniel Kroening, Ofer Strichman.
Abstract Answer Set Solver. Todolist Print the rules of Fig 1.
SAT and Model Checking. Bounded Model Checking (BMC) A.I. Planning problems: can we reach a desired state in k steps? Verification of safety properties:
SAT-based Bounded Model Checking
Proof-based Abstraction Presented by Roman Gershman Ken McMillan, Nina Amla.
Boolean Satisfiability Solvers Wonhong Nam
Heuristics for Efficient SAT Solving As implemented in GRASP, Chaff and GSAT.
Penn ESE 535 Spring DeHon 1 ESE535: Electronic Design Automation Day 6: February 4, 2009 Modern SAT Solvers ({z}Chaff, GRASP,miniSAT)
Presented by Ed Clarke Slides borrowed from P. Chauhan and C. Bartzis
Chaff: Engineering an Efficient SAT Solver Matthew W.Moskewicz, Concor F. Madigan, Ying Zhao, Lintao Zhang, Sharad Malik Princeton University Presenting:
Ofer Strichman, Technion 1 Decision Procedures in First Order Logic Part I - Introduction.
GRASP-an efficient SAT solver Pankaj Chauhan. 6/19/ : GRASP and Chaff2 What is SAT? Given a propositional formula in CNF, find an assignment.
GRASP SAT solver Presented by Constantinos Bartzis Slides borrowed from Pankaj Chauhan J. Marques-Silva and K. Sakallah.
1 A theory-based decision heuristic for DPLL(T) Dan Goldwasser Ofer Strichman Shai Fine Haifa university TechnionIBM-HRL.
1 Abstraction Refinement for Bounded Model Checking Anubhav Gupta, CMU Ofer Strichman, Technion Highly Jet Lagged.
SAT Solving Presented by Avi Yadgar. The SAT Problem Given a Boolean formula, look for assignment A for such that.  A is a solution for. A partial assignment.
Penn ESE 535 Spring DeHon 1 ESE535: Electronic Design Automation Day 21: April 21, 2008 Modern SAT Solvers ({z}Chaff, GRASP,miniSAT)
Daniel Kroening and Ofer Strichman 1 Decision Procedures in First Order Logic Decision Procedures for Equality Logic.
Binary Decision Diagrams (BDDs)
Boolean Satisfiability and SAT Solvers
Quantified Formulas - Decision Procedure Daniel Kroening, Ofer Strichman Presented by Changki Hong 07 NOV 08.
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 Agenda Modeling problems in Propositional Logic SAT basics Decision heuristics Non-chronological Backtracking Learning with Conflict Clauses SAT and.
Penn ESE 535 Spring DeHon 1 ESE535: Electronic Design Automation Day 18: April 1, 2015 Modern SAT Solvers ({z}Chaff, GRASP, miniSAT)
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View BDDs.
On the Relation between SAT and BDDs for Equivalence Checking Sherief Reda Rolf Drechsler Alex Orailoglu Computer Science & Engineering Dept. University.
Boolean Satisfiability Present and Future
SAT Solver Heuristics. SAT-solver History Started with David-Putnam-Logemann-Loveland (DPLL) (1962) –Able to solve variable problems Satz (Chu Min.
Heuristics for Efficient SAT Solving As implemented in GRASP, Chaff and GSAT.
SAT Solving As implemented in - DPLL solvers: GRASP, Chaff and
Inference in Propositional Logic (and Intro to SAT) CSE 473.
1 Boolean Satisfiability (SAT) Class Presentation By Girish Paladugu.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View Basic Concepts and Background.
Daniel Kroening and Ofer Strichman 1 Decision Procedures in First Order Logic Decision Procedures for Equality Logic.
Heuristics for Efficient SAT Solving As implemented in GRASP, Chaff and GSAT.
Decision Procedures in First Order Logic
CS137: Electronic Design Automation
Inference in Propositional Logic (and Intro to SAT)
Gábor Kusper University of Linz RISC Austria
Resolution in the Propositional Calculus
A theory-based decision heuristic for DPLL(T)
Logic Synthesis CNF Satisfiability.
ESE535: Electronic Design Automation
Heuristics for Efficient SAT Solving
ECE 667 Synthesis and Verification of Digital Circuits
Logics for Data and Knowledge Representation
Biointelligence Lab School of Computer Sci. & Eng.
Unit Propagation and Variable Ordering in MiniSAT
Unit Propagation and Variable Ordering in MiniSAT
Biointelligence Lab School of Computer Sci. & Eng.
Canonical Computation without Canonical Data Structure
Decision heuristics based on an Abstraction/Refinement model
GRASP-an efficient SAT solver
Faster Extraction of High-Level Minimal Unsatisfiable Cores
Presentation transcript:

Decision Procedures An Algorithmic Point of View SAT Daniel Kroening and Ofer Strichman

Decision Procedures An algorithmic point of view Part I Reminders - What is Logic Proofs by deduction Proofs by enumeration Decidability, Soundness and Completeness some notes on Propositional Logic Deciding Propositional Logic SAT tools BDDs       Decision Procedures An algorithmic point of view

Next: Deciding Propositional Formulas SAT solvers Binary Decision Diagrams Decision Procedures An algorithmic point of view

Decision Procedures An algorithmic point of view A Basic SAT algorithm Given  in CNF: (x,y,z),(-x,y),(-y,z),(-x,-y,-z)  X  Decide() BCP() Resolve_Conflict() Decision Procedures An algorithmic point of view

SAT made some progress… Decision Procedures An algorithmic point of view

A Basic SAT algorithm While (true) { if (!Decide()) return (SAT); Choose the next variable and value. Return False if all variables are assigned While (true) { if (!Decide()) return (SAT); while (!BCP()) if (!Resolve_Conflict()) return (UNSAT); } Apply repeatedly the unit clause rule. Return False if reached a conflict Backtrack until no conflict. Return False if impossible Decision Procedures An algorithmic point of view

Basic Backtracking Search Organize the search in the form of a decision tree Each node corresponds to a decision Definition: Decision Level (DL) is the depth of the node in the decision tree. Notation: x=v@d x 2 {0,1} is assigned to v at decision level d Decision Procedures An algorithmic point of view

Backtracking Search in Action 1 = (x2  x3) 2 = (x1  x4) 3 = (x2  x4) x1 x1 = 0@1 x2 x2 = 0@2 x1 = 1@1  x4 = 0@1  x2 = 0@1 Say which step is which.  x3 = 1@1  x3 = 1@2 {(x1,1), (x2,0), (x3,1) , (x4,0)} {(x1,0), (x2,0), (x3,1)} No backtrack in this example, regardless of the decision! Decision Procedures An algorithmic point of view

Backtracking Search in Action Add a clause 1 = (x2  x3) 2 = (x1  x4) 3 = (x2  x4) 4 = (x1  x2  x3) x1 x1 = 1@1 x1 = 0@1  x4 = 0@1 {(x1,0), (x2,0), (x3,1)} x2 x2 = 0@2  x3 = 1@2  x2 = 0@1  x3 = 1@1 conflict Decision Procedures An algorithmic point of view

Decision Procedures An algorithmic point of view Status of a clause A clause can be Satisfied: at least one literal is satisfied Unsatisfied: all literals are assigned but non are satisfied Unit: all but one literals are assigned but none are satisfied Unresolved: all other cases Example: C = (x1 Ç x2 Ç x3) x1 x2 x3 C 1 Satisfied Unsatisfied Unit Unresolved Decision Procedures An algorithmic point of view

Decision Procedures An algorithmic point of view Decision heuristics - DLIS DLIS (Dynamic Largest Individual Sum) – choose the assignment that increases the most the number of satisfied clauses For a given variable x: Cxp – # unresolved clauses in which x appears positively Cxn - # unresolved clauses in which x appears negatively Let x be the literal for which Cxp is maximal Let y be the literal for which Cyn is maximal If Cxp > Cyn choose x and assign it TRUE Otherwise choose y and assign it FALSE Requires l (#literals) queries for each decision. Decision Procedures An algorithmic point of view

Decision Procedures An algorithmic point of view Decision heuristics - JW Jeroslow-Wang method Compute for every clause w and every variable l (in each phase): J(l) := Choose a variable l that maximizes J(l). This gives an exponentially higher weight to literals in shorter clauses. Decision Procedures An algorithmic point of view

Decision Procedures An algorithmic point of view Pause... We will see other (more advanced) decision Heuristics soon. These heuristics are integrated with a mechanism called Learning with Conflict-Clauses, which we will learn next. Decision Procedures An algorithmic point of view

Implication graphs and learning: option #1 Current truth assignment: {x9=0@1 ,x10=0@3, x11=0@3, x12=1@2, x13=1@2} Current decision assignment: {x1=1@6} x10=0@3 1 = (x1  x2) 2 = (x1  x3  x9) 3 = (x2  x3  x4) 4 = (x4  x5  x10) 5 = (x4  x6  x11) 6 = (x5   x6) 7 = (x1  x7  x12) 8 = (x1 x8) 9 = (x7  x8   x13) x5=1@6 4 1 x2=1@6 3 x4=1@6 6  conflict x1=1@6 2 x3=1@6 5 x6=1@6 x9=0@1 x11=0@3 We learn the conflict clause 10 : (: x1 Ç x9 Ç x11 Ç x10) Decision Procedures An algorithmic point of view

Implication graph, flipped assignment option #1 9 ’ x13=1@2 x9=0@1 x8=1@6 8 1 = (x1  x2) 2 = (x1  x3  x9) 3 = (x2  x3  x4) 4 = (x4  x5  x10) 5 = (x4  x6  x11) 6 = (x5  x6) 7 = (x1  x7  x12) 8 = (x1 x8) 9 = (x7  x8   x13) 10 : (: x1 Ç x9 Ç x11 Ç x10) 10 x10=0@3 x1=0@6 10 x7=1@6 x12=1@2 7 10 x11=0@3 Due to the conflict clause No decision here Another conflict clause:11: (:x13 Ç :x12 Ç x11 Ç x10 Ç x9) where should we backtrack to now ? Decision Procedures An algorithmic point of view

Non-chronological backtracking 3 Decision level Which assignments caused the conflicts ? x9= 0@1 x10= 0@3 x11= 0@3 x12= 1@2 x13= 1@2 Backtrack to DL = 3 4 5 These assignments Are sufficient for Causing a conflict. x1 6  ’ Non-chronological backtracking Decision Procedures An algorithmic point of view

Non-chronological backtracking So the rule is: backtrack to the largest decision level in the conflict clause. This works for both the initial conflict and the conflict after the flip. Q: What if the flipped assignment works? A: Change the decision retroactively. Decision Procedures An algorithmic point of view

Non-chronological Backtracking x1 = 0 x2 = 0 x3 = 1 x3 = 0 x4 = 0 x6 = 0 Here without implications ... x5 = 0 x5 = 1 x7 = 1 x9 = 0 x9 = 1 Decision Procedures An algorithmic point of view

Decision Procedures An algorithmic point of view More Conflict Clauses Def: A Conflict Clause is any clause implied by the formula Let L be a set of literals labeling nodes that form a cut in the implication graph, separating the conflict node from the roots. Claim: Çl2L:l is a Conflict Clause. 1. (x10 Ç :x1 Ç x9 Ç x11) x10=0@3 2 1 x5=1@6 4 3 1 x2=1@6 2. (x10 Ç :x4 Ç x11) 3 x4=1@6 6  conflict x1=1@6 3. (x10 Ç :x2 Ç :x3 Ç x11) 2 x3=1@6 5 x6=1@6  x9=0@1 x11=0@3 Decision Procedures An algorithmic point of view

Decision Procedures An algorithmic point of view Conflict clauses How many clauses should we add ? If not all, then which ones ? Shorter ones ? Check their influence on the backtracking level ? The most “influential” ? Decision Procedures An algorithmic point of view

Decision Procedures An algorithmic point of view Conflict clauses Def: An Asserting Clause is a Conflict Clause with a single literal from the current decision level. Backtracking (to the right level) makes it a Unit clause. Asserting clauses are those that force an immediate change in the search path. Modern solvers only consider Asserting Clauses. Decision Procedures An algorithmic point of view

Unique Implication Points (UIP’s) Definition: A Unique Implication Point (UIP) is an internal node in the Implication Graph that all paths from the decision to the conflict node go through it. The First-UIP is the closest UIP to the conflict. 4 1 4 UIP 3 UIP 6  conflict 3 2 5 2 5 Decision Procedures An algorithmic point of view

Conflict-driven backtracking (option #2) Conflict clause: (x10 Ç :x4 Ç x11) With standard Non-Chronological Backtracking we backtracked to DL = 6. Conflict-driven Backtrack: backtrack to the second highest decision level in the clause (without erasing it). In this case, to DL = 3. Q: why?  conflict x10=0@3 x11=0@3 x4=1@6 Answers: already in decision level 3 x4=0 is implied. Why is it better ? because the new clause changes the decision heuristic’s decision. So we want to give it a fresh start from DL = 3, and not get stuck with decisions and implications that were made before we had the knowledge on the conflict. Decision Procedures An algorithmic point of view

Conflict-driven Non-chronological Backtracking x1 = 0 x2 = 0 x3 = 1 x5 = 1 x4 = 0 x7 = 1 x9 = 1 x5 = 0 x3 = 1 x9 = 0 x6 = 0 ... Decision Procedures An algorithmic point of view

Progress of a SAT solver work invested in refuting x=1 (some of it seems wasted) C x=1 Refutation of x=1 C5 C2 Decision Level C1 C4 BCP C3 Decision Time Conflict Decision Procedures An algorithmic point of view

Conflict-Driven Backtracking So the rule is: backtrack to the second highest decision level dl, but do not erase it. This way the literal with the currently highest decision level will be implied in DL = dl. Q: what if the conflict clause has a single literal ? For example, from (xÇ :y) Æ (x Ç y) and decision x=0, we learn the conflict clause (x). Answer: we jump to level 0. This is clear, because \neg x is not a consequence of any other decision. Decision Procedures An algorithmic point of view

Conflict clauses and Resolution The Binary-resolution is a sound inference rule: Example: Decision Procedures An algorithmic point of view

Conflict clauses and resolution Consider the following example: Conflict clause: c5: (x2 Ç :x4 Ç x10) Decision Procedures An algorithmic point of view

Conflict clauses and resolution Conflict clause: c5: (x2 Ç :x4 Ç x10) Resolution order: x4,x5,x6,x7 T1 = Res(c4,c3,x7) = (:x5 Ç :x6) T2 = Res(T1, c2, x6) = (:x4 Ç :x5 Ç X10 ) T3 = Res(T2,c1,x5) = (x2 Ç :x4 Ç x10 ) Decision Procedures An algorithmic point of view

Finding the conflict clause: cl is asserting the first UIP Applied to our example: Decision Procedures An algorithmic point of view

The Resolution-Graph keeps track of the “inference relation” 5 6  conflict 4 2 1 3 Resolution Graph 1 2 3 10 4 11 9 5 10 8 7 9 ’ conflict 10 9 6 8 10 7 9 7 Decision Procedures An algorithmic point of view

Decision Procedures An algorithmic point of view The resolution graph What is it good for ? Example: for computing an Unsatisfiable core [Picture Borrowed from Zhang, Malik SAT’03] Decision Procedures An algorithmic point of view

Resolution graph: example Empty clause Inferred clauses learning Original clauses L : Unsatisfiable core

Decision Procedures An algorithmic point of view Decision heuristics - VSIDS VSIDS (Variable State Independent Decaying Sum) Each variable in each polarity has a counter initialized to 0. 2. When a clause is added, the counters are updated. 3. The unassigned variable with the highest counter is chosen. 4. Periodically, all the counters are divided by a constant. (Implemented in Chaff) Decision Procedures An algorithmic point of view

Decision heuristics – VSIDS (cont’d) Chaff holds a list of unassigned variables sorted by the counter value. Updates are needed only when adding conflict clauses. Thus - decision is made in constant time. Decision Procedures An algorithmic point of view

Decision Procedures An algorithmic point of view Decision heuristics VSIDS (cont’d) VSIDS is a ‘quasi-static’ strategy: - static because it doesn’t depend on current assignment - dynamic because it gradually changes. Variables that appear in recent conflicts have higher priority. This strategy is a conflict-driven decision strategy. “..employing this strategy dramatically (i.e. an order of magnitude) improved performance ... “ Decision Procedures An algorithmic point of view

Decision Heuristics - Berkmin Keep conflict clauses in a stack Choose the first unresolved clause in the stack If there is no such clause, use VSIDS Choose from this clause a variable + value according to some scoring (e.g. VSIDS) This gives absolute priority to conflicts. Decision Procedures An algorithmic point of view

Decision Procedures An algorithmic point of view Berkmin heuristic tail- first conflict clause Berkmin satisfies all the clauses until c. This is the current abstract model M of formula f. After a conflict, Berkmin retreats with a new conflict clause. When it comes back and satisfies again all clauses until c, it creates a refinement of M. Decision Procedures An algorithmic point of view

Decision Procedures An algorithmic point of view The SAT competitions Decision Procedures An algorithmic point of view

Decision Procedures An algorithmic point of view End of SAT (for now) Beginning of Binary Decision Diagrams Decision Procedures An algorithmic point of view