File: .lake/packages/lean4/src/lean/Lean/Compiler/LCNF/CompilerM.lean

full_name: Lean.Compiler.LCNF.instInhabitedPhase
code: /--
The pipeline phase a certain `Pass` is supposed to happen in.
-/
inductive Phase where
  /-- Here we still carry most of the original type information, most
  of the dependent portion is already (partially) erased though. -/
  | base
  /-- In this phase polymorphism has been eliminated. -/
  | mono
  /-- In this phase impure stuff such as RC or efficient BaseIO transformations happen. -/
  | impure
  deriving Inhabited
goal: Inhabited Lean.Compiler.LCNF.Phase

full_name: Lean.Compiler.LCNF.Phase.impure
code: /--
The pipeline phase a certain `Pass` is supposed to happen in.
-/
inductive Phase where
  /-- Here we still carry most of the original type information, most
  of the dependent portion is already (partially) erased though. -/
  | base
  /-- In this phase polymorphism has been eliminated. -/
  | mono
  /-- In this phase impure stuff such as RC or efficient BaseIO transformations happen. -/
  | impure
  deriving Inhabited
goal: Lean.Compiler.LCNF.Phase

full_name: Lean.Compiler.LCNF.Phase.base
code: /--
The pipeline phase a certain `Pass` is supposed to happen in.
-/
inductive Phase where
  /-- Here we still carry most of the original type information, most
  of the dependent portion is already (partially) erased though. -/
  | base
  /-- In this phase polymorphism has been eliminated. -/
  | mono
  /-- In this phase impure stuff such as RC or efficient BaseIO transformations happen. -/
  | impure
  deriving Inhabited
goal: Lean.Compiler.LCNF.Phase

full_name: Lean.Compiler.LCNF.Phase.mono
code: /--
The pipeline phase a certain `Pass` is supposed to happen in.
-/
inductive Phase where
  /-- Here we still carry most of the original type information, most
  of the dependent portion is already (partially) erased though. -/
  | base
  /-- In this phase polymorphism has been eliminated. -/
  | mono
  /-- In this phase impure stuff such as RC or efficient BaseIO transformations happen. -/
  | impure
  deriving Inhabited
goal: Lean.Compiler.LCNF.Phase

full_name: Lean.Compiler.LCNF.Phase
code: /--
The pipeline phase a certain `Pass` is supposed to happen in.
-/
inductive Phase where
  /-- Here we still carry most of the original type information, most
  of the dependent portion is already (partially) erased though. -/
  | base
  /-- In this phase polymorphism has been eliminated. -/
  | mono
  /-- In this phase impure stuff such as RC or efficient BaseIO transformations happen. -/
  | impure
  deriving Inhabited
goal: Type

full_name: Lean.Compiler.LCNF.CompilerM.State
code: /--
The state managed by the `CompilerM` `Monad`.
-/
structure CompilerM.State where
  /--
  A `LocalContext` to store local declarations from let binders
  and other constructs in as we move through `Expr`s.
  -/
  lctx     : LCtx := {}
  /-- Next auxiliary variable suffix -/
  nextIdx : Nat := 1
  deriving Inhabited
goal: Type

full_name: Lean.Compiler.LCNF.CompilerM.instInhabitedState
code: /--
The state managed by the `CompilerM` `Monad`.
-/
structure CompilerM.State where
  /--
  A `LocalContext` to store local declarations from let binders
  and other constructs in as we move through `Expr`s.
  -/
  lctx     : LCtx := {}
  /-- Next auxiliary variable suffix -/
  nextIdx : Nat := 1
  deriving Inhabited
goal: Inhabited Lean.Compiler.LCNF.CompilerM.State

full_name: Lean.Compiler.LCNF.CompilerM.State.nextIdx
code: /--
The state managed by the `CompilerM` `Monad`.
-/
structure CompilerM.State where
  /--
  A `LocalContext` to store local declarations from let binders
  and other constructs in as we move through `Expr`s.
  -/
  lctx     : LCtx := {}
  /-- Next auxiliary variable suffix -/
  nextIdx : Nat := 1
  deriving Inhabited
goal: Nat

full_name: Lean.Compiler.LCNF.CompilerM.State.lctx
code: /--
The state managed by the `CompilerM` `Monad`.
-/
structure CompilerM.State where
  /--
  A `LocalContext` to store local declarations from let binders
  and other constructs in as we move through `Expr`s.
  -/
  lctx     : LCtx := {}
  /-- Next auxiliary variable suffix -/
  nextIdx : Nat := 1
  deriving Inhabited
