Helper functions for creating auxiliary names used in (old) compiler passes.
Equations
- Lean.Compiler.mkEagerLambdaLiftingName n idx = n.mkStr ("_elambda_" ++ toString idx)
Instances For
Equations
- Lean.Compiler.isEagerLambdaLiftingName (p.str s) = ("_elambda".isPrefixOf s || Lean.Compiler.isEagerLambdaLiftingName p)
- Lean.Compiler.isEagerLambdaLiftingName (p.num i) = Lean.Compiler.isEagerLambdaLiftingName p
- Lean.Compiler.isEagerLambdaLiftingName x = false
Instances For
Return the name of new definitions in the a given declaration.
Here we consider only declarations we generate code for.
We use this definition to implement add_and_compile.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
We generate auxiliary unsafe definitions for regular recursive definitions. The auxiliary unsafe definition has a clear runtime cost execution model. This function returns the auxiliary unsafe definition name for the given name.
Equations
- Lean.Compiler.mkUnsafeRecName declName = declName.mkStr "_unsafe_rec"
Instances For
Return some _ if the given name was created using mkUnsafeRecName
Equations
- Lean.Compiler.isUnsafeRecName? x = match x with | n.str "_unsafe_rec" => some n | x => none
Instances For
Compile the given block of mutual declarations.
Assumes the declarations have already been added to the environment using addDecl.
Compile the given declaration, it assumes the declaration has already been added to the environment using addDecl.
Equations
- env.compileDecl opt decl = env.compileDecls opt (Lean.Compiler.getDeclNamesForCodeGen decl)