Bundled Oracle Specs and Implementations #
This file defines a type OracleContext ι m that provides an ambient set of oracles,
along with an implementation of those oracles in the monad m.
An OracleContext ι m bundles a specification spec of oracles with input set ι
and an implementation of the oracles in terms of the monad m.
Structures can extend this to get
- spec : OracleSpec ι
Instances For
@[reducible]
def
OracleSpec.defaultContext
{ι : Type u}
(spec : OracleSpec ι)
:
OracleContext spec.Domain (OracleComp spec)
Convert an OracleSpec into an OracleContext with OracleComp as the implementation monad,
using the identity implementation for queries.
Equations
Instances For
instance
OracleContext.instInhabitedOfPure
{ι : Type u_1}
{m : Type u → Type v}
[Pure m]
:
Inhabited (OracleContext ι m)
Equations
@[reducible]
def
OracleContext.ofImpl
{ι : Type u_1}
{spec : OracleSpec ι}
{m : Type u → Type v}
(impl : QueryImpl spec m)
:
OracleContext ι m
Convert a QueryImpl into an OracleContext by bundling the OracleSpec corresponding
to the particular implementation.
Equations
Instances For
@[reducible]
def
OracleContext.add
{ι : Type u_1}
{ι' : Type u_2}
{m : Type u → Type v}
(O : OracleContext ι m)
(O' : OracleContext ι' m)
:
OracleContext (ι ⊕ ι') m
Combine two oracle contexts with the same target monad, giving access to both ambient oracles and implementing queries to each independently.
Equations
Instances For
instance
OracleContext.instHAddSum
{ι : Type u_1}
{ι' : Type u_2}
{m : Type u → Type v}
:
HAdd (OracleContext ι m) (OracleContext ι' m) (OracleContext (ι ⊕ ι') m)
Equations
@[simp]
theorem
OracleContext.add_def
{ι : Type u_1}
{ι' : Type u_2}
{m : Type u → Type v}
(O : OracleContext ι m)
(O' : OracleContext ι' m)
:
theorem
OracleContext.spec_add
{ι : Type u_1}
{ι' : Type u_2}
{m : Type u → Type v}
(O : OracleContext ι m)
(O' : OracleContext ι' m)
:
theorem
OracleContext.impl_add
{ι : Type u_1}
{ι' : Type u_2}
{m : Type u → Type v}
(O : OracleContext ι m)
(O' : OracleContext ι' m)
: