In propositional logic we saw the concept of satisfiability. We can now extend this concept to QPL formulas.
Definition 2.33| QPL Satisfiability A QPL formula ϕ is satisfiable, if there exists an
assignment β : free(ϕ) → B of the free variables such that eval(ϕ, β) = true. We call β a model of ϕ and write β |= ϕ.
In first order logic, the satisfiability (or validity) of formulas is not decidable but only semi-decidable. In QPL however, satisfiability is decidable. We distinguish two cases: (1) sentences (purely existentially or fully quantified), and (2) arbitrary formulas. Satisfiability of QPL Sentences
Taking the Definition 2.33 of QPL satisfiability, a formula is satisfiable if there is an assignment to its free variables such that the formula evaluates to true. In a QPL sentence there are no free variables, therefore it can be evaluated without any assignment. Obviously the validity of a QPL sentence can be decided. Definition 2.29 already presents a recursive decision procedure. For a universal quantifier ∀x both branches x 7→ true and x 7→ false must recursively evaluate to true. For an existential quantifier ∃x only one branch must evaluate to true. Figure 2.11 visualizes the situation. eval(8x9y[(x _ y) ^ (¬x _ ¬y)], ;)
8x
9y
9y
x7! false x7! truey7! true y7! false y7! true
false true true
Figure 2.11 |Evaluation of a QPL sentence
We consider the formula ϕ = ∀x∃y[(x ∨ y) ∧ (¬x ∨ ¬y)]. In the quantifier prefix of ϕ the first quantifier is a universal quantifier, i.e. both assignments of x need to evaluate to true. We first consider x 7→ true. The next quantifier ∃y is an existential quantifier, therefore a single branch evaluating to true is sufficient. We again first consider y 7→ true, thus we have eval((x∨y)∧(¬x∨¬y), {x 7→ true, y 7→ true}) =
false, meaning this branch is not satisfying, thus we have to consider y 7→ false. This branch now evaluates to true. But since the top level node was a universal quantifier, we also have to consider the branch x 7→ false. Here, the assignment {x7→ false, y 7→ true} satisfies the branch, therefore the whole formula ϕ evaluates to true.
This decision procedure looks a lot like the DPLL algorithm. In fact, if we consider an existential QPL sentence, the decision procedure is exactly the DPLL algorithm. This is obvious, since the satisfiability of an existential QPL sentence is exactly the SAT problem. All variables are existentially quantified, so the sentence evaluates to trueif and only if there exists an assignment of the variables such that the matrix of the formula is satisfied. Since the matrix is an ordinary propositional formula, this degenerates to the SAT problem as stated in Definition 2.18.
The satisfiability for arbitrary QPL sentences is also a well known problem: the QBF problem (Quantified Boolean Formulas). An overview of QBF can be found in [Büning & Bubeck, 2009]. One possible approach to QBF solving is the alteration of the CDCL algorithm as presented in [Zhang & Malik, 2002]. As we have seen, backtracking has to be performed not only in the case of an unsatisfying branch, but also in the case of satisfying branches when there were universal quantifiers in the prefix of this path. We state an altered version of the CDCL algorithm which reflects the backtracking for universally quantified variables. Algorithm 2.5 sketches the procedure and is for a QPL sentence ϕ initially called with qbf(ϕ, ∅).
The procedure analyzeConflict learns a new clause and returns a suitable backtrack level very similar to CDCL for propositional logic. However, it has to be adjusted to also consider universally quantified variables. During the procedure analyzeSAT the value of the last universally quantified variable is flipped in order to search both branches in the search tree. Notice that when replacing Lines 12–15 by return truewe obtain the original CDCL SAT algorithm. In fact if there are no universally quantified variables then qbf proceeds exactly like cdcl.
For the variable selection in Line 18 there are essentially the same heuristics used as with SAT. There is, however, one important restriction: successive quantifiers of the same type are grouped like
Q1x1. . .Q1xk1Q2xk1+1. . .Q2xk2. . .ϕ,
where Qi ∈ {∃, ∀}, Qi+1 6= Qi, and xj ∈ vars(ϕ). The index i ∈ N of Qiis the
quantification level of the corresponding quantified variables xki−1+1, ..., xki. The
variable selection heuristics must choose a variable from the smallest quantification level where there are still unassigned variables. Notice that in the worst case of alternating quantifiers like ∃x1∀x2∃x3∀x4. . .ϕone must successively pick x1, x2, x3, x4, ..., i.e. there is no choice at all.
It is noteworthy that in contrast to most existing implementations of a QBF decision procedure, the version above does not only return the truth value τ but also the original formula ϕ extended with learned clauses and the last assignment β. This additional information is required for the full quantifier elimination algorithm for QPL described in Section 2.6.2.
2.5 Quantified Propositional Logic
Algorithm 2.5 |Satisfiability of a QPL Sentence: qbf(ϕ, β)
Input: A QPL sentence ϕ in PNF with mat(ϕ) in CNF and an optional assignment β for variables existentially quantified in the outermost block of ϕ
Output: (τ, ϕ0,β0), with τ ∈ {true, false}, ϕ0 ≡ ϕ with additional learned clauses, and β0the final variable assignment
1 label all assignments in β with level = −1 2 level= 0
3 while true do
4 unitpropagate(ϕ, β)
5 if ϕcontains an empty clause e then 6 level= analyzeConflict(e, ϕ) 7 if level = −1 then 8 return (false, ϕ, β) 9 backtrack(level) 10 else 11 if β |= ϕ then 12 level= analyzeSAT() 13 if level = 0 then 14 return (true, ϕ, β) 15 backtrack(level) 16 else 17 level= level + 1
18 choose x ∈ vars(ϕ) \ dom(β) wrt. the quantification level 19 β= β∪ {(x 7→ false)}
The satisfiability problem for QPL sentences is solvable in polynomial space and complete for PSPACE [Büning & Bubeck, 2009].
Satisfiability of Arbitrary QPL Formulas
Considering the satisfiability of QPL formulas with free and bound variables, we need to find an assignment to the free variables, such that the formula evaluates to true. Therefore the question is, whether there exists an assignment to the free variables. To answer the satisfiability problem, we can existentially quantify all free variables at the outermost level and solve the corresponding satisfiability problem for the resulting QPL sentence.
Example 2.16| Reducing QPL Satisfiability to QPL Sentence Satisfiability Let
ϕ=∃x∀y[(x ∨ y ∨ ¬u) ∧ (¬x ∨ ¬y ∨ w) ∧ (u ∨ w)].
The QPL formula ϕ is satisfiable if and only if there exists an assignment β of w and u such that ϕ evaluates to true under this assignment, eval(ϕ, β) = true.
This is equivalent to compute the solution of the QBF problem ϕ0=∃u∃w∃x∀y[(x ∨ y ∨ ¬u) ∧ (¬x ∨ ¬y ∨ w) ∧ (u ∨ w)]
which can be solved by the algorithm sketched in the last section. In fact, ϕ0 is satisfiable. If we consider e.g. the assignment {u 7→ true, w 7→ true, x 7→ true}, the formula is already satisfied and the assignment of the universally quantified variable y does not matter.
Since each satisfiability problem of arbitrary QPL formulas can be reduced to a satisfiability problem of QPL sentences in linear time, the complexity of the satisfia- bility problem for QPL formulas is again in polynomial space and is complete for PSPACE.
2.6 Quantifier Elimination for QPL
Besides satisfiability, for QPL formulas ϕ with free variables there is another inter- esting question: can we find a quantifier-free formula ϕ0which is equivalent to the original quantified formula ϕ. Such a quantifier-free equivalent formula ϕ0would then express necessary and sufficient conditions to the free variables of ϕ such that ϕ can evaluate to true. Before we present the necessary definitions and go into detail, we want to illustrate this problem with a small example.
Example 2.17| Quantifier Elimination for QPL We consider the formula
ϕ=∃x∀y[(x ∨ y ∨ ¬u) ∧ (¬x ∨ ¬y ∨ w) ∧ (u ∨ w)].
We saw in Example 2.16 that this formula is satisfiable. The question now is under which conditions to the free variables u and w can this formula evaluate to true. We see e.g. that if u and w are both assigned to false, the formula can never be satisfied because the last clause always evaluates to false. If w is assigned to false, u has to be assigned to true because of the last clause. Then the formula can be reduced to ∃x∀y[(x ∨ y) ∧ (¬x ∨ ¬y)] which evaluates to false. Therefore we can establish the condition that w has to be assigned to true in order that ϕ can evaluate to true. In fact, the formula ϕ0= wis the quantifier-free equivalent to ϕ. Before we can state the quantifier elimination problem formally, we need to define what equivalence on QPL formula means.
Definition 2.34| Entailment and Equivalence of QPL formulas A QPL formula ϕ en-
tails a QPL formula ψ, ϕ |= ψ, if and only if for each model β |= ϕ we have β |= ψ. Two QPL formulas ϕ and ψ are equivalent, ϕ ≡ ψ, if both ϕ |= ψ and ψ |= ϕ. Two formulas are equisatisfiable if both are satisfiable or both are unsatisfiable. Note that models on QPL formulas only cover the free variables. This means also that two QPL sentences (not formulas) are equivalent if and only if they are equisatisfiable.
2.6 Quantifier Elimination for QPL
We can now revisit Example 2.17. We stated that
∃x∀y[(x ∨ y ∨ ¬u) ∧ (¬x ∨ ¬y ∨ w) ∧ (u ∨ w)] ≡ w
Obviously the formula w has a single model {w 7→ true} which is also a model for ∃x∀y[(x ∨ y ∨ ¬u) ∧ (¬x ∨ ¬y ∨ w) ∧ (u ∨ w)]. The latter formula has two models: {w7→ true, u 7→ true} and {w 7→ true, u 7→ false} both of which are models of w. Therefore the two formulas are equivalent.
We can now formally state the quantifier elimination problem for QPL.
Definition 2.35| Quantifier Elimination Procedure for Quantified Propositional Logic
A quantifier elimination procedure (QE) for QPL computes for an arbitrary QPL input formula ϕ a quantifier-free formula ψ with ϕ ≡ ψ.
Not every structure allows quantifier elimination. We have to assure that QPL allows quantifier elimination.
Theorem 2.1| Existence of QE for QPL QPL allows quantifier elimination.
Proof We prove the theorem by providing a quantifier elimination procedure for
QPL. This procedure is closely related to the one presented in [Seidl & Sturm, 2003]. There are only two possible values for variables in QPL, so we can ex- tract each quantifier over these values. According to Definition 2.29 a formula ϕ = ∀x[ψ] evaluates to true if and only if eval(ψ, β ∪ {x 7→ true}) = true and eval(ψ, β∪ {x 7→ false}) = true. Instead of extending the assignment with x7→ true and x 7→ false, we can substitute the corresponding truth values in the respective formula, i.e. ϕ evaluates to true if and only if eval(ψ[>/x]) = true and eval(ψ[⊥/x]) = true. This can be further simplified by looking at the evaluation of ∧: ϕ evaluates to true if and only if ψ[>/x] ∧ ψ[⊥/x] evaluates to true. Analo- gously we replace an existential quantifier ∃x[ψ] with ψ[>/x] ∨ ψ[⊥/x]. Several quantifiers are successively eliminated from a prenex input formula starting with
the innermost quantifier.
Of course the procedure as stated above is not suited for large problems. But if we introduce a simplification step after each elimination of a quantifier, experiments show that we can already handle reasonably large formulas. We will look at this quantifier elimination procedure in more detail in the next section and refer to it as
Substitute & Simplify. In [Seidl & Sturm, 2003] it is shown that for an input formula
ϕ= Q1x1. . .Qnxn[ψ]with Qi∈ {∀, ∃} and ψ quantifier-free the resulting quantifier- free formula ϕ0has a length of
O(2n|ψ|) = 2O|ϕ| where | · | denotes the word length.
In the next two sections we will take a closer look at different quantifier elimination procedures for QPL. In Section 2.6.1 we will consider only existential QPL formulas. In this case quantifier elimination is equivalent to projecting the formula to the set of free variables. Section 2.6.2 then takes a look at quantifier elimination procedures for arbitrary QPL formulas.