goal: Lean.Compiler.LCNF.LCtx

full_name: Lean.Compiler.LCNF.CompilerM.instInhabitedContext
code: structure CompilerM.Context where
  phase : Phase
  config : ConfigOptions
  deriving Inhabited
goal: Inhabited Lean.Compiler.LCNF.CompilerM.Context

full_name: Lean.Compiler.LCNF.CompilerM.Context.config
code: structure CompilerM.Context where
  phase : Phase
  config : ConfigOptions
  deriving Inhabited
goal: Lean.Compiler.LCNF.ConfigOptions

full_name: Lean.Compiler.LCNF.CompilerM.Context
code: structure CompilerM.Context where
  phase : Phase
  config : ConfigOptions
  deriving Inhabited
goal: Type

full_name: Lean.Compiler.LCNF.CompilerM.Context.phase
code: structure CompilerM.Context where
  phase : Phase
  config : ConfigOptions
  deriving Inhabited
goal: Lean.Compiler.LCNF.Phase

full_name: Lean.Compiler.LCNF.CompilerM
code: abbrev CompilerM 
goal: Type

full_name: Lean.Compiler.LCNF.instMonadCompilerM
code: @[always_inline]
instance : Monad CompilerM 
goal: Monad Lean.Compiler.LCNF.CompilerM

full_name: Lean.Compiler.LCNF.withPhase
code: @[inline] def withPhase (phase : Phase) (x : CompilerM α) : CompilerM α 
goal: Lean.Compiler.LCNF.CompilerM α

full_name: Lean.Compiler.LCNF.getPhase
code: def getPhase : CompilerM Phase 
goal: Lean.Compiler.LCNF.CompilerM Lean.Compiler.LCNF.Phase

full_name: Lean.Compiler.LCNF.inBasePhase
code: def inBasePhase : CompilerM Bool 
goal: Lean.Compiler.LCNF.CompilerM Bool

full_name: Lean.Compiler.LCNF.instAddMessageContextCompilerM
code: instance : AddMessageContext CompilerM 
goal: Lean.AddMessageContext Lean.Compiler.LCNF.CompilerM

full_name: Lean.Compiler.LCNF.getType
code: def getType (fvarId : FVarId) : CompilerM Expr 
goal: Lean.Compiler.LCNF.CompilerM Lean.Expr

full_name: Lean.Compiler.LCNF.getBinderName
code: def getBinderName (fvarId : FVarId) : CompilerM Name 
goal: Lean.Compiler.LCNF.CompilerM Lean.Name

full_name: Lean.Compiler.LCNF.findParam?
code: def findParam? (fvarId : FVarId) : CompilerM (Option Param) 
goal: Lean.Compiler.LCNF.CompilerM (Option Lean.Compiler.LCNF.Param)

full_name: Lean.Compiler.LCNF.findLetDecl?
code: def findLetDecl? (fvarId : FVarId) : CompilerM (Option LetDecl) 
goal: Lean.Compiler.LCNF.CompilerM (Option Lean.Compiler.LCNF.LetDecl)

full_name: Lean.Compiler.LCNF.findFunDecl?
code: def findFunDecl? (fvarId : FVarId) : CompilerM (Option FunDecl) 
goal: Lean.Compiler.LCNF.CompilerM (Option Lean.Compiler.LCNF.FunDecl)

full_name: Lean.Compiler.LCNF.findLetValue?
code: def findLetValue? (fvarId : FVarId) : CompilerM (Option LetValue) 
goal: Lean.Compiler.LCNF.CompilerM (Option Lean.Compiler.LCNF.LetValue)

full_name: Lean.Compiler.LCNF.isConstructorApp
code: def isConstructorApp (fvarId : FVarId) : CompilerM Bool 
goal: Lean.Compiler.LCNF.CompilerM Bool

full_name: Lean.Compiler.LCNF.Arg.isConstructorApp
code: def Arg.isConstructorApp (arg : Arg) : CompilerM Bool 
goal: Lean.Compiler.LCNF.CompilerM Bool

full_name: Lean.Compiler.LCNF.getParam
code: def getParam (fvarId : FVarId) : CompilerM Param 
goal: Lean.Compiler.LCNF.CompilerM Lean.Compiler.LCNF.Param

