Reading an effectful machine's input from work tapes #
Two fresh work tapes hold the virtual input and its left-boundary marker. The compiler reuses upstream's clamped-input simulation, retaining all typed choices and oracle interactions. The real input head stays at its original position, and the real input is never inspected.
The simulation starts from a prepared virtual input. Preparing these tapes is a separate computation whose cost must be included when composing machines.
Main definitions #
Turing.MultiTapeMachine.inputFromTape: read a virtual input without adding instructions.Turing.MultiTapeMachine.InputFromTape.config: embed the input and retain all oracle channels.
Main results #
Turing.MultiTapeMachine.runConfigFrom_inputFromTape: preserve the complete clocked program.Turing.MultiTapeMachine.toTM_inputFromTape: agree with upstream's deterministic compiler.
References #
Adapted from MultiTape/Oracle/InputFromTape.lean on the cslib crypto branch at
5ff69ca93402e7c947208dc56396d6d86203ccd8, using the common machine and upstream input redirection
by Christian Reitwiessner and Samuel Schlesinger.
Move the virtual input and boundary heads together, clamping at either end.
Instances For
Embed the source input on work tapes while retaining every communication channel.
Instances For
Upstream's clamped move preserves the virtual input geometry after every instruction.
Read the input from two fresh work tapes: a word and its boundary marker.
Instances For
Unfold a single virtual-input transition without unfolding its machine in continuations.
Virtual input preserves the complete program, including communication and private state.
The virtual-input compiler emits exactly the source output program.
Effect-free deterministic input redirection is exactly upstream's compiler.