GRASP-an efficient SAT solver

Slides:



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

Exploiting SAT solvers in unbounded model checking
Exploiting SAT solvers in unbounded model checking K. L. McMillan Cadence Berkeley Labs.
Automated Theorem Proving
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 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:
1 Constraint Satisfaction Problems A Quick Overview (based on AIMA book slides)
Introduction to MiniSat v1.14 Presented by Yunho Kim Provable Software Lab, KAIST.
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
Proofs from SAT Solvers Yeting Ge ACSys NYU Nov
Methods of Proof Chapter 7, second half.. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound)
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.
Properties of SLUR Formulae Ondřej Čepek, Petr Kučera, Václav Vlček Charles University in Prague SOFSEM 2012 January 23, 2012.
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:
ECE 667 Synthesis & Verification - SAT 1 ECE 667 ECE 667 Synthesis and Verification of Digital Systems Boolean SAT CNF Representation Slides adopted (with.
SAT-based Bounded Model Checking
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.
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.
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.
A Compressed Breadth-First Search for Satisfiability DoRon B. Motter and Igor L. Markov University of Michigan, Ann Arbor.
SAT Algorithms in EDA Applications Mukul R. Prasad Dept. of Electrical Engineering & Computer Sciences University of California-Berkeley EE219B Seminar.
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.
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.
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.
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.
© R.A. Rutenbar 2009 Slide 1 Carnegie Mellon (Lec 06) Boolean Satisfiability: SAT Solvers (Pt 1) What you know  Representation and manipulation via BDDs,
Heuristics for Efficient SAT Solving As implemented in GRASP, Chaff and GSAT.
CS137: Electronic Design Automation
Inference in Propositional Logic (and Intro to SAT)
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
Gábor Kusper University of Linz RISC Austria
First-Order Logic and Inductive Logic Programming
Introduction to Software Verification
Boolean Satisfiability in Electronic Design Automation
Logic Synthesis CNF Satisfiability.
Heuristics for Efficient SAT Solving
ECE 667 Synthesis and Verification of Digital Circuits
Logics for Data and Knowledge Representation
Unit Propagation and Variable Ordering in MiniSAT
Decision Procedures An Algorithmic Point of View
Unit Propagation and Variable Ordering in MiniSAT
Faster Extraction of High-Level Minimal Unsatisfiable Cores
Verifying Clausal Proofs, DRUPing and Interpolants SAT/SMT Seminar
Presentation transcript:

GRASP-an efficient SAT solver Pankaj Chauhan

SATisfying assignment! What is SAT? Given a propositional formula in CNF, find an assignment to boolean variables that makes the formula true! E.g. 1 = (x2  x3) 2 = (x1  x4) 3 = (x2  x4) A = {x1=0, x2=1, x3=0, x4=1} SATisfying assignment! 8/2/2019 15-398: GRASP and Chaff

What is SAT? Solution 1: Search through all assignments! n variables  2n possible assignments, explosion! SAT is a classic NP-Complete problem, solve SAT and P=NP! 8/2/2019 15-398: GRASP and Chaff

Why SAT? Fundamental problem from theoretical point of view Numerous applications CAD, VLSI Optimization Model Checking and other type of formal verification AI, planning, automated deduction 8/2/2019 15-398: GRASP and Chaff

Outline Terminology Basic Backtracking Search GRASP Pointers to future work Please interrupt me if anything is not clear! 8/2/2019 15-398: GRASP and Chaff

Terminology CNF formula  Assignment A x1,…, xn: n variables 1,…, m: m clauses Assignment A Set of (x,v(x)) pairs |A| < n  partial assignment {(x1,0), (x2,1), (x4,1)} |A| = n  complete assignment {(x1,0), (x2,1), (x3,0), (x4,1)} |A= 0  unsatisfying assignment {(x1,1), (x4,1)} |A= 1  satisfying assignment {(x1,0), (x2,1), (x4,1)} 1 = (x2  x3) 2 = (x1  x4) 3 = (x2  x4) A = {x1=0, x2=1, x3=0, x4=1} Manually write down the examples of all types of assignments For unsat, same as A but with x1=1 8/2/2019 15-398: GRASP and Chaff

Terminology Assignment A (contd.) |A= X  unresolved {(x1,0), (x2,0), (x4,1)} An assignment partitions the clause database into three classes Satisfied, unsatisfied, unresolved Free literals: unassigned literals of a clause Unit clause: #free literals = 1 8/2/2019 15-398: GRASP and Chaff

Basic Backtracking Search Organize the search in the form of a decision tree Each node is an assignment, called decision assignment Depth of the node in the decision tree  decision level (x) x=v@d  x is assigned to v at decision level d 8/2/2019 15-398: GRASP and Chaff

Basic Backtracking Search Iterate through: Make new decision assignments to explore new regions of search space Infer implied assignments by a deduction process. May lead to unsatisfied clauses, conflict! The assignment is called conflicting assignment. Conflicting assignments leads to backtrack to discard the search subspace 8/2/2019 15-398: GRASP and Chaff

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! 8/2/2019 15-398: GRASP and Chaff

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 x2 x2 = 0@2  x2 = 0@1  x3 = 1@1  x3 = 1@2 conflict {(x1,0), (x2,0), (x3,1)} 8/2/2019 15-398: GRASP and Chaff

Davis-Putnam revisited Deduction Decision Backtrack 8/2/2019 15-398: GRASP and Chaff

GRASP GRASP is Generalized seaRch Algorithm for the Satisfiability Problem (Silva, Sakallah, ’96) Features: Implication graphs for BCP and conflict analysis Learning of new clauses Non-chronological backtracking! 8/2/2019 15-398: GRASP and Chaff

GRASP search template 8/2/2019 15-398: GRASP and Chaff Decide: simple one, choose the one with most # of sat. clauses Deduce: do BCP Diagnose: do learning Erase: erase assignment at current decision level Search tree is maintained implicitly in procedure call stack 8/2/2019 15-398: GRASP and Chaff

GRASP Decision Heuristics Procedure decide() Choose the variable that satisfies the most #clauses == max occurences as unit clauses at current decision level Other possibilities exist 8/2/2019 15-398: GRASP and Chaff

GRASP Deduction Boolean Constraint Propagation using implication graphs E.g. for the clause  = (x  y), if y=1, then we must have x=1 For a variable x occuring in a clause , assignment 0 to all other literals is called antecedent assignment A(x) E.g. for  = (x  y  z), A(x) = {(y,0), (z,1)}, A(y) = {(x,0),(z,1)}, A(z) = {(x,0), (y,0)} Variables directly responsible for forcing the value of x Antecedent assignment of a decision variable is empty 8/2/2019 15-398: GRASP and Chaff

(x) = max{(y)|(y,v(y))A(x)} Implication Graphs Nodes are variable assignments x=v(x) (decision or implied) Predecessors of x are antecedent assignments A(x) No predecessors for decision assignments! Special conflict vertices have A() = assignments to vars in the unsatisfied clause Decision level for an implied assignment is (x) = max{(y)|(y,v(y))A(x)} Tell them it is assigned to each node in the search tree 8/2/2019 15-398: GRASP and Chaff

Example Implication Graph 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 8/2/2019 15-398: GRASP and Chaff

GRASP Deduction Process 8/2/2019 15-398: GRASP and Chaff

GRASP Conflict Analysis After a conflict arises, analyze the implication graph at current decision level Add new clauses that would prevent the occurrence of the same conflict in the future  Learning Determine decision level to backtrack to, might not be the immediate one  Non-chronological backtrack 8/2/2019 15-398: GRASP and Chaff

Learning Determine the assignment that caused the conflict, negation of this assignment is called conflict induced clause C() The conjunct of this assignment is necessary condition for  So adding C() will prevent the occurrence of  again 8/2/2019 15-398: GRASP and Chaff

Learning Find C() by a backward traversal of the IG, find the roots of the IG in the transitive fanin of  For our example IG, C() = (x1  x9  x10  x11) 8/2/2019 15-398: GRASP and Chaff

Learning (some math) For any node of an IG x, partition A(x) into (x) = {(y,v(y)) A(x)|(y)<(x)} (x) = {(y,v(y)) A(x)|(y)=(x)} Conflicting assignment AC() = causesof(), where (x,v(x)) if A(x) =  (x)  [  causesof(y) ]o/w (y,v(y))  (x) causesof(x) = 8/2/2019 15-398: GRASP and Chaff

Learning (some math) Deriving conflicting clause C() from the conflicting assignment AC() is straight forward For our IG, C() =  xv(x) (x,v(x))  AC() AC() = {x1=1@6, x9 =0@1, x10 = 0@3, x11 = 0@3} 8/2/2019 15-398: GRASP and Chaff

Learning Unique implication points (UIPs) of an IG also provide conflict clauses Learning of new clauses increases clause database size Heuristically delete clauses based on a user parameter If size of learned clause > parameter, don’t include it 8/2/2019 15-398: GRASP and Chaff

Backtracking Failure driven assertions (FDA): If C() involves current decision variable, then after addition, it becomes unit clause, so different assignment for the current variable is immediately tried. In our IG, after erasing the assignment at level 6, C() becomes a unit clause x1 This immediately implies x1=0 8/2/2019 15-398: GRASP and Chaff

Continued IG  ’ x1 ’ Decision level 3 x9=0@1 x8=1@6 C() 8 9 ’ x13=1@2 5 x1=0@6 C() 9 9 C() 7 x11=0@3 x7=1@6 x1 7 6 x12=1@2 Due to C()  ’ 8/2/2019 15-398: GRASP and Chaff

Backtracking Conflict Directed Backtracking Now deriving a new IG after setting x1=0 by FDA, we get another conflict ’ Non-chronological backtrack to decision level 3, because backtracking to any level 5, 4 would generate the same conflict ’ 8/2/2019 15-398: GRASP and Chaff

Backtracking Conflict Directed Backtracking contd. Backtrack level is given by  = d-1 chronological backtrack  < d-1 non-chronological backtrack AC(’) = {x9 =0@1, x10 = 0@3, x11 = 0@3, x12=1@2, x13=1@2} C() = (x9  x10  x11   x12   x13)  = max{(x)|(x,v(x))AC(’)} 8/2/2019 15-398: GRASP and Chaff

Procedure Diagnose() 8/2/2019 15-398: GRASP and Chaff

Is that all? Huge overhead for constraint propagation Better decision heuristics Better learning, problem specific Better engineering! Chaff 8/2/2019 15-398: GRASP and Chaff