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

full_name: Lean.KeyedDeclsAttribute.Key
code: abbrev Key 
goal: Type

full_name: Lean.KeyedDeclsAttribute.Def.descr
code: /--
`KeyedDeclsAttribute` definition.

 Important: `mkConst valueTypeName` and `γ` must be definitionally equal. -/
structure Def (γ : Type) where
  /-- Builtin attribute name, if any (e.g., `builtin_term_elab) -/
  builtinName   : Name := Name.anonymous
  /-- Attribute name (e.g., `term_elab) -/
  name          : Name
  /-- Attribute description -/
  descr         : String
  valueTypeName : Name
  /-- Convert `Syntax` into a `Key`, the default implementation expects an identifier. -/
  evalKey (builtin : Bool) (stx : Syntax) : AttrM Key := do
    let stx ← Attribute.Builtin.getIdent stx
    let kind := stx.getId
    if (← getEnv).contains kind && (← Elab.getInfoState).enabled then
      Elab.addConstInfo stx kind none
    pure kind
  onAdded (builtin : Bool) (declName : Name) : AttrM Unit := pure ()
  deriving Inhabited
goal: String

full_name: Lean.KeyedDeclsAttribute.instInhabitedDef
code: /--
`KeyedDeclsAttribute` definition.

 Important: `mkConst valueTypeName` and `γ` must be definitionally equal. -/
structure Def (γ : Type) where
  /-- Builtin attribute name, if any (e.g., `builtin_term_elab) -/
  builtinName   : Name := Name.anonymous
  /-- Attribute name (e.g., `term_elab) -/
  name          : Name
  /-- Attribute description -/
  descr         : String
  valueTypeName : Name
  /-- Convert `Syntax` into a `Key`, the default implementation expects an identifier. -/
  evalKey (builtin : Bool) (stx : Syntax) : AttrM Key := do
    let stx ← Attribute.Builtin.getIdent stx
    let kind := stx.getId
    if (← getEnv).contains kind && (← Elab.getInfoState).enabled then
      Elab.addConstInfo stx kind none
    pure kind
  onAdded (builtin : Bool) (declName : Name) : AttrM Unit := pure ()
  deriving Inhabited
goal: {a : Type} → Inhabited (Lean.KeyedDeclsAttribute.Def a)

full_name: Lean.KeyedDeclsAttribute.Def.valueTypeName
code: /--
`KeyedDeclsAttribute` definition.

 Important: `mkConst valueTypeName` and `γ` must be definitionally equal. -/
structure Def (γ : Type) where
  /-- Builtin attribute name, if any (e.g., `builtin_term_elab) -/
  builtinName   : Name := Name.anonymous
  /-- Attribute name (e.g., `term_elab) -/
  name          : Name
  /-- Attribute description -/
  descr         : String
  valueTypeName : Name
  /-- Convert `Syntax` into a `Key`, the default implementation expects an identifier. -/
  evalKey (builtin : Bool) (stx : Syntax) : AttrM Key := do
    let stx ← Attribute.Builtin.getIdent stx
    let kind := stx.getId
    if (← getEnv).contains kind && (← Elab.getInfoState).enabled then
      Elab.addConstInfo stx kind none
    pure kind
  onAdded (builtin : Bool) (declName : Name) : AttrM Unit := pure ()
  deriving Inhabited
goal: Lean.Name

full_name: Lean.KeyedDeclsAttribute.Def.builtinName
code: /--
`KeyedDeclsAttribute` definition.

 Important: `mkConst valueTypeName` and `γ` must be definitionally equal. -/
structure Def (γ : Type) where
  /-- Builtin attribute name, if any (e.g., `builtin_term_elab) -/
  builtinName   : Name := Name.anonymous
  /-- Attribute name (e.g., `term_elab) -/
  name          : Name
  /-- Attribute description -/
  descr         : String
  valueTypeName : Name
  /-- Convert `Syntax` into a `Key`, the default implementation expects an identifier. -/
  evalKey (builtin : Bool) (stx : Syntax) : AttrM Key := do
    let stx ← Attribute.Builtin.getIdent stx
    let kind := stx.getId
    if (← getEnv).contains kind && (← Elab.getInfoState).enabled then
      Elab.addConstInfo stx kind none
    pure kind
  onAdded (builtin : Bool) (declName : Name) : AttrM Unit := pure ()
  deriving Inhabited
goal: Lean.Name

