Combined Caching + Logging Handlers #
This file packages the concrete "cache plus append-log" handlers that are
useful in proof developments but should live below ProgramLogic.
QueryImpl.withCachingTraceAppend is the generic transformer: it threads a
QueryCache spec × ω state, reuses cached answers on hits, falls back to the
underlying implementation on misses, and appends a response-dependent trace to
the second state component after every query.
QueryImpl.withCachingLogging and OracleSpec.cachingLoggingOracle are the
canonical specializations to QueryLog spec.
Cache responses in the first state component and append a response-dependent trace to the second state component after every query.
On a cache hit, the underlying handler is not consulted; the cached answer is
returned directly and the trace still records the observed (query, response)
pair. On a cache miss, the underlying handler supplies the answer, which is then
installed in the cache before the trace is appended.
Instances For
Specialization of withCachingTraceAppend to the canonical query log
QueryLog spec.
Instances For
Forward-direction query bounds for withCachingTraceAppend #
The trace overlay does not change the underlying query count, so the withCaching bounds
transfer through withCachingAux_run_proj_eq via isQueryBound_iff_of_map_eq.
Canonical combined caching + logging oracle over OracleComp spec.
Instances For
Projecting away the log component recovers the ordinary caching semantics.
Output-only projection corollary of fst_map_run_simulateQ.
Forward-direction query bounds #
The log overlay does not change the underlying query count, so the cachingOracle bounds
transfer through fst_map_run_simulateQ via isQueryBound_iff_of_map_eq.