File: .lake/packages/lean4/src/lean/Lean/CoreM.lean

full_name: Lean.diagnostics
code: register_builtin_option diagnostics : Bool := {
  defValue := false
  group    := "diagnostics"
  descr    := "collect diagnostic information"
}
goal: Lean.Option Bool

full_name: Lean.initFn._@..lake.packages.lean4.src.lean.Lean.CoreM._hyg.6
code: register_builtin_option diagnostics : Bool := {
  defValue := false
  group    := "diagnostics"
  descr    := "collect diagnostic information"
}
goal: IO (Lean.Option Bool)

full_name: Lean.initFn._@..lake.packages.lean4.src.lean.Lean.CoreM._hyg.43
code: register_builtin_option diagnostics.threshold : Nat := {
  defValue := 20
  group    := "diagnostics"
  descr    := "only diagnostic counters above this threshold are reported by the definitional equality"
}
goal: IO (Lean.Option Nat)

full_name: Lean.diagnostics.threshold
code: register_builtin_option diagnostics.threshold : Nat := {
  defValue := 20
  group    := "diagnostics"
  descr    := "only diagnostic counters above this threshold are reported by the definitional equality"
}
goal: Lean.Option Nat

full_name: Lean.maxHeartbeats
code: register_builtin_option maxHeartbeats : Nat := {
  defValue := 200000
  descr := "maximum amount of heartbeats per command. A heartbeat is number of (small) memory allocations (in thousands), 0 means no limit"
}
goal: Lean.Option Nat

full_name: Lean.initFn._@..lake.packages.lean4.src.lean.Lean.CoreM._hyg.85
code: register_builtin_option maxHeartbeats : Nat := {
  defValue := 200000
  descr := "maximum amount of heartbeats per command. A heartbeat is number of (small) memory allocations (in thousands), 0 means no limit"
}
goal: IO (Lean.Option Nat)

full_name: Lean.useDiagnosticMsg
code: def useDiagnosticMsg 
goal: String

