Equations
- m.empty = rbtree.empty m
Equations
- m.to_list = rbtree.to_list m
def
rbmap.fold
{α : Type u}
{β : Type v}
{δ : Type w}
{lt : α → α → Prop}
(f : α → β → δ → δ)
(m : rbmap α β lt)
(d : δ) :
δ
Equations
- rbmap.fold f m d = rbtree.fold (λ (e : α × β), f e.fst e.snd) m d
def
rbmap.rev_fold
{α : Type u}
{β : Type v}
{δ : Type w}
{lt : α → α → Prop}
(f : α → β → δ → δ)
(m : rbmap α β lt)
(d : δ) :
δ
Equations
- rbmap.rev_fold f m d = rbtree.rev_fold (λ (e : α × β), f e.fst e.snd) m d
@[protected]
Equations
- rbmap.mem k m = rbmap.mem._match_1 k m m.val
- rbmap.mem._match_1 k m (_x.black_node e _x_1) = rbtree.mem (k, e.snd) m
- rbmap.mem._match_1 k m (_x.red_node e _x_1) = rbtree.mem (k, e.snd) m
- rbmap.mem._match_1 k m rbnode.leaf = false
@[protected, instance]
Equations
- rbmap.has_mem = {mem := rbmap.mem lt}
def
rbmap.rbmap_lt_dec
{α : Type u}
{β : Type v}
{lt : α → α → Prop}
[h : decidable_rel lt] :
decidable_rel (rbmap_lt lt)
Equations
- rbmap.rbmap_lt_dec = λ (a b : α × β), h a.fst b.fst
def
rbmap.insert
{α : Type u}
{β : Type v}
{lt : α → α → Prop}
[decidable_rel lt]
(m : rbmap α β lt)
(k : α)
(v : β) :
rbmap α β lt
Equations
- m.insert k v = rbtree.insert m (k, v)
def
rbmap.find_entry
{α : Type u}
{β : Type v}
{lt : α → α → Prop}
[decidable_rel lt]
(m : rbmap α β lt)
(k : α) :
Equations
- m.find_entry k = rbmap.find_entry._match_1 m k m.val
- rbmap.find_entry._match_1 m k (_x.black_node e _x_1) = rbtree.find m (k, e.snd)
- rbmap.find_entry._match_1 m k (_x.red_node e _x_1) = rbtree.find m (k, e.snd)
- rbmap.find_entry._match_1 m k rbnode.leaf = none
Equations
- rbmap.to_value (some e) = some e.snd
- rbmap.to_value none = none
def
rbmap.find
{α : Type u}
{β : Type v}
{lt : α → α → Prop}
[decidable_rel lt]
(m : rbmap α β lt)
(k : α) :
option β
Equations
- m.find k = rbmap.to_value (m.find_entry k)
def
rbmap.contains
{α : Type u}
{β : Type v}
{lt : α → α → Prop}
[decidable_rel lt]
(m : rbmap α β lt)
(k : α) :
Equations
- m.contains k = (m.find_entry k).is_some
def
rbmap.from_list
{α : Type u}
{β : Type v}
(l : list (α × β))
(lt : α → α → Prop . "default_lt")
[decidable_rel lt] :
rbmap α β lt
Equations
- rbmap.from_list l lt = list.foldl (λ (m : rbmap α β lt) (p : α × β), m.insert p.fst p.snd) (mk_rbmap α β lt) l
def
rbmap_of
{α : Type u}
{β : Type v}
(l : list (α × β))
(lt : α → α → Prop . "default_lt")
[decidable_rel lt] :
rbmap α β lt
Equations
- rbmap_of l lt = rbmap.from_list l lt