4.6.28 · D3Theory of Computation

Worked examples — PSPACE — Quantified Boolean Formula

2,304 words10 min readBack to topic

Everything here uses only three moves from the parent:

  • is TRUE is TRUE.
  • is TRUE is TRUE.
  • No quantifiers left plug in the fixed bits and compute.

Here means "true", means "false". is OR, is AND, is NOT, is "equal" (both same), is "if… then…".


The scenario matrix

Every QBF differs along a handful of axes. This table names each cell — every worked example below is tagged with the cell(s) it covers.

Cell What varies Why it's a distinct case Covered by
A Pure This is just SAT — one player Ex 1
B Pure One failing branch kills it Ex 2
C then commits before seeing 's reply Ex 3
D then answers after seeing 's move (dependence!) Ex 4
E Order swap vs Same body, different truth value Ex 5
F A false QBF (early -failure) Short-circuit / spoiler wins Ex 6
G Degenerate: variable absent from body Quantifier over an unused variable Ex 7
H Real-world word problem (a game) Reading a game as a QBF Ex 8
I Exam twist: nested 3-alternation Depth-3 game tree, prune early Ex 9

We solve them so that every cell is hit at least once.


The examples

Ex 1 — Cell A: pure (this is SAT)


Ex 2 — Cell B: pure


Ex 3 — Cell C: then


Ex 4 — Cell D: then (dependence!)


Ex 5 — Cell E: order matters (the swap)


Ex 6 — Cell F: a FALSE QBF via early -failure


Ex 7 — Cell G: degenerate — a quantifier over an unused variable


Ex 8 — Cell H: real-world word problem (a tiny game)


Ex 9 — Cell I: exam twist — depth-3 alternation


Which cell did each example fill?

Recall Map back to the matrix
  • A → Ex 1 (pure = SAT) — SAT and NP-completeness
  • B → Ex 2 (pure )
  • C → Ex 3 (, commits first)
  • D → Ex 4 (, dependence)
  • E → Ex 5 (order swap flips truth)
  • F → Ex 6 (false via early -fail)
  • G → Ex 7 (vacuous quantifier)
  • H → Ex 8 (word-problem game)
  • I → Ex 9 (depth-3, prune with )

Self-check

Which quantifier short-circuits on the first TRUE branch?
(it is an OR).
Which quantifier short-circuits on the first FALSE branch?
(it is an AND).
In , may depend on ?
Yes — is chosen after is revealed.
Why did Ex 5's swapped formula become false?
had to fix one before seeing , so no single matched both values.
What happens to or when is absent from the body?
The quantifier is vacuous — delete it, truth is unchanged.

Related: PSPACE — Quantified Boolean Formula · NP vs PSPACE · Polynomial Hierarchy · Savitch's Theorem · PSPACE and Polynomial Space