Logging Queries Made by a Computation #
def
QueryImpl.withLogging
{ι : Type u}
{spec : OracleSpec ι}
{m : Type u → Type v}
[Monad m]
(so : QueryImpl spec m)
:
Given that so implements the oracles in spec using the monad m,
withLogging so gives the same implementation in the extension WriterT (QueryLog spec) m,
by logging all the queries to the writer monad before forwarding the response.
Equations
Instances For
theorem
QueryImpl.fst_map_run_withLogging
{ι : Type u}
{spec : OracleSpec ι}
{α : Type u}
{m : Type u → Type v}
[Monad m]
[LawfulMonad m]
(so : QueryImpl spec m)
(mx : OracleComp spec α)
:
def
loggingOracle
{ι : Type (max u_1 u_2)}
{spec : OracleSpec ι}
:
QueryImpl spec (WriterT spec.QueryLog (OracleComp spec))
Simulation oracle for tracking the quries in a QueryLog, without modifying the actual
behavior of the oracle. Requires decidable equality of the indexing set to determine
which list to update when queries come in.
Equations
Instances For
@[simp]
theorem
loggingOracle.probFailure_simulateQ
{ι : Type}
{spec : OracleSpec ι}
{α : Type}
[spec.Fintype]
[spec.Inhabited]
(oa : OracleComp spec α)
:
@[reducible]
def
OracleComp.withQueryLog
{ι : Type u_1}
{spec : OracleSpec ι}
{α : Type u_1}
(mx : OracleComp spec α)
:
OracleComp spec (α × spec.QueryLog)
Add a query log to a computation using a logging oracle.