full_name: Lean.Compiler.LCNF.getLetDecl
code: def getLetDecl (fvarId : FVarId) : CompilerM LetDecl 
goal: Lean.Compiler.LCNF.CompilerM Lean.Compiler.LCNF.LetDecl

full_name: Lean.Compiler.LCNF.getFunDecl
code: def getFunDecl (fvarId : FVarId) : CompilerM FunDecl 
goal: Lean.Compiler.LCNF.CompilerM Lean.Compiler.LCNF.FunDecl

full_name: Lean.Compiler.LCNF.modifyLCtx
code: @[inline] def modifyLCtx (f : LCtx → LCtx) : CompilerM Unit 
goal: Lean.Compiler.LCNF.CompilerM Unit

full_name: Lean.Compiler.LCNF.eraseLetDecl
code: def eraseLetDecl (decl : LetDecl) : CompilerM Unit 
goal: Lean.Compiler.LCNF.CompilerM Unit

full_name: Lean.Compiler.LCNF.eraseFunDecl
code: def eraseFunDecl (decl : FunDecl) (recursive := true) : CompilerM Unit 
goal: Lean.Compiler.LCNF.CompilerM Unit

full_name: Lean.Compiler.LCNF.eraseCode
code: def eraseCode (code : Code) : CompilerM Unit 
goal: Lean.Compiler.LCNF.CompilerM Unit

full_name: Lean.Compiler.LCNF.eraseParam
code: def eraseParam (param : Param) : CompilerM Unit 
goal: Lean.Compiler.LCNF.CompilerM Unit

full_name: Lean.Compiler.LCNF.eraseParams
code: def eraseParams (params : Array Param) : CompilerM Unit 
goal: Lean.Compiler.LCNF.CompilerM Unit

full_name: Lean.Compiler.LCNF.eraseCodeDecl
code: def eraseCodeDecl (decl : CodeDecl) : CompilerM Unit 
goal: Lean.Compiler.LCNF.CompilerM Unit

full_name: Lean.Compiler.LCNF.eraseCodeDecls
code: /--
Erase all free variables occurring in `decls` from the local context.
-/
def eraseCodeDecls (decls : Array CodeDecl) : CompilerM Unit 
goal: Lean.Compiler.LCNF.CompilerM Unit

full_name: Lean.Compiler.LCNF.eraseDecl
code: def eraseDecl (decl : Decl) : CompilerM Unit 
goal: Lean.Compiler.LCNF.CompilerM Unit

full_name: Lean.Compiler.LCNF.Decl.erase
code: abbrev Decl.erase (decl : Decl) : CompilerM Unit 
goal: Lean.Compiler.LCNF.CompilerM Unit

full_name: Lean.Compiler.LCNF.FVarSubst
code: /--
A free variable substitution.
We use these substitutions when inlining definitions and "internalizing" LCNF code into `CompilerM`.
During the internalization process, we ensure all free variables in the LCNF code do not collide with existing ones
at the `CompilerM` local context.
Remark: in LCNF, (computationally relevant) data is in A-normal form, but this is not the case for types and type formers.
So, when inlining we often want to replace a free variable with a type or type former.

The substitution contains entries `fvarId ↦ e` s.t., `e` is a valid LCNF argument. That is,
it is a free variable, a type (or type former), or `lcErased`.

`Check.lean` contains a substitution validator.
-/
abbrev FVarSubst 
goal: Type

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Compiler.LCNF.CompilerM.0.Lean.Compiler.LCNF.normExprImp.goApp
code: /--
Replace the free variables in `e` using the given substitution.

If `translator = true`, then we assume the free variables occurring in the range of the substitution are in another
local context. For example, `translator = true` during internalization where we are making sure all free variables
in a given expression are replaced with new ones that do not collide with the ones in the current local context.

If `translator = false`, we assume the substitution contains free variable replacements in the same local context,
and given entries such as `x₁ ↦ x₂`, `x₂ ↦ x₃`, ..., `xₙ₋₁ ↦ xₙ`, and the expression `f x₁ x₂`, we want the resulting
expression to be `f xₙ xₙ`. We use this setting, for example, in the simplifier.
-/
private partial def normExprImp (s : FVarSubst) (e : Expr) (translator : Bool) : Expr 
goal: Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Compiler.LCNF.CompilerM.0.Lean.Compiler.LCNF.normExprImp
code: /--
Replace the free variables in `e` using the given substitution.

