PSPACE-Completeness Section 8.3 Giorgi Japaridze Theory of Computability
PSPACE-completeness defined 8.3.a Giorgi Japaridze Theory of Computability Definition 8.8 A language B is PSPACE-complete iff it satisfies two conditions: 1. B is in PSPACE, and 2. every A in PSPACE is polynomial time reducible to B. If B merely satisfies condition 2, we say that it is PSPACE-hard. Why do we still appeal to polynomial time reducibility and not, say, polynomial space reducibility, philosophically speaking? A reduction must be easy relative to the class (of difficult problems) that we are defining. Only then it is the case that if we find an easy way to solve a (PSPACE-, NP- or whatever-) complete problem, easy solutions to other (reducible to it) problems would also be found. If the reduction itself is hard, it does not at all offer an easy way to solve problems.
The TQBF problem 8.3.b Giorgi Japaridze Theory of Computability Universal quantifier : xP(x) means “for any x {0,1}, P(x) is true” Existential quantifier : xP(x) means “for some x {0,1}, P(x) is true” We consider fully quantified Boolean formulas (in the prenex form). These are Boolean formulas prefixed with either x or x for each variable x. Examples (true or false?): x(x x) x(x x) x(x x) x y(x y) x y ( (x y) (x y) ) x y (x y) x y ( (x y) (x y) ) z x y ( (x y z) (x y z) ) TQBF = { | is a true fully quantified Boolean formula} (True Quantified Boolean Formulas)
The PSPACE-completeness of TQBF – proof idea 8.3.c Giorgi Japaridze Theory of Computability Theorem 8.9 TQBF is PSPACE-complete. Proof idea. To show that TQBF PSPACE, we give an algorithm that assigns values to the variables and recursively evaluates the truth of the formula for those values. To show that A p TQBF for every A PSPACE, we begin with a polynomial-space machine M for A. Then we give a polynomial time reduction that maps a string w to a formula that encodes a simulation of M on input w. is true iff M accepts w (and hence iff w A). A first, naive, attempt to do so could be trying to precisely imitate the proof of the Cook-Levin theorem. We can indeed construct a that simulates M on input w by expressing the requirements for an accepting tableau. As in the proof of the Cook-Levin theorem, such a tableau has polynomial width O(n k ), the space used by M. But the problem is that the height of the tableau would be exponential! Instead, we use a technique related to the proof of Savitch’s theorem to construct the formula. The formula divides the tableau into halves and employs the universal quantifier to represent each half with the same part of the formula. The result is a much shorter formula. End of proof idea
A polynomial space algorithm for TQBF 8.3.d Giorgi Japaridze Theory of Computability The following algorithm obviously decides TQBF: T = “On input, a fully quantified Boolean formula: 1. If contains no quantifiers, then it is an expression with only constants, so evaluate and accept if true, otherwise, reject. 2. If is x , recursively call T on , first with 0 substituted for x and then 1 substituted for x. If either result is accept, then accept; otherwise, reject. 3. If is x , recursively call T on , first with 0 substituted for x and then 1 substituted for x. If both results are accept, then accept; otherwise, reject.” Analysis: Let m be the number of variables that appear in . The depth of recursion does not exceed m. And at each level of recursion, we need only store the value of one variable. So, the total space used is O(m), and hence linear in the size of . To complete the proof of Theorem 8.9, we also need to show that TQBF is PSPACE- hard. A a detailed technical proof of this part is technically somewhat trickier than (but otherwise similar to) the proof of the Cook-Levin theorem, and we omit it.
Formulas as games 8.3.e Giorgi Japaridze Theory of Computability Each fully quantified Boolean formula (in prenex form) can be seen as a game between two players A and E. If = x (x), it is A’s move, who should select x=0 or x=1, after which the game continues as (0) or (1), respectively. x y z[(x y) (y z) (y z)] E moves, selects x=1 y z[(1 y) (y z) (y z)] A moves, selects y=0 z[(1 0) (0 z) (0 z)] E moves, selects z=1 (1 0) (0 1) (0 1) A wins If = x (x), it is E’s move, who should select x=0 or x=1, after which the game continues as (0) or (1), respectively. The play continues until all quantifiers are stripped off, after which E is considered the winner iff the final, variable-free formula, is true. Who has a winning strategy (a strategy that guarantees a win no matter how the adversary acts) in this example? --- Player A has a winning strategy: No matter what E does, select y=0.
The FORMULA-GAME problem 8.3.f Giorgi Japaridze Theory of Computability x y z[(x y) (y z) (y z)] ? E: Select x=1, and select z to be the negation of whatever A selects for y. Who has a winning strategy in FORMULA-GAME = { | Player E has a winning strategy in } Theorem 8.11 FORMULA-GAME is PSPACE-complete. Proof. This is so for a simple reason: we simply have FORMULA-GAME = TQBF. To see this, observe that is true iff player E has a winning strategy in it. A detailed proof of this fact (if it was necessary) can proceed by induction on the length of the quantifier-prefix of .
The child’s game Geography 8.3.g Giorgi Japaridze Theory of Computability Players, called I and II, take turns naming cities from anywhere in the world (player I starts). Each city chosen must begin with the same letter that ended the previous city’s name. Repetitions are not permitted. The player who is unable to continue loses. We can model this game with a directed graph whose nodes are the cities of the world. There is an edge from one city to another if the first can lead to the second according to the game rules. One node is designated as the start node/city. The condition that cities cannot be repeated means that the path that is being spelled must be simple. PeoriaAustinNashua Albany AmherstTusconTokyo Orsay Oakland...
Generalized Geography 8.3.h Giorgi Japaridze Theory of Computability In Generalized Geography, we take an arbitrary digraph with a designated start node instead of the graph associated with the actual cities Who has a winning strategy here?
Generalized Geography 8.3.h Giorgi Japaridze Theory of Computability In Generalized Geography, we take an arbitrary digraph with a designated start node instead of the graph associated with the actual cities Who has a winning strategy here? Player I: Choose 3.
Generalized Geography 8.3.h Giorgi Japaridze Theory of Computability In Generalized Geography, we take an arbitrary digraph with a designated start node instead of the graph associated with the actual cities Who has a winning strategy here? Player I: Choose 3. II will have to choose 5.
Generalized Geography 8.3.h Giorgi Japaridze Theory of Computability In Generalized Geography, we take an arbitrary digraph with a designated start node instead of the graph associated with the actual cities Who has a winning strategy here? Player I: Choose 3. II will have to choose 5. Now I selects 6, and II is stuck Who has a winning strategy here? Player II. Indeed, if I starts by choosing 3 as before, II chooses 6 and wins.
Generalized Geography 8.3.h Giorgi Japaridze Theory of Computability In Generalized Geography, we take an arbitrary digraph with a designated start node instead of the graph associated with the actual cities Who has a winning strategy here? Player I: Choose 3. II will have to choose 5. Now I selects 6, and II is stuck Who has a winning strategy here? Player II. Indeed, if I starts by choosing 3 as before, II chooses 6 and wins. Now assume I starts with 2.
Generalized Geography 8.3.h Giorgi Japaridze Theory of Computability In Generalized Geography, we take an arbitrary digraph with a designated start node instead of the graph associated with the actual cities Who has a winning strategy here? Player I: Choose 3. II will have to choose 5. Now I selects 6, and II is stuck Who has a winning strategy here? Player II. Indeed, if I starts by choosing 3 as before, II chooses 6 and wins. Now assume I starts with 2. Then II responds with 4. If I responds with 5, II responds with 6 and wins. Otherwise, if I takes 7, II wins with 9.
GG and its PSPACE-completeness 8.3.i Giorgi Japaridze Theory of Computability GG = { | Player I has a winning strategy for the Generalized Geography game played on graph G starting at node b} Theorem 8.14 GG is PSPACE-complete. Proof idea. A recursive algorithm similar to the one used for TQBF in Theorem 8.9 determines which player has a winning strategy. This algorithm runs in polynomial space and so GG PSPACE. To prove that GG is PSPACE-hard, we give a polynomial time reduction from FORMULA-GAME to GG. This reduction converts a formula game to a generalized geography graph G so that play on G mimics play in . In effect, the players in the generalized geography game are really playing an encoded form of the formula game. On the following slides we give a more detailed argument.
Why GG PSPACE 8.3.j Giorgi Japaridze Theory of Computability The following algorithm obviously decides GG: M = “On input, where G is a digraph and b is a node of G: 1. If b has outdegree 0, reject, because Player I loses immediately. 2. Remove node b and all connected arrows to get a new graph H. 3. For each of the nodes b 1,...,b k that b originally pointed at, recursively call M on. 4. If all of these accept, Player II has a winning strategy in the original game, so reject. Otherwise, Player II doesn’t have a winning strategy, so Player I must; therefore, accept. Analysis: Let m be the number of nodes in G. The only space required by this algorithm is for storing the recursion stack. Each level of the recursion adds a single node to the stack, and at most m levels occur. Hence the algorithm runs in linear space.
Why GG is PSPACE-hard (a) 8.3.k Giorgi Japaridze Theory of Computability Consider any formula-game . We may assume that both its first and last quantifiers are , and that the quantifiers strictly alternate. If not, we can easily bring to this form by adding dummy variables and quantifiers. Furthermore, we can assume that the quantifier-free part of is a 3cnf-formula, otherwise it can be converted to such. All these conversions yield an equivalent formula and take a polynomial amount of time. Thus, = x 1 x 2 x 3 x 4... x k [c 1 c 2 ... c m ], where each c i is a disjunction of three literals. Now we describe a way how to convert (in polynomial time) into such that FORMULA-GAME iff GG, i.e., E has a winning strategy in iff Player I has a winning strategy in.
Why GG is PSPACE-hard (b) 8.3.l Giorgi Japaridze Theory of Computability b x1x1 x2x2 x3x3 xkxk... The left part of G will look like this: for each variable we create a diamond. The blue arrows indicate Player I’s choices (turns), and the red arrows indicate Player II’s choices in the game. The left-hand choices will correspond to choosing 1 in the formula game, and the right-hand choices correspond to choosing Then we extend this graph by adding to it the right part as shown on the next slide for a particular example of . x 1 x 2 x 3 x 4... x k [c 1 c 2 ...c m ] x 1 x 2 x 3... x k [(x 1 x 2 x 3 ) (x 2 x 3 ...) ... (...)]
Why GG is PSPACE-hard (c) 8.3.m Giorgi Japaridze Theory of Computability b x1x1 x2x2 x3x3 xkxk x 1 x 2 x 3 x 4... x k [c 1 c 2 ...c m ] x 1 x 2 x 3... x k [(x 1 x 2 x 3 ) (x 2 x 3 ...) ... (...)] x1x1 x2x2 x3x3 c1c1 x2x2 x3x3 c2c2 cmcm... c Suppose E has a winning strategy in . Then, let Player I follow the “same” strategy in the left part of the graph. Whatever c i is chosen by Player II, it is a true clause and thus has a true literal. Let then Player I choose such a true literal. Then Player II is stuck, as the path has already passed through the corresponding left or right node of the corresponding diamond. So, Player I has a winning strategy in G.
Why GG is PSPACE-hard (d) 8.3.n Giorgi Japaridze Theory of Computability b x1x1 x2x2 x3x3 xkxk x 1 x 2 x 3 x 4... x k [c 1 c 2 ...c m ] x 1 x 2 x 3... x k [(x 1 x 2 x 3 ) (x 2 x 3 ...) ... (...)] x1x1 x2x2 x3x3 c1c1 x2x2 x3x3 c2c2 cmcm... c Suppose now A has a winning strategy in . Then, let it follow the “same” strategy in the left part of the graph. Then there is a false clause c i, and let Player II choose that clause. Now, whatever literal of c i is chosen by Player I, it is a false literal and hence the path has not passed through it. So, Player II is not stuck, and goes to the corresponding left or right node of the corresponding diamond. Now Player I is stuck. Thus, II has a winning strategy in G.