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