full_name: Lean.Core.initFn._@..lake.packages.lean4.src.lean.Lean.CoreM._hyg.138
code: builtin_initialize registerTraceClass `Kernel
goal: IO Unit

full_name: Lean.Core.getMaxHeartbeats
code: def getMaxHeartbeats (opts : Options) : Nat 
goal: Nat

full_name: Lean.Core.InstantiateLevelCache
code: abbrev InstantiateLevelCache 
goal: Type

full_name: Lean.Core.Cache.instLevelValue
code: /-- Cache for the `CoreM` monad -/
structure Cache where
  instLevelType  : InstantiateLevelCache := {}
  instLevelValue : InstantiateLevelCache := {}
  deriving Inhabited
goal: Lean.Core.InstantiateLevelCache

full_name: Lean.Core.Cache.instLevelType
code: /-- Cache for the `CoreM` monad -/
structure Cache where
  instLevelType  : InstantiateLevelCache := {}
  instLevelValue : InstantiateLevelCache := {}
  deriving Inhabited
goal: Lean.Core.InstantiateLevelCache

full_name: Lean.Core.instInhabitedCache
code: /-- Cache for the `CoreM` monad -/
structure Cache where
  instLevelType  : InstantiateLevelCache := {}
  instLevelValue : InstantiateLevelCache := {}
  deriving Inhabited
goal: Inhabited Lean.Core.Cache

full_name: Lean.Core.Cache
code: /-- Cache for the `CoreM` monad -/
structure Cache where
  instLevelType  : InstantiateLevelCache := {}
  instLevelValue : InstantiateLevelCache := {}
  deriving Inhabited
goal: Type

full_name: Lean.Core.State
code: /-- State for the CoreM monad. -/
structure State where
  /-- Current environment. -/
  env             : Environment
  /-- Next macro scope. We use macro scopes to avoid accidental name capture. -/
  nextMacroScope  : MacroScope     := firstFrontendMacroScope + 1
  /-- Name generator for producing unique `FVarId`s, `MVarId`s, and `LMVarId`s -/
  ngen            : NameGenerator  := {}
  /-- Trace messages -/
  traceState      : TraceState     := {}
  /-- Cache for instantiating universe polymorphic declarations. -/
  cache           : Cache          := {}
  /-- Message log. -/
  messages        : MessageLog     := {}
  /-- Info tree. We have the info tree here because we want to update it while adding attributes. -/
  infoState       : Elab.InfoState := {}
  deriving Nonempty
goal: Type

full_name: Lean.Core.instNonemptyState
code: /-- State for the CoreM monad. -/
structure State where
  /-- Current environment. -/
  env             : Environment
  /-- Next macro scope. We use macro scopes to avoid accidental name capture. -/
  nextMacroScope  : MacroScope     := firstFrontendMacroScope + 1
  /-- Name generator for producing unique `FVarId`s, `MVarId`s, and `LMVarId`s -/
  ngen            : NameGenerator  := {}
  /-- Trace messages -/
  traceState      : TraceState     := {}
  /-- Cache for instantiating universe polymorphic declarations. -/
  cache           : Cache          := {}
  /-- Message log. -/
  messages        : MessageLog     := {}
  /-- Info tree. We have the info tree here because we want to update it while adding attributes. -/
  infoState       : Elab.InfoState := {}
  deriving Nonempty
goal: Nonempty Lean.Core.State

full_name: Lean.Core.State.traceState
code: /-- State for the CoreM monad. -/
structure State where
  /-- Current environment. -/
  env             : Environment
  /-- Next macro scope. We use macro scopes to avoid accidental name capture. -/
  nextMacroScope  : MacroScope     := firstFrontendMacroScope + 1
  /-- Name generator for producing unique `FVarId`s, `MVarId`s, and `LMVarId`s -/
  ngen            : NameGenerator  := {}
  /-- Trace messages -/
  traceState      : TraceState     := {}
  /-- Cache for instantiating universe polymorphic declarations. -/
  cache           : Cache          := {}
  /-- Message log. -/
  messages        : MessageLog     := {}
  /-- Info tree. We have the info tree here because we want to update it while adding attributes. -/
  infoState       : Elab.InfoState := {}
  deriving Nonempty
goal: Lean.TraceState

full_name: Lean.Core.State.env
code: /-- State for the CoreM monad. -/
structure State where
  /-- Current environment. -/
  env             : Environment
  /-- Next macro scope. We use macro scopes to avoid accidental name capture. -/
  nextMacroScope  : MacroScope     := firstFrontendMacroScope + 1
  /-- Name generator for producing unique `FVarId`s, `MVarId`s, and `LMVarId`s -/
  ngen            : NameGenerator  := {}
  /-- Trace messages -/
  traceState      : TraceState     := {}
  /-- Cache for instantiating universe polymorphic declarations. -/
  cache           : Cache          := {}
  /-- Message log. -/
  messages        : MessageLog     := {}
  /-- Info tree. We have the info tree here because we want to update it while adding attributes. -/
  infoState       : Elab.InfoState := {}
  deriving Nonempty
goal: Lean.Environment

full_name: Lean.Core.State.nextMacroScope
code: /-- State for the CoreM monad. -/
structure State where
  /-- Current environment. -/
  env             : Environment
  /-- Next macro scope. We use macro scopes to avoid accidental name capture. -/
  nextMacroScope  : MacroScope     := firstFrontendMacroScope + 1
  /-- Name generator for producing unique `FVarId`s, `MVarId`s, and `LMVarId`s -/
  ngen            : NameGenerator  := {}
  /-- Trace messages -/
  traceState      : TraceState     := {}
  /-- Cache for instantiating universe polymorphic declarations. -/
  cache           : Cache          := {}
  /-- Message log. -/
  messages        : MessageLog     := {}
  /-- Info tree. We have the info tree here because we want to update it while adding attributes. -/
  infoState       : Elab.InfoState := {}
  deriving Nonempty
goal: Lean.MacroScope

full_name: Lean.Core.State.cache
code: /-- State for the CoreM monad. -/
structure State where
  /-- Current environment. -/
  env             : Environment
  /-- Next macro scope. We use macro scopes to avoid accidental name capture. -/
  nextMacroScope  : MacroScope     := firstFrontendMacroScope + 1
  /-- Name generator for producing unique `FVarId`s, `MVarId`s, and `LMVarId`s -/
  ngen            : NameGenerator  := {}
  /-- Trace messages -/
  traceState      : TraceState     := {}
  /-- Cache for instantiating universe polymorphic declarations. -/
  cache           : Cache          := {}
  /-- Message log. -/
  messages        : MessageLog     := {}
  /-- Info tree. We have the info tree here because we want to update it while adding attributes. -/
  infoState       : Elab.InfoState := {}
  deriving Nonempty
goal: Lean.Core.Cache

full_name: Lean.Core.State.messages
code: /-- State for the CoreM monad. -/
structure State where
  /-- Current environment. -/
  env             : Environment
  /-- Next macro scope. We use macro scopes to avoid accidental name capture. -/
  nextMacroScope  : MacroScope     := firstFrontendMacroScope + 1
  /-- Name generator for producing unique `FVarId`s, `MVarId`s, and `LMVarId`s -/
  ngen            : NameGenerator  := {}
  /-- Trace messages -/
  traceState      : TraceState     := {}
  /-- Cache for instantiating universe polymorphic declarations. -/
  cache           : Cache          := {}
  /-- Message log. -/
  messages        : MessageLog     := {}
  /-- Info tree. We have the info tree here because we want to update it while adding attributes. -/
  infoState       : Elab.InfoState := {}
  deriving Nonempty
goal: Lean.MessageLog

full_name: Lean.Core.State.infoState
code: /-- State for the CoreM monad. -/
structure State where
  /-- Current environment. -/
  env             : Environment
  /-- Next macro scope. We use macro scopes to avoid accidental name capture. -/
  nextMacroScope  : MacroScope     := firstFrontendMacroScope + 1
  /-- Name generator for producing unique `FVarId`s, `MVarId`s, and `LMVarId`s -/
  ngen            : NameGenerator  := {}
  /-- Trace messages -/
  traceState      : TraceState     := {}
  /-- Cache for instantiating universe polymorphic declarations. -/
  cache           : Cache          := {}
  /-- Message log. -/
  messages        : MessageLog     := {}
  /-- Info tree. We have the info tree here because we want to update it while adding attributes. -/
  infoState       : Elab.InfoState := {}
  deriving Nonempty
goal: Lean.Elab.InfoState

full_name: Lean.Core.State.ngen
code: /-- State for the CoreM monad. -/
structure State where
  /-- Current environment. -/
  env             : Environment
  /-- Next macro scope. We use macro scopes to avoid accidental name capture. -/
  nextMacroScope  : MacroScope     := firstFrontendMacroScope + 1
  /-- Name generator for producing unique `FVarId`s, `MVarId`s, and `LMVarId`s -/
  ngen            : NameGenerator  := {}
  /-- Trace messages -/
  traceState      : TraceState     := {}
  /-- Cache for instantiating universe polymorphic declarations. -/
  cache           : Cache          := {}
  /-- Message log. -/
  messages        : MessageLog     := {}
  /-- Info tree. We have the info tree here because we want to update it while adding attributes. -/
  infoState       : Elab.InfoState := {}
  deriving Nonempty
goal: Lean.NameGenerator

full_name: Lean.Core.Context.cancelTk?
code: /-- Context for the CoreM monad. -/
structure Context where
  /-- Name of the file being compiled. -/
  fileName       : String
  /-- Auxiliary datastructure for converting `String.Pos` into Line/Column number. -/
  fileMap        : FileMap
  options        : Options := {}
  currRecDepth   : Nat := 0
  maxRecDepth    : Nat := 1000
  ref            : Syntax := Syntax.missing
  currNamespace  : Name := Name.anonymous
  openDecls      : List OpenDecl := []
  initHeartbeats : Nat := 0
  maxHeartbeats  : Nat := getMaxHeartbeats options
  currMacroScope : MacroScope := firstFrontendMacroScope
  /--
  If `diag := true`, different parts of the system collect diagnostics.
  Use the `set_option diag true` to set it to true.
  -/
  diag           : Bool := false
  /-- If set, used to cancel elaboration from outside when results are not needed anymore. -/
  cancelTk?      : Option IO.CancelToken := none
  /--
  If set (when `showPartialSyntaxErrors` is not set and parsing failed), suppresses most elaboration
  errors; see also `logMessage` below.
  -/
  suppressElabErrors : Bool := false
  deriving Nonempty
goal: Option IO.CancelToken

full_name: Lean.Core.Context.openDecls
code: /-- Context for the CoreM monad. -/
structure Context where
  /-- Name of the file being compiled. -/
  fileName       : String
  /-- Auxiliary datastructure for converting `String.Pos` into Line/Column number. -/
  fileMap        : FileMap
  options        : Options := {}
  currRecDepth   : Nat := 0
  maxRecDepth    : Nat := 1000
  ref            : Syntax := Syntax.missing
  currNamespace  : Name := Name.anonymous
  openDecls      : List OpenDecl := []
  initHeartbeats : Nat := 0
  maxHeartbeats  : Nat := getMaxHeartbeats options
  currMacroScope : MacroScope := firstFrontendMacroScope
  /--
  If `diag := true`, different parts of the system collect diagnostics.
  Use the `set_option diag true` to set it to true.
  -/
  diag           : Bool := false
  /-- If set, used to cancel elaboration from outside when results are not needed anymore. -/
  cancelTk?      : Option IO.CancelToken := none
  /--
  If set (when `showPartialSyntaxErrors` is not set and parsing failed), suppresses most elaboration
  errors; see also `logMessage` below.
  -/
  suppressElabErrors : Bool := false
  deriving Nonempty
goal: List Lean.OpenDecl

full_name: Lean.Core.Context.maxRecDepth
code: /-- Context for the CoreM monad. -/
structure Context where
  /-- Name of the file being compiled. -/
  fileName       : String
  /-- Auxiliary datastructure for converting `String.Pos` into Line/Column number. -/
  fileMap        : FileMap
  options        : Options := {}
  currRecDepth   : Nat := 0
  maxRecDepth    : Nat := 1000
  ref            : Syntax := Syntax.missing
  currNamespace  : Name := Name.anonymous
  openDecls      : List OpenDecl := []
  initHeartbeats : Nat := 0
  maxHeartbeats  : Nat := getMaxHeartbeats options
  currMacroScope : MacroScope := firstFrontendMacroScope
  /--
  If `diag := true`, different parts of the system collect diagnostics.
  Use the `set_option diag true` to set it to true.
  -/
  diag           : Bool := false
  /-- If set, used to cancel elaboration from outside when results are not needed anymore. -/
  cancelTk?      : Option IO.CancelToken := none
  /--
  If set (when `showPartialSyntaxErrors` is not set and parsing failed), suppresses most elaboration
  errors; see also `logMessage` below.
  -/
  suppressElabErrors : Bool := false
  deriving Nonempty
goal: Nat

full_name: Lean.Core.Context.initHeartbeats
code: /-- Context for the CoreM monad. -/
structure Context where
  /-- Name of the file being compiled. -/
  fileName       : String
  /-- Auxiliary datastructure for converting `String.Pos` into Line/Column number. -/
  fileMap        : FileMap
  options        : Options := {}
  currRecDepth   : Nat := 0
  maxRecDepth    : Nat := 1000
  ref            : Syntax := Syntax.missing
  currNamespace  : Name := Name.anonymous
  openDecls      : List OpenDecl := []
  initHeartbeats : Nat := 0
  maxHeartbeats  : Nat := getMaxHeartbeats options
  currMacroScope : MacroScope := firstFrontendMacroScope
  /--
  If `diag := true`, different parts of the system collect diagnostics.
  Use the `set_option diag true` to set it to true.
  -/
  diag           : Bool := false
  /-- If set, used to cancel elaboration from outside when results are not needed anymore. -/
  cancelTk?      : Option IO.CancelToken := none
  /--
  If set (when `showPartialSyntaxErrors` is not set and parsing failed), suppresses most elaboration
  errors; see also `logMessage` below.
  -/
  suppressElabErrors : Bool := false
  deriving Nonempty
goal: Nat

full_name: Lean.Core.Context.ref
code: /-- Context for the CoreM monad. -/
structure Context where
  /-- Name of the file being compiled. -/
  fileName       : String
  /-- Auxiliary datastructure for converting `String.Pos` into Line/Column number. -/
  fileMap        : FileMap
  options        : Options := {}
  currRecDepth   : Nat := 0
  maxRecDepth    : Nat := 1000
  ref            : Syntax := Syntax.missing
  currNamespace  : Name := Name.anonymous
  openDecls      : List OpenDecl := []
  initHeartbeats : Nat := 0
  maxHeartbeats  : Nat := getMaxHeartbeats options
  currMacroScope : MacroScope := firstFrontendMacroScope
  /--
  If `diag := true`, different parts of the system collect diagnostics.
  Use the `set_option diag true` to set it to true.
  -/
  diag           : Bool := false
  /-- If set, used to cancel elaboration from outside when results are not needed anymore. -/
  cancelTk?      : Option IO.CancelToken := none
  /--
  If set (when `showPartialSyntaxErrors` is not set and parsing failed), suppresses most elaboration
  errors; see also `logMessage` below.
  -/
  suppressElabErrors : Bool := false
  deriving Nonempty
goal: Lean.Syntax

full_name: Lean.Core.Context
code: /-- Context for the CoreM monad. -/
structure Context where
  /-- Name of the file being compiled. -/
  fileName       : String
  /-- Auxiliary datastructure for converting `String.Pos` into Line/Column number. -/
  fileMap        : FileMap
  options        : Options := {}
  currRecDepth   : Nat := 0
  maxRecDepth    : Nat := 1000
  ref            : Syntax := Syntax.missing
  currNamespace  : Name := Name.anonymous
  openDecls      : List OpenDecl := []
  initHeartbeats : Nat := 0
  maxHeartbeats  : Nat := getMaxHeartbeats options
  currMacroScope : MacroScope := firstFrontendMacroScope
  /--
  If `diag := true`, different parts of the system collect diagnostics.
  Use the `set_option diag true` to set it to true.
  -/
  diag           : Bool := false
  /-- If set, used to cancel elaboration from outside when results are not needed anymore. -/
  cancelTk?      : Option IO.CancelToken := none
  /--
  If set (when `showPartialSyntaxErrors` is not set and parsing failed), suppresses most elaboration
  errors; see also `logMessage` below.
  -/
  suppressElabErrors : Bool := false
  deriving Nonempty
goal: Type

full_name: Lean.Core.Context.currNamespace
code: /-- Context for the CoreM monad. -/
structure Context where
  /-- Name of the file being compiled. -/
  fileName       : String
  /-- Auxiliary datastructure for converting `String.Pos` into Line/Column number. -/
  fileMap        : FileMap
  options        : Options := {}
  currRecDepth   : Nat := 0
  maxRecDepth    : Nat := 1000
  ref            : Syntax := Syntax.missing
  currNamespace  : Name := Name.anonymous
  openDecls      : List OpenDecl := []
  initHeartbeats : Nat := 0
  maxHeartbeats  : Nat := getMaxHeartbeats options
  currMacroScope : MacroScope := firstFrontendMacroScope
  /--
  If `diag := true`, different parts of the system collect diagnostics.
  Use the `set_option diag true` to set it to true.
  -/
  diag           : Bool := false
  /-- If set, used to cancel elaboration from outside when results are not needed anymore. -/
  cancelTk?      : Option IO.CancelToken := none
  /--
  If set (when `showPartialSyntaxErrors` is not set and parsing failed), suppresses most elaboration
  errors; see also `logMessage` below.
  -/
  suppressElabErrors : Bool := false
  deriving Nonempty
goal: Lean.Name

full_name: Lean.Core.instNonemptyContext
code: /-- Context for the CoreM monad. -/
structure Context where
  /-- Name of the file being compiled. -/
  fileName       : String
  /-- Auxiliary datastructure for converting `String.Pos` into Line/Column number. -/
  fileMap        : FileMap
  options        : Options := {}
  currRecDepth   : Nat := 0
  maxRecDepth    : Nat := 1000
  ref            : Syntax := Syntax.missing
  currNamespace  : Name := Name.anonymous
  openDecls      : List OpenDecl := []
  initHeartbeats : Nat := 0
  maxHeartbeats  : Nat := getMaxHeartbeats options
  currMacroScope : MacroScope := firstFrontendMacroScope
  /--
  If `diag := true`, different parts of the system collect diagnostics.
  Use the `set_option diag true` to set it to true.
  -/
  diag           : Bool := false
  /-- If set, used to cancel elaboration from outside when results are not needed anymore. -/
  cancelTk?      : Option IO.CancelToken := none
  /--
  If set (when `showPartialSyntaxErrors` is not set and parsing failed), suppresses most elaboration
  errors; see also `logMessage` below.
  -/
  suppressElabErrors : Bool := false
  deriving Nonempty
goal: Nonempty Lean.Core.Context

full_name: Lean.Core.Context.options
code: /-- Context for the CoreM monad. -/
structure Context where
  /-- Name of the file being compiled. -/
  fileName       : String
  /-- Auxiliary datastructure for converting `String.Pos` into Line/Column number. -/
  fileMap        : FileMap
  options        : Options := {}
  currRecDepth   : Nat := 0
  maxRecDepth    : Nat := 1000
  ref            : Syntax := Syntax.missing
  currNamespace  : Name := Name.anonymous
  openDecls      : List OpenDecl := []
  initHeartbeats : Nat := 0
  maxHeartbeats  : Nat := getMaxHeartbeats options
  currMacroScope : MacroScope := firstFrontendMacroScope
  /--
  If `diag := true`, different parts of the system collect diagnostics.
  Use the `set_option diag true` to set it to true.
  -/
  diag           : Bool := false
  /-- If set, used to cancel elaboration from outside when results are not needed anymore. -/
  cancelTk?      : Option IO.CancelToken := none
  /--
  If set (when `showPartialSyntaxErrors` is not set and parsing failed), suppresses most elaboration
  errors; see also `logMessage` below.
  -/
  suppressElabErrors : Bool := false
  deriving Nonempty
goal: Lean.Options

full_name: Lean.Core.Context.currMacroScope
code: /-- Context for the CoreM monad. -/
structure Context where
  /-- Name of the file being compiled. -/
  fileName       : String
  /-- Auxiliary datastructure for converting `String.Pos` into Line/Column number. -/
  fileMap        : FileMap
  options        : Options := {}
  currRecDepth   : Nat := 0
  maxRecDepth    : Nat := 1000
  ref            : Syntax := Syntax.missing
  currNamespace  : Name := Name.anonymous
  openDecls      : List OpenDecl := []
  initHeartbeats : Nat := 0
  maxHeartbeats  : Nat := getMaxHeartbeats options
  currMacroScope : MacroScope := firstFrontendMacroScope
  /--
  If `diag := true`, different parts of the system collect diagnostics.
  Use the `set_option diag true` to set it to true.
  -/
  diag           : Bool := false
  /-- If set, used to cancel elaboration from outside when results are not needed anymore. -/
  cancelTk?      : Option IO.CancelToken := none
  /--
  If set (when `showPartialSyntaxErrors` is not set and parsing failed), suppresses most elaboration
  errors; see also `logMessage` below.
  -/
  suppressElabErrors : Bool := false
  deriving Nonempty
goal: Lean.MacroScope

full_name: Lean.Core.Context.suppressElabErrors
code: /-- Context for the CoreM monad. -/
structure Context where
  /-- Name of the file being compiled. -/
  fileName       : String
  /-- Auxiliary datastructure for converting `String.Pos` into Line/Column number. -/
  fileMap        : FileMap
  options        : Options := {}
  currRecDepth   : Nat := 0
  maxRecDepth    : Nat := 1000
  ref            : Syntax := Syntax.missing
  currNamespace  : Name := Name.anonymous
  openDecls      : List OpenDecl := []
  initHeartbeats : Nat := 0
  maxHeartbeats  : Nat := getMaxHeartbeats options
  currMacroScope : MacroScope := firstFrontendMacroScope
  /--
  If `diag := true`, different parts of the system collect diagnostics.
  Use the `set_option diag true` to set it to true.
  -/
  diag           : Bool := false
  /-- If set, used to cancel elaboration from outside when results are not needed anymore. -/
  cancelTk?      : Option IO.CancelToken := none
  /--
  If set (when `showPartialSyntaxErrors` is not set and parsing failed), suppresses most elaboration
  errors; see also `logMessage` below.
  -/
  suppressElabErrors : Bool := false
  deriving Nonempty
goal: Bool

full_name: Lean.Core.Context.maxHeartbeats
code: /-- Context for the CoreM monad. -/
structure Context where
  /-- Name of the file being compiled. -/
  fileName       : String
  /-- Auxiliary datastructure for converting `String.Pos` into Line/Column number. -/
  fileMap        : FileMap
  options        : Options := {}
  currRecDepth   : Nat := 0
  maxRecDepth    : Nat := 1000
  ref            : Syntax := Syntax.missing
  currNamespace  : Name := Name.anonymous
  openDecls      : List OpenDecl := []
  initHeartbeats : Nat := 0
  maxHeartbeats  : Nat := getMaxHeartbeats options
  currMacroScope : MacroScope := firstFrontendMacroScope
  /--
  If `diag := true`, different parts of the system collect diagnostics.
  Use the `set_option diag true` to set it to true.
  -/
  diag           : Bool := false
  /-- If set, used to cancel elaboration from outside when results are not needed anymore. -/
  cancelTk?      : Option IO.CancelToken := none
  /--
  If set (when `showPartialSyntaxErrors` is not set and parsing failed), suppresses most elaboration
  errors; see also `logMessage` below.
  -/
  suppressElabErrors : Bool := false
  deriving Nonempty
goal: Nat

full_name: Lean.Core.Context.fileName
code: /-- Context for the CoreM monad. -/
structure Context where
  /-- Name of the file being compiled. -/
  fileName       : String
  /-- Auxiliary datastructure for converting `String.Pos` into Line/Column number. -/
  fileMap        : FileMap
  options        : Options := {}
  currRecDepth   : Nat := 0
  maxRecDepth    : Nat := 1000
  ref            : Syntax := Syntax.missing
  currNamespace  : Name := Name.anonymous
  openDecls      : List OpenDecl := []
  initHeartbeats : Nat := 0
  maxHeartbeats  : Nat := getMaxHeartbeats options
  currMacroScope : MacroScope := firstFrontendMacroScope
  /--
  If `diag := true`, different parts of the system collect diagnostics.
  Use the `set_option diag true` to set it to true.
  -/
  diag           : Bool := false
  /-- If set, used to cancel elaboration from outside when results are not needed anymore. -/
  cancelTk?      : Option IO.CancelToken := none
  /--
  If set (when `showPartialSyntaxErrors` is not set and parsing failed), suppresses most elaboration
  errors; see also `logMessage` below.
  -/
  suppressElabErrors : Bool := false
  deriving Nonempty
goal: String

full_name: Lean.Core.Context.currRecDepth
code: /-- Context for the CoreM monad. -/
structure Context where
  /-- Name of the file being compiled. -/
  fileName       : String
  /-- Auxiliary datastructure for converting `String.Pos` into Line/Column number. -/
  fileMap        : FileMap
  options        : Options := {}
  currRecDepth   : Nat := 0
  maxRecDepth    : Nat := 1000
  ref            : Syntax := Syntax.missing
  currNamespace  : Name := Name.anonymous
  openDecls      : List OpenDecl := []
  initHeartbeats : Nat := 0
  maxHeartbeats  : Nat := getMaxHeartbeats options
  currMacroScope : MacroScope := firstFrontendMacroScope
  /--
  If `diag := true`, different parts of the system collect diagnostics.
  Use the `set_option diag true` to set it to true.
  -/
  diag           : Bool := false
  /-- If set, used to cancel elaboration from outside when results are not needed anymore. -/
  cancelTk?      : Option IO.CancelToken := none
  /--
  If set (when `showPartialSyntaxErrors` is not set and parsing failed), suppresses most elaboration
  errors; see also `logMessage` below.
  -/
  suppressElabErrors : Bool := false
  deriving Nonempty
goal: Nat

full_name: Lean.Core.Context.diag
code: /-- Context for the CoreM monad. -/
structure Context where
  /-- Name of the file being compiled. -/
  fileName       : String
  /-- Auxiliary datastructure for converting `String.Pos` into Line/Column number. -/
  fileMap        : FileMap
  options        : Options := {}
  currRecDepth   : Nat := 0
  maxRecDepth    : Nat := 1000
  ref            : Syntax := Syntax.missing
  currNamespace  : Name := Name.anonymous
  openDecls      : List OpenDecl := []
  initHeartbeats : Nat := 0
  maxHeartbeats  : Nat := getMaxHeartbeats options
  currMacroScope : MacroScope := firstFrontendMacroScope
  /--
  If `diag := true`, different parts of the system collect diagnostics.
  Use the `set_option diag true` to set it to true.
  -/
  diag           : Bool := false
  /-- If set, used to cancel elaboration from outside when results are not needed anymore. -/
  cancelTk?      : Option IO.CancelToken := none
  /--
  If set (when `showPartialSyntaxErrors` is not set and parsing failed), suppresses most elaboration
  errors; see also `logMessage` below.
  -/
  suppressElabErrors : Bool := false
  deriving Nonempty
goal: Bool

full_name: Lean.Core.Context.fileMap
code: /-- Context for the CoreM monad. -/
structure Context where
  /-- Name of the file being compiled. -/
  fileName       : String
  /-- Auxiliary datastructure for converting `String.Pos` into Line/Column number. -/
  fileMap        : FileMap
  options        : Options := {}
  currRecDepth   : Nat := 0
  maxRecDepth    : Nat := 1000
  ref            : Syntax := Syntax.missing
  currNamespace  : Name := Name.anonymous
  openDecls      : List OpenDecl := []
  initHeartbeats : Nat := 0
  maxHeartbeats  : Nat := getMaxHeartbeats options
  currMacroScope : MacroScope := firstFrontendMacroScope
  /--
  If `diag := true`, different parts of the system collect diagnostics.
  Use the `set_option diag true` to set it to true.
  -/
  diag           : Bool := false
  /-- If set, used to cancel elaboration from outside when results are not needed anymore. -/
  cancelTk?      : Option IO.CancelToken := none
  /--
  If set (when `showPartialSyntaxErrors` is not set and parsing failed), suppresses most elaboration
  errors; see also `logMessage` below.
  -/
  suppressElabErrors : Bool := false
  deriving Nonempty
goal: Lean.FileMap

full_name: Lean.Core.CoreM
code: /-- CoreM is a monad for manipulating the Lean environment.
It is the base monad for `MetaM`.
The main features it provides are:
- name generator state
- environment state
- Lean options context
- the current open namespace
-/
abbrev CoreM 
goal: Type

full_name: Lean.Core.instMonadCoreM
code: @[always_inline]
instance : Monad CoreM 
goal: Monad Lean.CoreM

full_name: Lean.Core.instInhabitedCoreM
code: instance : Inhabited (CoreM α) 
goal: Inhabited (Lean.CoreM α)

full_name: Lean.Core.instMonadRefCoreM
code: instance : MonadRef CoreM 
goal: Lean.MonadRef Lean.CoreM

full_name: Lean.Core.instMonadEnvCoreM
code: instance : MonadEnv CoreM 
goal: Lean.MonadEnv Lean.CoreM

full_name: Lean.Core.instMonadOptionsCoreM
code: instance : MonadOptions CoreM 
goal: Lean.MonadOptions Lean.CoreM

full_name: Lean.Core.instMonadWithOptionsCoreM
code: instance : MonadWithOptions CoreM 
goal: Lean.MonadWithOptions Lean.CoreM

full_name: _private.«.lake».packages.lean4.src.lean.Lean.CoreM.0.Lean.Core.withConsistentCtx
code: @[inline] private def withConsistentCtx (x : CoreM α) : CoreM α 
goal: Lean.CoreM α

full_name: Lean.Core.instAddMessageContextCoreM
code: instance : AddMessageContext CoreM 
goal: Lean.AddMessageContext Lean.CoreM

full_name: Lean.Core.instMonadNameGeneratorCoreM
code: instance : MonadNameGenerator CoreM 
goal: Lean.MonadNameGenerator Lean.CoreM

full_name: Lean.Core.instMonadRecDepthCoreM
code: instance : MonadRecDepth CoreM 
goal: Lean.MonadRecDepth Lean.CoreM

full_name: Lean.Core.instMonadResolveNameCoreM
code: instance : MonadResolveName CoreM 
goal: Lean.MonadResolveName Lean.CoreM

full_name: Lean.Core.withFreshMacroScope
code: protected def withFreshMacroScope (x : CoreM α) : CoreM α 
goal: Lean.CoreM α

full_name: Lean.Core.instMonadQuotationCoreM
code: instance : MonadQuotation CoreM 
goal: Lean.MonadQuotation Lean.CoreM

full_name: Lean.Core.instMonadInfoTreeCoreM
code: instance : Elab.MonadInfoTree CoreM 
goal: Lean.Elab.MonadInfoTree Lean.CoreM

full_name: Lean.Core.modifyCache
code: @[inline] def modifyCache (f : Cache → Cache) : CoreM Unit 
goal: Lean.CoreM Unit

full_name: Lean.Core.modifyInstLevelTypeCache
code: @[inline] def modifyInstLevelTypeCache (f : InstantiateLevelCache → InstantiateLevelCache) : CoreM Unit 
goal: Lean.CoreM Unit

full_name: Lean.Core.modifyInstLevelValueCache
code: @[inline] def modifyInstLevelValueCache (f : InstantiateLevelCache → InstantiateLevelCache) : CoreM Unit 
goal: Lean.CoreM Unit

full_name: Lean.Core.instantiateTypeLevelParams
code: def instantiateTypeLevelParams (c : ConstantInfo) (us : List Level) : CoreM Expr 
goal: Lean.CoreM Lean.Expr

full_name: Lean.Core.instantiateValueLevelParams
code: def instantiateValueLevelParams (c : ConstantInfo) (us : List Level) : CoreM Expr 
goal: Lean.CoreM Lean.Expr

full_name: Lean.Core.liftIOCore
code: @[inline] def liftIOCore (x : IO α) : CoreM α 
goal: Lean.CoreM α

full_name: Lean.Core.instMonadLiftIOCoreM
code: instance : MonadLift IO CoreM 
goal: MonadLift IO Lean.CoreM

full_name: Lean.Core.instMonadTraceCoreM
code: instance : MonadTrace CoreM 
goal: Lean.MonadTrace Lean.CoreM

full_name: Lean.Core.instNonemptySavedState
code: structure SavedState extends State where
  /-- Number of heartbeats passed inside `withRestoreOrSaveFull`, not used otherwise. -/
  passedHearbeats : Nat
deriving Nonempty
goal: Nonempty Lean.Core.SavedState

full_name: Lean.Core.SavedState
code: structure SavedState extends State where
  /-- Number of heartbeats passed inside `withRestoreOrSaveFull`, not used otherwise. -/
  passedHearbeats : Nat
deriving Nonempty
goal: Type

full_name: Lean.Core.SavedState.passedHearbeats
code: structure SavedState extends State where
  /-- Number of heartbeats passed inside `withRestoreOrSaveFull`, not used otherwise. -/
  passedHearbeats : Nat
deriving Nonempty
goal: Nat

full_name: Lean.Core.saveState
code: def saveState : CoreM SavedState 
goal: Lean.CoreM Lean.Core.SavedState

full_name: Lean.Core.withRestoreOrSaveFull
code: /--
Incremental reuse primitive: if `reusableResult?` is `none`, runs `act` and returns its result
together with the saved monadic state after `act` including the heartbeats used by it. If
`reusableResult?` on the other hand is `some (a, state)`, restores full `state` including heartbeats
used and returns `(a, state)`.

The intention is for steps that support incremental reuse to initially pass `none` as
`reusableResult?` and store the result and state in a snapshot. In a further run, if reuse is
possible, `reusableResult?` should be set to the previous result and state, ensuring that the state
after running `withRestoreOrSaveFull` is identical in both runs. Note however that necessarily this
is only an approximation in the case of heartbeats as heartbeats used by `withRestoreOrSaveFull`
itself after calling `act` as well as by reuse-handling code such as the one supplying
`reusableResult?` are not accounted for.
-/
@[specialize] def withRestoreOrSaveFull (reusableResult? : Option (α × SavedState))
    (act : CoreM α) : CoreM (α × SavedState) 
goal: Lean.CoreM (α × Lean.Core.SavedState)

full_name: Lean.Core.SavedState.restore
code: /-- Restore backtrackable parts of the state. -/
def SavedState.restore (b : SavedState) : CoreM Unit 
goal: Lean.CoreM Unit

full_name: _private.«.lake».packages.lean4.src.lean.Lean.CoreM.0.Lean.Core.mkFreshNameImp
code: private def mkFreshNameImp (n : Name) : CoreM Name 
goal: Lean.CoreM Lean.Name

full_name: Lean.Core.mkFreshUserName
code: def mkFreshUserName (n : Name) : CoreM Name 
goal: Lean.CoreM Lean.Name

full_name: Lean.Core.CoreM.run
code: @[inline] def CoreM.run (x : CoreM α) (ctx : Context) (s : State) : EIO Exception (α × State) 
goal: EIO Lean.Exception (α × Lean.Core.State)

full_name: Lean.Core.CoreM.run'
code: @[inline] def CoreM.run' (x : CoreM α) (ctx : Context) (s : State) : EIO Exception α 
goal: EIO Lean.Exception α

full_name: Lean.Core.CoreM.toIO
code: @[inline] def CoreM.toIO (x : CoreM α) (ctx : Context) (s : State) : IO (α × State) 
goal: IO (α × Lean.Core.State)

full_name: Lean.Core.instMetaEvalCoreM
code: instance [MetaEval α] : MetaEval (CoreM α) 
goal: Lean.MetaEval (Lean.CoreM α)

full_name: Lean.Core.withIncRecDepth
code: protected def withIncRecDepth [Monad m] [MonadControlT CoreM m] (x : m α) : m α 
goal: m α

full_name: Lean.Core.initFn._@..lake.packages.lean4.src.lean.Lean.CoreM._hyg.2867
code: builtin_initialize interruptExceptionId : InternalExceptionId ← registerInternalExceptionId `interrupt
goal: IO Lean.InternalExceptionId

