SAT Solver Heuristics. SAT-solver History Started with David-Putnam-Logemann-Loveland (DPLL) (1962) –Able to solve 10-15 variable problems Satz (Chu Min.

Slides:



Advertisements
Similar presentations
Exploiting SAT solvers in unbounded model checking
Advertisements

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.
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.
IBM Labs in Haifa © 2005 IBM Corporation Adaptive Application of SAT Solving Techniques Ohad Shacham and Karen Yorav Presented by Sharon Barner.
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.
ECE 667 Synthesis & Verification - SAT 1 ECE 667 ECE 667 Synthesis and Verification of Digital Systems Boolean SAT CNF Representation Slides adopted (with.
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
1 Boolean Satisfiability in Electronic Design Automation (EDA ) By Kunal P. Ganeshpure.
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:
GRASP-an efficient SAT solver Pankaj Chauhan. 6/19/ : GRASP and Chaff2 What is SAT? Given a propositional formula in CNF, find an assignment.
Efficient SAT Solving for Non- clausal Formulas using DPLL, Graphs, and Watched-cuts Himanshu Jain Edmund M. Clarke.
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.
Search in the semantic domain. Some definitions atomic formula: smallest formula possible (no sub- formulas) literal: atomic formula or negation of an.
Last time Proof-system search ( ` ) Interpretation search ( ² ) Quantifiers Equality Decision procedures Induction Cross-cutting aspectsMain search strategy.
SAT Algorithms in EDA Applications Mukul R. Prasad Dept. of Electrical Engineering & Computer Sciences University of California-Berkeley EE219B Seminar.
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.
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)
SAT Solver Math Foundations of Computer Science. 2 Boolean Expressions  A Boolean expression is a Boolean function  Any Boolean function can be written.
Boolean Satisfiability and SAT Solvers
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.
Parallelizing MiniSat I-Ting Angelina Lee Justin Zhang May 05, Final Project Presentation.
Explorations in Artificial Intelligence Prof. Carla P. Gomes Module Logic Representations.
Boolean Satisfiability Present and Future
CPSC 422, Lecture 21Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 21 Oct, 30, 2015 Slide credit: some slides adapted from Stuart.
Nikolaj Bjørner Microsoft Research DTU Winter course January 2 nd 2012 Organized by Flemming Nielson & Hanne Riis Nielson.
Planning as Satisfiability (SAT-Plan). SAT-Plan Translate the planning problem into a satisfiability problem for length n of Plan garb 0 (proposition)present.
Heuristics for Efficient SAT Solving As implemented in GRASP, Chaff and GSAT.
Satisfiability and SAT Solvers CS 270 Math Foundations of CS Jeremy Johnson.
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.
A Decision-Making Procedure for Resolution-Based SAT-solvers Eugene Goldberg Cadence Research Labs (USA) SAT-2008, Guangzhou, P.R. China.
Knowledge Repn. & Reasoning Lecture #9: Propositional Logic UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2005.
Dynamic Backtracking for SAT Presented by: Phil Oertel April 6, 2004.
Heuristics for Efficient SAT Solving As implemented in GRASP, Chaff and GSAT.
SAT for Software Model Checking Introduction to SAT-problem for newbie
CS137: Electronic Design Automation
Inference and search for the propositional satisfiability problem
Bounded Model Checking
Recovering and Exploiting Structural Knowledge from CNF Formulas
Backtracking search: look-back
ECE 667 Synthesis and Verification of Digital Circuits
Decision Procedures An Algorithmic Point of View
GRASP-an efficient SAT solver
Presentation transcript:

SAT Solver Heuristics

SAT-solver History Started with David-Putnam-Logemann-Loveland (DPLL) (1962) –Able to solve variable problems Satz (Chu Min Li, 1995) –Able to solve some 1000 variable problems Chaff (Malik et al., 2001) –Intelligently hacked DPLL, Won the 2004 competitionthe 2004 competition –Able to solve some variable problems Current state-of-the-art –MiniSAT and SATELITEGTI (Chalmer’s university, ) –Jerusat and Haifasat (Intel Haifa, 2002) –Ace (UCLA, ) 2/28

MiniSAT MiniSat is a fast SAT solver developed by Niklas Eén an d Niklas Sörensson –MiniSat won all industrial categories in SAT 2005 competition –MiniSat won SAT-Race 2006 MiniSat is simple and well-documented –Well-defined interface for general use –Helpful implementation documents and comments –Minimal but efficient heuristic Main.C (344 lines) Solver.C (741 lines) 3/28

Overview (1/2) A set of propositional variables and CNF clauses involving variables –(x 1 v x 1 ’ v x 3 )  (x 2 v x 1 ’ v x 4 ) –x 1, x 2, x 3 and x 4 are variables (true or false) Literals: Variable and its negation –x 1 and x 1 ’ A clause is satisfied if one of the literals is true –x 1 =true satisfies clause 1 –x 1 =false satisfies clause 2 Solution: An assignment that satisfies all clauses 4/21

Overview (2/2) Unit clause is a clause in which all but one of literals is assigned to False Unit literal is the unassigned literal in a unit clause –(x 0 ) is a unit clause and ‘x 0 ’ is a unit literal –(-x 0 ∨ x 1 ) is a unit clause since x 0 has to be True –(-x 2 ∨ -x 3 ∨ -x 4 ) can be a unit clause if the current assignment is that x 3 and x 4 are True Boolean Constraint Propagation(BCP) is the process of assigning the True value to all unit literals 5/28 …… (x 0 )∧ (-x 0 ∨x 1 )∧ (-x 2 ∨-x 3 ∨-x 4 )∧ ……

DPLL Overview (1/3) 6/28 (p ∨ r) ∧ (  p ∨  q ∨ r) ∧ (p ∨  r) (T ∨ r) ∧ (  T ∨  q ∨ r) ∧ (T ∨  r)(F ∨ r) ∧ (  F ∨  q ∨ r) ∧ (F ∨  r) p=Tp=F q ∨ rq ∨ rr∧rr∧r SIMPLIFY

DPLL Overview (2/3) /* The Quest for Efficient Boolean Satisfiability Solvers * by L.Zhang and S.Malik, Computer Aided Verification 2002 */ DPLL(a formula Á, assignment) { necessary = deduction( Á, assignment); new_asgnment = union(necessary, assignment); if (is_satisfied( Á, new_asgnment)) return SATISFIABLE; else if (is_conflicting( Á, new_asgnmnt)) return UNSATISFIABLE; var = choose_free_variable( Á, new_asgnmnt); asgn1 = union(new_asgnmnt, assign(var, 1)); if (DPLL( Á, asgn1) == SATISFIABLE) return SATISFIABLE; else { asgn2 = union (new_asgnmnt, assign(var,0)); return DPLL ( Á, asgn2); } 7/28 Three techniques added t o modern SAT solvers 1.Learnt clauses 2.Non-chronological backtracking 3.Restart

DPLL Overview (3/3) /* overall structure of Minisat solve procedure */ Solve(){ while(true){ boolean_constraint_propagation(); if(no_conflict){ if(no_unassigned_variable) return SAT; make_decision(); }else{ if (no_decisions_made) return UNSAT; analyze_conflict(); undo_assignments(); add_conflict_clause(); } 8/28

Search Space for SAT Formula Á x1x1 x2x2 x2x2 x3x3 x3x3 x3x3 x4x4 x4x4 x4x4 x4x4 x4x4 x4x4 x3x3 x4x4 x4x4 TF asgn= {X 1 =T, X 2 =T, X 3 =F} Suppose that Á has 10,000 variables 10,000 levels 2 10,000 assignments (i.e., search space) asgn= {X 1 =T, X 2 =T, X 3 =T} Ordering x i ’s: VSIDS Pruning: Learnt clause Guiding: Restart, non-chronological back tracking TF TF

Conflict Clause Analysis (1/10) A conflict happens when one clause is falsified by unit propagation Analyze the conflicting clause to infer a clause –(-x 3 ∨ -x 2 ∨ -x 1 ) is conflicting clause The inferred clause is a new knowledge –A new learnt clause is added to constraints 10/28 Assume x 4 is False (x 1 ∨x 4 ) ∧ (-x 1 ∨x 2 ) ∧ (-x 2 ∨x 3 ) ∧ (-x 3 ∨-x 2 ∨-x 1 ) Falsified! Omitted clauses

Conflict Clause Analysis (2/10) Learnt clauses are inferred by conflict analysis They help prune future parts of the search space –Assigning False to x 4 is the casual of conflict –Adding (x 4 ) to constraints prohibit conflict from –x 4 Learnt clauses actually drive backtracking 11/28 (x 1 ∨x 4 ) ∧ (-x 1 ∨x 2 ) ∧ (-x 2 ∨x 3 ) ∧ (-x 3 ∨-x 2 ∨-x 1 ) ∧ omitted clauses ∧ (x 4 ) learnt clause

Conflict Clause Analysis (3/10) /* conflict analysis algorithm */ Analyze_conflict(){ cl = find_conflicting_clause(); /* Loop until cl is falsified and one literal whose value is determined in current decision level is remained */ While(!stop_criterion_met(cl)){ lit = choose_literal(cl); /* select the last propagated literal */ Var = variable_of_literal(lit); ante = antecedent(var); cl = resolve(cl, ante, var); } add_clause_to_database(cl); /* backtrack level is the lowest decision level for which the learnt clause is unit clause */ back_dl = clause_asserting_level(cl); return back_dl; } 12/28 Algorithm from Lintao Zhang and Sharad malik “The Quest for Efficient Boolean Satisfiability Solvers”

Conflict Clause Analysis (4/10) Example of conflict clause analysis –a, b, c, d, e, f, g, and h: 8 variables ( 2 8 cases) 13/28 (-f∨e) ∧ (-g∨f) ∧ (b∨a∨e) ∧ (c∨e∨f∨-b) ∧ (-h ∨ g) (d∨-b∨h) ∧ (-b∨-c∨-d) ∧ (c∨d) Satisfiable? Unsatisfiable?

Conflict Clause Analysis (5/10) Assignmentsantecedent e=F assumption f=F -f∨e g=F -g∨f h=F -h∨g a=F assumption b=T b∨a∨e c=T c∨e∨f∨-b d=T d∨-b∨h 14/28 e=F a=F -b∨-c∨-d Conflict DLevel=2 DLevel=1 Example slides are from CMU course ppt (-f∨e) ∧(-g∨f) ∧(b∨a∨e) ∧(c∨e∨f∨-b) ∧(-h ∨ g) ∧ (d∨-b∨h) ∧(-b∨-c∨-d)∧(c∨d)

Conflict Clause Analysis (6/10) 15/28 e=F a=F -b∨-c∨-d Assignmentsantecedent e=F assumption f=F -f∨e g=F -g∨f h=F -h∨g a=F assumption b=T b∨a∨e c=T c∨e∨f∨-b d=T d∨-b∨h DLevel=2 DLevel=1 (-f∨e) ∧(-g∨f) ∧(b∨a∨e) ∧(c∨e∨f∨-b) ∧(-h ∨ g) ∧ (d∨-b∨h) ∧(-b∨-c∨-d)∧(c∨d)

Resolution Resolution is a process to generate a clause from two clauses Given two clauses (x ∨ y) and (-y ∨ z), the resolvent of these two clauses is ( x ∨ z) –(x ∨ y) ∧ (-y ∨ z) is satisfiable iff (x ∨ y) ∧ (-y ∨ z) ∧ (x ∨ z) is satisfiable –The resolvent is redundant 16

Conflict Clause Analysis (7/10) 17/28 e=F a=F -b∨-c∨h (a resolvent of -b∨-c∨-d and d∨-b∨h) Assignmentsantecedent e=F assumption f=F -f∨e g=F -g∨f h=F -h∨g a=F assumption b=T b∨a∨e c=T c∨e∨f∨-b d=T d∨-b∨h DLevel=2 DLevel=1 (-f∨e) ∧(-g∨f) ∧(b∨a∨e) ∧(c∨e∨f∨-b) ∧(-h ∨ g) ∧ (d∨-b∨h) ∧(-b∨-c∨-d)∧(c∨d)

Conflict Clause Analysis (8/10) 18/28 e=F a=F -b∨-c∨h Assignmentsantecedent e=F assumption f=F -f∨e g=F -g∨f h=F -h∨g a=F assumption b=T b∨a∨e c=T c∨e∨f∨-b d=T d∨-b∨h DLevel=2 DLevel=1 (-f∨e) ∧(-g∨f) ∧(b∨a∨e) ∧(c∨e∨f∨-b) ∧(-h ∨ g) ∧ (d∨-b∨h) ∧(-b∨-c∨-d)∧(c∨d)

Conflict Clause Analysis (9/10) 19/28 e=F a=F -b∨e∨f∨h A final learnt clause since b is the only variable belonging to level 2 Assignmentsantecedent e=F assumption f=F -f∨e g=F -g∨f h=F -h∨g a=F assumption b=T b∨a∨e c=T c∨e∨f∨-b d=T d∨-b∨h DLevel=2 DLevel=1 (-f∨e) ∧(-g∨f) ∧(b∨a∨e) ∧(c∨e∨f∨-b) ∧(-h ∨ g) ∧ (d∨-b∨h) ∧(-b∨-c∨-d)∧(c∨d)

Conflict Clause Analysis (10/10) 20/28 e=F a=F -b∨-c∨-d -b∨-c∨h b=F -b∨e∨f∨h Assignmentsantecedent e=F assumption f=F -f∨e g=F -g∨f h=F -h∨g b=F -b∨e∨f∨h … … DLevel=1 New assign level 1 (-f∨e) ∧(-g∨f) ∧(b∨a∨e) ∧(c∨e∨f∨-b) ∧(-h ∨ g) ∧ (d∨-b∨h) ∧(-b∨-c∨-d)∧(c∨d)

Variable State Independent Decaying Sum(VSIDS) Decision heuristic to determine what variable will be assigned next Decision is independent from the current assignment of each variable VSIDS makes decisions based on activity –Activity is a literal occurrence count with higher weight on the more recently added clauses –MiniSAT does not consider any polarity in VSIDS Each variable, not literal has score 21/28 activity description from Lintao Zhang and Sharad malik “The Quest for Efficient Boolean Satisfiability Solvers”

VSIDS Decision Heuristic – MiniSAT style (1/8) Initially, the score for each variable is 0 First make a decision e = False –The order between the same score is unspecified. –MiniSAT always assigns False to variables. 22/28 Initial constraints (-f∨e) ∧ (-g∨f) ∧ (b∨a∨e) ∧ (c∨e∨f∨-b) ∧ (-h∨g) ∧ (d∨-b∨h) ∧ (-b∨-c∨-d) ∧ (c∨d) VariableScoreValue a0 b0 c0 d0 e0F f0 g0 h0

VSIDS Decision Heuristic (2/8) f, g, h are False after BCP 23/28 (-f∨e) ∧ (-g∨f) ∧ (b∨a∨e) ∧ (c∨e∨f∨-b) ∧ (-h∨g) ∧ (d∨-b∨h) ∧ (-b∨-c∨-d) ∧ (c∨d) VariableScoreValue a0 b0 c0 d0 e0F f0F g0F h0F

VSIDS Decision Heuristic (3/8) a is next decision variable 24/28 (-f∨e) ∧ (-g∨f) ∧ (b∨a∨e) ∧ (c∨e∨f∨-b) ∧ (-h∨g) ∧ (d∨-b∨h) ∧ (-b∨-c∨-d) ∧ (c∨d) VariableScoreValue a0F b0 c0 d0 e0F f0F g0F h0F

VSIDS Decision Heuristic (4/8) b, c are True after BCP Conflict occurs on variable d –Start conflict analysis 25/28 (-f∨e) ∧ (-g∨f) ∧ (b∨a∨e) ∧ (c∨e∨f∨-b) ∧ (-h∨g) ∧ (d∨-b∨h) ∧ (-b∨-c∨-d) ∧ (c∨d) VariableScoreValue a0F b0T c0T d0T e0F f0F g0F h0F

VSIDS Decision Heuristic (5/8) The score of variable in resolvents is increased by 1 –Even if a variable appears in resolvents two or mores increase the score just once 26/28 (-f∨e) ∧ (-g∨f) ∧ (b∨a∨e) ∧ (c∨e∨f∨-b) ∧ (-h∨g) ∧ (d∨-b∨h) ∧ (-b∨-c∨-d) ∧ (c∨d) VariableScoreValue a0F b1T c1T d0T e0F f0F g0F h1F Resolvent on d -b∨-c∨h

VSIDS Decision Heuristic (6/8) The end of conflict analysis The scores are decaying 5% for next scoring 27/28 (-f∨e) ∧ (-g∨f) ∧ (b∨a∨e) ∧ (c∨e∨f∨-b) ∧ (-h∨g) ∧ (d∨-b∨h) ∧ (-b∨-c∨-d) ∧ (c∨d) VariableScoreValue a0F b0.95T c T d0T e F f F g0F h F Resolvents -b∨-c∨h -b∨e∨f∨h  learnt clause

VSIDS Decision Heuristic (7/8) b is now False and a is True after BCP Next decision variable is c with 0.95 score 28/28 VariableScoreValue a0T b0.95F c d0 e F f F g0F h F (-f∨e) ∧ (-g∨f) ∧ (b∨a∨e) ∧ (c∨e∨f∨-b) ∧ (-h∨g) ∧ (d∨-b∨h) ∧ (-b∨-c∨-d) ∧ (c∨d) ∧ (-b∨e∨f∨h ) Learnt clause

VSIDS Decision Heuristic (8/8) Finally we find a model! 29/28 VariableScoreValue a0T b0.95F c F d0T e F f F g0F h F (-f∨e) ∧ (-g∨f) ∧ (b∨a∨e) ∧ (c∨e∨f∨-b) ∧ (-h∨g) ∧ (d∨-b∨h) ∧ (-b∨-c∨-d) ∧ (c∨d) ∧ (-b∨e∨f∨h ) Learnt clause