File: .lake/packages/lean4/src/lean/Lean/Meta/DiscrTree.lean

full_name: Lean.Meta.DiscrTree.Key.ctorIdx
code: def Key.ctorIdx : Key → Nat
  
goal: Lean.Meta.DiscrTree.Key → Nat

full_name: Lean.Meta.DiscrTree.Key.lt
code: def Key.lt : Key → Key → Bool
  
goal: Lean.Meta.DiscrTree.Key → Lean.Meta.DiscrTree.Key → Bool

full_name: Lean.Meta.DiscrTree.«instLTKey_.lake»
code: instance : LT Key 
goal: LT Lean.Meta.DiscrTree.Key

full_name: Lean.Meta.DiscrTree.«instDecidableLtKey_.lake»
code: instance (a b : Key) : Decidable (a < b) 
goal: Decidable (a < b)

full_name: Lean.Meta.DiscrTree.Key.format
code: def Key.format : Key → Format
  
goal: Lean.Meta.DiscrTree.Key → Lean.Format

full_name: Lean.Meta.DiscrTree.«instToFormatKey_.lake»
code: instance : ToFormat Key 
goal: Lean.ToFormat Lean.Meta.DiscrTree.Key

full_name: Lean.Meta.DiscrTree.keysAsPattern
code: /--
Helper function for converting an entry (i.e., `Array Key`) to the discrimination tree into
`MessageData` that is more user-friendly. We use this function to implement diagnostic information.
-/
partial def keysAsPattern (keys : Array Key) : CoreM MessageData 
goal: Lean.CoreM Lean.MessageData

full_name: Lean.Meta.DiscrTree.keysAsPattern.mkApp
code: /--
Helper function for converting an entry (i.e., `Array Key`) to the discrimination tree into
`MessageData` that is more user-friendly. We use this function to implement diagnostic information.
-/
partial def keysAsPattern (keys : Array Key) : CoreM MessageData 
goal: Lean.CoreM Lean.MessageData

full_name: Lean.Meta.DiscrTree.keysAsPattern.goN
code: /--
Helper function for converting an entry (i.e., `Array Key`) to the discrimination tree into
`MessageData` that is more user-friendly. We use this function to implement diagnostic information.
-/
partial def keysAsPattern (keys : Array Key) : CoreM MessageData 
goal: StateRefT' IO.RealWorld (List Lean.Meta.DiscrTree.Key) Lean.CoreM (Array Lean.MessageData)

full_name: Lean.Meta.DiscrTree.keysAsPattern.go
code: /--
Helper function for converting an entry (i.e., `Array Key`) to the discrimination tree into
`MessageData` that is more user-friendly. We use this function to implement diagnostic information.
-/
partial def keysAsPattern (keys : Array Key) : CoreM MessageData 
goal: StateRefT' IO.RealWorld (List Lean.Meta.DiscrTree.Key) Lean.CoreM Lean.MessageData

full_name: Lean.Meta.DiscrTree.keysAsPattern.next?
code: /--
Helper function for converting an entry (i.e., `Array Key`) to the discrimination tree into
`MessageData` that is more user-friendly. We use this function to implement diagnostic information.
-/
partial def keysAsPattern (keys : Array Key) : CoreM MessageData 
goal: StateRefT' IO.RealWorld (List Lean.Meta.DiscrTree.Key) Lean.CoreM (Option Lean.Meta.DiscrTree.Key)

full_name: Lean.Meta.DiscrTree.Key.arity
code: def Key.arity : Key → Nat
  
goal: Lean.Meta.DiscrTree.Key → Nat

full_name: Lean.Meta.DiscrTree.«instInhabitedTrie_.lake»
code: instance : Inhabited (Trie α) 
goal: Inhabited (Lean.Meta.DiscrTree.Trie α)

full_name: Lean.Meta.DiscrTree.empty
code: def empty : DiscrTree α 
goal: Lean.Meta.DiscrTree α

