ruc-ai4math/mathlib_handler_benchmark_410 huggingface dataset:
File: .lake/packages/lean4/src/lean/Lean/Compiler/LCNF/Internalize.lean

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Compiler.LCNF.Internalize.0.Lean.Compiler.LCNF.refreshBinderName
code: private def refreshBinderName (binderName : Name) : CompilerM Name 
goal: Lean.Compiler.LCNF.CompilerM Lean.Name

full_name: Lean.Compiler.LCNF.Internalize.InternalizeM
code: abbrev InternalizeM 
goal: Type

full_name: Lean.Compiler.LCNF.Internalize.instMonadFVarSubstInternalizeMTrue
code: /--
The `InternalizeM` monad is a translator. It "translates" the free variables
in the input expressions and `Code`, into new fresh free variables in the
local context.
-/
instance : MonadFVarSubst InternalizeM true 
goal: Lean.Compiler.LCNF.MonadFVarSubst Lean.Compiler.LCNF.Internalize.InternalizeM true

full_name: Lean.Compiler.LCNF.Internalize.instMonadFVarSubstStateInternalizeM
code: instance : MonadFVarSubstState InternalizeM 
goal: Lean.Compiler.LCNF.MonadFVarSubstState Lean.Compiler.LCNF.Internalize.InternalizeM

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Compiler.LCNF.Internalize.0.Lean.Compiler.LCNF.Internalize.mkNewFVarId
code: private def mkNewFVarId (fvarId : FVarId) : InternalizeM FVarId 
goal: Lean.Compiler.LCNF.Internalize.InternalizeM Lean.FVarId

full_name: Lean.Compiler.LCNF.Internalize.internalizeParam
code: def internalizeParam (p : Param) : InternalizeM Param 
goal: Lean.Compiler.LCNF.Internalize.InternalizeM Lean.Compiler.LCNF.Param

full_name: Lean.Compiler.LCNF.Internalize.internalizeLetDecl
code: def internalizeLetDecl (decl : LetDecl) : InternalizeM LetDecl 
goal: Lean.Compiler.LCNF.Internalize.InternalizeM Lean.Compiler.LCNF.LetDecl

full_name: Lean.Compiler.LCNF.Internalize.internalizeCodeDecl
code: partial def internalizeCodeDecl (decl : CodeDecl) : InternalizeM CodeDecl 
goal: Lean.Compiler.LCNF.Internalize.InternalizeM Lean.Compiler.LCNF.CodeDecl

full_name: Lean.Compiler.LCNF.Code.internalize
code: /--
Refresh free variables ids in `code`, and store their declarations in the local context.
-/
partial def Code.internalize (code : Code) (s : FVarSubst := {}) : CompilerM Code 
goal: Lean.Compiler.LCNF.CompilerM Lean.Compiler.LCNF.Code

full_name: Lean.Compiler.LCNF.Decl.internalize.go
code: def Decl.internalize (decl : Decl) (s : FVarSubst := {}): CompilerM Decl 
goal: Lean.Compiler.LCNF.Internalize.InternalizeM Lean.Compiler.LCNF.Decl

full_name: Lean.Compiler.LCNF.Decl.internalize
code: def Decl.internalize (decl : Decl) (s : FVarSubst := {}): CompilerM Decl 
goal: Lean.Compiler.LCNF.CompilerM Lean.Compiler.LCNF.Decl

full_name: Lean.Compiler.LCNF.cleanup
code: /--
Create a fresh local context and internalize the given decls.
-/
def cleanup (decl : Array Decl) : CompilerM (Array Decl) 
goal: Lean.Compiler.LCNF.CompilerM (Array Lean.Compiler.LCNF.Decl)

full_name: Lean.Compiler.LCNF.normalizeFVarIds
code: def normalizeFVarIds (decl : Decl) : CoreM Decl 
goal: Lean.CoreM Lean.Compiler.LCNF.Decl
File: .lake/packages/lean4/src/lean/Lean/Compiler/LCNF/CompatibleTypes.lean

