Documentation

GaudisCrypt.Logic.ECConseqHoare

Two more forms of EasyCrypt's conseq #

With a Hoare triple about one side #

equiv_conseq (: P ==> Q) _ (: P₂ ==> Q₂)     -- EC's `conseq (_ : P ==> Q) _ (_ : P₂ ==> Q₂)`

On a relational judgment c₁ ~ c₂ : A ==> B: what the right program guarantees on its own (hoare[ c₂ : P₂ ==> Q₂ ]) is proved apart from the equivalence. P₂, Q₂ are about the right memory and are written with its tag (size §bs{2} = §n{2}, where EC writes size bs = n): a condition without tags could not name a variable that only the judgment's conditions read.

Goals in EC's order: pre (A implies P and P₂), post (EC's A => (frames) => Q => Q₂ => B, as equiv_conseq (: P ==> Q) states it), hoare (the triple about c₂), judgment (c₁ ~ c₂ : P ==> Q); _ keeps a condition of the judgment. The rule is prhlStmt_and_hoare_right under prhlStmt_conseq_frame.

conseq H on procedures, the precondition kept #

equiv_conseq_pre H                            -- EC's `conseq H` on `equiv[ f ~ g : P ==> Q ]`

equiv_conseq H states post as Q' ⇒ Q alone. EC states it under the precondition (forall &1 &2, P => forall res…, Q' => Q), which a proof may need (a fact about the arguments). equiv_conseq_pre H leaves pre (P ⇒ P') and that post: for the arguments and the initial globals that satisfy P, and every result and final globals, Q' ⇒ Q. The rule is prhlProc_conseq_pre.

EC's conseq (_ : P ==> Q) _ (_ : P₂ ==> Q₂) on a relational judgment about statements: goals pre, post, hoare (the triple P₂ ==> Q₂ about the right program), judgment (P ==> Q). P₂, Q₂ are about the right memory, written with its tag (§x{2}).

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    theorem GaudisCrypt.prhlProc_conseq_pre {sig₁ sig₂ : ProcedureSignature} {p₁ : Procedure sig₁} {p₂ : Procedure sig₂} {A A' : sig₁.ParamType → VariableAssignment → sig₂.ParamType → VariableAssignment → Prop} {B B' : sig₁.ret → VariableAssignment → sig₂.ret → VariableAssignment → Prop} (h : prhlProc A' p₁ p₂ B') (hA : ∀ (a₁ : sig₁.ParamType) (g₁ : VariableAssignment) (a₂ : sig₂.ParamType) (g₂ : VariableAssignment), A a₁ g₁ a₂ g₂ → A' a₁ g₁ a₂ g₂) (hB : ∀ (a₁ : sig₁.ParamType) (g₁ : VariableAssignment) (a₂ : sig₂.ParamType) (g₂ : VariableAssignment), A a₁ g₁ a₂ g₂ → ∀ (r₁ : sig₁.ret) (τ₁ : VariableAssignment) (r₂ : sig₂.ret) (τ₂ : VariableAssignment), B' r₁ τ₁ r₂ τ₂ → B r₁ τ₁ r₂ τ₂) :
    prhlProc A p₁ p₂ B

    A judgment about procedures from another one, the postcondition's implication under the precondition (EC's conseq H: forall &1 &2, P => forall res…, Q' => Q).

    EC's conseq H on a relational judgment about procedures, post under the precondition as EC states it: goals pre (the goal's precondition implies H's) and post (for arguments and initial globals satisfying the goal's precondition, H's postcondition implies the goal's).

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