Tape cursors for the streaming circuit evaluator #
The evaluator repeatedly rewinds, indexes, and extends canonical binary tapes.
BinaryCursor keeps the complete canonical cell contents fixed while exposing
the current zero-based read position. This is intentionally internal: the
neutral endpoint and suffix predicates remain the public tape API.
A zero-based cursor into a tape with exact canonical binary contents. The position may also equal the string length, in which case the cursor reads the first trailing blank.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The boundary state reached after rewinding a canonical binary tape onto its left-end marker.
Equations
- Complexity.CircuitCode.Machine.Internal.BinaryAtMarker t bits = (t.head = 0 ∧ t.cells = (Complexity.Tape.init (List.map Complexity.Γ.ofBool bits)).cells)
Instances For
An appendable binary prefix is a cursor at its first trailing blank once its left marker is known.
A binary cursor carries the standard unique-left-marker invariant.
A binary cursor is always parked away from the left-end marker.
The controller's preserve action leaves a cursor tape unchanged.
The controller's right action changes only the cursor head.
The controller's guarded-left action is an ordinary left move for a binary cursor.
The guarded-left action from position zero enters the left-marker state used by every controller rewind.
A cursor at the frontier reads the first trailing blank.
A position-zero cursor exposes the neutral completed-string contract.
A position-zero cursor exposes the whole string as its remaining suffix.
Moving right advances an in-bounds cursor and preserves its contents.
Moving left retreats a positive cursor and preserves its contents.
A frontier cursor exposes the existing appendable-prefix contract.
Writing at the frontier and moving right appends one bit and leaves a new frontier cursor.
Writable-alphabet form of append, matching the controller transition
exactly.
A canonical marker state reads the unique left-end marker.
A canonical marker state carries the standard tape invariant.
Writing back at the immutable marker and moving right is exactly an ordinary right move.
The controller's marker bounce returns to the position-zero cursor.