Encoding an Expr as a sequence of Keys #
We compute the encoding of an expression in a lazy way.
This means computing only one Key at a time
and storing the state of the remaining computation in a LazyEntry.
Each step is computed by
evalLazyEntryWithEta : LazyEntry → MetaM (Option (List (Key × LazyEntry))).
It returns none when the last Key has already been reached.
The first step, which is used when initializing the tree,
is computed by initializeLazyEntryWithEta.
To compute all the keys at once, we have
encodeExprWithEta, which computes all possible key sequences.encodeExpr, which computes the canonical key sequence. This will be used for expressions that are looked up in aRefinedDiscrTreeusinggetMatch.
def
Lean.Meta.RefinedDiscrTree.initializeLazyEntryWithEta
(e : Expr)
(labelledStars : Bool := true)
:
Encode e as a sequence of keys, computing only the first Key.
Equations
- Lean.Meta.RefinedDiscrTree.initializeLazyEntryWithEta e labelledStars = Lean.Meta.withReducible (Lean.Meta.RefinedDiscrTree.initializeLazyEntryWithEtaAux e labelledStars)