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

Slides:



Advertisements
Similar presentations
Exploiting SAT solvers in unbounded model checking
Advertisements

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.
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
“Using Weighted MAX-SAT Engines to Solve MPE” -- by James D. Park Shuo (Olivia) Yang.
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.
Properties of SLUR Formulae Ondřej Čepek, Petr Kučera, Václav Vlček Charles University in Prague SOFSEM 2012 January 23, 2012.
© The McGraw-Hill Companies, Inc., Chapter 8 The Theory of NP-Completeness.
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
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.
A Compressed Breadth-First Search for Satisfiability DoRon B. Motter and Igor L. Markov University of Michigan, Ann Arbor.
Pruning techniques for the SAT-based Bounded Model-Checking problem Ofer Shtrichman Weizmann Institute of Science & IBM - HRL.
1 Abstraction Refinement for Bounded Model Checking Anubhav Gupta, CMU Ofer Strichman, Technion Highly Jet Lagged.
Artificial Intelligence Chapter 14 Resolution in the Propositional Calculus Artificial Intelligence Chapter 14 Resolution in the Propositional Calculus.
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.
SAT Solver Math Foundations of Computer Science. 2 Boolean Expressions  A Boolean expression is a Boolean function  Any Boolean function can be written.
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)
Parallelizing MiniSat I-Ting Angelina Lee Justin Zhang May 05, Final Project Presentation.
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.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View BDDs.
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.
Knowledge Repn. & Reasoning Lecture #9: Propositional Logic UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2005.
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
(xy)(yz)(xz)(zy)
A theory-based decision heuristic for DPLL(T)
ESE535: Electronic Design Automation
Heuristics for Efficient SAT Solving
ECE 667 Synthesis and Verification of Digital Circuits
Biointelligence Lab School of Computer Sci. & Eng.
Decision Procedures An Algorithmic Point of View
Decision heuristics based on an Abstraction/Refinement model
GRASP-an efficient SAT solver
Presentation transcript:

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

Decision Procedures An algorithmic point of view2 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 view3 Next: Deciding Propositional Formulas SAT solvers Binary Decision Diagrams

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

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

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

Decision Procedures An algorithmic point of view7 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 2 {0,1} is assigned to v at decision level d

Decision Procedures An algorithmic point of view8 Backtracking Search in Action  1 = (x 2  x 3 )  2 = (  x 1   x 4 )  3 = (  x 2  x 4 )  1 = (x 2  x 3 )  2 = (  x 1   x 4 )  3 = (  x 2  x 4 ) x 1 x 1 = {(x 1,0), (x 2,0), (x 3,1)} x 2 x 2 = {(x 1,1), (x 2,0), (x 3,1), (x 4,0)} x 1 =  x 3 =  x 4 =  x 2 =  x 3 = No backtrack in this example, regardless of the decision!

Decision Procedures An algorithmic point of view9 Backtracking Search in Action  1 = (x 2  x 3 )  2 = (  x 1   x 4 )  3 = (  x 2  x 4 )  4 = (  x 1  x 2   x 3 )  1 = (x 2  x 3 )  2 = (  x 1   x 4 )  3 = (  x 2  x 4 )  4 = (  x 1  x 2   x 3 ) Add a clause  x 4 =  x 2 =  x 3 = conflict {(x 1,0), (x 2,0), (x 3,1)} x 2 x 2 =  x 3 = x 1 = x 1 x 1 =

Decision Procedures An algorithmic point of view10 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 = ( x 1 Ç x 2 Ç x 3 ) x1x1 x2x2 x3x3 C 10Satisfied 000Unsatisfied 00Unit 0Unresolved

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

Decision Procedures An algorithmic point of view12 Compute for every clause  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 heuristics - JW Jeroslow-Wang method

Decision Procedures An algorithmic point of view13 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 view14 55 55 x 6 Implication graphs and learning: option #1  1 = (  x 1  x 2 )  2 = (  x 1  x 3  x 9 )  3 = (  x 2   x 3  x 4 )  4 = (  x 4  x 5  x 10 )  5 = (  x 4  x 6  x 11 )  6 = (  x 5   x 6 )  7 = (x 1  x 7   x 12 )  8 = (x 1  x 8 )  9 = (  x 7   x 8   x 13 )  1 = (  x 1  x 2 )  2 = (  x 1  x 3  x 9 )  3 = (  x 2   x 3  x 4 )  4 = (  x 4  x 5  x 10 )  5 = (  x 4  x 6  x 11 )  6 = (  x 5   x 6 )  7 = (x 1  x 7   x 12 )  8 = (x 1  x 8 )  9 = (  x 7   x 8   x 13 ) Current truth assignment: {x 9 10 x 11 x 12 x 13 Current decision assignment: {x 1 66 66  conflict x 9 x 1 x 10 x 11 x 5 44 44 22 22 x 3 11 x 2 33 33 x 4 We learn the conflict clause  10 : ( : x 1 Ç x 9 Ç x 11 Ç x 10 )

