Documentation

Auto.Tactic

* : LCtxHyps, * <ident> : Lemma database

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

      Specify constants to unfold. unfolds Must not contain cyclic dependency

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

        Specify constants to collect definitional equality 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
              • 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
                  Instances For
                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      inductive Auto.HintElem :
                      Instances For
                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          Instances For
                            Equations

                            Parse hints to an array of Term, which is still syntax

                            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
                                    • One or more equations did not get rendered due to their size.
                                    Instances For
                                      def Auto.collectLctxLemmas (lctxhyps : Bool) (ngoalAndBinders : Array Lean.FVarId) :
                                      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
                                              • One or more equations did not get rendered due to their size.
                                              Instances For

                                                We assume that all defeq facts have the form ∀ (x₁ : ⋯) ⋯ (xₙ : ⋯), c ... = ... where c is a constant. To avoid whnf from reducing c, we call forallTelescope, then call prepReduceExpr on · All the arguments of c, and · The right-hand side of the equation

                                                Equations
                                                • One or more equations did not get rendered due to their size.
                                                Instances For
                                                  def Auto.traceLemmas (traceClass : Lean.Name) (pre : String) (lemmas : Array Lemma) :
                                                  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
                                                        def Auto.collectAllLemmas (hintstx : Lean.TSyntax `Auto.hints) (uords : Array (Lean.TSyntax `Auto.uord)) (ngoalAndBinders : Array Lean.FVarId) :
                                                        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 the longest common prefix of two substrings. The returned substring will use the same underlying string as s.

                                                            Note: Code taken from Std

                                                            Equations
                                                            Instances For
                                                              @[irreducible]

                                                              Returns the ending position of the common prefix, working up from spos, tpos.

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

                                                                If pre is a prefix of s, i.e. s = pre ++ t, returns the remainder t.

                                                                Equations
                                                                Instances For
                                                                  def Auto.addTryThisTacticSeqSuggestion (ref : Lean.Syntax) (suggestion : Lean.TSyntax `Lean.Parser.Tactic.tacticSeq) (origSpan? : Option Lean.Syntax := none) :
                                                                  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
                                                                        @[reducible, inline]

                                                                        solverHints includes:

                                                                        • unsatCoreDerivLeafStrings an array of Strings that appear as leaves in any derivation for any fact in the unsat core
                                                                        • selectorInfos which is an array of
                                                                          • The SMT selector name (String)
                                                                          • The constructor that the selector is for (Expr)
                                                                          • The index of the argument it is a selector for (Nat)
                                                                          • The type of the selector function (Expr)
                                                                        • preprocessFacts : List Expr
                                                                        • theoryLemmas : List Expr
                                                                        • instantiations : List Expr
                                                                        • computationLemmas : List Expr
                                                                        • polynomialLemmas : List Expr
                                                                        • rewriteFacts : List (List Expr)

                                                                        Note 1: In all fields except selectorInfos, there may be loose bound variables. The loose bound variable #i corresponds to the selector indicated by selectorInfos[i]

                                                                        Note 2: When the external solver is cvc5, all fields can be populated, but when the external solver is Zipperposition, only the first field (unsatCoreDerivLeafStrings) will be populated

                                                                        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

                                                                            Given · nonempties = #[s₀, s₁, ⋯, sᵤ₋₁] · valids = #[t₀, t₁, ⋯, kₖ₋₁] Invoke prover to get a proof of proof : (∀ (_ : v₀) (_ : v₁) ⋯ (_ : vᵤ₋₁), w₀ → w₁ → ⋯ → wₗ₋₁ → ⊥).interp and returns · fun etoms => proof · ∀ etoms, ∀ (_ : v₀) (_ : v₁) ⋯ (_ : vᵤ₋₁), w₀ → w₁ → ⋯ → wₗ₋₁ → ⊥) · etoms · [s₀, s₁, ⋯, sᵤ₋₁] · [w₀, w₁, ⋯, wₗ₋₁] Here · [v₀, v₁, ⋯, vᵤ₋₁] is a subsequence of [s₀, s₁, ⋯, sᵤ₋₁] · [w₀, w₁, ⋯, wₗ₋₁] is a subsequence of [t₀, t₁, ⋯, kₖ₋₁] · etoms are all the etoms present in w₀ → w₁ → ⋯ → wₗ₋₁ → ⊥

                                                                            Note that MetaState.withTemporaryLCtx is used to isolate the prover from the current local context. This is necessary because lean-auto assumes that the prover does not use free variables introduced during monomorphization

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

                                                                              Similar in functionality compared to callNative_checker, but all valid entries are supposed to be reified facts (so there should be no etoms). We invoke the prover to get the same proof as callNativeChecker, but we return a proof of by applying proof to un-reified facts.

                                                                              Note that MetaState.withTemporaryLCtx is used to isolate the prover from the current local context. This is necessary because lean-auto assumes that the prover does not use free variables introduced during monomorphization

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

                                                                                If prover? is specified, use the specified one. Otherwise use the one determined by Solver.Native.queryNative

                                                                                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 Auto.runAuto (lemmas inhFacts : Array Lemma) :

                                                                                    Run auto's monomorphization and preprocessing, then send the problem to different solvers

                                                                                    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

                                                                                          Runs auto's monomorphization and preprocessing, then returns solverHints determined by the external prover's output

                                                                                          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

                                                                                                Given an expression ∀ x1 : t1, x2 : t2, ... xn : tn, b, returns [t1, t2, ..., tn]. If the given expression is not a forall expression, then getForallArgumentTypes just returns the empty list

                                                                                                Given the constructor selCtor of some inductive datatype and an argIdx which is less than selCtor's total number of fields, buildSelectorForInhabitedType uses the datatype's recursor to build a function that takes in the datatype and outputs a value of the same type as the argument indicated by argIdx. This function has the property that if it is passed in selCtor, it returns the argIdxth argument of selCtor, and if it is passed in a different constructor, it returns the default value of the appropriate type.

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

                                                                                                  Given the constructor selCtor of some inductive datatype and an argIdx which is less than selCtor's total number of fields, buildSelectorForUninhabitedType uses the datatype's recursor to build a function that takes in the datatype and outputs a value of the same type as the argument indicated by argIdx. This function has the property that if it is passed in selCtor, it returns the argIdxth argument of selCtor, and if it is passed in a different constructor, it returns sorry.

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

                                                                                                    Given the constructor selCtor of some inductive datatype and an argIdx which is less than selCtor's total number of fields, buildSelectorForInhabitedType uses the datatype's recursor to build a function that takes in the datatype and outputs a value of the same type as the argument indicated by argIdx. This function has the property that if it is passed in selCtor, it returns the argIdxth argument of selCtor.

                                                                                                    Equations
                                                                                                    Instances For
                                                                                                      def Auto.buildSelectorFact (selName : String) (selCtor selType : Lean.Expr) (argIdx : Nat) :

                                                                                                      Given the information relating to a selector of type idt → argType, returns the selector fact entailed by SMT-Lib's semantics (∃ f : idt → argType, ∀ ctor_fields, f (ctor ctor_fields) = ctor_fields[argIdx])

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

                                                                                                        ppOptionsSetting is used to ensure that the tactics suggested by autoGetHints are pretty printed correctly

                                                                                                        Equations
                                                                                                        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 monomorphization interface that can be invoked by repos dependent on lean-auto.

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

                                                                                                                Run native prover with monomorphization and preprocessing of auto

                                                                                                                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