Documentation

Lean.Data.PrefixTree

inductive Lean.PrefixTreeNode (α : Type u) (β : Type v) :
Type (max u v)
Instances For
@[specialize #[]]
def Lean.PrefixTreeNode.insert {α : Type u_1} {β : Type u_2} (t : PrefixTreeNode α β) (cmp : ααOrdering) (k : List α) (val : β) :
Equations
partial def Lean.PrefixTreeNode.insert.insertEmpty {α : Type u_1} {β : Type u_2} (val : β) (k : List α) :
partial def Lean.PrefixTreeNode.insert.loop {α : Type u_1} {β : Type u_2} (cmp : ααOrdering) (val : β) :
PrefixTreeNode α βList αPrefixTreeNode α β
@[specialize #[]]
def Lean.PrefixTreeNode.find? {α : Type u_1} {β : Type u_2} (t : PrefixTreeNode α β) (cmp : ααOrdering) (k : List α) :
Equations
partial def Lean.PrefixTreeNode.find?.loop {α : Type u_1} {β : Type u_2} (cmp : ααOrdering) :
PrefixTreeNode α βList αOption β
@[specialize #[]]
def Lean.PrefixTreeNode.findLongestPrefix? {α : Type u_1} {β : Type u_2} (t : PrefixTreeNode α β) (cmp : ααOrdering) (k : List α) :

Returns the the value of the longest key in t that is a prefix of k, if any.

Equations
partial def Lean.PrefixTreeNode.findLongestPrefix?.loop {α : Type u_1} {β : Type u_2} (cmp : ααOrdering) (acc? : Option β) :
PrefixTreeNode α βList αOption β
@[specialize #[]]
def Lean.PrefixTreeNode.foldMatchingM {m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_4} {σ : Type u_1} [Monad m] (t : PrefixTreeNode α β) (cmp : ααOrdering) (k : List α) (init : σ) (f : βσm σ) :
m σ
Equations
partial def Lean.PrefixTreeNode.foldMatchingM.fold {m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_4} {σ : Type u_1} [Monad m] (f : βσm σ) :
PrefixTreeNode α βσm σ
partial def Lean.PrefixTreeNode.foldMatchingM.find {m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_4} {σ : Type u_1} [Monad m] (cmp : ααOrdering) (init : σ) (f : βσm σ) :
List αPrefixTreeNode α βσm σ
inductive Lean.PrefixTreeNode.WellFormed {α : Type u_1} (cmp : ααOrdering) {β : Type u_2} :
def Lean.PrefixTree.empty {α : Type u_1} {β : Type u_2} {p : ααOrdering} :
PrefixTree α β p
Equations
instance Lean.instInhabitedPrefixTree {α : Type u_1} {β : Type u_2} {p : ααOrdering} :
Equations
instance Lean.instEmptyCollectionPrefixTree {α : Type u_1} {β : Type u_2} {p : ααOrdering} :
Equations
@[inline]
def Lean.PrefixTree.insert {α : Type u_1} {β : Type u_2} {p : ααOrdering} (t : PrefixTree α β p) (k : List α) (v : β) :
PrefixTree α β p
Equations
@[inline]
def Lean.PrefixTree.find? {α : Type u_1} {β : Type u_2} {p : ααOrdering} (t : PrefixTree α β p) (k : List α) :
Equations
@[inline]
def Lean.PrefixTree.findLongestPrefix? {α : Type u_1} {β : Type u_2} {p : ααOrdering} (t : PrefixTree α β p) (k : List α) :

Returns the the value of the longest key in t that is a prefix of k, if any.

Equations
@[inline]
def Lean.PrefixTree.foldMatchingM {m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_4} {p : ααOrdering} {σ : Type u_1} [Monad m] (t : PrefixTree α β p) (k : List α) (init : σ) (f : βσm σ) :
m σ
Equations
@[inline]
def Lean.PrefixTree.foldM {m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_4} {p : ααOrdering} {σ : Type u_1} [Monad m] (t : PrefixTree α β p) (init : σ) (f : βσm σ) :
m σ
Equations
@[inline]
def Lean.PrefixTree.forMatchingM {m : TypeType u_1} {α : Type u_2} {β : Type u_3} {p : ααOrdering} [Monad m] (t : PrefixTree α β p) (k : List α) (f : βm Unit) :
Equations
@[inline]
def Lean.PrefixTree.forM {m : TypeType u_1} {α : Type u_2} {β : Type u_3} {p : ααOrdering} [Monad m] (t : PrefixTree α β p) (f : βm Unit) :
Equations