From relational statements to the eager judgment #
ProgramDenotation.eagerR S S (=) p q (=) (Logic/EagerRhl.lean) is a judgment about two
composite programs on the globals, S; p and q; S. EasyCrypt proves its eager lemmas by the
relational tactics on those composites. This file lets the equiv_* tactics do the same.
ProgramDenotation.preserves_compl_of_inFootprint: a run confined to a lensXkeeps everything outsideX(X.compl).ProgramDenotation.eagerR_of_prhl2_lens: the frame. WhenS,pandqare confined toX, a coupling of the composites with equal results and equalXis the full equality-invariant eager judgment. EasyCrypt'seagerlemmas about an oracle stateX(={x, FRO.m} ==> ={res, FRO.m}) are proven at this postcondition.prhl2_composite_of_prhlStmt: the composites are the runs of the statements_ <- R(); r <- p(a)andr <- q(a); _ <- R(), so aprhlStmtbetween those statements gives the coupling.eagerR_of_prhlStmt: the two together.
A run confined to X keeps the content outside X.
Two states that agree on X and outside it are equal.
The frame for the eager judgment: with S, p and q confined to X, a coupling of
S; p and q; S with equal results and equal X gives the equality-invariant judgment.
A run confined to X from two states equal on X (EC's sim on code touching only
X): the two runs couple with equal results and equal X. The second state is the first with
its outside replaced, a deterministic update outside X, which the run commutes with.
ProgramDenotation.prhl2_refl_of_inFootprint for a procedure: EC's sim on an oracle
procedure whose code touches only X, from ={arg, X} to ={res, X}.
prhlProc_refl_of_inFootprint for a procedure within X (within_lens).
A run on the left only, against a value on the right: lossless, and the postcondition on all
its outcomes (ProgramDenotation.prhl2.kill_left for any result types).
The composites as statements #
programDenotation_call_apply, for StmtWithHoles.call (the form the program syntax and the
inliner use).
_ <- R(); y <- p(a): the eager side's composite, as a statement.
Equations
- GaudisCrypt.eagerLeftStmt R p a y = GaudiProg[ call R (); y <- call p (a); ]
Instances For
y <- q(a); _ <- R(): the lazy side's composite, as a statement.
Equations
- GaudisCrypt.eagerRightStmt R q a y = GaudiProg[ y <- call q (a); call R (); ]
Instances For
From statements to the eager judgment: a prhlStmt between _ <- R(); y <- p(a) and
y <- q(a); _ <- R(), from equal X to equal y and equal X, is the equality-invariant
eager judgment, when R, p and q are confined to X. EasyCrypt's eager proc on a concrete
pair of procedures, followed by its relational proof.