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

full_name: Lean.instInhabitedReducibilityStatus
code: /--
Reducibility status for a definition.
-/
inductive ReducibilityStatus where
  | reducible | semireducible | irreducible
  deriving Inhabited, Repr, BEq
goal: Inhabited Lean.ReducibilityStatus

full_name: Lean.ReducibilityStatus.reducible
code: /--
Reducibility status for a definition.
-/
inductive ReducibilityStatus where
  | reducible | semireducible | irreducible
  deriving Inhabited, Repr, BEq
goal: Lean.ReducibilityStatus

full_name: Lean.ReducibilityStatus.irreducible
code: /--
Reducibility status for a definition.
-/
inductive ReducibilityStatus where
  | reducible | semireducible | irreducible
  deriving Inhabited, Repr, BEq
goal: Lean.ReducibilityStatus

full_name: Lean.ReducibilityStatus.semireducible
code: /--
Reducibility status for a definition.
-/
inductive ReducibilityStatus where
  | reducible | semireducible | irreducible
  deriving Inhabited, Repr, BEq
goal: Lean.ReducibilityStatus

full_name: Lean.ReducibilityStatus
code: /--
Reducibility status for a definition.
-/
inductive ReducibilityStatus where
  | reducible | semireducible | irreducible
  deriving Inhabited, Repr, BEq
goal: Type

full_name: Lean.instReprReducibilityStatus
code: /--
Reducibility status for a definition.
-/
inductive ReducibilityStatus where
  | reducible | semireducible | irreducible
  deriving Inhabited, Repr, BEq
goal: Repr Lean.ReducibilityStatus

full_name: Lean.instBEqReducibilityStatus
code: BEq
goal: BEq Lean.ReducibilityStatus

full_name: Lean.ReducibilityStatus.toAttrString
code: def ReducibilityStatus.toAttrString : ReducibilityStatus → String
  
goal: Lean.ReducibilityStatus → String

full_name: Lean.initFn._@..lake.packages.lean4.src.lean.Lean.ReducibilityAttrs._hyg.186
code: builtin_initialize reducibilityCoreExt : PersistentEnvExtension (Name × ReducibilityStatus) (Name × ReducibilityStatus) (NameMap ReducibilityStatus) ←
  registerPersistentEnvExtension {
    name            := `reducibilityCore
    mkInitial       := pure {}
    addImportedFn   := fun _ _ => pure {}
    addEntryFn      := fun (s : NameMap ReducibilityStatus) (p : Name × ReducibilityStatus) => s.insert p.1 p.2
    exportEntriesFn := fun m =>
      let r : Array (Name × ReducibilityStatus) := m.fold (fun a n p => a.push (n, p)) #[]
      r.qsort (fun a b => Name.quickLt a.1 b.1)
    statsFn         := fun s => "reducibility attribute core extension" ++ Format.line ++ "number of local entries: " ++ format s.size
  }
goal: IO
  (Lean.PersistentEnvExtension (Lean.Name × Lean.ReducibilityStatus) (Lean.Name × Lean.ReducibilityStatus)
    (Lean.NameMap Lean.ReducibilityStatus))

full_name: Lean.reducibilityCoreExt
code: builtin_initialize reducibilityCoreExt : PersistentEnvExtension (Name × ReducibilityStatus) (Name × ReducibilityStatus) (NameMap ReducibilityStatus) ←
  registerPersistentEnvExtension {
    name            := `reducibilityCore
    mkInitial       := pure {}
    addImportedFn   := fun _ _ => pure {}
    addEntryFn      := fun (s : NameMap ReducibilityStatus) (p : Name × ReducibilityStatus) => s.insert p.1 p.2
    exportEntriesFn := fun m =>
      let r : Array (Name × ReducibilityStatus) := m.fold (fun a n p => a.push (n, p)) #[]
      r.qsort (fun a b => Name.quickLt a.1 b.1)
    statsFn         := fun s => "reducibility attribute core extension" ++ Format.line ++ "number of local entries: " ++ format s.size
  }
goal: Lean.PersistentEnvExtension (Lean.Name × Lean.ReducibilityStatus) (Lean.Name × Lean.ReducibilityStatus)
  (Lean.NameMap Lean.ReducibilityStatus)

full_name: Lean.reducibilityExtraExt
code: builtin_initialize reducibilityExtraExt : SimpleScopedEnvExtension (Name × ReducibilityStatus) (SMap Name ReducibilityStatus) ←
  registerSimpleScopedEnvExtension {
    name := `reducibilityExtra
    initial := {}
    addEntry := fun d (declName, status) => d.insert declName status
    finalizeImport := fun d => d.switch
  }
goal: Lean.SimpleScopedEnvExtension (Lean.Name × Lean.ReducibilityStatus) (Lean.SMap Lean.Name Lean.ReducibilityStatus)

full_name: Lean.initFn._@..lake.packages.lean4.src.lean.Lean.ReducibilityAttrs._hyg.335
code: builtin_initialize reducibilityExtraExt : SimpleScopedEnvExtension (Name × ReducibilityStatus) (SMap Name ReducibilityStatus) ←
  registerSimpleScopedEnvExtension {
    name := `reducibilityExtra
    initial := {}
    addEntry := fun d (declName, status) => d.insert declName status
    finalizeImport := fun d => d.switch
  }
