EasyCrypt's while I on a Hoare triple #
hoare_while (I)
EC's while I on hoare[ c; while b do s : P ==> Q ] leaves two goals:
- the body:
hoare[ s : I ∧ b ==> I ]; - the code before:
hoare[ c : P ==> I ∧ ∀ (modified variables), I ⇒ ¬b ⇒ Q ]: on exit only what the loop modifies has changed, so what the precondition says of the other variables is still there.
Here the second is I σ ∧ ∀ τ, F σ τ → I τ → b τ = false → Q τ, the frame F the variables the
conditions read that the loop keeps (as for EC's conseq, Logic/ECConseqFrame.lean; the rule
is hoareStmt_seq_while_ec).
The older form, three goals (body, exit, the code before with postcondition I) and no
frame, is hoare_while_raw (Logic/HoareWp.lean).
EC's while I on a Hoare triple whose code ends with a loop: goals body and hpre
(see the module docstring). I is written like a condition of a hoare[ ] triple.
Equations
- One or more equations did not get rendered due to their size.