If `translator = true`, then we assume the free variables occurring in the range of the substitution are in another
local context. For example, `translator = true` during internalization where we are making sure all free variables
in a given expression are replaced with new ones that do not collide with the ones in the current local context.

If `translator = false`, we assume the substitution contains free variable replacements in the same local context,
and given entries such as `x₁ ↦ x₂`, `x₂ ↦ x₃`, ..., `xₙ₋₁ ↦ xₙ`, and the expression `f x₁ x₂`, we want the resulting
expression to be `f xₙ xₙ`. We use this setting, for example, in the simplifier.
-/
private partial def normExprImp (s : FVarSubst) (e : Expr) (translator : Bool) : Expr 
goal: Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Compiler.LCNF.CompilerM.0.Lean.Compiler.LCNF.normExprImp.go
code: /--
Replace the free variables in `e` using the given substitution.

If `translator = true`, then we assume the free variables occurring in the range of the substitution are in another
local context. For example, `translator = true` during internalization where we are making sure all free variables
in a given expression are replaced with new ones that do not collide with the ones in the current local context.

If `translator = false`, we assume the substitution contains free variable replacements in the same local context,
and given entries such as `x₁ ↦ x₂`, `x₂ ↦ x₃`, ..., `xₙ₋₁ ↦ xₙ`, and the expression `f x₁ x₂`, we want the resulting
expression to be `f xₙ xₙ`. We use this setting, for example, in the simplifier.
-/
private partial def normExprImp (s : FVarSubst) (e : Expr) (translator : Bool) : Expr 
goal: Lean.Expr

full_name: Lean.Compiler.LCNF.NormFVarResult.fvar
code: /--
Result type for `normFVar` and `normFVarImp`.
-/
inductive NormFVarResult where
  | /-- New free variable. -/
    fvar (fvarId : FVarId)
  | /--
    Free variable has been erased. This can happen when instantiating polymorphic code
    with computationally irrelant stuff. -/
    erased
  deriving Inhabited
goal: Lean.Compiler.LCNF.NormFVarResult

full_name: Lean.Compiler.LCNF.NormFVarResult.erased
code: /--
Result type for `normFVar` and `normFVarImp`.
-/
inductive NormFVarResult where
  | /-- New free variable. -/
    fvar (fvarId : FVarId)
  | /--
    Free variable has been erased. This can happen when instantiating polymorphic code
    with computationally irrelant stuff. -/
    erased
  deriving Inhabited
goal: Lean.Compiler.LCNF.NormFVarResult

full_name: Lean.Compiler.LCNF.NormFVarResult
code: /--
Result type for `normFVar` and `normFVarImp`.
-/
inductive NormFVarResult where
  | /-- New free variable. -/
    fvar (fvarId : FVarId)
  | /--
    Free variable has been erased. This can happen when instantiating polymorphic code
    with computationally irrelant stuff. -/
    erased
  deriving Inhabited
goal: Type

full_name: Lean.Compiler.LCNF.instInhabitedNormFVarResult
code: /--
Result type for `normFVar` and `normFVarImp`.
-/
inductive NormFVarResult where
  | /-- New free variable. -/
    fvar (fvarId : FVarId)
  | /--
    Free variable has been erased. This can happen when instantiating polymorphic code
    with computationally irrelant stuff. -/
    erased
  deriving Inhabited
goal: Inhabited Lean.Compiler.LCNF.NormFVarResult

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Compiler.LCNF.CompilerM.0.Lean.Compiler.LCNF.normFVarImp
code: /--
Normalize the given free variable.
See `normExprImp` for documentation on the `translator` parameter.
This function is meant to be used in contexts where the input free-variable is computationally relevant.
This function panics if the substitution is mapping `fvarId` to an expression that is not another free variable.
That is, it is not a type (or type former), nor `lcErased`. Recall that a valid `FVarSubst` contains only
expressions that are free variables, `lcErased`, or type formers.
-/
private partial def normFVarImp (s : FVarSubst) (fvarId : FVarId) (translator : Bool) : NormFVarResult 
goal: Lean.Compiler.LCNF.NormFVarResult

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Compiler.LCNF.CompilerM.0.Lean.Compiler.LCNF.normArgImp
code: /--
Replace the free variables in `arg` using the given substitution.

