Oracle Queries #
This file defines OracleQuery, the single-query functor induced by an OracleSpec.
Functor to represent queries to oracles specified by an OracleSpec ι,
defined to be the object type of the corresponding PFunctor.
In particular an element of OracleQuery spec α consists of an input value t : spec.Domain,
and a continuation f : spec.Range t → α specifying what to do with the result.
See OracleSpec.query for the case when the continuation f just returns the query result.
Instances For
Instances For
Query an oracle on in input t to get a result in the corresponding range t.
Marked protected: the bare identifier query resolves to HasQuery.query
(exported in VCVio.OracleComp.HasQuery.Basic), which yields a value in the
ambient monad and lets Lean recover spec from the expected type without an
ascription. Use spec.query t or OracleSpec.query t when you specifically
want the primitive single-query syntax OracleQuery spec (spec.Range t).
Instances For
Primitive query notation #
OracleSpec.query is protected so the bare identifier query resolves to
HasQuery.query (exported in VCVio.OracleComp.HasQuery.Basic) for
ergonomic monadic use. Files that work structurally on the primitive
single-query syntax OracleQuery spec _ (e.g. liftM (query t),
(query t).cont, induction on query_bind) can opt back into the
primitive interpretation of bare query with a single line:
open scoped OracleSpec.PrimitiveQuery
The notation is scoped to this namespace, so it never leaks past a file
boundary; you must explicitly opt in.
Inside open scoped OracleSpec.PrimitiveQuery, the bare identifier
query aliases the primitive single-query syntax OracleSpec.query.
Instances For
OracleQuery spec inherets the functorial structure from PFunctor.Obj.
The oracle input used in an oracle query.
Instances For
The continutation used for the result of an oracle query.
Instances For
Two oracles queries are equal if they query for the same input and run extensionally equal continuation on the results of the query.
Version of OracleQuery.ext that avoids using HEq when the inputs are the same.
If an oracle exists and the output type is non-empty then the type of queries is non-empty.
If there are no oracles available then the type of queries is empty.
If there is a at most one oracle and output, then ther is at most one query.