Efficient stateful oracle substitution #
A certified oracle program can be interpreted against a closed stateful PPT handler. A local invariant bounds reply length and the amount of encoded private storage added per call. The result is a closed PPT program returning both the original result and the final handler state. The proof charges the native interpreter, captured inputs, requests, replies and all stored data.
The machine, clock, finite configurations and query bounds remain internal. Individually efficient
calls alone do not suffice: repeatedly doubling the state does not satisfy a resource allowance
that depends only on the caller and request. The theorem is the closed case of open substitution
(Cslib.Probability.IsOraclePPTOn.run_interpret_preprocess_open): a sampled closed handler makes
no external call.
Main results #
Cslib.Probability.IsOraclePPTOn.run_interpret_preprocess: efficient substitution with captured caller data, a local state invariant and an efficiently computed resource allowance.
References #
Adapts Computability/Probabilistic/OracleSimulation.lean on the cslib crypto branch at
5ff69ca93402e7c947208dc56396d6d86203ccd8, using the shared OracleComp.interpret interface.
Substitute a stateful handler into an oracle program, preserving the joint output/state law. The efficiently computed allowance bounds each reply and the added encoded state. One invariant must hold on every supported transition; clocks and storage bounds are derived internally.