Low-level implementation of the size-bounded tree #
This file contains the basic definition implementing the functionality of the size-bounded trees.
Returns the tree l ++ ⟨k, v⟩ ++ r
, with the smallest element chopped off.
Equations
- One or more equations did not get rendered due to their size.
- Std.DTreeMap.Internal.Impl.minView k v Std.DTreeMap.Internal.Impl.leaf r hl_2 hr hlr_2 = { k := k, v := v, tree := { impl := r, balanced_impl := hr, size_impl := ⋯ } }
Instances For
Slower version of minView
which can be used in the absence of balance information but still
assumes the preconditions of minView
, otherwise might panic.
Equations
- One or more equations did not get rendered due to their size.
- Std.DTreeMap.Internal.Impl.minView! k v Std.DTreeMap.Internal.Impl.leaf r = { k := k, v := v, tree := r }
Instances For
Returns the tree l ++ ⟨k, v⟩ ++ r
, with the largest element chopped off.
Equations
- One or more equations did not get rendered due to their size.
- Std.DTreeMap.Internal.Impl.maxView k v l Std.DTreeMap.Internal.Impl.leaf hl hr_2 hlr_2 = { k := k, v := v, tree := { impl := l, balanced_impl := hl, size_impl := ⋯ } }
Instances For
Slower version of maxView
which can be used in the absence of balance information but still
assumes the preconditions of maxView
, otherwise might panic.
Equations
- One or more equations did not get rendered due to their size.
- Std.DTreeMap.Internal.Impl.maxView! k v l Std.DTreeMap.Internal.Impl.leaf = { k := k, v := v, tree := l }
Instances For
Constructs the tree l ++ r
.
Equations
- One or more equations did not get rendered due to their size.
- Std.DTreeMap.Internal.Impl.leaf.glue r hl_2 hr hlr_2 = r
- (Std.DTreeMap.Internal.Impl.inner size k' v' l' r').glue Std.DTreeMap.Internal.Impl.leaf hl_2 hr_2 hlr_3 = Std.DTreeMap.Internal.Impl.inner size k' v' l' r'
Instances For
Slower version of glue
which can be used in the absence of balance information but still
assumes the preconditions of glue
, otherwise might panic.
Equations
- One or more equations did not get rendered due to their size.
- Std.DTreeMap.Internal.Impl.leaf.glue! r = r
- (Std.DTreeMap.Internal.Impl.inner sz' k' v' l'' r'').glue! Std.DTreeMap.Internal.Impl.leaf = Std.DTreeMap.Internal.Impl.inner sz' k' v' l'' r''
Instances For
Slower version of insertMin
which can be used in the absence of balance information but
still assumes the preconditions of insertMin
, otherwise might panic.
Equations
- Std.DTreeMap.Internal.Impl.insertMin! k v Std.DTreeMap.Internal.Impl.leaf = Std.DTreeMap.Internal.Impl.inner 1 k v Std.DTreeMap.Internal.Impl.leaf Std.DTreeMap.Internal.Impl.leaf
- Std.DTreeMap.Internal.Impl.insertMin! k v (Std.DTreeMap.Internal.Impl.inner size k' v' l' r') = Std.DTreeMap.Internal.Impl.balanceL! k' v' (Std.DTreeMap.Internal.Impl.insertMin! k v l') r'
Instances For
Slower version of insertMax
which can be used in the absence of balance information but
still assumes the preconditions of insertMax
, otherwise might panic.
Equations
- Std.DTreeMap.Internal.Impl.insertMax! k v Std.DTreeMap.Internal.Impl.leaf = Std.DTreeMap.Internal.Impl.inner 1 k v Std.DTreeMap.Internal.Impl.leaf Std.DTreeMap.Internal.Impl.leaf
- Std.DTreeMap.Internal.Impl.insertMax! k v (Std.DTreeMap.Internal.Impl.inner size k' v' l' r') = Std.DTreeMap.Internal.Impl.balanceR! k' v' l' (Std.DTreeMap.Internal.Impl.insertMax! k v r')
Instances For
Builds the tree l ++ ⟨k, v⟩ ++ r
without any balancing information at the root.
Equations
- One or more equations did not get rendered due to their size.
- Std.DTreeMap.Internal.Impl.link k v Std.DTreeMap.Internal.Impl.leaf r hr_2 hr = { impl := (Std.DTreeMap.Internal.Impl.insertMin k v r ⋯).impl, balanced_impl := ⋯, size_impl := ⋯ }
Instances For
Slower version of link
which can be used in the absence of balance information but
still assumes the preconditions of link
, otherwise might panic.
Equations
- One or more equations did not get rendered due to their size.
- Std.DTreeMap.Internal.Impl.link! k v Std.DTreeMap.Internal.Impl.leaf r = Std.DTreeMap.Internal.Impl.insertMin! k v r
Instances For
Builds the tree l ++ r
without any balancing information at the root.
Equations
- One or more equations did not get rendered due to their size.
- Std.DTreeMap.Internal.Impl.leaf.link2 r hr_2 hr = { impl := r, balanced_impl := ⋯, size_impl := ⋯ }
Instances For
Slower version of link2
which can be used in the absence of balance information but
still assumes the preconditions of link2
, otherwise might panic.
Equations
- One or more equations did not get rendered due to their size.
- Std.DTreeMap.Internal.Impl.leaf.link2! r = r
- (Std.DTreeMap.Internal.Impl.inner sz' k' v' l'' r'').link2! Std.DTreeMap.Internal.Impl.leaf = Std.DTreeMap.Internal.Impl.inner sz' k' v' l'' r''
Instances For
Modification operations #
An empty tree.
Instances For
Adds a new mapping to the key, overwriting an existing one with equal key if present.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Slower version of insert
which can be used in the absence of balance information but
still assumes the preconditions of insert
, otherwise might panic.
Equations
- One or more equations did not get rendered due to their size.
- Std.DTreeMap.Internal.Impl.insert! k v Std.DTreeMap.Internal.Impl.leaf = Std.DTreeMap.Internal.Impl.inner 1 k v Std.DTreeMap.Internal.Impl.leaf Std.DTreeMap.Internal.Impl.leaf
Instances For
Equations
Instances For
Slower version of containsThenInsert
which can be used in the absence of balance
information but still assumes the preconditions of containsThenInsert
, otherwise might panic.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Adds a new mapping to the tree, leaving the tree unchanged if the key is already present.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Slower version of insertIfNew
which can be used in the absence of balance
information but still assumes the preconditions of insertIfNew
, otherwise might panic.
Equations
Instances For
Returns the pair (t.contains k, t.insertIfNew k v)
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Slower version of containsThenInsertIfNew
which can be used in the absence of balance
information but still assumes the preconditions of containsThenInsertIfNew
, otherwise might panic.
Equations
Instances For
Implementation detail of the tree map
Equations
Instances For
Slower version of getThenInsertIfNew?
which can be used in the absence of balance
information but still assumes the preconditions of getThenInsertIfNew?
, otherwise might panic.
Equations
Instances For
Removes the mapping with key k
, if it exists.
Equations
- One or more equations did not get rendered due to their size.
- Std.DTreeMap.Internal.Impl.erase k Std.DTreeMap.Internal.Impl.leaf hr_1 = { impl := Std.DTreeMap.Internal.Impl.leaf, balanced_impl := ⋯, lb_le_size_impl := ⋯, size_impl_le_ub := ⋯ }
Instances For
Slower version of erase
which can be used in the absence of balance
information but still assumes the preconditions of erase
, otherwise might panic.
Equations
- One or more equations did not get rendered due to their size.
- Std.DTreeMap.Internal.Impl.erase! k Std.DTreeMap.Internal.Impl.leaf = Std.DTreeMap.Internal.Impl.leaf
Instances For
A tree map obtained by erasing elements from t
, bundled with an inductive principle.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A tree map obtained by erasing elements from t
, bundled with an inductive principle.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Slower version of eraseMany
which can be used in absence of balance information but still
assumes the preconditions of eraseMany
, otherwise might panic.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A tree map obtained by inserting elements into t
, bundled with an inductive principle.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Iterate over l
and insert all of its elements into t
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A tree map obtained by inserting elements into t
, bundled with an inductive principle.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Slower version of insertMany
which can be used in absence of balance information but still
assumes the preconditions of insertMany
, otherwise might panic.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A tree map obtained by inserting elements into t
, bundled with an inductive principle.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Iterate over l
and insert all of its elements into t
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A tree map obtained by inserting elements into t
, bundled with an inductive principle.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Slower version of insertMany
which can be used in absence of balance information but still
assumes the preconditions of insertMany
, otherwise might panic.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A tree map obtained by inserting elements into t
, bundled with an inductive principle.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Iterate over l
and insert all of its elements into t
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A tree map obtained by inserting elements into t
, bundled with an inductive principle.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Slower version of insertManyIfNewUnit
which can be used in absence of balance information but still
assumes the preconditions of insertManyIfNewUnit
, otherwise might panic.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Transforms an element of SizedBalancedTree
into a BalancedTree
.
Equations
- t.toBalancedTree = { impl := t.impl, balanced_impl := ⋯ }
Instances For
Slower version of getThenInsertIfNew?
which can be used in the absence of balance
information but still assumes the preconditions of getThenInsertIfNew?
, otherwise might panic.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Transforms a list of mappings into a tree map.
Equations
Instances For
Transforms an array of mappings into a tree map.
Equations
Instances For
Returns the tree consisting of the mappings (k, (f k v).get)
where (k, v)
was a mapping in
the original tree and (f k v).isSome
.
Equations
- One or more equations did not get rendered due to their size.
- Std.DTreeMap.Internal.Impl.filterMap f Std.DTreeMap.Internal.Impl.leaf hr_1 = { impl := Std.DTreeMap.Internal.Impl.leaf, balanced_impl := ⋯ }
Instances For
Slower version of filterMap
which can be used in the absence of balance
information but still assumes the preconditions of filterMap
, otherwise might panic.
Equations
- One or more equations did not get rendered due to their size.
- Std.DTreeMap.Internal.Impl.filterMap! f Std.DTreeMap.Internal.Impl.leaf = Std.DTreeMap.Internal.Impl.leaf
Instances For
Returns the tree consisting of the mappings (k, f k v)
where (k, v)
was a mapping in the
original tree.
Equations
- One or more equations did not get rendered due to their size.
- Std.DTreeMap.Internal.Impl.map f Std.DTreeMap.Internal.Impl.leaf = Std.DTreeMap.Internal.Impl.leaf
Instances For
Monadic version of map
.
Equations
- One or more equations did not get rendered due to their size.
- Std.DTreeMap.Internal.Impl.mapM f Std.DTreeMap.Internal.Impl.leaf = pure Std.DTreeMap.Internal.Impl.leaf
Instances For
Returns the tree consisting of the mapping (k, v)
where (k, v)
was a mapping in the
original tree and f k v = true
.
Equations
- One or more equations did not get rendered due to their size.
- Std.DTreeMap.Internal.Impl.filter f Std.DTreeMap.Internal.Impl.leaf hr_1 = { impl := Std.DTreeMap.Internal.Impl.leaf, balanced_impl := ⋯ }
Instances For
Slower version of filter
which can be used in the absence of balance
information but still assumes the preconditions of filter
, otherwise might panic.
Equations
- One or more equations did not get rendered due to their size.
- Std.DTreeMap.Internal.Impl.filter! f Std.DTreeMap.Internal.Impl.leaf = Std.DTreeMap.Internal.Impl.leaf
Instances For
Changes the mapping of the key k
by applying the function f
to the current mapped value
(if any). This function can be used to insert a new mapping, modify an existing one or delete it.
This version of the function requires LawfulEqOrd α
. There is an alternative non-dependent version
called Const.alter
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Slower version of modify
which can be used in the absence of balance
information but still assumes the preconditions of modify
, otherwise might panic.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Internal implementation detail of the tree map
Equations
- One or more equations did not get rendered due to their size.
- Std.DTreeMap.Internal.Impl.modify k f Std.DTreeMap.Internal.Impl.leaf = Std.DTreeMap.Internal.Impl.leaf
Instances For
Returns a map that contains all mappings of t₁
and t₂
. In case that both maps contain the
same key k
with respect to cmp
, the provided function is used to determine the new value from
the respective values in t₁
and t₂
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Returns a map that contains all mappings of t₁
and t₂
. In case that both maps contain the
same key k
with respect to cmp
, the provided function is used to determine the new value from
the respective values in t₁
and t₂
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Changes the mapping of the key k
by applying the function f
to the current mapped value
(if any). This function can be used to insert a new mapping, modify an existing one or delete it.
This version of the function requires LawfulEqOrd α
. There is an alternative non-dependent version
called Const.alter
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Slower version of modify
which can be used in the absence of balance
information but still assumes the preconditions of modify
, otherwise might panic.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Internal implementation detail of the tree map
Equations
- One or more equations did not get rendered due to their size.
- Std.DTreeMap.Internal.Impl.Const.modify k f Std.DTreeMap.Internal.Impl.leaf = Std.DTreeMap.Internal.Impl.leaf
Instances For
Returns a map that contains all mappings of t₁
and t₂
. In case that both maps contain the
same key k
with respect to cmp
, the provided function is used to determine the new value from
the respective values in t₁
and t₂
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Returns a map that contains all mappings of t₁
and t₂
. In case that both maps contain the
same key k
with respect to cmp
, the provided function is used to determine the new value from
the respective values in t₁
and t₂
.
Equations
- One or more equations did not get rendered due to their size.