Query-machine replay inside a local tape window #
The query machine stores three blocks per work tape, binary head positions and a remaining-step counter. The original input is read only through the query-machine input channel. Both native input boundaries read blank and input movement uses the existing clamping arithmetic.
A halted simulated machine keeps its data fixed while the replay counter continues to zero. Only the three-valued output track is retained; no accumulated output word is stored or emitted. Initialization receives the input length explicitly; computing that length and decoding a caller's block labels are charged by the caller.
Main results #
Turing.MultiTapePTM.BlockComputation.QueryReplay.runFrom_loadView_represents: every clocked prefix represents the native replay from the existing configuration embedding.Turing.MultiTapePTM.BlockComputation.QueryReplay.result_runFrom_loadView: the returned view agrees with the native block replay.Turing.MultiTapePTM.BlockComputation.QueryReplay.halted_runFrom_loadView,live_runFrom_loadView: the subroutine takes exactly its requested duration.
Decode the existing ternary cell code; malformed codes read blank.
Finite local storage. Tape families are fixed-size tuples, not finite lookup tables over whole windows. Every runtime work cell and every head position is explicitly encoded.
- inputLength : ℕ
Length of the original read-only input.
- width : ℕ
Runtime block width.
- remaining : ℕ
Ticks still to replay.
- inputPos : ℕ
Native padded input position, including both blank boundaries.
- control : Option Q
Current simulated control, or halted.
Local work-head positions.
Explicit local windows using ternary symbol codes.
Finite summary of emitted output.
Signed movement on the natural coordinates of a finite window. Valid replay heads do not attempt a left move at zero before their remaining-step counter reaches zero.
One replay tick. Even after the simulated machine halts, the duration counter decreases.
A silent state-returning query subroutine. Callers supply an initialized state via runFrom.
A local window agrees with the native configuration on every stored cell. Absolute tape origins belong to this proof relation, not to the runtime tape data.
Applying the same action preserves every stored cell and the output track.
The duration counter does not change the represented native data.
A tick simulates one native step whenever all current work heads are in the stored window.
The counter uses exactly the requested duration, including halted simulated prefixes.
Replay never allocates cells beyond its supplied fixed windows.
Replaying a block preserves the native state, heads, stored windows and output track at
all clocked prefixes. The initial heads are in the middle block, leaving room for width moves.
Initialize the local replay from decoded block data. The input length is an explicit
argument, and every work cell is stored using the existing ternary symbol code. Native loading
and its semantic correspondence are provided by QueryReplayLoad and QueryReplayLoadCorrect.
The actual query subroutine realizes the native block replay on the original input, without storing that word in its state.
Every proper prefix remains live, even if the simulated machine has already halted.
A represented replay returns the native control and the contents of the original windows.
The state-returning query subroutine computes exactly the native leaving view of the block.
Every new work-cell code remains one of the three canonical symbols.
Replay preserves canonical ternary cell codes at every clocked prefix.