full_name: Lean.Compiler.LCNF.compatibleTypesQuick
code: /--
Quick check for `compatibleTypes`. It is not monadic, but it is incomplete
because it does not eta-expand type formers. See comment at `compatibleTypes`.
Remark: if the result is `true`, then `a` and `b` are indeed compatible.
If it is `false`, we must use the full-check.
-/
partial def compatibleTypesQuick (a b : Expr) : Bool 
goal: Bool

full_name: Lean.Compiler.LCNF.InferType.compatibleTypesFull
code: /--
Complete check for `compatibleTypes`. It eta-expands type formers. See comment at `compatibleTypes`.
-/
partial def InferType.compatibleTypesFull (a b : Expr) : InferTypeM Bool 
goal: Lean.Compiler.LCNF.InferType.InferTypeM Bool

full_name: Lean.Compiler.LCNF.InferType.compatibleTypesFull.etaExpand?
code: /--
Complete check for `compatibleTypes`. It eta-expands type formers. See comment at `compatibleTypes`.
-/
partial def InferType.compatibleTypesFull (a b : Expr) : InferTypeM Bool 
goal: Lean.Compiler.LCNF.InferType.InferTypeM (Option Lean.Expr)

full_name: Lean.Compiler.LCNF.InferType.compatibleTypes
code: /--
Return true if the LCNF types `a` and `b` are compatible.
Remark: `a` and `b` can be type formers (e.g., `List`, or `fun (α : Type) => Nat → Nat × α`)
Remark: We may need to eta-expand type formers to establish whether they are compatible or not.
For example, suppose we have
```
fun (x : B) => Id B ◾ ◾
Id B ◾
```
We must eta-expand `Id B ◾` to `fun (x : B) => Id B ◾ x`. Note that, we use `x` instead of `◾` to
make the implementation simpler and skip the check whether `B` is a type former type. However,
this simplification should not affect correctness since `◾` is compatible with everything.
Remark: see comment at `isErasedCompatible`.
Remark: because of "erasure confusion" see note above, we assume `◾` (aka `lcErasure`) is compatible with everything.
This is a simplification. We used to use `isErasedCompatible`, but this only address item 1.
For item 2, we would have to modify the `toLCNFType` function and make sure a type former is erased if the expected
type is not always a type former (see `S.mk` type and example in the note above).
-/
def InferType.compatibleTypes (a b : Expr) : InferTypeM Bool 
goal: Lean.Compiler.LCNF.InferType.InferTypeM Bool
File: .lake/packages/lean4/src/lean/Lean/Compiler/LCNF/ScopeM.lean

full_name: Lean.Compiler.LCNF.ScopeM
code: /--
A general abstraction for the idea of a scope in the compiler.
-/
abbrev ScopeM 
goal: Type

full_name: Lean.Compiler.LCNF.ScopeM.getScope
code: def getScope : ScopeM FVarIdSet 
goal: Lean.Compiler.LCNF.ScopeM Lean.FVarIdSet

full_name: Lean.Compiler.LCNF.ScopeM.setScope
code: def setScope (newScope : FVarIdSet) : ScopeM Unit 
goal: Lean.Compiler.LCNF.ScopeM Unit

full_name: Lean.Compiler.LCNF.ScopeM.clearScope
code: def clearScope : ScopeM Unit 
goal: Lean.Compiler.LCNF.ScopeM Unit

full_name: Lean.Compiler.LCNF.ScopeM.withBackTrackingScope
code: /--
Execute `x` but recover the previous scope after doing so.
-/
def withBackTrackingScope [MonadLiftT ScopeM m] [Monad m] [MonadFinally m] (x : m α) : m α 
goal: m α