Decision Procedures An algorithmic point of view15 Implication graph, flipped assignment option #1 x 1 x 11 x 10 x 9 x 7 x 12 77 77 x 8 88  10 99 99 ’’ x 13 99 Due to the conflict clause  1 = (  x 1  x 2 )  2 = (  x 1  x 3  x 9 )  3 = (  x 2   x 3  x 4 )  4 = (  x 4  x 5  x 10 )  5 = (  x 4  x 6  x 11 )  6 = (  x 5  x 6 )  7 = (x 1  x 7   x 12 )  8 = (x 1  x 8 )  9 = (  x 7   x 8   x 13 )  10 : ( : x 1 Ç x 9 Ç x 11 Ç x 10 )  1 = (  x 1  x 2 )  2 = (  x 1  x 3  x 9 )  3 = (  x 2   x 3  x 4 )  4 = (  x 4  x 5  x 10 )  5 = (  x 4  x 6  x 11 )  6 = (  x 5  x 6 )  7 = (x 1  x 7   x 12 )  8 = (x 1  x 8 )  9 = (  x 7   x 8   x 13 )  10 : ( : x 1 Ç x 9 Ç x 11 Ç x 10 ) No decision here Another conflict clause:  11 : ( : x 13 Ç : x 12 Ç x 11 Ç x 10 Ç x 9 ) where should we backtrack to now ?

Decision Procedures An algorithmic point of view16 Non-chronological backtracking Non- chronological backtracking x ’’ Decision level Which assignments caused the conflicts ? x 9 = x 10 = x 11 = x 12 = x 13 = Backtrack to DL = 3 3 These assignments Are sufficient for Causing a conflict.

Decision Procedures An algorithmic point of view17 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 view18 Non-chronological Backtracking x 1 = 0 x 2 = 0 x 3 = 1 x 4 = 0 x 5 = 0 x 7 = 1 x 9 = 0 x 6 = 0... x 5 = 1 x 9 = 1 x 3 = 0

Decision Procedures An algorithmic point of view19 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: Ç l 2 L : l is a Conflict Clause. 55 55 x 6 66 66  conflict x 9 x 1 x 10 x 11 x 5 44 44 22 22 x 3 11 x 2 33 33 x 4 1. (x 10 Ç : x 1 Ç x 9 Ç x 11 ) 2. (x 10 Ç : x 4 Ç x 11 ) 3. (x 10 Ç : x 2 Ç : x 3 Ç x 11 )  1 2 3

Decision Procedures An algorithmic point of view20 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 view21 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 view22 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. 55 55 66 66  conflict 44 44 22 22 11 33 33 UIP

Decision Procedures An algorithmic point of view23 Conflict-driven backtracking (option #2) Conflict clause: ( x 10 Ç : x 4 Ç x 11 ) 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 x 10 x 11 x 4

Decision Procedures An algorithmic point of view24 Conflict-driven Non-chronological Backtracking x 1 = 0 x 2 = 0 x 3 = 1 x 4 = 0 x 5 = 0 x 5 = 1 x 7 = 1 x 3 = 1 x 9 = 0 x 9 = 1 x 6 = 0...

Decision Procedures An algorithmic point of view25 Decision Conflict Decision Level Time work invested in refuting x =1 (some of it seems wasted) C x =1 Refutation of x =1 C1C1 C5C5 C4C4 C3C3 C2C2 Progress of a SAT solver BCP

Decision Procedures An algorithmic point of view26 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 ).

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

Decision Procedures An algorithmic point of view28 Consider the following example: Conflict clause: c 5 : ( x 2 Ç : x 4 Ç x 10 ) Conflict clauses and resolution

Decision Procedures An algorithmic point of view29 Conflict clause: c 5 : ( x 2 Ç : x 4 Ç x 10 ) Resolution order: x 4, x 5, x 6, x 7  T1 = Res(c 4,c 3,x 7 ) = ( : x 5 Ç : x 6 )  T2 = Res(T1, c 2, x 6 ) = ( : x 4 Ç : x 5 Ç X 10 )  T3 = Res(T2,c 1,x 5 ) = (x 2 Ç : x 4 Ç x 10 ) Conflict clauses and resolution

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

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

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

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

Decision Procedures An algorithmic point of view34 (Implemented in Chaff) VSIDS (Variable State Independent Decaying Sum) Decision heuristics - VSIDS 1.Each variable in each polarity has a counter initialized to 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.

Decision Procedures An algorithmic point of view35 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 view36 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 heuristics VSIDS (cont’d)

Decision Procedures An algorithmic point of view37 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 view38 Berkmin heuristic tail- first conflict clause

Decision Procedures An algorithmic point of view39 The SAT competitions

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