Manuscript Offprint
arXiv:2610.39536Semantic Path Orders are Generalized Weighted Path Orders
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
TEPPEI SAITO AND NAO HIROKAWA
JAIST, Japan
e-mail address: saito@jaist.ac.jp, hirokawa@jaist.ac.jp
ABSTRACT. Monotonic semantic path orders (MSPOs) are powerful reduction orders, but their effective use in theorem proving and termination analysis raises three issues: efficient comparison of terms, ground totality, and a reduction-pair formulation. Inspired by weighted path orders (WPOs), we introduce generalized weighted path orders (GWPOs) which encompass both WPOs and MSPOs. GWPOs and MSPOs coincide as classes of reduction orders, thereby yielding efficient and ground-total subclasses of MSPOs. We further formulate the reduction-pair version of the GWPO for the dependency pair method, from which a reduction-pair version of the MSPO is obtained. In contrast to the reduction-order setting, the correspondence between GWPOs and MSPOs no longer fully carries over, establishing the GWPO as a framework of independent interest. Effectiveness of the resulting reduction pairs is assessed by standard termination benchmarks.
1. INTRODUCTION
Term orders are a fundamental tool in termination analysis of term rewrite systems, and they also underlie completion-based automated theorem proving. Classical examples include the Knuth–Bendix order (KBO) [KB70] and the lexicographic path order (LPO) [KL80], along with numerous variants and generalizations. Typically, these orders are used as so-called reduction orders >, which characterize termination of term rewrite systems by orientability of all rules .
The semantic path order (SPO) was introduced by Kamin and Lévy alongside the LPO in their unpublished but celebrated note [KL80]. It generalizes the precedence of the LPO (used to compare function symbols) to relations on terms, thereby allowing semantic ingredients to be used in term comparison. Despite its expressive power for termination analysis, the SPO does not necessarily satisfy the monotonicity property required of reduction orders. Building on Geser's work [Ges92, Ges96], Borralleras, Ferreira, and Rubio [BFR00, Bor03] introduced a reduction-order version of the SPO dubbed the monotonic semantic path order (MSPO). Their work paved the way to automated termination analysis with the SPO [BR07].
The motivation of this article lies in making the (M)SPO more effective in termination analysis and theorem proving. This raises the following three questions.
Key words and phrases: term rewriting, termination, weighted path order, semantic path order. This research was supported by JSPS KAKENHI Grant Numbers JP22K11900 and JP25KJ1363.
Preprint submitted to Logical Methods in Computer Science
© T. Saito and N. Hirokawa Creative Commons
T. SAITO AND N. HIROKAWA
-
Under what conditions is an MSPO ground total? This property means that ground terms are totally ordered, and it is a standard requirement for the refutational completeness of theorem proving procedures, such as ordered completion [BDP89] and superposition calculus [BG94].
-
Can terms be compared by an MSPO efficiently? This is also important for theorem proving, where term comparisons are performed frequently. For classical orders such as the KBO and the LPO, efficient comparison algorithms have been studied, for instance, in [Löc06a, Löc06b].
-
Can MSPOs be formulated as reduction pairs (a more general form of reduction orders)? Such a formulation (based on pairs of quasi-orders and well-founded orders on terms) is needed for their effective use in termination proving based on the dependency pair method [AG00].
The technical key lies in the weighted path order (WPO) [YKS15], another generalization of the LPO and also the KBO. It combines a semantic comparison based on an interpretation (e.g., a polynomial interpretation [Lan75]) with a syntactic comparison based on a precedence. Regarding the three questions above, more is known about the WPO than about the MSPO. First, there is a reasonable sufficient condition for a WPO to be a ground-total reduction order. Second, the WPO admits a subclass with an efficient implementation, namely the KBO [Löc06a]. Third, WPOs have been formulated as reduction pairs [YKS15] and used successfully in automated termination provers [YKS14, Sch20]. In our previous work [SH23], we showed that WPOs formulated as reduction orders can be represented as MSPOs. This connection suggests that the aforementioned features of the WPO might be transferred to the MSPO.
To this end, we introduce a generalization of the WPO dubbed the generalized weighted path order (GWPO). The definition shares the same recursion structure as the WPO, but the parameters of the WPO are generalized from an algebra and a precedence to reduction triples, which are basic ingredients of the MSPO [Bor03]. By definition, the WPO and the (M)SPO are immediate special cases of the GWPO.
Using the GWPO, the issues of ground totality and efficiency are addressed as follows. As with the WPO, there is a reasonable sufficient condition for a GWPO to be a ground-total reduction order, and the GWPO admits an efficient subclass analogous to the KBO. These results can then be transferred to the MSPO by using a simulation result that every GWPO formulated as a reduction order can be represented as an MSPO. As a byproduct, this implies that the GWPO and the MSPO coincide as classes of reduction orders.
Following the WPO, we also formulate GWPOs as reduction pairs. In this formulation, WPOs and (M)SPOs again arise as immediate special cases. Interestingly, the aforementioned simulation result for reduction orders does not fully carry over to the reduction-pair setting, which implies that the GWPO is of independent interest. We also evaluate the resulting reduction pairs on standard benchmark problems for automated termination proving [Ter].
This article is based largely on the first author's PhD thesis [Sai26], and substantially extends our conference paper [SH23]. More precisely, the main result of the conference paper that WPOs are (M)SPOs is a special case of Theorem 3.33, which states that GWPOs are SPOs. The other results are new with respect to the conference paper.
The remainder of the paper is organized as follows. Section 2 collects basic facts about orders, term rewriting, and interpretation methods. The next two sections are devoted to the main results of this article, and begin with a brief overview of their subsections. Section 3 is devoted to GWPOs as reduction orders, and Section 4 to GWPOs as reduction pairs. The article concludes with Section 5, which discusses related and future work.
A pair (≥,>) of relations on the same set X is compatible if > · ≥ ⊆ > and ≥ · > ⊆ >. Here denotes the composition of and defined as . The pair (≥,>) is an order pair if it is compatible, ≥ is a quasi-order and > is a strict order; it is well-founded if > is well-founded; and it is normal if > ⊆ ≥. For example, (≥ₙ, >ₙ) is a well-founded and normal order pair. We say that a relation extends another relation if . Similarly, we say that an order pair (≥,>) extends another one (⊆, ⊆) on if ≥ extends ⊆ and > extends ⊆. We call a trivial order pair.
Given a set X and a natural number n, we write for the set of all tuples of length n consisting of elements of X. We also write for the set of all tuples of arbitrary finite length over X. The elements of are called lists. We recall the lexicographic extension, which extends an order pair to lists.
Definition 2.1. Let be a pair of relations on a set . The lexicographic extension is a pair of relations on defined recursively: if one of the following cases holds.
•
• and
• and , and moreover
Similarly, if one of the following cases holds.
• and
• and
• and , and moreover
It is known that ( ) is an order pair on if ( ) is. However, is not well-founded even if > is. This is witnessed by the lexicographic extension ( ) of ( ), in which (1) holds. Well-foundedness is recovered by imposing a fixed length bound on , see [ST13, Section 3] for a related discussion. Given a set , we write for the union of for all natural numbers .
Proposition 2.2. If ( ) is a well-founded order pair, then the restriction of to for a natural number is well-founded.
Quite often, for a single strict order > (rather than an order pair), we consider the strict part > of the lexicographic extension of (=, >), where = is the identity relation. In that case, we may simply call > the lexicographic extension of >.
We note that there are some variations in the definition of an order pair. For instance, what is called an order pair in [Yam22, Definition 1] corresponds to a normal order pair in our terminology.
T. SAITO AND N. HIROKAWA
2.2. Term Rewriting. We begin with the definition of terms. A signature is a designated set of function symbols. Each function symbol is associated with a unique natural number called arity, which specifies the number of arguments of the function. When we need to indicate the arity of a function symbol , we write for . A function symbol is called a constant if , unary if , and binary if . Let be a designated countably infinite set of variables with . The set of terms is defined inductively: every variable is a term, and is a term if and are terms. The set may be written as when and are clear from the context.
We define a few convenient notations for terms. For binary function symbols like +, we may use infix notation to denote the term . For example, let , and . Then we have . Also, we may use vector notation to indicate that is a term headed by the function symbol . In this case, is the root symbol of , denoted by . For instance, is the root symbol of . The set of all variables occurring in a term is denoted by . The size of a term is the number of function symbols and variables occurring in . For example, we have and for .
Let be a fresh constant with , which we call the hole. Contexts are terms over that contain exactly one hole. The term resulting from replacing in a context by a term is denoted by . We write if there is a context with . In such a case, is a subterm of . The strict part of is denoted by . Similarly, reads as is a proper subterm of . For example, the term has four proper subterms, namely , , , and .
A substitution is a mapping from variables to terms such that is finite. The application of a substitution to a term is inductively defined as follows: if is a variable, and if . We write for the substitution such that if for some , and otherwise. For example, for .
A pair of terms is said to be a rewrite rule if is not a variable and every variable in occurs in . Rewrite rules are written as . A set of rewrite rules is called a term rewrite system (TRS). A famous example of a TRS is combinatory logic, consisting of the rewrite rules and . Let be a TRS. The relation is defined on terms as follows: if there exist a rule , a context , and a substitution such that and hold. When , it is written as . For instance, in the TRS of combinatory logic we have .
Let be a relation on terms. We say that is closed under contexts or just monotone if holds whenever and is a context; is closed under substitutions or just stable if holds whenever and is a substitution; is a rewrite relation if it is stable and monotone; and has the subterm property if whenever . For example, the relation induced by a TRS is by definition closed under contexts and substitutions. We say that a pair of relations on terms is stable if and are stable.
A term is terminating with respect to a relation on terms if there is no infinite sequence starting from . Termination of the relation is defined as the absence of non-terminating terms. In other words, is well-founded if and only if it is terminating. A TRS is terminating if is. For example, the TRS consisting of and is non-terminating, see for example [Bar84]. In contrast, the TRS consisting of only is terminating.
Termination of TRSs is often shown by orders. We say that a rewrite relation is a rewrite preorder or reduction order if it is a preorder or a well-founded order, respectively.
Proposition 2.3. A TRS R is terminating if for some reduction order >.
A powerful method for automated termination analysis is the dependency pair framework (to be explained in Subsection 4.1). Rather than reduction orders, this method uses reduction pairs, namely well-founded stable order pairs ( ) with closed under contexts. A reduction pair ( ) is monotone if > is also closed under contexts. We note that > is a reduction order for a monotone reduction pair ( ). Conversely, given a reduction order >, the pair ( ) of the reflexive closure and > is a monotone reduction pair.
2.3. Interpretation-Based Orders. Algebras (or interpretations) are useful for constructing reduction orders/pairs. Let be a set of function symbols. An -algebra is a pair , where is a set called a carrier, and is an -ary function on (called an interpretation function) associated with each . Let be an algebra. A mapping from to is called an assignment for . The interpretation of a term under an assignment is inductively defined as follows: if is a variable, and if .
Example 2.4. Let and consider the -algebra whose carrier is and interpretation functions are given by and . For the assignment with we have .
In the rest of this article, we assume that the carrier of an algebra is always endowed with an order pair . We write if for all assignments . The relation is a stable strict order. Similarly we write if holds for all assignments . The relation is a stable quasi-order, and satisfies compatibility with , namely and . The -th argument position of with is said to be
• strictly simple if for all ;
• weakly simple if for all ;
• strictly monotone if follows from for all ; and
• weakly monotone if follows from for all .
The terminology above carries over to subsets : for example, we say that is strictly simple for if every argument position of is so. Moreover, if , we may simply call strictly simple. The algebra is well-founded if > is well-founded; normal if > ; and trivial if the carrier is a singleton set.
Example 2.5 (continued from Example 2.4). We endow with the order pair . Then is weakly simple and monotone, and strictly monotone, but it is not strictly simple, since when . Moreover, is well-founded and normal, but not trivial.
It is known that if > is well-founded, so is >_A. Similarly, if A is normal, so is (≥_A, >_A). If A is trivial, then (≥_A, >_A) degenerates to (T × T, ∅). If A is a weakly monotone algebra, ≥_A is a rewrite preorder. If A is a strictly monotone algebra, >_A is a reduction order. If A is strictly (resp. weakly) simple, >_A (resp. ≥_A) has the subterm property. An important consequence is:
T. SAITO AND N. HIROKAWA
Proposition 2.6 [Zan94]. If A is a weakly monotone and well-founded algebra, then is a reduction pair. If in addition A is strictly monotone, then is a monotone reduction pair.
Example 2.7 (continued from Example 2.5). Consider the TRS . From Proposition 2.6, the pair is a monotone reduction pair, and therefore is a reduction order. Furthermore, we have , as all assignments satisfy the inequality . Hence the termination of is concluded by Proposition 2.3.
The algebra used above is an instance of the linear polynomial interpretation [Lan75]. Formally, a linear polynomial interpretation is an algebra such that the carrier is ordered by and for each its interpretation is of the form with . Such an interpretation is well-founded, normal and also weakly monotone. In general, the -th argument of a function symbol is strictly monotone if and only if . Strict simplicity and weak simplicity are characterized in the same way.
A max/plus interpretation associates a combination of + and max for each function symbol. For simplicity, we only consider as the carrier, and the interpretations are restricted to the following form (adapted from [YKS15, Definition 7]): For each its interpretation is of the form where is a natural number, and . (See [FGM+08] for a more general version.) Every max/plus interpretation is weakly monotone, well-founded and normal. The -th argument of a function symbol is weakly simple if and only if and . Consider . The first argument of is weakly simple but not strictly simple, and the second is not even weakly simple. In fact, and .
3. REDUCTION ORDERS
This section studies the WPO, the MSPO, and their natural generalization, the GWPO, in the reduction-order setting. Through our analysis of the GWPO, we identify both a ground-total subclass of the MSPO and a subclass that admits efficient term comparison.
More precisely, we first introduce a variant of (M)SPOs suited to our purposes in Subsection 3.1, and then WPOs and GWPOs in Subsection 3.2. In Subsection 3.3, we establish a simulation result showing that the GWPO and the MSPO coincide as classes of reduction orders. We then discuss two subclasses of GWPOs, and hence of MSPOs: an efficient subclass in Subsection 3.4 and a ground-total subclass in Subsection 3.5.
3.1. Semantic Path Order. Among the many variants of the semantic path order, we use one based on order pairs and lexicographic extension, as suggested in [Bor03, Section 4.5]. We employ order pairs to allow interpretations to serve as basic ingredients of the SPO, and lexicographic extension to relate the SPO to the WPO, which is usually defined using lexicographic extension [YKS15]. These choices are explained in due course.
Definition 3.1. Let be a pair of relations on terms. The semantic path order is defined on terms as follows: if and one of the following conditions holds.
a. for some .
b. and for all , and moreover
(i) , or
(ii) and .
Here denotes the reflexive closure of .
When the signature is infinite, an SPO induced by an order pair is not always well-founded, even if is well-founded. This is already remarked in [Bor03, Section 4.5]; see also [Toy04, Section 3] and [ST13, Section 3] for related discussions. Well-foundedness of is restored by assuming existence of an upper bound of arities used in the signature (cf. Proposition 2.2). We refer to this condition as boundedness of the signature. Needless to say, a signature is bounded whenever it is finite.
Assumption 3.2. The signature is assumed to be bounded in the rest of the paper.
Theorem 3.3. If is a stable and well-founded order pair on terms, the induced semantic path order is a stable well-founded order with the subterm property.
We are not aware of a published proof of the theorem above. So, for completeness, a proof of Theorem 3.3 is included in Appendix A. In general, semantic path orders are not closed under contexts, even when is monotone.
Example 3.4. Let be the linear polynomial interpretation over with and , and the SPO induced by the reduction pair . Then we have by case a. However, does not hold: case a is not applicable, and case b cannot be applied either, since does not hold.
For a remedy, Borralleras et al. [BFR00, Bor03] have proposed to restrict the SPO >s by taking intersection with another preorder ≥ satisfying the harmony property [Der04] (originally called quasi-monotonicity [BFR00]). Here, a relation ↔ on terms is harmonious with respect to another relation ↔ on terms if
for all -ary function symbols , integers , and terms . It is not difficult to see that is closed under contexts if and only if is harmonious with respect to itself.
Definition 3.5 ([Bor03, Definition 4.1.20]). A triple ( , , ) is a reduction triple if is a rewrite preorder on terms, ( , ) is a stable order pair on with well-founded, and is harmonious with respect to .
Definition 3.6. Let ( , , ) be a reduction triple and >s the semantic path order induced from ( , ). The monotonic semantic path order is defined as and .
Theorem 3.7. Every monotonic semantic path order is a reduction order.
Observe that Definition 3.1 uses the order pair only when s and t are headed by function symbols, so behavior of the orders on variables does not matter.
Borralleras calls reduction triples reduction triplets [Bor03]. In the context of dependency pairs, there is another usage of the term in a different meaning [HM07].
T. SAITO AND N. HIROKAWA
Although the proof due to Borralleras et al. [BFR00, Theorem 2] goes through, we present it here to explain the role of and the harmony property.
Proof. Since we have Theorem 3.3, the only interesting part is the proof that >_MS is monotone. Let >_MS be the MSPO induced by a reduction triple (≥, ⊆, ⊆), and let s >_MS t and . By definition and . From the monotonicity of ≥ we have , and from the harmony property we have . So, follows by case b(ii), using the subterm property of >_S. Hence .
Remark 3.8. The MSPO is incremental in the following sense: Let and be reduction triples. Suppose that extends , i.e., extends and also extends . Then, the MSPO induced by extends the MSPO induced by . Since the greater relation is the more profitable for termination proving in general (see Proposition 2.3), we have no reason to use instead of .
In the sequel, we recall constructions of reduction triples [BFR00, Bor03]. A quasi-order on the signature is called a precedence, and it naturally induces a reduction triple. A precedence is called well-founded if its strict part is well-founded.
Proposition 3.9 [BFR00]. Let be a well-founded precedence, and define by or , and , and by the strict part of . Then is a reduction triple.
Note that the harmony property follows from the fact that equates terms with the same root symbol. Lexicographic path orders (LPOs) [KL80] are special instances of MSPOs constructed with Proposition 3.9.
Remark 3.10. Generalizing precedences from quasi-orders to order pairs does not increase termination proving power when the signature is finite: Let be an order pair on the signature. Then defined as is a quasi-order by the compatibility of . Moreover, extends , and also the strict part extends . So, is preferred to when using them with the construction of Proposition 3.9, because the MSPO is incremental, as remarked in Remark 3.8.
For a reduction pair , the quasi-order is monotone, and therefore harmonious with respect to itself. So, every reduction pair can be turned into a reduction triple as follows.
Proposition 3.11 [BFR00]. If (≥, >) is a reduction pair, (≥, ≥, >) is a reduction triple.
In particular, since is a reduction pair, is a reduction triple. We call it the trivial reduction triple.
We illustrate the use of Proposition 3.11 with the MSPO by an example.
Example 3.12. We show the termination of the TRS taken from [Zan94]. Let be the linear polynomial interpretation over with and (the same one as Example 3.4), and the MSPO induced by the reduction triple . The inequality boils down to for all , which trivially holds. In the same way, we can confirm for all subterms of . So, follows from successive application of case b(i). Thus, we conclude and thereby the termination.
Note that the strict order > in Proposition 3.11 is not the strict part of in general. This essentially explains why we adopt a formulation based on order pairs in Definition 3.1. The issue is most evident when they are induced by a polynomial interpretation.
Example 3.13. Consider the linear polynomial interpretation over with the interpretation , and the induced reduction triple . On the one hand we have from for all , but not as does not hold for . On the other hand does not hold either, because does not hold for .
It is known that Proposition 3.11 can be improved by marking root symbols; see [BFR00, Proposition 4.2]. (A similar idea is used by the dependency pair method discussed in Section 4.) In this article, we use a special case based on algebras. We first introduce a distinguished copy of the original signature , consisting of a fresh -ary function symbol for each . For an -algebra , we define on by or , and . Similarly, we define on by , and . The construction below is based on the observation that is harmonious with respect to if is weakly monotone for .
Proposition 3.14. The triple is a reduction triple on for every weakly monotone and well-founded -algebra .
There is a variant of the construction above that allows us to use non-weakly-monotone algebras, at the cost of using the equivalence relation as the first component of the reduction triple [HM04]. Here, is defined on as for all assignments .
Proposition 3.15. The triple is a reduction triple on for every well-founded -algebra .
Proof. For the harmony property, let and . From we obtain , and thus . The other properties are easy to verify.
Example 3.16. Consider the TRS . We mimic the termination proof of [Zan95, Example 2] by the finite algebra over defined as follows:
We consider the MSPO >_MS induced by the reduction triple . Obviously, we have , and also . So follows from case b(i). Finally, we conclude and thereby termination.
3.2. Generalizing WPO. The weighted path order (WPO) is a class of reduction orders introduced by Yamada, Kusakari and Sakabe [YKS15]. The definition of WPOs is based on an algebra A and a precedence . A WPO compares terms s and t as a Knuth–Bendix order (KBO) [KB70] does: If , we can immediately conclude that s is strictly greater than t. If the weak inequality holds then we can compare an argument of s with t, or and by the precedence . When the weak inequality holds, then the arguments of s and t can be compared lexicographically.
In contrast to [YKS15, Definition 3], we do not consider the status extension that allows permutation of arguments. This is merely to simplify the presentation.
T. SAITO AND N. HIROKAWA
Definition 3.17 [YKS15]. Let A be an ordered F-algebra and a precedence. The weighted path order is defined on terms over F as follows: if
-
, or
-
, , and one of the following conditions holds.
a. for some .
b. and for all , and moreover
(i) , or
(ii) and .
Here denotes the reflexive closure of .
We note that generalizing precedences to order pairs does not increase termination proving power of the WPO; see Remark 3.10.
Theorem 3.18 [YKS15]. For every well-founded, normal, weakly simple and monotone algebra and well-founded precedence, the induced relation >_W is a reduction order (with the subterm property).
We note that the normality requirement was identified by [TSSY20]. Weak simplicity of the algebra is essential for well-foundedness of the WPO in Theorem 3.18. In fact, otherwise the order may not be irreflexive.
Example 3.19. Let A be the weakly monotone and normal algebra on N given by and . The WPO >_W induced by A and any precedence satisfies which can be seen by applying case 2a and then case 1.
In general, it is known that the WPO generalizes the LPO and the KBO in the following sense: KBOs are WPOs induced by a restricted form of linear polynomial interpretations over N, and LPOs are WPOs induced by a restricted form of max/plus interpretations [YKS15]. So every termination proof by an LPO or KBO can be simulated by a corresponding WPO.
We generalize the WPO in the spirit of Kamin and Lévy. Their idea to obtain the SPO is to generalize precedence of the LPO to order pairs on terms. Following this, we generalize the WPO so as to take two order pairs on terms: one takes the role of algebra, and the other that of precedence.
Definition 3.20. Let and be pairs of relations on terms. The generalized weighted path order (GWPO) is defined as follows: if
-
, or
-
and one of the following conditions holds:
a. for some argument .
b. , for all arguments , and moreover
(i) , or
(ii) and .
It is a nice exercise to compare Definition 3.20 and Definition 3.1: an SPO induced by a pair (⊆, ⊆) is identical to the GWPO induced by (T × T, ∅) and (⊆, ⊆). It is also instructive to compare Definition 3.20 and Definition 3.17: The order pair (⊆_A, ⊆_A) corresponds to (≥_A, >_A) induced by an algebra A, and (⊆_B, ⊆_B) corresponds to comparison by a precedence. Interestingly, the version of WPO formalized in Isabelle/HOL ([TSSY20, Section 3]) is based on a similar idea, but does not generalize precedences to order pairs on terms.
Not surprisingly, a sufficient condition for a GWPO to be a stable and well-founded order is a merger of that for an SPO (Theorem 3.3) and that for a WPO (Theorem 3.18). We say that an order pair on terms has the subterm property if . Hereafter, for brevity we may simply write the subscript for a pair or a triple , if it does not cause any confusion.
Theorem 3.21. If and are well-founded stable order pairs and the order pair has the subterm property, the induced relation is a stable and well-founded order with the subterm property.
In the next section we show the theorem using a simulation result. The subterm property of is necessary for well-foundedness. The necessity is witnessed by the WPO in Example 3.19, as it can be regarded as a GWPO induced by . By definition, the subterm property of is a sufficient condition for that of the order pair . Here, we allow the weaker condition for convenience in Subsection 3.4 (so that Corollary 3.41 can be derived using Theorem 3.33).
As the SPO has the monotonic variant MSPO, so does the GWPO. We call it the monotonic generalized weighted path order, or MGWPO for short.
Definition 3.22. Let and be triples of relations on terms. The monotonic generalized weighted path order is the intersection where is induced by and .
Now, we arrive at the main theorem of this section.
Theorem 3.23. The relation >MG is a reduction order for reduction triples ( ) and ( ) with ( ) having the subterm property.
The theorem is also a consequence of the simulation result in the next section. Next, we confirm that our MGWPO indeed generalizes the WPO.
Proposition 3.24. Let >_W be the WPO induced by a normal algebra A and a precedence ≥. Then >_W is identical to >_MG induced by (≥_A, ≥_A, >_A) and P, where P is constructed from ≥ as in Proposition 3.9.
Proof. It is easy to see that >_W is identical to >_G, and therefore >_MG ⊆ >_W. Moreover, by the normality of A, one can show that >_W ⊆ ≥_A. This entails the converse >_W ⊆ >_MG. □
Using the same construction, we can see that Theorem 3.18 follows from Theorem 3.23: When A is weakly simple, we have the subterm property of and thereby that of . Also, we can see that our MGWPO indeed generalizes MSPO.
Proposition 3.25. Let >_MS be the MSPO induced by a reduction triple (≥, ⊆, ⊆). Then >_MS is identical to >_MG induced by the reduction triples (T × T, T × T, ∅) and (≥, ⊆, ⊆).
Now, we illustrate the use of GWPOs by examples.
Example 3.26. Consider the rewrite system for combinatory logic:
While the system is well known to be non-terminating (see for example [Bar84]), the following system R obtained by flipping the S rule is actually terminating.
The observation that the rule is terminating dates back to [BK79].
T. SAITO AND N. HIROKAWA
To see it, let A be the linear polynomial interpretation over N defined as follows:
Intuitively, captures the decrease of the number of occurrences of in the second rule with , and the decrease of the depth of the rightmost in the first rule with . The monotone generalized weighted path order induced by the reduction triples and satisfies . The comparison proceeds as follows: First, holds, as it boils down to the valid inequality . So it remains to confirm a decrease in . Let . Then we have the following derivation.
2b(i)
Here follows from the validity of . In a similar way, is verified. As holds, the termination of is concluded.
The termination of R above cannot be shown by the original weighted path order if algebras are restricted to be linear polynomial interpretations over N, see Proposition A.1.
Example 3.27. Consider the TRS R for groups with two commuting endomorphisms [SL06]:
A difficulty is rule 6, which is a terminating instance of the non-terminating rule . We consider the linear polynomial interpretation A over N with
and the linear polynomial interpretation over for the extended signature :
Roughly, captures the decreases in term size while captures the change from to in the first argument of for rule 6. This can be seen in , and . From Theorem 3.23 the MGWPO induced by the reduction triples and is a reduction order. To conclude the termination of with Proposition 2.3, we verify . Checking and is routine work. So, it remains to verify . For rule 6, we use case 2b(i) with and then case 1 for recursive comparison. For rule 3 we similarly use case 2b(i) with and then case 1. The other rules are oriented by and therefore by case 1.
Remark 3.28. We cannot naively use Proposition 3.14 for the first reduction triple of an MGWPO, since Theorem 3.23 demands the subterm property of . For example, does not hold for a weakly simple algebra on with , , and . So a typical choice for the first component is to use with an algebra on the original signature, as in the examples above. (We however have more to say about this in the next section.) Moreover, if is normal, then holds and therefore is equivalent to and .
3.3. Simulating GWPOs by SPOs. We present a simulation result between (M)GWPOs and (M)SPOs. This result allows us to establish desired properties of (M)SPOs via those of (M)GWPOs, and vice versa.
To this end, we recall lexicographic combination, which provides a way to combine multiple order pairs on the same set X into a more complex one on X.
Definition 3.29. Let and be pairs of relations on the same set . The lexicographic combination is the pair of relations on defined as follows:
• if , or both and .
• if , or both and .
Let and be order pairs on the same set. Then is again an order pair. Moreover, it preserves well-foundedness: If both and are well-founded, so is . The same goes for stability.
The simulation result is based on lexicographic combination: Given a GWPO >_G induced by two order pairs ( ) and ( ), we consider the SPO >_S induced by the lexicographic combination ( ). Our goal is to show that >_G and >_S are identical.
Before presenting proofs, we illustrate how the derivation of in Example 3.26 is simulated by the semantic path order.
Example 3.30 (continued from Example 3.26). Under the construction above, is the lexicographic combination of and . Since , we can first apply case b(i) of instead of case 2b(i) of , which gives rise to two obligations, namely and . The former is derived by applying case b(i) and case a repeatedly:
\frac{t\sqsupset_{AB}\left(\mathsf{S}\cdot x\right)\cdot y}{\frac{t\sqsupset_{AB}\mathsf{S}\cdot x}{t>\mathsf{S}\mathsf{S}}\frac{\frac{t\sqsupset_{AB}\mathsf{S}}{t>\mathsf{S}\mathsf{S}}\text{a}}{t>\mathsf{S}\mathsf{S}\cdot x}\frac{\frac{x\geqslant_{\mathsf{S}}x}{x\cdot z\geqslant_{\mathsf{S}}x}\text{a}}{t>\mathsf{S}x}\text{b(i)}\frac{\frac{y\geqslant_{\mathsf{S}}y}{y\cdot z\geqslant_{\mathsf{S}}y}\text{a}}{t>\mathsf{S}y}\text{b(i)}Notice that, and the weak simplicity of guarantees and thereby for all subterms of in the simulating derivation. Similarly, the latter obligation is derived by repeatedly applying case a.
As shown in the example, the subterm property of allows us to simulate case 1 of by case b(i) and case a of .
Lemma 3.31. Suppose that is a stable order pair with the subterm property. If then .
Proof. We prove the claim by induction on . Let . We analyze the derivation of .
- Assume that is derived from . We distinguish three cases.
- Suppose that is a variable. We further analyze whether contains or not. If so, by the subterm property of , we have or , which is a contradiction; otherwise, by substituting into we obtain , which is again a contradiction.
T. SAITO AND N. HIROKAWA
-
Suppose that is not a variable while is a variable. If does not occur in then by substituting into we obtain , a contradiction. So occurs in . We obtain by the subterm property of .
-
Suppose that is not a variable, and . Since has the subterm property, for every we have or , which leads to . Thus, the induction hypothesis yields for all . Moreover, follows from . Hence, follows from case b(i).
- Assume that and .
a. Suppose that is derived from and for some . Then is obtained by case a using the induction hypothesis.
b. Suppose that and for all . By the induction hypothesis for all .
(i) If is derived from case 2b(i), then we have . So is obtained by case b(i).
(ii) If is derived from case 2b(ii), then we have and by the induction hypothesis. So is obtained by case b(ii).
Next we prove the converse direction of Lemma 3.31.
Lemma 3.32. Suppose that is an order pair with the subterm property. If then .
Proof. We prove the claim by induction on . Let . We analyze the derivation of .
a. Suppose that is derived by case a. The induction hypothesis yields for some . Then, by the definition of the GWPO, or holds.
-
In the former case, using the subterm property of , we obtain or . So we have by case 2a or case 1.
-
In the latter case, using the subterm property of , we obtain or . Therefore by case 1.
b. Suppose that is derived by case b. Let and assume for all . By the induction hypothesis we have for all .
(i) If , we further analyze how it follows: If then we have by case 1. Otherwise, we conclude with case 2b(i).
(ii) If , we further analyze how it follows: If then we have by case 1. Otherwise, we conclude with case 2b(ii) using the induction hypothesis.
From Lemma 3.31 and Lemma 3.32, we establish the simulation result.
Theorem 3.33. Let >_G be the generalized weighted path order induced by stable order pairs ( ) and ( ) with the subterm property of ( ). Then >_G and >_S are identical, where >_S is induced by ( ).
As a consequence, >_G and >_S coincide under the preconditions of Theorem 3.21. This proves Theorem 3.21 via Theorem 3.3. Moreover, the simulation result can be easily extended to the monotonic versions by using lexicographic combination of reduction triples.
Proposition 3.34. If and are reduction triples, so is the triple .
Proof. For the harmony property, let and , and let . Since and are harmonious with respect to and , respectively, we have and . So, we obtain . The other properties are readily confirmed.
Essentially, [BFR00, Proposition 4.3] is the special case when and are identical.
Corollary 3.35. Let >MG be the monotone generalized weighted path order induced by reduction triples ( ) and ( ) with the subterm property of . Then >MG and >MS are identical, where >MS is induced by ( ).
Together with Theorem 3.7 and Proposition 3.34, this simulation result proves Theorem 3.23. We remark that some of the assumptions of Corollary 3.35 could be dropped. For example, as in Theorem 3.33, well-foundedness of the reduction triples is not necessary for simulation.
It is worth examining this simulation result a little more. The MGWPO (Theorem 3.23) provides a way to turn two reduction triples, say and , into a reduction order, provided that has the subterm property. If this property is not satisfied (cf. Remark 3.28), as in the proof of the simulation result, we can instead use Proposition 3.34 to obtain the single reduction triple and then turn it into a reduction order via the MSPO (Theorem 3.7). Bypassing the simplicity requirement in this way gives us more termination proving power.
Remark 3.36. We add a few words about the preliminary paper [SH23] of this chapter. There, the main result is a special case of Theorem 3.33 corresponding to the original WPO, namely when A is induced by a weakly simple and monotone algebra and B by a precedence (via Proposition 3.9). Based on this result and the observation above, a generalized version of the WPO is obtained by using Proposition 3.14 (with possibly non-weakly-simple algebras) for A. Somewhat confusingly, although the generalization is merely a special version of the MSPO, they call it the GWPO.
The simulation result does not hold, for instance, when the SPO is defined using multiset extension as in [BFR00] and the (G)WPO is defined using lexicographic extension as in this article and in the original article of the WPO [YKS15]. This is why our definitions of the path orders are aligned with lexicographic extension.
3.4. GWPO as Optimized SPO. Another way of seeing the simulation result is an optimization technique of term comparison. Unlike the SPO, the GWPO allows us to avoid recursive comparison with arguments of if , see Example 3.26 and Example 3.30. This is reminiscent of the relationship between the KBO and the WPO: the former is a special case of the latter with the strict simplicity of algebras, where recursive comparison with arguments of can be further avoided [YKS15]. As one can expect, we also have a more KBO-like variant of GWPO that assumes the subterm property of and thereby avoids unnecessary comparison.
To present the KBO-like variant, we need a few definitions. First, following [Yam14, Definition 3.2], we extend admissibility of weight for the KBO to order pairs: an order pair is admissible for another order pair if one of the following conditions holds for all n-ary function symbols .
• for all terms and integers
• and for all terms and function symbols
T. SAITO AND N. HIROKAWA
If the latter holds for a function symbol , we call it a special unary symbol. By definition, if has the subterm property then is admissible regardless of . Moreover, we say that an order pair is sensible if whenever . This is a technical requirement to be explained later.
Theorem 3.37. Let and be order pairs and the GWPO induced by them. Suppose that has the subterm property, and is sensible and admissible for . Then if and only if
-
, or
-
and one of the following conditions holds:
A. t is a variable
B. and
(I) , or
(II) and
Proof. For the “if” direction, it suffices to show that each of case 1, case 2A and case 2B entails . If case 1 holds then trivially . So let .
A. Assume that is a variable. Since is sensible, occurs in . So follows from the subterm property.
B. Assume that .
I. Suppose . Then is not a special unary symbol, because otherwise we obtain a contradiction from . So and therefore for all . Hence, by case 2b(i).
II. Suppose and . If is not a special unary symbol, then by the same argument as the previous case we can show that by case 2b(ii). So assume that is a special unary symbol. From we obtain . Since by the subterm property, we now have by transitivity. Hence, by case 2b(ii).
For the “only-if” direction, it suffices to show that each case of entails one of case 1, case 2A, and case 2B. Trivially, case 1 entails case 1, case 2b(i) entails case 2B(I), and case 2b(ii) entails case 2B(II). So assume that case 2a holds, namely and for some . If is a variable, then case 2A applies. So let . If is not a special unary symbol, then we have or , and therefore case 1 applies. Otherwise, and . Since follows from the subterm property, we obtain and thereby . Hence, case 2B(II) holds.
Example 3.38 (continued from Example 3.26). Since is strictly simple, satisfies the subterm property, and thus is admissible for . So Theorem 3.37 is available. Recall the derivation of . As and , it is now derived by case 2B(I) of the theorem, without checking or .
Theorem 3.37 allows us to improve the complexity of deciding in the following sense: Consider deciding for fixed order pairs and . If we measure the number of comparisons by and , the best algorithm known so far (simply following that for the LPO [Löc06b]) requires a number of comparisons quadratic in . If fortunately is sensible and admissible for , Theorem 3.37 suggests that the number of comparisons can
This case sits oddly but goes back to [Yam14, Definition 3.1].
be reduced to linear in . This is an analog of the fact that KBO comparison admits an implementation of linear time complexity (with respect to ) [Löc06a]. We note that the simulation result (Theorem 3.33) allows us to apply the same optimization to the SPO induced by the lexicographic combination ( ).
The requirement for A to be sensible cannot be dropped from Theorem 3.37.
Example 3.39. Consider the signature . Let and be the trivial order pair . Since is the empty relation in this signature, has the subterm property and is admissible for , but it is not sensible. However, the GWPO induced by and does not satisfy while case 2A follows from . This pathological example also serves as a counterexample to [Yam14, Theorem 3.3] by considering the algebra whose carrier is the set of all terms and ordered by the reduction pair .
A precursor of the observation underlying Theorems 3.33 and 3.37 appears in the technical report by Geser [Ges92]. More precisely, [Ges92, Theorem 5] states that a variant of KBOs (which he attributes to Dershowitz [Der82]) can be simulated by SPOs. For comparison, we present his observation in our order-pair based formulation. We first define our version of Dershowitz's KBO.
Definition 3.40. Let be an order pair on terms. The relation is inductively defined as follows: if
-
, or
-
and one of the following conditions holds.
a. t is a variable
b. and
One can find several differences between Definition 3.40 and Geser's original formulation ([Ges92, Definition 8.1]). There, the order >_D is formulated as a quasi-order parameterized by another quasi-order; case 2 demands for the equivalence part of ; and case 2b allows a more general status extension including multiset extension. (The same goes for comparing his definition of the SPO with ours.) Now, Geser's observation is stated as follows.
Corollary 3.41. Let be a stable and sensible order pair with . The relations and are identical when both are induced by .
Proof. From the subterm property of is guaranteed. So, by Theorem 3.33 is identical to the GWPO induced by and the trivial order pair . Thanks to , the order pair is admissible for . So we conclude by observing the correspondence between case 2b of Definition 3.40 and case 2B of Theorem 3.37 with trivial.
We note that the subterm property of the strict order cannot be replaced with that of the quasi-order in Corollary 3.41. Even worse, may not be well-founded.
Example 3.42. Let be the trivial order pair . The corresponding relation admits the infinite sequence:
Here 2b is repeatedly applied together with . Also, is not identical to any SPO , because holds by definition.
T. SAITO AND N. HIROKAWA
In fact, the same example shows that [Ges92, Theorems 4 and 5], which state that his version of >_D is well-founded and coincides with his SPO, do not hold as stated. The subterm property should instead be assumed for ⊠ rather than ⊠.
3.5. Ground Totality. A strict order > on terms is ground total if either s > t or t > s holds for all ground terms . Here, ground terms are terms that contain no variable. Ground totality of reduction orders is of interest since refutational completeness of theorem proving procedures like ordered completion [BDP89] relies on it. This subsection investigates the property for the (G)WPO and the SPO.
We begin with preliminary definitions. We say that a strict order > is total on a set X if either x > y or y > x holds for all different elements . (So, ground totality is totality restricted to ground terms.) We say that a quasi-order is total on X if its strict part is total. An order pair is almost total on X if , or holds for all . Here, is the equivalence part of . For example, the usual orders and on are total, and also the order pair is almost total.
We say an algebra is almost total if the underlying order pair is almost total on the domain. Polynomial interpretations and max/plus interpretations are such examples. The order pair induced by an almost total algebra is almost total on ground terms. We note that may not be ground total even when > is total: for the polynomial interpretation of Example 2.4 with we have neither nor .
The WPO gives rise to a ground-total reduction order, under reasonable assumptions.
Theorem 3.43. Let A be an algebra that is well-founded, normal, weakly simple and monotone, and almost total. Let be a well-founded total precedence. Then the WPO >_W induced by A and is a ground-total reduction order.
Although the fact above is easy to prove and implicitly used in [JK20], the authors are not aware of a published proof. Later we prove it by a more general result.
Unfortunately, in contrast to WPOs, MGWPOs may not be ground total, even when they are constructed from total algebras and precedences. The same goes for MSPOs by the simulation result (Corollary 3.35).
Example 3.44 (adapted from [Zan94]). Let , and let be the linear polynomial interpretation for with
and the following linear polynomial interpretation for .
The MGWPO >_MG induced by ( ) and ( ) satisfies and . If >_MG were ground total, then we would have either or , from which we obtain a contradiction using the monotonicity. Even worse, by the same argument we can show that there is no ground-total reduction order that extends >_MG. Therefore, combining ( ) with a precedence (via Proposition 3.9) lexicographically does not resolve the issue.
An observation here is that even though a and b are incomparable with respect to >_MG, we actually have b >_G a. Indeed, we can show that >_G is ground total under a few reasonable assumptions. We say that (⊆, ⊆) discriminates root symbols if whenever .
For instance, let be an order pair induced by a precedence (as in Proposition 3.9). If is total, then discriminates root symbols. With this in mind, Theorem 3.43 is proved from Theorem 3.18 and the following lemma.
Lemma 3.45. Let and be order pairs that are almost total on ground terms. If discriminates root symbols, then the induced GWPO satisfies or for all distinct ground terms and .
Proof. Let and be different ground terms. We prove or by induction on . If or then we are done by case 1. So hereafter we assume and as is almost total on ground terms. If or for some , then we are done by case 2a. Otherwise, by the induction hypothesis, for all and for all . Then, we again use the assumption that is almost total on ground terms. If or then we are done by case 2b(i). Otherwise, and . Since discriminates root symbols and , we have . By the induction hypothesis together with the fact that lexicographic extension preserves totality, we have or . So case 2b(ii) applies.
Note that of Example 3.44 does not discriminate root symbols, since both and hold. In such a case, we can simply combine it lexicographically with an order pair induced by a total precedence. This leads to the following construction: Let be a well-founded and total precedence, and an -algebra that is almost total, normal, weakly monotone, well-founded, and weakly simple for . Define as the lexicographic combination of and the order pair induced by . Consider the GWPO induced by and . Then we have:
Theorem 3.46. The GWPO >_G defined as above is a ground-total reduction order.
Proof. To show that >_G is a reduction order, the key is that (≥_A, ≥_A, >_A) and (≥_A, ⊠, ⊠) are reduction triples with the subterm property of ≥_A. Using the normality of A, we can show that >_G is identical to the MGWPO induced by those reduction triples, and therefore a reduction order. Finally, Lemma 3.45 shows that >_G is ground total.
We remark that we could show the termination of Example 3.26 with a ground-total reduction order by additionally using a total precedence as in Theorem 3.46. Also, we note that Lemma 3.45 and Theorem 3.46 can be used for the SPO via the simulation result (Theorem 3.33).
4. REDUCTION PAIRS
While we have considered the reduction-order versions of the MSPO and the (M)GWPO so far, the original WPO has been extended to reduction pairs so it can be used more effectively in the dependency pair framework. After recalling the dependency pair framework in Subsection 4.1, we introduce a reduction-pair version of the GWPO in Subsection 4.2. As a special case of it, in Subsection 4.3 we also present the SPO as a reduction pair, and discuss simulation of GWPOs (which does not hold as in Section 3). In Subsection 4.4 we discuss
As the proof suggests, the lemma does not hold if we adopt multiset extension in the definition of the GWPO.
T. SAITO AND N. HIROKAWA
how to use the reduction pairs more effectively. Finally, Subsection 4.5 presents experimental data of GWPOs in the context of the dependency pair framework.
4.1. Dependency Pairs. We recall the dependency pair framework [AG00, GTSK05a, HM05, HM07]. Let be a TRS. We write for the set of defined symbols. Other symbols are called constructor symbols. Given a term of the form with , we write for . Here is a fresh -ary function symbol corresponding to . The set of such terms is denoted by . The TRS DP( ) is defined as follows:
We note that the condition is Dershowitz's refinement [Der04]. Rules in DP() are called dependency pairs. Dependency pair problems are pairs of TRSs with and . A dependency pair problem is finite if there exists no infinite sequence of the form , where each is terminating with respect to .
Theorem 4.1. A TRS R is terminating if and only if (DP(R), R) is finite.
Whenever we apply the dependency pair framework to a concrete TRS, we stick to the following notational convention: for a function symbol in the original signature , the capitalized symbol (instead of ) denotes the corresponding copy introduced by the dependency pair framework. This is reasonable, e.g., when we use the dependency pair framework with the GWPO and Proposition 3.14, both of which perform marking with .
Example 4.2. Consider the fragment R of the TRS encoding of factorial:
The defined symbols are f and p, so .
Reduction pairs ( ) are common decreasing measures for the dependency pair framework. The next theorem is known as reduction pair processor.
Theorem 4.3. Let ( ) be a reduction pair. A dependency pair problem ( ) with is finite if and only if ( ) is finite.
Since is trivially finite, the theorem above implies a simple method for showing termination by a reduction pair.
Corollary 4.4. A TRS is terminating if there is a reduction pair ( ) with and .
Example 4.5 (continued from Example 4.2). Let be the max/plus interpretation defined by and . Then we have and . For instance, boils down to the valid inequality for all natural numbers . The others are also verified in a similar fashion. So, from Corollary 4.4 we conclude the termination of .
If a monotone reduction pair is employed, Theorem 4.3 can be strengthened in a way that some rules in R can also be removed. This technique is known as rule removal processor, or just rule removal.
Theorem 4.6. Let ( ) be a monotone reduction pair. A dependency pair problem ( ) with is finite if and only if ( ) is finite.
Argument filtering [AG00, KNT06] is a popular transformation for reduction pairs. As the name suggests, this transformation filters out arguments from a given term. Formally, an argument filter is a mapping that associates each n-ary function symbol to an integer or a list of integers with . If is a list for every function symbol , then the argument filtering is called non-collapsing. Non-collapsing argument filters are also called partial statuses. The argument filtering is defined on terms as follows:
Note that by applying , arities of function symbols may change, or some function symbols may be even eliminated. So more precisely, terms after argument filtering are of a different signature. We write for it to distinguish from the original signature . Given a binary relation on terms, we write if .
Proposition 4.7. Let be a reduction pair and an argument filter. Then is a reduction pair.
Although Proposition 4.7 can be used with the WPO as a reduction order (Definition 3.17), a dedicated version of the WPO as a reduction pair is known. Let be a partial status. We abuse to mean that occurs in the list . Similarly, we may identify the list and the corresponding set, because here we only consider an increasing list of argument positions for . If for all , we call total. Similarly, if for all , we call empty. Note that when the signature contains only constants, the unique partial status is both empty and total. If with then we write as .
Below, we define a reduction-pair version of the WPO, reusing the notation for brevity. The same convention applies to the upcoming GWPO/SPO.
Definition 4.8. Let be a partial status, an algebra, and a precedence. The weighted path order ( ) is the pair of relations on terms defined simultaneously as follows: if
-
, or
-
and one of the following conditions holds:
a. and for some .
b. , , for all , and
(i) or
(ii) and .
c. and
The relation >_W is defined by cases 1, 2a and 2b where is replaced by >_W. Here is the lexicographic extension of .
We say that an algebra is weakly (resp. strictly) -simple if the argument position is weakly (resp. strictly) simple for all function symbols and .
There are versions of partial status that allow permutation and/or duplication of arguments [YKS15, TSSY20, Yam22]. Such a version could be considered with additional care of boundedness of arity.
T. SAITO AND N. HIROKAWA
Theorem 4.9 [YKS15]. Let be a partial status, a well-founded precedence, and an algebra that is well-founded, normal, weakly -simple and weakly monotone. Then is a reduction pair. If in addition is total, then is a monotone reduction pair.
The assumption of weak -simplicity is essential for well-foundedness; see Example 3.19.
Example 4.10 (Continued from Example 4.2). To show the termination of R, consider the linear polynomial interpretation A with
and the partial status with and for other function symbols . The WPO ( ) induced from , and the precedence with satisfies and also . To elaborate, follows from case 1, from case 2b(i), and from case 2b(i). The remaining inequality is verified as follows:
Here is used for avoiding the undesired comparison for the second occurrence of . Using Corollary 4.4 we conclude the termination of .
4.2. GWPO as Reduction Pair. As in the reduction-order setting, a reduction-pair version of the GWPO is obtained by generalizing the parameters of the WPO to order pairs.
Definition 4.11. Let be a partial status, and let and be pairs of relations on terms. The generalized weighted path order is a pair of relations on terms defined simultaneously as follows: if
-
or
-
and one of the following conditions holds.
a. and for some .
b. , , for all , and
(i) or
(ii) and .
c. and
The relation >_G is defined by cases 1, 2a and 2b where is replaced by >_G^{\text{lex}}. Here is the lexicographic extension of .
As is done for the original weighted path order in [YKS15, Section 4.2], it is possible to incorporate more refinements in Definition 4.11. This is considered in the first author's dissertation [Sai26], see Section 5 for a brief discussion.
As in the reduction-order setting, we define a monotonic version of the generalized weighted path order.
Definition 4.12. Let be a partial status, and let and be triples of relations on terms. The monotonic generalized weighted path order is defined as the pair of and where is induced by and .
We say that an order pair on terms is simple with respect to a partial status if or holds for all function symbols , terms and . This is an analog of simplicity of algebras with respect to partial statuses which is demanded for the reduction-pair version of WPO. Here we arrive at our main theorem.
Theorem 4.13. Let be a partial status, and and reduction triples. If is simple with respect to , then is a reduction pair.
In fact, the proof is easily done by replaying that for the original WPO. For completeness, the proofs are included in Appendix A.
The original weighted path order as a reduction pair (Theorem 4.9) is obtained by instantiating with , and with the reduction pair induced by precedence. As we expect, the weak -simplicity of guarantees that is simple with respect to .
Now, let us look at a termination proof by Theorem 4.13.
Example 4.14. Consider the TRS R taken from [AG01, Example 3.4]:
Here m stands for minus, p plus, and q quotient. The set consists of six rules:
Let A be the linear polynomial interpretation over N defined by
and the partial status with and for other function symbols . The order pair is simple with respect to since the first arguments of and are taken into account in . So, we construct the reduction pair by Theorem 4.13 with the reduction triples and . To conclude that is terminating, it suffices to show and . This can be seen as follows. Since , these are handled by case 1. The other rules are oriented by , so we compare them after marking the root symbols.
3:
9:
5:
11:
7:
For rules 3 and 9 we further apply recursive comparison by case 2b(ii).
T. SAITO AND N. HIROKAWA
In the example above, some arguments ignored by are used by the interpretation , see for example . This is an advantage of having partial status built in compared to applying the GWPO with the total status followed by argument filtering. As with the case of the WPO [YKS15, Proposition 1], the latter with a non-collapsing argument filter can be simulated by the former, although the two approaches are incomparable in general (as argument filtering allows collapsing). Formally, let be the signature, a non-collapsing argument filter (therefore a partial status), and and reduction triples on . Define on as , and similarly define as .
Proposition 4.15. If has the subterm property, then is simple with respect to . Moreover, is identical to , where is induced by the total status and the reduction triples and , and is induced by and the reduction triples and .
Proof. Our proof follows the same line as that of [YKS15, Proposition 1]: The simplicity of is easy to verify. The other claim follows by showing that if and only if and if and only if for all terms and , by induction on .
4.3. SPO as Reduction Pair. To the best of the authors' knowledge, there is no existing work that formulates the semantic path order as a reduction pair incorporating mutual recursion and partial status as in Definition 4.11. Such a version of the semantic path order is naturally obtained from the GWPO.
Definition 4.16. Let be a partial status and let be a pair of relations on terms. The semantic path order induced by and is defined inductively as follows: if
a. and for some .
b. , , for all , and
(i) or
(ii) and .
c. and
The relation >s is defined by cases a and b, where is replaced by >s. Here is the lexicographic extension of .
Obviously, we could define as induced from and . The monotone version is defined as follows.
Definition 4.17. Let be a partial status, and let be a triple of relations on terms. The monotonic semantic path order is defined as the pair of and where is induced by .
Again, we could define as induced from the reduction triple and . This results in the following corollary.
Corollary 4.18. Let be a partial status, and a reduction triple. Then is a reduction pair.
The example below illustrates a key step in a termination proof of the benchmark Saito_26/AProVE_08_id_inc_p in the Termination Problem Database [Ter], with some simplification. As mentioned in Subsection 4.5, the SPO plays a crucial role.
Example 4.19. Consider the set P of the dependency pairs
and the TRS . To show that the dependency pair problem is finite, we use the max/plus interpretations and defined by:
Let ( , , ) be the lexicographic combination of ( , , ) and ( , , ), and let ( , ) be the SPO induced by ( , , ) and the partial status with and . We can easily verify . For the first dependency pair, we have the following derivation.
Here, follows from the decrease
in , and follows from the decrease
in A. Similarly, we have the following derivation for the second dependency pair.
Here, follows from the decrease
in A, and follows from the decrease
in B. Hence, we conclude that is finite.
Next, following Subsection 3.3 we compare the generalized weighted path order with the semantic path order as a reduction pair. Let be the GWPO induced by a partial status and stable order pairs and . We consider the SPO induced by the lexicographic combination and . In this setting, an analog of Lemma 3.32 holds.
T. SAITO AND N. HIROKAWA
Lemma 4.20. Suppose that is simple with respect to . For all terms and , it holds that implies , and implies .
Proof. We prove the two implications simultaneously by induction on . Here we only prove the first claim, as the other is analogously shown. Let . We analyze how it is derived.
a. If it follows from case a, then and for some . By the induction hypothesis we have . By definition, or holds. In the former case, we use the simplicity assumption of to obtain or , so by case 1. In the latter case, we are done by case 2a.
b. If it follows from case b, we have , and for all . By the induction hypothesis we have for all .
(i) If , we further analyze how it follows: If then we have by case 1. Otherwise, we conclude with case 2b(i).
(ii) If , we further analyze how it follows: If then we have by case 1. Otherwise, we conclude with case 2b(ii) using the induction hypothesis.
c. If it follows from case c, we simply apply the corresponding case 2c with the reflexivity of .
The assumption that A is simple with respect to is essential for the lemma above.
Example 4.21. Consider the signature , the partial status with , and the algebra on defined by and . Let be and let be . Then we have by case a, but does not hold.
The converse is shown by additionally assuming that is total. The proof follows the same line as Lemma 3.31.
Lemma 4.22. Suppose that is simple with respect to , and is total. For all terms and , it holds that implies , and implies .
The assumption that is total cannot be dropped. This contrasts with the simulation result (Theorem 3.33) in the reduction-order setting.
Example 4.23. Suppose that the signature only contains a unary function symbol f. Let be the partial status defined by , let be the algebra on defined by , and let be an arbitrary pair of relations on terms (e.g., one induced by a precedence to consider the original WPO). On one hand, the GWPO induced by and satisfies and by case 1. On the other hand, no SPO (regardless of the underlying order pair) satisfies , because the only possible case, case a, is blocked by .
The cause behind the example above is very simple: if , the GWPO satisfies and with case 1 regardless of the underlying partial status, while or may not be possible if the partial status does not allow it.
As a consequence of Lemma 4.20 and Lemma 4.22, we can show an analog of Theorem 3.33 and Corollary 3.35: Let be the monotone generalized weighted path order induced by a partial status and reduction triples and , and let be the monotone semantic path order induced by and .
Theorem 4.24. If is simple with respect to , then we have and as well as . If additionally is total, then and are identical to and , respectively.
So, in the setting of Theorem 4.24 the GWPO is preferred over the SPO. In other words, the SPO should be used only if the simplicity requirement is unsatisfied.
Theorem 4.24 does not allow SPOs to simulate GWPOs with partial statuses. So, it is natural to seek a better construction. However, we note that any such construction must essentially assume well-foundedness of the order pair A, in contrast to Theorem 3.33 and Theorem 4.24. This can be seen from the following example.
Example 4.25. Suppose that the signature only contains a unary function symbol f. Let be the partial status defined by , let be the algebra on non-positive integers defined by , and let be an arbitrary pair of relations on terms. Here, the carrier of is endowed with the ordinary order pair on integers, so > is not well-founded. On one hand, the GWPO induced by and satisfies and by case 1 and . On the other hand, no SPO (regardless of the underlying order pair and partial status) satisfies , let alone , as can be seen from the definition.
We remark that non-well-founded algebras like the one above have been used for non-reachability proofs with WPOs [Yam22].
4.4. Using GWPO with Refinements to the Reduction Pair Processor. There are many refinements to use reduction pairs more effectively in the dependency pair framework. Among others, here we consider rule removal, usable rule and lexicographic combination, providing some necessary facts to use GWPOs with them.
For rule removal (Theorem 4.6), we should use rather than , because monotonicity is required for the reduction pair.
Theorem 4.26. Let be a partial status, and and reduction triples with simple with respect to . Then is a normal reduction pair. If in addition is total, then is a monotone reduction pair.
Proof. The normality is a consequence of , which is verified by straightforward induction. The monotonicity is shown in a similar way to the proof of Theorem 3.7. The other properties are consequences of Theorem 4.13.
However, while exploring the experimental configurations for Subsection 4.5 we found no case where rule removal with was useful. Rather, we find that Theorem 4.26 is useful to construct a normal reduction pair, which is required for lexicographic combination (to be explained soon). The next example shows that the reduction pairs and are not always normal.
Example 4.27. Let be the linear polynomial interpretation with and . The SPO () induced by the total status with and the reduction triple () is not normal. In fact, it satisfies but due to .
Remark 4.28. As a side remark, we relate the reduction-pair version and the reduction-order version: Let > be the reduction-order version of the MGWPO (Definition 3.22) induced by reduction triples A and B, and let ( ) be the reduction-pair version of the MGWPO (Definition 4.12) induced by the total status, A and B. Then by easy simultaneous induction one can show that and > , where is the reflexive closure of >. For termination proving, the greater relations are the more profitable, so we should use the reduction-pair version.
T. SAITO AND N. HIROKAWA
The usable rule technique [Urb04, GTSK05a, GTSK05b, GTSKF06, HM07] is a popular refinement to Theorem 4.3 which relaxes the requirement to for a possibly smaller set of usable rules; see also [ST10, Section 4] for the most general version. The technique demands the reduction pair to be -compatible, meaning that the reduction pair can be extended to another one with . Here and is a fresh binary symbol. Like usual reduction pairs, the GWPO satisfies -compatibility almost for free, as we show in what follows.
We say that a reduction triple ( , , ) is -compatible if it can be extended to another one ( , , ) with . We call it strongly -compatible if such an extension can be chosen to satisfy both and . Let and be reduction triples such that is simple with respect to a partial status .
Proposition 4.29. If A is strongly -compatible and B is -compatible, then and induced by A, B and are -compatible reduction pairs.
Proof. Using the assumption, we can extend and to and , respectively, so that the inclusion holds. We can also extend to with . The relation induced by and satisfies . Here, follows from case 2a using . Moreover, -simplicity for is satisfied since and is -simple. Therefore, Theorem 4.13 and Theorem 4.26 can be applied.
The assumption of the proposition above is rather mild in practice, because usual reduction triples are -compatible: the trivial reduction triple and those induced by precedences (Proposition 3.9) are -compatible; usual interpretations (like polynomial interpretations, max/plus interpretations, matrix interpretation [EWZ08], and so on) can be used to construct -compatible reduction triples via Proposition 3.14, and strongly -compatible ones via Proposition 3.11; and lexicographic combination (Proposition 3.34) preserves -compatibility. Moreover, the trivial reduction triple is strongly -compatible, so Proposition 4.29 can be applied to the SPO if it is induced by a -compatible reduction triple. However, -compatibility is not guaranteed for the model-based construction of Proposition 3.15. Note that admits only trivial models [HM07].
Continuing with the usable rule technique, we consider -compatibility of reduction pairs, which is relevant to the refinement called usable rule w.r.t. argument filtering [GTSKF06]. Let us recall the formal definition: The -th argument position of a function symbol is invariant w.r.t. a relation if for all terms and and contexts with the hole at the -th argument of [SH25]. A reduction pair is -compatible for a partial status if the -th argument position of is invariant w.r.t. whenever . So, below we give a sufficient condition of invariance w.r.t. . For convenience, we extend the notion of invariance to reduction triples: The -th argument position of a function symbol is invariant w.r.t. a reduction triple if it is so with respect to and .
Proposition 4.30. Let be the MGWPO induced by a partial status and reduction triples and . Suppose that is simple w.r.t. . The -th argument position of a function symbol is invariant w.r.t. if it is so w.r.t. and , and also .
Proof. Let and be terms and a context with the hole at the -th argument of . By assumption, we have and by case 2b(ii). So .
We can use the criterion above as follows: Given a partial status and reduction triples and with simple w.r.t. , we define the partial statuses by
for each function symbol . Also, we define for each -ary function symbol . Then and induced by , and are -compatible.
The remaining problem for using Proposition 4.30 is how to estimate invariant positions for the underlying reduction triples A and B. For those induced by algebras, this is done by adapting how to do it for reduction pairs, see for example [SH25]. For the trivial reduction triple and those induced by precedences, all argument positions are invariant. Also, lexicographic combination (Proposition 3.34) preserves invariance: if an argument position is invariant w.r.t. reduction triples A and B, then it is so w.r.t. the lexicographic combination of A and B.
Lexicographic combination of reduction pairs [SH25] is another technique to which invariance is relevant; this can be done by Proposition 4.30. Also, the technique demands normality of all reduction pairs but the last of the combination; this can be done by using ( ) with Theorem 4.26. Lastly, it demands us to identify monotone positions of the strict order : Formally, the -th argument position of a function symbol is monotone w.r.t. a relation if for all terms and with . We have a proposition for monotone positions in the style of Proposition 4.30.
Proposition 4.31. Let >MG be the MGWPO induced by a partial status and reduction triples ( ) and ( ). Suppose that ( ) is simple w.r.t. . The i-th argument position of a function symbol is monotone w.r.t. >MG if .
4.5. Evaluation with Benchmark Problems. In order to evaluate GWPOs as reduction pairs, we implemented them in the prototype termination tool Mint based on the dependency pair framework. Below we explain the experimental setting, and then discuss the results.
To describe the configuration of reduction pairs in Table 2, we use the notation of Table 1. We additionally put the following assumptions on interpretations.
• Linear polynomial interpretations A over N interpret each function symbol as
where and for all .
• Max/plus interpretations A interpret each function symbol as
where , and for all
The restrictions above on coefficients allow us to keep the search for parameters decidable, as explained in due course. In contrast, arbitrary interpretations are allowed for . Moreover, by abuse of the notation, may denote not only the class of algebras, but the class of reduction triples constructed from linear polynomial interpretations (via Proposition 3.11); the same goes for . In this setting, and generalize as classes of reduction pairs, and also generalizes . These are consequences of Proposition A.12 and Proposition A.13.
The tool and experimental data are available at: https://www.jaist.ac.jp/project/mint/
T. SAITO AND N. HIROKAWA
Table 1: Notation for reduction-pair configurations used in the experiment.
| construct | reads as |
|---|---|
| T | trivial reduction triple |
| P | precedence as reduction triple (Proposition 3.9) |
| L | linear polynomial interpretation over N (as algebra or reduction triple) |
| linear polynomial interpretation over N with Proposition 3.14 | |
| M | max/plus interpretation (as algebra or reduction triple) |
| max/plus interpretation with Proposition 3.14 | |
| finite algebra over with Proposition 3.15 | |
| lexicographic combination of reduction triples A and B (Proposition 3.34) | |
| WPO() | WPO induced by algebra (Theorem 4.9), equals GWPO() |
| GWPO() | GWPO induced by reduction triples A and B (Theorem 4.13) |
| SPO() | SPO induced by reduction triple A (Corollary 4.18), equals GWPO(T, A) |
Our termination tool Mint is based on the standard techniques in the dependency pair framework, namely, recursive cycle analysis based on strongly connected components of dependency graphs [AG00, GAO02, HM05] and reduction pairs (Theorem 4.3). In addition, we use the usable rule technique (explained in Subsection 4.4) with tcap [GTSK05b] and the refinement called usable rule w.r.t. argument filter [GTSKF06]. To handle applicative term rewrite systems more effectively, the tool also uses the uncurrying technique [HMZ13]. The search for suitable reduction pairs is performed by encoding the search problem in the language of satisfiability modulo theory (SMT) solvers, using the standard techniques [ZHM09, YKS15]. Our restrictions on coefficients of linear polynomial or max/plus interpretations to allow us to encode it into quantifier-free linear integer arithmetic with if-then-else expressions, which is known to be decidable. As discussed at the end of Subsection 4.4, -compatibility for usable rules is guaranteed for free, except for the case of using finite algebras . In this case, the reduction pair processor is applied without the usable rule technique.
The problems for the experiment consist of 1542 finite TRSs included below the directory TRS_Standard of version 11.6 of the Termination Problem Database (TPDB) [Ter], including the secret problems for the Termination Competition 2026. The termination tool was run on a machine equipped with an Intel Core i7-11850H CPU (8 cores, 16 threads, 2.50–4.80 GHz) and 16 GB RAM, and used Z3 version 4.13.0 [dMB08] as an SMT solver for constraint solving. A one-minute timeout was set for each run of a configuration on a termination problem. So, if a run neither proved (non-)termination nor timed out, it means that it terminated after exhausting the search space, or aborted due to some errors such as memory exhaustion. Some of the problems contain ill-formed rewrite rules like . Our tool reports them as non-terminating TRSs, as other tools do.
Let us explain how to read the result table (Table 2) with an example: the configuration proved termination of 246 TRSs in the problem set, aborted on 11 problems (actually due to memory exhaustion), and reached the time limit for 19 problems. The total runtime on the whole problem set was 60 minutes.
Overall, we obtained more termination proofs by switching from the original WPO to the GWPO. Combining different kinds of algebras is quite effective, which is not possible for the WPO. As in theory, every problem solved by WPO(L) was also solved by GWPO(L, L), and the same holds for WPO(M) and GWPO(M, M). Due to the time limit, there was just one problem
Table 2: Experimental results on 1542 TRSs from TPDB.
| configuration | proofs | timeouts | errors | total (min) | note |
|---|---|---|---|---|---|
| WPO(L) | 578 | 22 | 0 | 50 | equals GWPO(L, P) |
| WPO(M) | 616 | 55 | 0 | 101 | equals GWPO(M, P) |
| GWPO(L, L#) | 607 | 20 | 0 | 44 | generalizes WPO(L) |
| GWPO(L, M#) | 704 | 45 | 0 | 100 | generalizes WPO(L) |
| GWPO(M, L#) | 703 | 39 | 0 | 81 | |
| GWPO(M, M#) | 639 | 61 | 0 | 127 | generalizes WPO(M) |
| SPO(L# × L#) | 595 | 22 | 0 | 51 | equals GWPO(T, L# × L#) |
| SPO(L# × M#) | 700 | 55 | 0 | 110 | equals GWPO(T, L# × M#) |
| SPO(M# × L#) | 700 | 60 | 0 | 129 | equals GWPO(T, M# × L#) |
| SPO(M# × M#) | 640 | 79 | 0 | 167 | equals GWPO(T, M# × M#) |
| SPO(F2#) | 246 | 19 | 11 | 60 | equals GWPO(T, F2#) |
| AProVE | 1036 | 230 | 0 | 289 | [GAB+17] |
| NaTT | 888 | 40 | 1 | 91 | implements WPO [YKS14] |
solved by WPO(L) but not by GWPO(L, M#). The configuration SPO(F2#) proved termination of 9 TRSs that could not be proven by the other 10 constructions of reduction pairs. A representative example is of Example 3.16 (SK90/4.50 in TPDB).
We also discuss the impact of the GWPO on state-of-the-art termination provers. Due to space limitations, we only consider the top two tools in the TRS_Standard category of the Termination Competition 2026, namely AProVE [GAB 17] and NaTT [YKS14]. As shown in Table 2, AProVE proved termination of 1036 TRSs, and NaTT proved termination of 888 TRSs, in the same experimental setting (with a one-minute time limit). The configurations of the form GWPO(*, ) or SPO() collectively proved termination of 725 distinct TRSs. Among them, there were 9 TRSs whose termination could not be proved by NaTT, namely:
AProVE_04/forward_instantiation
Saito_26/AProVE_08_id_inc_p
AProVE_04/forward_instantiation2
Strategy_removed_AG01/#4.25
AProVE_08/id_inc
Transformed_CSR_04/Ex4_DLMMU04_iGM
SK90/4.50
Various_04/11
SK90/4.55
Among them, AProVE failed to prove termination of Saito_26/AProVE_08_id_inc_p. The TRS is given below.
This problem was crafted by the first author as a secret problem for the Termination Competition 2026. There, our tool Mint was the only tool that proved the termination. We refer to Example 4.19 for the intuition behind the termination proof using .
T. SAITO AND N. HIROKAWA
5. CONCLUSION
We addressed the issues of the (M)SPO through the lens of the GWPO. In the reduction-order setting, we identified an efficient subclass (Theorem 3.37), and also a ground-total subclass (Theorem 3.46) for the GWPO. These results are also applicable to the (M)SPO by appealing to the simulation result (Theorem 3.33 and Corollary 3.35). In the reduction-pair setting, we devised a reduction-pair version of the GWPO (Theorem 4.13), and thereby the first reduction-pair version of the SPO (Corollary 4.18). The experiment with standard benchmarks (Table 2) demonstrated a large improvement over the original WPO.
We conclude with related and future work. In particular, we briefly discuss some related results presented in the first author's PhD thesis [Sai26] but not presented here.
Termination modulo associativity and commutativity (AC) is characterized by so-called AC reduction orders in a similar way to Proposition 2.3. There are already AC versions of KBOs [Ste90, KV03, YWHM16], recursive path orders [Rub02], multiset path orders [HM25], and monotonic semantic path orders [BR03]. (In fact, Ochiai, Aoto and Toyama pointed out a flaw in the monotonicity of Borralleras and Rubio's AC-MSPO, and proposed a remedy for it [OAT05].) It is interesting to investigate unified orders for AC rewriting, as has been done for plain rewriting. As a first step, the first author has investigated an AC version of the GWPO ([Sai26, Section 3.4]) that corresponds to the E-AC-MSPO of [Bor03, Section 2.6] (a simpler version of the aforementioned AC-MSPO), establishing a simulation result.
The WPO has been extended to co-rewrite pairs [Yam22], which are a generalization of reduction pairs to prove non-reachability in term rewriting. Not so surprisingly, the GWPO can be extended to co-rewrite pairs in a similar way; the details are found in [Sai26, Chapter 5]. We note that co-rewrite pairs can be used as discrimination pairs for proving non-confluence [Aot13].
There is an extension of the reduction-pair version of the WPO (found in [YKS15, Section 4.2]) to properly subsume interpretation-based reduction pairs, i.e., and can be satisfied by choosing a suitable partial status and precedence. Although this extension does not greatly improve the power of the WPO in practice, it is natural to investigate a similar extension for the GWPO. In fact, it has turned out that the GWPO with a similar extension is possible, and can simulate arbitrary non-trivial reduction pairs ([Sai26, Theorem 4.3.7]).
While the path orders considered here compare arguments only lexicographically, it is well known that they can be extended to allow choice of argument comparison method depending on the root function symbols. In fact, the WPO formalized in Isabelle/HOL [STY21] extends Definition 4.8 so that it allows a choice between multiset and lexicographic extensions for each symbol, incorporating the well-known extension for the recursive path order. It is very likely that the same extension is also possible for the GWPO, because the proofs here seem independent of lexicographic extension. The general path order (GPO) [DH95, Ges96] is a unifying framework for such extensions, parameterizing the way to compare arguments. The relationship between the GPO and our GWPO is worth investigating.
ACKNOWLEDGMENT
We thank René Thiemann and Akihisa Yamada for valuable feedback on our work. We also thank Jürgen Giesl for interesting questions at WST 2023 and FroCoS 2023, which led to
Section 4 and Subsection 3.5, respectively. Special thanks go to Alfons Geser for providing a copy of his technical report [Ges92].
REFERENCES
[AG00] T. Arts and J. Giesl. Termination of term rewriting using dependency pairs. Theoretical Computer Science, 236:133–178, 2000. doi:10.1016/S0304-3975(99)00207-8.
[AG01] T. Arts and J. Giesl. A collection of examples for termination of term rewriting using dependency pairs. Technical report, RWTH Aachen, 2001.
[Aot13] T. Aoto. Disproving confluence of term rewriting systems by interpretation and ordering. In Proc. 9th International Symposium on Frontiers of Combining Systems, volume 8152 of LNCS, pages 311–326, 2013. doi:10.1007/978-3-642-40885-4_22.
[Bar84] H. P. Barendregt. The Lambda Calculus: Its Syntax and Semantics. Elsevier, 1984.
[BDP89] L. Bachmair, N. Dershowitz, and D. A. Plaisted. Resolution of Equations in Algebraic Structures: Completion without Failure, volume 2, pages 1–30. Academic Press, 1989. doi:10.1016/B978-0-12-046371-8.50007-9.
[BFR00] C. Borralleras, M. Ferreira, and A. Rubio. Complete monotonic semantic path orderings. In Proc. 17th International Conference on Automated Deduction, volume 1831 of LNCS (LNAI), pages 346–364, 2000. doi:10.1007/10721959_27.
[BG94] L. Bachmair and H. Ganzinger. Rewrite-based equational theorem proving with selection and simplification. Journal of Logic and Computation, 4(3):217–247, 1994. doi:10.1093/LOGCOM/4.3.217.
[BK79] J. Bergstra and J.W. Klop. Church–Rosser strategies in the lambda calculus. Theoretical Computer Science, 9(1):27–38, 1979. doi:10.1016/0304-3975(79)90004-5.
[Bor03] C. Borralleras. Ordering-Based Methods for Proving Termination Automatically. PhD thesis, Universitat Politècnica de Catalunya, 2003.
[BR03] C. Borralleras and A. Rubio. Monotonic AC-compatible semantic path orderings. In Proc. 14th International Conference on Rewriting Techniques and Applications, volume 2706 of LNCS, pages 279–295, 2003. doi:10.1007/3-540-44881-0_20.
[BR07] C. Borralleras and A. Rubio. Orderings and constraints: Theory and practice of proving termination. In Rewriting, Computation and Proof, Essays Dedicated to Jean-Pierre Jouannaud on the Occasion of His 60th Birthday, volume 4600 of LNCS, pages 28–43, 2007. doi:10.1007/978-3-540-73147-4_2.
[Buc95] W. Buchholz. Proof-theoretic analysis of termination proofs. Annals of Pure and Applied Logic, 75(1–2):57–65, 1995. doi:10.1016/0168-0072(94)00056-9.
[Der82] N. Dershowitz. Orderings for term-rewriting systems. Theoretical Computer Science, 17:279–301, 1982. doi:10.1016/0304-3975(82)90026-3.
[Der04] N. Dershowitz. Termination by abstraction. In Proc. 20th International Conference on Logic Programming, volume 3132 of LNCS, pages 1–18, 2004. doi:10.1007/978-3-540-27775-0_1.
[DH95] N. Dershowitz and C. Hoot. Natural termination. Theoretical Computer Science, 142:179–207, 1995. doi:10.1016/0304-3975(94)00275-4.
[dMB08] L. M. de Moura and N. S. Bjørner. Z3: an efficient SMT solver. In Proc. 14th International Conference on Tools and Algorithms for the Construction and Analysis of Systems, volume 4963 of LNCS, pages 337–340, 2008. doi:10.1007/978-3-540-78800-3_24.
[EWZ08] J. Endrullis, J. Waldmann, and H. Zantema. Matrix interpretations for proving termination of term rewriting. Journal of Automated Reasoning, 40(2-3):195–220, 2008. doi:10.1007/S10817-007-9087-9.
[FGM 08] C. Fuhs, J. Giesl, A. Middeldorp, P. Schneider-Kamp, R. Thiemann, and H. Zankl. Maximal termination. In Proc. 19th International Conference on Rewriting Techniques and Applications, volume 5117 of LNCS, pages 110–125, 2008. doi:10.1007/978-3-540-70590-1_8.
[GAB 17] J. Giesl, C. Aschermann, M. Brockschmidt, F. Emmes, F. Frohn, C. Fuhs, J. Hensel, C. Otto, M. Plücker, P. Schneider-Kamp, T. Ströder, S. Swiderski, and R. Thiemann. Analyzing program termination and complexity automatically with AProVE. Journal of Automated Reasoning, 58:3–31, 2017. doi:10.1007/s10817-016-9388-y.
T. SAITO AND N. HIROKAWA
[GAO02] J. Giesl, T. Arts, and E. Ohlebusch. Modular termination proofs for rewriting using dependency pairs. Journal of Symbolic Computation, 34:21–58, 2002. doi:10.1006/jsco.2002.0541.
[Ges92] A. Geser. On a monotonic semantic path ordering. Technical Report 92–13, Ulmer Informatik-Berichte, Universität Ulm, Germany, 1992.
[Ges96] A. Geser. An improved general path order. Applicable Algebra in Engineering, Communication and Computing, 7:469–511, 1996. doi:10.1007/BF01293264.
[GTSK05a] J. Giesl, R. Thiemann, and P. Schneider-Kamp. The dependency pair framework: Combining techniques for automated termination proofs. In Proc. 11th International Conference on Logic Programming and Automated Reasoning, volume 3452 of LNCS (LNAI), pages 301–331, 2005. doi:10.1007/978-3-540-32275-7_21.
[GTSK05b] J. Giesl, R. Thiemann, and P. Schneider-Kamp. Proving and disproving termination of higher-order functions. In Proc. 5th International Symposium on Frontiers of Combining Systems, volume 3717 of LNCS (LNAI), pages 216–231, 2005. doi:10.1007/11559306_12.
[GTSKF06] J. Giesl, R. Thiemann, P. Schneider-Kamp, and S. Falke. Mechanizing and improving dependency pairs. Journal of Automated Reasoning, 37:155–203, 2006. doi:10.1007/s10817-006-9057-7.
[HM04] N. Hirokawa and A. Middeldorp. Polynomial interpretations with negative coefficients. In Proc. 7th International Conference on Artificial Intelligence and Symbolic Computation, volume 3249 of LNCS, pages 185–198, 2004. doi:10.1007/978-3-540-30210-0_16.
[HM05] N. Hirokawa and A. Middeldorp. Automating the dependency pair method. Information and Computation, 199(1-2):172–199, 2005. doi:10.1016/J.IC.2004.10.004.
[HM07] N. Hirokawa and A. Middeldorp. Tyrolean termination tool: Techniques and features. Information and Computation, 205(4):474–511, 2007. doi:10.1016/J.IC.2006.08.010.
[HM25] N. Hirokawa and A. Middeldorp. Hydra battles and AC termination. Logical Methods in Computer Science, 21(2), 2025. doi:10.46298/LMCS-21(2:29)2025.
[HMZ13] N. Hirokawa, A. Middeldorp, and H. Zankl. Uncurrying for termination and complexity. Journal of Automated Reasoning, 50(3):279–315, 2013. doi:10.1007/S10817-012-9248-3.
[JK20] J. Jakubuv and C. Kaliszyk. Relaxed weighted path order in theorem proving. Mathematics in Computer Science, 14:657–670, 2020. doi:10.1007/s11786-020-00474-0.
[KB70] D.E. Knuth and P.B. Bendix. Simple word problems in universal algebras. In J. Leech, editor, Computational Problems in Abstract Algebra, pages 263–297. Pergamon Press, 1970. doi:10.1016/B978-0-08-012975-4.50028-X.
[KL80] S. Kamin and J.J. Lévy. Two generalizations of the recursive path ordering. Technical report, University of Illinois, 1980. Unpublished manuscript.
[KNT06] K. Kusakari, M. Nakamura, and Y. Toyama. Elimination transformations for associative-commutative rewriting systems. Journal of Automated Reasoning, 37(3):205–229, 2006. doi:10.1007/S10817-006-9053-Y.
[KV03] K. Korovin and A. Voronkov. An AC-compatible Knuth–Bendix order. In Proc. 19th International Conference on Automated Deduction, volume 2741 of LNCS (LNAI), pages 45–59, 2003. doi:10.1007/978-3-540-45085-6_5.
[Lan75] D. Lankford. Canonical algebraic simplification in computational logic. Technical Report ATP-25, University of Texas, 1975.
[Löc06a] B. Löchner. Things to know when implementing KBO. Journal of Automated Reasoning, 36(4):289–310, 2006. doi:10.1007/S10817-006-9031-4.
[Löc06b] B. Löchner. Things to know when implementing LPO. International Journal on Artificial Intelligence Tools, 15(1):53–80, 2006. doi:10.1142/S0218213006002564.
[OAT05] H. Ochiai, T. Aoto, and Y. Toyama. AC-termination by modified monotonic AC-compatible semantic path orderings. In COMP2004-76, pages 23–31, March 2005.
[Rub02] A. Rubio. A fully syntactic AC-RPO. Information and Computation, 178:515–533, 2002. doi:10.1006/inco.2002.3158.
[Sai26] T. Saito. Unifying Semantic Path Order and Weighted Path Order. PhD thesis, Japan Advanced Institute of Science and Technology, 2026. URL: https://hdl.handle.net/10119/20584.
[Sch20] J. Schöpf. The weighted path order in T T . Master's thesis, University of Innsbruck, 2020.
[SH23] T. Saito and N. Hirokawa. Weighted path orders are semantic path orders. In Proc. 14th International Symposium on Frontiers of Combining Systems, volume 14279 of LNCS (LNAI), 2023. doi:10.1007/978-3-031-43369-6_4.
[SH25] T. Saito and N. Hirokawa. Lexicographic combination of reduction pairs. In Proc. 30th International Conference on Automated Deduction, volume 15943 of LNCS (LNAI), pages 167–186, 2025. doi:10.1007/978-3-031-99984-0_10.
[SL06] A. Stump and B. Löchner. Knuth–Bendix completion of theories of commuting group endomorphisms. Information Processing Letter, 98:195–198, 2006. doi:10.1016/j.ipl.2006.01.009.
[ST10] C. Sternagel and R. Thiemann. Certified subterm criterion and certified usable rules. In Proc. 21st International Conference on Rewriting Techniques and Applications, volume 6 of LIPIcs, pages 325–340, 2010. doi:10.4230/LIPIcs.RTA.2010.325.
[ST13] C. Sternagel and R. Thiemann. Formalizing Knuth–Bendix orders and Knuth–Bendix completion. In Proc. 13th International Conference on Rewriting Techniques and Applications, volume 21 of LIPIcs, pages 287–302, 2013. doi:10.4230/LIPIcs.RTA.2013.287.
[Ste90] J. Steinbach. AC-termination of rewrite systems: a modified Knuth–Bendix ordering. In Proc. 2nd International Conference on Algebraic and Logic Programming, volume 463 of LNCS, pages 372–386, 1990.
[STY21] C. Sternagel, R. Thiemann, and A. Yamada. A formalization of weighted path orders and recursive path orders. Archive of Formal Proofs, September 2021. https://isa-afp.org/entries/Weighted_Path_Order.html, Formal proof development.
[Ter] Termination Community. The Termination Problem Database (TPDB). https://github.com/TermCOMP/TPDB-ARI. Accessed: 09.10.2026.
[Toy04] Y. Toyama. Termination of S-expression rewriting systems: Lexicographic path ordering for higher-order terms. In Proc. 15th International Conference on Rewriting Techniques and Applications, volume 3091 of LNCS, pages 40–54, 2004. doi:10.1007/978-3-540-25979-4_3.
[TSSY20] R. Thiemann, J. Schöpf, C. Sternagel, and A. Yamada. Certifying the weighted path order (invited talk). In Zena M. Ariola, editor, Proc. 5th International Conference on Formal Structures on Computation and Deduction, volume 167 of LIPIcs, pages 4:1–4:20, 2020. doi:10.4230/LIPICS.FSCD.2020.4.
[Urb04] X. Urbain. Modular & incremental automated termination proofs. Journal of Automated Reasoning, 34(4):315–355, 2004. doi:10.1007/BF03177743.
[Yam14] A. Yamada. The Weighted Path Order for Termination of Term Rewriting. PhD thesis, Nagoya University, 2014.
[Yam22] A. Yamada. Term orderings for non-reachability of (conditional) rewriting. In Proc. 11th International Joint Conference on Automated Reasoning, volume 13385 of LNCS, pages 248–267, 2022. doi:10.1007/978-3-031-10769-6_15.
[YKS14] A. Yamada, K. Kusakari, and T. Sakabe. Nagoya Termination Tool. In Proc. Joint 25th International Conference on Rewriting Techniques and Applications and 12th International Conference on Typed Lambda Calculi and Applications, volume 8560, pages 466–475, 2014. doi:10.1007/978-3-319-08918-8_32.
[YKS15] A. Yamada, K. Kusakari, and T. Sakabe. A unified ordering for termination proving. Science of Computer Programming, 111:110–134, 2015. doi:10.1016/j.scico.2014.07.009.
[YWHM16] A. Yamada, S. Winkler, N. Hirokawa, and A. Middeldorp. AC-KBO revisited. Theory Pract. Log. Program., 16(2):163–188, 2016. doi:10.1017/S1471068415000083.
[Zan94] H. Zantema. Termination of term rewriting: Interpretation and type elimination. Journal of Symbolic Computation, 17:23–50, 1994. doi:10.1006/jsco.1994.1003.
[Zan95] H. Zantema. Termination of term rewriting by semantic labelling. Fundamenta Informaticae, 24:89–105, 1995. doi:10.3233/FI-1995-24124.
[ZHM09] H. Zankl, N. Hirokawa, and A. Middeldorp. KBO orientability. Journal of Automated Reasoning, 43:173–201, 2009. doi:10.1007/s10817-009-9131-z.
APPENDIX A. OMITTED PROOFS
We show that the termination of Example 3.26 cannot be shown by a WPO as a reduction order, if the algebra is restricted to a linear polynomial interpretation.
Proposition A.1. There is no weakly simple linear polynomial interpretation A and precedence such that the induced WPO >_W satisfies .
T. SAITO AND N. HIROKAWA
Proof. Let be a weakly simple linear polynomial interpretation of the form and . As is weakly simple, we have . Suppose (. Consider . It is unfolded to the inequality:
This leads to and , yielding a contradiction. So case 1 is impossible. Moreover, cases 2a and 2b(ii) are impossible because of the variables, and case 2b(i) is also impossible because and have the same root symbols.
Next, we prove Theorem 3.3. Let be a stable order pair on and the induced SPO. The transitivity, irreflexivity, and stability of are straightforward to prove.
Lemma A.2. The SPO > s is a stable strict order with the subterm property.
It remains to prove well-foundedness of >s under the assumption that ⊠ is well-founded and F is bounded. This follows from Corollary 4.18 and Remark 4.28: >s is well-founded because it is contained in the well-founded order of the reduction-pair version of the SPO.
We present a proof of Theorem 4.13 following the proofs for the WPO [YKS15, Yam22]. Except for well-foundedness, we only indicate the proof strategies by induction because the rest is routine; see [Sai26, Chapter 4] for the omitted details. Let be the GWPO induced by a partial status and pairs and of relations on terms.
Lemma A.3. The inclusion holds.
Proof. Easy induction on shows that implies .
Lemma A.4. If and are order pairs, then and are transitive, and is compatible.
Proof. As in [YKS15, Lemma 7], the claim is proven by showing the next four properties for all terms and : if and then ; if and then ; if and then ; and if and then . This is done by easy simultaneous induction on .
Lemma A.5. If and are reflexive and is simple with respect to , then
• whenever and , and
• for all (i.e., is reflexive).
Proof. As in [Yam22, Lemma 1], the claims are shown by simultaneous induction on . ☐
Next we show stability via Lemma A.5.
Lemma A.6. If and are stable, and are reflexive, and is simple with respect to , then is stable.
Proof. It suffices to prove the following properties: for all terms and and substitutions , if then , and if then . Following [Yam22, Lemma 2], we can prove these claims simultaneously by induction on .
For our well-foundedness proof, we recall the notion of lexicographic product. In contrast to lexicographic combination, order pairs on possibly different sets are combined into a strict order on the set of tuples.
Definition A.7. Let be order pairs on sets , respectively. The lexicographic product is the strict order > defined on as follows: if there exists an index such that and for all .
Like lexicographic combination, the product operation preserves well-foundedness.
Proposition A.8. The lexicographic product of order pairs is well-founded if every is well-founded.
For showing that >_G is well-founded, we adopt Buchholz's method [Buc95]. One can find a similar proof in [YKS15, Lemma 8]. We write for the set of all terms such that there is no infinite descending sequence starting from . We have the following basic properties:
• The restriction of >_G to is a well-founded order on .
• if for all terms with .
To exploit these properties, we need the assumptions to use Lemma A.4.
Lemma A.9. Suppose that and are well-founded stable order pairs, and is simple with respect to . Then whenever and for all .
Proof. We perform induction on the quadruple with respect to , where is the lexicographic product
defined on for an upper bound of arity. It suffices to prove that whenever . If is a variable, then by definition must hold. By applying to successively, we obtain , which contradicts the well-foundedness of . So, letting , we analyze the derivation of .
-
Suppose . By the simplicity assumption, we have or , and therefore for all we have by case 1. So, we apply the induction hypothesis with to obtain for all . Here, for readability, the decreasing components are indicated by underlining. Then, we apply the induction hypothesis with to conclude .
-
Suppose .
a. Assume and for some . Then we have by Lemma A.4, so yields .
b. Assume for all . We apply the induction hypothesis with
to obtain for all . Now, we apply the induction hypothesis with
to obtain , where the inequality of is justified as follows: if case 2b(i) holds, the second component decreases; if case 2b(ii) holds, the third decreases.
SN stands for strong normalization, which is another name for termination.
T. SAITO AND N. HIROKAWA
Lemma A.10. Suppose that and are well-founded stable order pairs, and is simple with respect to . Then is well-founded.
Proof. We show that for all terms by structural induction on . It suffices to show that whenever . By the same argument used in the proof of Lemma A.9, we can assume that is not a variable, so let . By the induction hypothesis for all , so Lemma A.9 applies.
To conclude Theorem 4.13, it remains to prove monotonicity. Let be the monotone generalized weighted path order induced by a partial status and triples and of relations on terms.
Lemma A.11. Suppose that and are reduction triples, and is simple with respect to . Then is monotone. If in addition is total, then is also monotone.
Proof. The claim can be shown using Lemma A.5, following the line of Theorem 3.7.
In Table 2 it is claimed that GWPO(L, L⁺) generalizes WPO(L) and GWPO(M, M⁺) generalizes WPO(M), as classes of reduction pairs. To show this, let F be the finite signature, and (≥w, >w) the WPO induced by an F-algebra A on N (ordered as usual), a precedence ≥ and a partial status π. The signature F can be partitioned into equivalence classes induced by ≥. We can assume that they are topologically sorted. So we have whenever , , and . Now we extend A to the -algebra with for each . Then we have:
Proposition A.12. The GWPO ( ) induced by the partial status and the reduction triples ( ) and ( ) extends ( ).
Proof. By construction, extends . Moreover, since is normal, extends . The claim immediately follows from these facts.
By slightly changing the argument above, we can show that GWPO(L, M⁺) generalizes WPO(L): After taking the partition , we define a max/plus -algebra by
for each . Then we have:
Proposition A.13. Let be the GWPO induced by the partial status and the reduction triples and , and let and be terms with . Then implies , and also implies .
Proof. By construction, extends , and extends , as in the proof of Proposition A.12. Moreover, follows from . So the claim holds.
Since the dependency pair framework assumes TRSs with the variable conditions, the requirement in the statement is satisfied for free.
This work is licensed under the Creative Commons Attribution License. To view a copy of this license, visit https://creativecommons.org/licenses/by/4.0/ or send a letter to Creative Commons, 171 Second St, Suite 300, San Francisco, CA 94105, USA, or Eisenacher Strasse 2, 10777 Berlin, Germany