Tests for ModuleApplicationSyntax #
The record of a module's fields: Coin.structure m is Coin.Structure.mk applied to Coin.flip, Coin.neg of m.
Inverse of Coin.mk (Coin.mk_destruct, Coin.destruct_mk).
Instances For
The module type declared by moduletype Coin, with fields flip, neg: the type Module Coin.typeRep of modules that are a right-nested tuple of the field types.
Build one from a record of its fields with Coin.mk, read a single field off one with the accessors Coin.flip, Coin.neg, and get the whole record back with Coin.structure.
Equations
Instances For
The field flip of a module of type Coin: the projection onto component 0 of the right-nested tuple Coin.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].
Coin.flip.mk_simp reads this field back off a module built by Coin.mk; Coin.flip.utilities has the accessor as a module, and the lemmas about it.
It takes no parameters (recorded in @[gaudiProcParamNames]).
Equations
- theModule✝.flip = GaudisCrypt.Module.fst' theModule✝
Instances For
Builds a module of type Coin from the record Coin.Structure of its fields, as a right-nested Module.pair'. @[reducible].
Inverse of Coin.structure (Coin.mk_destruct, Coin.destruct_mk); a single field of a module built this way is read back by the @[simp] lemmas Coin.flip.mk_simp, Coin.neg.mk_simp.
Equations
- GaudisCrypt.ModuleApplicationSyntaxTest.Coin.mk theRecord✝ = GaudisCrypt.Module.pair' theRecord✝.flip theRecord✝.neg
Instances For
What is derivable about the accessor Coin.flip, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):
Coin.flip.utilities.accessorModule : Coin →ₘ …— the accessor as a module, a projection being a module morphism;Coin.flip.utilities.apply_simp—Module.app Coin.flip.utilities.accessorModule m = Coin.flip m: applying that module is the accessor;Coin.flip.utilities.expression_eq— the same at the level of expressions:(Coin.flip m).expression = (Coin.flip.utilities.proj m.expression).reduce.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The field neg of a module of type Coin: the projection onto component 1 of the right-nested tuple Coin.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].
Coin.neg.mk_simp reads this field back off a module built by Coin.mk; Coin.neg.utilities has the accessor as a module, and the lemmas about it.
Its parameters are named n, in that order (recorded in @[gaudiProcParamNames], a ProcedureSignature holding only their types).
Equations
- theModule✝.neg = GaudisCrypt.Module.snd' theModule✝
Instances For
@[simp]: reading the field flip back off a module built from a record — Coin.flip (Coin.mk r) = r.flip.
It is what carries the right-hand side of an X.apply_simp (which is an Coin.mk) on to the field the caller actually asked for, so that simp chains X.apply_simp into X.flip.apply_simp.
@[simp]: reading the field neg back off a module built from a record — Coin.neg (Coin.mk r) = r.neg.
It is what carries the right-hand side of an X.apply_simp (which is an Coin.mk) on to the field the caller actually asked for, so that simp chains X.apply_simp into X.neg.apply_simp.
The ModuleTypeRep underlying Coin, the module type declared by moduletype Coin: the right-nested product of its 2 field types, in declaration order.
Coin is by definition Module Coin.typeRep.
Equations
Instances For
@[simp]: Coin.structure (Coin.mk r) = r — destructing a module built from a record gives that record back.
The IsModule Coin instance: Coin is a module type, with representation Coin.typeRep.
It is what lets the name Coin stand where a module type is expected — in Module.Arr/Module.Prod (→ₘ/×ₘ), say — which the underlying Module Coin.typeRep would do on its own but Coin, a plain (non-reducible) def, would not.
Equations
- GaudisCrypt.ModuleApplicationSyntaxTest.instIsModuleCoin = { moduleTypeRep := GaudisCrypt.ModuleApplicationSyntaxTest.Coin.typeRep, isModule := ⋯ }
What is derivable about the accessor Coin.neg, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):
Coin.neg.utilities.accessorModule : Coin →ₘ …— the accessor as a module, a projection being a module morphism;Coin.neg.utilities.apply_simp—Module.app Coin.neg.utilities.accessorModule m = Coin.neg m: applying that module is the accessor;Coin.neg.utilities.expression_eq— the same at the level of expressions:(Coin.neg m).expression = (Coin.neg.utilities.proj m.expression).reduce.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: FairCoin.flip = Module.proc FairCoin.flip.procedure — true by definition, proc flip using no module parameter and so having no holes to fill.
The module declared by module FairCoin: the record of its procedures FairCoin.flip, FairCoin.neg.
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 FairCoin.apply_simp to apply it with.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: FairCoin.neg = Module.proc FairCoin.neg.procedure — true by definition, proc neg using no module parameter and so having no holes to fill.
Instantiating the holes of FairCoin.flip.procedure with a tuple holeArgs of procedures: the body of proc flip 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 [FairCoin.flip.procedure.apply_simp]).
proc neg of module FairCoin as a module: Module.proc FairCoin.neg.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — FairCoin.neg.apply_simp says exactly that.
Equations
Instances For
proc flip of module FairCoin as a module: Module.proc FairCoin.flip.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — FairCoin.flip.apply_simp says exactly that.
Equations
Instances For
Instantiating the holes of FairCoin.neg.procedure with a tuple holeArgs of procedures: the body of proc neg 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 [FairCoin.neg.procedure.apply_simp]).
The body of proc flip of module FairCoin, 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 FairCoin.flip.procedure.apply_simp) rather than run. Use FairCoin.flip for this procedure as a module.
Equations
- GaudisCrypt.ModuleApplicationSyntaxTest.FairCoin.flip.procedure = proc () : Bool { var b : Bool; b <$ GaudisCrypt.SubProbability.uniform; return §b }
Instances For
The body of proc neg of module FairCoin, 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 FairCoin.neg.procedure.apply_simp) rather than run. Use FairCoin.neg for this procedure as a module.
Equations
Instances For
The body of proc flip of module Swap, as a procedure of its own: the one call it makes to a module parameter (C) is its single hole.
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 Swap.flip.procedure.apply_simp) rather than run. Use Swap.flip for this procedure as a module.
Equations
Instances For
@[simp]: applying Swap to a tuple of its single parameter C — the record of its procedures Swap.flip, Swap.neg, each applied to the parameters it uses.
This is the lemma that unfolds a module use: simp rewrites with it, then with the field lemmas of the module type (N.f.mk_simp) to get at the one procedure the goal is about, and then with Swap.flip.apply_simp, Swap.neg.apply_simp to fill that procedure's holes.
Instantiating the holes of Swap.flip.procedure with a tuple holeArgs of procedures: the body of proc flip 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 [Swap.flip.procedure.apply_simp]).
proc neg of module Swap as a module, abstracted over the module parameters it uses (C, in declaration order): Module.Arr … (Module.Proc (procsig …)).
Apply it with the @[simp] lemma Swap.neg.apply_simp, which fills the holes of Swap.neg.procedure with the callees the body called.
Equations
- One or more equations did not get rendered due to their size.
Instances For
proc flip of module Swap as a module, abstracted over the module parameters it uses (C, in declaration order): Module.Arr … (Module.Proc (procsig …)).
Apply it with the @[simp] lemma Swap.flip.apply_simp, which fills the holes of Swap.flip.procedure with the callees the body called.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: applying Swap.flip to the parameters proc flip uses (C) is Module.proc (Swap.flip.procedure.instantiate …) — the procedure with its holes filled by the callees they were made from, each written as it was in the body (with the arguments in place of the module parameters) and turned into a Procedure by Module.Proc.procedure.
@[simp]: applying Swap.neg to the parameters proc neg uses (C) is Module.proc (Swap.neg.procedure.instantiate …) — the procedure with its holes filled by the callees they were made from, each written as it was in the body (with the arguments in place of the module parameters) and turned into a Procedure by Module.Proc.procedure.
The body of proc neg of module Swap, as a procedure of its own: the one call it makes to a module parameter (C) is its single hole.
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 Swap.neg.procedure.apply_simp) rather than run. Use Swap.neg for this procedure as a module.
Equations
Instances For
The module declared by module Swap, abstracted over its single parameter C, which it takes as one right-nested tuple: Module.Arr (T₁ ×ₘ (… ×ₘ Tₙ)) M, with M the module type it was declared with.
Applied to such a tuple it is the record of its procedures Swap.flip, Swap.neg, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma Swap.apply_simp says.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instantiating the holes of Swap.neg.procedure with a tuple holeArgs of procedures: the body of proc neg 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 [Swap.neg.procedure.apply_simp]).
proc main of module Both as a module, abstracted over the module parameters it uses (C, D, in declaration order): Module.Arr … (Module.Proc (procsig …)).
Apply it with the @[simp] lemma Both.main.apply_simp, which fills the holes of Both.main.procedure with the callees the body called.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instantiating the holes of Both.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 [Both.main.procedure.apply_simp]).
The module declared by module Both, abstracted over its 2 parameters C, D, which it takes as one right-nested tuple: Module.Arr (T₁ ×ₘ (… ×ₘ Tₙ)) M, with M the anonymous product of the procedures' own types, the declaration naming no module type.
Applied to such a tuple it is the record of its procedures Both.main, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma Both.apply_simp says.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: applying Both to a tuple of its 2 parameters C, D — the record of its procedures Both.main, each applied to the parameters it uses.
This is the lemma that unfolds a module use: simp rewrites with it, then with the field lemmas of the module type (N.f.mk_simp) to get at the one procedure the goal is about, and then with Both.main.apply_simp to fill that procedure's holes.
The body of proc main of module Both, as a procedure of its own: the 2 calls it makes to module parameters (C, D) are its holes, in the order the body makes them.
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 Both.main.procedure.apply_simp) rather than run. Use Both.main for this procedure as a module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: applying Both.main to the parameters proc main uses (C, D) is Module.proc (Both.main.procedure.instantiate …) — the procedure with its holes filled by the callees they were made from, each written as it was in the body (with the arguments in place of the module parameters) and turned into a Procedure by Module.Proc.procedure.
The module declared by module One, abstracted over its single parameter C, which it takes as one right-nested tuple: Module.Arr (T₁ ×ₘ (… ×ₘ Tₙ)) M, with M the anonymous product of the procedures' own types, the declaration naming no module type.
Applied to such a tuple it is the record of its procedures One.main, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma One.apply_simp says.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The body of proc main of module One, as a procedure of its own: the one call it makes to a module parameter (C) is its single hole.
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 One.main.procedure.apply_simp) rather than run. Use One.main for this procedure as a module.
Equations
Instances For
Instantiating the holes of One.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 [One.main.procedure.apply_simp]).
@[simp]: applying One to a tuple of its single parameter C — the record of its procedures One.main, each applied to the parameters it uses.
This is the lemma that unfolds a module use: simp rewrites with it, then with the field lemmas of the module type (N.f.mk_simp) to get at the one procedure the goal is about, and then with One.main.apply_simp to fill that procedure's holes.
proc main of module One as a module, abstracted over the module parameters it uses (C, in declaration order): Module.Arr … (Module.Proc (procsig …)).
Apply it with the @[simp] lemma One.main.apply_simp, which fills the holes of One.main.procedure with the callees the body called.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: applying One.main to the parameters proc main uses (C) is Module.proc (One.main.procedure.instantiate …) — the procedure with its holes filled by the callees they were made from, each written as it was in the body (with the arguments in place of the module parameters) and turned into a Procedure by Module.Proc.procedure.
The ModuleTypeRep underlying Flip, the module type declared by moduletype Flip: the right-nested product of its 1 field types, in declaration order.
Flip is by definition Module Flip.typeRep.
Equations
Instances For
The IsModule Flip instance: Flip is a module type, with representation Flip.typeRep.
It is what lets the name Flip stand where a module type is expected — in Module.Arr/Module.Prod (→ₘ/×ₘ), say — which the underlying Module Flip.typeRep would do on its own but Flip, a plain (non-reducible) def, would not.
Equations
- GaudisCrypt.ModuleApplicationSyntaxTest.instIsModuleFlip = { moduleTypeRep := GaudisCrypt.ModuleApplicationSyntaxTest.Flip.typeRep, isModule := ⋯ }
The module type declared by moduletype Flip, with fields flip: the type Module Flip.typeRep of modules that are a right-nested tuple of the field types.
Build one from a record of its fields with Flip.mk, read a single field off one with the accessors Flip.flip, and get the whole record back with Flip.structure.
Equations
Instances For
The field flip of a module of type Flip: the projection onto component 0 of the right-nested tuple Flip.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].
Flip.flip.mk_simp reads this field back off a module built by Flip.mk; Flip.flip.utilities has the accessor as a module, and the lemmas about it.
It takes no parameters (recorded in @[gaudiProcParamNames]).
Instances For
Builds a module of type Flip from the record Flip.Structure of its fields, as a right-nested Module.pair'. @[reducible].
Inverse of Flip.structure (Flip.mk_destruct, Flip.destruct_mk); a single field of a module built this way is read back by the @[simp] lemmas Flip.flip.mk_simp.
Equations
- GaudisCrypt.ModuleApplicationSyntaxTest.Flip.mk theRecord✝ = theRecord✝.flip
Instances For
@[simp]: Flip.structure (Flip.mk r) = r — destructing a module built from a record gives that record back.
The record of a module's fields: Flip.structure m is Flip.Structure.mk applied to Flip.flip of m.
Inverse of Flip.mk (Flip.mk_destruct, Flip.destruct_mk).
Instances For
What is derivable about the accessor Flip.flip, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):
Flip.flip.utilities.accessorModule : Flip →ₘ …— the accessor as a module, a projection being a module morphism;Flip.flip.utilities.apply_simp—Module.app Flip.flip.utilities.accessorModule m = Flip.flip m: applying that module is the accessor;Flip.flip.utilities.expression_eq— the same at the level of expressions:(Flip.flip m).expression = (Flip.flip.utilities.proj m.expression).reduce.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: reading the field flip back off a module built from a record — Flip.flip (Flip.mk r) = r.flip.
It is what carries the right-hand side of an X.apply_simp (which is an Flip.mk) on to the field the caller actually asked for, so that simp chains X.apply_simp into X.flip.apply_simp.
Equations
- One or more equations did not get rendered due to their size.
The body of proc main of module UseFlip, as a procedure of its own: the one call it makes to a module parameter (F) is its single hole.
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 UseFlip.main.procedure.apply_simp) rather than run. Use UseFlip.main for this procedure as a module.
Equations
- GaudisCrypt.ModuleApplicationSyntaxTest.UseFlip.main.procedure = proc () uses (F_flip : () → Bool) : Bool { var b : Bool; b <- call F_flip (); return §b }
Instances For
@[simp]: applying UseFlip.main to the parameters proc main uses (F) is Module.proc (UseFlip.main.procedure.instantiate …) — the procedure with its holes filled by the callees they were made from, each written as it was in the body (with the arguments in place of the module parameters) and turned into a Procedure by Module.Proc.procedure.
@[simp]: applying UseFlip to a tuple of its single parameter F — the record of its procedures UseFlip.main, each applied to the parameters it uses.
This is the lemma that unfolds a module use: simp rewrites with it, then with the field lemmas of the module type (N.f.mk_simp) to get at the one procedure the goal is about, and then with UseFlip.main.apply_simp to fill that procedure's holes.
proc main of module UseFlip as a module, abstracted over the module parameters it uses (F, in declaration order): Module.Arr … (Module.Proc (procsig …)).
Apply it with the @[simp] lemma UseFlip.main.apply_simp, which fills the holes of UseFlip.main.procedure with the callees the body called.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The module declared by module UseFlip, abstracted over its single parameter F, which it takes as one right-nested tuple: Module.Arr (T₁ ×ₘ (… ×ₘ Tₙ)) M, with M the anonymous product of the procedures' own types, the declaration naming no module type.
Applied to such a tuple it is the record of its procedures UseFlip.main, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma UseFlip.apply_simp says.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instantiating the holes of UseFlip.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 [UseFlip.main.procedure.apply_simp]).
@[simp]: Loaded.extra = Module.proc Loaded.extra.procedure — true by definition, proc extra using no module parameter and so having no holes to fill.
Instantiating the holes of Loaded.flip.procedure with a tuple holeArgs of procedures: the body of proc flip 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 [Loaded.flip.procedure.apply_simp]).
@[simp]: Loaded.flip = Module.proc Loaded.flip.procedure — true by definition, proc flip using no module parameter and so having no holes to fill.
The body of proc flip of module Loaded, 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 Loaded.flip.procedure.apply_simp) rather than run. Use Loaded.flip for this procedure as a module.
Equations
- GaudisCrypt.ModuleApplicationSyntaxTest.Loaded.flip.procedure = proc () : Bool { skip; return true }
Instances For
proc flip of module Loaded as a module: Module.proc Loaded.flip.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — Loaded.flip.apply_simp says exactly that.
Equations
Instances For
Instantiating the holes of Loaded.neg.procedure with a tuple holeArgs of procedures: the body of proc neg 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 [Loaded.neg.procedure.apply_simp]).
The body of proc extra of module Loaded, 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 Loaded.extra.procedure.apply_simp) rather than run. Use Loaded.extra for this procedure as a module.
Equations
Instances For
The body of proc neg of module Loaded, 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 Loaded.neg.procedure.apply_simp) rather than run. Use Loaded.neg for this procedure as a module.
Equations
Instances For
Instantiating the holes of Loaded.extra.procedure with a tuple holeArgs of procedures: the body of proc extra 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 [Loaded.extra.procedure.apply_simp]).
proc extra of module Loaded as a module: Module.proc Loaded.extra.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — Loaded.extra.apply_simp says exactly that.
Equations
Instances For
proc neg of module Loaded as a module: Module.proc Loaded.neg.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — Loaded.neg.apply_simp says exactly that.
Equations
Instances For
@[simp]: Loaded.neg = Module.proc Loaded.neg.procedure — true by definition, proc neg using no module parameter and so having no holes to fill.
The module declared by module Loaded: the record of its procedures Loaded.flip, Loaded.neg.
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 Loaded.apply_simp to apply it with.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The body of proc both of module Two, as a procedure of its own: the 2 calls it makes to module parameters (C, F) are its holes, in the order the body makes them.
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 Two.both.procedure.apply_simp) rather than run. Use Two.both for this procedure as a module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The body of proc first of module Two, as a procedure of its own: the one call it makes to a module parameter (F) is its single hole.
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 Two.first.procedure.apply_simp) rather than run. Use Two.first for this procedure as a module.
Equations
- GaudisCrypt.ModuleApplicationSyntaxTest.Two.first.procedure = proc () uses (F_flip : () → Bool) : Bool { var b : Bool; b <- call F_flip (); return §b }
Instances For
Instantiating the holes of Two.second.procedure with a tuple holeArgs of procedures: the body of proc second 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 [Two.second.procedure.apply_simp]).
The module declared by module Two, abstracted over its 2 parameters C, F, which it takes as one right-nested tuple: Module.Arr (T₁ ×ₘ (… ×ₘ Tₙ)) M, with M the anonymous product of the procedures' own types, the declaration naming no module type.
Applied to such a tuple it is the record of its procedures Two.first, Two.second, Two.both, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma Two.apply_simp says.
Equations
- One or more equations did not get rendered due to their size.
Instances For
proc both of module Two as a module, abstracted over the module parameters it uses (C, F, in declaration order): Module.Arr … (Module.Proc (procsig …)).
Apply it with the @[simp] lemma Two.both.apply_simp, which fills the holes of Two.both.procedure with the callees the body called.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instantiating the holes of Two.both.procedure with a tuple holeArgs of procedures: the body of proc both 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 [Two.both.procedure.apply_simp]).
@[simp]: applying Two.first to the parameters proc first uses (F) is Module.proc (Two.first.procedure.instantiate …) — the procedure with its holes filled by the callees they were made from, each written as it was in the body (with the arguments in place of the module parameters) and turned into a Procedure by Module.Proc.procedure.
@[simp]: applying Two to a tuple of its 2 parameters C, F — the record of its procedures Two.first, Two.second, Two.both, each applied to the parameters it uses.
This is the lemma that unfolds a module use: simp rewrites with it, then with the field lemmas of the module type (N.f.mk_simp) to get at the one procedure the goal is about, and then with Two.first.apply_simp, Two.second.apply_simp, Two.both.apply_simp to fill that procedure's holes.
The body of proc second of module Two, as a procedure of its own: the one call it makes to a module parameter (C) is its single hole.
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 Two.second.procedure.apply_simp) rather than run. Use Two.second for this procedure as a module.
Equations
Instances For
Instantiating the holes of Two.first.procedure with a tuple holeArgs of procedures: the body of proc first 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 [Two.first.procedure.apply_simp]).
@[simp]: applying Two.both to the parameters proc both uses (C, F) is Module.proc (Two.both.procedure.instantiate …) — the procedure with its holes filled by the callees they were made from, each written as it was in the body (with the arguments in place of the module parameters) and turned into a Procedure by Module.Proc.procedure.
proc first of module Two as a module, abstracted over the module parameters it uses (F, in declaration order): Module.Arr … (Module.Proc (procsig …)).
Apply it with the @[simp] lemma Two.first.apply_simp, which fills the holes of Two.first.procedure with the callees the body called.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: applying Two.second to the parameters proc second uses (C) is Module.proc (Two.second.procedure.instantiate …) — the procedure with its holes filled by the callees they were made from, each written as it was in the body (with the arguments in place of the module parameters) and turned into a Procedure by Module.Proc.procedure.
proc second of module Two as a module, abstracted over the module parameters it uses (C, in declaration order): Module.Arr … (Module.Proc (procsig …)).
Apply it with the @[simp] lemma Two.second.apply_simp, which fills the holes of Two.second.procedure with the callees the body called.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: the alias Pick.other, applied to the parameters its callee uses (F), is its callee, as written in the declaration.
The body of proc call_ of module Pick, as a procedure of its own: the one call it makes to a module parameter (C, F) is its single hole.
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 Pick.call_.procedure.apply_simp) rather than run. Use Pick.call_ for this procedure as a module.
Equations
- GaudisCrypt.ModuleApplicationSyntaxTest.Pick.call_.procedure = proc () uses (_hole0 : () → Bool) : Bool { var b : Bool; b <- call _hole0 (); return §b }
Instances For
proc other = …; of module Pick: an alias, EasyCrypt's proc other = M.g — the callee itself, as a module abstracted over the module parameters it uses (F, in declaration order). It has no Pick.other.procedure: applied with the @[simp] lemma Pick.other.apply_simp, it is the callee.
Equations
Instances For
@[simp]: the alias Pick.coin, applied to the parameters its callee uses (C), is its callee, as written in the declaration.
proc coin = …; of module Pick: an alias, EasyCrypt's proc coin = M.g — the callee itself, as a module abstracted over the module parameters it uses (C, in declaration order). It has no Pick.coin.procedure: applied with the @[simp] lemma Pick.coin.apply_simp, it is the callee.
Equations
Instances For
proc call_ of module Pick as a module, abstracted over the module parameters it uses (C, F, in declaration order): Module.Arr … (Module.Proc (procsig …)).
Apply it with the @[simp] lemma Pick.call_.apply_simp, which fills the holes of Pick.call_.procedure with the callees the body called.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instantiating the holes of Pick.call_.procedure with a tuple holeArgs of procedures: the body of proc call_ 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 [Pick.call_.procedure.apply_simp]).
@[simp]: applying Pick.call_ to the parameters proc call_ uses (C, F) is Module.proc (Pick.call_.procedure.instantiate …) — the procedure with its holes filled by the callees they were made from, each written as it was in the body (with the arguments in place of the module parameters) and turned into a Procedure by Module.Proc.procedure.
The module declared by module Pick, abstracted over its 2 parameters C, F, which it takes as one right-nested tuple: Module.Arr (T₁ ×ₘ (… ×ₘ Tₙ)) M, with M the anonymous product of the procedures' own types, the declaration naming no module type.
Applied to such a tuple it is the record of its procedures Pick.coin, Pick.other, Pick.call_, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma Pick.apply_simp says.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: applying Pick to a tuple of its 2 parameters C, F — the record of its procedures Pick.coin, Pick.other, Pick.call_, each applied to the parameters it uses.
This is the lemma that unfolds a module use: simp rewrites with it, then with the field lemmas of the module type (N.f.mk_simp) to get at the one procedure the goal is about, and then with Pick.coin.apply_simp, Pick.other.apply_simp, Pick.call_.apply_simp to fill that procedure's holes.