pspace-completeness section 8.3 giorgi japaridze theory of computability

20
PSPACE-Completeness PSPACE-Completeness Section 8.3 Giorgi Japaridze Theory of Computability

Upload: cornelius-rose

Post on 25-Dec-2015

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: PSPACE-Completeness Section 8.3 Giorgi Japaridze Theory of Computability

PSPACE-CompletenessPSPACE-Completeness

Section 8.3

Giorgi Japaridze

Theory of Computability

Page 2: 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 twoconditions: 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 easyway 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.

Page 3: PSPACE-Completeness Section 8.3 Giorgi Japaridze Theory of Computability

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(xx)

x(xx)

x(xx)

xy(xy)

xy ((xy)(xy))

xy (xy)

xy ((xy)(xy))zxy ((xyz)(xyz))

TQBF = {<> | is a true fully quantified Boolean formula}

(True Quantified Boolean Formulas)

Page 4: PSPACE-Completeness Section 8.3 Giorgi Japaridze Theory of Computability

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 TQBFPSPACE, we give an algorithm that assigns values tothe variables and recursively evaluates the truth of the formula for those values.

To show that ApTQBF for every APSPACE, 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 (andhence iff wA). 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-Levintheorem, such a tableau has polynomial width O(nk), 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 theformula. 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 muchshorter formula. End of proof idea

Page 5: PSPACE-Completeness Section 8.3 Giorgi Japaridze Theory of Computability

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 (butotherwise similar to) the proof of the Cook-Levin theorem, and we omit it.

Page 6: PSPACE-Completeness Section 8.3 Giorgi Japaridze Theory of Computability

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.

xyz[(xy)(yz)(yz)] E moves, selects x=1

yz[(1y)(yz)(yz)] A moves, selects y=0

z[(10)(0z)(0z)] E moves, selects z=1

(10)(01)(01) 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 matterhow the adversary acts) in this example?

--- Player A has a winning strategy: No matter what E does, select y=0.

Page 7: PSPACE-Completeness Section 8.3 Giorgi Japaridze Theory of Computability

The FORMULA-GAME problem 8.3.f Giorgi Japaridze Theory of Computability

xyz[(xy)(yz)(yz)] ?

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 .

