Documentation

GaudisCrypt.Logic.ECConseqHoareTest

Tests of equiv_conseq (: P ==> Q) _ (: P₂ ==> Q₂) and equiv_conseq_pre H (Logic/ECConseqHoare.lean).

The module declared by module Twice: the record of its procedures Twice.f.

The declaration has no parameter list, so no procedure of it can call one either and the module is not a function — it is the plain record itself, and there is no Twice.apply_simp to apply it with.

Equations
Instances For

    The body of proc f of module Twice, as a procedure of its own: it calls no module parameter, so it has no holes.

    A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see Twice.f.procedure.apply_simp) rather than run. Use Twice.f for this procedure as a module.

    Equations
    Instances For

      proc f of module Twice as a module: Module.proc Twice.f.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — Twice.f.apply_simp says exactly that.

      Equations
      Instances For
        @[simp]

        @[simp]: Twice.f = Module.proc Twice.f.procedure — true by definition, proc f using no module parameter and so having no holes to fill.

        theorem GaudisCrypt.ECConseqHoareTest.Twice.f.procedure.apply_simp (holeArgs✝ : HoleSigs.empty.Instantiation) :
        procedure.instantiate holeArgs✝ = proc (x : ℤ) : ℤ { skip; return §x + §x }

        Instantiating the holes of Twice.f.procedure with a tuple holeArgs of procedures: the body of proc f as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.

        Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [Twice.f.procedure.apply_simp]).

        theorem GaudisCrypt.ECConseqHoareTest.Twice_f (v : ℤ) :
        equiv[ Twice.f (x) ~ Twice.f (x) : §x{1} = v ∧ §x{2} = v ==> §res{1} = v + v ∧ §res{2} = v + v ]