WIPIVERSE

Path ordering (term rewriting)

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(s₁,...,sₙ) if f .> g and f(...) > sᵢ 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 sᵢ smaller than f(...) using a lower-precedence root symbol g. By structural induction, a term f(...) is bigger than any term containing only symbols smaller than f.

Usage in Term Rewriting

A path ordering is often used as a 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)

To prove termination, a reduction ordering (>) must be found with respect to which the term x*(y+z) is greater than the term (xy)+(xz). 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) > xy 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)), where b⁺ denotes the successor of b.

Decision Procedure

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

  • If f .< g, then s can dominate t only if one of s's subterms does.
  • If f .> g, then s dominates t if s dominates each of t's subterms.
  • If f = g, then the immediate subterms of s and t need to be compared recursively. Depending on the particular method, different variations of path orderings exist.

Variants

The main variations of path orderings include:

  • Multiset path ordering (mpo), originally called recursive path ordering (rpo)
  • Lexicographic path ordering (lpo)
  • A combination of mpo and lpo, called recursive path ordering by Dershowitz and Jouannaud (1990)

Dershowitz and 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 Definition of Multiset Path Ordering

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

s = f(s₁,...,sₘ) > t = g(t₁,...,tₙ) if:

  1. f .> g and s > tⱼ for each j ∈ {1,...,n}, or
  2. sᵢ ≥ t for some i ∈ {1,...,m}, or
  3. f = g and {s₁,...,sₘ} >> {t₁,...,tₙ}

where (>>) denotes the multiset extension of (>), defined by {s₁,...,sₘ} >> {t₁,...,tₙ} if {t₁,...,tₙ} can be obtained from {s₁,...,sₘ} by deleting at least one element, or by replacing an element by a multiset of strictly smaller (w.r.t. the mpo) elements.

Order Functionals

An order functional is a function O mapping an ordering to another one, satisfying:

  • If (>) is transitive, then so is O(>).
  • If (>) is irreflexive, then so is O(>).
  • If s > t, then f(...,s,...) O(>) f(...,t,...).
  • O is continuous on relations: if R₀, R₁, R₂, ... is an infinite sequence of relations, then O(∪ᵢ Rᵢ) = ∪ᵢ O(Rᵢ).

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

References

  • N. Dershowitz, "Termination" (1995), p. 207.
  • Nachum Dershowitz, Jean-Pierre Jouannaud (1990). "Rewrite Systems". Handbook of Theoretical Computer Science, Vol. B, Elsevier, pp. 243–320.
  • Gerard Huet (May 1986). "Formal Structures for Computation and Deduction".
  • N. Dershowitz (1982). "Orderings for Term-Rewriting Systems". Theoret. Comput. Sci. 17(3): 279–301.
  • S. Kamin, J.-J. Levy (1980). "Two Generalizations of the Recursive Path Ordering". Univ. of Illinois.
  • N. Dershowitz, M. Okada (1988). "Proof-Theoretic Techniques for Term Rewriting Theory". Proc. 3rd IEEE Symp. on Logic in Computer Science, pp. 104–111.
Browse

More topics to explore

    Browse all articles