File: .lake/packages/lean4/src/lean/Lean/PrettyPrinter/Delaborator/Basic.lean

full_name: Lean.PrettyPrinter.Delaborator.Context.currNamespace
code: structure Context where
  optionsPerPos  : OptionsPerPos
  currNamespace  : Name
  openDecls      : List OpenDecl
  inPattern      : Bool := false -- true when delaborating `match` patterns
  subExpr        : SubExpr
  /-- Current recursion depth during delaboration. Used by the `pp.deepTerms false` option. -/
  depth          : Nat := 0
goal: Lean.Name

full_name: Lean.PrettyPrinter.Delaborator.Context.depth
code: structure Context where
  optionsPerPos  : OptionsPerPos
  currNamespace  : Name
  openDecls      : List OpenDecl
  inPattern      : Bool := false -- true when delaborating `match` patterns
  subExpr        : SubExpr
  /-- Current recursion depth during delaboration. Used by the `pp.deepTerms false` option. -/
  depth          : Nat := 0
goal: Nat

full_name: Lean.PrettyPrinter.Delaborator.Context.openDecls
code: structure Context where
  optionsPerPos  : OptionsPerPos
  currNamespace  : Name
  openDecls      : List OpenDecl
  inPattern      : Bool := false -- true when delaborating `match` patterns
  subExpr        : SubExpr
  /-- Current recursion depth during delaboration. Used by the `pp.deepTerms false` option. -/
  depth          : Nat := 0
goal: List Lean.OpenDecl

full_name: Lean.PrettyPrinter.Delaborator.Context.subExpr
code: structure Context where
  optionsPerPos  : OptionsPerPos
  currNamespace  : Name
  openDecls      : List OpenDecl
  inPattern      : Bool := false -- true when delaborating `match` patterns
  subExpr        : SubExpr
  /-- Current recursion depth during delaboration. Used by the `pp.deepTerms false` option. -/
  depth          : Nat := 0
goal: Lean.SubExpr

full_name: Lean.PrettyPrinter.Delaborator.Context.inPattern
code: structure Context where
  optionsPerPos  : OptionsPerPos
  currNamespace  : Name
  openDecls      : List OpenDecl
  inPattern      : Bool := false -- true when delaborating `match` patterns
  subExpr        : SubExpr
  /-- Current recursion depth during delaboration. Used by the `pp.deepTerms false` option. -/
  depth          : Nat := 0
goal: Bool

full_name: Lean.PrettyPrinter.Delaborator.Context.optionsPerPos
code: structure Context where
  optionsPerPos  : OptionsPerPos
  currNamespace  : Name
  openDecls      : List OpenDecl
  inPattern      : Bool := false -- true when delaborating `match` patterns
  subExpr        : SubExpr
  /-- Current recursion depth during delaboration. Used by the `pp.deepTerms false` option. -/
  depth          : Nat := 0
goal: Lean.PrettyPrinter.Delaborator.OptionsPerPos

full_name: Lean.PrettyPrinter.Delaborator.Context
code: structure Context where
  optionsPerPos  : OptionsPerPos
  currNamespace  : Name
  openDecls      : List OpenDecl
  inPattern      : Bool := false -- true when delaborating `match` patterns
  subExpr        : SubExpr
  /-- Current recursion depth during delaboration. Used by the `pp.deepTerms false` option. -/
  depth          : Nat := 0
goal: Type

full_name: Lean.PrettyPrinter.Delaborator.State
code: structure State where
  /-- The number of `delab` steps so far. Used by `pp.maxSteps` to stop delaboration. -/
  steps : Nat := 0
  /-- We attach `Elab.Info` at various locations in the `Syntax` output in order to convey
  its semantics. While the elaborator emits `InfoTree`s, here we have no real text location tree
  to traverse, so we use a flattened map. -/
  infos    : PosMap Info := {}
  /-- See `SubExpr.nextExtraPos`. -/
  holeIter : SubExpr.HoleIterator := {}
goal: Type

