Documentation

Lean.Meta.Tactic.Grind.Extension

Types that grind will case-split on.

Instances For
    Equations
    Instances For

      Inserts declName ↦ prio into s.

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

                Abstracted universe level param names in the rhs

              • numMVars : Nat

                Number of abstracted metavariable in the rhs

              • expr : Expr

                The actual rhs.

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

                    Grind patterns may have constraints associated with them.

                    • notDefEq (lhs : Nat) (rhs : CnstrRHS) : EMatchTheoremConstraint

                      A constraint of the form lhs =/= rhs. The lhs is one of the bound variables, and the rhs an abstract term that must not be definitionally equal to a term t assigned to lhs.

                    • defEq (lhs : Nat) (rhs : CnstrRHS) : EMatchTheoremConstraint

                      A constraint of the form lhs =?= rhs. The lhs is one of the bound variables, and the rhs an abstract term that must be definitionally equal to a term t assigned to lhs.

                    • sizeLt (lhs n : Nat) : EMatchTheoremConstraint

                      A constraint of the form size lhs < n. The lhs is one of the bound variables. The size is computed ignoring implicit terms, but sharing is not taken into account.

                    • depthLt (lhs n : Nat) : EMatchTheoremConstraint

                      A constraint of the form depth lhs < n. The lhs is one of the bound variables. The depth is computed in constant time using the approxDepth field attached to expressions.

                    • genLt (n : Nat) : EMatchTheoremConstraint

                      Instantiates the theorem only if its generation is less than n

                    • isGround (bvarIdx : Nat) : EMatchTheoremConstraint

                      Constraints of the form is_ground x. Instantiates the theorem only if x is ground term.

                    • isValue (bvarIdx : Nat) (strict : Bool) : EMatchTheoremConstraint

                      Constraints of the form is_value x and is_strict_value x. A value is defined as

                      • A constructor fully applied to value arguments.
                      • A literal: numerals, strings, etc.
                      • A lambda. In the strict case, lambdas are not considered.
                    • maxInsts (n : Nat) : EMatchTheoremConstraint

                      Instantiates the theorem only if less than n instances have been generated for this theorem.

                    • guard (e : Expr) : EMatchTheoremConstraint

                      It instructs grind to postpone the instantiation of the theorem until e is known to be true.

                    • check (e : Expr) : EMatchTheoremConstraint

                      Similar to guard, but checks whether e is implied by asserting ¬e.

                    • notValue (bvarIdx : Nat) (strict : Bool) : EMatchTheoremConstraint

                      Constraints of the form not_value x and not_strict_value x. They are the negations of is_value x and is_strict_value x.

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

                          A theorem for heuristic instantiation based on E-matching.

                          • levelParams : Array Name

                            It stores universe parameter names for universe polymorphic proofs. Recall that it is non-empty only when we elaborate an expression provided by the user. When proof is just a constant, we can use the universe parameter names stored in the declaration.

                          • proof : Expr
                          • numParams : Nat
                          • patterns : List Expr
                          • symbols : List HeadIndex

                            Contains all symbols used in patterns.

                          • origin : Origin
                          • The kind is used for generating the patterns. We save it here to implement grind?.

                          • minIndexable : Bool

                            Stores whether patterns were inferred using the minimal indexable subexpression condition.

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

                              A theorem marked with @[grind inj]

                              Instances For
                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  Equations
                                  Instances For
                                    def Lean.Meta.Grind.mkExtension (name : Name := by exact decl_name%) :
                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For
                                      @[reducible, inline]

                                      grind is parametrized by a collection of ExtensionState. The motivation is to allow users to use multiple extensions simultaneously without merging them into a single structure. The collection is scanned linearly. In practice, we expect the array to be very small.

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