Documentation

Mathlib.Lean.Meta.RefinedDiscrTree

We define discrimination trees for the purpose of unifying local expressions with library results.

This structure is based on Lean.Meta.DiscrTree. I document here what features are not in the original:

I have also made some changes in the implementation:

TODO:

Inserting intro a RefinedDiscrTree #

Insert the value v at index keys : Array Key in a Trie.

Insert the value v at index keys : Array Key in a RefinedDiscrTree.

Warning: to account for η-reduction, an entry may need to be added at multiple indexes, so it is recommended to use RefinedDiscrTree.insert for insertion.

Equations
  • One or more equations did not get rendered due to their size.
Instances For

    Insert the value v at index e : DTExpr in a RefinedDiscrTree.

    Warning: to account for η-reduction, an entry may need to be added at multiple indexes, so it is recommended to use RefinedDiscrTree.insert for insertion.

    Equations
    • d.insertDTExpr e v = d.insertInRefinedDiscrTree e.flatten v
    Instances For
      def Lean.Meta.RefinedDiscrTree.insert {α : Type} [BEq α] (d : Lean.Meta.RefinedDiscrTree α) (e : Lean.Expr) (v : α) (onlySpecific : Bool := true) (fvarInContext : Lean.FVarIdBool := fun (x : Lean.FVarId) => false) :

      Insert the value v at index e : Expr in a RefinedDiscrTree. The argument fvarInContext allows you to specify which free variables in e will still be in the context when the RefinedDiscrTree is being used for lookup. It should return true only if the RefinedDiscrTree is built and used locally.

      if onlySpecific := true, then we filter out the patterns * and Eq * * *.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        def Lean.Meta.RefinedDiscrTree.insertEqn {α : Type} [BEq α] (d : Lean.Meta.RefinedDiscrTree α) (lhs rhs : Lean.Expr) (vLhs vRhs : α) (onlySpecific : Bool := true) (fvarInContext : Lean.FVarIdBool := fun (x : Lean.FVarId) => false) :

        Insert the value vLhs at index lhs, and if rhs is indexed differently, then also insert the value vRhs at index rhs.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For

          Apply a monadic function to the array of values at each node in a RefinedDiscrTree.

          Apply a monadic function to the array of values at each node in a RefinedDiscrTree.

          Equations
          Instances For

            Apply a function to the array of values at each node in a RefinedDiscrTree.

            Equations
            • d.mapArrays f = d.mapArraysM f
            Instances For