full_name: Lean.PrettyPrinter.Delaborator.State.holeIter
code: structure State where
  /-- The number of `delab` steps so far. Used by `pp.maxSteps` to stop delaboration. -/
  steps : Nat := 0
  /-- We attach `Elab.Info` at various locations in the `Syntax` output in order to convey
  its semantics. While the elaborator emits `InfoTree`s, here we have no real text location tree
  to traverse, so we use a flattened map. -/
  infos    : PosMap Info := {}
  /-- See `SubExpr.nextExtraPos`. -/
  holeIter : SubExpr.HoleIterator := {}
goal: Lean.PrettyPrinter.Delaborator.SubExpr.HoleIterator

full_name: Lean.PrettyPrinter.Delaborator.State.steps
code: structure State where
  /-- The number of `delab` steps so far. Used by `pp.maxSteps` to stop delaboration. -/
  steps : Nat := 0
  /-- We attach `Elab.Info` at various locations in the `Syntax` output in order to convey
  its semantics. While the elaborator emits `InfoTree`s, here we have no real text location tree
  to traverse, so we use a flattened map. -/
  infos    : PosMap Info := {}
  /-- See `SubExpr.nextExtraPos`. -/
  holeIter : SubExpr.HoleIterator := {}
goal: Nat

full_name: Lean.PrettyPrinter.Delaborator.State.infos
code: structure State where
  /-- The number of `delab` steps so far. Used by `pp.maxSteps` to stop delaboration. -/
  steps : Nat := 0
  /-- We attach `Elab.Info` at various locations in the `Syntax` output in order to convey
  its semantics. While the elaborator emits `InfoTree`s, here we have no real text location tree
  to traverse, so we use a flattened map. -/
  infos    : PosMap Info := {}
  /-- See `SubExpr.nextExtraPos`. -/
  holeIter : SubExpr.HoleIterator := {}
goal: Lean.SubExpr.PosMap Lean.Elab.Info

full_name: Lean.PrettyPrinter.Delaborator.delabFailureId
code: builtin_initialize delabFailureId : InternalExceptionId ← registerInternalExceptionId `delabFailure
goal: Lean.InternalExceptionId

full_name: Lean.PrettyPrinter.Delaborator.initFn._@..lake.packages.lean4.src.lean.Lean.PrettyPrinter.Delaborator.Basic._hyg.106
code: builtin_initialize delabFailureId : InternalExceptionId ← registerInternalExceptionId `delabFailure
goal: IO Lean.InternalExceptionId

full_name: Lean.PrettyPrinter.Delaborator.DelabM
code: abbrev DelabM 
goal: Type

full_name: Lean.PrettyPrinter.Delaborator.Delab
code: abbrev Delab 
goal: Type

full_name: Lean.PrettyPrinter.Delaborator.instInhabitedDelabM
code: instance : Inhabited (DelabM α) 
goal: Inhabited (Lean.PrettyPrinter.Delaborator.DelabM α)

full_name: Lean.PrettyPrinter.Delaborator.orElse
code: @[inline] protected def orElse (d₁ : DelabM α) (d₂ : Unit → DelabM α) : DelabM α 
goal: Lean.PrettyPrinter.Delaborator.DelabM α

full_name: Lean.PrettyPrinter.Delaborator.failure
code: protected def failure : DelabM α 
goal: Lean.PrettyPrinter.Delaborator.DelabM α

full_name: Lean.PrettyPrinter.Delaborator.instAlternativeDelabM
code: instance : Alternative DelabM 
goal: Alternative Lean.PrettyPrinter.Delaborator.DelabM

full_name: Lean.PrettyPrinter.Delaborator.instOrElseDelabM
code: instance {α} : OrElse (DelabM α) 
goal: OrElse (Lean.PrettyPrinter.Delaborator.DelabM α)

full_name: Lean.PrettyPrinter.Delaborator.instMonadReaderOfSubExprDelabM
code: instance (priority := low) : MonadReaderOf SubExpr DelabM 
goal: MonadReaderOf Lean.SubExpr Lean.PrettyPrinter.Delaborator.DelabM

full_name: Lean.PrettyPrinter.Delaborator.instMonadWithReaderOfSubExprDelabM
code: instance (priority := low) : MonadWithReaderOf SubExpr DelabM 
goal: MonadWithReaderOf Lean.SubExpr Lean.PrettyPrinter.Delaborator.DelabM

