Chaff: Engineering an Efficient SAT Solver Matthew W.Moskewicz, Concor F. Madigan, Ying Zhao, Lintao Zhang, Sharad Malik Princeton University Presenting:

Slides:



Advertisements
Similar presentations
Exploiting SAT solvers in unbounded model checking
Advertisements

Hybrid BDD and All-SAT Method for Model Checking Orna Grumberg Joint work with Assaf Schuster and Avi Yadgar Technion – Israel Institute of Technology.
The Quest for Efficient Boolean Satisfiability Solvers Sharad Malik Princeton University.
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.
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.
IBM Labs in Haifa © 2005 IBM Corporation Adaptive Application of SAT Solving Techniques Ohad Shacham and Karen Yorav Presented by Sharon Barner.
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:
© 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
Authors: Lucas Bordeaux, Youssef Hamadi & Lintao Zhang
Hrinking hrinking A signment tack tack. Agenda Introduction Algorithm Description Heuristics Experimental Results Conclusions.
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
GRASP-an efficient SAT solver Pankaj Chauhan. 6/19/ : GRASP and Chaff2 What is SAT? Given a propositional formula in CNF, find an assignment.
State-of-the-art in SAT solvers
GRASP SAT solver Presented by Constantinos Bartzis Slides borrowed from Pankaj Chauhan J. Marques-Silva and K. Sakallah.
Efficient Reachability Checking using Sequential SAT G. Parthasarathy, M. K. Iyer, K.-T.Cheng, Li. C. Wang Department of ECE University of California –
Search in the semantic domain. Some definitions atomic formula: smallest formula possible (no sub- formulas) literal: atomic formula or negation of an.
A Compressed Breadth-First Search for Satisfiability DoRon B. Motter and Igor L. Markov University of Michigan, Ann Arbor.
Last time Proof-system search ( ` ) Interpretation search ( ² ) Quantifiers Equality Decision procedures Induction Cross-cutting aspectsMain search strategy.
MiniSAT: World fastest SAT solver (2005 and 2006) Niklas Sorensson, Niklas Een and Armin Biere Some slides are from Niklas Sorensson presentation Presented.
1 Abstraction Refinement for Bounded Model Checking Anubhav Gupta, CMU Ofer Strichman, Technion Highly Jet Lagged.
ENGG3190 Logic Synthesis “Boolean Satisfiability” Winter 2014 S. Areibi School of Engineering University of Guelph.
GRASP: A Search Algorithm for Propositional Satisfiability EE878C Homework #2 2002/11/1 KAIST, EECS ICS Lab Lee, Dongsoo.
The Quest for Efficient Boolean Satisfiability Solvers
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)
/425 Declarative Methods - J. Eisner1 Satisfiability Solvers Part 1: Systematic Solvers.
Boolean Satisfiability and SAT Solvers
Constrainedness Including slides from Toby Walsh.
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.
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
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.
SAT Solving As implemented in - DPLL solvers: GRASP, Chaff and
1 Boolean Satisfiability (SAT) Class Presentation By Girish Paladugu.
Dynamic Backtracking for SAT Presented by: Phil Oertel April 6, 2004.
Heuristics for Efficient SAT Solving As implemented in GRASP, Chaff and GSAT.
The Quest for Efficient Boolean Satisfiability Solvers Sharad Malik Princeton University.
CS137: Electronic Design Automation
Hybrid BDD and All-SAT Method for Model Checking
Clause Learning in a SAT-Solver
Inference and search for the propositional satisfiability problem
Bounded Model Checking
SAT’07 Conference, Lisbon;
Watched Literals and Restarts in MiniSAT
ESE535: Electronic Design Automation
Heuristics for Efficient SAT Solving
ECE 667 Synthesis and Verification of Digital Circuits
Unit Propagation and Variable Ordering in MiniSAT
Decision Procedures An Algorithmic Point of View
Unit Propagation and Variable Ordering in MiniSAT
Satisfiability Solvers
Watched Literals and Restarts in MiniSAT
GRASP-an efficient SAT solver
Presentation transcript:

Chaff: Engineering an Efficient SAT Solver Matthew W.Moskewicz, Concor F. Madigan, Ying Zhao, Lintao Zhang, Sharad Malik Princeton University Presenting: Tamir Heyman Some are from Malik’s presentation

Chaff Philosophy Make the core operations fast profiling driven, most time-consuming parts: Boolean Constraint Propagation (BCP) and Decision Emphasis on coding efficiency Emphasis on optimizing data cache behavior Search space pruning: conflict resolution and learning

Chaff’s Main Procedures Efficient BCP Two watched literals Fast backtracking Efficient decision heuristic Localizes search space Restart Increases robustness

Implication What “causes” an implication? When can it occur? All literals in a clause but one are assigned to False

Implication example The clause (v1 + v2 + v3) implies values only in the following cases In case (F + F + v3) implies v3=T In case (F + v2 + F) implies v2=T In case (v1 + F + F) implies v1=T

Implication for N-literal clause Implication occurs after N-1 assignments to False to its literals Theoretically, we could ignore the first N-2 assignments to this clause The first N-2 assignments won’t have any effect on the BCP

Watched Literals Each clause has two watched literals Ignore any assignments to the other literals in the clause. BCP Maintains the following invariant By the end of BCP, one of the watched literal is true or both are undefined. Guaranteed to find all implications

BCP with watched Literals Identifying conflict clauses Identifying unit clauses Identifying associated implications Maintaining “BCP Invariant”

Example (1/13) v2 + v3 + v1 + v4 v1 + v2 + v3’ v1 + v2’ v1’+ v4

Example (2/13) v2v3 v2 + v3 + v1 + v4 v1v2 v1 + v2 + v3’ v1 + v2’ v1’+ v4 Watched literals

Example (3/13) v2v3 v2 + v3 + v1 + v4 v1v2 v1 + v2 + v3’ v1 + v2’ v1’+ v4 Stack:(v1=F) Assume we decide to set v1 the value F

Example (4/13) v2v3 v2 + v3 + v1 + v4 v1v2 v1 + v2 + v3’ v1 + v2’ v1’+ v4 Ignore clauses with a watched literal whose value is T. Stack:(v1=F)

Example (5/13) v2v3 v2 + v3 + v1 + v4 v1v2 v1 + v2 + v3’ v1 + v2’ v1’+ v4 Ignore clauses where neither watched literal value changes Stack:(v1=F)

Example (6/13) v2v3 v2 + v3 + v1 + v4 v1v2 v1 + v2 + v3’ v1 + v2’ v1’+ v4 Examine clauses with a watched literal whose value is F Stack:(v1=F)

Example (7/13) v2v3 v2 + v3 + v1 + v4 v2 v1 + v2 + v3’ v1 + v2’ v1’+ v4 Stack:(v1=F) In the second clause, replace the watched literal v1 with v3’ v2v3 v2 + v3 + v1 + v4 v1v2 v1 + v2 + v3’ v1 + v2’ v1’+ v4 Stack:(v1=F)

Example (8/13) v2v3 v2 + v3 + v1 + v4 v2 v1 + v2 + v3’ v1 + v2’ v1’+ v4 Stack:(v1=F) The third clause is a unit and implies v2=F We record the new implication, and add it to a queue of assignments to process. v2v3 v2 + v3 + v1 + v4 v1v2 v1 + v2 + v3’ v1 + v2’ v1’+ v4 Stack:(v1=F) Pending: (v2=F)

Example (9/13) v2 + v3 + v1 + v4 v1 + v2 + v3’ v1 + v2’ v1’+ v4 Stack:(v1=F, v2=F) Next, we process v2. We only examine the first 2 clauses v2 + v3 + v1 + v4 v1 + v2 + v3’ v1 + v2’ v1’+ v4 Stack:(v1=F, v2=F) Pending: (v3=F)

Example (10/13) v2 + v3 + v1 + v4 v1 + v2 + v3’ v1 + v2’ v1’+ v4 Stack:(v1=F, v2=F) In the first clause, we replace v2 with v4 The second clause is a unit and implies v3=F We record the new implication, and add it to the queue v2 + v3 + v1 + v4 v1 + v2 + v3’ v1 + v2’ v1’+ v4 Stack:(v1=F, v2=F) Pending: (v3=F)

Example (11/13) v2 + v3 + v1 + v4 v1 + v2 + v3’ v1 + v2’ v1’+ v4 Stack:(v1=F, v2=F, v3=F) Next, we process v3’. We only examine the first clause. v2 + v3 + v1 + v4 v1 + v2 + v3’ v1 + v2’ v1’+ v4 Stack:(v1=F, v2=F, v3=F) Pending: ()

Example (12/13) v2 + v3 + v1 + v4 v1 + v2 + v3’ v1 + v2’ v1’+ v4 Stack:(v1=F, v2=F, v3=F) The first clause is a unit and implies v4=T. We record the new implication, and add it to the queue. v2 + v3 + v1 + v4 v1 + v2 + v3’ v1 + v2’ v1’+ v4 Stack:(v1=F, v2=F, v3=F) Pending: (v4=T)

Example (13/13) Stack:(v1=F, v2=F, v3=F, v4=T) There are no pending assignments, and no conflict Therefore, BCP terminates and so does the SAT solver v2 + v3 + v1 + v4 v1 + v2 + v3’ v1 + v2’ v1’+ v4

Identify conflicts Stack:(v1=F, v2=F, v3=F) What if the first clause does not have v4? When processing v3’, we examine the first clause. This time, there is no alternative literal to watch. BCP returns a conflict v2 + v3 + v1 v1 + v2 + v3’ v1 + v2’ v1’+ v4

Backtrack Stack:() We do not need to move any watched literal v2 + v3 + v1 v1 + v2 + v3’ v1 + v2’ v1’+ v4

BCP Summary During forward progress (decisions, implications) Examine clauses where watched literal is set to F Ignore clauses with assignments of literals to T Ignore clauses with assignments to non-watched literals

Backtrack Summary Unwind Assignment Stack No action is applied to the watched literals Overall Minimize clause access

Chaff Decision Heuristic VSIDS Variable State Independent Decaying Sum Rank variables based on literal count in the initial clause database. Only increment counts as new clauses are added. Periodically, divide all counts by a constant.

VSIDS Example (1/2) Initial data base x1 + x4 x1 + x3’ + x8’ x1 + x8 + x12 x2 + x11 x7’ + x3’ + x9 x7’ + x8 + x9’ x7 + x8 + x10’ Scores: 4: x8 3: x1,x7 2: x3 1: x2,x4,x9,x10,x11,x12 New clause added x1 + x4 x1 + x3’ + x8’ x1 + x8 + x12 x2 + x11 x7’ + x3’ + x9 x7’ + x8 + x9’ x7 + x8 + x10’ x7 + x10 + x12’ Scores: 4: x8,x7 3: x1 2: x3,x10,x12 1: x2,x4,x9,x11 watch what happens to x8, x7 and x1

VSIDS Example (2/2) Counters divided by 2 x1 + x4 x1 + x3’ + x8’ x1 + x8 + x12 x2 + x11 x7’ + x3’ + x9 x7’ + x8 + x9’ x7 + x8 + x10’ x7 + x10 + x12’ Scores: 2: x8,x7 1: x3,x10,x12,x1 0: x2,x4,x9,x11 New clause added x1 + x4 x1 + x3’ + x8’ x1 + x8 + x12 x2 + x11 x7’ + x3’ + x9 x7’ + x8 + x9’ x7 + x8 + x10’ x7 + x10 + x12’ x12’ + x10 Scores: 2: x8,x7,x12,x10 1: x3,x1 0: x2,x4,x9,x11 watch what happens to x8, x10

VSIDS - Summary Quasi-static: Static because it is independent of variable values Not static because it gradually changes as new clauses are added Decay causes bias toward *recent* conflicts. Use heap to find an unassigned variable with the highest ranking

Interplay of BCP and the Decision Heuristic This is only an intuitive description … Reality depends heavily on specific instances Take some variable ranking Assume several decisions are made Say v2=T, v7=F, v9=T, v1=T (and any implications thereof)

Interplay of BCP and the Decision Heuristic (cont’) Then a conflict is encountered and forces v2=F The next decisions may still be v7=F, v9=T, v1=T VSIDS variable ranks change slowly… But the BCP engine has recently processed these assignments … so these variables are unlikely to still be watched.

Interplay of BCP and the Decision Heuristic (cont’) In a more general sense The more “active” a variable is, the more likely it is to *not* be watched. Because BCP is likely to replace it

Interplay of Learning and the Decision Heuristic Again, this is an intuitive description … Learned clauses capture relationships between variables Decision heuristic influences which variables appear in learned clauses Decisions → implications → conflicts → learned clause

Interplay of Learning and the Decision Heuristic (cont’) Important for decisions to keep the search strongly localized Especially when there are 100k variables! In VSIDS, learned clauses bias decision strategy Focusing in a smaller set of variables

Restart Abandon the current search tree and reconstruct a new one Helps reduce runtime variance between instances- adds to robustness of the solver The clauses learned prior to the restart are still there after the restart and can help pruning the search space

TimeLine 1986 BDD  100 var 1992 GSAT  300 var 1996 Stålmarck  1000 var 1996 GRASP  1k var 1960 DP  10 var 1988 SOCRATES  3k var 1994 Hannibal  3k var 1962 DLL  10 var 2001 Chaff  10k var 1996 SATO  1k var