The machine of a quantified Boolean formula #
The program half of QBF k ≤ᶠᵒ[≤] ATMAccept k: the states, symbols and
transitions of the alternating machine M_φ built inside an ordered QBF
instance, on the tape laid out in
DescriptiveComplexity.Problems.Machine.AltTape.
The program #
sweep i: ⊢ → at each cell (x, b): if block i marks x and b is false,
write true or leave it – the round's choice → ⊣
⊣ ← back over the cells, unchanged → ⊢
at ⊢: hand over to sweep i + 1, or start the check
check c: sweep over the cells accumulating
flag := flag ∨ (the literal of c at this cell is `good`)
at the far marker: settle the clause, or die
accept: the check has settled every clause
Three things differ from the SAT machine of
DescriptiveComplexity.Problems.Machine.Hardness.
The guess is spread over k sweeps, and it accumulates. A cell holds one
truth value, initially false, and sweep i may turn it to true when block
i marks the variable – never back. After the k sweeps the cell holds
DescriptiveComplexity.qbfVal, which is a disjunction over the blocks marking
the variable. So there are two transitions available at a cell block i marks
and holds false, and one everywhere else: the choice a round makes is exactly
its block's truth assignment.
Only the guess is nondeterministic, as in the SAT machine – which is what makes the check work at either polarity: a universal block whose configuration has a single available move is an existential one.
The check serves both matrix shapes. For a conjunctive matrix the flag
records that some literal of the clause is satisfied, and a clause is settled
when the flag is set; for a disjunctive one it records that some literal is
violated, and a term is settled – by accepting – when the flag is clear.
The two are the same clause with the truth value flipped
(DescriptiveComplexity.xorB), which is why one table serves both.
Semantics first #
Everything here is a plain predicate on tagged tuples: the machine is assembled
as a DescriptiveComplexity.ATMData and reasoned about directly. Only once its
correctness is proved does the first-order transcription happen.
The instance, read #
Being a clause – a term, for a disjunctive matrix – of the instance.
Equations
Instances For
Dependency graph
The variable x occurs positively in the clause c.
Equations
Instances For
Dependency graph
The variable x occurs negatively in the clause c.
Equations
Instances For
Dependency graph
The variable x carries the mark of block i.
Equations
Instances For
Dependency graph
The variable x carries the mark of the block of index i, where i is
allowed to be the sentinel k: at the sentinel, no mark.
Equations
- DescriptiveComplexity.AltQbf.QbfBlkAt i x = ∃ (j : Fin k), ↑j = ↑i ∧ DescriptiveComplexity.AltQbf.QbfBlk j x
Instances For
Dependency graph
The literal test: the cell x, holding the truth value v, satisfies
the clause c. This is the first-order test on the source structure that the
transition relation performs.
Equations
- DescriptiveComplexity.AltQbf.QbfLit k c x v = (DescriptiveComplexity.AltQbf.QbfPos k c x ∧ v = true ∨ DescriptiveComplexity.AltQbf.QbfNeg k c x ∧ v = false)
Instances For
Dependency graph
The truth value the check phase tests: the value itself for a conjunctive matrix, its negation for a disjunctive one, so that the flag records a satisfied literal in the first case and a violated one in the second.
Instances For
Dependency graph
c is the lowest clause.
Equations
- DescriptiveComplexity.AltQbf.QbfMinCl k c = (DescriptiveComplexity.AltQbf.QbfCl k c ∧ ∀ (e : A), DescriptiveComplexity.AltQbf.QbfCl k e → c ≤ e)
Instances For
Dependency graph
c is the highest clause.
Equations
- DescriptiveComplexity.AltQbf.QbfMaxCl k c = (DescriptiveComplexity.AltQbf.QbfCl k c ∧ ∀ (e : A), DescriptiveComplexity.AltQbf.QbfCl k e → e ≤ c)
Instances For
Dependency graph
c' is the clause immediately above c.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The elements of the machine #
The least element of the instance, to which every constant of the machine is pinned.
Equations
Instances For
Dependency graph
Dependency graph
Dependency graph
The universe of the machine: tagged pairs.
Equations
- DescriptiveComplexity.AltQbf.AltV k A = (DescriptiveComplexity.AltQbf.AltTag k × (Fin 2 → A))
Instances For
Dependency graph
A constant of the machine at the sweep index i.
Equations
- DescriptiveComplexity.AltQbf.acstI t i = ((t, i), fun (x : Fin 2) => DescriptiveComplexity.AltQbf.qbotA)
Instances For
Dependency graph
A tag carrying one element at the sweep index i.
Equations
Instances For
Dependency graph
A constant of the machine: a tag on the pair of least elements.
Equations
Instances For
Dependency graph
A tag carrying one element, pinned in the second coordinate.
Equations
Instances For
Dependency graph
Symbols #
The left-marker symbol.
Equations
Instances For
Dependency graph
The right-marker symbol.
Equations
Instances For
Dependency graph
The blank symbol.
Equations
Instances For
Dependency graph
The symbol of the cell of x, holding the truth value v.
Equations
Instances For
Dependency graph
Positions #
The left-marker cell.
Equations
Instances For
Dependency graph
The cell of the element x.
Equations
Instances For
Dependency graph
The right-marker cell.
Equations
Instances For
Dependency graph
States #
Sweeping in direction d during the sweep of index i. The index runs
over Fin (k + 1), but only the values below k are ever reached.
Equations
Instances For
Dependency graph
Checking the clause c, flag f, sweeping in direction d.
Equations
Instances For
Dependency graph
The accepting state.
Equations
Instances For
Dependency graph
The transition table #
Which tagged tuples are transitions. The payload is pinned exactly as far as the transition needs it, the sweep index is required to be a real sweep, and the clause coordinates are required to be clauses, so that no junk element is ever a transition.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The state a transition applies in. The accepting turn fires at the flag
cnf: set, for a conjunctive matrix, where it means the clause is satisfied;
clear, for a disjunctive one, where it means no literal of the term is
violated.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The symbol a transition reads.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The state a transition moves to. The only place the instance is consulted
is the check clause, where the new flag depends on
DescriptiveComplexity.QbfLit.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The symbol a transition writes: only a guessing sweep ever changes the
tape, and only from false to true.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Which transitions move the head right: a sweep goes in its own direction, and every transition that fires at a marker moves away from it.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Dependency graph
Start states: the rightward sweep of index 0.
Equations
Instances For
Dependency graph
The quantifier block an element belongs to: its sweep index for a sweeping
state, the last block for the check and the accepting state, and block 0 for
everything else – DescriptiveComplexity.ATMData.BlocksWellFormed asks every
element for a block, junk included.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The block marks of the machine.
Equations
Instances For
Dependency graph
The alternating machine of a quantified Boolean formula.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The instance obligations #
Everything DescriptiveComplexity.TMData.WellFormed and
DescriptiveComplexity.ATMData.BlocksWellFormed ask, discharged before any run
is considered.
Dependency graph
Dependency graph
A sweeping state's block is its sweep index.
Dependency graph
Dependency graph
Dependency graph
The block structure is well formed: every element has exactly one
block, a transition stays in its block or moves to the next one, and a start
state is in block 0.