full_name: Lean.PrettyPrinter.Delaborator.instMonadStateOfHoleIteratorDelabM
code: instance (priority := low) : MonadStateOf SubExpr.HoleIterator DelabM 
goal: MonadStateOf Lean.PrettyPrinter.Delaborator.SubExpr.HoleIterator Lean.PrettyPrinter.Delaborator.DelabM

full_name: Lean.PrettyPrinter.Delaborator.instMonadQuotationDelabM
code: instance : MonadQuotation DelabM 
goal: Lean.MonadQuotation Lean.PrettyPrinter.Delaborator.DelabM

full_name: Lean.PrettyPrinter.Delaborator.mkDelabAttribute
code: unsafe def mkDelabAttribute : IO (KeyedDeclsAttribute Delab) 
goal: IO (Lean.KeyedDeclsAttribute Lean.PrettyPrinter.Delaborator.Delab)

full_name: Lean.PrettyPrinter.Delaborator.delabAttribute
code: @[builtin_init mkDelabAttribute] opaque delabAttribute : KeyedDeclsAttribute Delab
goal: Lean.KeyedDeclsAttribute Lean.PrettyPrinter.Delaborator.Delab

full_name: Lean.PrettyPrinter.Delaborator.getExprKind
code: def getExprKind : DelabM Name 
goal: Lean.PrettyPrinter.Delaborator.DelabM Lean.Name

full_name: Lean.PrettyPrinter.Delaborator.getOptionsAtCurrPos
code: def getOptionsAtCurrPos : DelabM Options 
goal: Lean.PrettyPrinter.Delaborator.DelabM Lean.Options

full_name: Lean.PrettyPrinter.Delaborator.getPPOption
code: /-- Evaluate option accessor, using subterm-specific options if set. -/
def getPPOption (opt : Options → α) : DelabM α 
goal: Lean.PrettyPrinter.Delaborator.DelabM α

full_name: Lean.PrettyPrinter.Delaborator.whenPPOption
code: def whenPPOption (opt : Options → Bool) (d : Delab) : Delab 
goal: Lean.PrettyPrinter.Delaborator.Delab

full_name: Lean.PrettyPrinter.Delaborator.whenNotPPOption
code: def whenNotPPOption (opt : Options → Bool) (d : Delab) : Delab 
goal: Lean.PrettyPrinter.Delaborator.Delab

full_name: Lean.PrettyPrinter.Delaborator.withOptionAtCurrPos
code: /-- Set the given option at the current position and execute `x` in this context. -/
def withOptionAtCurrPos (k : Name) (v : DataValue) (x : DelabM α) : DelabM α 
goal: Lean.PrettyPrinter.Delaborator.DelabM α

full_name: Lean.PrettyPrinter.Delaborator.annotatePos
code: def annotatePos (pos : Pos) (stx : Term) : Term 
goal: Lean.Term

full_name: Lean.PrettyPrinter.Delaborator.annotateCurPos
code: def annotateCurPos (stx : Term) : Delab 
goal: Lean.PrettyPrinter.Delaborator.Delab

full_name: Lean.PrettyPrinter.Delaborator.addTermInfo.mkTermInfo
code: def addTermInfo (pos : Pos) (stx : Syntax) (e : Expr) (isBinder : Bool := false) : DelabM Unit 
goal: Lean.PrettyPrinter.Delaborator.DelabM Lean.Elab.TermInfo

full_name: Lean.PrettyPrinter.Delaborator.addTermInfo
code: def addTermInfo (pos : Pos) (stx : Syntax) (e : Expr) (isBinder : Bool := false) : DelabM Unit 
goal: Lean.PrettyPrinter.Delaborator.DelabM Unit

full_name: Lean.PrettyPrinter.Delaborator.addFieldInfo.mkFieldInfo
code: def addFieldInfo (pos : Pos) (projName fieldName : Name) (stx : Syntax) (val : Expr) : DelabM Unit 
goal: Lean.PrettyPrinter.Delaborator.DelabM Lean.Elab.FieldInfo

