Path ordering (term rewriting) explained

In theoretical computer science, in particular in term rewriting, a path ordering is a well-founded strict total order (>) on the set of all terms such that

f(...) > g(s1,...,sn)   if   f .> g   and   f(...) > si for i=1,...,n,where (.>) is a user-given total precedence order on the set of all function symbols.

Intuitively, a term f(...) is bigger than any term g(...) built from terms si smaller than f(...) using alower-precedence root symbol g.In particular, by structural induction, a term f(...) is bigger than any term containing only symbols smaller than f.

A path ordering is often used as reduction ordering in term rewriting, in particular in the Knuth–Bendix completion algorithm.As an example, a term rewriting system for "multiplying out" mathematical expressions could contain a rule x*(y+z) → (x*y) + (x*z). In order to prove termination, a reduction ordering (>) must be found with respect to which the term x*(y+z) is greater than the term (x*y)+(x*z). This is not trivial, since the former term contains both fewer function symbols and fewer variables than the latter. However, setting the precedence (*) .> (+), a path ordering can be used, since both x*(y+z) > x*y and x*(y+z) > x*z is easy to achieve.

There may also be systems for certain general recursive functions, for example a system for the Ackermann function may contain the rule A(a+, b+) → A(a, A(a+, b)),[1] where b+ denotes the successor of b.

Given two terms s and t, with a root symbol f and g, respectively, to decide their relation their root symbols are compared first.

The latter variations include:

Dershowitz, Okada (1988) list more variants, and relate them to Ackermann's system of ordinal notations. In particular, an upper bound given on the order types of recursive path orderings with n function symbols is φ(n,0), using Veblen's function for large countable ordinals.

Formal definitions

The multiset path ordering (>) can be defined as follows:[9]

s = f(s1,...,sm) > t = g(t1,...,tn) if
f .> g and s > tj for each j∈,     or
si t for some i∈,or
f=gand >>

where

More generally, an order functional is a function O mapping an ordering to another one, and satisfying the following properties:[11]

The multiset extension, mapping (>) above to (>>) above is one example of an order functional: (>>)=O(>).Another order functional is the lexicographic extension, leading to the lexicographic path ordering.

Notes and References

  1. N. Dershowitz, "Termination" (1995). p. 207
  2. Book: Nachum Dershowitz, Jean-Pierre Jouannaud. Rewrite Systems. 1990. B. 243–320. Elsevier. Jan van Leeuwen. Handbook of Theoretical Computer Science. Here: sect.5.3, p.275
  3. Book: Gerard Huet. Formal Structures for Computation and Deduction. May 1986. International Summer School on Logic of Programming and Calculi of Discrete Design. dead. https://web.archive.org/web/20140714171331/http://yquem.inria.fr/~huet/PUBLIC/Formal_Structures.ps.gz. 2014-07-14. Here: chapter 4, p.55-64
  4. N. Dershowitz. Orderings for Term-Rewriting Systems. Theoret. Comput. Sci.. 1982. 17. 3. 279–301. 10.1016/0304-3975(82)90026-3. 6070052.
  5. S. Kamin, J.-J. Levy. Two Generalizations of the Recursive Path Ordering. 1980. Univ. of Illinois, Urbana/IL.
  6. Kamin, Levy (1980)
  7. Book: N. Dershowitz, M. Okada. Proof-Theoretic Techniques for Term Rewriting Theory. Proc. 3rd IEEE Symp. on Logic in Computer Science. 1988. 104–111.
  8. Book: Mitsuhiro Okada, Adam Steele. Ordering Structures and the Knuth–Bendix Completion Algorithm. Proc. of the Allerton Conf. on Communication, Control, and Computing. 1988.
  9. Huet (1986), sect.4.3, def.1, p.57
  10. Huet (1986), sect.4.1.3, p.56
  11. Huet (1986), sect.4.3, p. 58