Algorithms and Problems for Quantified SAT
description
Transcript of Algorithms and Problems for Quantified SAT
![Page 1: Algorithms and Problems for Quantified SAT](https://reader036.fdocuments.us/reader036/viewer/2022062723/56813fe9550346895daadc78/html5/thumbnails/1.jpg)
Algorithms and Problemsfor Quantified SAT
Toby Walsh
Department of Computer ScienceUniversity of York
England
Ian P. Gent
School of Computer ScienceUniversity of St Andrews
Scotland
![Page 2: Algorithms and Problems for Quantified SAT](https://reader036.fdocuments.us/reader036/viewer/2022062723/56813fe9550346895daadc78/html5/thumbnails/2.jpg)
Algorithms and Problemsfor Quantified SAT
1. Quantified Satisfiability QSAT2. The Evaluate Algorithm3. A New Algorithm 4. Phase Transitions5. Phase Transition in QSAT
![Page 3: Algorithms and Problems for Quantified SAT](https://reader036.fdocuments.us/reader036/viewer/2022062723/56813fe9550346895daadc78/html5/thumbnails/3.jpg)
Quantified satisfiability (QSAT)
Existential quantifiersas in propositional SAT
Universal quantifiers"x. $ y. (x v y) & (-x v -y) x=true, then y=false satisfiesx=false, then y=true satisfies
also called quantified Boolean formulae (QBF)
QSAT can be seen as an alternating game between existentials which want to make formula true, and universals which want to make it false
![Page 4: Algorithms and Problems for Quantified SAT](https://reader036.fdocuments.us/reader036/viewer/2022062723/56813fe9550346895daadc78/html5/thumbnails/4.jpg)
Complexity of QSATPSPACE-complete
no limit on number of alternating quantifiers
problems needing polynomial space on a Turing machine
k-QSATk alternations, $ innermost Sk P-complete
CNF formulaedoes not change complexity
![Page 5: Algorithms and Problems for Quantified SAT](https://reader036.fdocuments.us/reader036/viewer/2022062723/56813fe9550346895daadc78/html5/thumbnails/5.jpg)
Algorithms for QSAT
Recent Algorithms by... Cadoli, Giovanardi & Schaerf, AAAI 98, SAT 2000.simple to avoid
Both based on similar ideaWork `outside in'Set outermost quantifiers first, then next level ...
Both make extensive use of propagation rulesI will present a simplified version of Cadoli's
![Page 6: Algorithms and Problems for Quantified SAT](https://reader036.fdocuments.us/reader036/viewer/2022062723/56813fe9550346895daadc78/html5/thumbnails/6.jpg)
Cadoli et al's Evaluate algorithmTwo mutually recursive functions
U-evaluate for universal quantifiers E-evaluate for existential quantifier
Many propagation rules in eache.g. `unit propagation'
If a clause exists with only a single existential literal ... commit to the E-variable having the relevant value
I will not detail propagation rulesFocus on branching nature of search ...... and an unusual preprocessing step
![Page 7: Algorithms and Problems for Quantified SAT](https://reader036.fdocuments.us/reader036/viewer/2022062723/56813fe9550346895daadc78/html5/thumbnails/7.jpg)
An unusual preprocessing stepGiven a QSAT formula F Form existential simplification E(F)
Discard universal literals in F
Solve E(F) as SAT problem (not as QSAT)Use classic Davis-Putnam
If DP succeeds, F is soluble as QSATSame values of e-variables works for all values of u-
variables
![Page 8: Algorithms and Problems for Quantified SAT](https://reader036.fdocuments.us/reader036/viewer/2022062723/56813fe9550346895daadc78/html5/thumbnails/8.jpg)
Function U-Evaluate(F) If clause set is empty, succeed If there is empty/all universal clause, fail Try Davis-Putnam on Existential Simplification
If this solves all clauses, succeed
Apply Propagation rules If the outermost quantifier is now Existential
Return result of E-evaluate(F)
Choose a U-variable u Fail if U-Evaluate(F u:=true) fails Else return result of U-Evaluate(F u:=false)
![Page 9: Algorithms and Problems for Quantified SAT](https://reader036.fdocuments.us/reader036/viewer/2022062723/56813fe9550346895daadc78/html5/thumbnails/9.jpg)
Function E-Evaluate(F) If clause set is empty, succeed If there is empty/all universal clause, fail Try Davis-Putnam on Existential Simplification
If this solves all clauses, succeed
Apply Propagation rules If the outermost quantifier is now Universal
Return result of U-evaluate(F)
Choose a E-variable e Succeed if E-Evaluate(F e:=true) succeeds Else return result of E-Evaluate(F e:=false)
![Page 10: Algorithms and Problems for Quantified SAT](https://reader036.fdocuments.us/reader036/viewer/2022062723/56813fe9550346895daadc78/html5/thumbnails/10.jpg)
Thoughts about theAlgorithms Both Rintanen/Cadoli algorithms successful
Cadoli et al on Random Problems Rintanen on `Conditional Planning' Problems
Blind search successfulespecially notable in U-evaluatesimple enumeration of possibilities
SAT preprocessing successful yet work often discarded
New algorithm should: avoid blind search/avoid discarding SAT work
![Page 11: Algorithms and Problems for Quantified SAT](https://reader036.fdocuments.us/reader036/viewer/2022062723/56813fe9550346895daadc78/html5/thumbnails/11.jpg)
Failure Driven Search Any partial solution (e.g. from DP) is helpful ...
... as long as it solves all clauses without universals The existential assignment solves many clauses
applies to all universal assignments ... except those invalidating universals in unsat clauses
Future tests need only solve remaining cases Failure-driven rather than blind search Exploits work done by failed calls to DP
![Page 12: Algorithms and Problems for Quantified SAT](https://reader036.fdocuments.us/reader036/viewer/2022062723/56813fe9550346895daadc78/html5/thumbnails/12.jpg)
No-commitment Search We can try hard to avoid guessing universals Set them as unknown initially Treat all literals as false if value = unknown
Attempt to solve without choosing value Only forced to choose a value on backtracking for universal values not solved by existentials
![Page 13: Algorithms and Problems for Quantified SAT](https://reader036.fdocuments.us/reader036/viewer/2022062723/56813fe9550346895daadc78/html5/thumbnails/13.jpg)
Hard and Soft Clauses Soft Clauses
clauses that can be left unsolved on this attempt have some free universal variables e.g. U or V or W or E if we set E = false, have solution when U/V/W true next test we set U=V=W=false and force new solution
Hard Clauses clauses that must be solved for problem to be soluble i.e. No universal variables, e.g. E
![Page 14: Algorithms and Problems for Quantified SAT](https://reader036.fdocuments.us/reader036/viewer/2022062723/56813fe9550346895daadc78/html5/thumbnails/14.jpg)
Revised E-evaluate
Takes hard and soft clauses as input Fails if hard clauses alone are insoluble Succeeds if hard clauses are soluble
solves as many soft clauses as possible can use heuristic method on soft clauses returns list of unsatisfied soft clauses
Calls U-evaluate recursively for hard clauses
![Page 15: Algorithms and Problems for Quantified SAT](https://reader036.fdocuments.us/reader036/viewer/2022062723/56813fe9550346895daadc78/html5/thumbnails/15.jpg)
Revised U-evaluate([F]) Uses ToDo list of subproblems
Initially ToDo = [ F ] Succeed when ToDo empty
Removes element G of ToDo list Call E-evaluate(G)
fail if E-evaluate fails if E-evaluate succeeds ...
for each unsat soft clause returned assign universals so as to unsatisfy the soft clause add the resulting simplified problem to ToDo
Return result of U-evaluate on revised ToDo list
![Page 16: Algorithms and Problems for Quantified SAT](https://reader036.fdocuments.us/reader036/viewer/2022062723/56813fe9550346895daadc78/html5/thumbnails/16.jpg)
Comments Where did DP go? DP call evaporates!
First step in U-evaluate is to call E-evaluate We are always reasoning on existentials first DP could be used as heuristic on soft clauses As could WalkSAT ...
Where is unknown value set? Unknown value is set implicitly
when U-evaluate calls E-evaluate without setting universal
![Page 17: Algorithms and Problems for Quantified SAT](https://reader036.fdocuments.us/reader036/viewer/2022062723/56813fe9550346895daadc78/html5/thumbnails/17.jpg)
Conclusions (Algorithms)
Recent algorithms making QSAT feasible Existing algorithms have possible drawbacks
blind searchwasted work
Can remove these drawbacks Exercises for the interested author...
Correctness proof (except 2-QSAT) Implementation Empirical Evaluation
![Page 18: Algorithms and Problems for Quantified SAT](https://reader036.fdocuments.us/reader036/viewer/2022062723/56813fe9550346895daadc78/html5/thumbnails/18.jpg)
Phase transition behaviour
Seen in many NP-hard problemsSAT, CSP, number
partitioning, TSP ...seminal IJCAI-91
paper by Cheeseman, Kanefsky & Taylor
rapid solubility transitionaround <Sol> » 1
![Page 19: Algorithms and Problems for Quantified SAT](https://reader036.fdocuments.us/reader036/viewer/2022062723/56813fe9550346895daadc78/html5/thumbnails/19.jpg)
Phase transition behaviourComplexity peak
associated with solubility transition
easy-hard-easyproblems on "knife-
edge"a theory of
constrainednessmodels such behaviourk = 1-log(<Sol>)/n -96, 97, 98AAAI
![Page 20: Algorithms and Problems for Quantified SAT](https://reader036.fdocuments.us/reader036/viewer/2022062723/56813fe9550346895daadc78/html5/thumbnails/20.jpg)
Other complexity classesPolynomial problems
enforcing arc-consistency in CSPs [CP-97]
worst-case complexity seen at phase boundary
k useful to predict location of transition
What about higher complexity classes?
![Page 21: Algorithms and Problems for Quantified SAT](https://reader036.fdocuments.us/reader036/viewer/2022062723/56813fe9550346895daadc78/html5/thumbnails/21.jpg)
QSAT phase transition
Fixed clause length modelk alternating quantifierseach with n variables l clauses each with h literals
Cadoli et al (AI*IA97, AAAI98)not always an easy-hard-easy
patternsolubility transition at l µÖn
![Page 22: Algorithms and Problems for Quantified SAT](https://reader036.fdocuments.us/reader036/viewer/2022062723/56813fe9550346895daadc78/html5/thumbnails/22.jpg)
Flawed problem generation!Propositional satisfiability
may generate unit clauses, x and -x
just as 2 people here are likely to have same birthday
Quantified satisfiabilitymay generate clause with
single existential, x and another with -x
no satisfying assignmentsimple argument gives l µÖn
Two fixes:Model A, discard clauses with one or fewer existentialsModel B, fix number of existentials in each clause
Easy fix:discard unit clauses
![Page 23: Algorithms and Problems for Quantified SAT](https://reader036.fdocuments.us/reader036/viewer/2022062723/56813fe9550346895daadc78/html5/thumbnails/23.jpg)
QSAT phase transition
![Page 24: Algorithms and Problems for Quantified SAT](https://reader036.fdocuments.us/reader036/viewer/2022062723/56813fe9550346895daadc78/html5/thumbnails/24.jpg)
QSAT phase transition
Easy-hard-easy pattern now clearly visiblephase transition around fixed l/n
2-QSAT, 3-cnf
![Page 25: Algorithms and Problems for Quantified SAT](https://reader036.fdocuments.us/reader036/viewer/2022062723/56813fe9550346895daadc78/html5/thumbnails/25.jpg)
QSAT phase transition
Clear complexity "ridge"varying l/n, and proportion of universals larger gap between higher percentiles than in NP?
ãJ. Rintanen
![Page 26: Algorithms and Problems for Quantified SAT](https://reader036.fdocuments.us/reader036/viewer/2022062723/56813fe9550346895daadc78/html5/thumbnails/26.jpg)
Conclusions (Transitions)
Be careful of "flaws"SAT, CSP, QSAT ...simple to avoid
QSAT phase transitionsimilar to that seen in NPconstrainedness, k useful but less accuate
We predict similar results in other PSPACE problemsgame playing and planning