Documentation

Complexitylib.Circuits.Encoding.Machine.Core.Internal.Tape

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
    Instances For

      An appendable binary prefix is a cursor at its first trailing blank once its left marker is known.

      Exact canonical cells and a head at cell one form the position-zero cursor.

      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.

      theorem Complexity.CircuitCode.Machine.Internal.BinaryCursor.read_of_lt {t : Tape} {bits : List Bool} {position : } (h : BinaryCursor t bits position) (hlt : position < bits.length) :
      t.read = Γ.ofBool bits[position]

      Reading a cursor strictly inside the string returns that indexed bit.

      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.

      theorem Complexity.CircuitCode.Machine.Internal.BinaryCursor.moveRight {t : Tape} {bits : List Bool} {position : } (h : BinaryCursor t bits position) (hlt : position < bits.length) :
      BinaryCursor (t.move Dir3.right) bits (position + 1)

      Moving right advances an in-bounds cursor and preserves its contents.

      theorem Complexity.CircuitCode.Machine.Internal.BinaryCursor.moveLeft {t : Tape} {bits : List Bool} {position : } (h : BinaryCursor t bits position) (hpos : 0 < position) :
      BinaryCursor (t.move Dir3.left) bits (position - 1)

      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.