full_name: Lean.KeyedDeclsAttribute.Def.evalKey
code: /--
`KeyedDeclsAttribute` definition.

 Important: `mkConst valueTypeName` and `γ` must be definitionally equal. -/
structure Def (γ : Type) where
  /-- Builtin attribute name, if any (e.g., `builtin_term_elab) -/
  builtinName   : Name := Name.anonymous
  /-- Attribute name (e.g., `term_elab) -/
  name          : Name
  /-- Attribute description -/
  descr         : String
  valueTypeName : Name
  /-- Convert `Syntax` into a `Key`, the default implementation expects an identifier. -/
  evalKey (builtin : Bool) (stx : Syntax) : AttrM Key := do
    let stx ← Attribute.Builtin.getIdent stx
    let kind := stx.getId
    if (← getEnv).contains kind && (← Elab.getInfoState).enabled then
      Elab.addConstInfo stx kind none
    pure kind
  onAdded (builtin : Bool) (declName : Name) : AttrM Unit := pure ()
  deriving Inhabited
goal: Lean.AttrM Lean.KeyedDeclsAttribute.Key

full_name: Lean.KeyedDeclsAttribute.Def.name
code: /--
`KeyedDeclsAttribute` definition.

 Important: `mkConst valueTypeName` and `γ` must be definitionally equal. -/
structure Def (γ : Type) where
  /-- Builtin attribute name, if any (e.g., `builtin_term_elab) -/
  builtinName   : Name := Name.anonymous
  /-- Attribute name (e.g., `term_elab) -/
  name          : Name
  /-- Attribute description -/
  descr         : String
  valueTypeName : Name
  /-- Convert `Syntax` into a `Key`, the default implementation expects an identifier. -/
  evalKey (builtin : Bool) (stx : Syntax) : AttrM Key := do
    let stx ← Attribute.Builtin.getIdent stx
    let kind := stx.getId
    if (← getEnv).contains kind && (← Elab.getInfoState).enabled then
      Elab.addConstInfo stx kind none
    pure kind
  onAdded (builtin : Bool) (declName : Name) : AttrM Unit := pure ()
  deriving Inhabited
goal: Lean.Name

full_name: Lean.KeyedDeclsAttribute.Def
code: /--
`KeyedDeclsAttribute` definition.

 Important: `mkConst valueTypeName` and `γ` must be definitionally equal. -/
structure Def (γ : Type) where
  /-- Builtin attribute name, if any (e.g., `builtin_term_elab) -/
  builtinName   : Name := Name.anonymous
  /-- Attribute name (e.g., `term_elab) -/
  name          : Name
  /-- Attribute description -/
  descr         : String
  valueTypeName : Name
  /-- Convert `Syntax` into a `Key`, the default implementation expects an identifier. -/
  evalKey (builtin : Bool) (stx : Syntax) : AttrM Key := do
    let stx ← Attribute.Builtin.getIdent stx
    let kind := stx.getId
    if (← getEnv).contains kind && (← Elab.getInfoState).enabled then
      Elab.addConstInfo stx kind none
    pure kind
  onAdded (builtin : Bool) (declName : Name) : AttrM Unit := pure ()
  deriving Inhabited
goal: Type

full_name: Lean.KeyedDeclsAttribute.Def.onAdded
code: /--
`KeyedDeclsAttribute` definition.

 Important: `mkConst valueTypeName` and `γ` must be definitionally equal. -/
structure Def (γ : Type) where
  /-- Builtin attribute name, if any (e.g., `builtin_term_elab) -/
  builtinName   : Name := Name.anonymous
  /-- Attribute name (e.g., `term_elab) -/
  name          : Name
  /-- Attribute description -/
  descr         : String
  valueTypeName : Name
  /-- Convert `Syntax` into a `Key`, the default implementation expects an identifier. -/
  evalKey (builtin : Bool) (stx : Syntax) : AttrM Key := do
    let stx ← Attribute.Builtin.getIdent stx
    let kind := stx.getId
    if (← getEnv).contains kind && (← Elab.getInfoState).enabled then
      Elab.addConstInfo stx kind none
    pure kind
  onAdded (builtin : Bool) (declName : Name) : AttrM Unit := pure ()
  deriving Inhabited
goal: Lean.AttrM Unit

full_name: Lean.KeyedDeclsAttribute.OLeanEntry.key
code: structure OLeanEntry where
  key      : Key
  /-- Name of a declaration stored in the environment which has type `mkConst Def.valueTypeName`. -/
  declName : Name
  deriving Inhabited
