pRHL loop rules #
Synchronized invariant rules for the bounded loop combinator loop_n and
for the unbounded while_loop.
The while_loop rule follows EasyCrypt's synchronized while: the guards
must agree under the invariant (PostC refines the invariant by the guard
value), the bodies preserve the invariant from PostC true, and the loop
relates at PostC false. The proof needs no Kleene induction: the left
loop's wp is a least fixed point (wp_while), so it suffices to exhibit a
prefixed point — fun τ₁ => ⨅ τ₂, ⨅ (_ : Inv τ₁ τ₂), (while₂).wp G τ₂ —
the same ENNReal-interpolant trick as rel.trans.
Synchronized loop rule: if the bodies preserve the relational
invariant Inv (as a state relation), so do n synchronized
iterations.
Two-sided synchronized loop rule.
Synchronized while_loop rule #
Synchronized while rule: under the invariant the guards agree
(PostC b records the invariant refined by the guard value b), the
bodies preserve the invariant from PostC true, and the loops relate
at PostC false.
Two-sided synchronized while rule.