Documentation

Lean.Meta.Tactic.Grind.Types

We use this auxiliary constant to mark delayed congruence proofs.

Equations
Instances For

    Returns true if e is True, False, or a literal value. See LitValues for supported literals.

    Equations
    Instances For

      Context for GrindM monad.

      Instances For

        Key for the congruence theorem cache.

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

          State for the GrindM monad.

          Instances For

            Returns the user-defined configuration options

            Equations
            Instances For

              Returns the internalized True constant.

              Equations
              Instances For

                Returns the internalized False constant.

                Equations
                Instances For

                  Returns maximum term generation that is considered during ematching.

                  Equations
                  Instances For

                    Abtracts nested proofs in e. This is a preprocessing step performed before internalization.

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

                      Applies hash-consing to e. Recall that all expressions in a grind goal have been hash-consing. We perform this step before we internalize expressions.

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

                        Canonicalizes nested types, type formers, and instances in e.

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

                          Returns true if e is the internalized True expression.

                          Equations
                          Instances For

                            Returns true if e is the internalized False expression.

                            Equations
                            Instances For

                              Creates a congruence theorem for a f-applications with numArgs arguments.

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

                                Stores information for a node in the egraph. Each internalized expression e has an ENode associated with it.

                                • self : Lean.Expr

                                  Node represented by this ENode.

                                • next : Lean.Expr

                                  Next element in the equivalence class.

                                • root : Lean.Expr

                                  Root (aka canonical representative) of the equivalence class

                                • congr : Lean.Expr

                                  congr is the term self is congruent to. We say self is the congruence class root if isSameExpr congr self. This field is initialized to self even if e is not an application.

                                • target? : Option Lean.Expr

                                  When e was added to this equivalence class because of an equality h : e = target, then we store target here, and h at proof?.

                                • proof? : Option Lean.Expr
                                • flipped : Bool

                                  Proof has been flipped.

                                • size : Nat

                                  Number of elements in the equivalence class, this field is meaningless if node is not the root.

                                • interpreted : Bool

                                  interpreted := true if node should be viewed as an abstract value.

                                • ctor : Bool

                                  ctor := true if the head symbol is a constructor application.

                                • hasLambdas : Bool

                                  hasLambdas := true if equivalence class contains lambda expressions.

                                • heqProofs : Bool

                                  If heqProofs := true, then some proofs in the equivalence class are based on heterogeneous equality.

                                • idx : Nat

                                  Unique index used for pretty printing and debugging purposes.

                                • generation : Nat
                                • mt : Nat

                                  Modification time

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

                                    New equality to be processed.

                                    Instances For

                                      Key for the congruence table. We need access to the enodes to be able to retrieve the equivalence class roots.

                                      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
                                            Equations
                                            • One or more equations did not get rendered due to their size.
                                            Instances For

                                              Returns true if a and b are congruent modulo the equivalence classes in enodes.

                                              Equations
                                              • One or more equations did not get rendered due to their size.
                                              Instances For
                                                def Lean.Meta.Grind.isCongruent.goEq (enodes : Lean.Meta.Grind.ENodeMap) (lhs₁ rhs₁ lhs₂ rhs₂ : Lean.Expr) :
                                                Equations
                                                • One or more equations did not get rendered due to their size.
                                                Instances For
                                                  @[reducible, inline]
                                                  Equations
                                                  Instances For

                                                    The E-matching module instantiates theorems using the EMatchTheorem proof and a (partial) assignment. We want to avoid instantiating the same theorem with the same assignment more than once. Therefore, we store the (pre-)instance information in set. Recall that the proofs of activated theorems have been hash-consed. The assignment contains internalized expressions, which have also been hash-consed.

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

                                                      New fact to be processed.

                                                      Instances For
                                                        Instances For
                                                          Equations
                                                          • One or more equations did not get rendered due to their size.
                                                          Equations
                                                          • goal.admit = goal.mvarId.admit
                                                          Instances For
                                                            @[inline]
                                                            Equations
                                                            Instances For
                                                              @[inline]
                                                              Equations
                                                              Instances For

                                                                A helper function used to mark a theorem instance found by the E-matching module. It returns true if it is a new instance and false otherwise.

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

                                                                  Adds a new fact prop with proof proof to the queue for processing.

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

                                                                    Adds a new theorem instance produced using E-matching.

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

                                                                      Returns true if the maximum number of instances has been reached.

                                                                      Equations
                                                                      Instances For

                                                                        Returns some n if e has already been "internalized" into the Otherwise, returns nones.

                                                                        Equations
                                                                        Instances For

                                                                          Returns node associated with e. It assumes e has already been internalized.

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

                                                                            Returns the generation of the given term. Is assumes it has been internalized

                                                                            Equations
                                                                            Instances For

                                                                              Returns true if e is in the equivalence class of True.

                                                                              Equations
                                                                              Instances For

                                                                                Returns true if e is in the equivalence class of False.

                                                                                Equations
                                                                                Instances For

                                                                                  Returns true if a and b are in the same equivalence class.

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

                                                                                    Returns true if the root of its equivalence class.

                                                                                    Equations
                                                                                    Instances For

                                                                                      Returns the root element in the equivalence class of e IF e has been internalized.

                                                                                      Equations
                                                                                      Instances For

                                                                                        Returns the root element in the equivalence class of e.

                                                                                        Equations
                                                                                        Instances For

                                                                                          Returns the root enode in the equivalence class of e.

                                                                                          Equations
                                                                                          Instances For

                                                                                            Returns the next element in the equivalence class of e.

                                                                                            Equations
                                                                                            Instances For

                                                                                              Returns true if e has already been internalized.

                                                                                              Equations
                                                                                              Instances For
                                                                                                Equations
                                                                                                Instances For

                                                                                                  If isHEq is false, it pushes lhs = rhs with proof to newEqs. Otherwise, it pushes HEq lhs rhs.

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

                                                                                                    Return true if a and b have the same type.

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

                                                                                                        Pushes lhs = rhs with proof to newEqs.

                                                                                                        Equations
                                                                                                        Instances For
                                                                                                          @[inline]

                                                                                                          Pushes HEq lhs rhs with proof to newEqs.

                                                                                                          Equations
                                                                                                          Instances For

                                                                                                            Pushes a = True with proof to newEqs.

                                                                                                            Equations
                                                                                                            Instances For

                                                                                                              Pushes a = False with proof to newEqs.

                                                                                                              Equations
                                                                                                              Instances For

                                                                                                                Records that parent is a parent of child. This function actually stores the information in the root (aka canonical representative) of child.

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

                                                                                                                  Returns the set of expressions e is a child of, or an expression in es equivalence class is a child of. The information is only up to date if e is the root (aka canonical representative) of the equivalence class.

                                                                                                                  Equations
                                                                                                                  Instances For

                                                                                                                    Similar to getParents, but also removes the entry eparents from the parent map.

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

                                                                                                                      Copy parents to the parents of root. root must be the root of its equivalence class.

                                                                                                                      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
                                                                                                                          def Lean.Meta.Grind.mkENodeCore (e : Lean.Expr) (interpreted ctor : Bool) (generation : Nat) :
                                                                                                                          Equations
                                                                                                                          • One or more equations did not get rendered due to their size.
                                                                                                                          Instances For

                                                                                                                            Creates an ENode for e if one does not already exist. This method assumes e has been hashconsed.

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

                                                                                                                              Returns true is e is the root of its congruence class.

                                                                                                                              Equations
                                                                                                                              Instances For

                                                                                                                                Returns the root of the congruence class containing e.

                                                                                                                                Return true if the goal is inconsistent.

                                                                                                                                Equations
                                                                                                                                Instances For
                                                                                                                                  @[extern lean_grind_mk_eq_proof]

                                                                                                                                  Returns a proof that a = b. It assumes a and b are in the same equivalence class, and have the same type.

                                                                                                                                  @[extern lean_grind_mk_heq_proof]

                                                                                                                                  Returns a proof that HEq a b. It assumes a and b are in the same equivalence class.

                                                                                                                                  Returns a proof that a = b if they have the same type. Otherwise, returns a proof of HEq a b. It assumes a and b are in the same equivalence class.

                                                                                                                                  Equations
                                                                                                                                  Instances For

                                                                                                                                    Returns a proof that a = True. It assumes a and True are in the same equivalence class.

                                                                                                                                    Equations
                                                                                                                                    Instances For

                                                                                                                                      Returns a proof that a = False. It assumes a and False are in the same equivalence class.

                                                                                                                                      Equations
                                                                                                                                      Instances For

                                                                                                                                        Marks current goal as inconsistent without assigning mvarId.

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

                                                                                                                                          Closes the current goal using the given proof of False and marks it as inconsistent if it is not already marked so.

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

                                                                                                                                            Returns all enodes in the goal

                                                                                                                                            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
                                                                                                                                                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
                                                                                                                                                    Equations
                                                                                                                                                    Equations
                                                                                                                                                    Instances For
                                                                                                                                                      Equations
                                                                                                                                                      Instances For
                                                                                                                                                        Equations
                                                                                                                                                        Instances For

                                                                                                                                                          Returns expressions in the given expression equivalence class.

                                                                                                                                                          Equations
                                                                                                                                                          Instances For

                                                                                                                                                            Returns all equivalence classes in the current goal.

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