full_name: Lean.Compiler.LCNF.ScopeM.withNewScope
code: /--
Clear the current scope for the monadic action `x`, afterwards continuing
with the old one.
-/
def withNewScope [MonadLiftT ScopeM m] [Monad m] [MonadFinally m] (x : m α) : m α 
goal: m α

full_name: Lean.Compiler.LCNF.ScopeM.isInScope
code: /--
Check whether `fvarId` is in the current scope, that is, was declared within
the current `fun` declaration that is being processed.
-/
def isInScope (fvarId : FVarId) : ScopeM Bool 
goal: Lean.Compiler.LCNF.ScopeM Bool

full_name: Lean.Compiler.LCNF.ScopeM.addToScope
code: /--
Add a new `FVarId` to the current scope.
-/
def addToScope (fvarId : FVarId) : ScopeM Unit 
goal: Lean.Compiler.LCNF.ScopeM Unit
File: .lake/packages/lean4/src/lean/Lean/Compiler/LCNF/ReduceJpArity.lean

full_name: Lean.Compiler.LCNF.ReduceJpArity.ReduceM
code: abbrev ReduceM 
goal: Type

full_name: Lean.Compiler.LCNF.ReduceJpArity.reduce
code: partial def reduce (code : Code) : ReduceM Code 
goal: Lean.Compiler.LCNF.ReduceJpArity.ReduceM Lean.Compiler.LCNF.Code

full_name: Lean.Compiler.LCNF.Decl.reduceJpArity
code: /--
Try to reduce arity of join points
-/
def Decl.reduceJpArity (decl : Decl) : CompilerM Decl 
goal: Lean.Compiler.LCNF.CompilerM Lean.Compiler.LCNF.Decl

full_name: Lean.Compiler.LCNF.reduceJpArity
code: def reduceJpArity (phase := Phase.base) : Pass 
goal: Lean.Compiler.LCNF.Pass

