Title: QBF Modeling: Exploiting Player Symmetry for Simplicity and Efficiency
1QBF Modeling Exploiting Player Symmetry for
Simplicity and Efficiency
- Ashish Sabharwal, Carlos Ansotegui,Carla P.
Gomes, Justin W. Hart, Bart Selman - Cornell University
- SAT Conference, August 2006
- Seattle, WA
2The Goal of This Work
- To significantly extend the reach of QBF
reasoning by - Investigating and improving basic modeling
framework - Retaining the benefits of CNF for SAT/QBF solvers
- E.g., must avoid higher level representations
- Maintaining (or enhancing) simplicity of
representation - Our driving force
- Real-World Reasoning Program
- A set of challenging QBF benchmarks
- With many quantifier alternations
- Encoding a hard adversarial task chess-style end
games
3Our Contribution
- We propose a simple but fundamental change in the
way problems are modeled as QBF instances, and
solved. - A systematic modeling technique based on a game
theoretic view and SAT-based planning ideas - A split CNF-DNF dual encoding (existential player
modeled as CNF, universal player as DNF) - A new QBF solver Duaffle (dual-Quaffle)
- 2 orders of magnitude improvement through
- Better propagation across quantifiers
- Avoidance of illegal search space issue
- Simpler encoding w.r.t. previous approaches
4Roadmap of the Talk
FourKey Challenges
The Basicsof QBF
Our ApproachFrom problem to ? games?
dual representation? dual solver
Summary
ExperimentalResults
5Roadmap of the Talk
FourKey Challenges
The Basicsof QBF
Our ApproachFrom problem to ? games?
dual representation? dual solver
Summary
ExperimentalResults
6SAT, QBF, CNF, and DNF
- F a Boolean formula
- e.g. F (a or b) and (not (a and (b or
c))) - 3 satisfying assignments (a,b,c) (1,0,0),
(0,1,0), (0,1,1) - F in CNF FCNF (a or b) and (?a or ?b) and
(b or ?c) - F in DNF FDNF (?a and b) or (a and ?b and
?c) - SAT Does F have any satisfying assignments?
- NP-complete for FCNF, trivial for FDNF
- QBF Is a given (totally) quantified Boolean
formula True? - e.g. G ?a,b ?c. (a or b) and (not (a and (b
or c))) - GCNF ?a,b ?c. FCNF, GDNF ?a,b ?c. FDNF
- In general, an unbounded number of quantifier
layers - PSPACE-complete for both CNF and DNF forms
7CNF Format and SAT
- Many good reasons to use the CNF format for SAT
- Fairly natural representation
- Many problems are a conjunction of several
constraints - Each constraint in itself is often simple and
easy to satisfy - Efficient pruning of unsat. parts of the search
space - Violation of any single constraint by a partial
assignment can be detected immediately - Simplicity
- Lends itself easily to clever techniques and data
structures(e.g. watched literals, conflict
graph, ) - Provides a clear uniform standard
8Is CNF Equally Good for QBF?
- Many advantages
- SAT techniques carry over to QBF(encoder
format, clause learning, unit propagation,
watched literals, restarts, ) - Can quickly extend existing SAT solvers to QBF
solvers(search both assignments for universal
variables) - This approach led to the first QBF solvers based
on DPLL, local search, Q-resolution, etc.
So far so good. The problem? Modern SAT solvers
scale very well (1M variables),but modern QBF
solvers dont! (10 K vars)
9The Message
Assuming CNF is a good modeling language for
SAT, a split CNF-DNF representation is the right
format for QBF
- Provides effective propagation
- Avoids QBF-specific search issues
- Results in a simpler encoding
- Improves state-of-the-art by orders of magnitude
10Roadmap of the Talk
FourKey Challenges
The Basicsof QBF
Our ApproachFrom problem to ? games?
dual representation? dual solver
Summary
ExperimentalResults
11Challenge 1
- Most QBF benchmarks have only 2-3 quantifer
levels - Might as well translate into SAT (it often
works!) - Benchmarks with many levels are often the hardest
- Practical issues in both modeling and solving
become much more apparent with many quantifier
levels - Our benchmarks encode chess-like problems with
7-15 quantifier levels
Can QBF solvers be made to scale well with10
quantifier alternations?
12Challenge 2
- QBF solvers extremely sensitive to encoding!
- Especially with many quantifier levels, e.g.,
evader-pursuer chess instances Madhusudan et
al. 2003
Can we design generic QBF modeling
techniquesthat are simple and efficient for
solvers?
13Challenge 3
- For QBF, traditional encodings hinder unit
propagation - E.g. unsatisfiable reachability queries
- A SAT solver would have simply unit propagated
- QBF solvers need 1000s of backtracks and complex
mechanisms like learning
Can we achieve unit propagation across
quantifiers?
14Lack of Effective Propagation
QuestionCan White reach thepink square
withoutbeing captured?
q-unsatWhite has one toofew available moves
15Challenge 4
- QBF solvers suffer from the illegal search space
issue Ansotegui et al. 2005 - Auxiliary variables needed for conversion into
CNF - Can push solver into large irrelevant parts of
search space - Note negligible impact on SAT due to effective
propagation - Best fix for QBF condQuaffle (passes flags to
the solver)
Can we somehow completely avoid the illegal
searchspace issue by using a better
representation?
16Aside Search Space for SAT
Effect of addingauxiliary variables
Search Space SAT Encoding 2NM
Original Search Space 2N
Space Searched by SAT Solvers 2N/C Nlog(N)
Poly(N)
17Aside Search Space for QBF
Search Space QBF Encoding 2NM
Can we reduce the search space With clever
encodings , streamlining, etc?
Original Search Space 2N
18Roadmap of the Talk
FourKey Challenges
The Basicsof QBF
Our ApproachFrom problem to ? games?
dual representation? dual solver
Summary
ExperimentalResults
19The Traditional Approach
CNF-basedQBF encoding
QBF Solver
Problemof interest
e.g. chess end-game, circuit minimization,advers
arial planning,
Solution!
Any discreteadversarial task
20Overview of Our Approach
Game G players E U,states, actions, rules,
goal
AdversarialTask
Planning as Satisfiability framework (standard)
e.g. chess end-game, circuit minimization,advers
arial planning,
Create CNF encodingseparately for E and
U initial state axioms, action implies
precondition,fact implies achieving
action, frame axioms, goal condition
Solution!
Dual (split)CNF-DNF encoding
QBF SolverDuaffle
NegateCNF part for U(creates DNF)
21From Adversarial Tasks To Games
- Example 1
- Circuit Minimization Given a circuit C, is
there a smaller circuit computing the same
function as C? - Related QBF benchmarks adder circuits, sorting
networks - A game with 2 turns
- Moves First, E commits to a circuit CE second,
U produces an input p and computations of CE, C
on p. - Rules CE must be a legal circuit smaller than C
U must correctly compute CE(p) and C(p). - Goal E wins if CE(p) C(p) no matter how U
chooses p - E wins iff there is a smaller circuit
22From Adversarial Tasks To Games
- Example 2
- The Chromatic Number Problem Given a graph G
and a positive number k, does G have chromatic
number k? - Chromatic number minimum number of colors needed
to color G so that every two adjacent vertices
get different colors - A game with 2 turns
- Moves First, E produces a coloring S of G
second, U produces a coloring T of G - Rules S must be a legal k-coloring of G T must
be a legal (k-1)-coloring of G - Goal E wins if S is valid and T is not
- E wins iff G has chromatic number k
23From Games to Formulas
- Use the planning as satisfiability framework
- I Initial conditions
- TrE Rules for legal transitions/moves of E
- TrU Rules for legal transitions/moves of U
- GE Goal of E (negation of goal of U)
- Two alternative formulations of the QBF Matrix
CNFclauses
Fits circuit minimization,chromatic number
problem, etc.
M1 I ? TrE ? (TrU ? GE)
M2 TrU ? (I ? TrE ? GE)
Fits games like chess, etc.
24The Dual Encoding
Two alternative formulations of the dual QBF
matrix
M1 (I ? TrE) ? (?TrU ? ?GU)
CNF
DNF
(negation of CNF clauses)
M2 (I ? TrE ? GE) ? ?TrU
In contrast withZhang, AAAI 06split,
non-redundant
Variables state vars S1, S2, , Sk1
action vars A1, A2, , Ak
?S1 ?A1?S2 ?A2?S3 ?A3?S4 ?Ak?Sk1 Mi
i ? 1,2
25The Dual Encoding Example
- Chess White as E, Black as U
- TrE Transition axioms for E CNF clauses
- e.g. ? Move(Wking, sqA, sqB, step 5) ?
Loc(Wking, sqA, 5) - TrU Transition axioms for U DNF terms(negated
traditional axiom clauses) - e.g. Move(Bking, sqA, sqB, step 5) ? ?
Loc(Bking, sqA, 5)
26Our QBF Solver Duaffle
dual-Quaffle
- An extension of Quaffle Zhang-Malik 02
- Quaffle already supports DNF terms (cubes)
- However, its DNF terms are deduced from the CNF
input - For us, DNF and CNF parts are independent
- ? propagation mechanism changes
- Most features remain unchanged(e.g. parser, data
structures, decision heuristic, clause and cube
learning, fast backjumping, )
27Duaffle Input Format
c Dual QBF format c 100 variables c 25 CNF
clauses, 32 DNF terms c p cnfdnf and 100 25
32 c c Quantifiers e 1 2 5 9 23 56 0 a 6 7 21
22 0 0 c CNF clauses -4 -7 8 12 0 9 5 -55
0 0 c DNF terms 43 -61 -2 0 4 1 -100 0 0
- Straightforward extensionof QDIMACS format
- Specifies quantification,CNF clauses, DNF terms
- Additional flag for choosingbetween formulations
M1 (connective ?) and M2 (connective ?)
28Duaffle Backtracking Policy
- E.g. what should we do when the CNF part is
satisfied but the DNF part is not? - Extension of Quaffles policy(Quaffle never
encounters certain possibilities because its
DNF part is logically deduced from the CNF part)
DNF part
DNF part
U
F
T
U
F
T
U
U
CNFpart
CNFpart
F
F
T
T
For formulation M2
For formulation M1
29Roadmap of the Talk
FourKey Challenges
The Basicsof QBF
Our ApproachFrom problem to ? games?
dual representation? dual solver
Summary
ExperimentalResults
30Experimental Results
5-15 quantifier levels (reachability)
7-9 quantifier levels
31Experimental Results, contd.
7-9 quantifier levels
Duaffle (even without learning) on the dual
encoding dramatically outperforms all leading
CNF-based QBF solvers on these challenging
instances
32Summary
- A new QBF modeling approach
- Uses a split CNF-DNF representation
- Preserves benefits of CNF
- Leverages modern QBF solvers ability to handle
DNF - Based on a systematic view of problems as games,
and the planning as satisfiability framework - A dual format QBF solver, Duaffle
- Extends Quaffle
- Outperforms all existing QBF solvers (on xChess)
by orders of magnitude, even without clause/cube
learning