Oracle substitution preserving private randomness #
ProbOracleComp.simulate handler program replaces the external calls of program with
handler, forwarding private sampling unchanged. Both the handler and the resulting reduction
remain free-monadic programs. A later OracleComp.interpret supplies the random sampler and any
shared oracle state; reductions need only describe their external-oracle simulation.
Main definitions #
Cslib.ProbOracleComp.simulate: substitute external calls while preserving private samples.
Main results #
Cslib.ProbOracleComp.interpret_simulate: compose substitution with an outer interpreter.Cslib.ProbOracleComp.simulate_simulate: compose two oracle substitutions.
References #
This API follows the separation of untouched effects from simulated oracles in Devon Tuma,
Quang Dao, and collaborators' VCVio, in particular
OracleSpec.passthrough and simulateQ (revision 87bc1892fff1982e97cfd8c7303c9d1f2bfdc2f9),
in the OracleComp.SimSemantics.Append.Core and OracleComp.SimSemantics.SimulateQ modules.
The implementation uses the heterogeneous OracleComp.substitute fold and its composition law.
Replace external oracle calls by programs over another interface, preserving every private sample. Randomness is interpreted only when the resulting program is run.
Substitution preserves ordinary same-universe sequential composition.
Substitution preserves ordinary same-universe deterministic postprocessing.
An external call is replaced by its handler program.
Substitution forwards private samples without consulting the external handler.
Running a substituted program runs each handler under the same outer interpreter. In particular, a stateful interpreter shares its state across all calls and private samples.
Two successive substitutions compose at the external handler, preserving private samples.