QSAT is in PSPACE #
The membership half: the truth of a fully quantified Boolean formula is SO(TC)
definable, hence in DescriptiveComplexity.PSPACE.
The walk is the classical depth-first evaluation of the game tree, which is where the polynomial space of PSPACE is spent: the stack is a set of variables, and a set is one monadic relation variable. Four relation variables make up a state:
D(unary) – the variables already given a value, i.e. the current branch of the game tree; the variable played next is theprefixLt-least one outsideD(DescriptiveComplexity.QLeast) and the one returned to is the greatest one inside it;T(unary) – the values they were given;up(nullary – a relation variable of arity0is a bit) – the mode: descending towards a leaf, or returning a value;res(nullary) – the value being returned.
No accumulator is needed, and that is what keeps the transition sentence
short: the evaluation short-circuits. Having returned the value v of the
first branch of a variable x, the walk pops x immediately when v already
settles the node (v true at an existential x, v false at a universal one)
and otherwise plays the second branch, whose value is then the value of the
node. So a value is never combined with a remembered one, and each of the four
transitions merely edits the state
(DescriptiveComplexity.qsSpec_step_iff).
Why the walk computes the game value #
The transition relation is deterministic
(DescriptiveComplexity.qsSpec_step_unique), and the run started at a position
(D, τ) in descending mode comes back to D in returning mode carrying
exactly QsatWins D τ (DescriptiveComplexity.qsSpec_run, by induction on the number
of variables outside D). Determinism turns that into an equivalence: the
returning state at D = ∅ is a dead end, and two dead ends reachable from one
state coincide, so a walk accepting the specification has to be the run.
Well-formedness is checked by the source sentence, so a malformed instance – where the prefix order is not a linear order on the variables, and neither the next nor the last variable of a position need exist – has no starting state at all.
Generic sentence shapes #
Each shape is built over an arbitrary vocabulary and an arbitrary variable type, so that the same builder and the same realization lemma serve the current copy of the block, the next one, and the nesting inside a quantifier.
A relation variable of arity 0 read as a formula: a propositional bit.
Equations
Instances For
Dependency graph
Dependency graph
Dependency graph
“x is marked, lies outside d, and no marked element outside d
precedes it”: the element a position plays next.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Dependency graph
“x is marked, lies inside d, and precedes no marked element of d”:
the element a position returns to.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Dependency graph
“Every marked element lies in d”: the position is a leaf.
Equations
- DescriptiveComplexity.coveredF mark d = FirstOrder.Language.Formula.iAlls (Fin 1) ((mark.formula₁ (FirstOrder.Language.var (Sum.inr 0))).imp (d.formula₁ (FirstOrder.Language.var (Sum.inr 0))))
Instances For
Dependency graph
Dependency graph
“No element lies in d”.
Equations
Instances For
Dependency graph
Dependency graph
The matrix: every clause holds a literal on a marked element that t
makes true.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Dependency graph
“a' holds of y exactly when a does”: an unchanged component.
Equations
- DescriptiveComplexity.sameF a' a y = (a'.formula₁ y).iff (a.formula₁ y)
Instances For
Dependency graph
Dependency graph
“a' is a with the value of x set to φ”: the one update shape the
walk needs – adding x (φ = ⊤) and removing it (φ = ⊥).
Equations
- DescriptiveComplexity.updF a' a φ x y = (a'.formula₁ y).iff (y.equal x ⊓ φ ⊔ FirstOrder.Language.BoundedFormula.not (y.equal x) ⊓ a.formula₁ y)
Instances For
Dependency graph
Dependency graph
Well-formedness #
The prefix order is a strict linear order on the marked elements.
The prefix order only relates marked elements.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The prefix order is irreflexive.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The prefix order is transitive.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The prefix order is total on the marked elements.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The instance is well formed: the prefix order is a strict linear order on the marked elements.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Dependency graph
Dependency graph
Dependency graph
The nine conjuncts of the transition sentence #
One conjunct per case of the walk and per kind of component: the two unary
components are edited under a ∀ x y, the two bits under a ∀ x. All are
built over an arbitrary vocabulary, with the current copy of the block (d,
t, u, r) and the next one (d', t', u', r') as parameters.
“The subtree of x is finished”: either its second value has been played
already, or the value just returned settles the node – true at an existential
x, false at a universal one.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Dependency graph
Descending one step: the next variable joins the quantified set with the
value false.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Dependency graph
Descending one step: the mode stays descending and the value is carried along.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Dependency graph
At a leaf the two unary components are unchanged.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Dependency graph
At a leaf the walk starts returning, carrying the value of the matrix.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Dependency graph
Returning is only possible from a nonempty branch.
Equations
- DescriptiveComplexity.upExS mark d prec = FirstOrder.Language.Formula.iExs (Fin 1) (DescriptiveComplexity.greatestF mark d prec (FirstOrder.Language.var (Sum.inr 0)))
Instances For
Dependency graph
Dependency graph
Popping a finished variable: it leaves the quantified set, the values are unchanged.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Playing the second value of an unfinished variable.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Popping a finished variable: the walk keeps returning, with the same value.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Playing the second value: the walk goes back to descending.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
The block and the vocabularies #
The block of the SO(TC) specification of QSAT: two unary relation
variables – the quantified set and the values it gave – and two relation
variables of arity 0, i.e. two bits – the mode and the value being
returned.
Equations
Instances For
Dependency graph
The unary relation variable of index i: the quantified set at false,
the valuation at true.
Equations
Instances For
Dependency graph
The nullary relation variable of index i: the mode at false, the value
being returned at true.
Equations
Instances For
Dependency graph
The input vocabulary together with the order, over which the sentences of an SO(TC) specification live.
Instances For
Dependency graph
The vocabulary of the endpoint sentences: one copy of the block.
Equations
Instances For
Dependency graph
The vocabulary of the transition sentence: two copies of the block.
Equations
Instances For
Dependency graph
An input symbol, in the endpoint vocabulary.
Equations
Instances For
Dependency graph
A unary relation variable, in the endpoint vocabulary.
Equations
Instances For
Dependency graph
A bit of the block, in the endpoint vocabulary.
Equations
Instances For
Dependency graph
An input symbol, in the transition vocabulary.
Equations
Instances For
Dependency graph
A unary relation variable of the current state.
Equations
Instances For
Dependency graph
A bit of the current state.
Equations
Instances For
Dependency graph
A unary relation variable of the next state.
Equations
Instances For
Dependency graph
A bit of the next state.
Equations
Instances For
Dependency graph
The SO(TC) specification of QSAT: the depth-first evaluation of the
game tree. Descending, the walk plays the next variable with the value
false, or – at a leaf – turns round carrying the value of the matrix;
returning, it pops the last variable when its subtree is settled and otherwise
plays its second value.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Reading the specification back #
The unary component i of a state.
Equations
- DescriptiveComplexity.qsPred ρ i a = ρ (Sum.inl i) fun (x : Fin (DescriptiveComplexity.qsBlock.arity (Sum.inl i))) => a
Instances For
Dependency graph
The bit i of a state.
Equations
- DescriptiveComplexity.qsBit ρ i = ρ (Sum.inr i) Fin.elim0
Instances For
Dependency graph
The quantified set of a state.
Equations
Instances For
Dependency graph
The valuation of a state.
Equations
Instances For
Dependency graph
Dependency graph
The value a state is returning.
Equations
Instances For
Dependency graph
The state built from its four components.
Equations
- DescriptiveComplexity.qsLift D T u r (Sum.inl false) v = D (v 0)
- DescriptiveComplexity.qsLift D T u r (Sum.inl true) v = T (v 0)
- DescriptiveComplexity.qsLift D T u r (Sum.inr false) x_2 = u
- DescriptiveComplexity.qsLift D T u r (Sum.inr true) x_2 = r
Instances For
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
A state is determined by its four components.
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Splitting the connectives of a sentence #
Instance search does not see through a specification's block, so the propositional connectives of the three sentences are split by hand.
Dependency graph
Dependency graph
Dependency graph
Dependency graph
The walk, read back #
The last variable of a branch: the prefixLt-greatest variable of D.
Equations
- DescriptiveComplexity.QGreatest D x = (DescriptiveComplexity.IsQVar x ∧ D x ∧ ∀ (y : A), DescriptiveComplexity.IsQVar y → D y → ¬DescriptiveComplexity.QPrec x y)
Instances For
Dependency graph
The last variable of a branch is unique.
Dependency graph
The subtree of x is settled by the value r just returned: either x
has been played twice already, or r is decisive for its quantifier – true at
an existential x, false at a universal one.
Equations
- DescriptiveComplexity.QPop T r x = (T x ∨ DescriptiveComplexity.IsQAll x ∧ ¬r ∨ ¬DescriptiveComplexity.IsQAll x ∧ r)
Instances For
Dependency graph
Removing a variable from the quantified set.
Equations
- DescriptiveComplexity.qRem D x y = (y ≠ x ∧ D y)
Instances For
Dependency graph
The transition of the walk, read back: descending, either the next
variable is played with the value false or the leaf is evaluated; returning,
the last variable of the branch is popped or played a second time.
Dependency graph
Dependency graph
The starting states: a well-formed instance at the initial position – nothing quantified, about to descend.
Dependency graph
The accepting states: back at the initial position, returning the value
true.
Dependency graph
The walk is the depth-first evaluation #
Setting a variable to true is adding it.
Dependency graph
Setting a variable to false is removing it.
Dependency graph
Dependency graph
The quantified set of a position is downward closed for the prefix order: the variables already played are an initial segment.
Equations
- DescriptiveComplexity.QDownClosed D = ∀ (y z : A), DescriptiveComplexity.IsQVar y → DescriptiveComplexity.QPrec y z → D z → D y
Instances For
Dependency graph
Dependency graph
Dependency graph
The variable just played is the last one of the branch.
Dependency graph
Popping the variable just played returns to the position before it.
Dependency graph
The four transitions #
Dependency graph
Dependency graph
Dependency graph
Dependency graph
The next and the last variable exist #
On a finite well-formed instance a position that is not a leaf has a next variable.
Dependency graph
On a finite well-formed instance a nonempty branch has a last variable.
Dependency graph
The walk is deterministic #
The transition relation is functional: every state has at most one successor, which is what turns the run of the walk into the only walk there is.
Dependency graph
A state returning a value at the empty branch is a dead end: the walk is over.
Dependency graph
The run of the walk #
The run of the walk computes the game value: started at the position
(D, τ) in descending mode, the walk comes back to D in returning mode
carrying QsatWins D τ, having changed nothing on D.
Dependency graph
Correctness of the specification #
The specification is correct: the walk accepts an instance exactly when the quantified formula it describes is true.
Dependency graph
QSAT is SO(TC) definable: the walk is the depth-first evaluation of the game tree, whose stack is the set of variables already played.