New Algorithms for QBF Ian Gent University of
New Algorithms for QBF Ian Gent University of St Andrews http: //www. dcs. st-and. ac. uk/~apes Glasgow, 24 April 2001
Outline z Quantified Boolean Formulae (QBF) z Davis Putnam Algorithm for SAT y. Conflict Directed Backjumping z Generalised Davis Putnam for QBF y. Solution Based Backjumping y. Genovese Algorithm y. St Andrews Algorithm z The future ywhy you should review a grant quickly if you get it
Quantified Boolean Formulae (QBF) • Existential quantifiers • • as in propositional SAT Universal quantifiers "x. $ y. (x v y) & (-x v -y) QBF can be seen as an alternating game between existentials which want to make formula true, and universals which want to make it false • • • x=true, then y=false satisfies • x=false, then y=true satisfies Solution is a strategy also called quantified satisfiability (QSAT)
Complexity of QSAT z PSPACE-complete y y z z no limit on number of alternating quantifiers problems needing polynomial space on a Turing machine k-QSAT y k alternations, $ innermost y Sk P-complete CNF formulae y does not change complexity
Applications of QBF z Games z Conditional Planning yformulate plans which have an ‘opponent’, xe. g. unforeseeable events z Hardware Verification yyou tell me about that !
Davis Putnam Algorithm for SAT z SAT is QBF with only one layer of existential quantifiers ywe don’t need a strategy yjust find assignment satisfying all clauses z Davis Putnam is classic algorithm for SAT ydeveloped by D/P/Logemann/Loveland in 60’s yat heart of many modern SAT solvers ydeveloping applications in model checking z Problems in clause form (=CNF) yeach clause a disjunction of literals yall clauses must be true
Davis Putnam Algorithm for SAT z If any clause false, fail z If all clauses satisfied, succeed z If any clause is unit, set the relevant variable, recurse z Otherwise yset any variable to true and recurse xif result is success, succeed xif result is failure, • set the variable to false and recurse
Thrashing in Davis Putnam z Davis Putnam is liable to thrashing yexploring exponentially too many branches z Look at this part of a clause set -a, y, z -a, -y, z -a, y, -z -a, -y, z z Suppose we set variables in order a b c d … w x y z z When we set w either way, unit clauses force failure z But we will backtrack useless to x, then w, … ytaking 224 branches until we get back to a
Conflict Directed Backjumping z Patrick Prosser invented CBJ to help reduce thrashing z change backtracking part of Davis Putnam … z Otherwise yset any variable to true and recurse xif result is success, succeed xif result is failure, • if current variable not involved in conflict set, fail • set the variable to false and recurse z “conflict set” = set of variables arising in failed and unit clauses in any part of failed search
Formal proof of correctness … z Search Algorithms in Type Theory y. Jim Caldwell, Ian Gent, Judith Underwood y. Theoretical Computer Science, 232 (2000), 255 -290 z Ok I’ll skip it but …. y… it contains a formal proof plus extracted program
What’s coming up. . . z QBF is the same again with a twist y. DP has been generalised to deal with QBF ythrashing is still a problem yneed two kinds of backjumping ynew kind is “solution based backjumping” z I’m going to miss out propagation rules yfocus on branching search and backtracking ypropagation rules vital in practice
Extending DP to QBF z Recent work in Artificial Intelligence y. Cadoli, Giovanardi & Schaerf, AAAI 98, SAT 2000. y. Rintanen, IJCAI 99 z Two main issues to deal with ycorrectness of quantifier dependencies xmanaging difference between "x. $ y. (x v y) & (-x v -y) $x. "y. (x v y) & (-x v -y) xset outermost quantified variable first, whatever type ydifferent logic induced by universal quantification xalgorithm breaks into cases depending on quantifier
Extending DP to QBF z. . . z If outermost quantifier is existential y set variable to true and recurse xif result is success, succeed xif result is failure, • set the variable to false and recurse z If outermost quantifier is universal y set variable to true and recurse xif result is failure, fail xif result is success, • set the variable to false and recurse
Solution Based Backjumping z Thrashing can occur just as in SAT, and likely worse z Can implement Prosser’s CBJ ybut only applies to branches that fail z We need a new form of backjumping after successes yinvented in Genova but named in St Andrews z Remember a single success is not a solution ywe need a strategy ywe can recycle elements of a strategy yif a universal variable is not used in a solution… x… we can backjump over it when backtracking
Solution Based Backjumping z Enrico Giunchiglia, Tacchella, Narizzano, IJCAI-01 z change universal backtracking part of QBF algorithm … z If outermost quantifier is universal y set variable to true and recurse xif result is failure, fail xif result is success, • if current variable not involved in solution set, succeed • set the variable to false and recurse z “solution set” = set of universal variables essential to successes in any part of failed search z reduces thrashing on some benchmark problems
St Andrews Algorithm z Ian Gent & Andrew Rowley, unpublished z Based on a least commitment principle ywe don’t want to set universal variables if possible… y… so we don’t set them at all z Search still proceeds outside in … z … but we just leave a place holder for universals z When no existential variables left, set universals yby a magic call to g. o. f. Davis Putnam z On backtracking set universal variables in solutions ybackjump over others as in SBJ
St Andrews Algorithm z. . . z If outermost quantifier is existential y set variable to true and recurse xif result is success, succeed xif result is failure, • set the variable to false and recurse z If outermost quantifier is universal y mark variable and recurse xif result is failure, fail xif result is success, • if current variable not involved in solution set, succeed • set the variable to false and recurse z If only unmarked universal variables remain y return result of Davis Putnam on remaining clauses
The Future z I’d like to fund Andrew Rowley to do a Ph. D on this yor failing that, get him to Glasgow to do one here z We need to do non-clausal versions of the algorithms yfix asymmetry in CNF between " $ z Do variants of other algorithms like Stalmarck’s z Do nice theoretical work like Judith’s TCS paper z Develop applications, e. g. in hardware verification
- Slides: 18