full_name: Lean.Core.interruptExceptionId
code: builtin_initialize interruptExceptionId : InternalExceptionId ← registerInternalExceptionId `interrupt
goal: Lean.InternalExceptionId

full_name: Lean.Core.checkInterrupted
code: /--
Throws an internal interrupt exception if cancellation has been requested. The exception is not
caught by `try catch` but is intended to be caught by `Command.withLoggingExceptions` at the top
level of elaboration. In particular, we want to skip producing further incremental snapshots after
the exception has been thrown.
 -/
@[inline] def checkInterrupted : CoreM Unit 
goal: Lean.CoreM Unit

full_name: Lean.Core.debug.moduleNameAtTimeout
code: register_builtin_option debug.moduleNameAtTimeout : Bool := {
  defValue := true
  group    := "debug"
  descr    := "include module name in deterministic timeout error messages.\nRemark: we set this option to false to increase the stability of our test suite"
}
goal: Lean.Option Bool

full_name: Lean.Core.initFn._@..lake.packages.lean4.src.lean.Lean.CoreM._hyg.2982
code: register_builtin_option debug.moduleNameAtTimeout : Bool := {
  defValue := true
  group    := "debug"
  descr    := "include module name in deterministic timeout error messages.\nRemark: we set this option to false to increase the stability of our test suite"
}
goal: IO (Lean.Option Bool)

full_name: Lean.Core.throwMaxHeartbeat
code: def throwMaxHeartbeat (moduleName : Name) (optionName : Name) (max : Nat) : CoreM Unit 
goal: Lean.CoreM Unit

full_name: Lean.Core.checkMaxHeartbeatsCore
code: def checkMaxHeartbeatsCore (moduleName : String) (optionName : Name) (max : Nat) : CoreM Unit 
goal: Lean.CoreM Unit

full_name: Lean.Core.checkMaxHeartbeats
code: def checkMaxHeartbeats (moduleName : String) : CoreM Unit 
goal: Lean.CoreM Unit

full_name: Lean.Core.checkSystem
code: def checkSystem (moduleName : String) : CoreM Unit 
goal: Lean.CoreM Unit

full_name: _private.«.lake».packages.lean4.src.lean.Lean.CoreM.0.Lean.Core.withCurrHeartbeatsImp
code: private def withCurrHeartbeatsImp (x : CoreM α) : CoreM α 
goal: Lean.CoreM α

full_name: Lean.Core.withCurrHeartbeats
code: def withCurrHeartbeats [Monad m] [MonadControlT CoreM m] (x : m α) : m α 
goal: m α

full_name: Lean.Core.setMessageLog
code: def setMessageLog (messages : MessageLog) : CoreM Unit 
goal: Lean.CoreM Unit

full_name: Lean.Core.resetMessageLog
code: def resetMessageLog : CoreM Unit 
goal: Lean.CoreM Unit

full_name: Lean.Core.getMessageLog
code: def getMessageLog : CoreM MessageLog 
goal: Lean.CoreM Lean.MessageLog

full_name: Lean.Core.getAndEmptyMessageLog
code: /--
Returns the current log and then resets its messages while adjusting `MessageLog.hadErrors`. Used
for incremental reporting during elaboration of a single command.
-/
def getAndEmptyMessageLog : CoreM MessageLog 
goal: Lean.CoreM Lean.MessageLog

full_name: Lean.Core.instMonadLogCoreM
code: instance : MonadLog CoreM 
goal: Lean.MonadLog Lean.CoreM

full_name: Lean.withAtLeastMaxRecDepth
code: @[inline] def withAtLeastMaxRecDepth [MonadFunctorT CoreM m] (max : Nat) : m α → m α 
goal: m α → m α

full_name: Lean.catchInternalId
code: @[inline] def catchInternalId [Monad m] [MonadExcept Exception m] (id : InternalExceptionId) (x : m α) (h : Exception → m α) : m α 
goal: m α

full_name: Lean.catchInternalIds
code: @[inline] def catchInternalIds [Monad m] [MonadExcept Exception m] (ids : List InternalExceptionId) (x : m α) (h : Exception → m α) : m α 
goal: m α

full_name: Lean.Exception.isMaxHeartbeat
code: /--
  Return true if `ex` was generated by `throwMaxHeartbeat`.
  This function is a bit hackish. The heartbeat exception should probably be an internal exception.
  We used a similar hack at `Exception.isMaxRecDepth` -/
def Exception.isMaxHeartbeat (ex : Exception) : Bool 
goal: Bool

full_name: Lean.mkArrow
code: /-- Creates the expression `d → b` -/
def mkArrow (d b : Expr) : CoreM Expr 
goal: Lean.CoreM Lean.Expr

full_name: Lean.mkArrowN
code: /-- Iterated `mkArrow`, creates the expression `a₁ → a₂ → … → aₙ → b`. Also see `arrowDomainsN`. -/
def mkArrowN (ds : Array Expr) (e : Expr) : CoreM Expr 
goal: Lean.CoreM Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.CoreM.0.Lean.supportedRecursors
code: private def supportedRecursors 
goal: Array Lean.Name

full_name: _private.«.lake».packages.lean4.src.lean.Lean.CoreM.0.Lean.checkUnsupported
code: /-- This is a temporary workaround for generating better error messages for the compiler. It can be deleted after we
   rewrite the remaining parts of the compiler in Lean.  -/
private def checkUnsupported [Monad m] [MonadEnv m] [MonadError m] (decl : Declaration) : m Unit 
goal: m Unit

full_name: Lean.initFn._@..lake.packages.lean4.src.lean.Lean.CoreM._hyg.4419
code: register_builtin_option compiler.enableNew : Bool := {
  defValue := false
  group    := "compiler"
  descr    := "(compiler) enable the new code generator, this should have no significant effect on your code but it does help to test the new code generator; unset to only use the old code generator instead"
}
goal: IO (Lean.Option Bool)

full_name: Lean.compiler.enableNew
code: register_builtin_option compiler.enableNew : Bool := {
  defValue := false
  group    := "compiler"
  descr    := "(compiler) enable the new code generator, this should have no significant effect on your code but it does help to test the new code generator; unset to only use the old code generator instead"
}
goal: Lean.Option Bool

full_name: Lean.compileDeclsNew
code: @[extern "lean_lcnf_compile_decls"]
opaque compileDeclsNew (declNames : List Name) : CoreM Unit
goal: Lean.CoreM Unit

full_name: Lean.compileDecl
code: def compileDecl (decl : Declaration) : CoreM Unit 
goal: Lean.CoreM Unit

full_name: Lean.compileDecls
code: def compileDecls (decls : List Name) : CoreM Unit 
goal: Lean.CoreM Unit

full_name: Lean.getDiag
code: def getDiag (opts : Options) : Bool 
goal: Bool

full_name: Lean.isDiagnosticsEnabled
code: /-- Return `true` if diagnostic information collection is enabled. -/
def isDiagnosticsEnabled : CoreM Bool 
goal: Lean.CoreM Bool

full_name: Lean.ImportM.runCoreM
code: def ImportM.runCoreM (x : CoreM α) : ImportM α 
goal: Lean.ImportM α

full_name: Lean.Exception.isRuntime
code: /-- Return `true` if the exception was generated by one of our resource limits. -/
def Exception.isRuntime (ex : Exception) : Bool 
goal: Bool

full_name: Lean.Exception.isInterrupt
code: /-- Returns `true` if the exception is an interrupt generated by `checkInterrupted`. -/
def Exception.isInterrupt : Exception → Bool
  
goal: Lean.Exception → Bool

full_name: Lean.Core.tryCatch
code: /--
Custom `try-catch` for all monads based on `CoreM`. We usually don't want to catch "runtime
exceptions" these monads, but on `CommandElabM` or, in specific cases, using `tryCatchRuntimeEx`.
See issues #2775 and #2744 as well as `MonadAlwaysExcept`. Also, we never want to catch interrupt
exceptions inside the elaborator.
-/
@[inline] protected def Core.tryCatch (x : CoreM α) (h : Exception → CoreM α) : CoreM α 
goal: Lean.CoreM α

full_name: Lean.Core.tryCatchRuntimeEx
code: /--
A variant of `tryCatch` that also catches runtime exception (see also `tryCatch` documentation).
Like `tryCatch`, this function does not catch interrupt exceptions, which are not considered runtime
exceptions.
-/
@[inline] protected def Core.tryCatchRuntimeEx (x : CoreM α) (h : Exception → CoreM α) : CoreM α 
goal: Lean.CoreM α

full_name: Lean.instMonadExceptOfExceptionCoreM
code: instance : MonadExceptOf Exception CoreM 
goal: MonadExceptOf Lean.Exception Lean.CoreM

full_name: Lean.MonadRuntimeException.tryCatchRuntimeEx
code: class MonadRuntimeException (m : Type → Type) where
  tryCatchRuntimeEx (body : m α) (handler : Exception → m α) : m α
goal: m α

full_name: Lean.MonadRuntimeException
code: class MonadRuntimeException (m : Type → Type) where
  tryCatchRuntimeEx (body : m α) (handler : Exception → m α) : m α
goal: Type 1

full_name: Lean.instMonadRuntimeExceptionCoreM
code: instance : MonadRuntimeException CoreM 
goal: Lean.MonadRuntimeException Lean.CoreM

full_name: Lean.instMonadRuntimeExceptionReaderT
code: @[inline] instance [MonadRuntimeException m] : MonadRuntimeException (ReaderT ρ m) 
goal: Lean.MonadRuntimeException (ReaderT ρ m)

full_name: Lean.instMonadRuntimeExceptionStateRefT'
code: @[inline] instance [MonadRuntimeException m] : MonadRuntimeException (StateRefT' ω σ m) 
goal: Lean.MonadRuntimeException (StateRefT' ω σ m)

full_name: Lean.mapCoreM
code: @[inline] def mapCoreM [MonadControlT CoreM m] [Monad m] (f : forall {α}, CoreM α → CoreM α) {α} (x : m α) : m α 
goal: m α