Cache invariants of the lazy random oracle #
A run of an oracle program under the lazy random oracle RandomOracle.answer dist only extends
its cache, keeps every cached answer in the support of dist, and returns what the program
computes against any total oracle extending the final cache
(OracleComp.mem_support_runWith_answer_invariant). Completing the final cache to a total oracle
with OracleComp.cacheOracle turns facts about deterministic evaluation (OracleComp.evalPure)
into facts about the lazy random-oracle run: a program that returns a against every oracle drawn
from the pointwise support of dist returns PMF.pure a under RandomOracle.answer dist
(OracleComp.map_fst_runWith_answer_eq_pure).
Main definitions #
Cslib.OracleComp.cacheOracle: a total oracle extending a cache, answering uncached queries with an element of the support ofdist.
Main results #
Cslib.OracleComp.mem_support_runWith_answer_invariant: the cache invariant of supported runs.Cslib.OracleComp.map_fst_runWith_answer_eq_pure: oracle programs that are constant on the support ofdistare deterministic under the lazy random oracle.
Multi-step invariant of runWith (RandomOracle.answer dist): any outcome (res, cache') in
the support of a run from cache produces a final cache cache' extending cache whose entries
lie in (dist q).support, and res = evalPure h prog for every total function h extending
cache'.
Extend a partial cache cache to a total deterministic oracle by returning v when
cache q = some v and otherwise choosing an element in (dist q).support.
If an oracle program evaluates to a under every deterministic oracle drawn from the
point-wise support of dist, then running it under the lazy random oracle
RandomOracle.answer dist from the empty cache yields PMF.pure a.