full_name: Lean.Meta.DiscrTree.Trie.format
code: partial def Trie.format [ToFormat α] : Trie α → Format
  
goal: Lean.Meta.DiscrTree.Trie α → Lean.Format

full_name: Lean.Meta.DiscrTree.«instToFormatTrie_.lake»
code: instance [ToFormat α] : ToFormat (Trie α) 
goal: Lean.ToFormat (Lean.Meta.DiscrTree.Trie α)

full_name: Lean.Meta.DiscrTree.format
code: partial def format [ToFormat α] (d : DiscrTree α) : Format 
goal: Lean.Format

full_name: Lean.Meta.DiscrTree.«instToFormat_.lake»
code: instance [ToFormat α] : ToFormat (DiscrTree α) 
goal: Lean.ToFormat (Lean.Meta.DiscrTree α)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.DiscrTree.0.Lean.Meta.DiscrTree.tmpMVarId
code: /-- The discrimination tree ignores implicit arguments and proofs.
   We use the following auxiliary id as a "mark". -/
private def tmpMVarId : MVarId 
goal: Lean.MVarId

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.DiscrTree.0.Lean.Meta.DiscrTree.tmpStar
code: private def tmpStar 
goal: Lean.Expr

full_name: Lean.Meta.DiscrTree.«instInhabited_.lake»
code: instance : Inhabited (DiscrTree α) 
goal: Inhabited (Lean.Meta.DiscrTree α)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.DiscrTree.0.Lean.Meta.DiscrTree.ignoreArg
code: /--
  Return true iff the argument should be treated as a "wildcard" by the discrimination tree.

  - We ignore proofs because of proof irrelevance. It doesn't make sense to try to
    index their structure.

  - We ignore instance implicit arguments (e.g., `[Add α]`) because they are "morally" canonical.
    Moreover, we may have many definitionally equal terms floating around.
    Example: `Ring.hasAdd Int Int.isRing` and `Int.hasAdd`.

  - We considered ignoring implicit arguments (e.g., `{α : Type}`) since users don't "see" them,
    and may not even understand why some simplification rule is not firing.
    However, in type class resolution, we have instance such as `Decidable (@Eq Nat x y)`,
    where `Nat` is an implicit argument. Thus, we would add the path
    ```
    Decidable -> Eq -> * -> * -> * -> [Nat.decEq]
    ```
    to the discrimination tree IF we ignored the implicit `Nat` argument.
    This would be BAD since **ALL** decidable equality instances would be in the same path.
    So, we index implicit arguments if they are types.
    This setting seems sensible for simplification theorems such as:
    ```
    forall (x y : Unit), (@Eq Unit x y) = true
    ```
    If we ignore the implicit argument `Unit`, the `DiscrTree` will say it is a candidate
    simplification theorem for any equality in our goal.

  Remark: if users have problems with the solution above, we may provide a `noIndexing` annotation,
  and `ignoreArg` would return true for any term of the form `noIndexing t`.
-/
private def ignoreArg (a : Expr) (i : Nat) (infos : Array ParamInfo) : MetaM Bool 
goal: Lean.MetaM Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.DiscrTree.0.Lean.Meta.DiscrTree.pushArgsAux
code: private partial def pushArgsAux (infos : Array ParamInfo) : Nat → Expr → Array Expr → MetaM (Array Expr)
  
goal: Nat → Lean.Expr → Array Lean.Expr → Lean.MetaM (Array Lean.Expr)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.DiscrTree.0.Lean.Meta.DiscrTree.isNumeral
code: /--
  Return true if `e` is one of the following
  - A nat literal (numeral)
  - `Nat.zero`
  - `Nat.succ x` where `isNumeral x`
  - `OfNat.ofNat _ x _` where `isNumeral x` -/
