Approximate stateful oracle simulation #
OracleComp.run_interpret_simulation lifts an exact local simulation, relating each call of one
stateful oracle to a call of another through a probabilistic change of state, to every adaptive
program. This module lifts an approximate local simulation in the same way: when each call q
commutes with the change of state up to statistical distance cost q * ε, a program whose calls
cost at most d in total commutes with it up to d * ε.
The typical use is a lazy-to-eager hop in which one kind of call is answered from partial information (a cache) on the lazy side and from the completed table on the eager side, so that the two disagree on an event of small probability; calls of other kinds cost nothing.
Main results #
Cslib.OracleComp.closeTo_run_interpret_simulation: an approximate local simulation lifts to every cost-bounded program, retaining the result and the final state.Cslib.OracleComp.closeTo_run_interpret_simulation_readOnly: its marginal on the result when the target oracle only reads its state, as an eager table.
Approximate stateful simulation. If each call q of oracle commutes with the change of
state relate up to statistical distance cost q * ε, then running any program prog with
IsCostBounded cost prog d commutes with relate up to statistical distance d * ε.
Approximate simulation by a read-only oracle. If each call q of oracle commutes up to
statistical distance cost q * ε with answering it by oracle' t q from a state t ← relate s
that the call leaves unchanged, then the result of running any program prog with
IsCostBounded cost prog d is within d * ε of sampling t ← relate s and interpreting prog
against oracle' t.