True quantified Boolean formula
Encyclopedia
In computational complexity theory
, the language TQBF is a formal language
consisting of the true quantified Boolean formulas. A (fully) quantified Boolean formula is a formula in quantified
propositional logic where every variable is quantified (or bound), using either existential
or universal
quantifiers, at the beginning of the sentence. Such a formula is equivalent to 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
).
in which both existential quantifiers
and universal quantifiers
can be applied to each variable. Put another way, it asks whether a quantified sentential form over a set of Boolean variables is true or false. For example, the following is an instance of QBF:
QBF is the canonical complete problem for PSPACE
, the class of problems solvable by a deterministic or nondeterministic Turing machine
in polynomial space and unlimited time. Given the formula in the form of an abstract syntax tree
, the problem can be solved easily by a set of mutually recursive procedures which evaluate the formula. Such an algorithm uses space proportional to the height of the tree, which is linear in the worst case, but uses time exponential in the number of quantifiers.
Provided that MA ⊊ PSPACE, which is widely believed, QBF cannot be solved, nor can a given solution even be verified, in either deterministic or probabilistic
polynomial time (in fact, unlike the satisfiability problem, there's no known way to specify a solution succinctly). It is trivial to solve using an alternating Turing machine
in linear time, which is no surprise since in fact AP = PSPACE, where AP is the class of problems alternating machines can solve in polynomial time.
When the seminal result IP
= PSPACE was shown (see interactive proof system
), it was done by exhibiting an interactive proof system that could solve QBF by solving a particular arithmetization of the problem.
QBF formulas have a number of useful canonical forms. For example, it can be shown that there is a polynomial-time many-one reduction that will move all quantifiers to the front of the formula and make them alternate between universal and existential quantifiers. There is another reduction that proved useful in the IP = PSPACE proof where no more than one universal quantifier is placed between each variable's use and the quantifier binding that variable. This was critical in limiting the number of products in certain subexpressions of the arithmetization.
. 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
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 ,
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.
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:
If , then return . If , then return .
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 logarithmic 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
.
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.,
This means that, for a PSPACE language L, whether an input is in L can be decided by checking whether is in TQBF, for some function that is required to run in polynomial time (relative to the length of the input) Symbolically,
Proving that TQBF is PSPACE-hard, requires specification of .
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 and , which represent two possible configurations of the DTM for L, and a natural number t, in constructing a QBF which is true if and only if the DTM for L can go from the configuration encoded in to the configuration encoded in in no more than t steps. The function , then, will construct from the DTM for L a QBF , where is the DTM's starting configuration, 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 unless it enters a loop, in which case it will never reach anyway.
At this stage of the proof, we have already reduced the question of whether an input formula (encoded, of course, in ) is in L to the question of whether the QBF , i.e., , is in TQBF. The remainder of this proof proves that can be computed in polynomial time.
For , computation of 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 , computation of involves a recursive evaluation, looking for a so-called "middle point" . In this case, we rewrite the formula as follows:
This converts the question of whether can reach in t steps to the question of whether reaches a middle point in steps, which itself reaches in 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 is only one midpoint--for greater t, there are more stops along the way, so to speak.) So the time required to recursively evaluate 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 and over the configuration pairs (e.g., ), which prevents the length of the formula from expanding due to recursive layers. This yields the following interpretation of :
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 is made, .
Thus, , 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.)
Computational complexity theory
Computational complexity theory is a branch of the theory of computation in theoretical computer science and mathematics that focuses on classifying computational problems according to their inherent difficulty, and relating those classes to each other...
, the language TQBF is a formal language
Formal language
A formal language is a set of words—that is, finite strings of letters, symbols, or tokens that are defined in the language. The set from which these letters are taken is the alphabet over which the language is defined. A formal language is often defined by means of a formal grammar...
consisting of the true quantified Boolean formulas. A (fully) quantified Boolean formula is a formula in quantified
Quantification
Quantification has several distinct senses. In mathematics and empirical science, it is the act of counting and measuring that maps human sense observations and experiences into members of some set of numbers. Quantification in this sense is fundamental to the scientific method.In logic,...
propositional logic where every variable is quantified (or bound), using either existential
Existential quantification
In predicate logic, an existential quantification is the predication of a property or relation to at least one member of the domain. It is denoted by the logical operator symbol ∃ , which is called the existential quantifier...
or universal
Universal quantification
In predicate logic, universal quantification formalizes the notion that something is true for everything, or every relevant thing....
quantifiers, at the beginning of the sentence. Such a formula is equivalent to 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
Boolean satisfiability problem
In computer science, satisfiability is the problem of determining if the variables of a given Boolean formula can be assigned in such a way as to make the formula evaluate to TRUE...
).
Overview
In computational complexity theory, the quantified Boolean formula problem (QBF) is a generalization of the Boolean satisfiability problemBoolean satisfiability problem
In computer science, satisfiability is the problem of determining if the variables of a given Boolean formula can be assigned in such a way as to make the formula evaluate to TRUE...
in which both existential quantifiers
Existential quantification
In predicate logic, an existential quantification is the predication of a property or relation to at least one member of the domain. It is denoted by the logical operator symbol ∃ , which is called the existential quantifier...
and universal quantifiers
Universal quantification
In predicate logic, universal quantification formalizes the notion that something is true for everything, or every relevant thing....
can be applied to each variable. Put another way, it asks whether a quantified sentential form over a set of Boolean variables is true or false. For example, the following is an instance of QBF:
QBF is the canonical complete problem for PSPACE
PSPACE
In computational complexity theory, PSPACE is the set of all decision problems which can be solved by a Turing machine using a polynomial amount of space.- Formal definition :...
, the class of problems solvable by a deterministic or nondeterministic Turing machine
Turing machine
A Turing machine is a theoretical device that manipulates symbols on a strip of tape according to a table of rules. Despite its simplicity, a Turing machine can be adapted to simulate the logic of any computer algorithm, and is particularly useful in explaining the functions of a CPU inside a...
in polynomial space and unlimited time. Given the formula in the form of an abstract syntax tree
Abstract syntax tree
In computer science, an abstract syntax tree , or just syntax tree, is a tree representation of the abstract syntactic structure of source code written in a programming language. Each node of the tree denotes a construct occurring in the source code. The syntax is 'abstract' in the sense that it...
, the problem can be solved easily by a set of mutually recursive procedures which evaluate the formula. Such an algorithm uses space proportional to the height of the tree, which is linear in the worst case, but uses time exponential in the number of quantifiers.
Provided that MA ⊊ PSPACE, which is widely believed, QBF cannot be solved, nor can a given solution even be verified, in either deterministic or probabilistic
Probabilistic Turing machine
In computability theory, a probabilistic Turing machine is a non-deterministic Turing machine which randomly chooses between the available transitions at each point according to some probability distribution....
polynomial time (in fact, unlike the satisfiability problem, there's no known way to specify a solution succinctly). It is trivial to solve using an alternating Turing machine
Alternating Turing machine
In computational complexity theory, an alternating Turing machine is a non-deterministic Turing machine with a rule for accepting computations that generalizes the rules used in the definition of the complexity classes NP and co-NP...
in linear time, which is no surprise since in fact AP = PSPACE, where AP is the class of problems alternating machines can solve in polynomial time.
When the seminal result IP
IP (complexity)
In computational complexity theory, the class IP is the class of problems solvable by an interactive proof system. The concept of an interactive proof system was first introduced by Shafi Goldwasser, Silvio Micali, and Charles Rackoff in 1985...
= PSPACE was shown (see interactive proof system
Interactive proof system
In computational complexity theory, an interactive proof system is an abstract machine that models computation as the exchange of messages between two parties. The parties, the verifier and the prover, interact by exchanging messages in order to ascertain whether a given string belongs to a...
), it was done by exhibiting an interactive proof system that could solve QBF by solving a particular arithmetization of the problem.
QBF formulas have a number of useful canonical forms. For example, it can be shown that there is a polynomial-time many-one reduction that will move all quantifiers to the front of the formula and make them alternate between universal and existential quantifiers. There is another reduction that proved useful in the IP = PSPACE proof where no more than one universal quantifier is placed between each variable's use and the quantifier binding that variable. This was critical in limiting the number of products in certain subexpressions of the arithmetization.
Prenex normal form
A fully quantified Boolean formula can be assumed to have a very specific form, called prenex normal formPrenex normal form
A formula of the predicate calculus is in prenex normal form if it is written as a string of quantifiers followed by a quantifier-free part .Every formula in classical logic is equivalent to a formula in 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
where every variable falls within the scope
Free variables and bound variables
In mathematics, and in other disciplines involving formal languages, including mathematical logic and computer science, a free variable is a notation that specifies places in an expression where substitution may take place...
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 ,
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.
Solving
There is a simple recursive algorithm for determining whether a TQBF is true. Given some QBFIf 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:
If , then return . If , then return .
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)
Big O notation
In mathematics, big O notation is used to describe the limiting behavior of a function when the argument tends towards a particular value or infinity, usually in terms of simpler functions. It is a member of a larger family of notations that is called Landau notation, Bachmann-Landau notation, or...
.
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 logarithmic 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
PSPACE
In computational complexity theory, PSPACE is the set of all decision problems which can be solved by a Turing machine using a polynomial amount of space.- Formal definition :...
complexity class
Complexity class
In computational complexity theory, a complexity class is a set of problems of related resource-based complexity. A typical complexity class has a definition of the form:...
.
PSPACE-completeness
The TQBF language serves in complexity theoryComputational complexity theory
Computational complexity theory is a branch of the theory of computation in theoretical computer science and mathematics that focuses on classifying computational problems according to their inherent difficulty, and relating those classes to each other...
as the canonical PSPACE-complete
PSPACE-complete
In complexity theory, a decision problem is PSPACE-complete if it is in the complexity class PSPACE, and every problem in PSPACE can be reduced to it in polynomial time...
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.,
This means that, for a PSPACE language L, whether an input is in L can be decided by checking whether is in TQBF, for some function that is required to run in polynomial time (relative to the length of the input) Symbolically,
Proving that TQBF is PSPACE-hard, requires specification of .
So, suppose that L is a PSPACE language. This means that L can be decided by a polynomial space deterministic Turing machine
Turing machine
A Turing machine is a theoretical device that manipulates symbols on a strip of tape according to a table of rules. Despite its simplicity, a Turing machine can be adapted to simulate the logic of any computer algorithm, and is particularly useful in explaining the functions of a CPU inside a...
(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 and , which represent two possible configurations of the DTM for L, and a natural number t, in constructing a QBF which is true if and only if the DTM for L can go from the configuration encoded in to the configuration encoded in in no more than t steps. The function , then, will construct from the DTM for L a QBF , where is the DTM's starting configuration, 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 unless it enters a loop, in which case it will never reach anyway.
At this stage of the proof, we have already reduced the question of whether an input formula (encoded, of course, in ) is in L to the question of whether the QBF , i.e., , is in TQBF. The remainder of this proof proves that can be computed in polynomial time.
For , computation of 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 , computation of involves a recursive evaluation, looking for a so-called "middle point" . In this case, we rewrite the formula as follows:
This converts the question of whether can reach in t steps to the question of whether reaches a middle point in steps, which itself reaches in 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 is only one midpoint--for greater t, there are more stops along the way, so to speak.) So the time required to recursively evaluate 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 and over the configuration pairs (e.g., ), which prevents the length of the formula from expanding due to recursive layers. This yields the following interpretation of :
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 is made, .
Thus, , 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.)
Miscellany
- One important subproblem in TQBF is the Boolean satisfiability problemBoolean satisfiability problemIn computer science, satisfiability is the problem of determining if the variables of a given Boolean formula can be assigned in such a way as to make the formula evaluate to TRUE...
. 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:
- This is also an example of the larger result NP 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 machineNon-deterministic Turing machineIn theoretical computer science, a Turing machine is a theoretical machine that is used in thought experiments to examine the abilities and limitations of computers....
) requires polynomial space to store the proof.- Any class in the polynomial hierarchyPolynomial hierarchyIn computational complexity theory, the polynomial hierarchy is a hierarchy of complexity classes that generalize the classes P, NP and co-NP to oracle machines...
(PH) has TQBF as its complete problem. In other words, for the class comprising all languages L for which there exists a poly-time TM V, a verifier, such that for all input x and some constant i,
- Any class in the polynomial hierarchy
- which has a specific QBF formulation that is given as
-
- such that
- where the '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 gameFormula gameA formula game is an artificial game represented by a fully quantified Boolean formula. Players' turns alternate and the space of possible moves is denoted by bound variables. If a variable is universally quantified, the formula following it has the same truth value as the formula beginning with...
in which the first player has a winning strategy. - A TQBF for which the quantified formula is in 2-CNFConjunctive normal formIn Boolean logic, a formula is in conjunctive normal form if it is a conjunction of clauses, where a clause is a disjunction of literals.As a normal form, it is useful in automated theorem proving...
may be solved in linear time, by an algorithm involving strong connectivity analysisStrongly connected componentA directed graph is called strongly connected if there is a path from each vertex in the graph to every other vertex. In particular, this means paths in each direction; a path from a to b and also a path from b to a....
of its implication graphImplication graphIn mathematical logic, an implication graph is a skew-symmetric directed graph G composed of vertex set V and directed edge set E. Each vertex in V represents the truth status of a Boolean literal, and each directed edge from vertex u to vertex v represents the material implication "If the literal...
. The 2-satisfiability2-satisfiabilityIn computer science, 2-satisfiability is the problem of determining whether a collection of two-valued variables with constraints on pairs of variables can be assigned values satisfying all the constraints...
problem is a special case of TQBF for these formulas, in which every quantifier is existential. - There is a systematic treatment of restricted versions of quantified boolean formulas (giving Schaefer-type classifications) provided in an expository paper by Hubie Chen.
See also
- Cook–Levin theorem, stating that SATBoolean satisfiability problemIn computer science, satisfiability is the problem of determining if the variables of a given Boolean formula can be assigned in such a way as to make the formula evaluate to TRUE...
is NP-completeNP-completeIn computational complexity theory, the complexity class NP-complete is a class of decision problems. A decision problem L is NP-complete if it is in the set of NP problems so that any given solution to the decision problem can be verified in polynomial time, and also in the set of NP-hard... - Generalized geographyGeneralized GeographyIn computational complexity theory, generalized geography is a problem that can be proven to be PSPACE-complete.-Introduction:Geography is a children's game, which is good for a long car trip, where players take turns naming cities from anywhere in the world. Each city chosen must begin with the...