Lazy Discrimination Tree #
This file defines a new type of discrimination tree optimized for rapid population of imported modules for use in tactics. It uses a lazy initialization strategy.
The discrimination tree can be created through
createImportedEnvironment
. This creates a discrimination tree from all
imported modules in an environment using a callback that provides the
entries as InitEntry
values.
The function getMatch
can be used to get the values that match the
expression as well as an updated lazy discrimination tree that has
elaborated additional parts of the tree.
Equations
- Lean.Meta.LazyDiscrTree.MatchClone.instInhabitedKey = { default := Lean.Meta.LazyDiscrTree.MatchClone.Key.const default default }
Hash function
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.Meta.LazyDiscrTree.instInhabitedTrie = { default := { values := default, star := default, children := default, pending := default } }
LazyDiscrTree
is a variant of the discriminator tree datatype
DiscrTree
in Lean core that is designed to be efficiently
initializable with a large number of patterns. This is useful
in contexts such as searching an entire Lean environment for
expressions that match a pattern.
Lazy discriminator trees achieve good performance by minimizing the amount of work that is done up front to build the discriminator tree. When first adding patterns to the tree, only the root discriminator key is computed and processing the remaining terms is deferred until demanded by a match.
- config : Lean.Meta.WhnfCoreConfig
Configuration for normalization.
- tries : Array (Lean.Meta.LazyDiscrTree.Trie α)
Backing array of trie entries. Should be owned by this trie.
Map from discriminator trie roots to the index.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Find values that match e
in d
.
The results are ordered so that the longest matches in terms of number of non-star keys are first with ties going to earlier operators first.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.Meta.LazyDiscrTree.instInhabitedPreDiscrTree = { default := { roots := default, tries := default } }
Merge two discrimination trees.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.Meta.LazyDiscrTree.PreDiscrTree.instAppendPreDiscrTree = { append := Lean.Meta.LazyDiscrTree.PreDiscrTree.append }
Initial entry in lazy discrimination tree
Return root key for an entry.
- entry : Lean.Meta.LazyDiscrTree.LazyEntry α
Returns rest of entry for later insertion.
Instances For
Constructs an initial entry from an expression and value.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Creates an entry for a subterm of an initial entry.
This is slightly more efficient than using fromExpr
on subterms since it avoids a redundant call
to whnf
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
- ngen : Lean.NameGenerator
- core : Lean.Core.Cache
- meta : Lean.Meta.Cache
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Combine two initial results.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.Meta.LazyDiscrTree.InitResults.instAppendInitResults = { append := Lean.Meta.LazyDiscrTree.InitResults.append }
Create an imported environment for tree.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Allocate constants to tasks according to constantsPerTask
.
Equations
- One or more equations did not get rendered due to their size.