Golden tests: a module read at another module type; a procedure's footprint read off its code #
equiv_procandstmt_inlineopen a procedure of a module read through a view at another module type (EasyCrypt's subtyping: a primitive handed on as the distinguisher's view of it), with nomodule_normfirst (Flatten.unfoldProcedureretries through the views where the plain pass finds no body; the SHA-3 port'sLowerDistandSponge(PRIMITIVE.view Perm)are the cases the plain pass misses).fp_lebounds amodule's procedure that has no stated@[fp_bound]by its code (ModuleFootprint.cachedBound).
Equations
- GaudisCrypt.ECProcViewsTest.cnt = GaudisCrypt.varLens (GaudisCrypt.VariableName.mk "GaudisCrypt.ECProcViewsTest.cnt" ℤ)
Instances For
Builds a module of type PRIM from the record PRIM.Structure of its fields, as a right-nested Module.pair'. @[reducible].
Inverse of PRIM.structure (PRIM.mk_destruct, PRIM.destruct_mk); a single field of a module built this way is read back by the @[simp] lemmas PRIM.init.mk_simp, PRIM.f.mk_simp.
Equations
- GaudisCrypt.ECProcViewsTest.PRIM.mk theRecord✝ = GaudisCrypt.Module.pair' theRecord✝.init theRecord✝.f
Instances For
@[simp]: reading the field f back off a module built from a record — PRIM.f (PRIM.mk r) = r.f.
It is what carries the right-hand side of an X.apply_simp (which is an PRIM.mk) on to the field the caller actually asked for, so that simp chains X.apply_simp into X.f.apply_simp.
The module type declared by moduletype PRIM, with fields init, f: the type Module PRIM.typeRep of modules that are a right-nested tuple of the field types.
Build one from a record of its fields with PRIM.mk, read a single field off one with the accessors PRIM.init, PRIM.f, and get the whole record back with PRIM.structure.
Equations
Instances For
The field f of a module of type PRIM: the projection onto component 1 of the right-nested tuple PRIM.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].
PRIM.f.mk_simp reads this field back off a module built by PRIM.mk; PRIM.f.utilities has the accessor as a module, and the lemmas about it.
Its parameters are named x, in that order (recorded in @[gaudiProcParamNames], a ProcedureSignature holding only their types).
Equations
- theModule✝.f = GaudisCrypt.Module.snd' theModule✝
Instances For
The field init of a module of type PRIM: the projection onto component 0 of the right-nested tuple PRIM.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].
PRIM.init.mk_simp reads this field back off a module built by PRIM.mk; PRIM.init.utilities has the accessor as a module, and the lemmas about it.
It takes no parameters (recorded in @[gaudiProcParamNames]).
Equations
- theModule✝.init = GaudisCrypt.Module.fst' theModule✝
Instances For
@[simp]: PRIM.structure (PRIM.mk r) = r — destructing a module built from a record gives that record back.
The IsModule PRIM instance: PRIM is a module type, with representation PRIM.typeRep.
It is what lets the name PRIM stand where a module type is expected — in Module.Arr/Module.Prod (→ₘ/×ₘ), say — which the underlying Module PRIM.typeRep would do on its own but PRIM, a plain (non-reducible) def, would not.
Equations
- GaudisCrypt.ECProcViewsTest.instIsModulePRIM = { moduleTypeRep := GaudisCrypt.ECProcViewsTest.PRIM.typeRep, isModule := ⋯ }
@[simp]: reading the field init back off a module built from a record — PRIM.init (PRIM.mk r) = r.init.
It is what carries the right-hand side of an X.apply_simp (which is an PRIM.mk) on to the field the caller actually asked for, so that simp chains X.apply_simp into X.init.apply_simp.
What is derivable about the accessor PRIM.f, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):
PRIM.f.utilities.accessorModule : PRIM →ₘ …— the accessor as a module, a projection being a module morphism;PRIM.f.utilities.apply_simp—Module.app PRIM.f.utilities.accessorModule m = PRIM.f m: applying that module is the accessor;PRIM.f.utilities.expression_eq— the same at the level of expressions:(PRIM.f m).expression = (PRIM.f.utilities.proj m.expression).reduce.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The ModuleTypeRep underlying PRIM, the module type declared by moduletype PRIM: the right-nested product of its 2 field types, in declaration order.
PRIM is by definition Module PRIM.typeRep.
Equations
Instances For
What is derivable about the accessor PRIM.init, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):
PRIM.init.utilities.accessorModule : PRIM →ₘ …— the accessor as a module, a projection being a module morphism;PRIM.init.utilities.apply_simp—Module.app PRIM.init.utilities.accessorModule m = PRIM.init m: applying that module is the accessor;PRIM.init.utilities.expression_eq— the same at the level of expressions:(PRIM.init m).expression = (PRIM.init.utilities.proj m.expression).reduce.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The record of a module's fields: PRIM.structure m is PRIM.Structure.mk applied to PRIM.init, PRIM.f of m.
Inverse of PRIM.mk (PRIM.mk_destruct, PRIM.destruct_mk).
Instances For
What is derivable about the accessor DPRIM.f, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):
DPRIM.f.utilities.accessorModule : DPRIM →ₘ …— the accessor as a module, a projection being a module morphism;DPRIM.f.utilities.apply_simp—Module.app DPRIM.f.utilities.accessorModule m = DPRIM.f m: applying that module is the accessor;DPRIM.f.utilities.expression_eq— the same at the level of expressions:(DPRIM.f m).expression = (DPRIM.f.utilities.proj m.expression).reduce.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The module type declared by moduletype DPRIM, with fields f: the type Module DPRIM.typeRep of modules that are a right-nested tuple of the field types.
Build one from a record of its fields with DPRIM.mk, read a single field off one with the accessors DPRIM.f, and get the whole record back with DPRIM.structure.
Equations
Instances For
The IsModule DPRIM instance: DPRIM is a module type, with representation DPRIM.typeRep.
It is what lets the name DPRIM stand where a module type is expected — in Module.Arr/Module.Prod (→ₘ/×ₘ), say — which the underlying Module DPRIM.typeRep would do on its own but DPRIM, a plain (non-reducible) def, would not.
Equations
- GaudisCrypt.ECProcViewsTest.instIsModuleDPRIM = { moduleTypeRep := GaudisCrypt.ECProcViewsTest.DPRIM.typeRep, isModule := ⋯ }
@[simp]: DPRIM.structure (DPRIM.mk r) = r — destructing a module built from a record gives that record back.
The record of a module's fields: DPRIM.structure m is DPRIM.Structure.mk applied to DPRIM.f of m.
Inverse of DPRIM.mk (DPRIM.mk_destruct, DPRIM.destruct_mk).
Instances For
@[simp]: reading the field f back off a module built from a record — DPRIM.f (DPRIM.mk r) = r.f.
It is what carries the right-hand side of an X.apply_simp (which is an DPRIM.mk) on to the field the caller actually asked for, so that simp chains X.apply_simp into X.f.apply_simp.
The field f of a module of type DPRIM: the projection onto component 0 of the right-nested tuple DPRIM.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].
DPRIM.f.mk_simp reads this field back off a module built by DPRIM.mk; DPRIM.f.utilities has the accessor as a module, and the lemmas about it.
Its parameters are named x, in that order (recorded in @[gaudiProcParamNames], a ProcedureSignature holding only their types).
Instances For
Builds a module of type DPRIM from the record DPRIM.Structure of its fields, as a right-nested Module.pair'. @[reducible].
Inverse of DPRIM.structure (DPRIM.mk_destruct, DPRIM.destruct_mk); a single field of a module built this way is read back by the @[simp] lemmas DPRIM.f.mk_simp.
Equations
- GaudisCrypt.ECProcViewsTest.DPRIM.mk theRecord✝ = theRecord✝.f
Instances For
The ModuleTypeRep underlying DPRIM, the module type declared by moduletype DPRIM: the right-nested product of its 1 field types, in declaration order.
DPRIM is by definition Module DPRIM.typeRep.
Equations
Instances For
Instantiating the holes of Ctr.init.procedure with a tuple holeArgs of procedures: the body of proc init 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 [Ctr.init.procedure.apply_simp]).
Instantiating the holes of Ctr.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 [Ctr.f.procedure.apply_simp]).
@[simp]: Ctr.init = Module.proc Ctr.init.procedure — true by definition, proc init using no module parameter and so having no holes to fill.
proc init of module Ctr as a module: Module.proc Ctr.init.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — Ctr.init.apply_simp says exactly that.
Equations
Instances For
The body of proc f of module Ctr, 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 Ctr.f.procedure.apply_simp) rather than run. Use Ctr.f for this procedure as a module.
Equations
- GaudisCrypt.ECProcViewsTest.Ctr.f.procedure = proc (x : ℤ) : ℤ { GaudisCrypt.ECProcViewsTest.cnt <- §GaudisCrypt.ECProcViewsTest.cnt + 1; return §x + 1 }
Instances For
The body of proc init of module Ctr, 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 Ctr.init.procedure.apply_simp) rather than run. Use Ctr.init for this procedure as a module.
Equations
- GaudisCrypt.ECProcViewsTest.Ctr.init.procedure = proc () : Unit { GaudisCrypt.ECProcViewsTest.cnt <- 0; return () }
Instances For
proc f of module Ctr as a module: Module.proc Ctr.f.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — Ctr.f.apply_simp says exactly that.
Equations
Instances For
The module declared by module Ctr: the record of its procedures Ctr.init, Ctr.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 Ctr.apply_simp to apply it with.
Equations
Instances For
@[simp]: Ctr.f = Module.proc Ctr.f.procedure — true by definition, proc f using no module parameter and so having no holes to fill.
The module declared by module G: the record of its procedures G.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 G.apply_simp to apply it with.
Instances For
proc run of module G as a module: Module.proc G.run.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — G.run.apply_simp says exactly that.
Equations
Instances For
@[simp]: G.run = Module.proc G.run.procedure — true by definition, proc run using no module parameter and so having no holes to fill.
The body of proc run of module G, 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 G.run.procedure.apply_simp) rather than run. Use G.run for this procedure as a module.
Equations
- GaudisCrypt.ECProcViewsTest.G.run.procedure = proc () : ℤ { var y : ℤ; y <- call GaudisCrypt.ECProcViewsTest.CtrView.f.procedure (1); return §y }
Instances For
Instantiating the holes of G.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 [G.run.procedure.apply_simp]).
Instantiating the holes of H.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 [H.run.procedure.apply_simp]).
The module declared by module H: the record of its procedures H.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 H.apply_simp to apply it with.
Instances For
The body of proc run of module H, 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 H.run.procedure.apply_simp) rather than run. Use H.run for this procedure as a module.
Equations
- GaudisCrypt.ECProcViewsTest.H.run.procedure = proc () : ℤ { var y : ℤ; y <- call GaudisCrypt.ECProcViewsTest.Ctr.f.procedure (1); return §y }
Instances For
proc run of module H as a module: Module.proc H.run.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — H.run.apply_simp says exactly that.
Equations
Instances For
@[simp]: H.run = Module.proc H.run.procedure — true by definition, proc run using no module parameter and so having no holes to fill.
Equations
- GaudisCrypt.ECProcViewsTest.other = GaudisCrypt.varLens (GaudisCrypt.VariableName.mk "GaudisCrypt.ECProcViewsTest.other" ℤ)
Instances For
A module read at a clone's module type through another module type's record: the first SHA-3
port's module types (explicit type parameters) are the theory's (instance parameters) at the
clone's types, so a module built with the first port's constructor is one of the clone's module
type, and the clone's accessor (here of a clone inside a cloned theory, as SHA3OSecurity's
SH.OIndif) meets that record. proc opens it as it is (SHA3OSecurity's GAP 3, whose hand
simp only [ODPRIMITIVE_f_mk] became unnecessary with the procedures across clones' module types,
2026-11-17).
The record of a module's fields: DPRIM2.structure m is DPRIM2.Structure.mk applied to DPRIM2.f of m.
Inverse of DPRIM2.mk (DPRIM2.mk_destruct, DPRIM2.destruct_mk).
Equations
- GaudisCrypt.ECProcViewsTest.FP.DPRIM2.structure p theModule✝ = { f := GaudisCrypt.ECProcViewsTest.FP.DPRIM2.f p theModule✝ }
Instances For
@[simp]: DPRIM2.mk (DPRIM2.structure m) = m — rebuilding a module from its own fields gives that module back.
The ModuleTypeRep underlying DPRIM2, the module type declared by moduletype DPRIM2: the right-nested product of its 1 field types, in declaration order.
DPRIM2 is by definition Module DPRIM2.typeRep.
Equations
Instances For
The IsModule DPRIM2 instance: DPRIM2 is a module type, with representation DPRIM2.typeRep.
It is what lets the name DPRIM2 stand where a module type is expected — in Module.Arr/Module.Prod (→ₘ/×ₘ), say — which the underlying Module DPRIM2.typeRep would do on its own but DPRIM2, a plain (non-reducible) def, would not.
Equations
- GaudisCrypt.ECProcViewsTest.FP.instIsModuleDPRIM2 p = { moduleTypeRep := GaudisCrypt.ECProcViewsTest.FP.DPRIM2.typeRep p, isModule := ⋯ }
Builds a module of type DPRIM2 from the record DPRIM2.Structure of its fields, as a right-nested Module.pair'. @[reducible].
Inverse of DPRIM2.structure (DPRIM2.mk_destruct, DPRIM2.destruct_mk); a single field of a module built this way is read back by the @[simp] lemmas DPRIM2.f.mk_simp.
Equations
- GaudisCrypt.ECProcViewsTest.FP.DPRIM2.mk p theRecord✝ = theRecord✝.f
Instances For
The field f of a module of type DPRIM2: the projection onto component 0 of the right-nested tuple DPRIM2.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].
DPRIM2.f.mk_simp reads this field back off a module built by DPRIM2.mk; DPRIM2.f.utilities has the accessor as a module, and the lemmas about it.
Its parameters are named x, in that order (recorded in @[gaudiProcParamNames], a ProcedureSignature holding only their types).
Equations
- GaudisCrypt.ECProcViewsTest.FP.DPRIM2.f p theModule✝ = theModule✝
Instances For
@[simp]: reading the field f back off a module built from a record — DPRIM2.f (DPRIM2.mk r) = r.f.
It is what carries the right-hand side of an X.apply_simp (which is an DPRIM2.mk) on to the field the caller actually asked for, so that simp chains X.apply_simp into X.f.apply_simp.
What is derivable about the accessor DPRIM2.f, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):
DPRIM2.f.utilities.accessorModule : DPRIM2 →ₘ …— the accessor as a module, a projection being a module morphism;DPRIM2.f.utilities.apply_simp—Module.app DPRIM2.f.utilities.accessorModule m = DPRIM2.f m: applying that module is the accessor;DPRIM2.f.utilities.expression_eq— the same at the level of expressions:(DPRIM2.f m).expression = (DPRIM2.f.utilities.proj m.expression).reduce.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: DPRIM2.structure (DPRIM2.mk r) = r — destructing a module built from a record gives that record back.
The module type declared by moduletype DPRIM2, with fields f: the type Module DPRIM2.typeRep of modules that are a right-nested tuple of the field types.
Build one from a record of its fields with DPRIM2.mk, read a single field off one with the accessors DPRIM2.f, and get the whole record back with DPRIM2.structure.
Equations
Instances For
The theory's type.
Instances
@[simp]: reading the field f back off a module built from a record — DPRIM2.f (DPRIM2.mk r) = r.f.
It is what carries the right-hand side of an X.apply_simp (which is an DPRIM2.mk) on to the field the caller actually asked for, so that simp chains X.apply_simp into X.f.apply_simp.
The record of a module's fields: DPRIM2.structure m is DPRIM2.Structure.mk applied to DPRIM2.f of m.
Inverse of DPRIM2.mk (DPRIM2.mk_destruct, DPRIM2.destruct_mk).
Instances For
The field f of a module of type DPRIM2: the projection onto component 0 of the right-nested tuple DPRIM2.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].
DPRIM2.f.mk_simp reads this field back off a module built by DPRIM2.mk; DPRIM2.f.utilities has the accessor as a module, and the lemmas about it.
Its parameters are named x, in that order (recorded in @[gaudiProcParamNames], a ProcedureSignature holding only their types).
Instances For
Builds a module of type DPRIM2 from the record DPRIM2.Structure of its fields, as a right-nested Module.pair'. @[reducible].
Inverse of DPRIM2.structure (DPRIM2.mk_destruct, DPRIM2.destruct_mk); a single field of a module built this way is read back by the @[simp] lemmas DPRIM2.f.mk_simp.
Equations
- GaudisCrypt.ECProcViewsTest.TH.DPRIM2.mk theRecord✝ = theRecord✝.f
Instances For
What is derivable about the accessor DPRIM2.f, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):
DPRIM2.f.utilities.accessorModule : DPRIM2 →ₘ …— the accessor as a module, a projection being a module morphism;DPRIM2.f.utilities.apply_simp—Module.app DPRIM2.f.utilities.accessorModule m = DPRIM2.f m: applying that module is the accessor;DPRIM2.f.utilities.expression_eq— the same at the level of expressions:(DPRIM2.f m).expression = (DPRIM2.f.utilities.proj m.expression).reduce.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The record of the fields of a module of type DPRIM2: the fields f, one per moduletype field, each of that field's own module type.
DPRIM2.mk turns such a record into a DPRIM2, DPRIM2.structure turns a DPRIM2 back into one.
Instances For
@[simp]: DPRIM2.structure (DPRIM2.mk r) = r — destructing a module built from a record gives that record back.
The IsModule DPRIM2 instance: DPRIM2 is a module type, with representation DPRIM2.typeRep.
It is what lets the name DPRIM2 stand where a module type is expected — in Module.Arr/Module.Prod (→ₘ/×ₘ), say — which the underlying Module DPRIM2.typeRep would do on its own but DPRIM2, a plain (non-reducible) def, would not.
Equations
- GaudisCrypt.ECProcViewsTest.TH.instIsModuleDPRIM2 = { moduleTypeRep := GaudisCrypt.ECProcViewsTest.TH.DPRIM2.typeRep, isModule := ⋯ }
The ModuleTypeRep underlying DPRIM2, the module type declared by moduletype DPRIM2: the right-nested product of its 1 field types, in declaration order.
DPRIM2 is by definition Module DPRIM2.typeRep.
Equations
Instances For
The module type declared by moduletype DPRIM2, with fields f: the type Module DPRIM2.typeRep of modules that are a right-nested tuple of the field types.
Build one from a record of its fields with DPRIM2.mk, read a single field off one with the accessors DPRIM2.f, and get the whole record back with DPRIM2.structure.
Equations
Instances For
The theory's type.
Instances
The body of proc f of module Inc2, 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 Inc2.f.procedure.apply_simp) rather than run. Use Inc2.f for this procedure as a module.
Equations
- GaudisCrypt.ECProcViewsTest.Inc2.f.procedure = proc (x : ℤ) : ℤ { GaudisCrypt.ECProcViewsTest.cnt <- §GaudisCrypt.ECProcViewsTest.cnt + 1; return §x + 1 }
Instances For
Instantiating the holes of Inc2.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 [Inc2.f.procedure.apply_simp]).
The module declared by module Inc2: the record of its procedures Inc2.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 Inc2.apply_simp to apply it with.
Instances For
@[simp]: Inc2.f = Module.proc Inc2.f.procedure — true by definition, proc f using no module parameter and so having no holes to fill.
proc f of module Inc2 as a module: Module.proc Inc2.f.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — Inc2.f.apply_simp says exactly that.
Equations
Instances For
Inc2 handed on at the clone's module type, built with the first port's constructor.