Documentation

Lean.Environment

constant Lean.EnvExtensionStateSpec :
(α : Type) × Inhabited α
noncomputable def Lean.ModuleIdx :
Type
Equations
structure Lean.Import :
Type
Equations
noncomputable def Lean.CompactedRegion :
Type
Equations
@[extern lean_compacted_region_is_memory_mapped]
@[extern lean_compacted_region_free]
Equations
structure Lean.EnvironmentHeader :
Type
Equations
  • Lean.instInhabitedEnvironmentHeader = { default := { trustLevel := default, quotInit := default, mainModule := default, imports := default, regions := default, moduleNames := default, moduleData := default } }
Equations
Equations
Equations
  • Lean.Environment.setMainModule env m = { const2ModIdx := env.const2ModIdx, constants := env.constants, extensions := env.extensions, header := let src := env.header; { trustLevel := src.trustLevel, quotInit := src.quotInit, mainModule := m, imports := src.imports, regions := src.regions, moduleNames := src.moduleNames, moduleData := src.moduleData } }
Equations
Equations
structure Lean.EnvExtensionInterface :
Type 1
Equations
  • Lean.instInhabitedEnvExtensionInterface = { default := { ext := id, inhabitedExt := fun {σ} => id, registerExt := fun {σ} mk => mk, setState := fun {σ} x env x => env, modifyState := fun {σ} x env x => env, getState := fun {σ} [Inhabited σ] ext x => ext, mkInitialExtStates := pure #[], ensureExtensionsSize := fun env => pure env } }
structure Lean.EnvExtensionInterfaceUnsafe.Ext (σ : Type) :
Type
  • idx : Nat
  • mkInitial : IO σ
Equations
  • Lean.EnvExtensionInterfaceUnsafe.instInhabitedExt = { default := { idx := default, mkInitial := default } }
Equations
@[inline]
Equations
Equations
Equations
Equations
@[implementedBy Lean.EnvExtensionInterfaceUnsafe.imp]
Equations
Equations
structure Lean.PersistentEnvExtensionState (α : Type) (σ : Type) :
Type
@[inline]
abbrev Lean.ImportM (α : Type) :
Type
Equations
structure Lean.PersistentEnvExtension (α : Type) (β : Type) (σ : Type) :
Type
Equations
  • Lean.instInhabitedPersistentEnvExtensionState = { default := { importedEntries := #[], state := default } }
instance Lean.instInhabitedPersistentEnvExtension {α : Type} {β : Type} {σ : Type} [inst : Inhabited σ] :
Equations
  • Lean.instInhabitedPersistentEnvExtension = { default := { toEnvExtension := default, name := default, addImportedFn := fun x => default, addEntryFn := fun s x => s, exportEntriesFn := fun x => #[], statsFn := fun x => Lean.Format.nil } }
def Lean.PersistentEnvExtension.getModuleEntries {α : Type} {β : Type} {σ : Type} [inst : Inhabited σ] (ext : Lean.PersistentEnvExtension α β σ) (env : Lean.Environment) (m : Lean.ModuleIdx) :
Equations
def Lean.PersistentEnvExtension.addEntry {α : Type} {β : Type} {σ : Type} (ext : Lean.PersistentEnvExtension α β σ) (env : Lean.Environment) (b : β) :
Equations
def Lean.PersistentEnvExtension.getState {α : Type} {β : Type} {σ : Type} [inst : Inhabited σ] (ext : Lean.PersistentEnvExtension α β σ) (env : Lean.Environment) :
σ
Equations
def Lean.PersistentEnvExtension.setState {α : Type} {β : Type} {σ : Type} (ext : Lean.PersistentEnvExtension α β σ) (env : Lean.Environment) (s : σ) :
Equations
def Lean.PersistentEnvExtension.modifyState {α : Type} {β : Type} {σ : Type} (ext : Lean.PersistentEnvExtension α β σ) (env : Lean.Environment) (f : σσ) :
Equations
structure Lean.PersistentEnvExtensionDescr (α : Type) (β : Type) (σ : Type) :
Type
unsafe def Lean.registerPersistentEnvExtensionUnsafe {α : Type} {β : Type} {σ : Type} [inst : Inhabited σ] (descr : Lean.PersistentEnvExtensionDescr α β σ) :
Equations
@[implementedBy Lean.registerPersistentEnvExtensionUnsafe]
constant Lean.registerPersistentEnvExtension {α : Type} {β : Type} {σ : Type} [inst : Inhabited σ] (descr : Lean.PersistentEnvExtensionDescr α β σ) :
noncomputable def Lean.SimplePersistentEnvExtension (α : Type) (σ : Type) :
Type
Equations
@[specialize]
def Lean.mkStateFromImportedEntries {α : Type} {σ : Type} (addEntryFn : σασ) (initState : σ) (as : Array (Array α)) :
σ
Equations
structure Lean.SimplePersistentEnvExtensionDescr (α : Type) (σ : Type) :
Type
Equations
Equations
Equations
Equations
Equations
Equations
Equations
Equations
def Lean.MapDeclarationExtension.find? {α : Type} [inst : Inhabited α] (ext : Lean.MapDeclarationExtension α) (env : Lean.Environment) (declName : Lean.Name) :
Equations
Equations
@[extern lean_save_module_data]
constant Lean.saveModuleData (fname : System.FilePath) (mod : Lean.Name) (data : Lean.ModuleData) :
@[extern lean_read_module_data]
@[noinline]
Equations
Equations
@[extern 2lean_update_env_attributes]
@[extern 1lean_get_num_attributes]
structure Lean.ImportState :
Type
def Lean.importModules (imports : List Lean.Import) (opts : Lean.Options) (trustLevel : optParam UInt32 0) :
Equations
unsafe def Lean.withImportModules {α : Type} (imports : List Lean.Import) (opts : Lean.Options) (trustLevel : optParam UInt32 0) (x : Lean.EnvironmentIO α) :
IO α
Equations
Equations
@[extern lean_eval_const]
unsafe constant Lean.Environment.evalConst (α : Type u_1) (env : Lean.Environment) (opts : Lean.Options) (constName : Lean.Name) :
unsafe def Lean.Environment.evalConstCheck (α : Type) (env : Lean.Environment) (opts : Lean.Options) (typeName : Lean.Name) (constName : Lean.Name) :
Equations
Equations
@[extern lean_kernel_is_def_eq]
@[extern lean_kernel_whnf]
instance Lean.instMonadEnv (m : TypeType) (n : TypeType) [inst : MonadLift m n] [inst : Lean.MonadEnv m] :
Equations
def Lean.mkBaseNameFor (env : Lean.Environment) (declName : Lean.Name) (elemSuffix : Lean.Name) (suffix : Lean.Name) :
Equations
partial def Lean.mkBaseNameFor.go (env : Lean.Environment) (declName : Lean.Name) (elemSuffix : Lean.Name) (suffix : Lean.Name) (idx : Nat) :