Documentation

Duper.Order

Instances For
    inductive Duper.Symbol :
    Instances For
      @[reducible, inline]
      Equations
      Instances For
        Equations
        • One or more equations did not get rendered due to their size.
        Equations
        Equations
        Equations
        Equations
        Equations
        Instances For
          Equations
          Instances For
            def Duper.Order.headWeight (f : Lean.Expr) (symbolPrecMap : SymbolPrecMap) (highesetPrecSymbolHasArityZero belowLam : Bool) :

            Computes headWeight according to firstmaximal0 weight generation scheme. The head is given weight 1 unless if the head is the unique symbol with the highest precedence in symbolPrecMap, in which case, it is given weight 0.

            Note: In order to make the firstmaximal0 weight generation scheme compliant with KBO, if the highest precedence symbol has arity 0 (i.e. is a first-order 'constant'), then I cannot assign the highest precedence symbol weight 0 (because this would violate KBO's constraint that all first-order 'constants' share some positive weight μ). In this case, I simply assign the highest precedence symbol weight 1, as with everything else.

            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 comparison function for comparing fvars and consts based on precomputed precedences. Note that lower numbers in symbolPrecMap correspond to higher precedences. e1 is the expression that produces symbol s1 and e2 is the expression that produces symbol s2 (e1 and e2 need to be included in addition to s1 and s2 in case if we need to determine the arity of e1 or e2)

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    Instances For
                      def Duper.Order.kbo (t1 t2 : Lean.Expr) (alreadyReduced : Bool) (symbolPrecMap : SymbolPrecMap) (highesetPrecSymbolHasArityZero : Bool) :

                      Higher-Order KBO, inspired by https://github.com/sneeuwballen/zipperposition/blob/master/src/core/Ordering.ml.

                      Follows Section 3.9 of https://matryoshka-project.github.io/pubs/hosup_article.pdf and the article "Things to Know when Implementing KBO" by Bernd Löchner.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        partial def Duper.Order.balance_weight (wb : Weight) (vb : VarBalance) (t : Lean.Expr) (s : Option Lean.Expr) (pos belowLam : Bool) (symbolPrecMap : SymbolPrecMap) (highesetPrecSymbolHasArityZero : Bool) :

                        Update variable balance, weight balance, and check whether the term contains the fluid term s. The argument pos determines whether weights and variables will be counted positively or negatively, i.e., whether t is the left term in the comparison. Returns the weight balance and whether s was found.

                        def Duper.Order.balance_weight_var (wb : Weight) (vb : VarBalance) (t : Lean.Expr) (s : Option Lean.Expr) (pos belowLam : Bool) (symbolPrecMap : SymbolPrecMap) (highesetPrecSymbolHasArityZero : Bool) :

                        balance_weight for the case where t is an applied variable

                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          partial def Duper.Order.balance_weight_rec (wb : Weight) (vb : VarBalance) (terms : List Lean.Expr) (s : Option Lean.Expr) (pos belowLam res : Bool) (symbolPrecMap : SymbolPrecMap) (highesetPrecSymbolHasArityZero : Bool) :

                          list version of the previous one, threaded with the check result

                          partial def Duper.Order.tckbolex (wb : Weight) (vb : VarBalance) (terms1 terms2 : List Lean.Expr) (belowLam : Bool) (symbolPrecMap : SymbolPrecMap) (highesetPrecSymbolHasArityZero : Bool) :

                          lexicographic comparison

                          partial def Duper.Order.tckbolenlex (wb : Weight) (vb : VarBalance) (terms1 terms2 : List Lean.Expr) (belowLam : Bool) (symbolPrecMap : SymbolPrecMap) (highesetPrecSymbolHasArityZero : Bool) :

                          length-lexicographic comparison

                          partial def Duper.Order.tckbo (wb : Weight) (vb : VarBalance) (t1 t2 : Lean.Expr) (belowLam : Bool) (symbolPrecMap : SymbolPrecMap) (highesetPrecSymbolHasArityZero : Bool) :

                          tupled version of kbo (kbo_5 of the paper)

                          partial def Duper.Order.tckbo_composite (wb : Weight) (vb : VarBalance) (f g : Lean.Expr) (ss ts : List Lean.Expr) (belowLam : Bool) (symbolPrecMap : SymbolPrecMap) (highesetPrecSymbolHasArityZero : Bool) :

                          tckbo, for non-variable-headed terms).

                          partial def Duper.Order.tckbo_rec (wb : Weight) (vb : VarBalance) (f g : Lean.Expr) (ss ts : List Lean.Expr) (belowLam : Bool) (symbolPrecMap : SymbolPrecMap) (highesetPrecSymbolHasArityZero : Bool) :

                          recursive comparison

                          def Duper.Order.getNetWeight (t1 t2 : Lean.Expr) (alreadyReduced : Bool) (symbolPrecMap : SymbolPrecMap) (highesetPrecSymbolHasArityZero : Bool) :

                          getLitNetWeight takes two expressions t1 and t2 and calculates weight(t1) - weight(t2), returning the difference of the two expressions' weights.

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