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 #

partial def Lean.Meta.RefinedDiscrTree.insertInTrie {α : Type} [BEq α] (keys : Array Key) (v : α) (i : ) :
Trie αTrie α

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 : RefinedDiscrTree α) (e : Expr) (v : α) (onlySpecific : Bool := true) (fvarInContext : FVarIdBool := fun (x : 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 : RefinedDiscrTree α) (lhs rhs : Expr) (vLhs vRhs : α) (onlySpecific : Bool := true) (fvarInContext : FVarIdBool := fun (x : 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
          partial def Lean.Meta.RefinedDiscrTree.Trie.mapArraysM {α β : Type} {m : TypeType} [Monad m] (t : Trie α) (f : Array αm (Array β)) :
          m (Trie β)

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

          def Lean.Meta.RefinedDiscrTree.mapArraysM {α β : Type} {m : TypeType} [Monad m] (d : RefinedDiscrTree α) (f : Array αm (Array β)) :

          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