full_name: Lean.Compiler.LCNF.initFn._@..lake.packages.lean4.src.lean.Lean.Compiler.LCNF.ReduceJpArity._hyg.892
code: builtin_initialize
  registerTraceClass `Compiler.reduceJpArity (inherited := true)
goal: IO Unit
File: .lake/packages/lean4/src/lean/Lean/Compiler/LCNF/ToExpr.lean

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Compiler.LCNF.ToExpr.0.Lean.Compiler.LCNF.ToExpr.LevelMap
code: private abbrev LevelMap 
goal: Type

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Compiler.LCNF.ToExpr.0.Lean.FVarId.toExpr
code: private def _root_.Lean.FVarId.toExpr (offset : Nat) (m : LevelMap) (fvarId : FVarId) : Expr 
goal: Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Compiler.LCNF.ToExpr.0.Lean.Expr.abstract'
code: private def _root_.Lean.Expr.abstract' (offset : Nat) (m : LevelMap) (e : Expr) : Expr 
goal: Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Compiler.LCNF.ToExpr.0.Lean.Expr.abstract'.go
code: private def _root_.Lean.Expr.abstract' (offset : Nat) (m : LevelMap) (e : Expr) : Expr 
goal: Lean.Expr

full_name: Lean.Compiler.LCNF.ToExpr.ToExprM
code: abbrev ToExprM 
goal: Type

full_name: Lean.Compiler.LCNF.ToExpr.mkLambdaM.go
code: abbrev mkLambdaM (params : Array Param) (e : Expr) : ToExprM Expr 
goal: Lean.Expr

full_name: Lean.Compiler.LCNF.ToExpr.mkLambdaM
code: abbrev mkLambdaM (params : Array Param) (e : Expr) : ToExprM Expr 
goal: Lean.Compiler.LCNF.ToExpr.ToExprM Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Compiler.LCNF.ToExpr.0.Lean.FVarId.toExprM
code: private abbrev _root_.Lean.FVarId.toExprM (fvarId : FVarId) : ToExprM Expr 
goal: Lean.Compiler.LCNF.ToExpr.ToExprM Lean.Expr

full_name: Lean.Compiler.LCNF.ToExpr.abstractM
code: abbrev abstractM (e : Expr) : ToExprM Expr 
goal: Lean.Compiler.LCNF.ToExpr.ToExprM Lean.Expr

full_name: Lean.Compiler.LCNF.ToExpr.withFVar
code: @[inline] def withFVar (fvarId : FVarId) (k : ToExprM α) : ToExprM α 
goal: Lean.Compiler.LCNF.ToExpr.ToExprM α

full_name: Lean.Compiler.LCNF.ToExpr.withParams.go
code: @[inline] partial def withParams (params : Array Param) (k : ToExprM α) : ToExprM α 
goal: Lean.Compiler.LCNF.ToExpr.ToExprM α

full_name: Lean.Compiler.LCNF.ToExpr.withParams
code: @[inline] partial def withParams (params : Array Param) (k : ToExprM α) : ToExprM α 
goal: Lean.Compiler.LCNF.ToExpr.ToExprM α

full_name: Lean.Compiler.LCNF.ToExpr.run
code: @[inline] def run (x : ToExprM α) (offset : Nat := 0) (levelMap : LevelMap := {}) : α 
goal: α

full_name: Lean.Compiler.LCNF.ToExpr.run'
code: @[inline] def run' (x : ToExprM α) (xs : Array FVarId) : α 
goal: α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Compiler.LCNF.ToExpr.0.Lean.Compiler.LCNF.Arg.toExprM
code: private def Arg.toExprM (arg : Arg) : ToExprM Expr 
goal: Lean.Compiler.LCNF.ToExpr.ToExprM Lean.Expr

full_name: Lean.Compiler.LCNF.Code.toExpr
code: def Code.toExpr (code : Code) (xs : Array FVarId := #[]) : Expr 
goal: Lean.Expr

full_name: Lean.Compiler.LCNF.FunDeclCore.toExpr
code: def FunDeclCore.toExpr (decl : FunDecl) (xs : Array FVarId := #[]) : Expr 
goal: Lean.Expr

full_name: Lean.Compiler.LCNF.Decl.toExpr
code: def Decl.toExpr (decl : Decl) : Expr 
goal: Lean.Expr
File: .lake/packages/lean4/src/lean/Lean/Compiler/LCNF/DependsOn.lean

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Compiler.LCNF.DependsOn.0.Lean.Compiler.LCNF.M
code: private abbrev M 
goal: Type

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Compiler.LCNF.DependsOn.0.Lean.Compiler.LCNF.fvarDepOn
code: private def fvarDepOn (fvarId : FVarId) : M Bool 
goal: Lean.Compiler.LCNF.M Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Compiler.LCNF.DependsOn.0.Lean.Compiler.LCNF.typeDepOn
code: private def typeDepOn (e : Expr) : M Bool 
goal: Lean.Compiler.LCNF.M Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Compiler.LCNF.DependsOn.0.Lean.Compiler.LCNF.argDepOn
code: private def argDepOn (a : Arg) : M Bool 
goal: Lean.Compiler.LCNF.M Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Compiler.LCNF.DependsOn.0.Lean.Compiler.LCNF.letValueDepOn
code: private def letValueDepOn (e : LetValue) : M Bool 
goal: Lean.Compiler.LCNF.M Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Compiler.LCNF.DependsOn.0.Lean.Compiler.LCNF.LetDecl.depOn
code: private def LetDecl.depOn (decl : LetDecl) : M Bool 
goal: Lean.Compiler.LCNF.M Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Compiler.LCNF.DependsOn.0.Lean.Compiler.LCNF.depOn
code: private partial def depOn (c : Code) : M Bool 
goal: Lean.Compiler.LCNF.M Bool

full_name: Lean.Compiler.LCNF.LetDecl.dependsOn
code: abbrev LetDecl.dependsOn (decl : LetDecl) (s : FVarIdSet) :  Bool 
goal: Bool

full_name: Lean.Compiler.LCNF.FunDecl.dependsOn
code: abbrev FunDecl.dependsOn (decl : FunDecl) (s : FVarIdSet) :  Bool 
goal: Bool

full_name: Lean.Compiler.LCNF.CodeDecl.dependsOn
code: def CodeDecl.dependsOn (decl : CodeDecl) (s : FVarIdSet) : Bool 
goal: Bool

full_name: Lean.Compiler.LCNF.Code.dependsOn
code: /--
Return `true` is `c` depends on a free variable in `s`.
-/
def Code.dependsOn (c : Code) (s : FVarIdSet) : Bool 
goal: Bool
File: .lake/packages/lean4/src/lean/Lean/Compiler/LCNF/Main.lean

full_name: Lean.Compiler.LCNF.shouldGenerateCode
code: /--
We do not generate code for `declName` if
- Its type is a proposition.
- Its type is a type former.
- It is tagged as `[macro_inline]`.
- It is a type class instance.

Remark: we still generate code for declarations tagged as `[inline]`
and `[specialize]` since they can be partially applied.
-/
def shouldGenerateCode (declName : Name) : CoreM Bool 
goal: Lean.CoreM Bool

full_name: Lean.Compiler.LCNF.shouldGenerateCode.isCompIrrelevant
code: /--
We do not generate code for `declName` if
- Its type is a proposition.
- Its type is a type former.
- It is tagged as `[macro_inline]`.
- It is a type class instance.

Remark: we still generate code for declarations tagged as `[inline]`
and `[specialize]` since they can be partially applied.
-/
def shouldGenerateCode (declName : Name) : CoreM Bool 
goal: Lean.MetaM Bool

full_name: Lean.Compiler.LCNF.checkpoint
code: /--
A checkpoint in code generation to print all declarations in between
compiler passes in order to ease debugging.
The trace can be viewed with `set_option trace.Compiler.step true`.
-/
def checkpoint (stepName : Name) (decls : Array Decl) : CompilerM Unit 
goal: Lean.Compiler.LCNF.CompilerM Unit

full_name: Lean.Compiler.LCNF.PassManager.run
code: def run (declNames : Array Name) : CompilerM (Array Decl) 
goal: Lean.Compiler.LCNF.CompilerM (Array Lean.Compiler.LCNF.Decl)

full_name: Lean.Compiler.LCNF.compile
code: def compile (declNames : Array Name) : CoreM (Array Decl) 
goal: Lean.CoreM (Array Lean.Compiler.LCNF.Decl)

full_name: Lean.Compiler.LCNF.showDecl
code: def showDecl (phase : Phase) (declName : Name) : CoreM Format 
goal: Lean.CoreM Lean.Format

full_name: Lean.Compiler.LCNF.main
code: @[export lean_lcnf_compile_decls]
def main (declNames : List Name) : CoreM Unit 
goal: Lean.CoreM Unit

full_name: Lean.Compiler.LCNF.initFn._@..lake.packages.lean4.src.lean.Lean.Compiler.LCNF.Main._hyg.1414
code: builtin_initialize
  registerTraceClass `Compiler.init (inherited := true)
  registerTraceClass `Compiler.test (inherited := true)
  registerTraceClass `Compiler.result (inherited := true)
  registerTraceClass `Compiler.jp
goal: IO Unit
File: .lake/packages/lean4/src/lean/Lean/Compiler/LCNF/CSE.lean

full_name: Lean.Compiler.LCNF.CSE.State
code: structure State where
  map   : PHashMap Expr FVarId := {}
  subst : FVarSubst := {}
goal: Type

full_name: Lean.Compiler.LCNF.CSE.State.subst
code: structure State where
  map   : PHashMap Expr FVarId := {}
  subst : FVarSubst := {}
goal: Lean.Compiler.LCNF.FVarSubst

full_name: Lean.Compiler.LCNF.CSE.State.map
code: structure State where
  map   : PHashMap Expr FVarId := {}
  subst : FVarSubst := {}
goal: Lean.PHashMap Lean.Expr Lean.FVarId

full_name: Lean.Compiler.LCNF.CSE.M
code: abbrev M 
goal: Type

full_name: Lean.Compiler.LCNF.CSE.instMonadFVarSubstMFalse
code: instance : MonadFVarSubst M false 
goal: Lean.Compiler.LCNF.MonadFVarSubst Lean.Compiler.LCNF.CSE.M false

full_name: Lean.Compiler.LCNF.CSE.instMonadFVarSubstStateM
code: instance : MonadFVarSubstState M 
goal: Lean.Compiler.LCNF.MonadFVarSubstState Lean.Compiler.LCNF.CSE.M

full_name: Lean.Compiler.LCNF.CSE.getSubst
code: @[inline] def getSubst : M FVarSubst 
goal: Lean.Compiler.LCNF.CSE.M Lean.Compiler.LCNF.FVarSubst

full_name: Lean.Compiler.LCNF.CSE.addEntry
code: @[inline] def addEntry (value : Expr) (fvarId : FVarId) : M Unit 
goal: Lean.Compiler.LCNF.CSE.M Unit

full_name: Lean.Compiler.LCNF.CSE.withNewScope
code: @[inline] def withNewScope (x : M α) : M α 
goal: Lean.Compiler.LCNF.CSE.M α

full_name: Lean.Compiler.LCNF.CSE.replaceLet
code: def replaceLet (decl : LetDecl) (fvarId : FVarId) : M Unit 
goal: Lean.Compiler.LCNF.CSE.M Unit

full_name: Lean.Compiler.LCNF.CSE.replaceFun
code: def replaceFun (decl : FunDecl) (fvarId : FVarId) : M Unit 
goal: Lean.Compiler.LCNF.CSE.M Unit

full_name: Lean.Compiler.LCNF.Code.cse.go
code: partial def _root_.Lean.Compiler.LCNF.Code.cse (code : Code) : CompilerM Code 
goal: Lean.Compiler.LCNF.CSE.M Lean.Compiler.LCNF.Code

full_name: Lean.Compiler.LCNF.Code.cse
code: partial def _root_.Lean.Compiler.LCNF.Code.cse (code : Code) : CompilerM Code 
goal: Lean.Compiler.LCNF.CompilerM Lean.Compiler.LCNF.Code

full_name: Lean.Compiler.LCNF.Code.cse.goFunDecl
code: partial def _root_.Lean.Compiler.LCNF.Code.cse (code : Code) : CompilerM Code 
goal: Lean.Compiler.LCNF.CSE.M Lean.Compiler.LCNF.FunDecl

full_name: Lean.Compiler.LCNF.Decl.cse
code: /--
Common sub-expression elimination
-/
def Decl.cse (decl : Decl) : CompilerM Decl 
goal: Lean.Compiler.LCNF.CompilerM Lean.Compiler.LCNF.Decl

full_name: Lean.Compiler.LCNF.cse
code: def cse (phase : Phase := .base) (occurrence := 0) : Pass 
goal: Lean.Compiler.LCNF.Pass

full_name: Lean.Compiler.LCNF.initFn._@..lake.packages.lean4.src.lean.Lean.Compiler.LCNF.CSE._hyg.1070
code: builtin_initialize
  registerTraceClass `Compiler.cse (inherited := true)