full_name: Lean.PrettyPrinter.Delaborator.addFieldInfo
code: def addFieldInfo (pos : Pos) (projName fieldName : Name) (stx : Syntax) (val : Expr) : DelabM Unit 
goal: Lean.PrettyPrinter.Delaborator.DelabM Unit

full_name: Lean.PrettyPrinter.Delaborator.annotateTermInfo
code: /--
Annotates the term with the current expression position and registers `TermInfo`
to associate the term to the current expression.
-/
def annotateTermInfo (stx : Term) : Delab 
goal: Lean.PrettyPrinter.Delaborator.Delab

full_name: Lean.PrettyPrinter.Delaborator.withAnnotateTermInfo
code: /--
Modifies the delaborator so that it annotates the resulting term with the current expression
position and registers `TermInfo` to associate the term to the current expression.
-/
def withAnnotateTermInfo (d : Delab) : Delab 
goal: Lean.PrettyPrinter.Delaborator.Delab

full_name: Lean.PrettyPrinter.Delaborator.getUnusedName
code: def getUnusedName (suggestion : Name) (body : Expr) : DelabM Name 
goal: Lean.PrettyPrinter.Delaborator.DelabM Lean.Name

full_name: Lean.PrettyPrinter.Delaborator.getUnusedName.bodyUsesSuggestion
code: def getUnusedName (suggestion : Name) (body : Expr) : DelabM Name 
goal: Bool

full_name: Lean.PrettyPrinter.Delaborator.mkAnnotatedIdent
code: /--
Creates an identifier that is annotated with the term `e`, using a fresh position using the `HoleIterator`.
-/
def mkAnnotatedIdent (n : Name) (e : Expr) : DelabM Ident 
goal: Lean.PrettyPrinter.Delaborator.DelabM Lean.Ident

full_name: Lean.PrettyPrinter.Delaborator.withBindingBodyUnusedName
code: /--
Enters the body of the current expression, which must be a lambda or forall.
The binding variable is passed to `d` as `Syntax`, and it is an identifier that has been annotated with the fvar expression
for the variable.
-/
def withBindingBodyUnusedName {α} (d : Syntax → DelabM α) : DelabM α 
goal: Lean.PrettyPrinter.Delaborator.DelabM α

full_name: Lean.PrettyPrinter.Delaborator.OmissionReason.deep
code: inductive OmissionReason
  | deep
  | proof
  | maxSteps
goal: Lean.PrettyPrinter.Delaborator.OmissionReason

full_name: Lean.PrettyPrinter.Delaborator.OmissionReason.maxSteps
code: inductive OmissionReason
  | deep
  | proof
  | maxSteps
goal: Lean.PrettyPrinter.Delaborator.OmissionReason

full_name: Lean.PrettyPrinter.Delaborator.OmissionReason
code: inductive OmissionReason
  | deep
  | proof
  | maxSteps
goal: Type

full_name: Lean.PrettyPrinter.Delaborator.OmissionReason.proof
code: inductive OmissionReason
  | deep
  | proof
  | maxSteps
goal: Lean.PrettyPrinter.Delaborator.OmissionReason

full_name: Lean.PrettyPrinter.Delaborator.OmissionReason.toString
code: def OmissionReason.toString : OmissionReason → String
  
goal: Lean.PrettyPrinter.Delaborator.OmissionReason → String

full_name: Lean.PrettyPrinter.Delaborator.addOmissionInfo.mkOmissionInfo
code: def addOmissionInfo (pos : Pos) (stx : Syntax) (e : Expr) (reason : OmissionReason) : DelabM Unit 
goal: Lean.PrettyPrinter.Delaborator.DelabM Lean.Elab.OmissionInfo

full_name: Lean.PrettyPrinter.Delaborator.addOmissionInfo
code: def addOmissionInfo (pos : Pos) (stx : Syntax) (e : Expr) (reason : OmissionReason) : DelabM Unit 
goal: Lean.PrettyPrinter.Delaborator.DelabM Unit

full_name: Lean.PrettyPrinter.Delaborator.withIncDepth
code: /--
Runs the delaborator `act` with increased depth.
The depth is used when `pp.deepTerms` is `false` to determine what is a deep term.
See also `Lean.PrettyPrinter.Delaborator.Context.depth`.
-/
def withIncDepth (act : DelabM α) : DelabM α 
goal: Lean.PrettyPrinter.Delaborator.DelabM α

