Documentation

CslibFrontier.Computability.Machines.Turing.MultiTape.Probabilistic.CoinTape.Substitution

Substituting external calls in saved-coin replay #

Replacing the source machine's query programs commutes with replay as an equality of free programs. The fixed private tape and all effects of the substituted external calls are retained.

Main results #

References #

Original consequences of the shared interpreter's substitution law.

theorem Turing.MultiTapePTM.interpret_runConfigFromCoins_substitute {k : ℕ} {Symbol State Oracle Query : Type} {spec : Cslib.OracleSpec Query} {input : List Symbol} [DecidableEq Oracle] {Query' : Type} {target : Cslib.OracleSpec Query'} (machine : MultiTapePTM k Symbol State Oracle) (query : Oracle → List Symbol → Cslib.OracleComp spec (List Symbol)) (handler : (q : Query) → Cslib.OracleComp target (spec q)) (coins : List Bool) (cfg : MultiTapeMachine.Config k Symbol State Oracle input) :
Cslib.OracleComp.interpret handler (machine.runConfigFromCoins query coins cfg) = machine.runConfigFromCoins (fun (op : Oracle) (word : List Symbol) => Cslib.OracleComp.interpret handler (query op word)) coins cfg

Replacing external calls commutes with fixed-coin replay, without changing the coin tape.

theorem Turing.MultiTapePTM.interpret_runCoins {k : ℕ} {Symbol State Oracle Query : Type} {spec : Cslib.OracleSpec Query} [DecidableEq Oracle] {Query' : Type} {target : Cslib.OracleSpec Query'} (machine : MultiTapePTM k Symbol State Oracle) (query : Oracle → List Symbol → Cslib.OracleComp spec (List Symbol)) (handler : (q : Query) → Cslib.OracleComp target (spec q)) (coins : List Bool) (input : List Symbol) :
Cslib.OracleComp.interpret handler (machine.runCoins query coins input) = machine.runCoins (fun (op : Oracle) (word : List Symbol) => Cslib.OracleComp.interpret handler (query op word)) coins input

Substituting external calls preserves the output and all effects of fixed-coin replay.