Multi-tape machines with optional oracle channels #
A MultiTapeMachine separates the tape interface from the choice of a transition. Ordinary steps
use Turing.Action on a Turing.Cfg; in addition, Oracle indexes communication operations.
Each operation has a write-only query buffer and a read-only answer tape, and Empty gives a
machine without communication.
The operation type names interfaces such as hashing, signing and decryption; it does not contain
their request payloads. Payloads are words written to the selected query buffer, so a finite
operation type still permits arbitrarily long requests. At the game level, OracleComp can use
typed payloads and operation-dependent replies; a machine realization must encode these as words.
Different operations may share one hidden interpreter state. Separate communication channels do not assert independent oracles. In particular, a random-oracle handler must retain its sampled answers across every user of that oracle, including calls made inside another game operation.
Choose describes the result of a transition. A fair-coin table uses fun α => Bool → α, which
keeps the action for each coin value, including when the two actions agree.
Adapted from the cslib crypto branch at 5ff69ca93402e7c947208dc56396d6d86203ccd8.
The effect-free deterministic and nondeterministic interfaces are related step-exactly to
upstream machines in MultiTape.Machine.Equivalence.
Main definitions #
Turing.MultiTapeMachine: a transition table parameterized by its choice mechanism.Turing.MultiTapeMachine.Config: upstream tapes and control, plus oracle communication channels.Turing.MultiTapeMachine.Action.mapState,Turing.MultiTapeMachine.Config.mapState: relabel control states, preserving halting, tape data and communication channels.
No finiteness or complexity assumptions are imposed here. A complexity predicate must require fixed finite control, a finite alphabet and finitely many oracle channels. With these assumptions an ordinary step inspects and updates a fixed number of tape cells. Query submission is a separate step; writing the query and reading its reply require ordinary steps.
The local tape action and communication updates, or a call to a named oracle.
- step {k : ℕ} {Symbol : Type u} {State : Type v} {Oracle : Type w} (action : Turing.Action k Symbol State) (querySymbol : Oracle → Option Symbol) (answerMove : Oracle → SignType) : Action k Symbol State Oracle
Update ordinary tapes, write at most one symbol per query buffer, and move answer heads.
- query {k : ℕ} {Symbol : Type u} {State : Type v} {Oracle : Type w} (oracle : Oracle) (next : State) : Action k Symbol State Oracle
Submit one buffer, install its reply, and resume in the specified state.
Instances For
Ordinary machine tapes together with the communication state of each oracle channel.
- tapes : Cfg k Symbol State input
The shared configuration of ordinary tapes and control.
- channels : Oracle → Channel Symbol
Each oracle has its own query buffer and answer head.
Instances For
Rename the control state of a configuration, keeping its tapes and channels.
Instances For
Read the cell under a channel's answer head; positions outside the reply are blank.
Instances For
Apply one ordinary tape action and the channel-local writes and head moves.
Instances For
Install a reply on the selected channel, clear its query buffer, and reset its answer head. All other communication channels and all ordinary tapes are preserved.
Instances For
A multi-tape transition table with an explicit choice mechanism and optional oracle channels.
- initial : State
Initial control state.
- tr : State → Option Symbol → (Fin k → Option Symbol) → (Oracle → Option Symbol) → Choose (Action k Symbol State Oracle)
Inspect only the current state and the symbols under the input, work and answer heads.
Instances For
Start with the ordinary initial configuration and empty communication channels.