Documentation

Std.Data.DTreeMap.Internal.Def

Low-level implementation of the size-bounded tree #

This file contains the basic definition implementing the functionality of the size-bounded trees.

inductive Std.DTreeMap.Internal.Impl (α : Type u) (β : αType v) :
Type (max u v)

(Implementation detail) The actual inductive type for the size-balanced tree data structure.

  • inner {α : Type u} {β : αType v} (size : Nat) (k : α) (v : β k) (l r : Impl α β) : Impl α β

    (Implementation detail)

  • leaf {α : Type u} {β : αType v} : Impl α β

    (Implementation detail)

Instances For
    @[implicit_reducible]
    instance Std.DTreeMap.Internal.instInhabitedImpl {a✝ : Type u_1} {a✝¹ : a✝Type u_2} :
    Inhabited (Impl a✝ a✝¹)
    def Std.DTreeMap.Internal.instInhabitedImpl.default {a✝ : Type u_1} {a✝¹ : a✝Type u_2} :
    Impl a✝ a✝¹
    Instances For
      @[inline]

      The "delta" parameter of the size-bounded tree. Controls how imbalanced the tree can be.

      Instances For
        @[inline]

        The "ratio" parameter of the size-bounded tree. Controls how aggressive the rebalancing operations are.

        Instances For

          size #

          In contrast to other functions, size is defined here because it is required to define the Balanced predicate (see Std.Data.DTreeMap.Internal.Balanced).

          @[inline]
          def Std.DTreeMap.Internal.Impl.size {α : Type u} {β : αType v} :
          Impl α βNat

          The size information stored in the tree.

          Instances For
            theorem Std.DTreeMap.Internal.Impl.size_leaf {α : Type u} {β : αType v} :
            theorem Std.DTreeMap.Internal.Impl.size_inner {α : Type u} {β : αType v} {sz : Nat} {k : α} {v : β k} {l r : Impl α β} :
            (inner sz k v l r).size = sz

            toListModel #

            toListModel is defined here because it is required to define the Ordered predicate.

            def Std.DTreeMap.Internal.Impl.toListModel {α : Type u} {β : αType v} :
            Impl α βList ((a : α) × β a)

            Flattens a tree into a list of key-value pairs. This function is defined for verification purposes and should not be executed because it is very inefficient.

            Instances For
              @[simp]
              theorem Std.DTreeMap.Internal.Impl.toListModel_inner {α : Type u} {β : αType v} {sz : Nat} {k : α} {v : β k} {l r : Impl α β} :
              def Std.DTreeMap.Internal.Impl.treeSize {α : Type u} {β : αType v} :
              Impl α βNat

              Computes the size of the tree. Used for verification of iterators.

              Instances For