Bounded-space surface enumeration and decidable surface transitions #
A bounded-space surface configuration (Turing.AuxPDA.BoundedSurfaceCfg) restricts the work-tape
cells and head positions of a Turing.AuxPDA.SurfaceCfg to the symmetric window [-s, s]
(Turing.window s). This produces a concrete finite type with:
- an exact embedding
BoundedSurfaceCfg.toSurfaceonto{sc | sc.storage.FitsIn (fun _ => s)}; - a computable mixed-radix bijection
boundedSurfaceEquivFinontoFin (boundedSurfaceCard …), givinginput.length + 2 ≤ boundedSurfaceCard … ≤ surfaceCfgBound … (k * s)and therefore polynomial cardinality innfor logarithmic spaces(n) = O(log n)(boundedSurfaceCard_log_polynomiallyBounded); - decidable local transition predicates
BoundedStayStep,BoundedPushStep,BoundedPopStep, andBoundedPushPopStepviaapplyBoundedTapes?, together withDecidabletransport throughAuxPDA.withEmptyStackHalt.
This is original formalization infrastructure for Work Package 4 of cslib-frontier #7920, supplying the finite surface-configuration indexing consumed by the balanced-depth semi-unbounded circuit compiler.
Main definitions #
Turing.AuxPDA.BoundedSurfaceCfg: surface configurations restricted toTuring.window s.Turing.AuxPDA.BoundedSurfaceCfg.toSurface,Turing.AuxPDA.BoundedSurfaceCfg.ofSurface,Turing.AuxPDA.initBoundedSurface: bijection withFitsIn (fun _ => s)surface configurations.Turing.AuxPDA.boundedSurfaceCard,Turing.AuxPDA.boundedSurfaceEquivFin: explicit computable mixed-radixFinindexing.Turing.AuxPDA.applyBoundedTapes?,Turing.AuxPDA.BoundedStayStep,Turing.AuxPDA.BoundedPushStep,Turing.AuxPDA.BoundedPopStep,Turing.AuxPDA.BoundedPushPopStep: bounded surface transitions with computableDecidableinstances.
Main results #
Turing.AuxPDA.BoundedSurfaceCfg.toSurface_fitsIn,Turing.AuxPDA.BoundedSurfaceCfg.toSurface_injective: exact correspondence withFitsIn.Turing.AuxPDA.input_length_add_two_le_boundedSurfaceCard,Turing.AuxPDA.boundedSurfaceCard_le_surfaceCfgBound,Turing.AuxPDA.boundedSurfaceCard_log_polynomiallyBounded: lower and upper polynomial cardinality bounds.Turing.AuxPDA.applyBoundedTapes?_eq_some_iff: exact agreement between window-checked bounded updates andapplySurfaceTapes.
Bounded-space surface configurations #
A surface configuration of a binary k-tape AuxPDA on input whose work-tape heads and
non-blank cells are restricted to Turing.window s = [-s, s].
Input head position (shifted by one, matching
SurfaceCfg.inputPos).- state : Option State
Control state (
nonewhen halted). Work-tape contents on the bounded window
[-s, s].Work-tape head positions within
[-s, s].- topSym : Option StackSym
Top symbol of the pushdown stack, or
nonewhen empty. - outputSummary : OutputSummary
Three-value acceptance summary of the write-only binary output tape.
Instances For
Embed a bounded-space surface configuration into SurfaceCfg, padding cells outside
Turing.window s with blanks (none).
Every embedded bounded surface configuration fits in the uniform window fun _ => s.
Restrict a surface configuration fitting in fun _ => s to BoundedSurfaceCfg.
A bounded surface configuration is accepting when halted with output summary .accept.
Exact cardinality of BoundedSurfaceCfg k StackSym State input s when |StackSym| = mStack
and |State| = mState.
Computable mixed-radix bijection indexing every bounded-space surface configuration by
Fin (boundedSurfaceCard mStack mState k input.length s).
Pack the initial input head, initial state, centered work heads and blank contents.
The parameter stateCode includes the positive offset of the running state.
The numeric initial surface is the index assigned by the bounded surface equivalence.
Numeric fields of a bounded surface index, before unpacking the work tapes.
- inputPos : ℕ
Read-only input head position.
- state : ℕ
Optional state code. Zero denotes a halted state.
- workPositions : ℕ
Packed positions of the work-tape heads.
- workContents : ℕ
Packed ternary work-tape contents.
- top : ℕ
Optional top-symbol code. Zero denotes an empty stack.
- output : ℕ
Encoded output summary.
Extract the numeric fields of a bounded surface index by repeated division and remainder.
Encode the fields separately using the same radices as the surface index.
The numeric input position reads exactly the bounded surface's input symbol.
Decode the head position as an offset from the left boundary of the window.
Extract one packed work tape from the contents of all the work tapes.
Read the ternary symbol at a work head. The codes are 0 for blank, 1 for false, and 2 for true.
Replace the symbol under the selected work head and return that tape's ternary word.
The numeric head query recovers the encoded head at the selected tape.
The numeric symbol query gives the code of the symbol under the selected head.
Test the destination head and contents of a single work tape after a fixed action.
The numeric tape-action check agrees with the original work-tape fields.
The test checks each head move and each tape write in the fixed action.
Digit extraction agrees with the existing mixed-radix numbering.
Empty-stack acceptance is a test of three numeric fields.
A surface's state code is zero exactly when the machine has halted.
Testing the state, stack and output fields agrees with bounded surface acceptance.
Testing the numeric fields of a valid index recognizes accepting empty-stack surfaces.
The bounded surface-configuration count is always at least n + 2 (from the input head).
The bounded surface-configuration cardinality is at most surfaceCfgBound … (k * s).
Polynomial bounded-surface cardinality in logarithmic space: for s(n) = c * (log₂ n + 1),
boundedSurfaceCard is polynomially bounded in n.
Window-checked tape updates and decidable bounded surface transitions #
Apply a Turing.Action to a bounded surface configuration, returning none if any work-tape
head steps outside Turing.window s.
Check the control state, stack top and work symbols required by a fixed transition.
The observation test compares exactly the source fields read by a transition.
Test a fixed tape action, including the destination's scalar fields and all work tapes.
The complete numeric test is exact for the window-checked bounded tape action.
Window-checked bounded application agrees identically with applySurfaceTapes on embedded
surface configurations.
Bounded-space height-preserving surface transition (StayStep on embedded surfaces).
Instances For
Bounded-space push transition (PushStep on embedded surfaces).
Instances For
Bounded-space pop transition (PopStep on embedded surfaces).
Instances For
Computable finiteness of actions and decidability of bounded surface steps #
withEmptyStackHalt.Tr is decidable whenever M.Tr is decidable over finite StackSym and
State.