Tidy realizations of oracle PPT programs #
IsTidyOraclePPTOn strengthens IsOraclePPTOn by requiring one finite machine that halts
within a polynomial clock as a clean phase: it starts with blank work tapes and empty query
buffers, works for arbitrary retained answer tapes, and finishes with blank work tapes, empty
query buffers and its input head restored. Its output is appended to the output tape, and the
complete joint law of that output and every external oracle state is exact.
Clean phases compose. This module gives the shared core of the open calculus: deterministic
programs, the bounded-prefix query, fair bits, captured data, monadic composition and branching.
Only the selected branch of a conditional is executed, so unselected branches make no external
call. An unbounded oracle reply is never copied for free: query_take charges its prefix length.
Main definitions #
Cslib.Probability.IsTidyOraclePPTOn: a uniform polynomial-time clean-phase realization.
Main results #
Cslib.Probability.IsTidyOraclePPTOn.isOraclePPTOn: clean realizations are oracle PPT.Cslib.Probability.IsTidyOraclePPTOn.query_take: one external call returning a reply prefix.Cslib.Probability.IsTidyOraclePPTOn.bind,.bind_with,.pair,.map,.preprocess: composition, charging every intermediate word.Cslib.Probability.IsTidyOraclePPTOn.cond,.finite_cases: dispatch executing only the selected branch.
References #
The clean-phase combinators adapt the tidy deterministic calculus of cslib (Christian
Reitwiessner) to the probabilistic oracle machines of the cslib crypto branch at
5ff69ca93402e7c947208dc56396d6d86203ccd8.
One finite machine computes the encoded program as a clean phase within a uniform polynomial clock, preserving the joint law of the output and every shared stateful oracle.
Instances For
A fixed finite machine with a polynomially bounded clean-phase clock is a certificate.
A clean realization is in particular a strict oracle PPT certificate.
Equality of the complete stateful semantics preserves a clean realization.
A program returning its declared encoding has the same clean realizations.
Every supported encoded output has polynomial length, independently of all oracle replies.
One external call submits query on channel op and returns at most limit reply bits.
Unframing the request, the call and scanning the unary limit are all charged.
A fair private bit leaves every external oracle state unchanged.
Retain efficiently computed data beside a probabilistic oracle result.
Sequence two clean realizations. The first output length bounds the continuation's clock, and transferring the intermediate word is charged.
A continuation may use both the caller's input and the first result.
Efficient deterministic programs are clean phases that make no external call.
Efficiently prepare the argument of a clean realization.
Efficient deterministic postprocessing of every result preserves clean realization.
A deterministic callback may capture the original argument.
Select a branch with an efficient Boolean condition. Only the selected branch runs, so an unselected branch makes no external call and cannot change any oracle state.
Select a branch with an efficiently decidable condition, executing only that branch.
A computed finite tag selects one certified branch, which alone is executed.