See `normExprImp`
-/
private partial def normArgImp (s : FVarSubst) (arg : Arg) (translator : Bool) : Arg 
goal: Lean.Compiler.LCNF.Arg

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Compiler.LCNF.CompilerM.0.Lean.Compiler.LCNF.normArgsImp
code: private def normArgsImp (s : FVarSubst) (args : Array Arg) (translator : Bool) : Array Arg 
goal: Array Lean.Compiler.LCNF.Arg

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Compiler.LCNF.CompilerM.0.Lean.Compiler.LCNF.normLetValueImp
code: /--
Replace the free variables in `e` using the given substitution.

See `normExprImp`
-/
private partial def normLetValueImp (s : FVarSubst) (e : LetValue) (translator : Bool) : LetValue 
goal: Lean.Compiler.LCNF.LetValue

full_name: Lean.Compiler.LCNF.MonadFVarSubst
code: /--
Interface for monads that have a free substitutions.
-/
class MonadFVarSubst (m : Type → Type) (translator : outParam Bool) where
  getSubst : m FVarSubst
goal: Type

full_name: Lean.Compiler.LCNF.MonadFVarSubst.getSubst
code: /--
Interface for monads that have a free substitutions.
-/
class MonadFVarSubst (m : Type → Type) (translator : outParam Bool) where
  getSubst : m FVarSubst
goal: m Lean.Compiler.LCNF.FVarSubst

full_name: Lean.Compiler.LCNF.instMonadFVarSubstOfMonadLift
code: instance (m n) [MonadLift m n] [MonadFVarSubst m t] : MonadFVarSubst n t 
goal: Lean.Compiler.LCNF.MonadFVarSubst n t

full_name: Lean.Compiler.LCNF.MonadFVarSubstState.modifySubst
code: class MonadFVarSubstState (m : Type → Type) where
  modifySubst : (FVarSubst → FVarSubst) → m Unit
goal: (Lean.Compiler.LCNF.FVarSubst → Lean.Compiler.LCNF.FVarSubst) → m Unit

full_name: Lean.Compiler.LCNF.MonadFVarSubstState
code: class MonadFVarSubstState (m : Type → Type) where
  modifySubst : (FVarSubst → FVarSubst) → m Unit
goal: Type

full_name: Lean.Compiler.LCNF.instMonadFVarSubstStateOfMonadLift
code: instance (m n) [MonadLift m n] [MonadFVarSubstState m] : MonadFVarSubstState n 
goal: Lean.Compiler.LCNF.MonadFVarSubstState n

