Tests of stmt_swap and stmt_split_pair (Logic/StmtSwap.lean).
A clone's op given as a function (op dout _ <- d, an abbreviation): the sampling
b <$ dout §x does not read x, and moves past x's assignment.
Instances For
Equations
- GaudisCrypt.StmtSwapTest.swapTestCount = GaudisCrypt.varLens (GaudisCrypt.VariableName.mk "GaudisCrypt.StmtSwapTest.swapTestCount" ℕ)
Instances For
@[simp]: reading the field init back off a module built from a record — Init.init (Init.mk r) = r.init.
It is what carries the right-hand side of an X.apply_simp (which is an Init.mk) on to the field the caller actually asked for, so that simp chains X.apply_simp into X.init.apply_simp.
@[simp]: Init.structure (Init.mk r) = r — destructing a module built from a record gives that record back.
Builds a module of type Init from the record Init.Structure of its fields, as a right-nested Module.pair'. @[reducible].
Inverse of Init.structure (Init.mk_destruct, Init.destruct_mk); a single field of a module built this way is read back by the @[simp] lemmas Init.init.mk_simp.
Equations
- GaudisCrypt.StmtSwapTest.Init.mk theRecord✝ = theRecord✝.init
Instances For
What is derivable about the accessor Init.init, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):
Init.init.utilities.accessorModule : Init →ₘ …— the accessor as a module, a projection being a module morphism;Init.init.utilities.apply_simp—Module.app Init.init.utilities.accessorModule m = Init.init m: applying that module is the accessor;Init.init.utilities.expression_eq— the same at the level of expressions:(Init.init m).expression = (Init.init.utilities.proj m.expression).reduce.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The ModuleTypeRep underlying Init, the module type declared by moduletype Init: the right-nested product of its 1 field types, in declaration order.
Init is by definition Module Init.typeRep.
Instances For
The field init of a module of type Init: the projection onto component 0 of the right-nested tuple Init.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].
Init.init.mk_simp reads this field back off a module built by Init.mk; Init.init.utilities has the accessor as a module, and the lemmas about it.
It takes no parameters (recorded in @[gaudiProcParamNames]).
Instances For
The record of a module's fields: Init.structure m is Init.Structure.mk applied to Init.init of m.
Inverse of Init.mk (Init.mk_destruct, Init.destruct_mk).
Instances For
The module type declared by moduletype Init, with fields init: the type Module Init.typeRep of modules that are a right-nested tuple of the field types.
Build one from a record of its fields with Init.mk, read a single field off one with the accessors Init.init, and get the whole record back with Init.structure.
Instances For
The IsModule Init instance: Init is a module type, with representation Init.typeRep.
It is what lets the name Init stand where a module type is expected — in Module.Arr/Module.Prod (→ₘ/×ₘ), say — which the underlying Module Init.typeRep would do on its own but Init, a plain (non-reducible) def, would not.
Equations
- GaudisCrypt.StmtSwapTest.instIsModuleInit = { moduleTypeRep := GaudisCrypt.StmtSwapTest.Init.typeRep, isModule := ⋯ }
Equations
- GaudisCrypt.StmtSwapTest.swapTestFlag = GaudisCrypt.varLens (GaudisCrypt.VariableName.mk "GaudisCrypt.StmtSwapTest.swapTestFlag" Bool)