QBF 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
The Goal of This Work
To significantly extend the reach of QBF reasoning by
1. Investigating and improving basic modeling framework
2. Retaining the benefits of CNF for SAT/QBF solvers
3.
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
August 15, 2006
SAT 2006
2
Our 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
August 15, 2006
SAT 2006
3
Roadmap of the Talk
The Basics
of QBF
Four
Key Challenges
Our Approach:
From problem to
games
dual representation
dual solver
Summary
August 15, 2006
Experimental
Results
SAT 2006
4
Roadmap of the Talk
The Basics
of QBF
Four
Key Challenges
Our Approach:
From problem to
games
dual representation
dual solver
Summary
August 15, 2006
Experimental
Results
SAT 2006
5
SAT, 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
August 15, 2006
SAT 2006
6
CNF Format and SAT
Many good reasons to use the CNF format for SAT:
Fairly “natural” representation
Efficient pruning of unsat. parts of the search space
Many problems are a conjunction of several constraints
Each constraint in itself is often simple and easy to satisfy
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
August 15, 2006
SAT 2006
7
Is 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 don’t! (~10 K vars)
August 15, 2006
SAT 2006
8
The 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
August 15, 2006
SAT 2006
9
Roadmap of the Talk
The Basics
of QBF
Four
Key Challenges
Our Approach:
From problem to
games
dual representation
dual solver
Summary
August 15, 2006
Experimental
Results
SAT 2006
10
Challenge #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 with
10+ quantifier alternations?
August 15, 2006
SAT 2006
11
Challenge #2
QBF solvers extremely sensitive to encoding!
Especially with many quantifier levels,
e.g., evader-pursuer chess instances
[Madhusudan et al. 2003]
Instance
Model X
[Madhusudan et al. 2003]
Model A
[Ansotegui et al. 2005]
(N, steps)
QuBEJ
Semprop
Quaffle
Best other
solver
Model B
[Ansotegui et al. 2005]
CondQuaffle
Best other
solver
CondQuaffle
4
7
2030
>2030
>2030
7497
3
0.03
0.03
4
9
--
--
--
--
28
0.06
0.04
8
7
--
--
--
--
800
5
5
Can we design generic QBF modeling techniques
that are simple and efficient for solvers?
August 15, 2006
SAT 2006
12
Challenge #3
For QBF, traditional encodings hinder unit propagation
E.g. unsatisfiable “reachability” queries
A SAT solver would have simply unit propagated
QBF solvers need 1000’s of backtracks and complex
mechanisms like learning
Best solver
with only unit
propagation
Best solver
(conf-quaffle)
with learning
conf-r1
2.5
0.2
conf-r5
8603
5.4
conf-r6
>21600
7.1
?
q-unsat: too few steps for White
Can we achieve unit propagation across quantifiers?
August 15, 2006
SAT 2006
13
Lack of Effective Propagation
Question:
Can White reach the
pink square without
being captured?
QuickTime™ and a
Cinepak decompressor
are needed to see this picture.
q-unsat:
White has one too
few available moves
August 15, 2006
SAT 2006
14
Challenge #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 search
space issue by using a better representation?
August 15, 2006
SAT 2006
15
Aside: Search Space for SAT
Effect of adding
auxiliary variables
Search Space
SAT Encoding
2N+M
Space
Searched
Original
by SAT Solvers
Search
Space
2N/C ; Nlog(N)
2N; Poly(N)
Original
2N
August 15, 2006
SAT 2006
16
Aside: Search Space for QBF
Search Space
QBF Encoding
2N+M’
Search Space
Standard QBF Encoding
2N+M’’
Can we reduce
the search space
Original
With clever encodings
, streamlining, etc?
Search Space
2N
Original
2N
August 15, 2006
SAT 2006
17
Roadmap of the Talk
The Basics
of QBF
Four
Key Challenges
Our Approach:
From problem to
games
dual representation
dual solver
Summary
August 15, 2006
Experimental
Results
SAT 2006
18
The Traditional Approach
Problem
of interest
CNF-based
QBF encoding
e.g. chess end-game,
circuit minimization,
adversarial planning,
…
QBF Solver
Solution!
Any discrete
adversarial task
August 15, 2006
SAT 2006
19
Overview of Our Approach
Game G:
Adversarial
Task
players E & U,
states, actions,
rules, goal
e.g. chess end-game,
circuit minimization,
adversarial planning,
…
Create CNF encoding
separately for E and U:
initial state axioms,
action implies precondition,
fact implies achieving action,
frame axioms,
goal condition
Solution!
QBF Solver
Duaffle
August 15, 2006
“Planning as Satisfiability”
framework
(standard)
Dual (split)
CNF-DNF encoding
SAT 2006
Negate
CNF part for U
(creates DNF)
20
From 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
August 15, 2006
SAT 2006
21
From 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
August 15, 2006
SAT 2006
22
From Games to Formulas
Use the “planning as satisfiability” framework
I
TrE
TrU
GE
:
:
:
:
Initial conditions
Rules for legal transitions/moves of E
Rules for legal transitions/moves of U
Goal of E (negation of goal of U)
CNF
clauses
Two alternative formulations of the QBF Matrix
M1 = I TrE (TrU GE)
Fits games like chess, etc.
August 15, 2006
Fits circuit minimization,
chromatic number problem, etc.
M2 = TrU (I TrE GE)
SAT 2006
23
The Dual Encoding
Two alternative formulations of the dual QBF matrix
M’1 = (I TrE)
(TrU GU)
CNF
DNF (negation of CNF clauses)
M’2 = (I TrE GE)
Variables : state vars S1, S2, …, Sk+1
action vars A1, A2, …, Ak
TrU
In contrast with
[Zhang, AAAI ’06]:
split, non-redundant
S1 A1S2 A2S3 A3S4 AkSk+1 M’i
August 15, 2006
SAT 2006
i {1,2}
24
The 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)
August 15, 2006
SAT 2006
25
Our 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
August 15, 2006
Most features remain unchanged
(e.g. parser, data structures, decision heuristic,
clause and cube learning, fast backjumping, …)
SAT 2006
26
Duaffle: 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
August 15, 2006
• Straightforward extension
of QDIMACS format
• Specifies quantification,
CNF clauses, DNF terms
• Additional flag for choosing
between formulations
)
M’2 (connective )
M’1 (connective
SAT 2006
and
27
Duaffle: Backtracking Policy
E.g. what should we do when the CNF part is satisfied
but the DNF part is not?
Extension of Quaffle’s policy
(Quaffle never encounters certain possibilities because
its DNF part is logically deduced from the CNF part)
DNF part
U
U
BRN
F
UNS
DNF part
T
U
T
BRN
U
BRN
BRN
SAT
BRN
UNS
SAT
SAT
SAT
SAT
CNF
part F
UNS
UNS
UNS
CNF
part F
T
BRN
UNS
SAT
T
For formulation M’2
For formulation M’1
August 15, 2006
F
SAT 2006
28
Roadmap of the Talk
The Basics
of QBF
Four
Key Challenges
Our Approach:
From problem to
games
dual representation
dual solver
Summary
August 15, 2006
Experimental
Results
SAT 2006
29
Experimental Results
xChess
instance
5-15
quantifier
levels
(reachability)
7-9
quantifier
levels
August 15, 2006
Pure CNF Encoding
Dual Encoding
name
T/F
Semprop
sKizzo
Quaffle
CondQuaffle
Duaffle
(without learning!)
conf-r1
F
12
4.0
15
1.3
0.01
conf-r2
F
25
5.86
33
2.5
0.02
conf-r3
F
55
9.3
62
4.1
0.03
conf-r4
F
85
26
124
6.4
0.04
conf-r5
F
985
84
676
34
0.08
conf-r6
F
2042
73
713
49
0.10
conf01
F
1225
492
--
539
6.4
conf02
F
93
30
6.0
1.0
0.0
conf03
T
--
1532
--
83
1.4
conf04
T
--
--
2352
100
3.5
conf05
F
3290
448
510
196
0.1
conf06
F
--
memout
--
633
30.6
conf07
F
261
42
78
3.5
0.0
conf08
T
--
1509
--
1088
31.2
SAT 2006
30
Experimental Results, contd.
xChess
instance
7-9
quantifier
levels
Pure CNF Encoding
Dual Encoding
name
T/F
Semprop
sKizzo
Quaffle
CondQuaffle
Duaffle
(without learning!)
conf1a
T
627
83
--
161
1.8
conf1b
F
682
176
2939
124
1.3
conf1c
T
659
804
--
156
2.1
conf1d
F
706
1930
1473
148
2.2
conf2a
T
--
--
--
438
65.9
conf2b
F
--
--
--
275
56.9
conf3a
T
--
memout
--
653
5.2
conf3b
F
--
--
2128
327
2.2
conf4
F
--
--
--
274
32.0
conf5
F
1018
427
142
11
0.1
Duaffle (even without learning) on the dual encoding dramatically outperforms
all leading CNF-based QBF solvers on these challenging instances
August 15, 2006
SAT 2006
31
Summary
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
August 15, 2006
SAT 2006
32
© Copyright 2026 Paperzz