Rewrite order explained

In theoretical computer science, in particular in automated reasoning about formal equations, reduction orderings are used to prevent endless loops. Rewrite orders, and, in turn, rewrite relations, are generalizations of this concept that have turned out to be useful in theoretical investigations.

Motivation

Intuitively, a reduction order R relates two terms s and t if t is properly "simpler" than s in some sense.

For example, simplification of terms may be a part of a computer algebra program, and may be using the rule set . In order to prove impossibility of endless loops when simplifying a term using these rules, the reduction order defined by "sRt if term t is properly shorter than term s" can be used; applying any rule from the set will always properly shorten the term.

In contrast, to establish termination of "distributing-out" using the rule x*(y+z) → x*y+x*z, a more elaborate reduction order will be needed, since this rule may blow up the term size due to duplication of x. The theory of rewrite orders aims at helping to provide an appropriate order in such cases.

Formal definitions

Formally,a binary relation (→) on the set of terms is called a rewrite relation if it is closed under contextual embedding and under instantiation; formally: if lr implies u[]lσ]pu[''r''σ]p for all terms l, r, u, each path p of u, and each substitution σ. If (→) is also irreflexive and transitive, then it is called a rewrite ordering, or rewrite preorder. If the latter (→) is moreover well-founded, it is called a reduction ordering,[1] or a reduction preorder.Given a binary relation R, its rewrite closure is the smallest rewrite relation containing R.[2] A transitive and reflexive rewrite relation that contains the subterm ordering is called a simplification ordering.[3]

[4]
rewrite
relation
rewrite
order
reduction
order
simplification
order
closed under context
x R y implies u[]x]p R u[''y'']p
closed under instantiation
x R y implies xσ R yσ
contains subterm relation
y subterm of x implies x R y
reflexive
always x R x
align=center (No)align=center (No)
irreflexive
never x R x
align=center (No)
transitive
x R y and y R z implies x R z
well-founded
no infinite chain x1 R x2 R x3 R ...[5]
align=center (Yes)

Properties

References

Book: Nachum Dershowitz . Jean-Pierre Jouannaud. Jean-Pierre Jouannaud. Rewrite Systems. Formal Models and Semantics. 1990. B. 243–320. Elsevier. Jan van Leeuwen. Jan van Leeuwen. Handbook of Theoretical Computer Science . 10.1016/B978-0-444-88074-1.50011-1 . Nachum Dershowitz. 9780444880741.

Notes and References

  1. Dershowitz, Jouannaud (1990), sect.5.1, p.270
  2. Dershowitz, Jouannaud (1990), sect.2.2, p.252
  3. Dershowitz, Jouannaud (1990), sect.5.2, p.274
  4. Parenthesized entries indicate inferred properties which are not part of the definition. For example, an irreflexive relation cannot be reflexive (on a nonempty domain set).
  5. except all xi are equal for all i beyond some n, for a reflexive relation
  6. Dershowitz, Jouannaud (1990), sect.2.1, p.251
  7. Since x<y implies y<x, since the latter is an instance of the former, for variables x, y.
  8. Dershowitz, Jouannaud (1990), sect.5.1, p.272
  9. i.e. if for all i, where (>) is a reduction ordering; the system need not have finitely many rules
  10. Since e.g. implied, meaning the second rewrite rule was not decreasing.
  11. Dershowitz, Jouannaud (1990), sect.5.1, p.271
  12. i.e. a ground-total reduction ordering
  13. i.e. a simplification ordering
  14. The proof of this property is based on Higman's lemma, or, more generally, Kruskal's tree theorem.
  15. N. Dershowitz . Orderings for Term-Rewriting Systems . Theoret. Comput. Sci. . 17 . 3 . 279–301 . 1982 . 10.1016/0304-3975(82)90026-3 . 6070052 . Here: p.287; the notions are named slightly different.