Basic Definitions for RefinedDiscrTree #
Definitions #
Discrimination tree key.
- star : Nat → Key
A metavariable. This key matches with anything. It stores an index.
- opaque : Key
An opaque variable. This key only matches with itself or
Key.star. - const : Name → Nat → Key
A constant. It stores the name and the arity.
- fvar : FVarId → Nat → Key
A free variable. It stores the
FVarIdand the arity. - bvar : Nat → Nat → Key
A bound variable, from a lambda or forall binder. It stores the De Bruijn index and the arity.
- lit : Literal → Key
A literal.
- sort : Key
A sort. Universe levels are ignored.
- lam : Key
A lambda function.
- forall : Key
A dependent arrow.
- proj : Name → Nat → Nat → Key
A projection. It stores the structure name, the projection index and the arity.
Instances For
Equations
Equations
Equations
Equations
Constructor index used for ordering Key.
Note that the index of the star pattern is 0, so that when looking up in a Trie,
we can look at the start of the sorted array for all .star patterns.
Equations
- (Lean.Meta.RefinedDiscrTree.Key.star a).ctorIdx = 0
- Lean.Meta.RefinedDiscrTree.Key.opaque.ctorIdx = 1
- (Lean.Meta.RefinedDiscrTree.Key.const a a_1).ctorIdx = 2
- (Lean.Meta.RefinedDiscrTree.Key.fvar a a_1).ctorIdx = 3
- (Lean.Meta.RefinedDiscrTree.Key.bvar a a_1).ctorIdx = 4
- (Lean.Meta.RefinedDiscrTree.Key.lit a).ctorIdx = 5
- Lean.Meta.RefinedDiscrTree.Key.sort.ctorIdx = 6
- Lean.Meta.RefinedDiscrTree.Key.lam.ctorIdx = 7
- Lean.Meta.RefinedDiscrTree.Key.forall.ctorIdx = 8
- (Lean.Meta.RefinedDiscrTree.Key.proj a a_1 a_2).ctorIdx = 9
Instances For
Equations
- Lean.Meta.RefinedDiscrTree.instLTKey = { lt := fun (a b : Lean.Meta.RefinedDiscrTree.Key) => Lean.Meta.RefinedDiscrTree.Key.lt✝ a b = true }
Equations
Return the number of arguments that the Key takes.
Equations
- (Lean.Meta.RefinedDiscrTree.Key.const a a_1).arity = a_1
- (Lean.Meta.RefinedDiscrTree.Key.fvar a a_1).arity = a_1
- (Lean.Meta.RefinedDiscrTree.Key.bvar a a_1).arity = a_1
- Lean.Meta.RefinedDiscrTree.Key.lam.arity = 1
- Lean.Meta.RefinedDiscrTree.Key.forall.arity = 2
- (Lean.Meta.RefinedDiscrTree.Key.proj a a_1 a_2).arity = 1 + a_2
- x✝.arity = 0
Instances For
Equations
Trie.path constructor that only inserts the path if it is non-empty.
Equations
- Lean.Meta.RefinedDiscrTree.Trie.mkPath keys child = if keys.isEmpty = true then child else Lean.Meta.RefinedDiscrTree.Trie.path keys child
Instances For
Trie constructor for a single value, taking the keys starting at index i.
Equations
- Lean.Meta.RefinedDiscrTree.Trie.singleton keys value i = Lean.Meta.RefinedDiscrTree.Trie.mkPath (let a := keys; ↑(a.toSubarray i)) (Lean.Meta.RefinedDiscrTree.Trie.values #[value])
Instances For
Return the values from a Trie α, assuming that it is a leaf
Equations
- (Lean.Meta.RefinedDiscrTree.Trie.values vs).values! = vs
- x✝.values! = panicWithPosWithDecl "Mathlib.Lean.Meta.RefinedDiscrTree.Basic" "Lean.Meta.RefinedDiscrTree.Trie.values!" 139 9 "expected .values constructor"
Instances For
Return the children of a Trie α, assuming that it is not a leaf.
The result is sorted by the Key's
Equations
- One or more equations did not get rendered due to their size.
- (Lean.Meta.RefinedDiscrTree.Trie.node cs).children! = cs
- (Lean.Meta.RefinedDiscrTree.Trie.path ks c).children! = #[(ks[0]!, Lean.Meta.RefinedDiscrTree.Trie.mkPath (let a := ks; ↑(a.toSubarray 1)) c)]
Instances For
Equations
Discrimination tree. It is an index from expressions to values of type α.
- root : PersistentHashMap Key (Trie α)
The underlying
PersistentHashMapof aRefinedDiscrTree.
Instances For
Equations
- Lean.Meta.RefinedDiscrTree.instInhabited = { default := { root := { root := Lean.PersistentHashMap.Node.entries Lean.PersistentHashMap.mkEmptyEntriesArray } } }