Page 8: PSPACE-Completeness Section 8.3 Giorgi Japaridze Theory of Computability

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 (playerI 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 conditionthat cities cannot be repeated means that the path that is being spelled must be simple.

Peoria Austin Nashua

Albany

Amherst TusconTokyo

Orsay

Oakland ...

Page 9: PSPACE-Completeness Section 8.3 Giorgi Japaridze Theory of Computability

Generalized Geography 8.3.h Giorgi Japaridze Theory of Computability

In Generalized Geography, we take an arbitrary digraph with a designated start nodeinstead of the graph associated with the actual cities.

1

2

4

5

6

3

7

8

9

Who has a winning strategy here?

Page 10: PSPACE-Completeness Section 8.3 Giorgi Japaridze Theory of Computability

Generalized Geography 8.3.h Giorgi Japaridze Theory of Computability

In Generalized Geography, we take an arbitrary digraph with a designated start nodeinstead of the graph associated with the actual cities.

1

2

4

5

6

3

7

8

9

Who has a winning strategy here?

Player I: Choose 3.

Page 11: PSPACE-Completeness Section 8.3 Giorgi Japaridze Theory of Computability

Generalized Geography 8.3.h Giorgi Japaridze Theory of Computability

In Generalized Geography, we take an arbitrary digraph with a designated start nodeinstead of the graph associated with the actual cities.

1

2

4

5

6

3

7

8

9

Who has a winning strategy here?

Player I: Choose 3. II will have to choose 5.

Page 12: PSPACE-Completeness Section 8.3 Giorgi Japaridze Theory of Computability

Generalized Geography 8.3.h Giorgi Japaridze Theory of Computability

In Generalized Geography, we take an arbitrary digraph with a designated start nodeinstead of the graph associated with the actual cities.

1

2

4

5

6

3

7

8

9

Who has a winning strategy here?

Player I: Choose 3. II will have to choose 5.Now I selects 6, and II is stuck.

1

2

4

5

6

3

7

8

9

Who has a winning strategy here?Player II. Indeed, if I starts by choosing 3 as

before, II chooses 6 and wins.

Page 13: PSPACE-Completeness Section 8.3 Giorgi Japaridze Theory of Computability

Generalized Geography 8.3.h Giorgi Japaridze Theory of Computability

In Generalized Geography, we take an arbitrary digraph with a designated start nodeinstead of the graph associated with the actual cities.

1

2

4

5

6

3

7

8

9

Who has a winning strategy here?

Player I: Choose 3. II will have to choose 5.Now I selects 6, and II is stuck.

1

2

4

5

6

3

7

8

9

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.

Page 14: PSPACE-Completeness Section 8.3 Giorgi Japaridze Theory of Computability

Generalized Geography 8.3.h Giorgi Japaridze Theory of Computability

In Generalized Geography, we take an arbitrary digraph with a designated start nodeinstead of the graph associated with the actual cities.

1

2

4

5

6

3

7

8

9

Who has a winning strategy here?

Player I: Choose 3. II will have to choose 5.Now I selects 6, and II is stuck.

1

2

4

5

6

3

7

8

9

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 respondswith 4. If I responds with 5, II responds with

6 and wins. Otherwise, if I takes 7, II wins with 9.

Page 15: PSPACE-Completeness Section 8.3 Giorgi Japaridze Theory of Computability

GG and its PSPACE-completeness 8.3.i Giorgi Japaridze Theory of Computability

GG = {<G,b> | 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 GGPSPACE.

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.

Page 16: PSPACE-Completeness Section 8.3 Giorgi Japaridze Theory of Computability

Why GGPSPACE 8.3.j Giorgi Japaridze Theory of Computability

The following algorithm obviously decides GG:

M = “On input <G,b>, 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 b1,...,bk that b originally pointed at, recursively call M on <H,bi>. 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.

Page 17: PSPACE-Completeness Section 8.3 Giorgi Japaridze Theory of Computability

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, = x1x2x3x4... xk[c1c2...cm],where each ci is a disjunction of three literals.

Now we describe a way how to convert (in polynomial time) into <G,b> such that FORMULA-GAME iff <G,b>GG,i.e., E has a winning strategy in iff Player I has a winning strategy in <G,b>.

Page 18: PSPACE-Completeness Section 8.3 Giorgi Japaridze Theory of Computability

Why GG is PSPACE-hard (b) 8.3.l Giorgi Japaridze Theory of Computability

b

x1

x2

x3

xk

...

The left part of G will look like this: for eachvariable we create a diamond. The blue arrowsindicate Player I’s choices (turns), and the redarrows indicate Player II’s choices in the game.

The left-hand choices will correspond to choosing1 in the formula game, and the right-hand choicescorrespond to choosing 0.

1 0

Then we extend this graph by adding to it the right part as shown on the next slide for a particular example of .

x1x2x3x4... xk[c1c2...cm]x1x2x3...xk[(x1x2x3)(x2x3...)...(...)]

Page 19: PSPACE-Completeness Section 8.3 Giorgi Japaridze Theory of Computability

Why GG is PSPACE-hard (c) 8.3.m Giorgi Japaridze Theory of Computability

b

x1

x2

x3

xk

...

1 0

x1x2x3x4... xk[c1c2...cm]x1x2x3...xk[(x1x2x3)(x2x3...)...(...)]

x1

x2

x3

c1

x2

x3 c2

cm

...

c

Suppose E has a winning strategy in . Then, let Player I follow the “same” strategy in the left part of the graph.Whatever ci 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.

Page 20: PSPACE-Completeness Section 8.3 Giorgi Japaridze Theory of Computability

Why GG is PSPACE-hard (d) 8.3.n Giorgi Japaridze Theory of Computability

b

x1

x2

x3

xk

...

1 0

x1x2x3x4... xk[c1c2...cm]x1x2x3...xk[(x1x2x3)(x2x3...)...(...)]

x1

x2

x3

c1

x2

x3 c2

cm

...

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 ci,and let Player II choose that clause. Now, whatever literal of ci 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 hasa winning strategy in G.