1 Agenda Modeling problems in Propositional Logic SAT basics Decision heuristics Non-chronological Backtracking Learning with Conflict Clauses SAT and.

Slides:



Advertisements
Similar presentations
Exploiting SAT solvers in unbounded model checking
Advertisements

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
“Using Weighted MAX-SAT Engines to Solve MPE” -- by James D. Park Shuo (Olivia) Yang.
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.
CPSC 422, Lecture 21Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 21 Mar, 4, 2015 Slide credit: some slides adapted from Stuart.
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.
Review: Constraint Satisfaction Problems How is a CSP defined? How do we solve CSPs?
Generating Hard Satisfiability Problems1 Bart Selman, David Mitchell, Hector J. Levesque Presented by Xiaoxin Yin.
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:
© 2002 Fadi A. Aloul, University of Michigan PBS: A Pseudo-Boolean Solver and Optimizer Fadi A. Aloul, Arathi Ramani, Igor L. Markov, Karem A. Sakallah.
SAT-based Bounded Model Checking
Proof methods Proof methods divide into (roughly) two kinds: –Application of inference rules Legitimate (sound) generation of new sentences from old Proof.
Hrinking hrinking A signment tack tack. Agenda Introduction Algorithm Description Heuristics Experimental Results Conclusions.
Methods for SAT- a Survey Robert Glaubius CSCE 976 May 6, 2002.
Boolean Satisfiability Solvers Wonhong Nam
Heuristics for Efficient SAT Solving As implemented in GRASP, Chaff and GSAT.
Ryan Kinworthy 2/26/20031 Chapter 7- Local Search part 1 Ryan Kinworthy CSCE Advanced Constraint Processing.
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:
Algorithms in Exponential Time. Outline Backtracking Local Search Randomization: Reducing to a Polynomial-Time Case Randomization: Permuting the Evaluation.
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.
1 Linear-time Reductions of Resolution Proofs Omer Bar-Ilan Oded Fuhrmann Shlomo Hoory Ohad Shacham Ofer Strichman Technion.
Methods of Proof Chapter 7, second half.
GRASP SAT solver Presented by Constantinos Bartzis Slides borrowed from Pankaj Chauhan J. Marques-Silva and K. Sakallah.
SAT Algorithms in EDA Applications Mukul R. Prasad Dept. of Electrical Engineering & Computer Sciences University of California-Berkeley EE219B Seminar.
Randomzied Unique k-SAT R. Paturi, P. Pudlak, M.E. Saks and F. Zane An Improved Exponential-time Algorithm for k-SAT Journal of the ACM, Vol 52, No. 3,
Stochastic greedy local search Chapter 7 ICS-275 Spring 2007.
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)
1 Linear-time Reductions of Resolution Proofs Omer Bar-Ilan Oded Fuhrmann Shlomo Hoory Ohad Shacham Ofer Strichman Technion.
Boolean Satisfiability and SAT Solvers
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.
Solvers for the Problem of Boolean Satisfiability (SAT) Will Klieber Aug 31, 2011 TexPoint fonts used in EMF. Read the TexPoint manual before you.
Parallelizing MiniSat I-Ting Angelina Lee Justin Zhang May 05, Final Project Presentation.
S P Vimal, Department of CSIS, BITS, Pilani
On the Relation between SAT and BDDs for Equivalence Checking Sherief Reda Rolf Drechsler Alex Orailoglu Computer Science & Engineering Dept. University.
First-Order Logic and Inductive Logic Programming.
Boolean Satisfiability Present and Future
Review of Propositional Logic Syntax
Maximum Density Still Life Symmetries and Lazy Clause Generation Geoffrey Chu, Maria Garcia de la Banda, Chris Mears, Peter J. Stuckey.
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.
1 Propositional Logic Limits The expressive power of propositional logic is limited. The assumption is that everything can be expressed by simple facts.
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
SAT Solving As implemented in - DPLL solvers: GRASP, Chaff and
Inference in Propositional Logic (and Intro to SAT) CSE 473.
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:
Heuristics for Efficient SAT Solving As implemented in GRASP, Chaff and GSAT.
CS137: Electronic Design Automation
Inference in Propositional Logic (and Intro to SAT)
Inference and search for the propositional satisfiability problem
Parallelism in SAT Solvers
First-Order Logic and Inductive Logic Programming
Heuristics for Efficient SAT Solving
Decision Procedures An Algorithmic Point of View
Stronger learning and higher backjumping
Decision heuristics based on an Abstraction/Refinement model
GRASP-an efficient SAT solver
Presentation transcript:

1 Agenda Modeling problems in Propositional Logic SAT basics Decision heuristics Non-chronological Backtracking Learning with Conflict Clauses SAT and resolution More techniques: decision heuristics, deduction. Stochastic SAT solvers: the GSAT approach

2 Conflict clauses and Resolution Binary-resolution is a sound inference rule: Example:

3 Consider the following example: Conflict clause: c 5 : ( x 2 Ç : x 4 Ç x 10 ) We show that c 5 is inferred by resolution from c 1,…, c 4 Conflict clauses and resolution

4 Conflict clause: c 5 : ( x 2 Ç : x 4 Ç x 10 ) BCP 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

5 Applied to our example: Finding the conflict clause: cl is asserting the first UIP

6 Conflict clauses and resolution c2c2 c3c3 c4c4 c5c5 c1c1 This will be part of the (Hyper) Resolution Graph:

7 The resolution graph What is it good for ? Example: for computing an Unsatisfiable core [Picture Borrowed from Zhang, Malik SAT’03]

Minimizing the core The proof is not unique.  Different proofs / different cores. Can we find a minimum / minimal / smaller cores/proofs? 8