private partial def isNumeral (e : Expr) : Bool 
goal: Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.DiscrTree.0.Lean.Meta.DiscrTree.toNatLit?
code: private partial def toNatLit? (e : Expr) : Option Literal 
goal: Option Lean.Literal

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.DiscrTree.0.Lean.Meta.DiscrTree.toNatLit?.loop
code: private partial def toNatLit? (e : Expr) : Option Literal 
goal: OptionT Id Nat

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.DiscrTree.0.Lean.Meta.DiscrTree.isNatType
code: private def isNatType (e : Expr) : MetaM Bool 
goal: Lean.MetaM Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.DiscrTree.0.Lean.Meta.DiscrTree.isOffset
code: /--
  Return true if `e` is one of the following
  - `Nat.add _ k` where `isNumeral k`
  - `Add.add Nat _ _ k` where `isNumeral k`
  - `HAdd.hAdd _ Nat _ _ k` where `isNumeral k`
  - `Nat.succ _`
  This function assumes `e.isAppOf fName`
-/
private def isOffset (fName : Name) (e : Expr) : MetaM Bool 
goal: Lean.MetaM Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.DiscrTree.0.Lean.Meta.DiscrTree.shouldAddAsStar
code: /--
  TODO: add hook for users adding their own functions for controlling `shouldAddAsStar`
  Different `DiscrTree` users may populate this set using, for example, attributes.

  Remark: we currently tag "offset" terms as star to avoid having to add special
  support for offset terms.
  Example, suppose the discrimination tree contains the entry
  `Nat.succ ?m |-> v`, and we are trying to retrieve the matches for `Expr.lit (Literal.natVal 1) _`.
  In this scenario, we want to retrieve `Nat.succ ?m |-> v`
-/
private def shouldAddAsStar (fName : Name) (e : Expr) : MetaM Bool 
goal: Lean.MetaM Bool

full_name: Lean.Meta.DiscrTree.mkNoindexAnnotation
code: def mkNoindexAnnotation (e : Expr) : Expr 
goal: Lean.Expr

full_name: Lean.Meta.DiscrTree.hasNoindexAnnotation
code: def hasNoindexAnnotation (e : Expr) : Bool 
goal: Bool

full_name: Lean.Meta.DiscrTree.reduce
code: /--
Reduction procedure for the discrimination tree indexing.
The parameter `config` controls how aggressively the term is reduced.
The parameter at type `DiscrTree` controls this value.
See comment at `DiscrTree`.
-/
partial def reduce (e : Expr) (config : WhnfCoreConfig) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.DiscrTree.0.Lean.Meta.DiscrTree.isBadKey
code: /--
  Return `true` if `fn` is a "bad" key. That is, `pushArgs` would add `Key.other` or `Key.star`.
  We use this function when processing "root terms, and will avoid unfolding terms.
  Note that without this trick the pattern `List.map f ∘ List.map g` would be mapped into the key `Key.other`
  since the function composition `∘` would be unfolded and we would get `fun x => List.map g (List.map f x)`
-/
private def isBadKey (fn : Expr) : Bool 
goal: Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.DiscrTree.0.Lean.Meta.DiscrTree.reduceUntilBadKey
code: /--
  Reduce `e` until we get an irreducible term (modulo current reducibility setting) or the resulting term
  is a bad key (see comment at `isBadKey`).
  We use this method instead of `reduce` for root terms at `pushArgs`. -/
private partial def reduceUntilBadKey (e : Expr) (config : WhnfCoreConfig) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.DiscrTree.0.Lean.Meta.DiscrTree.reduceUntilBadKey.step
code: /--
  Reduce `e` until we get an irreducible term (modulo current reducibility setting) or the resulting term
  is a bad key (see comment at `isBadKey`).
  We use this method instead of `reduce` for root terms at `pushArgs`. -/