goal: Lean.KeyedDeclsAttribute.Key

full_name: Lean.KeyedDeclsAttribute.instInhabitedOLeanEntry
code: structure OLeanEntry where
  key      : Key
  /-- Name of a declaration stored in the environment which has type `mkConst Def.valueTypeName`. -/
  declName : Name
  deriving Inhabited
goal: Inhabited Lean.KeyedDeclsAttribute.OLeanEntry

full_name: Lean.KeyedDeclsAttribute.OLeanEntry
code: structure OLeanEntry where
  key      : Key
  /-- Name of a declaration stored in the environment which has type `mkConst Def.valueTypeName`. -/
  declName : Name
  deriving Inhabited
goal: Type

full_name: Lean.KeyedDeclsAttribute.OLeanEntry.declName
code: structure OLeanEntry where
  key      : Key
  /-- Name of a declaration stored in the environment which has type `mkConst Def.valueTypeName`. -/
  declName : Name
  deriving Inhabited
goal: Lean.Name

full_name: Lean.KeyedDeclsAttribute.AttributeEntry
code: structure AttributeEntry (γ : Type) extends OLeanEntry where
  /-- Recall that we cannot store `γ` into .olean files because it is a closure.
     Given `OLeanEntry.declName`, we convert it into a `γ` by using the unsafe function `evalConstCheck`. -/
  value : γ
goal: Type

full_name: Lean.KeyedDeclsAttribute.AttributeEntry.value
code: structure AttributeEntry (γ : Type) extends OLeanEntry where
  /-- Recall that we cannot store `γ` into .olean files because it is a closure.
     Given `OLeanEntry.declName`, we convert it into a `γ` by using the unsafe function `evalConstCheck`. -/
  value : γ
goal: γ

full_name: Lean.KeyedDeclsAttribute.Table
code: abbrev Table (γ : Type) 
goal: Type

full_name: Lean.KeyedDeclsAttribute.ExtensionState
code: structure ExtensionState (γ : Type) where
  newEntries : List OLeanEntry := []
  table      : Table γ := {}
  declNames  : PHashSet Name := {}
  erased     : PHashSet Name := {}
  deriving Inhabited
goal: Type

full_name: Lean.KeyedDeclsAttribute.ExtensionState.table
code: structure ExtensionState (γ : Type) where
  newEntries : List OLeanEntry := []
  table      : Table γ := {}
  declNames  : PHashSet Name := {}
  erased     : PHashSet Name := {}
  deriving Inhabited
goal: Lean.KeyedDeclsAttribute.Table γ

full_name: Lean.KeyedDeclsAttribute.ExtensionState.declNames
code: structure ExtensionState (γ : Type) where
  newEntries : List OLeanEntry := []
  table      : Table γ := {}
  declNames  : PHashSet Name := {}
  erased     : PHashSet Name := {}
  deriving Inhabited
goal: Lean.PHashSet Lean.Name

full_name: Lean.KeyedDeclsAttribute.instInhabitedExtensionState
code: structure ExtensionState (γ : Type) where
  newEntries : List OLeanEntry := []
  table      : Table γ := {}
  declNames  : PHashSet Name := {}
  erased     : PHashSet Name := {}
  deriving Inhabited
goal: {a : Type} → Inhabited (Lean.KeyedDeclsAttribute.ExtensionState a)

full_name: Lean.KeyedDeclsAttribute.ExtensionState.newEntries
code: structure ExtensionState (γ : Type) where
  newEntries : List OLeanEntry := []
  table      : Table γ := {}
  declNames  : PHashSet Name := {}
  erased     : PHashSet Name := {}
  deriving Inhabited
goal: List Lean.KeyedDeclsAttribute.OLeanEntry

full_name: Lean.KeyedDeclsAttribute.ExtensionState.erased
code: structure ExtensionState (γ : Type) where
  newEntries : List OLeanEntry := []
  table      : Table γ := {}
  declNames  : PHashSet Name := {}
  erased     : PHashSet Name := {}
  deriving Inhabited
goal: Lean.PHashSet Lean.Name

full_name: Lean.KeyedDeclsAttribute.Extension
code: abbrev Extension (γ : Type) 
goal: Type

