1.09k likes | 1.26k Views
Experiences with QBF Solvers. Sharad Malik Princeton University BMC Workshop Edinburgh July 11, 2005. Acknowledgements. Daijue Tang Yinlei Yu Zhaohui Fu Yogesh Mahajan Darsh Ranjan Lintao Zhang (now at Microsoft Research). Outline. QBF QBF algorithms
E N D
Experiences with QBF Solvers Sharad Malik Princeton University BMC Workshop Edinburgh July 11, 2005
Acknowledgements • Daijue Tang • Yinlei Yu • Zhaohui Fu • Yogesh Mahajan • Darsh Ranjan • Lintao Zhang (now at Microsoft Research)
Outline • QBF • QBF algorithms • Satisfiability driven learning • Long distance resolution • Validating QBF solvers • 2QBF • Sequential circuit state space diameter problem • 2QBF algorithms • Analysis
Outline • QBF • QBF algorithms • Satisfiability driven learning • Long distance resolution • Validating QBF solvers • 2QBF • Sequential circuit state space diameter problem • 2QBF algorithms • Analysis
Quantification Level 1 Quantification Level n Problem Formulation • Quantified Boolean Formula F: Q1X1······ QnXn where Qi (i=1,···, n) is either or , is a propositional formula • Example: ue(u+e’)(u’+e) e4e5u1u2u3e1e2e3f(e1,e2,e3,e4,e5,u1,u2,u3) • QBF Problem: Is F satisfiable? • P-Space Complete, theoretically harder than NP-Complete problems such as SAT.
Motivations • QBF has practical applications: • AI Planning • Sequential Circuit Verification • QBF has some similarities with SAT • Modern SAT solvers are very efficient and widely used in many fields • May be able to leverage SAT techniques
Outline • QBF • QBF algorithms • Satisfiability driven learning • Long distance resolution • Validating QBF solvers • 2QBF • Sequential circuit state space diameter problem • 2QBF algorithms • Analysis
Basic QBF Algorithms • Resolution based • Plaisted’s Algorithm • Search based
a + b + c’ + f g + h’ + c + f a + b + g + h’ a + b + g + h’ + f Resolution • Resolution of a pair of clauses with exactly ONE incompatible variable
Resolution Based QBF Algorithm false [BKF95] Hans Kleine Buning, Marek Karpinski, and Andreas Flogel. Resolution for Quantified Boolean Formulas. Information and Computation 117(1): 12-18 (1995).[Biere05]A. Biere. Resolve and Expand. In Proc. 7th Intl. Conf. on Theory and Applications of Satisfiability Testing (SAT'04), Lecture Notes in Computer Science (LNCS), Springer 2005.
Plaisted’s Algorithm enumerate conflict assignments of u1 e1 through DPLL search cut: e2 e3 [PBZ03] David A. Plaisted, Armin Biere, Yunshan Zhu, A satisfiability procedure for quantified Boolean formulae, Discrete Applied Mathematics 130 (2003) 291-328.
Search Based QBF Algorithms • Work by gradually assigning variables • A partial assignment [KGS98] M. Cadoli, A. Giovanardi, M. Schaerf. An Algorithm to Evaluate Quantified Boolean Formulae. In Proc. of 16th National Conference on Artificial Intelligence (AAAI-98)
Search Based QBF Algorithms • Work by gradually assigning variables • A partial assignment • Undetermined • Continue search [KGS98] M. Cadoli, A. Giovanardi, M. Schaerf. An Algorithm to Evaluate Quantified Boolean Formulae. In Proc. of 16th National Conference on Artificial Intelligence (AAAI-98)
Search Based QBF Algorithms • Work by gradually assigning variables • A partial assignment • Undetermined • Conflict • Backtrack • Record the reason [KGS98] M. Cadoli, A. Giovanardi, M. Schaerf. An Algorithm to Evaluate Quantified Boolean Formulae. In Proc. of 16th National Conference on Artificial Intelligence (AAAI-98)
Search Based QBF Algorithms • Work by gradually assigning variables • A partial assignment • Undetermined • Conflict • Satisfied • Backtrack • Determine the covered satisfying space [KGS98] M. Cadoli, A. Giovanardi, M. Schaerf. An Algorithm to Evaluate Quantified Boolean Formulae. In Proc. of 16th National Conference on Artificial Intelligence (AAAI-98)
Search Based QBF Algorithms • Work by gradually assigning variables • A partial assignment • Undetermined • Conflict • Satisfied • The majority of QBF solvers are search based, the DPLL algorithm is an example of this
Basic DPLL Flow for QBF eu (e + u)(e’ + u’) Unknown True (1) False(0)
Basic DPLL Flow for QBF eu (e + u)(e’ + u’) e = 1 Unknown True (1) False(0)
Basic DPLL Flow for QBF eu (e + u)(e’ + u’) e = 1 Unknown True (1) u = 1 False(0)
Basic DPLL Flow for QBF eu (e + u)(e’ + u’) e = 1 Conflicting Node Unknown True (1) u = 1 False(0)
Basic DPLL Flow for QBF eu (e + u)(e’ + u’) e = 1 Backtrack Unknown True (1) u = 1 False(0)
Basic DPLL Flow for QBF eu (e + u)(e’ + u’) e = 1 e = 0 Unknown True (1) u = 1 False(0)
Basic DPLL Flow for QBF eu (e + u)(e’ + u’) e = 1 e = 0 Satisfying Node Unknown True (1) u = 1 u = 1 False(0)
Basic DPLL Flow for QBF eu (e + u)(e’ + u’) e = 1 e = 0 Backtrack Unknown True (1) u = 1 u = 1 False(0)
Basic DPLL Flow for QBF ey (e + y)(e’ + y’) e = 1 e = 0 Unknown True (1) u = 1 u = 1 u = 0 False(0)
Basic DPLL Flow for QBF eu (e + u)(e’ + u’) e = 1 e = 0 Unknown True (1) u = 1 u = 1 u = 0 False(0)
Basic DPLL Flow for QBF False eu (e + u)(e’ + u’) e = 1 e = 0 Unknown True (1) u = 1 u = 1 u = 0 False(0)
Basic DPLL Flow for QBF ue (u + e)(u’ + e’) Unknown True (1) False(0)
Basic DPLL Flow for QBF ue (u + e)(u’ + e’) u = 1 Unknown True (1) False(0)
Basic DPLL Flow for QBF ue (u + e)(u’ + e’) u = 1 Unknown True (1) e = 1 False(0)
Basic DPLL Flow for QBF ue (u + e)(u’ + e’) u = 1 Unknown True (1) e = 1 e = 0 False(0)
Basic DPLL Flow for QBF ue (u + e)(u’ + e’) u = 1 Unknown True (1) e = 1 e = 0 False(0)
Basic DPLL Flow for QBF ue (u + e)(u’ + e’) u = 1 u = 0 Unknown True (1) e = 1 e = 1 e = 0 False(0)
Basic DPLL Flow for QBF True ue (u + e)(u’ + e’) u = 1 u = 0 Unknown True (1) e = 1 e = 1 e = 0 False(0)
Naïve DPLL Based Approach • Works on a CNF database • Backtracking is chronological • No learning is possible • In contrast, learning is critical for efficient SAT
Quaffle’s Approach • A new data structure for the database • New deduction rules for this data structure • Conflict driven learning and satisfaction driven learning • Non-chronological backtracking by assertion
Outline • QBF • QBF algorithms • Satisfiability driven learning [ZM02] • Long distance resolution • Validating QBF solvers • 2QBF • Sequential circuit state space diameter problem • 2QBF algorithms • Analysis [ZM02] L. Zhang and S. Malik. Towards Symmetric Treatment of Conflicts And Satisfaction in Quantified Boolean Satisfiability Solver. In Proc. of 8th International Conference on Principles and Practice of Constraint Programming (CP2002).
CNF/DNF/ACNF/ADNF Let = C1 C2…Cm = S1 + S2 +…+ Sn Then: = (C1 C2…Cm + S1 + S2 +…+ Sn ) = C1 C2…Cm (S1 + S2 +…+ Sn) = (C1 C2…Cm + AnySubset{ S1, S2,…,Sn}) = (AnySubset{ C1,C2,…,Cm})(S1+ S2 +…+ Sn)
ACNF • Definition: A Propositional formula is said to be in Augmented CNF (ACNF)if • = C1 C2…Cm+ S1 + S2 +……+ Sk • Where Ci’s are clauses, and Sj’s are cubes. • Each Sjis contained in the clause termC1 C2…Cm. i.e.i{1,2…k}, Si C1 C2…Cm • In ACNF, cubes are redundant • Example: f = a’b’c’+a’bc+ab’c+abc’ [DNF] = (a’+b’+c’)(a’+b+c)(a+b’+c)(a+b+c’) [CNF] = (a’+b’+c’)(a’+b+c)(a+b’+c)(a+b+c’) + a’b’c’+ ab’c [ACNF]
free literal Clause Deduction Example F = (…)(…)(e1+e2’+u1+u2’)(…) • e1, e2, e3…… existential literals • Try to satisfy the formula • u1, u2, u3…… universal literals • Try to falsify the formula true literal false literal
free literal Clause Deduction Example F = (…)(…)(e1+e2’+u1+u2’)(…) • e1, e2, e3…… existential literals • Try to satisfy the formula • u1, u2, u3…… universal literals • Try to falsify the formula Free literals are all univeral,conflicting clause! true literal false literal
free literal Clause Deduction Example F = (…)(…)(e1+e2’+u1+u2’)(…) • e1, e2, e3…… existential literals • Try to satisfy the formula • u1, u2, u3…… universal literals • Try to falsify the formula If u1 and u2 have higher quantification level than e2,unit clause! true literal false literal
free literal Clause Deduction Example • e1, e2, e3…… existential literals • Try to satisfy the formula • u1, u2, u3…… universal literals • Try to falsify the formula If u1 and u2 have higher quantification level than e2,unit clause! F = (…)(…)(e1+e2’+u1+u2’)(…) true literal Implication! false literal
Unknown True (1) False(0) Deduction and Search Space Pruning
Unknown True (1) False(0) Deduction and Search Space Pruning
Deduction and Search Space Pruning Unknown True (1) Unit Clause False(0) Conflict
free literal Cube Deduction Example F = (…)(…)(e1+e2’+u1+u2’)(…) + e3e4’u3 +… • e1, e2, e3…… existential literals • Try to satisfy the formula • u1, u2, u3…… universal literals • Try to falsify the formula true literal false literal
free literal Cube Deduction Example • e1, e2, e3…… existential literals • Try to satisfy the formula • u1, u2, u3…… universal literals • Try to falsify the formula Free literals are all existential, satisfying cube! F = (…)(…)(e1+e2’+u1+u2’)(…) + e3e4’u3 +… true literal false literal
free literal Cube Deduction Example • e1, e2, e3…… existential literals • Try to satisfy the formula • u1, u2, u3…… universal literals • Try to falsify the formula If e3 has higher quantification level than u3, unit cube! F = (…)(…)(e1+e2’+u1+u2’)(…) + e3e4’u3 +… true literal false literal
free literal Cube Deduction Example • e1, e2, e3…… existential literals • Try to satisfy the formula • u1, u2, u3…… universal literals • Try to falsify the formula If e3 has higher quantification level than u3, unit cube! F = (…)(…)(e1+e2’+u1+u2’)(…) + e3e4’u3 +… true literal false literal Implication!