The areas / V01. The language of Mathlib
Mathlib.Lean.Meta.RefinedDiscrTree.Initialize
24 declarations. Mathlib docs · Source
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.
theorem Lean.Meta.RefinedDiscrTree.PreDiscrTree.mk.inj E1 #
∀ {α : Type} {root : Std.HashMap Lean.Meta.RefinedDiscrTree.Key ℕ}
{tries : Array (Array (Lean.Meta.RefinedDiscrTree.LazyEntry × α))}
{root_1 : Std.HashMap Lean.Meta.RefinedDiscrTree.Key ℕ}
{tries_1 : Array (Array (Lean.Meta.RefinedDiscrTree.LazyEntry × α))},
{ root := root, tries := tries } = { root := root_1, tries := tries_1 } → root = root_1 ∧ tries = tries_1
theorem Lean.Meta.RefinedDiscrTree.ModuleDiscrTreeRef.mk.injEq E0 #
∀ {α : Type} (ref ref_1 : IO.Ref (Lean.Meta.RefinedDiscrTree α)), ({ ref := ref } = { ref := ref_1 }) = (ref = ref_1)
def Lean.Meta.RefinedDiscrTree.PreDiscrTree.ctorIdx E1 #
{α : Type} → Lean.Meta.RefinedDiscrTree.PreDiscrTree α → ℕ
def Lean.Meta.RefinedDiscrTree.instInhabitedPreDiscrTree.default E1 #
{α : Type} → Lean.Meta.RefinedDiscrTree.PreDiscrTree α
def Lean.Meta.RefinedDiscrTree.ModuleDiscrTreeRef.ctorIdx E1 #
{α : Type} → Lean.Meta.RefinedDiscrTree.ModuleDiscrTreeRef α → ℕ
theorem Lean.Meta.RefinedDiscrTree.ModuleDiscrTreeRef.mk.inj E1 #
∀ {α : Type} {ref ref_1 : IO.Ref (Lean.Meta.RefinedDiscrTree α)}, { ref := ref } = { ref := ref_1 } → ref = ref_1
theorem Lean.Meta.RefinedDiscrTree.PreDiscrTree.mk.injEq E0 #
∀ {α : Type} (root : Std.HashMap Lean.Meta.RefinedDiscrTree.Key ℕ)
(tries : Array (Array (Lean.Meta.RefinedDiscrTree.LazyEntry × α)))
(root_1 : Std.HashMap Lean.Meta.RefinedDiscrTree.Key ℕ)
(tries_1 : Array (Array (Lean.Meta.RefinedDiscrTree.LazyEntry × α))),
({ root := root, tries := tries } = { root := root_1, tries := tries_1 }) = (root = root_1 ∧ tries = tries_1)
def Lean.Meta.RefinedDiscrTree.insert E1 #
{α : Type} →
Lean.Meta.RefinedDiscrTree α →
Lean.Meta.RefinedDiscrTree.Key → Lean.Meta.RefinedDiscrTree.LazyEntry × α → Lean.Meta.RefinedDiscrTree α
Directly insert a Key, LazyEntry pair into a RefinedDiscrTree.
structure Lean.Meta.RefinedDiscrTree.PreDiscrTree E1 #
Type → Type
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.
ctor Lean.Meta.RefinedDiscrTree.PreDiscrTree.mk E0 #
{α : Type} →
Std.HashMap Lean.Meta.RefinedDiscrTree.Key ℕ →
Array (Array (Lean.Meta.RefinedDiscrTree.LazyEntry × α)) → Lean.Meta.RefinedDiscrTree.PreDiscrTree α
abbrev Lean.Meta.RefinedDiscrTree.PreDiscrTree.root E1 #
{α : Type} → Lean.Meta.RefinedDiscrTree.PreDiscrTree α → Std.HashMap Lean.Meta.RefinedDiscrTree.Key ℕ
Maps keys to index in tries array.
abbrev Lean.Meta.RefinedDiscrTree.PreDiscrTree.tries E1 #
{α : Type} → Lean.Meta.RefinedDiscrTree.PreDiscrTree α → Array (Array (Lean.Meta.RefinedDiscrTree.LazyEntry × α))
Lazy entries for root of trie.
instance Lean.Meta.RefinedDiscrTree.instInhabitedPreDiscrTree E0 #
{a : Type} → Inhabited (Lean.Meta.RefinedDiscrTree.PreDiscrTree a)
def Lean.Meta.RefinedDiscrTree.PreDiscrTree.push E1 #
{α : Type} →
Lean.Meta.RefinedDiscrTree.PreDiscrTree α →
Lean.Meta.RefinedDiscrTree.Key →
Lean.Meta.RefinedDiscrTree.LazyEntry × α → Lean.Meta.RefinedDiscrTree.PreDiscrTree α
Add an entry to the PreDiscrTree.
def Lean.Meta.RefinedDiscrTree.PreDiscrTree.toRefinedDiscrTree E1 #
{α : Type} → Lean.Meta.RefinedDiscrTree.PreDiscrTree α → Lean.Meta.RefinedDiscrTree α
Convert a PreDiscrTree to a RefinedDiscrTree.
def Lean.Meta.RefinedDiscrTree.PreDiscrTree.append E1 #
{α : Type} →
Lean.Meta.RefinedDiscrTree.PreDiscrTree α →
Lean.Meta.RefinedDiscrTree.PreDiscrTree α → Lean.Meta.RefinedDiscrTree.PreDiscrTree α
Merge two PreDiscrTrees.
instance Lean.Meta.RefinedDiscrTree.PreDiscrTree.instAppend E0 #
{α : Type} → Append (Lean.Meta.RefinedDiscrTree.PreDiscrTree α)
def Lean.Meta.RefinedDiscrTree.blacklistInsertion E1 #
Lean.Environment → Lean.Name → Bool
Return true if declName is automatically generated,
or otherwise unsuitable as a lemma suggestion.
def Lean.Meta.RefinedDiscrTree.createImportedDiscrTree E1 #
{α : Type} →
Lean.NameGenerator →
Lean.Environment →
(Lean.Name →
Lean.ConstantInfo →
Lean.MetaM (List (α × List (Lean.Meta.RefinedDiscrTree.Key × Lean.Meta.RefinedDiscrTree.LazyEntry)))) →
ℕ → ℕ → Lean.CoreM (Lean.Meta.RefinedDiscrTree α)
Create a RefinedDiscrTree consisting of all entries generated by act
from imported constants; addConstToPreDiscrTree calls this helper.
This uses parallel computation.
structure Lean.Meta.RefinedDiscrTree.ModuleDiscrTreeRef E1 #
Type → Type
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.
ctor Lean.Meta.RefinedDiscrTree.ModuleDiscrTreeRef.mk E0 #
{α : Type} → IO.Ref (Lean.Meta.RefinedDiscrTree α) → Lean.Meta.RefinedDiscrTree.ModuleDiscrTreeRef α
abbrev Lean.Meta.RefinedDiscrTree.ModuleDiscrTreeRef.ref E1 #
{α : Type} → Lean.Meta.RefinedDiscrTree.ModuleDiscrTreeRef α → IO.Ref (Lean.Meta.RefinedDiscrTree α)
The reference to the RefinedDiscrTree.
def Lean.Meta.RefinedDiscrTree.createModuleDiscrTree E1 #
{α : Type} →
(Lean.Name →
Lean.ConstantInfo →
Lean.MetaM (List (α × List (Lean.Meta.RefinedDiscrTree.Key × Lean.Meta.RefinedDiscrTree.LazyEntry)))) →
Lean.CoreM (Lean.Meta.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.
def Lean.Meta.RefinedDiscrTree.createModuleTreeRef E1 #
{α : Type} →
(Lean.Name →
Lean.ConstantInfo →
Lean.MetaM (List (α × List (Lean.Meta.RefinedDiscrTree.Key × Lean.Meta.RefinedDiscrTree.LazyEntry)))) →
Lean.MetaM (Lean.Meta.RefinedDiscrTree.ModuleDiscrTreeRef α)
Create a reference for a RefinedDiscrTree for current module declarations.