goal: IO Unit
File: .lake/packages/lean4/src/lean/Lean/Compiler/LCNF/MonadScope.lean

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

full_name: Lean.Compiler.LCNF.MonadScope.getScope
code: class MonadScope (m : Type → Type) where
  getScope : m Scope
  withScope : (Scope → Scope) → m α → m α
goal: m Lean.Compiler.LCNF.Scope

full_name: Lean.Compiler.LCNF.MonadScope.withScope
code: class MonadScope (m : Type → Type) where
  getScope : m Scope
  withScope : (Scope → Scope) → m α → m α
goal: (Lean.Compiler.LCNF.Scope → Lean.Compiler.LCNF.Scope) → m α → m α

full_name: Lean.Compiler.LCNF.MonadScope
code: class MonadScope (m : Type → Type) where
  getScope : m Scope
  withScope : (Scope → Scope) → m α → m α
goal: Type 1

full_name: Lean.Compiler.LCNF.ScopeT
code: abbrev ScopeT (m : Type → Type) 
goal: Type

full_name: Lean.Compiler.LCNF.instMonadScopeScopeTOfMonad
code: instance [Monad m] : MonadScope (ScopeT m) 
goal: Lean.Compiler.LCNF.MonadScope (Lean.Compiler.LCNF.ScopeT m)

