Documentation

GaudisCrypt.Logic.FrameTactics

Footprint and frame tactics, invariant Hoare rules #

Small helpers for game proofs that frame oracles against an abstract adversary:

X ≤ A₁ ⊔ … ⊔ Aₙ for X one of the joinands (nested joins included), by backtracking.

Equations
Instances For

    A join of footprints below a join containing each of its joinands (fp_mem, splitting the left-hand join).

    Equations
    Instances For

      writes_keep, the writes to global lenses closed by touched_set_of_le_compl with a hypothesis X.footprint ≤ Fᶜ about the written lens X itself (found syntactically, not by assumption, which compares the footprints of different lenses by unfolding them).

      Equations
      Instances For
        theorem GaudisCrypt.hoareProc_const {sig : ProcedureSignature} (p : Procedure sig) (P : Prop) :
        hoareProc (fun (x : sig.ParamType) (x_1 : VariableAssignment) => P) p fun (x : sig.ret) (x_1 : VariableAssignment) => P

        A Hoare triple whose pre- and postcondition are the same proposition, independent of the state.

        theorem GaudisCrypt.hoare_if_inv {c : Getter Bool ProgramState} {p q : Stmt} {J B : ProgramState → Prop} (ht : hoareStmt J p B) (he : hoareStmt J q B) :
        hoareStmt J (GaudiProg[ if (§c) { stmt p; } else { stmt q; } ]) B

        A conditional keeps an invariant when both branches do.

        theorem GaudisCrypt.hoare_seq_inv {J C : ProgramState → Prop} {p q : Stmt} (hq : hoareStmt J q C) (hp : hoareStmt J p J) :
        hoareStmt J (GaudiProg[ stmt p; stmt q; ]) C

        Sequencing through an invariant: the first part keeps the precondition.