Specifications of Available Oracles #
This file defines a type OracleSpec
to represent a set of available oracles.
The available oracles are all indexed by some (potentially infinite) indexing set ι
,
and for each index i
a pair of types domain i
and range i
.
We also define a number of basic oracle constructions:
A structure to represents a specification of oracles available to a computation.
The available oracles are all indexed by some (potentially infinite) indexing set ι
.
Represented as a map from indices i
to the domain and codomain of the corresponding oracle.
Equations
Instances For
Type of the domain for calls to the oracle corresponding to i
.
Equations
Instances For
Type of the range for calls to the oracle corresponding to i
.
Equations
Instances For
Typeclass to capture decidable equality of the oracle input and outputs.
Needed for things like finSupport
to be well defined.
- domain_decidableEq' (i : ι) : DecidableEq (spec.domain i)
- range_decidableEq' (i : ι) : DecidableEq (spec.range i)
Instances
Equations
Equations
Typeclass for specs where each oracle has a finite and non-empty output type.
Needed for things like evalDist
and probOutput
.
Instances
Equations
Equations
spec₁ ++ spec₂
combines the two sets of oracles disjointly using Sum
for the indexing set.
inl i
is a query to oracle i
of spec
, and inr i
for oracle i
of spec'
.
Equations
Instances For
Equations
Equations
Reduce the indexing set by pulling back along some map f
.
Equations
Instances For
Access to no oracles, represented by an empty indexing set.
We take the domain and range to be PUnit
(rather than e.g. empty.elim i
),
which often gives better behavior for proofs even though the oracle is never called.
Equations
Instances For
Equations
T →ₒ U
represents a single oracle, with domain T
and range U
.
Uses the singleton type PUnit
as the indexing set.
Equations
Instances For
Equations
Equations
A coin flipping oracle produces a random Bool
with no meaningful input.