full_name: Lean.Compiler.LCNF.instMonadScopeOfMonadLiftOfMonadFunctor
code: instance (m n) [MonadLift m n] [MonadFunctor m n] [MonadScope m] : MonadScope n 
goal: Lean.Compiler.LCNF.MonadScope n

full_name: Lean.Compiler.LCNF.inScope
code: def inScope [MonadScope m] [Monad m] (fvarId : FVarId) : m Bool 
goal: m Bool

full_name: Lean.Compiler.LCNF.withParams
code: @[inline] def withParams [MonadScope m] [Monad m] (ps : Array Param) (x : m α) : m α 
goal: m α

full_name: Lean.Compiler.LCNF.withFVar
code: @[inline] def withFVar [MonadScope m] [Monad m] (fvarId : FVarId) (x : m α) : m α 
goal: m α

full_name: Lean.Compiler.LCNF.withNewScope
code: @[inline] def withNewScope [MonadScope m] [Monad m] (x : m α) : m α 
goal: m α
File: .lake/packages/lean4/src/lean/Lean/Compiler/LCNF/ToDecl.lean

full_name: Lean.Compiler.LCNF.macroInline
code: /--
Inline constants tagged with the `[macro_inline]` attribute occurring in `e`.
-/
def macroInline (e : Expr) : CoreM Expr 
goal: Lean.CoreM Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Compiler.LCNF.ToDecl.0.Lean.Compiler.LCNF.normalizeAlt
code: private def normalizeAlt (e : Expr) (numParams : Nat) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Compiler.LCNF.inlineMatchers
code: /--
Inline auxiliary `matcher` applications.
-/
partial def inlineMatchers (e : Expr) : CoreM Expr 
goal: Lean.CoreM Lean.Expr

