Bounded adaptive loops of clean oracle phases #
A loop of clean phases is a clean phase when one invariant bounds the encoded size of every reachable state. Unlike closed loops, an adaptive loop with an external oracle cannot presample its randomness: every iteration may query the shared stateful oracle, and its replies may be arbitrarily long. The loop therefore runs the step machine itself, once per iteration, with a unary counter stored beside the state; the counter stops the loop after exactly the requested number of steps and the final round executes no step.
The invariant quantifies over every result possible for some stateful handler, so it holds for every shared oracle. Storage growth is controlled by the client's size bound, not assumed.
Main results #
Cslib.Probability.IsTidyOraclePPTOn.iterate_spec: certify a bounded loop and its final supported invariant.Cslib.Probability.IsTidyOraclePPTOn.iterateWith_spec: the step may capture the input.
References #
Adapts Computability/Probabilistic/Adaptive.lean on the cslib crypto branch at
5ff69ca93402e7c947208dc56396d6d86203ccd8 to open oracles, running the probabilistic oracle
version of the tidy iterateWhile loop instead of presampled coins.
A bounded loop of a clean step is clean when one invariant bounds every reachable state. The invariant holds for every possible result under every stateful oracle, and it is also established for the final state.
The loop body may capture the original input. The joint step certificate charges for both that input and the changing state; the client invariant describes only the changing state.
Captured-input steps may grow by a polynomially bounded amount depending on that input, for every possible next state under every stateful oracle.