private partial def reduceUntilBadKey (e : Expr) (config : WhnfCoreConfig) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.DiscrTree.reduceDT
code: /-- whnf for the discrimination tree module -/
def reduceDT (e : Expr) (root : Bool) (config : WhnfCoreConfig) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.DiscrTree.0.Lean.Meta.DiscrTree.pushWildcards
code: /--
Append `n` wildcards to `todo`
-/
private def pushWildcards (n : Nat) (todo : Array Expr) : Array Expr 
goal: Array Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.DiscrTree.0.Lean.Meta.DiscrTree.pushArgs
code: /--
When `noIndexAtArgs := true`, `pushArgs` assumes function application arguments have a `no_index` annotation.
That is, `f a b` is indexed as it was `f (no_index a) (no_index b)`.
This feature is used when indexing local proofs in the simplifier. This is useful in examples like the one described on issue #2670.
In this issue, we have a local hypotheses `(h : ∀ p : α × β, f p p.2 = p.2)`, and users expect it to be applicable to
`f (a, b) b = b`. This worked in Lean 3 since no indexing was used. We can retrieve Lean 3 behavior by writing
`(h : ∀ p : α × β, f p (no_index p.2) = p.2)`, but this is very inconvenient when the hypotheses was not written by the user in first place.
For example, it was introduced by another tactic. Thus, when populating the discrimination tree explicit arguments provided to `simp` (e.g., `simp [h]`),
we use `noIndexAtArgs := true`. See comment: https://github.com/leanprover/lean4/issues/2670#issuecomment-1758889365
-/
private def pushArgs (root : Bool) (todo : Array Expr) (e : Expr) (config : WhnfCoreConfig) (noIndexAtArgs : Bool) : MetaM (Key × Array Expr) 
goal: Lean.MetaM (Lean.Meta.DiscrTree.Key × Array Lean.Expr)

full_name: Lean.Meta.DiscrTree.mkPathAux
code: @[inherit_doc pushArgs]
partial def mkPathAux (root : Bool) (todo : Array Expr) (keys : Array Key) (config : WhnfCoreConfig) (noIndexAtArgs : Bool) : MetaM (Array Key) 
goal: Lean.MetaM (Array Lean.Meta.DiscrTree.Key)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.DiscrTree.0.Lean.Meta.DiscrTree.initCapacity
code: private def initCapacity 
goal: Nat

full_name: Lean.Meta.DiscrTree.mkPath
code: @[inherit_doc pushArgs]
def mkPath (e : Expr) (config : WhnfCoreConfig) (noIndexAtArgs := false) : MetaM (Array Key) 
goal: Lean.MetaM (Array Lean.Meta.DiscrTree.Key)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.DiscrTree.0.Lean.Meta.DiscrTree.createNodes
code: private partial def createNodes (keys : Array Key) (v : α) (i : Nat) : Trie α 
goal: Lean.Meta.DiscrTree.Trie α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.DiscrTree.0.Lean.Meta.DiscrTree.insertVal.loop
code: /--
If `vs` contains an element `v'` such that `v == v'`, then replace `v'` with `v`.
Otherwise, push `v`.
See issue #2155
Recall that `BEq α` may not be Lawful.
-/
private def insertVal [BEq α] (vs : Array α) (v : α) : Array α 
goal: Array α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.DiscrTree.0.Lean.Meta.DiscrTree.insertVal
code: /--
If `vs` contains an element `v'` such that `v == v'`, then replace `v'` with `v`.
Otherwise, push `v`.
See issue #2155
Recall that `BEq α` may not be Lawful.
-/
private def insertVal [BEq α] (vs : Array α) (v : α) : Array α 
goal: Array α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.DiscrTree.0.Lean.Meta.DiscrTree.insertAux
code: private partial def insertAux [BEq α] (keys : Array Key) (v : α) : Nat → Trie α → Trie α
  
goal: Nat → Lean.Meta.DiscrTree.Trie α → Lean.Meta.DiscrTree.Trie α