full_name: Lean.PrettyPrinter.Delaborator.isShallowExpression
code: /--
Returns true if `e` is a "shallow" expression.
Local variables, constants, and other atomic expressions are always shallow.
In general, an expression is considered to be shallow if its depth is at most `threshold`.

Since the implementation uses `Lean.Expr.approxDepth`, the `threshold` is clamped to `[0, 254]`.
-/
def isShallowExpression (threshold : Nat) (e : Expr) : Bool 
goal: Bool

full_name: Lean.PrettyPrinter.Delaborator.shouldOmitExpr
code: /--
Returns `true` if, at the current depth, we should omit the term and use `⋯` rather than
delaborating it. This function can only return `true` if `pp.deepTerms` is set to `false`.
It also contains a heuristic to allow "shallow terms" to be delaborated, even if they appear deep in
an expression, which prevents terms such as atomic expressions or `OfNat.ofNat` literals from being
delaborated as `⋯`.
-/
def shouldOmitExpr (e : Expr) : DelabM Bool 
goal: Lean.PrettyPrinter.Delaborator.DelabM Bool

full_name: Lean.PrettyPrinter.Delaborator.shouldOmitProof
code: /--
Returns `true` if the given expression is a proof and should be omitted.
This function only returns `true` if `pp.proofs` is set to `false`.

"Shallow" proofs are not omitted.
The `pp.proofs.threshold` option controls the depth threshold for what constitutes a shallow proof.
See `Lean.PrettyPrinter.Delaborator.isShallowExpression`.
-/
def shouldOmitProof (e : Expr) : DelabM Bool 
goal: Lean.PrettyPrinter.Delaborator.DelabM Bool

full_name: Lean.PrettyPrinter.Delaborator.omission
code: /--
Delaborates the current expression as `⋯` and attaches `Elab.OmissionInfo`, which influences how the
subterm omitted by `⋯` is delaborated when hovered over.
-/
def omission (reason : OmissionReason) : Delab 
goal: Lean.PrettyPrinter.Delaborator.Delab

full_name: Lean.PrettyPrinter.Delaborator.delabFor
code: partial def delabFor : Name → Delab
  
goal: Lean.Name → Lean.PrettyPrinter.Delaborator.Delab

full_name: Lean.PrettyPrinter.Delaborator.delab
code: partial def delab : Delab 
goal: Lean.PrettyPrinter.Delaborator.Delab

full_name: Lean.PrettyPrinter.Delaborator.mkAppUnexpanderAttribute
code: unsafe def mkAppUnexpanderAttribute : IO (KeyedDeclsAttribute Unexpander) 
goal: IO (Lean.KeyedDeclsAttribute Lean.PrettyPrinter.Unexpander)

full_name: Lean.PrettyPrinter.Delaborator.appUnexpanderAttribute
code: @[builtin_init mkAppUnexpanderAttribute] opaque appUnexpanderAttribute : KeyedDeclsAttribute Unexpander
goal: Lean.KeyedDeclsAttribute Lean.PrettyPrinter.Unexpander

full_name: Lean.PrettyPrinter.delabCore
code: def delabCore (e : Expr) (optionsPerPos : OptionsPerPos := {}) (delab : DelabM α) :
  MetaM (α × PosMap Elab.Info) 
goal: Lean.MetaM (α × Lean.SubExpr.PosMap Lean.Elab.Info)

full_name: Lean.PrettyPrinter.delab
code: /-- "Delaborate" the given term into surface-level syntax using the default and given subterm-specific options. -/
def delab (e : Expr) (optionsPerPos : OptionsPerPos := {}) : MetaM Term 
goal: Lean.MetaM Lean.Term

full_name: Lean.PrettyPrinter.initFn._@..lake.packages.lean4.src.lean.Lean.PrettyPrinter.Delaborator.Basic._hyg.4132
code: builtin_initialize
  registerTraceClass `PrettyPrinter.delab
  registerTraceClass `PrettyPrinter.delab.input
goal: IO Unit