QBF Modeling: Exploiting Player Symmetry for Simplicity and Efficiency Ashish Sabharwal, Carlos...
-
date post
22-Dec-2015 -
Category
Documents
-
view
219 -
download
0
Transcript of QBF Modeling: Exploiting Player Symmetry for Simplicity and Efficiency Ashish Sabharwal, Carlos...
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
August 15, 2006 SAT 2006 2
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 E.g., must avoid “higher level” representations
3. 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 3
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 4
Roadmap of the Talk
The Basicsof QBF
FourKey Challenges
Our Approach:From problem to games dual representation dual solver
ExperimentalResults
Summary
August 15, 2006 SAT 2006 5
Roadmap of the Talk
The Basicsof QBF
FourKey Challenges
Our Approach:From problem to games dual representation dual solver
ExperimentalResults
Summary
August 15, 2006 SAT 2006 6
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 7
CNF 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
August 15, 2006 SAT 2006 8
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 9
The Message
Provides effective propagation Avoids QBF-specific search issues Results in a simpler encoding Improves state-of-the-art by orders of magnitude
Assuming CNF is a good modeling language for SAT,
a split CNF-DNF representation is the right format for QBF
August 15, 2006 SAT 2006 10
Roadmap of the Talk
The Basicsof QBF
FourKey Challenges
Our Approach:From problem to games dual representation dual solver
ExperimentalResults
Summary
August 15, 2006 SAT 2006 11
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 12
Challenge #2
QBF solvers extremely sensitive to encoding! Especially with many quantifier levels,
e.g., evader-pursuer chess instances [Madhusudan et al. 2003]
Instance (N, steps)
Model X [Madhusudan et al. 2003]
Model A [Ansotegui et al. 2005]
Model B [Ansotegui et al. 2005]
QuBEJ Semprop QuaffleBest other
solverCond-Quaffle
Best other solver
Cond-Quaffle
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 13
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 solverwith 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 14
Lack of Effective Propagation
QuickTime™ and aCinepak decompressor
are needed to see this picture.
q-unsat:White has one toofew available moves
Question:Can White reach thepink square withoutbeing captured?
August 15, 2006 SAT 2006 15
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 16
Aside: Search Space for SAT
OriginalSearch Space
2N
Search SpaceSAT Encoding
2N+M
Space Searchedby SAT Solvers
2N/C ; Nlog(N); Poly(N)
Original2N
Effect of addingauxiliary variables
August 15, 2006 SAT 2006 17
Aside: Search Space for QBF
OriginalSearch Space
2N
Search SpaceQBF Encoding
2N+M’
Can we reduce the search spaceWith clever encodings , streamlining, etc?
Search SpaceStandard QBF Encoding
2N+M’’
Original2N
August 15, 2006 SAT 2006 18
Roadmap of the Talk
The Basicsof QBF
FourKey Challenges
Our Approach:From problem to games dual representation dual solver
ExperimentalResults
Summary
August 15, 2006 SAT 2006 19
The Traditional Approach
Problemof interest
e.g. chess end-game, circuit minimization,adversarial planning,…
CNF-basedQBF encoding QBF Solver
Solution!
Any discreteadversarial task
August 15, 2006 SAT 2006 20
Overview of Our Approach
AdversarialTask
e.g. chess end-game, circuit minimization,adversarial planning,…
Game G:
players E & U,states, actions,
rules, goal
“Planning as Satisfiability”framework(standard)
Create CNF encodingseparately for E and U:
initial state axioms,action implies precondition,
fact implies achieving action,frame axioms,goal condition
Dual (split)CNF-DNF encoding
QBF SolverDuaffle
NegateCNF part for U(creates DNF)
Solution!
August 15, 2006 SAT 2006 21
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 22
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 23
From 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
M1 = I TrE (TrU GE)
M2 = TrU (I TrE GE)
Fits circuit minimization,chromatic number problem, etc.
Fits games like chess, etc.
CNFclauses
August 15, 2006 SAT 2006 24
The Dual Encoding
M’1 = (I TrE) (TrU GU)
M’2 = (I TrE GE) TrU
Two alternative formulations of the dual QBF matrix
CNF DNF
Variables : state vars S1, S2, …, Sk+1
action vars A1, A2, …, Ak
S1 A1S2 A2S3 A3S4 AkSk+1 M’i i {1,2}
(negation of CNF clauses)
In contrast with[Zhang, AAAI ’06]:split, non-redundant
August 15, 2006 SAT 2006 25
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 26
Our QBF Solver: Duaffle
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, …)
“dual-Quaffle”
August 15, 2006 SAT 2006 27
Duaffle: Input Formatc Dual QBF formatc 100 variablesc 25 CNF clauses, 32 DNF termsc p cnfdnf and 100 25 32cc Quantifierse 1 2 5 9 23 56 … 0a 6 7 21 22 … 0…0c CNF clauses-4 -7 8 12 09 5 -55 0…0c DNF terms43 -61 -2 04 1 -100 0…0
• Straightforward extensionof QDIMACS format
• Specifies quantification,CNF clauses, DNF terms
• Additional flag for choosingbetween formulations
M’1 (connective ) and
M’2 (connective )
August 15, 2006 SAT 2006 28
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)
BRN UNS BRN
UNS UNS UNS
BRN UNS SAT
U F T
U
F
T
CNFpart
DNF part
BRN BRN SAT
BRN UNS SAT
SAT SAT SAT
U F T
U
F
T
CNFpart
DNF part
For formulation M’1 For formulation M’2
August 15, 2006 SAT 2006 29
Roadmap of the Talk
The Basicsof QBF
FourKey Challenges
Our Approach:From problem to games dual representation dual solver
ExperimentalResults
Summary
August 15, 2006 SAT 2006 30
Experimental ResultsxChess instance Pure CNF Encoding Dual Encoding
name T/F Semprop sKizzo QuaffleCond-Quaffle
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
5-15quantifier
levels(reachability)
7-9quantifier
levels
August 15, 2006 SAT 2006 31
Experimental Results, contd.xChess instance Pure CNF Encoding Dual Encoding
name T/F Semprop sKizzo QuaffleCond-Quaffle
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
7-9quantifier
levels
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 32
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