Universe level utilities for the code generator #
Universe level parameter normalizer #
The specializer creates "keys" for a function specialization. The key is an expression containing the function being specialized and the argument values used for the specialization. The key does not contain free variables, and function parameter names are irrelevant due to alpha equivalence. The universe level normalizer ensures the universe parameter names are irrelevant when comparing keys.
Counter for generating new (normalized) universe parameter names.
nextIdx : NatMapping from existing universe parameter names to the new ones.
map : Lean.HashMap Lean.Name Lean.LevelParameters that have been normalized.
State for the universe level normalizer monad.
Instances For
Monad for the universe leve normalizer
Normalize universe level parameter names in the given universe level.
Normalize universe level parameter names in the given expression.
Normalize universe level parameter names in the given expression. The function also returns the list of universe level parameter names that have been normalized.
Equations
- One or more equations did not get rendered due to their size.
Universe level collector #
This module extends support for Code
. See Lean.Util.CollectLevelParams.lean
In the code specializer, we create new auxiliary declarations and the universe level parameter collector is used to setup the new auxiliary declarations.
See Decl.setLevelParams
.
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.Compiler.LCNF.CollectLevelParams.visitArgs args s = Array.foldl (fun s arg => Lean.Compiler.LCNF.CollectLevelParams.visitArg arg s) s args 0 (Array.size args)
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.Compiler.LCNF.CollectLevelParams.visitParams ps s = Array.foldl (fun s p => Lean.Compiler.LCNF.CollectLevelParams.visitParam p s) s ps 0 (Array.size ps)
Collect universe level parameters collecting in the type, parameters, and value, and then
set decl.levelParams
with the resulting value.
Equations
- One or more equations did not get rendered due to their size.