Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
A sub-event of a null event is null. ofEvent is toNNReal of the measure and the measure
is finite (total mass ≤ 1), so the ℝ≥0 and the ℝ≥0∞ values vanish together and
monotonicity of the measure carries over.
An expectation is 0 when the function vanishes on the support: the measure is discrete,
so the points outside the support carry no mass.
hoareStmt is monotone in its postcondition: a weaker B is a weaker triple, because the null
event ¬ B only shrinks.
hoareProc is monotone in its postcondition, for the same reason as hoareStmt_mono.
A hoareStmt triple is a wp statement: wp against the indicator of the failure event is
that event's mass (expectation_indicator), so the triple is exactly that wp being 0.
The same for hoareProc.
A hoareStmt triple from a wp computation — the direction of hoareStmt_iff_wp that proofs
actually use.
The same for hoareProc.
Strengthening the precondition. The triple comes first, so that apply hoare_pre leaves
it with an open precondition ?A', to be filled by the wp steps, and the implication into
it as the last goal.
Weakening the postcondition (hoareStmt_mono, with the triple first as in hoare_pre):
apply hoare_post leaves the triple with an open postcondition ?B' and the implication out
of it as the last goal.
The rule for skip: the precondition implies the postcondition.
The wp rule for skip: the postcondition itself.
Sequencing: the postcondition of the first statement is the precondition of the second. The
second statement's triple comes first, so that apply hoare_seq leaves it with the open
intermediate condition ?B to be filled by the wp steps, and the first statement's after it.
The wp rule for sampling: the postcondition must hold after writing any value in the support of the sampled distribution.
The wp rule for assignment: the postcondition, at the state with the value written.
A procedure triple is the statement triple about the one-line body
res <- p(args);
where res and args are any two lenses into the caller's locals. The callee runs in its own
frame, so the two need not be disjoint, and neither needs to avoid p's parameter names.
args is read before res is written, and only res and the globals are read afterwards.
hoareStmt quantifies over every initial state; the ← direction picks one whose args slot
holds the given arguments. The tactic hoare_proc_to_stmt (Syntax/HoareSyntax.lean) picks
the two for a given triple: one local variable per parameter, and one for the result.