Documentation

GaudisCrypt.Logic.ECTrans

EasyCrypt's transitivity #

equiv_trans{i} { code } (P₁ ==> Q₁) (P₂ ==> Q₂)     -- EC's `transitivity{i} { code } …`

On a relational judgment c₁ ~ c₂ : P ==> Q: through the middle code code (written over side i's variables, more declared with var), the judgments c₁ ~ code : P₁ ==> Q₁ and code ~ c₂ : P₂ ==> Q₂. Goals in EC's order: the precondition splits through a middle state (∀ σ₁ σ₂, P σ₁ σ₂ → ∃ σ, P₁ σ₁ σ ∧ P₂ σ σ₂), the postconditions compose (∀ τ₁ τ τ₂, Q₁ τ₁ τ → Q₂ τ τ₂ → Q τ₁ τ₂), then the two judgments. The rule is prhlStmt.trans (Logic/LoopTransform.lean), by the gluing of couplings.

For procedures, prhlProc_trans_ec: the same through a middle procedure (EC's transitivity N (P₁ ==> Q₁) (P₂ ==> Q₂)).

theorem GaudisCrypt.prhlProc_trans_ec {sig₁ sig₂ sig : ProcedureSignature} {A : sig₁.ParamType → VariableAssignment → sig₂.ParamType → VariableAssignment → Prop} {B : sig₁.ret → VariableAssignment → sig₂.ret → VariableAssignment → Prop} {P₁ : sig₁.ParamType → VariableAssignment → sig.ParamType → VariableAssignment → Prop} {Q₁ : sig₁.ret → VariableAssignment → sig.ret → VariableAssignment → Prop} {P₂ : sig.ParamType → VariableAssignment → sig₂.ParamType → VariableAssignment → Prop} {Q₂ : sig.ret → VariableAssignment → sig₂.ret → VariableAssignment → Prop} {p₁ : Procedure sig₁} {p₂ : Procedure sig₂} {n : Procedure sig} (hP : ∀ (a₁ : sig₁.ParamType) (g₁ : VariableAssignment) (a₂ : sig₂.ParamType) (g₂ : VariableAssignment), A a₁ g₁ a₂ g₂ → ∃ (a : sig.ParamType) (g : VariableAssignment), P₁ a₁ g₁ a g ∧ P₂ a g a₂ g₂) (hQ : ∀ (r₁ : sig₁.ret) (g₁ : VariableAssignment) (r : sig.ret) (g : VariableAssignment) (r₂ : sig₂.ret) (g₂ : VariableAssignment), Q₁ r₁ g₁ r g → Q₂ r g r₂ g₂ → B r₁ g₁ r₂ g₂) (h₁ : prhlProc P₁ p₁ n Q₁) (h₂ : prhlProc P₂ n p₂ Q₂) :
prhlProc A p₁ p₂ B

EC's transitivity N (P₁ ==> Q₁) (P₂ ==> Q₂) on procedures, its goals in EC's order: the middle procedure's argument and globals from the two sides', the postconditions composed, the two judgments.

EC's transitivity{i} { code } (P₁ ==> Q₁) (P₂ ==> Q₂): see the module docstring.

Equations
  • One or more equations did not get rendered due to their size.
Instances For