True quantified boolean formula

From Wikipedia, the free encyclopedia

The language TQBF is a formal language in computer science that contains True Quantified Boolean Formulas. A fully quantified boolean formula is a formula in first-order logic where every variable is quantified (or bound), using either existential or universal quantifiers, at the beginning of the sentence. Any such formula is always either true or false (since there are no free variables). If such a formula evaluates to true, then that formula is in the language TQBF. It is also known as QSAT (Quantified SAT).

Contents

[edit] Prenex Normal Form

A fully quantified Boolean formula can be assumed to have a very specific form, called prenex normal form. It has two basic parts: a portion containing only quantifiers and a portion containing an unquantified boolean formula usually denoted as φ. If there are n boolean variables, the entire formula can be written as:

\exists x_1 \forall x_2 \exists x_3 \cdots Q_n x_n \phi(x_1, x_2, x_3, \cdots, x_n)

where every variable falls within the scope of some quantifier. By introducing dummy variables, any formula in prenex normal form can be converted into a sentence where existential and universal quantifiers alternate. Using the dummy variable y1,

\exists x_1 \exists x_2 \phi(x_1, x_2) \quad \mapsto \quad  \exists x_1 \forall y_1 \exists x_2 \phi(x_1, x_2)

The second sentence has the same truth value but follows the restricted syntax. Assuming fully quantified Boolean formulas to be in prenex normal form is a frequent feature of proofs.

[edit] Solving

There is a simple recursive algorithm for determining whether a TQBF is true. Given some QBF

Q_1 x_1 Q_2 x_2 \cdots Q_n x_n \phi(x_1, x_2, \cdots, x_n)

If the formula contains no quantifiers, we can just return the formula. Otherwise, we take off the first quantifier and check both possible values for the first variable:

A = Q_2 x_2 \cdots Q_n x_n \phi(0, x_2, \cdots, x_n)
B = Q_2 x_2 \cdots Q_n x_n \phi(1, x_2, \cdots, x_n)

If Q_1 = \exists, then return A \lor B. If Q_1 = \forall, then return A \land B.

How fast does this algorithm run? For every quantifier in the initial QBF, the algorithm makes two recursive calls on only a linearly smaller subproblem. This gives the algorithm an exponential runtime O(2^n).

How much space does this algorithm use? Within each invocation of the algorithm, it needs to store the intermediate results of computing A and B. Every recursive call takes off one quantifier, so the total recursive depth is linear in the number of quantifiers. Formulas that lack quantifiers can be evaluated in space logrithmic in the number of variables. The initial QBF was fully quantified, so there are at least as many quantifiers as variables. Thus, this algorithm uses O(n + log n) = O(n) space. This makes the TQBF language part of the PSPACE complexity class.

[edit] PSPACE-Completeness

The TQBF language serves in complexity theory as the canonical PSPACE-complete problem. Being PSPACE-complete means that a language is in PSPACE and that the language is also PSPACE-hard. The algorithm above shows that TQBF is in PSPACE. Showing that TQBF is PSPACE-hard requires showing that any language in the complexity class PSPACE can be reduced to TQBF in polynomial time. I.e.,

\forall L\in \textrm{PSPACE}, L\leq_p \textrm{TQBF}

This means that, for a PSPACE language L, whether an input x is in L can be decided by checking in polynomial time (relative to the length of the input) whether f(x) is in TQBF, for some function f. Symbolically,

x\in L\iff f(x)\in \textrm{TQBF}

Proving that TQBF is PSPACE-hard, requires specification of f.

So, suppose that L is a PSPACE language. This means that L can be decided by a polynomial space deterministic Turing machine (DTM). This is very important for the reduction of L to TQBF, because the configurations of any such Turing Machine can be represented as Boolean formulas, with Boolean variables representing the state of the machine as well as the contents of each cell on the Turing Machine tape, with the position of the Turing Machine head encoded in the formula by the formula's ordering. In particular, our reduction will use the variables c1 and c2, which represent two possible configurations of the DTM for L, and a natural number t, in constructing a QBF \phi_{c_1,c_2,t} which is true if and only if the DTM for L can go from the configuration encoded in c1 to the configuration encoded in c2 in no more than t steps. The function f, then, will construct from the DTM for L a QBF \phi_{c_{start},c_{accept},T}, where cstart is the DTM's starting configuration, caccept is the DTM's accepting configuration, and T is the maximum number of steps the DTM could need to move from one configuration to the other. We know that T=O(exp(n)), where n is the length of the input, because this bounds the total number of possible configurations of the relevant DTM. Of course, it cannot take the DTM more steps than there are possible configurations to reach caccept unless it enters a loop, in which case it will never reach caccept anyway.

