Documentation

Lean.Meta.Tactic.Grind.EMatch

This module implements a simple E-matching procedure as a backtracking search.

We represent an E-matching problem as a list of constraints.

Instances For

    Choice point for the backtracking search. The state of the procedure contains a stack of choices.

    • cnstrs : List Cnstr

      Constraints to be processed.

    • gen : Nat

      Maximum term generation found so far.

    • assignment : Array Expr

      Partial assignment so far. Recall that pattern variables are encoded as de-Bruijn variables.

    Instances For

      Context for the E-matching monad.

      • useMT : Bool

        useMT is true if we are using the mod-time optimization. It is always set to false for new EMatchTheorems.

      • EMatchTheorem being processed.

      • initApp : Expr

        Initial application used to start E-matching

      Instances For
        @[reducible, inline]

        A mapping uniqueId ↦ thm, where uniqueId is an auxiliary marker used to wrap a theorem instantiation proof of thm using a Expr.mdata. The uniqueIds are created using mkFreshId.

        Equations
          Instances For

            Returns some uniqueId if proof was marked using markTheoremInstanceProof

            Equations
              Instances For

                State for the E-matching monad

                • choiceStack : List Choice

                  Choices that still have to be processed.

                • instanceMap : InstanceMap

                  When tracing is enabled track instances here. See comment at InstanceMap

                Instances For
                  @[reducible, inline]
                  Equations
                    Instances For
                      def Lean.Meta.Grind.EMatch.M.run' {α : Type} (x : M α) :
                      Equations
                        Instances For
                          Equations
                            Instances For

                              Similar to reportIssue!, but only reports issue if grind.debug is set to true

                              Equations
                                Instances For

                                  Helper function for checking grind pattern constraints of the form size e < threshold Implicit arguments and type information in lambdas and let-expressions are ignored.

                                  Equations
                                    Instances For

                                      Performs one round of E-matching, and returns true if new instances were generated. Recall that the mapping is nonempty only if tracing is enabled.

                                      Equations
                                        Instances For

                                          Performs one round of E-matching, and returns true if new instances were generated.

                                          Equations
                                            Instances For

                                              Performs one round of E-matching using the giving theorems, and returns true if new instances were generated.

                                              Equations
                                                Instances For