EasyCrypt's conseq keeps what the code does not modify #
EC's conseq (_: P' ==> Q') on c₁ ~ c₂ : P ==> Q asks P => P' and
forall &1 &2, P => forall (modified variables), Q' => Q: the variables the code does not write
keep their values from the precondition. Here that is a frame on each side
(prhlStmt_conseq_frame): the variables Q reads whose writes the code commutes with
(Stmt.CommutesWith, shown as for stmt_swap; such code keeps them, Stmt.satisfies_keep)
keep their values from the start, and the side goal is
∀ σ₁ σ₂, P σ₁ σ₂ → ∀ τ₁ τ₂, (frames) → Q' τ₁ τ₂ → Q τ₁ τ₂. equiv_conseq (: P ==> Q) on
statements is this rule (Logic/ECConseq.lean).
A statement that commutes with every write to x keeps x.
s keeps x: every run ends with x as it started.
Instances For
A call keeps what neither its result nor the globals it leaves hold (a local other than the result).
A call keeps a global L outside the callee's footprint.
A call keeps a global L outside the callee's footprint, its result written elsewhere.
A call keeps a global L that every write of the callee keeps (EC's frame by writes: a callee
that reads L, or whose module touches it elsewhere, without writing it), its result written
elsewhere.
A call of a declared module D on oracles O keeps a global L outside D that every write
of every oracle procedure keeps (EC's frame by writes through an abstract call: the adversary
does not touch L, its oracles read it at most), its result written elsewhere.
s keeps the region F of the globals (EC's glob A, F = fvP A): every run ends with
the same F.touched_getter of the globals as it started.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A call of a module's procedure staying out of F.glob keeps F (EC's glob A across a call
of a concrete procedure outside A), its result written where F does not look.
A Hoare triple from what holds on every outcome (the converse of hoareStmt.satisfies).
EC's conseq on a Hoare triple, with the frame: F relates the state at the start to
the state at the end (what the code keeps).
EC's while I on a Hoare triple whose code ends with a loop: the body keeps I, and
the code before establishes I and, for every final state τ of the loop that its frame F
allows (what the loop keeps), I and a false guard give the postcondition.
Stmt.Keeps.call_app_writes for goal (Stmt.Keeps L.intoGlobal s, s a call of a declared
module D on oracles O): D's representation from its declaration and the oracles' module
type's T.ext (else its canonical one, as equiv_call's), D outside L (fp_disjoint), the
oracles' arguments countable, every write of every oracle procedure keeping L
(ECCallEquiv.writesKeepProof), the result elsewhere (StmtSwap.discharge).
Equations
- One or more equations did not get rendered due to their size.
Instances For
A proof of Stmt.Keeps x s, by the statement's syntax: writes to other variables (the side
equations by StmtSwap.discharge), calls keeping the caller's other locals, a global outside
the callee's footprint (fp_disjoint), or a global no write of the callee's body touches (EC's
frame by writes, ECCallEquiv.writesKeepProof).
A write keeps the region: ∀ v σ, F.touched_getter.get (y.set v σ).globals = … — a local
(the globals unchanged) or a global outside F (touched_set_of_le_compl, fp_disjoint).
Equations
- One or more equations did not get rendered due to their size.
Instances For
A proof of the proposition ty by the tactic tac (no goal left, no error, no sorry).
Equations
- One or more equations did not get rendered due to their size.
Instances For
A proof of Stmt.KeepsRegion F s, by the statement's syntax (calls of modules' procedures
outside F.glob: Stmt.KeepsRegion.call).
The regions F whose F.touched_getter the conditions es read (EC's glob A).
Equations
- One or more equations did not get rendered due to their size.
Instances For
The frame of the statement s for the variables xs (lenses of the program state): those
it keeps (keepsOf), as fun σ τ => x.get τ = x.get σ ∧ …, and the proof of
∀ σ, (programDenotation s σ).satisfies fun r => F σ r.2.
Equations
- One or more equations did not get rendered due to their size.