full_name: Lean.Compiler.LCNF.inlineMatchers.inlineMatcher
code: /--
Inline auxiliary `matcher` applications.
-/
partial def inlineMatchers (e : Expr) : CoreM Expr 
goal: Lean.MetaM Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Compiler.LCNF.ToDecl.0.Lean.Compiler.LCNF.replaceUnsafeRecNames
code: /--
Replace nested occurrences of `unsafeRec` names with the safe ones.
-/
private def replaceUnsafeRecNames (value : Expr) : CoreM Expr 
goal: Lean.CoreM Lean.Expr

full_name: Lean.Compiler.LCNF.getDeclInfo?
code: /--
Return the declaration `ConstantInfo` for the code generator.

Remark: the unsafe recursive version is tried first.
-/
def getDeclInfo? (declName : Name) : CoreM (Option ConstantInfo) 
goal: Lean.CoreM (Option Lean.ConstantInfo)

full_name: Lean.Compiler.LCNF.toDecl
code: /--
Convert the given declaration from the Lean environment into `Decl`.
The steps for this are roughly:
- partially erasing type information of the declaration
- eta-expanding the declaration value.
- if the declaration has an unsafe-rec version, use it.
- expand declarations tagged with the `[macro_inline]` attribute
- turn the resulting term into LCNF declaration
-/
def toDecl (declName : Name) : CompilerM Decl 
goal: Lean.Compiler.LCNF.CompilerM Lean.Compiler.LCNF.Decl
File: .lake/packages/lean4/src/lean/Lean/Compiler/LCNF/LCtx.lean

