Logging Queries Made by a Computation #
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.
Instances For
Logging preserves failure probability: for any base monad m with HasEvalSPMF,
wrapping an oracle implementation with withLogging does not change the probability of failure.
When m = OracleComp spec, both sides are 0 (trivially true). When m can genuinely fail
(e.g. OptionT (OracleComp spec)), this is a non-trivial faithfulness property.
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.
Instances For
Specialization of QueryImpl.probFailure_run_simulateQ_withLogging to loggingOracle.
Specialization of QueryImpl.NeverFail_run_simulateQ_withLogging_iff to loggingOracle.
loggingOracle preserves IsTotalQueryBound: the query structure of
(simulateQ loggingOracle oa).run is identical to that of oa (each query passes through
unchanged, with only the writer log being appended).
A total query bound controls the length of every loggingOracle trace in support:
if oa makes at most n queries, then every support point of
(simulateQ loggingOracle oa).run has log length at most n.
Add a query log to a computation using a logging oracle.