full_name: Lean.Compiler.LCNF.addFVarSubst
code: /--
Add the entry `fvarId ↦ fvarId'` to the free variable substitution.
-/
@[inline] def addFVarSubst [MonadFVarSubstState m] (fvarId : FVarId) (fvarId' : FVarId) : m Unit 
goal: m Unit

full_name: Lean.Compiler.LCNF.addSubst
code: /--
Add the substitution `fvarId ↦ e`, `e` must be a valid LCNF argument.
That is, it must be a free variable, type (or type former), or `lcErased`.

See `Check.lean` for the free variable substitution checker.
-/
@[inline] def addSubst [MonadFVarSubstState m] (fvarId : FVarId) (e : Expr) : m Unit 
goal: m Unit

full_name: Lean.Compiler.LCNF.normFVar
code: @[inline, inherit_doc normFVarImp] def normFVar [MonadFVarSubst m t] [Monad m] (fvarId : FVarId) : m NormFVarResult 
goal: m Lean.Compiler.LCNF.NormFVarResult

full_name: Lean.Compiler.LCNF.normExpr
code: @[inline, inherit_doc normExprImp] def normExpr [MonadFVarSubst m t] [Monad m] (e : Expr) : m Expr 
goal: m Lean.Expr

full_name: Lean.Compiler.LCNF.normArg
code: @[inline, inherit_doc normArgImp] def normArg [MonadFVarSubst m t] [Monad m] (arg : Arg) : m Arg 
goal: m Lean.Compiler.LCNF.Arg

full_name: Lean.Compiler.LCNF.normLetValue
code: @[inline, inherit_doc normLetValueImp] def normLetValue [MonadFVarSubst m t] [Monad m] (e : LetValue) : m LetValue 
goal: m Lean.Compiler.LCNF.LetValue

full_name: Lean.Compiler.LCNF.normExprCore
code: @[inherit_doc normExprImp]
abbrev normExprCore (s : FVarSubst) (e : Expr) (translator : Bool) : Expr 
goal: Lean.Expr

full_name: Lean.Compiler.LCNF.normArgs
code: /--
Normalize the given arguments using the current substitution.
-/
def normArgs [MonadFVarSubst m t] [Monad m] (args : Array Arg) : m (Array Arg) 
goal: m (Array Lean.Compiler.LCNF.Arg)

full_name: Lean.Compiler.LCNF.mkFreshBinderName
code: def mkFreshBinderName (binderName := `_x): CompilerM Name 
goal: Lean.Compiler.LCNF.CompilerM Lean.Name

full_name: Lean.Compiler.LCNF.ensureNotAnonymous
code: def ensureNotAnonymous (binderName : Name) (baseName : Name) : CompilerM Name 
goal: Lean.Compiler.LCNF.CompilerM Lean.Name

full_name: Lean.Compiler.LCNF.mkParam
code: def mkParam (binderName : Name) (type : Expr) (borrow : Bool) : CompilerM Param 
goal: Lean.Compiler.LCNF.CompilerM Lean.Compiler.LCNF.Param

full_name: Lean.Compiler.LCNF.mkLetDecl
code: def mkLetDecl (binderName : Name) (type : Expr) (value : LetValue) : CompilerM LetDecl 
goal: Lean.Compiler.LCNF.CompilerM Lean.Compiler.LCNF.LetDecl

full_name: Lean.Compiler.LCNF.mkFunDecl
code: def mkFunDecl (binderName : Name) (type : Expr) (params : Array Param) (value : Code) : CompilerM FunDecl 
goal: Lean.Compiler.LCNF.CompilerM Lean.Compiler.LCNF.FunDecl

full_name: Lean.Compiler.LCNF.mkLetDeclErased
code: def mkLetDeclErased : CompilerM LetDecl 
goal: Lean.Compiler.LCNF.CompilerM Lean.Compiler.LCNF.LetDecl

full_name: Lean.Compiler.LCNF.mkReturnErased
code: def mkReturnErased : CompilerM Code 
goal: Lean.Compiler.LCNF.CompilerM Lean.Compiler.LCNF.Code

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Compiler.LCNF.CompilerM.0.Lean.Compiler.LCNF.updateParamImp
code: private unsafe def updateParamImp (p : Param) (type : Expr) : CompilerM Param 
goal: Lean.Compiler.LCNF.CompilerM Lean.Compiler.LCNF.Param

full_name: Lean.Compiler.LCNF.Param.update
code: @[implemented_by updateParamImp] opaque Param.update (p : Param) (type : Expr) : CompilerM Param
goal: Lean.Compiler.LCNF.CompilerM Lean.Compiler.LCNF.Param

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Compiler.LCNF.CompilerM.0.Lean.Compiler.LCNF.updateLetDeclImp
code: private unsafe def updateLetDeclImp (decl : LetDecl) (type : Expr) (value : LetValue) : CompilerM LetDecl 
goal: Lean.Compiler.LCNF.CompilerM Lean.Compiler.LCNF.LetDecl

full_name: Lean.Compiler.LCNF.LetDecl.update
code: @[implemented_by updateLetDeclImp] opaque LetDecl.update (decl : LetDecl) (type : Expr) (value : LetValue) : CompilerM LetDecl
goal: Lean.Compiler.LCNF.CompilerM Lean.Compiler.LCNF.LetDecl

full_name: Lean.Compiler.LCNF.LetDecl.updateValue
code: def LetDecl.updateValue (decl : LetDecl) (value : LetValue) : CompilerM LetDecl 
goal: Lean.Compiler.LCNF.CompilerM Lean.Compiler.LCNF.LetDecl

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Compiler.LCNF.CompilerM.0.Lean.Compiler.LCNF.updateFunDeclImp
code: private unsafe def updateFunDeclImp (decl: FunDecl) (type : Expr) (params : Array Param) (value : Code) : CompilerM FunDecl 
goal: Lean.Compiler.LCNF.CompilerM Lean.Compiler.LCNF.FunDecl

full_name: Lean.Compiler.LCNF.FunDeclCore.update
code: @[implemented_by updateFunDeclImp] opaque FunDeclCore.update (decl: FunDecl) (type : Expr) (params : Array Param) (value : Code) : CompilerM FunDecl
goal: Lean.Compiler.LCNF.CompilerM Lean.Compiler.LCNF.FunDecl

full_name: Lean.Compiler.LCNF.FunDeclCore.update'
code: abbrev FunDeclCore.update' (decl : FunDecl) (type : Expr) (value : Code) : CompilerM FunDecl 
goal: Lean.Compiler.LCNF.CompilerM Lean.Compiler.LCNF.FunDecl

full_name: Lean.Compiler.LCNF.FunDeclCore.updateValue
code: abbrev FunDeclCore.updateValue (decl : FunDecl) (value : Code) : CompilerM FunDecl 
goal: Lean.Compiler.LCNF.CompilerM Lean.Compiler.LCNF.FunDecl

full_name: Lean.Compiler.LCNF.normParam
code: @[inline] def normParam [MonadLiftT CompilerM m] [Monad m] [MonadFVarSubst m t] (p : Param) : m Param 
goal: m Lean.Compiler.LCNF.Param

full_name: Lean.Compiler.LCNF.normParams
code: def normParams [MonadLiftT CompilerM m] [Monad m] [MonadFVarSubst m t] (ps : Array Param) : m (Array Param) 
goal: m (Array Lean.Compiler.LCNF.Param)

full_name: Lean.Compiler.LCNF.normLetDecl
code: def normLetDecl [MonadLiftT CompilerM m] [Monad m] [MonadFVarSubst m t] (decl : LetDecl) : m LetDecl 
goal: m Lean.Compiler.LCNF.LetDecl

full_name: Lean.Compiler.LCNF.NormalizerM
code: abbrev NormalizerM (_translator : Bool) 
goal: Type

full_name: Lean.Compiler.LCNF.instMonadFVarSubstNormalizerM
code: instance : MonadFVarSubst (NormalizerM t) t 
goal: Lean.Compiler.LCNF.MonadFVarSubst (Lean.Compiler.LCNF.NormalizerM t) t

full_name: Lean.Compiler.LCNF.withNormFVarResult
code: /--
If `result` is `.fvar fvarId`, then return `x fvarId`. Otherwise, it is `.erased`,
and method returns `let _x.i := .erased; return _x.i`.
-/
@[inline] def withNormFVarResult [MonadLiftT CompilerM m] [Monad m] (result : NormFVarResult) (x : FVarId → m Code) : m Code 
goal: m Lean.Compiler.LCNF.Code

full_name: Lean.Compiler.LCNF.normFunDecl
code: @[inline] def normFunDecl [MonadLiftT CompilerM m] [Monad m] [MonadFVarSubst m t] (decl : FunDecl) : m FunDecl 
goal: m Lean.Compiler.LCNF.FunDecl

full_name: Lean.Compiler.LCNF.normCode
code: /-- Similar to `internalize`, but does not refresh `FVarId`s. -/
@[inline] def normCode [MonadLiftT CompilerM m] [Monad m] [MonadFVarSubst m t] (code : Code) : m Code 
goal: m Lean.Compiler.LCNF.Code

full_name: Lean.Compiler.LCNF.replaceExprFVars
code: def replaceExprFVars (e : Expr) (s : FVarSubst) (translator : Bool) : CompilerM Expr 
goal: Lean.Compiler.LCNF.CompilerM Lean.Expr

full_name: Lean.Compiler.LCNF.replaceFVars
code: def replaceFVars (code : Code) (s : FVarSubst) (translator : Bool) : CompilerM Code 
goal: Lean.Compiler.LCNF.CompilerM Lean.Compiler.LCNF.Code

full_name: Lean.Compiler.LCNF.mkFreshJpName
code: def mkFreshJpName : CompilerM Name 
goal: Lean.Compiler.LCNF.CompilerM Lean.Name

full_name: Lean.Compiler.LCNF.mkAuxParam
code: def mkAuxParam (type : Expr) (borrow := false) : CompilerM Param 
goal: Lean.Compiler.LCNF.CompilerM Lean.Compiler.LCNF.Param

full_name: Lean.Compiler.LCNF.getConfig
code: def getConfig : CompilerM ConfigOptions 
goal: Lean.Compiler.LCNF.CompilerM Lean.Compiler.LCNF.ConfigOptions

full_name: Lean.Compiler.LCNF.CompilerM.run
code: def CompilerM.run (x : CompilerM α) (s : State := {}) (phase : Phase := .base) : CoreM α 
goal: Lean.CoreM α