full_name: Lean.Meta.DiscrTree.insertCore
code: def insertCore [BEq α] (d : DiscrTree α) (keys : Array Key) (v : α) : DiscrTree α 
goal: Lean.Meta.DiscrTree α

full_name: Lean.Meta.DiscrTree.insert
code: def insert [BEq α] (d : DiscrTree α) (e : Expr) (v : α) (config : WhnfCoreConfig) (noIndexAtArgs := false) : MetaM (DiscrTree α) 
goal: Lean.MetaM (Lean.Meta.DiscrTree α)

full_name: Lean.Meta.DiscrTree.insertIfSpecific
code: /--
Inserts a value into a discrimination tree,
but only if its key is not of the form `#[*]` or `#[=, *, *, *]`.
-/
def insertIfSpecific [BEq α] (d : DiscrTree α) (e : Expr) (v : α) (config : WhnfCoreConfig) (noIndexAtArgs := false) : MetaM (DiscrTree α) 
goal: Lean.MetaM (Lean.Meta.DiscrTree α)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.DiscrTree.0.Lean.Meta.DiscrTree.getKeyArgs
code: private def getKeyArgs (e : Expr) (isMatch root : Bool) (config : WhnfCoreConfig) : MetaM (Key × Array Expr) 
goal: Lean.MetaM (Lean.Meta.DiscrTree.Key × Array Lean.Expr)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.DiscrTree.0.Lean.Meta.DiscrTree.getMatchKeyArgs
code: private abbrev getMatchKeyArgs (e : Expr) (root : Bool) (config : WhnfCoreConfig) : MetaM (Key × Array Expr) 
goal: Lean.MetaM (Lean.Meta.DiscrTree.Key × Array Lean.Expr)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.DiscrTree.0.Lean.Meta.DiscrTree.getUnifyKeyArgs
code: private abbrev getUnifyKeyArgs (e : Expr) (root : Bool) (config : WhnfCoreConfig) : MetaM (Key × Array Expr) 
goal: Lean.MetaM (Lean.Meta.DiscrTree.Key × Array Lean.Expr)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.DiscrTree.0.Lean.Meta.DiscrTree.getStarResult
code: private def getStarResult (d : DiscrTree α) : Array α 
goal: Array α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.DiscrTree.0.Lean.Meta.DiscrTree.findKey
code: private abbrev findKey (cs : Array (Key × Trie α)) (k : Key) : Option (Key × Trie α) 
goal: Option (Lean.Meta.DiscrTree.Key × Lean.Meta.DiscrTree.Trie α)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.DiscrTree.0.Lean.Meta.DiscrTree.getMatchLoop
code: private partial def getMatchLoop (todo : Array Expr) (c : Trie α) (result : Array α) (config : WhnfCoreConfig) : MetaM (Array α) 
goal: Lean.MetaM (Array α)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.DiscrTree.0.Lean.Meta.DiscrTree.getMatchRoot
code: private def getMatchRoot (d : DiscrTree α) (k : Key) (args : Array Expr) (result : Array α) (config : WhnfCoreConfig) : MetaM (Array α) 
goal: Lean.MetaM (Array α)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.DiscrTree.0.Lean.Meta.DiscrTree.getMatchCore
code: private def getMatchCore (d : DiscrTree α) (e : Expr) (config : WhnfCoreConfig) : MetaM (Key × Array α) 
goal: Lean.MetaM (Lean.Meta.DiscrTree.Key × Array α)

full_name: Lean.Meta.DiscrTree.getMatch
code: /--
  Find values that match `e` in `d`.
-/
def getMatch (d : DiscrTree α) (e : Expr) (config : WhnfCoreConfig) : MetaM (Array α) 
goal: Lean.MetaM (Array α)

full_name: Lean.Meta.DiscrTree.getMatchWithExtra.mayMatchPrefix
code: /--
  Similar to `getMatch`, but returns solutions that are prefixes of `e`.
  We store the number of ignored arguments in the result.-/
