One step of Savitch's stack machine #
⚠️ Unreviewed by Bolton
The recursion of Savitch's theorem, written as a single polynomial-time function
on the stack of Complexitylib.Classes.Containments.Internal.SavitchFrame.
A step does exactly one of five things.
- Publish — the done flag is set, so the answer is copied into the flag the iteration reads.
- Finish — the stack is empty, so the root's return value is the answer and the done flag goes up.
- Bottom out — the top frame's level is zero, so its subproblem is one step of the configuration graph; the frame is popped with its verdict.
- Descend — the top frame pushes the half of its interval it is currently trying.
- Return — a subcall has come back: a success either advances the frame to its second half or finishes it, and a failure advances the midpoint, giving up when the enumeration wraps.
Main definitions #
Complexity.baseReach,Complexity.baseAcc— the two base casesComplexity.savStep— one step of the recursionComplexity.savInit— the state the recursion starts fromComplexity.savG— the functionSpaceIter.mem_PSPACE_of_iterateiterates
Main results #
Complexity.savStep_mem_FP,Complexity.savG_mem_FP— a step is polynomial-time
Reading the state #
The frame on top of the state's stack.
Equations
Instances For
The stack below the top frame.
Equations
Instances For
The wide ruler a whole configuration code is measured against.
Equations
Instances For
The all-zero code: the first midpoint the enumeration tries.
Equations
- Complexity.savZero k R = Complexity.padTo (Complexity.savRuler k R) []
Instances For
The base cases #
The step #
The initial state #
The block ruler of the window, as a function of the input.
Equations
- Complexity.savR qp x = Complexity.polyRuler (2 * qp + 2) x
Instances For
The state Savitch's recursion starts from: one acceptance frame, at the top level, on the code of the initial configuration.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The function the space-bounded iteration runs. The running state is the
first component and the input the second, so the very first call — on
pair [] x — is the one that builds the initial state.
Equations
- One or more equations did not get rendered due to their size.