Documentation

VCVio.OracleComp.QueryTracking.LoggingOracle

Logging Queries Made by a Computation #

def QueryImpl.withLogging {ι : Type u} {spec : OracleSpec ι} {m : Type u → Type v} [Monad m] (so : QueryImpl spec m) :
QueryImpl spec (WriterT spec.QueryLog m)

Add logging to an existing query implementation, using StateT to extend the final monad.

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    @[simp]
    theorem QueryImpl.withLogging_apply {ι : Type u} {spec : OracleSpec ι} {m : Type u → Type v} [Monad m] {α : Type u} (so : QueryImpl spec m) (q : spec.OracleQuery α) :
    def loggingOracle {ι : Type u} {spec : OracleSpec ι} :

    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.apply_eq {ι : Type u} {spec : OracleSpec ι} {α : Type u} (q : spec.OracleQuery α) :
      @[simp]

      Taking only the main output after logging queries is the original compuation.

      @[simp]
      theorem loggingOracle.run_simulateQ_bind_fst {ι : Type u} {spec : OracleSpec ι} {α β : Type u} (oa : OracleComp spec α) (ob : αOracleComp spec β) :
      (do let x(OracleComp.simulateQ loggingOracle oa).run ob x.1) = oa >>= ob

      Throwing away the query log after simulation looks like running the original computation.