Equations
- Lean.Core.getMaxHeartbeats opts = Lean.Option.get opts Lean.Core.maxHeartbeats * 1000
- instLevelType : Lean.Core.InstantiateLevelCache
- instLevelValue : Lean.Core.InstantiateLevelCache
Cache for the CoreM
monad
Instances For
Equations
- Lean.Core.instInhabitedCache = { default := { instLevelType := default, instLevelValue := default } }
Current environment.
env : Lean.EnvironmentNext macro scope. We use macro scopes to avoid accidental name capture.
nextMacroScope : Lean.MacroScopeName generator for producing unique
FVarId
s,MVarId
s, andLMVarId
sngen : Lean.NameGeneratorTrace messages
traceState : Lean.TraceStateCache for instantiating universe polymorphic declarations.
cache : Lean.Core.CacheMessage log.
messages : Lean.MessageLogInfo tree. We have the info tree here because we want to update it while adding attributes.
infoState : Lean.Elab.InfoState
State for the CoreM monad.
Instances For
Name of the file being compiled.
fileName : StringAuxiliary datastructure for converting
String.Pos
into Line/Column number.fileMap : Lean.FileMap- options : Lean.Options
- currRecDepth : Nat
- maxRecDepth : Nat
- ref : Lean.Syntax
- currNamespace : Lean.Name
- openDecls : List Lean.OpenDecl
- initHeartbeats : Nat
- maxHeartbeats : Nat
- currMacroScope : Lean.MacroScope
Context for the CoreM monad.
Instances For
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
Equations
- Lean.Core.instMonadCoreM = let i := inferInstanceAs (Monad Lean.CoreM); Monad.mk
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.Core.instMonadOptionsCoreM = { getOptions := do let __do_lift ← read pure __do_lift.options }
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.Core.instAddMessageContextCoreM = { addMessageContext := Lean.addMessageContextPartial }
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.Core.modifyInstLevelTypeCache f = Lean.Core.modifyCache fun x => match x with | { instLevelType := c₁, instLevelValue := c₂ } => { instLevelType := f c₁, instLevelValue := c₂ }
Equations
- Lean.Core.modifyInstLevelValueCache f = Lean.Core.modifyCache fun x => match x with | { instLevelType := c₁, instLevelValue := c₂ } => { instLevelType := c₁, instLevelValue := f c₂ }
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.Core.liftIOCore x = do let ref ← Lean.getRef liftM (IO.toEIO (fun err => Lean.Exception.error ref (Function.comp Lean.MessageData.ofFormat Std.format (toString err))) x)
Equations
- Lean.Core.instMonadLiftIOCoreM = { monadLift := fun {α} => Lean.Core.liftIOCore }
Equations
- One or more equations did not get rendered due to their size.
Restore backtrackable parts of the state.
Equations
- One or more equations did not get rendered due to their size.
Equations
Equations
- Lean.Core.CoreM.run x ctx s = StateRefT'.run (x ctx) s
Equations
- Lean.Core.CoreM.run' x ctx s = Prod.fst <$> Lean.Core.CoreM.run x ctx s
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.Core.withIncRecDepth x = controlAt Lean.CoreM fun runInBase => Lean.withIncRecDepth (runInBase x)
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.checkMaxHeartbeats moduleName = do let __do_lift ← read Lean.Core.checkMaxHeartbeatsCore moduleName `maxHeartbeats __do_lift.maxHeartbeats
Equations
- Lean.withCurrHeartbeats x = controlAt Lean.CoreM fun runInBase => Lean.Core.withCurrHeartbeatsImp (runInBase x)
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.Core.getMessageLog = do let __do_lift ← get pure __do_lift.messages
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
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
Equations
- One or more equations did not get rendered due to their size.
Creates the expression d → b
Equations
- Lean.mkArrow d b = do let __do_lift ← Lean.mkFreshUserName `x pure (Lean.mkForall __do_lift Lean.BinderInfo.default d b)
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.addAndCompile decl = do Lean.addDecl decl Lean.compileDecl decl
Equations
- One or more equations did not get rendered due to their size.