partial def getMatchWithExtra (d : DiscrTree α) (e : Expr) (config : WhnfCoreConfig) : MetaM (Array (α × Nat)) 
goal: Lean.MetaM Bool

full_name: Lean.Meta.DiscrTree.getMatchWithExtra
code: /--
  Similar to `getMatch`, but returns solutions that are prefixes of `e`.
  We store the number of ignored arguments in the result.-/
partial def getMatchWithExtra (d : DiscrTree α) (e : Expr) (config : WhnfCoreConfig) : MetaM (Array (α × Nat)) 
goal: Lean.MetaM (Array (α × Nat))

full_name: Lean.Meta.DiscrTree.getMatchWithExtra.go
code: /--
  Similar to `getMatch`, but returns solutions that are prefixes of `e`.
  We store the number of ignored arguments in the result.-/
partial def getMatchWithExtra (d : DiscrTree α) (e : Expr) (config : WhnfCoreConfig) : MetaM (Array (α × Nat)) 
goal: Lean.MetaM (Array (α × Nat))

full_name: Lean.Meta.DiscrTree.getMatchKeyRootFor
code: /--
Return the root symbol for `e`, and the number of arguments after `reduceDT`.
-/
def getMatchKeyRootFor (e : Expr) (config : WhnfCoreConfig) : MetaM (Key × Nat) 
goal: Lean.MetaM (Lean.Meta.DiscrTree.Key × Nat)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.DiscrTree.0.Lean.Meta.DiscrTree.getAllValuesForKey.go
code: /--
Get all results under key `k`.
-/
private partial def getAllValuesForKey (d : DiscrTree α) (k : Key) (result : Array α) : Array α 
goal: Array α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.DiscrTree.0.Lean.Meta.DiscrTree.getAllValuesForKey
code: /--
Get all results under key `k`.
-/
private partial def getAllValuesForKey (d : DiscrTree α) (k : Key) (result : Array α) : Array α 
goal: Array α

full_name: Lean.Meta.DiscrTree.getMatchLiberal
code: /--
A liberal version of `getMatch` which only takes the root symbol of `e` into account.
We use this method to simulate Lean 3's indexing.

The natural number in the result is the number of arguments in `e` after `reduceDT`.
-/
def getMatchLiberal (d : DiscrTree α) (e : Expr) (config : WhnfCoreConfig) : MetaM (Array α × Nat) 
goal: Lean.MetaM (Array α × Nat)

full_name: Lean.Meta.DiscrTree.getUnify.process
code: partial def getUnify (d : DiscrTree α) (e : Expr) (config : WhnfCoreConfig) : MetaM (Array α) 
goal: Lean.MetaM (Array α)

full_name: Lean.Meta.DiscrTree.getUnify
code: partial def getUnify (d : DiscrTree α) (e : Expr) (config : WhnfCoreConfig) : MetaM (Array α) 
goal: Lean.MetaM (Array α)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.DiscrTree.0.Lean.Meta.DiscrTree.Trie.«instInhabitedForallForallOfMonad_.lake»
code: private local instance [Monad m] : Inhabited (σ → β → m σ) 
goal: Inhabited (σ → β → m σ)

full_name: Lean.Meta.DiscrTree.Trie.foldM
code: /--
Monadically fold the keys and values stored in a `Trie`.
-/
partial def foldM [Monad m] (initialKeys : Array Key)
    (f : σ → Array Key → α → m σ) : (init : σ) → Trie α → m σ
  
goal: Lean.Meta.DiscrTree.Trie α → m σ

full_name: Lean.Meta.DiscrTree.Trie.fold
code: /--
Fold the keys and values stored in a `Trie`.
-/
@[inline]
def fold (initialKeys : Array Key) (f : σ → Array Key → α → σ) (init : σ) (t : Trie α) : σ 
goal: σ

