Documentation

GaudisCrypt.Logic.ECLoopTest

Tests of stmt_splitwhile and stmt_unroll (Logic/ECLoop.lean).

theorem GaudisCrypt.ECLoopTest.SimAdd.add.procedure.apply_simp (holeArgs✝ : HoleSigs.empty.Instantiation) :
procedure.instantiate holeArgs✝ = proc (a : ℕ, b : ℕ) : ℕ { var c : ℕ; c <- §a + §b; return §c }

Instantiating the holes of SimAdd.add.procedure with a tuple holeArgs of procedures: the body of proc add 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 [SimAdd.add.procedure.apply_simp]).

The module declared by module SimAdd: the record of its procedures SimAdd.add.

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 SimAdd.apply_simp to apply it with.

Equations
Instances For

    The body of proc add of module SimAdd, 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 SimAdd.add.procedure.apply_simp) rather than run. Use SimAdd.add for this procedure as a module.

    Equations
    Instances For
      @[simp]

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

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

      Equations
      Instances For
        theorem GaudisCrypt.ECLoopTest.SimSum.run.procedure.apply_simp (holeArgs✝ : HoleSigs.empty.Instantiation) :
        procedure.instantiate holeArgs✝ = proc (n : ℕ) : ℕ { var i : ℕ, s : ℕ; i <- 0; s <- 0; while (decide (§i < §n)) { s <- call SimAdd.add.procedure (§s, §i); i <- §i + 1; } return §s }

        Instantiating the holes of SimSum.run.procedure with a tuple holeArgs of procedures: the body of proc run 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 [SimSum.run.procedure.apply_simp]).

        The body of proc run of module SimSum, 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 SimSum.run.procedure.apply_simp) rather than run. Use SimSum.run for this procedure as a module.

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

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

          The module declared by module SimSum: the record of its procedures SimSum.run.

          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 SimSum.apply_simp to apply it with.

          Equations
          Instances For

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

            Equations
            Instances For