Documentation

Mathlib.Lean.Meta.RefinedDiscrTree.Initialize

Constructing a RefinedDiscrTree #

RefinedDiscrTree is lazy, so to add an entry, we need to compute the first Key and a LazyEntry. These are computed by initializeLazyEntry.

We provide RefinedDiscrTree.insert for directly performing this insert.

For initializing a RefinedDiscrTree using all imported constants, we provide createImportedDiscrTree, which loops through all imported constants, and does this with a parallel computation.

There is also createModuleDiscrTree which does the same but with the constants from the current file.

Directly insert a Key, LazyEntry pair into a RefinedDiscrTree.

Instances For

    Structure for quickly initializing a lazy discrimination tree with a large number of elements using concurrent functions for generating entries.

    This preliminary structure is converted to a RefinedDiscrTree via toRefinedDiscrTree.

    • root : Std.HashMap Key

      Maps keys to index in tries array.

    • tries : Array (Array (LazyEntry × α))

      Lazy entries for root of trie.

    Instances For
      @[implicit_reducible]

      Add an entry to the PreDiscrTree.

      Instances For
        def Lean.Meta.RefinedDiscrTree.blacklistInsertion (env : Environment) (declName : Name) :
        Bool

        Return true if declName is automatically generated, or otherwise unsuitable as a lemma suggestion.

        Instances For
          def Lean.Meta.RefinedDiscrTree.createImportedDiscrTree {α : Type} (ngen : NameGenerator) (env : Environment) (act : NameConstantInfoMetaM (List (α × List (Key × LazyEntry)))) (constantsPerTask capacityPerTask : ) :
          CoreM (RefinedDiscrTree α)

          Create a RefinedDiscrTree consisting of all entries generated by act from imported constants; addConstToPreDiscrTree calls this helper. This uses parallel computation.

          Instances For

            A discriminator tree for the current module's declarations only.

            Note: We use different discrimination trees for imported and current module declarations since imported declarations are typically much more numerous but not changed while the current module is edited.

            Instances For
              def Lean.Meta.RefinedDiscrTree.createModuleDiscrTree {α : Type} (act : NameConstantInfoMetaM (List (α × List (Key × LazyEntry)))) :
              CoreM (RefinedDiscrTree α)

              Create a RefinedDiscrTree for current module declarations, consisting of all entries generated by act from constants in the current file. This is called by addConstToPreDiscrTree.

              Instances For
                def Lean.Meta.RefinedDiscrTree.createModuleTreeRef {α : Type} (act : NameConstantInfoMetaM (List (α × List (Key × LazyEntry)))) :

                Create a reference for a RefinedDiscrTree for current module declarations.

                Instances For