Documentation

VCVio.OracleComp.QueryTracking.CountingOracle

Counting Queries Made by a Computation #

This file defines a simulation oracle countingOracle for counting the number of queries made while running the computation. The count is represented by a function from oracle indices to counts, allowing each oracle to be tracked individually.

Tracking individually is not necessary, but gives tighter security bounds in some cases. It also allows for generating things like seed values for a computation more tightly.

def QueryImpl.withCounting {ι : Type u} [DecidableEq ι] {spec : OracleSpec ι} {m : Type u → Type v} [Monad m] (so : QueryImpl spec m) :
Equations
Instances For
    @[simp]
    theorem QueryImpl.withCounting_apply {ι : Type u} [DecidableEq ι] {spec : OracleSpec ι} {m : Type u → Type v} [Monad m] {α : Type u} (so : QueryImpl spec m) (q : spec.OracleQuery α) :
    def countingOracle {ι : Type u} [DecidableEq ι] {spec : OracleSpec ι} :

    Oracle for counting the number of queries made by a computation. The count is stored as a function from oracle indices to counts, to give finer grained information about the count.

    Equations
    Instances For
      @[simp]

      countingOracle has no effect on the behavior of the computation itself.

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