One-gate execution for the streaming circuit evaluator #
This file proves the machine-level execution of one valid serialized gate. The proof follows the controller's dependency order: consume one gate-count mark, read the three fixed gate bits, rewind and resolve the first reference, rewind and resolve the second reference, then append the computed value to the wire memo.
The small named-action lemmas at the start are deliberately phase-generic
within this controller. They are the reusable proof-engineering seam between
CoreAction and exact named configurations.
Applying a named preserve action changes only the controller phase when all parked heads are away from the left marker.
Applying a named code-right action advances exactly the code tape and changes the controller phase.
Applying a named wire-right action advances exactly the wire tape and changes the controller phase.
A positive gate-check consumes one unary counter mark and enters the fixed-width gate header.
The gate-operation phase consumes the operation bit.
The first-negation phase consumes the first negation bit.
The second-negation phase consumes the second negation bit and begins the first wire rewind.
Consuming a counter mark and the three fixed gate bits reaches the first reference rewind in exactly four steps.
An off-marker first-reference rewind takes one ordinary wire-left step.
Reaching the wire marker ends the first-reference rewind and returns the wire head to its first bit.
Rewinding for the first reference takes exactly position + 2 steps
and returns the wire tape to position zero.
An off-marker second-reference rewind takes one ordinary wire-left step.
Reaching the wire marker ends the second-reference rewind and returns the wire head to its first bit.
Rewinding for the second reference takes exactly position + 2 steps
and returns the wire tape to position zero.
Reading a unary one in the first reference advances both the code and wire cursors.
The zero delimiter of the first reference captures the selected wire value and advances only the code cursor.
A complete first reference is resolved in exactly reference + 1 steps,
leaving the wire cursor at the referenced position.
Reading a unary one in the second reference advances both the code and wire cursors.
The zero delimiter of the second reference captures the selected wire value, computes the gate, and advances only the code cursor.
A complete second reference is resolved in exactly reference + 1
steps, leaving the wire cursor at the referenced position.
Seeking the append frontier across an existing wire advances only the wire cursor.
At the first blank after the wire memo, the controller appends the new wire value, mirrors it to the current output cell, and returns to gate check.
Seeking from an arbitrary in-bounds wire cursor appends in exactly
wireBits.length - position + 1 steps.
Evaluating the serialized operation bit of a raw gate agrees with the raw gate evaluator.
One canonical, in-range serialized gate executes in controller order with an exact aggregate cost. The second-reference traversal cancels against the remaining append seek, so the total depends only on the initial wire position, the first reference, and the memo length.