Title: Using Problem Structure for Efficient Clause Learning
1Using Problem Structure for Efficient Clause
Learning
- Ashish Sabharwal, Paul Beame, Henry Kautz
- University of Washington, Seattle
- April 23, 2003
2The SAT Approach
CNF encoding f
SAT solver
Input p 2 D
p Instance D Domain graph problem,
AI planning, model checking
f ? SAT
f ? SAT
p bad
p good
3Key Facts
- Problem instances typically have structure
- Graphs, precedence relations, cause and effects
- Translation to CNF flattens this structure
- Best complete SAT solvers are
- DPLL based clause learners branch and backtrack
- Critical Variable order used for branching
4Natural Questions
- Can we extract structure efficiently?
- In translation to CNF formula itself
- From CNF formula
- From higher level description
- How can we exploit this auxiliary information?
- Tweak SAT solver for each domain
- Tweak SAT solver to use general guidance
5Our Approach
CNF encoding f
Branching sequence
SAT solver
Input p 2 D
f ? SAT
f ? SAT
Encode structure as branching sequence
p bad
p good
6Related Work
- Exploiting structure in CNF formula
- GMT02 Dependent variables
- OGMS02 LSAT (blocked/redundant clauses)
- B01 Binary clauses
- AM00 Partition-based reasoning
- Exploiting domain knowledge
- S00 Model checking
- KS96 Planning (cause vars / effect vars)
7Our Result, Informally
Given a pebbling graph G, can efficiently
generate a branching sequence BG that
dramatically improves the performance of current
best SAT solvers on fG.
- Structure can be efficiently retrieved from
highlevel description (pebbling graph) - Branching sequence as auxiliary information can
be easily exploited
8Preliminaries CNF Formula
Conjunction of clauses
f (x1 OR x2 OR x9) AND (x3 OR x9)
AND (x1 OR x4 OR x5 OR x6)
9Preliminaries DPLL
- DPLL(CNF formula f)
- Simplify(f)
- If (conflict) return UNSAT
- If (all-vars-assigned) return SAT
assignment exit - Pick unassigned variable x
- Try DPLL(f x0), DPLL(f x1)
10Prelim Clause Learning
- DPLL Change if (conflict) return
UNSATto if (conflict)
learn conflict clause return UNSAT
x2 1, x3 0, x6 0 ) conflict
Learn (x2 OR x3 OR x6)
11Prelim Branching Sequence
- B (x1, x4, x3, x1, x8, x2, x4, x7, x1, x2)
- DPLL Change Pick unassigned var
xto Pick next literal x from B
delete it from B if x already assigned,
repeat - How good is B?
- Depends on backtracking process, learning scheme
Different from branching order
12Prelim Pebbling Formulas
Node E is pebbled if(e1 OR e2) 1
fG Pebbling(G) Source axioms A, B, C are
pebbled Pebbling axioms A and B are pebbled
) E is pebbled Target axioms T is not
pebbled
Target(s)
(t1 OR t2)
T
(e1 OR e2)
E
F
(f1)
A
B
C
(c1 OR c2 OR c3)
(a1 OR a2)
(b1 OR b2)
Sources
13Prelim Pebbling Formulas
- Can have
- Multiple targets
- Unbounded fanin
- Large clause labels
- Pebbling(G) is unsatisfiable
- Removing any clause from subgraph of each target
makes it satisfiable
14Grid vs. Randomized Pebbling
(n1 ? n2)
m1
(t1 ? t2)
l1
(h1 ? h2)
(h1 ? h2)
(i1 ? i2)
(i1 ? i2 ? i3 ? i4)
e1
f1
(e1 ? e2)
(g1 ? g2)
(f1 ? f2)
(d1 ? d2 ? d3)
(g1 ? g2)
(a1 ? a2)
(b1 ? b2)
(c1 ? c2)
(d1 ? d2)
(a1 ? a2)
b1
(c1 ? c2 ? c3)
15Why Pebbling?
- Practically useful
- precedence relations in tasks, fault propagation
in circuits, restricted planning problems - Theoretically interesting
- Used earlier for separating proof complexity
classes - Easy to analyze
- Hard for current best SAT solvers like zChaff
- Shown by our experiments
16Our Result, Again
Given a pebbling graph G, can efficiently
generate a branching sequence BG such that
zChaff(fG, BG) is empirically exponentially
faster than zChaff(fG).
- Efficient Q(fG)
- zChaff One of the current best SAT solvers
17The Algorithm
- Input
- Pebbling graph G
- Output
- Branching sequence BG, BG Q(fG), that
works well for 1UIP learning scheme and fast
backtrackingfG CNF encoding of pebbling(G)
18The Algorithm GenSeq(G)
- Compute node heights
- Foreach u 2 unit clause labeled nodes bottom up
- Add u to G.sources
- GenSubseq(u)
- Foreach t 2 targets bottom up
- GenSubseq(t)
19The Algorithm GenSubseq(v)
- // trivial wrapper
- If (v.preds gt 0)
- GenSubseq(v, v.preds)
20The Algorithm GenSubseq(v, i)
- u v.predsi // by increasing
height - if i1 // lowest pred
- GenSubseq(u) if unvisited non-source
- return
- Output u.labels // higher pred
- GenSubseq(u) if unvisitedHigh non-source
- GenSubseq(v, i-1) // recurse on i-1
- GenPattern(u, v, i-1) // repetitive pattern
21Results Grid Pebbling
- Pure DPLL upto 60 variables
- DPLL upto 60 variablesbranching seq
- Clause learning upto 4,000 variables(original
zChaff) - Clause learning upto 2,000,000 variables
branching seq
22Results Randomized Pebl.
- Pure DPLL upto 35 variables
- DPLL upto 50 variablesbranching seq
- Clause learning upto 350 variables(original
zChaff) - Clause learning upto 1,000,000 variables
branching seq
23Summary
- High level problem description is useful
- Domain knowledge can help SAT solvers
- Branching sequence
- One good way to encode structure
- Pebbling problems Proof of concept
- Can efficiently generate good branching sequence
- Structure use improves performance dramatically
24Open Problems
- Other domains?
- STRIPS planning problems (layered structure)
- Bounded model checking
- Variable ordering strategies from BDDs?
- Other ways of exploiting structure?
- branching order
- something to guide learning?
- Domain-based tweaking of SAT algorithms