goal: IO (Lean.SimpleScopedEnvExtension (Lean.Name × Lean.ReducibilityStatus) (Lean.SMap Lean.Name Lean.ReducibilityStatus))

full_name: Lean.getReducibilityStatusCore
code: @[export lean_get_reducibility_status]
def getReducibilityStatusCore (env : Environment) (declName : Name) : ReducibilityStatus 
goal: Lean.ReducibilityStatus

full_name: _private.«.lake».packages.lean4.src.lean.Lean.ReducibilityAttrs.0.Lean.setReducibilityStatusCore
code: private def setReducibilityStatusCore (env : Environment) (declName : Name) (status : ReducibilityStatus) (attrKind : AttributeKind) (currNamespace : Name) : Environment 
goal: Lean.Environment

full_name: _private.«.lake».packages.lean4.src.lean.Lean.ReducibilityAttrs.0.Lean.setReducibilityStatusImp
code: @[export lean_set_reducibility_status]
private def setReducibilityStatusImp (env : Environment) (declName : Name) (status : ReducibilityStatus) : Environment 
goal: Lean.Environment

full_name: Lean.allowUnsafeReducibility
code: register_builtin_option allowUnsafeReducibility : Bool := {
  defValue := false
  descr    := "enables users to modify the reducibility settings for declarations even when such changes are deemed potentially hazardous. For example, `simp` and type class resolution maintain term indices where reducible declarations are expanded."
}
goal: Lean.Option Bool

full_name: Lean.initFn._@..lake.packages.lean4.src.lean.Lean.ReducibilityAttrs._hyg.615
code: register_builtin_option allowUnsafeReducibility : Bool := {
  defValue := false
  descr    := "enables users to modify the reducibility settings for declarations even when such changes are deemed potentially hazardous. For example, `simp` and type class resolution maintain term indices where reducible declarations are expanded."
}
goal: IO (Lean.Option Bool)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.ReducibilityAttrs.0.Lean.validate
code: private def validate (declName : Name) (status : ReducibilityStatus) (attrKind : AttributeKind) : CoreM Unit 
goal: Lean.CoreM Unit

full_name: _private.«.lake».packages.lean4.src.lean.Lean.ReducibilityAttrs.0.Lean.addAttr
code: private def addAttr (status : ReducibilityStatus) (declName : Name) (stx : Syntax) (attrKind : AttributeKind) : AttrM Unit 
goal: Lean.AttrM Unit

full_name: Lean.initFn._@..lake.packages.lean4.src.lean.Lean.ReducibilityAttrs._hyg.1381
code: builtin_initialize
  registerBuiltinAttribute {
    ref             := by exact decl_name%
    name            := `irreducible
    descr           := "irreducible declaration"
    add             := addAttr .irreducible
    applicationTime := .afterTypeChecking
 }
goal: IO Unit

full_name: Lean.initFn._@..lake.packages.lean4.src.lean.Lean.ReducibilityAttrs._hyg.1433
code: builtin_initialize
  registerBuiltinAttribute {
    ref             := by exact decl_name%
    name            := `reducible
    descr           := "reducible declaration"
    add             := addAttr .reducible
    applicationTime := .afterTypeChecking
 }
goal: IO Unit

full_name: Lean.initFn._@..lake.packages.lean4.src.lean.Lean.ReducibilityAttrs._hyg.1485
code: builtin_initialize
  registerBuiltinAttribute {
    ref             := by exact decl_name%
    name            := `semireducible
    descr           := "semireducible declaration"
    add             := addAttr .semireducible
    applicationTime := .afterTypeChecking
 }
goal: IO Unit

full_name: Lean.getReducibilityStatus
code: /-- Return the reducibility attribute for the given declaration. -/
def getReducibilityStatus [Monad m] [MonadEnv m] (declName : Name) : m ReducibilityStatus 
goal: m Lean.ReducibilityStatus

full_name: Lean.setReducibilityStatus
code: /-- Set the reducibility attribute for the given declaration. -/
def setReducibilityStatus [MonadEnv m] (declName : Name) (s : ReducibilityStatus) : m Unit 
goal: m Unit

full_name: Lean.setReducibleAttribute
code: /-- Set the given declaration as `[reducible]` -/
def setReducibleAttribute [MonadEnv m] (declName : Name) : m Unit 
goal: m Unit

full_name: Lean.isReducible
code: /-- Return `true` if the given declaration has been marked as `[reducible]`. -/
def isReducible [Monad m] [MonadEnv m] (declName : Name) : m Bool 
goal: m Bool

full_name: Lean.isIrreducible
code: /-- Return `true` if the given declaration has been marked as `[irreducible]` -/
def isIrreducible [Monad m] [MonadEnv m] (declName : Name) : m Bool 
goal: m Bool

full_name: Lean.setIrreducibleAttribute
code: /-- Set the given declaration as `[irreducible]` -/
def setIrreducibleAttribute [MonadEnv m] (declName : Name) : m Unit 
goal: m Unit