Running a program against a stateful oracle #
A program with private samples and typed external calls (Cslib.ProbOracleComp) interacts with a
stateful probabilistic oracle answering each call q with an element of spec q, possibly at
random and updating a private state. Cslib.ProbOracleComp.runWith is the joint law of the result
and the final oracle state, with fresh fair samples for the private coins, and
Cslib.ProbOracleComp.acceptProbWith the probability that a Boolean program returns true.
A prover of an interactive proof is such an oracle; Cslib.Complexity.Prover.run is the case of
word queries and replies (Cslib.Complexity.Prover.run_eq_runWith).
runWith is the instance of the generic OracleComp.runWith whose handler draws private samples
freshly and answers external calls by oracle; that handler is the sum of the lifted uniform
handler and oracle (runWith_eq_runWith_sumHandler). Against a memoryless oracle it is
OracleComp.evalWith of the sum of the uniform handler and the oracle, with the state unchanged
(runWith_lift). Its structural rules are those of OracleComp.runWith.
Main definitions #
Cslib.ProbOracleComp.runWith: the joint law of the result and the final oracle state.Cslib.ProbOracleComp.acceptProbWith: the acceptance probability.
Main results #
Cslib.ProbOracleComp.runWith_eq_runWith_sumHandler,Cslib.ProbOracleComp.runWith_lift,Cslib.ProbOracleComp.acceptProbWith_lift: the instances of the generic semantics.Cslib.ProbOracleComp.runWith_pure,Cslib.ProbOracleComp.runWith_bind,Cslib.ProbOracleComp.runWith_map,Cslib.ProbOracleComp.runWith_query,Cslib.ProbOracleComp.runWith_sample: structural rules forrunWith.Cslib.ProbOracleComp.acceptProbWith_bind: sequencing for acceptance probability.Cslib.ProbOracleComp.acceptProbWith_query_bind,Cslib.ProbOracleComp.acceptProbWith_sample_bind: averages over replies and samples.Cslib.ProbOracleComp.acceptProbWith_bind_ite_le: a check run only after another one accepted accepts at most as often.
The joint law of the result of program and the final state of the oracle answering its
external calls, starting from the state s. Private samples are fresh.
Instances For
The probability that program returns true against the oracle from the state s.
Instances For
The run is the generic stateful run whose handler answers private samples by fresh uniform
draws, keeping the state, and external calls by oracle.
Against a memoryless oracle, the run is OracleComp.evalWith of the uniform handler on the
sampling side and the oracle on the other, with the state unchanged.
Against a memoryless oracle, the acceptance probability is the probability of true under
OracleComp.evalWith of the uniform handler and the oracle.
Running program >>= next runs program, then runs next at its result from the oracle
state it reached.
Mapping f over a program maps it over the result and keeps the final oracle state.
An acceptance probability is at most 1.
The acceptance probability of program >>= next averages the acceptance probability of next
over the joint law of the result and oracle state of program.
The acceptance probability after an external call q averages over the oracle's replies and
next states.
The acceptance probability after a private sample averages over the law of the sample, with the oracle state unchanged.
Running a second check only after a first one accepted accepts at most as often as the first check.