Efficient SAT Solving for Nonclausal Formulas using DPLL































- Slides: 31
Efficient SAT Solving for Nonclausal Formulas using DPLL, Graphs, and Watched-cuts Himanshu Jain Edmund M. Clarke
1 Agenda v. Motivation ¬Existing SAT solvers v. Our approach ¬Negation Normal Form (NNF) ¬Graphs to represent NNF ¬Boolean Constraint Propagation (BCP) ¬Experimental Results
2 Boolean Satisfiability v Applications in verification ¬Equivalence checking ¬Model checking ¬Theorem proving ¬Test generation ¬Static analysis output a b a b a Boolean Circuit b v Circuits in practice ¬Thousands of inputs ¬Millions of gates ¬Structure sharing
3 Current SAT solvers v Davis-Putnam-Logemann-Loveland (DPLL) algorithm ¬ Conversion of circuit to Conjunctive Normal Form (CNF) v Number of variables proportional to number of gates ¬ Can be 103 -104 times more than the number of inputs in a circuit ¬ Slowdown due to large number of new variables (and clauses) v Modern CNF solvers use pre-processing techniques ¬ To reduce #variables and #clauses in CNF ¬ But pre-processing has large memory requirements
Our SAT solving framework Boolean Circuit Negation Normal Form hpgraph vpgraph Fewer variables than CNF and more structure DPLL algorithm 4
Negation Normal Form (NNF) 5 a y a b y b An NNF formula contains arbitrary nesting of AND ( ) and OR ( ) gates - Negations can appear at leaf level - No sharing of sub formulas
6 How to obtain NNF from Boolean Circuits out a Circuit from converted to NNF by introducing one new variable y to remove sharing b a out b Boolean Circuit a b y y out’ a b y a b NNF a b y
7 Why NNF: Number of variables CNF without pre-processing has 5 -10 X more variables
8 Why NNF: Number of variables 428 points 1705 points Note no pre-processing for NNF
Our SAT solving framework Boolean Circuit Negation Normal Form hpgraph vpgraph Peter Andrew’s Horizontal/Vertical Path Forms (1981) DPLL algorithm 9
10 Inductively creating hpgraph( ) from NNF formula is a literal m = 1 2 m Create new node R 1 hpgraph( 1) L 1 R 2 hpgraph( 2) L 2 Take graph union R 1 hpgraph( 1) L 1 R 2 hpgraph( 2) Add hyperedge from L 1 to R 2 L 2
11 Example Formula F: (((p q) r q) ( p (r s) q)) horizontal path R p p q R r R q s r q hpgraph(F) L L L p q p p q r s p q q r p r r s r q q p q r s q q CNF(F) R denotes a root node and L denotes a leaf node
12 Example Formula F: (((p q) r q) ( p (r s) q)) vertical path R p r R R q p s r q q L L vpgraph(F) p r q q r q p s q DNF(F) R denotes a root node and L denotes a leaf node
Our SAT solving framework 13 Boolean Circuit Negation Normal Form Directed Acyclic Graphs (DAGs) Linear in size of original circuit hpgraph vpgraph CNF-like DPLL algorithm
14 DPLL on hpgraph Decisions hpgraph Boolean Constraint Propagation (BCP) engine Top-level DPLL Algorithm Conflicts, Implied Literals
15 Meaning of BCP on hpgraph Assignment 1 : ={r=1, p=1} p R p q r q L Assignment 2 : ={q=1, s=1} p s r q horizontal path = clause Conflict clause: r p r R p q q s r A horizontal path q Unit clause: q r s Implied literal: r L
16 Can we generalize the CNF watched literal scheme? Hpgraph R Horizontal path = clause p p q R r R q L s r q L L - Watch two literals (nodes) on each clause (path) - But exponential number of clauses (paths)!
Two Watched Cut Scheme 17 Hpgraph R p R watch a node cut R p q r q cut 1 L s r q L p q r s L cut 2 1. A node cut disconnects all horizontal paths 2. Watch two node cuts (allows observing two literals on each clause) 3. Minimal cuts (covered later)
Actual picture…. An hpgraph 1. Two cuts for each hpgraph component 2. Can be updated locally during BCP hpgraph components 3. Non-chronological backtracking is cheap 18
Our algorithm generalizes CNF watched literal scheme An hpgraph Special hpgraph (CNF) 19
20 Acceptable cut A cut is acceptable if no literal appearing in it is false R Cut 1 is: acceptable for : = {p=1} p p q R r R q cut 1 L s r q Cut 2 is: L not acceptable for : = {p=1} L cut 2 Now let us see the use of cuts during BCP
BCP Case 1: Both cuts are acceptable and disjoint Hpgraph component R : = {s=1} p p q R r R q cut 1 L s r q L L cut 2 No need to examine the hpgraph component Intuitively, there will be no conflicts or implied literals 21
BCP Case 2 (conflict): No acceptable cut Hpgraph component R : = {p=1, q=1} p p q R r R q L s r q Conflict clause: q p L L cut 2 cut 1 An hpgraph has no acceptable cut if and only if current assignment falsifies the formula 22
BCP Case 3 (Implications): Acceptable cuts but not disjoint 23 Hpgraph component p cut 1 For : = {p=1} we can find two acceptable cuts. p q r s r q q We cannot find two completely node-disjoint cuts cut 2 Intuitively nodes common to both cuts contain implied literals In our example r and q are implied literals.
24 Finding and Maintaining Minimal Cuts hpgraph component 1 R 2 p vpgraph component 3 p q 4 5 L s R r R q q 7 8 r 1 L R 6 L 2 p R 4 L r 3 R p q 5 s r q 7 minimal cut in hpgraph component = a path in vpgraph component q 8 L 6
25 Experimental Results v These techniques implemented in: ¬ NFLSAT (Non-clausal Formu. Las SATisfiability checker) v ~2500 Boolean circuits (industrial category) ¬ Bounded model checking, k-induction, SW/HW verification ¬ CNF obtained by adding new variables (one per AND gate in AIG) ¬ Timeout of 600 sec per problem v Comparing with state-of-the-art solvers ¬ SAT 2009 competition winners: Precosat, Glucose ¬ SAT-Race 2008 AIG track winners: Mini. SAT++, Picoaigersat ¬ Top three winners of SAT 2007 comp: RSAT, Mini. SAT, Pico. SAT
26 NFLSAT vs. Precosat y>x on 306 points NFLSAT solves 29 more problems x>y on 2018 points Total time: NFLSAT( 136000 sec), Precosat (193400 sec)
27 NFLSAT vs. Glucose y>x on 895 points NFLSAT solves 58 more problems x>y on 1382 points Total time: NFLSAT( 136000 sec), Glucose (185000 sec)
28 NFLSAT vs. Mini. SAT++ (AIG) Minisat++ solves 14 more problems Total time: NFLSAT( 105785 sec), Mini. SAT++ (103257 sec)
Summary Linear time conversion vpgraph BCP engine 29 Boolean Circuit 1. Other features of modern SAT solvers Negation Normal Form 2. No pre-processing so far (circuit rewriting applicable) hpgraph Clause Database Decisions Top-level DPLL Algorithm Conflicts, Implied Literals
30 Questions