full_name: Lean.Compiler.LCNF.LCtx.letDecls
code: /--
LCNF local context.
-/
structure LCtx where
  params   : HashMap FVarId Param := {}
  letDecls : HashMap FVarId LetDecl := {}
  funDecls : HashMap FVarId FunDecl := {}
  deriving Inhabited
goal: Lean.HashMap Lean.FVarId Lean.Compiler.LCNF.LetDecl

full_name: Lean.Compiler.LCNF.LCtx.funDecls
code: /--
LCNF local context.
-/
structure LCtx where
  params   : HashMap FVarId Param := {}
  letDecls : HashMap FVarId LetDecl := {}
  funDecls : HashMap FVarId FunDecl := {}
  deriving Inhabited
goal: Lean.HashMap Lean.FVarId Lean.Compiler.LCNF.FunDecl

full_name: Lean.Compiler.LCNF.instInhabitedLCtx
code: /--
LCNF local context.
-/
structure LCtx where
  params   : HashMap FVarId Param := {}
  letDecls : HashMap FVarId LetDecl := {}
  funDecls : HashMap FVarId FunDecl := {}
  deriving Inhabited
goal: Inhabited Lean.Compiler.LCNF.LCtx

full_name: Lean.Compiler.LCNF.LCtx
code: /--
LCNF local context.
-/
structure LCtx where
  params   : HashMap FVarId Param := {}
  letDecls : HashMap FVarId LetDecl := {}
  funDecls : HashMap FVarId FunDecl := {}
  deriving Inhabited
goal: Type

full_name: Lean.Compiler.LCNF.LCtx.params
code: /--
LCNF local context.
-/
structure LCtx where
  params   : HashMap FVarId Param := {}
  letDecls : HashMap FVarId LetDecl := {}
  funDecls : HashMap FVarId FunDecl := {}
  deriving Inhabited
goal: Lean.HashMap Lean.FVarId Lean.Compiler.LCNF.Param

full_name: Lean.Compiler.LCNF.LCtx.addParam
code: def LCtx.addParam (lctx : LCtx) (param : Param) : LCtx 
goal: Lean.Compiler.LCNF.LCtx

full_name: Lean.Compiler.LCNF.LCtx.addLetDecl
code: def LCtx.addLetDecl (lctx : LCtx) (letDecl : LetDecl) : LCtx 
goal: Lean.Compiler.LCNF.LCtx

full_name: Lean.Compiler.LCNF.LCtx.addFunDecl
code: def LCtx.addFunDecl (lctx : LCtx) (funDecl : FunDecl) : LCtx 
goal: Lean.Compiler.LCNF.LCtx

full_name: Lean.Compiler.LCNF.LCtx.eraseParam
code: def LCtx.eraseParam (lctx : LCtx) (param : Param) : LCtx 
goal: Lean.Compiler.LCNF.LCtx

full_name: Lean.Compiler.LCNF.LCtx.eraseParams
code: def LCtx.eraseParams (lctx : LCtx) (ps : Array Param) : LCtx 
goal: Lean.Compiler.LCNF.LCtx

full_name: Lean.Compiler.LCNF.LCtx.eraseLetDecl
code: def LCtx.eraseLetDecl (lctx : LCtx) (decl : LetDecl) : LCtx 
goal: Lean.Compiler.LCNF.LCtx

full_name: Lean.Compiler.LCNF.LCtx.toLocalContext
code: /--
Convert a LCNF local context into a regular Lean local context.
-/
def LCtx.toLocalContext (lctx : LCtx) : LocalContext 
goal: Lean.LocalContext