full_name: Lean.Meta.DiscrTree.Trie.foldValuesM
code: /--
Monadically fold the values stored in a `Trie`.
-/
partial def foldValuesM [Monad m] (f : σ → α → m σ) : (init : σ) → Trie α → m σ
  
goal: Lean.Meta.DiscrTree.Trie α → m σ

full_name: Lean.Meta.DiscrTree.Trie.foldValues
code: /--
Fold the values stored in a `Trie`.
-/
@[inline]
def foldValues (f : σ → α → σ) (init : σ) (t : Trie α) : σ 
goal: σ

full_name: Lean.Meta.DiscrTree.Trie.size
code: /--
The number of values stored in a `Trie`.
-/
partial def size : Trie α → Nat
  
goal: Lean.Meta.DiscrTree.Trie α → Nat

full_name: Lean.Meta.DiscrTree.foldM
code: /--
Monadically fold over the keys and values stored in a `DiscrTree`.
-/
@[inline]
def foldM [Monad m] (f : σ → Array Key → α → m σ) (init : σ)
    (t : DiscrTree α) : m σ 
goal: m σ

full_name: Lean.Meta.DiscrTree.fold
code: /--
Fold over the keys and values stored in a `DiscrTree`
-/
@[inline]
def fold (f : σ → Array Key → α → σ) (init : σ) (t : DiscrTree α) : σ 
goal: σ

full_name: Lean.Meta.DiscrTree.foldValuesM
code: /--
Monadically fold over the values stored in a `DiscrTree`.
-/
@[inline]
def foldValuesM [Monad m] (f : σ → α → m σ) (init : σ) (t : DiscrTree α) :
    m σ 
goal: m σ

full_name: Lean.Meta.DiscrTree.foldValues
code: /--
Fold over the values stored in a `DiscrTree`.
-/
@[inline]
def foldValues (f : σ → α → σ) (init : σ) (t : DiscrTree α) : σ 
goal: σ

full_name: Lean.Meta.DiscrTree.containsValueP
code: /--
Check for the presence of a value satisfying a predicate.
-/
@[inline]
def containsValueP (t : DiscrTree α) (f : α → Bool) : Bool 
goal: Bool

full_name: Lean.Meta.DiscrTree.values
code: /--
Extract the values stored in a `DiscrTree`.
-/
@[inline]
def values (t : DiscrTree α) : Array α 
goal: Array α

full_name: Lean.Meta.DiscrTree.toArray
code: /--
Extract the keys and values stored in a `DiscrTree`.
-/
@[inline]
def toArray (t : DiscrTree α) : Array (Array Key × α) 
goal: Array (Array Lean.Meta.DiscrTree.Key × α)

full_name: Lean.Meta.DiscrTree.size
code: /--
Get the number of values stored in a `DiscrTree`. O(n) in the size of the tree.
-/
@[inline]
def size (t : DiscrTree α) : Nat 
goal: Nat

full_name: Lean.Meta.DiscrTree.Trie.mapArraysM
code: /-- Apply a monadic function to the array of values at each node in a `DiscrTree`. -/
partial def Trie.mapArraysM (t : DiscrTree.Trie α) (f : Array α → m (Array β)) :
    m (DiscrTree.Trie β) 
goal: m (Lean.Meta.DiscrTree.Trie β)

full_name: Lean.Meta.DiscrTree.mapArraysM
code: /-- Apply a monadic function to the array of values at each node in a `DiscrTree`. -/
def mapArraysM (d : DiscrTree α) (f : Array α → m (Array β)) : m (DiscrTree β) 
goal: m (Lean.Meta.DiscrTree β)

full_name: Lean.Meta.DiscrTree.mapArrays
code: /-- Apply a function to the array of values at each node in a `DiscrTree`. -/
def mapArrays (d : DiscrTree α) (f : Array α → Array β) : DiscrTree β 
goal: Lean.Meta.DiscrTree β