Concrete syntax for probabilities #
EasyCrypt's Pr[ M.f(a₁, …, aₙ) @ &m : E ]:
Pr[ M (a₁, …, aₙ) @ &m : E ]
is the probability that the procedure M, run on the arguments a₁, …, aₙ from the globals
m : VariableAssignment, ends with a result and globals satisfying the event E — the real
number (Procedure.Pr p (a₁, …, aₙ) m E : ℝ) (Logic/PHoare.lean). As in EC it is a real, so
that differences and absolute values of probabilities are what they look like.
- The subject
Mis what the procedure judgments take (hoare[ M : … ],phoare[ M : … ]): a procedure, or a procedure module (amodule'sX.f,Module.app X A, …), atterm:max. - The arguments are Lean terms, as many as the procedure has parameters (none:
M ()). A single term for a procedure with several parameters is the whole argument tuple. - The memory
mfollows&(EC's memory names), atterm:max. - The event
Eis read like the postcondition ofphoare[ M : … ]:§resis the result,§xa global,§allGlobalsthe whole global state. ABoolevent is coerced, so EC's: resis: §res.
It prints back in the same form (#roundtrip, PrSyntaxTest.lean).
Equations
- One or more equations did not get rendered due to their size.