EasyCrypt's bypr, on phoare judgments #
bypr is the converse of byphoare (Logic/PrTactics.lean): a procedure judgment about an
event,
phoare[ p : P ==> E ] ≤ (ENNReal.ofReal x) (or `=`, `≥`)
its bound a real (as byphoare and phoare_call (: P ==> Q) leave it: EC's bounds are reals),
becomes the statement about the probabilities of the runs that satisfy the precondition,
∀ a &m, P a m → Pr[ p (a) @ &m : E ] ≤ x
(EC's goal after bypr=> &m: the arguments and the memory are introduced by intro).
bypr for ≤.
bypr for ≥.
bypr for =.
The event of a postcondition in the shape phoare[ p : P ==> ev ] elaborates to,
fun res σ => let res := …; GaudiExpr[ indicatorE (ev) ].get ⟨σ, init⟩, in the shape
Pr[ … : ev ] elaborates to (GaudiExpr[ ev ] read the same way), so that the goal bypr
leaves prints as probabilities; none for another shape.
EC's bypr on a phoare judgment about a procedure, see the module docstring: the goal
phoare[ p : P ==> E ] ≤ (ENNReal.ofReal x) (=, ≥) becomes
∀ a &m, P a m → Pr[ p (a) @ &m : E ] ≤ x.
Equations
- GaudisCrypt.tacticBypr = Lean.ParserDescr.node `GaudisCrypt.tacticBypr 1024 (Lean.ParserDescr.nonReservedSymbol "bypr" false)