Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Motivation  





2 Formal definitions  





3 Properties  





4 Notes  





5 References  














Rewrite order







Add links
 









Article
Talk
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Cite this page
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 
















Appearance
   

 






From Wikipedia, the free encyclopedia
 


Rewriting stot by a rule l::=r. If l and r are related by a rewrite relation, so are s and t. A simplification ordering always relates l and s, and similarly r and t.

Intheoretical 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

[edit]

Intuitively, a reduction order R relates two terms s and tift 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 { x+0 → x , 0+xx , x*0 → 0, 0*x → 0, x*1 → x , 1*xx }. 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

[edit]

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 pofu, and each substitution σ. If (→) is also irreflexive and transitive, then it is called a rewrite ordering,[1]orrewrite preorder. If the latter (→) is moreover well-founded, it is called a reduction ordering,[2] or a reduction preorder. Given a binary relation R, its rewrite closure is the smallest rewrite relation containing R.[3] A transitive and reflexive rewrite relation that contains the subterm ordering is called a simplification ordering.[4]

Overview of rewrite relations[note 1]
rewrite
relation
rewrite
order
reduction
order
simplification
order
closed under context
x R y implies u[x]p R u[y]p
Yes Yes Yes Yes
closed under instantiation
x R y implies xσ R yσ
Yes Yes Yes Yes
contains subterm relation
y subtermofx implies x R y
Yes
reflexive
always x R x
(No) (No) Yes
irreflexive
never x R x
Yes Yes (No)
transitive
x R y and y R z implies x R z
Yes Yes Yes
well-founded
no infinite chain x1 R x2 R x3 R ...[note 2]
Yes (Yes)

Properties

[edit]

Notes

[edit]
  1. ^ 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).
  • ^ except all xi are equal for all i beyond some n, for a reflexive relation
  • ^ Since x<y implies y<x, since the latter is an instance of the former, for variables x, y.
  • ^ i.e. if li > ri for all i, where (>) is a reduction ordering; the system need not have finitely many rules
  • ^ Since e.g. a>b implied g(a)>g(b), meaning the second rewrite rule was not decreasing.
  • ^ i.e. a ground-total reduction ordering
  • ^ Else, t|p > t for some term t and position p, implying an infinite descending chain t > t[t]p > t[t[t]p]p > ...[6][7]
  • ^ i.e. a simplification ordering
  • ^ The proof of this property is based on Higman's lemma, or, more generally, Kruskal's tree theorem.
  • References

    [edit]

    Nachum Dershowitz; Jean-Pierre Jouannaud (1990). "Rewrite Systems". In Jan van Leeuwen (ed.). Formal Models and Semantics. Handbook of Theoretical Computer Science. Vol. B. Elsevier. pp. 243–320. doi:10.1016/B978-0-444-88074-1.50011-1. ISBN 9780444880741.

    1. ^ a b Dershowitz, Jouannaud (1990), sect.2.1, p.251
  • ^ a b c Dershowitz, Jouannaud (1990), sect.5.1, p.270
  • ^ Dershowitz, Jouannaud (1990), sect.2.2, p.252
  • ^ a b Dershowitz, Jouannaud (1990), sect.5.2, p.274
  • ^ a b Dershowitz, Jouannaud (1990), sect.5.1, p.272
  • ^ a b Dershowitz, Jouannaud (1990), sect.5.1, p.271
  • ^ David A. Plaisted (1978). A Recursively Defined Ordering for Proving Termination of Term Rewriting Systems (Technical report). Univ. of Illinois, Dept. of Comp. Sc. p. 52. R-78-943.
  • ^ N. Dershowitz (1982). "Orderings for Term-Rewriting Systems" (PDF). Theoret. Comput. Sci. 17 (3): 279–301. doi:10.1016/0304-3975(82)90026-3. S2CID 6070052. Here: p.287; the notions are named slightly different.

  • Retrieved from "https://en.wikipedia.org/w/index.php?title=Rewrite_order&oldid=1227423352"

    Categories: 
    Rewriting systems
    Order theory
     



    This page was last edited on 5 June 2024, at 16:51 (UTC).

    Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



    Privacy policy

    About Wikipedia

    Disclaimers

    Contact Wikipedia

    Code of Conduct

    Developers

    Statistics

    Cookie statement

    Mobile view



    Wikimedia Foundation
    Powered by MediaWiki