Documentation

Mathlib.Lean.Meta.RefinedDiscrTree.Encode

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

@[inline]

Encode e as a sequence of keys, computing only the first Key.

Instances For

    Encode e as a sequence of keys, computing only the first Key.

    Instances For

      A single step in evaluating a LazyEntry. Allow multiple different outcomes.

      Instances For

        Return all encodings of e as a Array Key. This is used for testing.

        Instances For

          Completely evaluate a LazyEntry.

          Return the canonical encoding of e as a Array Key. This is used for looking up e in a RefinedDiscrTree.

          Instances For