Documentation

GaudisCrypt.Logic.ECInlineParamsTest

Golden tests of stmt_split_params #

The code EC's inline leaves: one assignment per parameter of an inlined call, the result's tuple assignment as it is (see Logic/ECAutoTest.lean for the format; scripts/update_golden.py refreshes the expected text).

The module declared by module M: the record of its procedures M.add, M.main.

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

Equations
Instances For
    theorem GaudisCrypt.ECInlineParamsTest.M.add.procedure.apply_simp (holeArgs✝ : HoleSigs.empty.Instantiation) :
    procedure.instantiate holeArgs✝ = proc (x : ℕ, y : ℕ, z : ℕ) : (ℕ × ℕ) { var s : ℕ; s <- §x + §y; return (§s, §s + §z) }

    Instantiating the holes of M.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 [M.add.procedure.apply_simp]).

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

    Equations
    Instances For

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

      Equations
      Instances For
        @[simp]

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

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

        Equations
        Instances For

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

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            theorem GaudisCrypt.ECInlineParamsTest.M.main.procedure.apply_simp (holeArgs✝ : HoleSigs.empty.Instantiation) :
            procedure.instantiate holeArgs✝ = proc (a : ℕ) : ℕ { var u : ℕ, v : ℕ; u, v <- call add.procedure (§a, §a + 1, 2); return §u + §v }

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

            @[simp]

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