Extending DPLL-Based QBF Solvers to Handle Free Variables Will Klieber , Mikol´ aˇ s Janota, Joao Marques-Silva, Edmund Clarke July 9, 2013 1
Open QBF ◮ Closed QBF: All variables quantified; answer is True or False. ◮ Open QBF: Contains free (unquantified) variables. ◮ Goal: Find equivalent propositional formula. ◮ E.g., given ∃ x. x ∧ ( y ∨ z ) , return y ∨ z . 2
Open QBF ◮ Closed QBF: All variables quantified; answer is True or False. ◮ Open QBF: Contains free (unquantified) variables. ◮ Goal: Find equivalent propositional formula. ◮ E.g., given ∃ x. x ∧ ( y ∨ z ) , return y ∨ z . ◮ Applications: symbolic MC, synthesis from formal spec, etc. 2
Outline ◮ Na¨ ıve Algorithm ◮ Introduce sequents that generalize clauses for open QBF in CNF (without ghost variables) ◮ Experimental results ◮ Ghost variables : see paper. 3
Na¨ ıve Algorithm ◮ Notation: “ ite( x, φ 1 , φ 2 ) ” is a formula with an if-then-else : ite( x, φ 1 , φ 2 ) = ( x ∧ φ 1 ) ∨ ( ¬ x ∧ φ 2 ) 4
Na¨ ıve Algorithm ◮ Notation: “ ite( x, φ 1 , φ 2 ) ” is a formula with an if-then-else : ite( x, φ 1 , φ 2 ) = ( x ∧ φ 1 ) ∨ ( ¬ x ∧ φ 2 ) ◮ Recursively Shannon-expand on free variables: Φ = ite( x, Φ | x = True , Φ | x = False ) 4
Na¨ ıve Algorithm ◮ Notation: “ ite( x, φ 1 , φ 2 ) ” is a formula with an if-then-else : ite( x, φ 1 , φ 2 ) = ( x ∧ φ 1 ) ∨ ( ¬ x ∧ φ 2 ) ◮ Recursively Shannon-expand on free variables: Φ = ite( x, Φ | x = True , Φ | x = False ) ◮ Base case (no more free variables): Give to closed-QBF solver. 4
Na¨ ıve Algorithm function solve( Φ ) { 1. if ( Φ has no free variables) 2. 3. return closed qbf solve( Φ ); 7. } 5
Na¨ ıve Algorithm function solve( Φ ) { 1. if ( Φ has no free variables) 2. 3. return closed qbf solve( Φ ); 4. x := (a free variable in Φ ) ; 5. return ite(x, solve( Φ | x = True ), 6. solve( Φ | x = False )); 7. } 5
Na¨ ıve Algorithm function solve( Φ ) { 1. if ( Φ has no free variables) 2. 3. return closed qbf solve( Φ ); 4. x := (a free variable in Φ ) ; 5. return ite(x, solve( Φ | x = True ), 6. solve( Φ | x = False )); 7. } Builds OBDD if: 1. same branch order, 2. formula construction is memoized, and 3. ite( x, φ, φ ) is simplified to φ . 5
Na¨ ıve Algorithm ◮ Na¨ ıve Algorithm: ◮ Similar to DPLL in terms of branching. ◮ But lacks many optimizations that make DPLL fast: ◮ Non-chronological backtracking ◮ Clause learning ◮ Our open-QBF technique: ◮ Extend existing closed-QBF algorithm to allow free variables. 6
Preliminaries ◮ Prenex Form: Q 1 � x 1 ...Q n � x n . φ where φ has no quantifiers. 7
Preliminaries ◮ Prenex Form: Q 1 � x 1 ...Q n � x n . φ where φ has no quantifiers. ◮ In ∀ x. ∃ y. φ , we say that y is downstream of x . ◮ ∃ y occurs inside scope of ∀ x . 7
Preliminaries ◮ Prenex Form: Q 1 � x 1 ...Q n � x n . φ where φ has no quantifiers. ◮ In ∀ x. ∃ y. φ , we say that y is downstream of x . ◮ ∃ y occurs inside scope of ∀ x . ◮ Free variables are upstream of all quantified variables. 7
Preliminaries ◮ Prenex Form: Q 1 � x 1 ...Q n � x n . φ where φ has no quantifiers. ◮ In ∀ x. ∃ y. φ , we say that y is downstream of x . ◮ ∃ y occurs inside scope of ∀ x . ◮ Free variables are upstream of all quantified variables. ◮ We identify assignment π with the set of literals made true by π . ◮ E.g., identify { ( e 1 , True ) , ( u 2 , False ) } with { e 1 , ¬ u 2 } . 7
Preliminaries ◮ Prenex Form: Q 1 � x 1 ...Q n � x n . φ where φ has no quantifiers. ◮ In ∀ x. ∃ y. φ , we say that y is downstream of x . ◮ ∃ y occurs inside scope of ∀ x . ◮ Free variables are upstream of all quantified variables. ◮ We identify assignment π with the set of literals made true by π . ◮ E.g., identify { ( e 1 , True ) , ( u 2 , False ) } with { e 1 , ¬ u 2 } . ◮ Substitution: Φ | π substitutes assigned variables with values (even if bound by quantifier, which gets deleted). 7
QBF as a Game ◮ Existential variables are owned by Player ∃ . ◮ Universal variables are owned by Player ∀ . ◮ Players assign variables in quantification order. ◮ The goal of Player ∃ is to make Φ be true. ◮ The goal of Player ∀ is to make Φ be false. 8
Properties of Clauses and Cubes ◮ Motivate definition of sequents. ◮ If π falsifies all literals in clause C in CNF Φ , then Φ | π = False. 9
Properties of Clauses and Cubes ◮ Motivate definition of sequents. ◮ If π falsifies all literals in clause C in CNF Φ , then Φ | π = False. ◮ If π falsifies all existential literals in clause C in CNF Φ and doesn’t satisfy any universal literals in C , then Φ | π = False. 9
Properties of Clauses and Cubes ◮ Motivate definition of sequents. ◮ If π falsifies all literals in clause C in CNF Φ , then Φ | π = False. ◮ If π falsifies all existential literals in clause C in CNF Φ and doesn’t satisfy any universal literals in C , then Φ | π = False. ◮ If π satisfies all universal literals in a cube C in a DNF Φ and doesn’t falsify any existential literals in C , then Φ | π = True. 9
Properties of Clauses and Cubes ◮ Motivate definition of sequents. ◮ If π falsifies all literals in clause C in CNF Φ , then Φ | π = False. ◮ If π falsifies all existential literals in clause C in CNF Φ and doesn’t satisfy any universal literals in C , then Φ | π = False. ◮ If π satisfies all universal literals in a cube C in a DNF Φ and doesn’t falsify any existential literals in C , then Φ | π = True. ◮ Tautological clauses learned via long-distance resolution? (Assuming ∀ -reduction is done only on-the-fly, during unit prop.) 9
� L now , L fut � Sequents ◮ Definition. A game-state specifier is a pair � L now , L fut � consisting of two sets of literals, L now and L fut . ◮ Definition. We say that � L now , L fut � matches assignment π iff: 1. for every literal ℓ in L now , ℓ | π = True, and 2. for every literal ℓ in L fut , either ℓ | π = True or ℓ �∈ vars( π ) . 10
� L now , L fut � Sequents ◮ Definition. A game-state specifier is a pair � L now , L fut � consisting of two sets of literals, L now and L fut . ◮ Definition. We say that � L now , L fut � matches assignment π iff: 1. for every literal ℓ in L now , ℓ | π = True, and 2. for every literal ℓ in L fut , either ℓ | π = True or ℓ �∈ vars( π ) . ◮ E.g., �{ e } , { u }� matches { e } and { e, u } , 10
� L now , L fut � Sequents ◮ Definition. A game-state specifier is a pair � L now , L fut � consisting of two sets of literals, L now and L fut . ◮ Definition. We say that � L now , L fut � matches assignment π iff: 1. for every literal ℓ in L now , ℓ | π = True, and 2. for every literal ℓ in L fut , either ℓ | π = True or ℓ �∈ vars( π ) . ◮ E.g., �{ e } , { u }� matches { e } and { e, u } , but does not match {} or { e, ¬ u } . 10
� L now , L fut � Sequents ◮ Definition. A game-state specifier is a pair � L now , L fut � consisting of two sets of literals, L now and L fut . ◮ Definition. We say that � L now , L fut � matches assignment π iff: 1. for every literal ℓ in L now , ℓ | π = True, and 2. for every literal ℓ in L fut , either ℓ | π = True or ℓ �∈ vars( π ) . ◮ E.g., �{ e } , { u }� matches { e } and { e, u } , but does not match {} or { e, ¬ u } . ◮ � L now , { ℓ, ¬ ℓ }� matches π only if π doesn’t assign ℓ . 10
� L now , L fut � Sequents ◮ Definition. A game-state specifier is a pair � L now , L fut � consisting of two sets of literals, L now and L fut . ◮ Definition. We say that � L now , L fut � matches assignment π iff: 1. for every literal ℓ in L now , ℓ | π = True, and 2. for every literal ℓ in L fut , either ℓ | π = True or ℓ �∈ vars( π ) . ◮ Definition. “ � L now , L fut � | = (Φ ⇔ ψ ) ” means “for all assignments π that match � L now , L fut � , Φ | π is logically equivalent to ψ | π unless π is a don’t-care assignment”. 11
� L now , L fut � Sequents ◮ Definition. A game-state specifier is a pair � L now , L fut � consisting of two sets of literals, L now and L fut . ◮ Definition. We say that � L now , L fut � matches assignment π iff: 1. for every literal ℓ in L now , ℓ | π = True, and 2. for every literal ℓ in L fut , either ℓ | π = True or ℓ �∈ vars( π ) . ◮ Definition. “ � L now , L fut � | = (Φ ⇔ ψ ) ” means “for all assignments π that match � L now , L fut � , Φ | π is logically equivalent to ψ | π unless π is a don’t-care assignment”. ◮ Without ghost literals: No assignments are don’t-care. ◮ With ghost literals: Some assignments are don’t-care. 11
Correspondence of Sequents to Clauses and Cubes ◮ Consider a QBF with existential literals e 1 ... e n and universal literals u 1 ... u m . ◮ Clause ( e 1 ∨ ... ∨ e n ∨ u 1 ∨ ... ∨ u m ) in CNF Φ in corresponds to sequent �{¬ e 1 , ..., ¬ e n } , {¬ u 1 , ..., ¬ u m }� | = (Φ in ⇔ False ) . 12
Recommend
More recommend