EasyCrypt's while I V on a phoare … = 1 judgment #
phoare_while I V -- EC's `while I V`: the loop runs out with probability 1
On a goal phoare[ … ==> E ] = 1 { s; while c body } (EC proves a loop lossless, or that it ends
in E, with an invariant I and a variant V): the body, from I, the test and V = k, ends
in I with V < k with probability 1 (body, for every k); the code before the loop ends in
I with probability 1. The side conditions — E holds on leaving the loop from I
(exit), the expectation is at most 1 (bound) — are closed when simp can.
EC's while (true) (size p - i): I is True, the variant size p - i (here a natural number,
(size p - i).toNat).
An expectation of a function at most 1 is at most 1.
e ≤ 1 for an expectation built from indicators, products, conditionals and expected (what
the side condition bound of phoare_while is about).
Equations
- GaudisCrypt.tacticLe_one = Lean.ParserDescr.node `GaudisCrypt.tacticLe_one 1024 (Lean.ParserDescr.nonReservedSymbol "le_one" false)
Instances For
A loop with a variant runs out: from I, if every round from I and the test ends in
I with a smaller variant with probability 1, the loop's expectation of g (at most 1, and
1 on leaving the loop from I) is 1.
EC's while I V on a trailing loop, for phoare[ … ] = 1: the body (for every k, from
I, the test and V = k, to I and V < k), the code before the loop (to I), both with
probability 1.
EC's while I V on phoareStmt A {…; while c body} g = 1 (phoareStmt_while_eq_one): goals
body, then the code before the loop; exit and bound when simp does not close them.
Equations
- One or more equations did not get rendered due to their size.
Instances For
EC's while I V on phoare[ … ] = 1 (see the module docstring): I a condition, V a
natural number, written like the judgment's conditions.
Equations
- One or more equations did not get rendered due to their size.