Computations with Oracle Access #
OracleComp spec α represents computations with oracle access to oracles in spec,
where the final return value has type α, represented as a free monad over the PFunctor
corresponding to spec.
Instances For
Manually lift an OracleQuery to an OracleComp.
Instances For
coin is the computation representing a coin flip, given a coin flipping oracle.
Instances For
Nicer induction rule for OracleComp that uses monad notation.
Allows inductive definitions on computations by considering the two cases:
return x/pure xfor anyxdo let u ← query i t; oa u(with inductive results foroa u) SeeoracleComp_emptySpec_equivfor an example of using this in a proof. If the final result needs to be aTypeand not aProp, seeOracleComp.construct.
Instances For
Version of OracleComp.inductionOn that includes an OptionT in the monad stack
and requires an explicit case to handle failure.
Instances For
Version of OracleComp.inductionOn with the computation at the start.
Instances For
Version of OracleComp.inductionOnOptional with the computation at the start.
Instances For
Version of construct with automatic induction on the query in when defining the
query_bind case. Can be useful with spec.DecidableEq and spec.FiniteRange.
mapM/simulateQ is usually preferable to this if the object being constructed is a monad.
Instances For
Returns true for computations that don't query any oracles or fail, else false.
Instances For
Given a computation oa : OracleComp spec α, construct a value x : α,
by assuming each query returns the default value given by the Inhabited instance.
Instances For
Total number of queries in a computation across all possible execution paths.
Can be a helpful alternative to sizeOf when proving recursive calls terminate.
Instances For
Two pure computations are equal iff they return the same value.
Binding two computations gives a pure operation iff the first computation is pure and the second computation does something pure with the result.
Binding two computations gives a pure operation iff the first computation is pure and the second computation does something pure with the result.
Alias of the reverse direction of OracleComp.bind_eq_pure_iff.
Binding two computations gives a pure operation iff the first computation is pure and the second computation does something pure with the result.
Alias of the reverse direction of OracleComp.pure_eq_bind_iff.
Binding two computations gives a pure operation iff the first computation is pure and the second computation does something pure with the result.