arXiv:2610.39536cs.LOOct 2026

Manuscript Offprint

arXiv:2610.39536

Semantic Path Orders are Generalized Weighted Path Orders

Teppei Saito, Nao Hirokawa

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

TEPPEI SAITO D◯\textcircled{D} AND NAO HIROKAWA D◯\textcircled{D}

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 R\mathcal{R} by orientability ℓ>r\ell > r of all rules ℓ→r∈R\ell \to r \in \mathcal{R}.

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.

References (52)