At this stage of the proof, we have already reduced the question of whether an input formula w (encoded, of course, in cstart) is in L to the question of whether the QBF \phi_{c_{start},c_{accept},T}, i.e., f(w), is in TQBF. The remainder of this proof proves that f can be computed in polynomial time.

For t = 1, computation of \phi_{c_1,c_2,t} is straightforward--either one of the configurations changes to the other in one step or it does not. Since the Turing Machine that our formula represents is deterministic, this presents no problem.

For t > 1, computation of \phi_{c_1,c_2,t} involves a recursive evaluation, looking for a so-called "middle point" m1. In this case, we rewrite the formula as follows:

\phi_{c_1,c_2,t}=\exists m_1(\phi_{c_1,m_1,\lceil t/2\rceil}\wedge\phi_{m_1,c_2,\lceil t/2\rceil})

This converts the question of whether c1 can reach c2 in t steps to the question of whether c1 reaches a middle point m1 in t / 2 steps, which itself reaches c2 in t / 2 steps. The answer to the latter question of course gives the answer to the former.

Now, t is only bounded by T, which is exponential (and so not polynomial) in the length of the input. Additionally, each recursive layer virtually doubles the length of the formula. (The variable m1 is only one midpoint--for greater t, there are more stops along the way, so to speak.) So the time required to recursively evaluate \phi_{c_1,c_2,t} in this manner could be exponential as well, simply because the formula could become exponentially large. This problem is solved by universally quantifying using variables c3 and c4 over the configuration pairs (e.g., {(c1,m1),(m1,c2)}), which prevents the length of the formula from expanding due to recursive layers. This yields the following interpretation of \phi_{c_1,c_2,t}:

\phi_{c_1,c_2,t}=\exists m_1\forall (c_3,c_4)\in \{ (c_1,m_1),(m_1,c_2)\}(\phi_{c_3,c_4,\lceil t/2\rceil})

This version of the formula can indeed be computed in polynomial time, since any one instance of it can be computed in polynomial time. The universally quantified ordered pair simply tells us that whichever choice of (c3,c4) is made, \phi_{c_1,c_2,t}\iff\phi_{c_3,c_4,\lceil t/2\rceil}.

Thus, \forall L\in \textrm{PSPACE}, L\leq_p \textrm{TQBF}, so TQBF is PSPACE-hard. Together with the above result that TQBF is in PSPACE, this completes the proof that TQBF is a PSPACE-complete language.

(This proof follows Sipser 2006 pp. 310-313 in all essentials. Papadimitriou 1994 also includes a proof.)

[edit] Miscellany

  • One important subproblem in TQBF is the boolean satisfiability problem. In this problem, you wish to know whether a given boolean formula φ can be made true with some assignment of variables. This is equivalent to the TQBF using only existential quantifiers:
\exists x_1 \cdots \exists x_n \phi(x_1, \ldots, x_n).
This is also an example of the larger result NP \subseteq PSPACE which follows directly from the observation that a polynomial time verifier for a proof of a language accepted by a NTM (Non-deterministic Turing Machine) requires polynomial space to store the proof.
  • Any class in the Polynomial hierarchy (PH) has TQBF as its complete problem. In other words, for the class comprised of all languages L for which there exists a poly-time TM V, a verifier, such that for all input x and some constant i,
x \in L \Leftrightarrow \exists y_1 \forall y_2 \cdots Q_i y_i \  V(x,y_1,y_2,\cdots,y_i)\ =\ 1
which has a specific QBF formulation that is given as
\exists \phi such that \exists \vec{x_1} \forall \vec{x_2} \cdots Q_i \vec{x_i}\  \phi(\vec{x_1},\vec{x_2},\cdots,\vec{x_i})\ =\ 1
where the \vec{x_i}'s are vectors of boolean variables.
  • It is important to note that while TQBF the language is defined as the collection of true quantified Boolean formulas, the abbreviation TQBF is often used (even in this article) to stand for a totally quantified Boolean formula, often simply called a QBF (quantified Boolean formula, understood as "fully" or "totally" quantified). It is important to distinguish contextually between the two uses of the abbreviation TQBF in reading the literature.
  • A TQBF can be thought of as a game played between two players, with alternating moves. Existentially quantified variables are equivalent to the notion that a move is available to a player at a turn. Universally quantified variables mean that the outcome of the game does not depend on what move a player makes at that turn. Also, a TQBF whose first quantifier is existential corresponds to a formula game in which the first player has a winning strategy.

[edit] Notes and References

  • The TQBF problem and its relationship to other results in complexity theory.
  • Generalized Geography
  • Fortnow & Homer (2003) provides some historical background for PSPACE and TQBF.
  • Zhang (2003) provides some historical background of Boolean formulas.