Minimizing the core Core compression [ZM03,…]…  Min-core-biased search [NRS’13] Proof compression:  Exponential-time transformations [GKS’06].  Linear time transformations “Recycle units” [BFHSS’08] 9

Core compression (smaller core) A basic approach: run until reaching a fixpoint [chaff] 10 SAT solver  core == last_core ? core last_core = core yes no initially last_core = ;

11 Remove an unmarked clause c 2  SAT(  ) ? mark c yes  := core no Initially  ’s clauses are unmarked Return  All marked Core compression (minimal core)

12 Proof compression Example of a linear-time transformation / “Recycle-units” Observation: When learning (resolving) a new clause in SAT,  The resolving clauses are not satisfied  Hence, the resolution-variable is unassigned l l 1 : l l 2 l 1 l 2

13 Example (cont’d) Suppose that the pivot’s constant value is learned later on. We will use it to simplify the resolution proof.

14 Recycle-units / easy case

15 Recycle-units / easy case

16 Recycle-units

17 Recycle-units Reduced proof by 4 clauses Reduced core by 2 clauses

18 Recycle-units / beware of cycles By making this connection we created cyclic reasoning

19 Recycle-units / beware of cycles Solution:  mark antecedents of units  apply only to unmarked nodes

20 Agenda Modeling problems in Propositional Logic SAT basics Decision heuristics Non-chronological Backtracking Learning with Conflict Clauses SAT and resolution More techniques: decision heuristics, deduction. Stochastic SAT solvers: the GSAT approach

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

22 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 heuristics VSIDS (cont ’ d)

23 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)

24 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.

25 Berkmin heuristic tail- first conflict clause

26 Deduction() allocates new implied variables and conflicts. How can this be done efficiently ? Observation: More than 90% of the time SAT solvers perform Deduction(). More engineering aspects of SAT solvers

27 Hold 2 counters for each clause  : val1 (  ) - # of negative literals assigned 0 in  + # of positive literals assigned 1 in . val0 (  ) - # of negative literals assigned 1 in  + # of positive literals assigned 0 in . Grasp implements Deduction() with counters

28 Every assignment to a variable x results in updating the counters for all the clauses that contain x. Grasp implements Deduction() with counters  is satisfied iff val1(  ) > 0  is unsatisfied iff val0(  ) = |  |  is unit iff val1(  ) = 0  val0(  ) = |  | - 1  is unresolved iff val1(  ) = 0  val0(  ) < |  | - 1. Backtracking: Same complexity.

29 Observation: during Deduction(), we are only interested in newly implied variables and conflicts. These occur only when the number of literals in  with value ‘ false ’ is greater than |  | - 2 Conclusion: no need to visit a clause unless (val0(  ) > |  | - 2)  How can this be implemented ? Chaff implements Deduction() with 2 observers

30 For each clause ¼, define two ‘ observers ’ : O1(  ), O2(  ). O1(  ) and O2(  ): two  literals which are not ‘ false ’.  is unit if updating one observer leads to O1(  ) = O2(  ). Visit clause  only if O1(  ) or O2(  ) become ‘ false ’. Chaff implements Deduction() with 2 observers

31 V[1]=0 V[5]=0, v[4]= 0 Unit clause Backtrack v[4] = v[5]= X v[1] = 1 Chaff implements Deduction() with 2 observers V[2]=0 O1O2

32 Complexity of Backtracking:  Observers of a unit clause are on the highest decision level present in the clause.  Hence backtracking will un-assign them first. Conclusion: when backtracking, observers stay in place. Chaff implements Deduction() with 2 observers

33 Chaff implements Deduction() with 2 observers Which observing literals?  Strategy: the least frequently updated variables The observers method has a learning curve  Initial observers: chosen arbitrarily.  Then: shifted from variables that were recently updated These variables will most probably be reassigned soon. In our example: the next time v[5] is updated, it will point to a significantly smaller set of clauses.

34 Agenda Modeling problems in Propositional Logic SAT basics Decision heuristics Non-chronological Backtracking Learning with Conflict Clauses SAT and resolution More techniques: decision heuristics, deduction. Stochastic SAT solvers: the GSAT approach

35 GSAT: stochastic SAT solving for i = 1 to max_tries { T := randomly generated truth assignment for j = 1 to max_flips { if T satisfies  return TRUE choose v s.t. flipping v’s value gives largest increase in the # of satisfied clauses (break ties randomly). T := T with v’s assignment flipped. } } Given a CNF formula , choose max_tries and max_flips Many alternative heuristics

36 Numerous progressing heuristics Hill-climbing Tabu-list Simulated-annealing Random-Walk Min-conflicts...

37 Improvement # 1: clause weights Initial weight of each clause: 1 Increase by k the weight of unsatisfied clauses. Choose v according to maximum increase in weight Clause weights is another example of conflict-driven decision strategy.

38 Improvement # 2: Averaging-in Q: Can we reuse information gathered in previous tries in order to speed up the search ? A: Yes! Rather than choosing T randomly each time, repeat ‘good assignments’ and choose randomly the rest.

39 Let X1, X2 and X3 be equally wide bit vectors. Define a function bit_average : X1  X2  X3 as follows: b 1 i b 1 i = b 2 i randomotherwise (where b j i is the i-th bit in Xj, j  {1,2,3}) b 3 i := Improvement # 2: Averaging-in

40 Notation: T i init : The initial assignment T in cycle i. T i best : The assignment with highest # of satisfied clauses in cycle i. T 1 init := random assignment. T 2 init := random assignment.  i > 2, T i init := bit_average(T i-1 best, T i-2 best ) Improvement # 2: Averaging-in