Framing a procedure judgment by what both procedures keep #
prhlProc_globInvF_of_writesKeep frames glob D. This is the same argument for any getter. If
neither procedure writes what K₁, K₂ read, then a relation between those values survives the
two runs. EasyCrypt's sim and call frame such equalities implicitly. With it, a judgment proven
on a small part of the state, such as prhlProc_refl_of_within, extends to an invariant on the
rest.
theorem
GaudisCrypt.prhlProc_frame_of_writesKeep
{α : Type}
{sig : ProcedureSignature}
{o₁ o₂ : Procedure sig}
{A : sig.ParamType → VariableAssignment → sig.ParamType → VariableAssignment → Prop}
{B : sig.ret → VariableAssignment → sig.ret → VariableAssignment → Prop}
(K₁ K₂ : VariableAssignment → α)
(R : α → α → Prop)
(h₁ : StmtWithHoles.WritesKeep K₁ o₁.body)
(h₂ : StmtWithHoles.WritesKeep K₂ o₂.body)
(h : prhlProc A o₁ o₂ B)
:
prhlProc
(fun (a₁ : sig.ParamType) (g₁ : VariableAssignment) (a₂ : sig.ParamType) (g₂ : VariableAssignment) =>
A a₁ g₁ a₂ g₂ ∧ R (K₁ g₁) (K₂ g₂))
o₁ o₂ fun (r₁ : sig.ret) (g₁ : VariableAssignment) (r₂ : sig.ret) (g₂ : VariableAssignment) =>
B r₁ g₁ r₂ g₂ ∧ R (K₁ g₁) (K₂ g₂)
The syntactic frame for procedure judgments: a relation R between K₁ on the left and
K₂ on the right, which the two bodies keep (WritesKeep), is added to both conditions.