Probabilistic block specifications
Library · Source module
Probabilistic block specifications
A randomized program meets its specification only on a good set of tapes. A probabilistic block specification NLAlib.Ops.PWrites says: from every memory of the precondition, the run writes only the footprint and ends in the postcondition for every tape of a good set, and under every tape with the stream laws law the good set fails with probability at most \varphi. The good set depends measurably on the memory and only on the tape from the current position on.
The rules mirror those of NLAlib.Ops.Writes, with failure probabilities that add: a deterministic block has failure 0 (PWrites.of_writes), a call whose result is wrong only on a bad window of its own draws has the probability of that window (PWrites.of_window), and a sequence, a branch, a counted loop and a loop with early exit add the failure probabilities of their parts (PWrites.seq, PWrites.ite, PWrites.whileFuel). The union bound over adaptively started calls is thus proved once, in PWrites.seq, from the strong Markov property of the tape (NLAlib.Ops.IsTapeLaw.measure_inter_shift_mem, at the stopping time "end position of the first part, ⊤ if it fails") and the measurability of runs (NLAlib.Ops.Interp.IsMeasurable.measurable_eval); a program proof applies the rules and never names the random state of a call.
Main definitions
* NLAlib.Ops.Interp.IsMeasurable (memories are measurable through NLAlib.Ops.Mem.obs, NLAlib.Ops.RunMeasurable). * NLAlib.Ops.Tape.DeterminedFrom: a set of tapes decided by the entries from a position on. * NLAlib.Ops.PWrites.
Main results
* NLAlib.Ops.Interp.IsMeasurable.measurable_eval: a run is measurable in its tape and memory. * NLAlib.Ops.PWrites.measureReal_not_writes_le: the probability that the run misses the postcondition. * NLAlib.Ops.PStep.bind: the union bound over the random end position of a first step, the core of PWrites.seq and PWrites.whileFuel. * NLAlib.Ops.PWrites.of_writes, .mono, .nonneg, .of_window, .seq, .ite, .whileFuel.
Declarations
- NLAlib.Ops.Interp.IsMeasurable
- NLAlib.Ops.Interp.IsMeasurable.measurableRun_callS
- NLAlib.Ops.Interp.IsMeasurable.measurable_eval
- NLAlib.Ops.Interp.IsMeasurable.measurable_testAt
- NLAlib.Ops.IsTapeLaw.measurable_measure_notMem
- NLAlib.Ops.PStep
- NLAlib.Ops.PStep.bind
- NLAlib.Ops.PStep.bind_test
- NLAlib.Ops.PStep.measure_exists_bind_bad_le
- NLAlib.Ops.PStep.mono
- NLAlib.Ops.PWrites
- NLAlib.Ops.PWrites.allocs
- NLAlib.Ops.PWrites.bindIdx
- NLAlib.Ops.PWrites.bindIdx_of_index_eq
- NLAlib.Ops.PWrites.in_frame
- NLAlib.Ops.PWrites.ite
- NLAlib.Ops.PWrites.loop
- NLAlib.Ops.PWrites.measureReal_not_conditionalRuns_le
- NLAlib.Ops.PWrites.measureReal_not_writes_le
- NLAlib.Ops.PWrites.mono
- NLAlib.Ops.PWrites.nonneg
- NLAlib.Ops.PWrites.note_iff
- NLAlib.Ops.PWrites.of_window
- NLAlib.Ops.PWrites.of_writes
- NLAlib.Ops.PWrites.seq
- NLAlib.Ops.PWrites.seq_assoc_iff
- NLAlib.Ops.PWrites.whileFuel
- NLAlib.Ops.Tape.DeterminedFrom