Evaluating oracle programs against a deterministic oracle #
OracleComp.evalPure h prog runs an oracle program against a total function
h : (q : ι) → spec q in the Id monad. It is the deterministic counterpart of
OracleComp.evalWith: evaluating with the point-mass oracle fun q => PMF.pure (h q) gives the
point mass at evalPure h prog (OracleComp.evalWith_pure_oracle). OracleComp.sumPure combines
deterministic oracles for the two sides of spec₁ ⊕ₒ spec₂, and evalPure of a lifted program
under sumPure only reads the matching side.
Random-oracle arguments use evalPure to compare an oracle program with its pure specification
once the oracle's answers are fixed
(CslibFrontier.Languages.Probabilistic.RandomOracle.Invariant).
Main definitions #
Cslib.OracleComp.evalPure: deterministic evaluation against a total function.Cslib.OracleComp.sumPure: the deterministic oracle forspec₁ ⊕ₒ spec₂built from one for each side.
Main results #
Cslib.OracleComp.evalPure_bind,Cslib.OracleComp.evalPure_mapM,Cslib.OracleComp.evalPure_foldlM:evalPurecommutes with the monad operations.Cslib.OracleComp.evalWith_pure_oracle: evaluation against point masses.Cslib.OracleComp.evalPure_liftLeft,Cslib.OracleComp.evalPure_liftRight: lifted programs read only their own side ofsumPure.
Evaluate an oracle program deterministically against a pure function h : (q : ι) → spec q
in the Id monad.
Evaluating an oracle program with PMF.pure (h q) produces the point mass at evalPure h.
Combine two deterministic oracles into a deterministic oracle for spec₁ ⊕ₒ spec₂.