full_name: Lean.KeyedDeclsAttribute.defn
code: structure KeyedDeclsAttribute (γ : Type) where
  defn : KeyedDeclsAttribute.Def γ
  -- imported/builtin instances
  tableRef : IO.Ref (KeyedDeclsAttribute.Table γ)
  -- instances from current module
  ext : KeyedDeclsAttribute.Extension γ
  deriving Nonempty
goal: Lean.KeyedDeclsAttribute.Def γ

full_name: Lean.KeyedDeclsAttribute.ext
code: structure KeyedDeclsAttribute (γ : Type) where
  defn : KeyedDeclsAttribute.Def γ
  -- imported/builtin instances
  tableRef : IO.Ref (KeyedDeclsAttribute.Table γ)
  -- instances from current module
  ext : KeyedDeclsAttribute.Extension γ
  deriving Nonempty
goal: Lean.KeyedDeclsAttribute.Extension γ

full_name: Lean.KeyedDeclsAttribute.tableRef
code: structure KeyedDeclsAttribute (γ : Type) where
  defn : KeyedDeclsAttribute.Def γ
  -- imported/builtin instances
  tableRef : IO.Ref (KeyedDeclsAttribute.Table γ)
  -- instances from current module
  ext : KeyedDeclsAttribute.Extension γ
  deriving Nonempty
goal: IO.Ref (Lean.KeyedDeclsAttribute.Table γ)

full_name: Lean.KeyedDeclsAttribute
code: structure KeyedDeclsAttribute (γ : Type) where
  defn : KeyedDeclsAttribute.Def γ
  -- imported/builtin instances
  tableRef : IO.Ref (KeyedDeclsAttribute.Table γ)
  -- instances from current module
  ext : KeyedDeclsAttribute.Extension γ
  deriving Nonempty
goal: Type

full_name: Lean.instNonemptyKeyedDeclsAttribute
code: structure KeyedDeclsAttribute (γ : Type) where
  defn : KeyedDeclsAttribute.Def γ
  -- imported/builtin instances
  tableRef : IO.Ref (KeyedDeclsAttribute.Table γ)
  -- instances from current module
  ext : KeyedDeclsAttribute.Extension γ
  deriving Nonempty
goal: ∀ {γ : Type}, Nonempty (Lean.KeyedDeclsAttribute γ)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.KeyedDeclsAttribute.0.Lean.KeyedDeclsAttribute.Table.insert
code: private def Table.insert (table : Table γ) (v : AttributeEntry γ) : Table γ 
goal: Lean.KeyedDeclsAttribute.Table γ

full_name: Lean.KeyedDeclsAttribute.ExtensionState.insert
code: def ExtensionState.insert (s : ExtensionState γ) (v : AttributeEntry γ) :  ExtensionState γ 
goal: Lean.KeyedDeclsAttribute.ExtensionState γ

full_name: Lean.KeyedDeclsAttribute.addBuiltin
code: def addBuiltin (attr : KeyedDeclsAttribute γ) (key : Key) (declName : Name) (value : γ) : IO Unit 
goal: IO Unit

full_name: Lean.KeyedDeclsAttribute.mkStateOfTable
code: def mkStateOfTable (table : Table γ) : ExtensionState γ 
goal: Lean.KeyedDeclsAttribute.ExtensionState γ

full_name: Lean.KeyedDeclsAttribute.ExtensionState.erase
code: def ExtensionState.erase (s : ExtensionState γ) (attrName : Name) (declName : Name) : CoreM (ExtensionState γ) 
goal: Lean.CoreM (Lean.KeyedDeclsAttribute.ExtensionState γ)

full_name: Lean.KeyedDeclsAttribute.init
code: protected unsafe def init {γ} (df : Def γ) (attrDeclName : Name := by exact decl_name%) : IO (KeyedDeclsAttribute γ) 
goal: IO (Lean.KeyedDeclsAttribute γ)

full_name: Lean.KeyedDeclsAttribute.getEntries
code: /-- Retrieve entries tagged with `[attr key]` or `[builtinAttr key]`. -/
def getEntries {γ} (attr : KeyedDeclsAttribute γ) (env : Environment) (key : Name) : List (AttributeEntry γ) 
goal: List (Lean.KeyedDeclsAttribute.AttributeEntry γ)

full_name: Lean.KeyedDeclsAttribute.getValues
code: /-- Retrieve values tagged with `[attr key]` or `[builtinAttr key]`. -/
def getValues {γ} (attr : KeyedDeclsAttribute γ) (env : Environment) (key : Name) : List γ 
goal: List γ