Simple Termination Revisited

Aart Middeldorp

Institute of Information Sciences and Electronics

University of Tsukuba, Tsukuba 305, Japan

e-mail: [email protected] c.jp

Hans Zantema

Department of Computer Science, Utrecht University

P.O. Box 80.089, 3508 TB Utrecht, The Netherlands

e-mail: [email protected]

ABSTRACT

In this pap er we investigate the concept of simple termination. A term

system is called simply terminating if its termination can b e proved by means of a

simpli cation order. The basic ingredient of a simpli cation order is the subterm

prop erty, but in the literature two di erent de nitions are given: one based on strict

partial orders and another one based on or quasi-orders. In the rst part

of the pap er we argue that there is no reason to cho ose the second one, while the

rst one has certain advantages.

Simpli cation orders are known to b e well-founded orders on terms over a nite

signature. This imp ortant result no longer holds if we consider in nite signatures.

Nevertheless, well-known simpli cation orders like the recursive path order are also

well-founded on terms over in nite signatures, provided the underlying precedence

is well-founded. We prop ose a new de nition of simpli cation order, which coincides

with the old one based on partial orders in case of nite signatures, but which is

also well-founded over in nite signatures and covers orders like the recursive path

order. 1

1. Intro duction

One of the main problems in the theory of term rewriting is the detection of termination: for

a xed system of rewrite rules, determine whether there exist in nite reduction sequences or

not. Huet and Lankford [9] showed that this problem is undecidable in general. However,

there are several metho ds for deciding termination that are successful for many sp ecial cases.

Awell-known metho d for proving termination is the recursive path order Dershowitz [2]. The

basic idea of such a path order is that, starting from a given order the so-called precedence 

on the op eration symb ols, in a recursivewayawell-founded order on terms is de ned. If every

reduction step in a term rewriting system corresp onds to a decrease according this order, one can

conclude that the system is terminating. If the order is closed under contexts and substitutions

then the decrease only has to b e checked for the rewrite rules instead of all reduction steps. The

b ottleneck of this kind of metho d is howtoprove that a relation de ned recursively on terms is

indeed a well-founded order. Proving irre exivity and transitivity often turns out to b e feasible,

using some induction and case analysis. However, when stating an arbitrary recursive de nition

of such an order, well-foundedness is very hard to prove directly. Fortunately, the powerful

Tree Theorem of Kruskal implies that if the order satis es some simpli cation prop erty, well-

foundedness is obtained for free. An order satisfying this prop erty is called a simpli cation

order. This notion of simpli cation comprises two ingredients:

 a term decreases by removing parts of it, and

 a term decreases by replacing an op eration symb ol with a smaller according to the prece-

dence one.

If the signature is in nite, b oth of these ingredients are essential for the applicability of Kruskal's

Tree Theorem. It is amazing, however, that in the term rewriting literature the notion of

simpli cation order is motivated by the applicability of Kruskal's Tree Theorem but only covers

the rst ingredient. For in nite signatures one easily de nes non-well-founded orders that are

simpli cation orders according to that de nition. Therefore, the usual de nition of simpli cation

order is only helpful for proving termination of systems over nite signatures. Nevertheless, it

is well-known that simpli cation orders like the recursive path order are also well-founded on

terms over in nite signatures provided the precedence on the signature is well-founded.

In this pap er we prop ose a de nition of a simpli cation order that matches exactly the

requirements of Kruskal's Tree Theorem, since that is the basic motivation for the notion of

simpli cation order. According to this new de nition all simpli cation orders are well-founded,

b oth over nite and in nite signatures. For nite signatures the new and the old notion of

simpli cation order coincide. A term rewriting system is called simply terminating if there is

a simpli cation order that orients the rewrite rules from left to right. It is immediate from

the de nition that every recursive path order over a well-founded precedence can be extended

to a simpli cation order, and hence it is well-founded. Even if one is only interested in nite

term rewriting systems this is of interest: semantic label ling [18] often succeeds in proving

termination of a nite but \dicult" non-simply terminating system by transforming it into

an in nite system over an in nite signature to which the recursive path order readily applies.

In the literature simpli cation orders are sometimes based on preorders or quasi-orders

instead of strict partial orders. A main result of this pap er is that there are no comp elling

reasons for doing so. We prove constructively that every term rewriting system which can b e

shown to be terminating by means of a simpli cation order based on preorders, can be shown

to b e terminating by means of a simpli cation order based on partial orders. Since basing the 2

notion of simpli cation order on preorders is more susceptive to mistakes and results in stronger

pro of obligations, simpli cation orders should be based on partial orders. As explained in

Section 3 these remarks already apply to nite signatures. As a consequence, we prefer the

partial order variant of wel l-quasi-orders, the so-called partial wel l-orders, in case of in nite

signatures. By cho osing partial well-orders instead of well-quasi-orders a great part of the

theory is not a ected, but another part b ecomes cleaner. For instance, in Section 5 we provea

useful result stating that a term rewriting system is simply terminating if and only if the union

of the system and a particular system that captures simpli cation is terminating. Based on

well-quasi-orders a similar result do es not hold.

A useful notion of termination for term rewriting systems is total termination see [6, 17].

For nite signature one easily shows that total termination implies simple termination. In

Section 6 we show that for in nite signatures this do es not hold any more: we construct an

in nite term rewriting system whose termination can b e proved by a p olynomial interpretation,

but which is not simply terminating.

2. Termination

In order to x our notations and terminology, we start with a very brief intro duction to term

rewriting. Term rewriting is surveyed in Dershowitz and Jouannaud [4] and Klop [11].

A signature is a set F of function symbols. Asso ciated with every f 2F is a natural number

denoting its arity. Function symb ols of arity 0 are called constants. Let T F ; V  be the set of

all terms built from F and a countably in nite set V of variables, disjoint from F . The set of

variables o ccurring in a term t is denoted by V ar t. A term t is called ground if V ar t=?.

The set of all ground terms is denoted by T F .

Weintro duce a fresh constant symbol , named hole. A context C is a term in T F[fg; V 

containing precisely one hole. The designation term is restricted to memb ers of T F ; V . If C is

a context and t a term then C [t] denotes the result of replacing the hole in C by t. A term s is

a subterm of a term t if there exists a context C such that t = C [s]. A subterm s of t is proper

if s 6= t. We assume familiarity with the position formalism for describing subterm o ccurrences.

A substitution is a map  from V to T F ; V  with the prop erty that the set fx 2V j  x 6= xg

is nite. If  is a substitution and t a term then t denotes the result of applying  to t. We

call t an instance of t. A R on terms is closed under contexts if C [s] R C [t]

whenever sR t, for all contexts C . A binary relation R on terms is closed under substitutions if

s R t whenever sR t, for all substitutions  . A rewrite relation is a binary relation on terms

that is closed under contexts and substitutions.

A rewrite rule is a pair l; r  of terms such that the left-hand side l is not a variable and

variables which o ccur in the right-hand side r o ccur also in l , i.e., V ar r  Var l . Since we

are interested in simple termination in this pap er, these two restrictions rule out only trivial

cases. Rewrite rules l; r  will henceforth b e written as l ! r .

A term rewriting system TRS for short is a pair F ; R consisting of a signature F and a

set R of rewrite rules between terms in T F ; V . We often present a TRS as a set of rewrite

rules, without making explicit its signature, assuming that the signature consists of the function

symb ols o ccurring in the rewrite rules. The smallest rewrite relation on T F ; V  that contains

R is denoted by ! . So s ! t if there exists a rewrite rule l ! r in R, a substitution  , and a

R R

context C such that s = C [l ] and t = C [r]. The subterm l of s is called a redex and wesay 3

that s rewrites to t by contracting redex l . We call s ! t a rewrite or reduction step. The

R

+



transitive of ! is denoted by ! and ! denotes the transitive and re exive closure

R

R

R

  

of ! . If s ! t wesay that s reduces to t. The converse of ! is denoted by  .

R

R R R

A TRS F ; R is called terminating if there are no in nite reduction sequences t ! t !

1 R 2 R

t !  of terms in T F ; V . In order to simplify matters, we assume throughout this pap er

3 R

that the signature F contains a constant symb ol. Hence a TRS is terminating if and only if

there do not exist in nite reduction sequence involving only ground terms.

A strict partial order is a transitive and irre exive relation. The re exive closure of is

denoted by <. The converse of < is denoted by 4. A partial order on a set A is wel l-founded

if there are no in nite descending sequences a a  of elements of A. A partial order

1 2

on A is total if for all di erent elements a; b 2 A either a b or b a. A or

quasi-order   is a transitive and re exive relation. The converse of  is denoted by -. The

strict part of a preorder  is the partial order de ned as n-. Every preorder  induces an

equivalence relation  de ned as  \ -. It is easy to see that = n. A preorder is said to

be well-founded if its strict part is a well-founded partial order.

A rewrite relation that is also a partial order is called a rewrite order. Awell-founded rewrite

order is called a reduction order. Wesay that a TRS F ; R and a partial order on T F ; V 

are compatible if R is contained in , i.e., l r for every rewrite rule l ! r of R. It is easy to

show that a TRS is terminating if and only if it is compatible with a reduction order.

Definition 2.1. Wesay that a binary relation R on terms has the subterm property if C [t] Rt

for all contexts C 6=  and terms t.

The task of showing that a given R has the subterm prop erty amounts

to verifying f t ;::: ;t  R t for all function symb ols f of arity n > 1, terms t ;::: ;t , and

1 n i 1 n

i 2f1;:::;ng. This observation will b e used freely in the sequel.

Definition 2.2. Let F b e a signature. The TRS E mb F  consists of all rewrite rules

f x ;::: ;x  ! x

1 n i

with f 2F a function symbol of arity n > 1 and i 2f1;:::;ng. Here x ;::: ;x are pairwise

1 n

+



di erent variables. We abbreviate ! to B and  to E . The latter relation

emb emb

E mb F 

E mb F 

is called embedding.

The following easy result relates the subterm prop ertytoemb edding.

Lemma 2.3. A rewrite order on T F ; V  has the subterm prop ertyif and only if it is com-

patible with the TRS E mb F . 

Proof.

 The subterm prop erty yields f x ;::: ;x  x and hence l r for every rewrite rule

1 n i

l ! r 2Emb F .

 Wehavetoshow f t ;::: ;t  t for all function symb ols f of arity n > 1, terms t ;::: ;t ,

1 n i 1 n

and i 2 f1;::: ;ng. By assumption f x ;::: ;x  x . Closure under substitutions yields

1 n i

f t ;::: ;t  t .

1 n i

 4

3. Simple Termination | Finite Signatures

Throughout this section we are dealing with nite signatures only.

Definition 3.1. A simpli cation order is a rewrite order with the subterm prop erty. A TRS

F ; Rissimply terminating if it is compatible with a simpli cation order on T F ; V .

Since we are only interested in signatures consisting of function symb ols with xed arity,we

have no need for the deletion property cf. [2]. It should also b e noted that many authors e.g.

[1, 2,3,7,10,16] do not require that simpli cation orders are closed under substitutions. Since

we don't really wanttocheck whether a simpli cation order orients al l instances of rewrite rules

from left to right in order to conclude termination, and concrete simpli cation orders like the

recursive path order are closed under substitutions, closure under substitutions should b e part

of the de nition. Moreover, it is easy to show that the class of simply terminating TRSs is not

a ected by imp osing closure under substitutions. Dershowitz [1, 2] showed that every simply

terminating TRS is terminating. The pro of is based on the b eautiful Tree Theorem of Kruskal

[12].

Definition 3.2. An in nite sequence t , t , t , ::: of terms in T F ; V isself-embedding if there

1 2 3

exist 1 6 i

i emb j

Theorem 3.3 Kruskal's Tree Theorem|Finite Version. Every in nite sequence of

ground terms is self-emb edding. 

We refrain from proving Theorem 3.3 since it is a sp ecial case of the general version of

Kruskal's Tree Theorem, which is presented and proved in Section 4.

Theorem 3.4. Every simply terminating TRS is terminating.

Proof. Supp ose there exists a simply terminating TRS F ; R that is not terminating. So

F ; R is compatible with a simpli cation order on T F ; V  and there exists an in nite

reduction sequence t ! t ! t !  involving only ground terms. From Kruskal's Tree

1 R 2 R 3 R

Theorem we learn the existence of 1 6 i

i emb j

+

obtain t < t . However, since F ; R is compatible with , t ! t implies t t . Hence

j i i j i j

R

we have a contradiction with the fact that is a partial order. We conclude that F ; R is

terminating. 

The following well-known result is esp ecially useful for showing that a given TRS is not

simply terminating, see [17].

Lemma 3.5. A TRS F ; R is simply terminating if and only if F ; R[Emb F  is terminating.

Proof.

 Let F ; R b e compatible with the simpli cation order on T F ; V . From Lemma 2.3 we

learn that is compatible with the TRS E mb F . Hence the TRS F ; R[Emb F  is

simply terminating. Theorem 3.4 yields the termination of F ; R[Emb F .

 Let be the rewrite order asso ciated with F ; R[Emb F  i.e., the transitive closure

of its rewrite relation. Clearly is compatible with E mb F . Lemma 2.3 shows that

it is a simpli cation order. Since also the TRS F ; R is compatible with , it is simply

terminating.

 5

In the term rewriting literature the notion of simpli cation order is sometimes based on

preorders instead of partial orders. Dershowitz [2] obtained the following result.

Theorem 3.6. Let F ; R be a TRS. Let  be a preorder on T F ; V  which is closed under

contexts and has the subterm prop erty. If l r for every rewrite rule l ! r 2 R and

substitution  then F ; R is terminating. 

A preorder that is closed under contexts and has the subterm prop erty is sometimes called

a quasi-simpli cation order. Observe that we require l r for al l substitutions  in Theo-

rem 3.6. It should b e stressed that this requirement cannot be weakened to the compatibility

of F ; R and i.e., l r for all rules l ! r 2R if we additionally require that  is closed

under substitutions, as is incorrectly done in Dershowitz and Jouannaud [4]. For instance, the



relation ! asso ciated with the TRS

R

8

>

f g x ! f f x

>

>

<

f g x ! g g x

R =

>

f x ! x

>

>

:

g x ! x

is a rewrite relation with the subterm prop erty b ecause R contains E mb ff; gg. Moreover,

 

l ! r but not r ! l , for every rewrite rule l ! r 2R. So R is included in the strict part of

R R



! . Nevertheless, R is not terminating:

R

f g g x ! f f g x ! f g g x !  :

R R R



The p oint is that the strict part of ! is not closed under substitutions. Hence to conclude

R

termination from compatibility with  it is essential that is closed under substitutions. A

simpler TRS illustrating the same p oint, due to Enno Ohlebusch p ersonal communication, is

ff x ! f a; f x ! xg.

Dershowitz [2] writes that Theorem 3.6 generalizes Theorem 3.4. We have the following

result.

Theorem 3.7. A TRS F ; R is simply terminating if and only if there exists a preorder  on

T F ; V  that is closed under contexts, has the subterm prop erty, and satis es l r for every

rewrite rule l ! r 2R and substitution  . 

The pro of is given in Section 5, where the ab ove theorem is generalized to TRSs over arbi-

trary, not necessarily nite, signatures.

So every TRS whose termination can be shown by means of Theorem 3.6 is simply termi-

nating, i.e., its termination can be shown by a simpli cation order. Since it is easier to check

l r for nitely many rewrite rules l ! r than l  r but not r  l for nitely many

rewrite rules l ! r and in nitely many substitutions  , there is no reason to base the de nition

of simpli cation order on preorders.

4. Partial Well-Orders

Theorem 3.4 do es not hold if we allow in nite signatures. Consider for instance the TRS F ; R

consisting of in nitely many constants a and rewrite rules a ! a for all i > 1. The rewrite

i i i+1

+

vacuously satis es the subterm prop erty, but F ; R is not terminating: order !

R

a ! a ! a ! 

1 R 2 R 3 R 6

So in case F is in nite, compatibility with E mb F  do es not ensure termination. In the next

section we will see that the results of the previous section can b e recovered by suitably extending

the TRS E mb F .

Definition 4.1. Let be a partial order on a signature F . The TRS E mb F ;  consists of

all rewrite rules of E mb F  together with all rewrite rules

f x ;::: ;x  ! g x ;::: ;x 

1 n i i

1 m

with f an n-ary function symbol in F , g an m-ary function symbol in F , n > m > 0, f g , and

1 6 i <  1. Here x ;::: ;x are pairwise di erentvariables. We ab-

1 m 1 n

+



breviate ! to and  to 4 . The latter relation is called homeomorphic

emb emb

E mb F ; 

E mb F ; 

embedding.

Since E mb F ; ? = E mb F , homeomorphic emb edding generalizes emb edding. Consider

for instance the signature F consisting of constants a and b, a unary function symbol g , and

binary functions symb ols f and h. De ne the partial order on F by a b f g h. In

the TRS

9 8

> >

a ! b

> >

> >

> >

> >

= <

f x; y  ! g x

E mb F ; =E mb F  [

> >

f x; y  ! g y 

> >

> >

> >

> >

; :

f x; y  ! hx; y 

we have the reduction sequence f ha; b;ga ! f a; g a ! f a; a ! f a; b, hence the

term f a; b is homeomorphically emb edded in f ha; b;ga. Since there is no reduction

sequence in the TRS E mb F  from f ha; b;ga to f a; b, the term f a; b is not emb edded

in f ha; b;ga.

In the next section we show that all results of the previous section carry over to in nite

signatures if we require compatibility with E mb F ; , provided the partial order satis es a

stronger prop erty than well-foundedness. This prop erty is explained b elow.

Definition 4.2. Let b e a partial order on a set A.

 An in nite sequence a  over A is called good if there exist indices 1 6 i

i i>1 i j

otherwise it is called bad.

 An in nite sequence a  over A is called a chain if a 4 a for all i > 1. We say that

i i>1 i i+1

a  contains a chain if it has a subsequence that is a chain.

i i>1

 An in nite sequence a  over A is called an antichain if neither a 4 a nor a 4 a , for

i i>1 i j j i

all 1 6 i

Lemma 4.3. Let b e a partial order on a set A. The following statements are equivalent.

1 Every partial order that extends including itself  is well-founded.

2 Every in nite sequence over A is go o d.

3 Every in nite sequence over A contains a chain.

4 The partial order is well-founded and do es not admit antichains. 7

Proof.

0 +

1  2 Supp ose a  is a bad sequence. De ne = [fa ;a  j i > 1g . Assume

i i>1 i i+1

0

a a for some a 2 A. Since is irre exive there is a non-empty sequence of

numb ers i ;::: ;i such that

1 n

a < a ; a < a ; a < a ; ::: ; a < a ; a < a:

i i +1 i i +1 i i +1 i i +1

1 1 2 2 3 n1 n n

Since a  is bad a < a is only p ossible for i 6 j . Hence we obtain the imp ossible

i i>1 i j

i

1 1 2 2 3 n1 n n 1

0

We conclude that is irre exive. By de nition it is transitive, hence it is a partial

0 0 0

order extending . However, since a a a  , it is not well-founded.

1 2 3

2  3 Let a  be any in nite sequence over A. Consider the subsequence consisting of

i i>1

all elements a with the prop erty that a 4 a holds for no j>i. If this subsequence

i i j

is in nite then it is a bad sequence, contradicting 2. Hence it is nite, and thus

there exists an index N > 1 such that for every i > N there exists a j > i with

a 4 a . De ne inductively

i j



N if i =1,

i=

min fj j j>i 1 and a 4 a g if i>1.

i1 j

Now a , a , a , ::: is a chain.

1 2 3

3  4 If is not well-founded then there exists an in nite sequence a a . Clearly

1 2

a 4 a do esn't hold for any16 i

i j

If admits an antichain then this antichain is an in nite sequence not containing a

chain.

4  1 For a pro of by contradiction, let be a well-founded partial order not satisfying

0

1. Then there is an extension of that is not well-founded. So there exists

0 0

an in nite sequence a a  . Since is well-founded, the sequence a 

1 2 i i>1

contains an element a with the prop erty that for no j >i a a holds. Actually,

i i j

a  contains in nitely many such elements. We claim that the in nite subse-

i i>1

quence a  consisting of those elements is an antichain with resp ect to .

i i>1

Let 1 6 i

i j  i j 

0 0

a 4 a , contradicting a a . Hence admits a anti-chain.

i j  i j 



Definition 4.4. A partial order on a set A is called a partial wel l-order PWO for short if

it satis es one of the four equivalent assertions of Lemma 4.3.

Using the terminology of PWOs, Theorem 3.3 can now be read as follows: if F is a nite

signature then B is a PWOon T F .

emb

By de nition every PWOisawell-founded order, but the reverse do es not hold. For instance,

the empty relation on an in nite set is a well-founded order but not a PWO. Clearly every total

well-founded order or well-order is a PWO. Any partial order extending a PWO is a PWO.

The following lemma states how new PWOs can b e obtained by restricting existing PWOs.

Lemma 4.5. Let be a PWO on a set A and let A be a PWO on a set B. Let ': A ! B be

0 0

any function. The partial order on A de ned by a b if and only if a b and 'a w 'b

is a PWO. 8

Proof. Let a  be any in nite sequence over A. Since is a PWO this sequence admits a

i i>1

chain

a 4 a 4 a 4  :

1 2 3

Since A is a PWOonB there exist 1 6 i

i j 

0

a 4 a . Hence a 4 a , while i <j . We conclude that a  is a go o d sequence

i j  i j  i i>1

0 0

with resp ect to ,so isaPWO. 

Corollary 4.6. The intersection of twoPWOs on a set A isaPWOonA.

Proof. Cho ose the function ' in Lemma 4.5 to b e the identityonA. 

Theorem 4.7 Kruskal's Tree Theorem|General Version. If is a PWOon a sig-

nature F then is a PWOonT F . 

emb

For the sake of completeness, b elowwe present a pro of of this b eautiful theorem, even though

it is very similar to the pro of of the Kruskal's Tree Theorem formulated in terms of wel l-quasi-

orders see e.g. Gallier [7]. First we show a related result for strings, known as Higman's Lemma

Higman [8].

 

Definition 4.8. Let b e a partial order on a set A. We de ne a relation on A as follows:

 

if w = a a  a and w = b b  b are elements of A then w w if and only if w 6= w

1 1 2 n 2 1 2 m 1 2 1 2

and either

 m =0,or

 n > m>0 and there exist indices i ;::: ;i such that 1 6 i < 

1 m 1 m i j

j

all j 2f1;::: ;mg.



The next result can b e viewed as an alternative de nition of .



Lemma 4.9. Let be a partial order on a set A. The relation is the least partial order A



on A satisfying the following two prop erties:



1 w aw A w w for all w ;w 2 A and a 2 A,

1 2 1 2 1 2



2 w aw A w bw for all w ;w 2 A and a; b 2 A with a b.

1 2 1 2 1 2



Proof. First we show that is a partial order. Irre exivity is obvious. Let w = a  a ,

1 1 n

  

w = b  b , and w = c  c be elements of A such that w w w . If l = 0 then

2 1 m 3 1 l 1 2 3



m > 0 b ecause w 6= w  and n > m > 0. Hence w w . Supp ose l > 0. We have

2 3 1 3

n > m > l . There exist indices i ;::: ;i and j ;::: ;j such that 1 6 i < 

1 l 1 m 1 l i k

k

for all k 2 f1;:::;lg, 1 6 j <  < j 6 n, and a < b for all k 2 f1;::: ;mg. Since

1 m j k

k



1 6 j <  < j 6 n and a < b < c for all k 2 f1;:::;lg, we have w w . This

i i j i k 1 3

1 i

l k

k

 

concludes the pro of of the transitivity of . It is very easy to see that satis es prop erties



1 and 2. Conversely, let A be any partial order on A that satis es prop erties 1 and 2.

 

We will show that A. Supp ose w = a  a b  b = w . If m = 0 then n> 0 and

1 1 n 1 m 2

hence the sequence w = a  a A a  a A  A a A " = w is non-empty, showing that

1 1 n 2 n n 2

w A w . If n > m>0 then there exist indices i ;::: ;i such that 1 6 i < 

1 2 1 m 1 m

. Wehave w w w by successively removing  a < b for all j 2f1;:::;mg. Let w = a a

1 3 i j 3 i i

m 1 j

elements a from w whose index i do es not b elong to the set fi ;::: ;i g. Clearly w = w if

i 1 1 m 1 3

b . Therefore with b whenever a and only if n = m. We have w w w by replacing a

j j i 3 2 i

j j

w w w and since w 6= w we obtain w A w . 

1 2 1 2 1 2 9

 

Lemma 4.10 Higman's Lemma. If is a PWO on a set A then isaPWOonA .

Proof. The following pro of is essentially due to Nash-Williams [14]. We have to show that



there are no bad sequences over A . Supp ose to the contrary that there exist bad sequences



over A . We construct a minimal bad sequence w  as follows:

i i>1

Supp ose we already chose the rst n 1 strings w ;::: ;w . De ne w to be a

1 n1 n

shortest string such that there are bad sequences that start with w ;::: ;w .

1 n

 

Because " 4 w for all w 2 A , we have w 6= " for all i > 1. Hence we may write w = a v

i i i i

i > 1. Since is a PWO on A, the in nite sequence a  contains a chain, say a  .

i i>1 i i>1

Because v is shorter than w , the sequence

1 1

w ; ::: ; w ; v ; v ; :::

1 11 1 2



must be good. Clearly w 4 w 1 6 i

i j i i>1

 

w 4 v 1 6 i 6 1 1 and 1 6 j  contradicts the badness of w  since v 4 w

i j  i i>1 j  j 

 

w . Hence wemust have v 4 v for some 1 6 i

j  i j  i



with a 4 a easily yields w = a v 4 a v = w , contradicting the badness

i j  i i i j  j  j 



of w  . We conclude that there are no bad sequences over A . 

i i>1

Proof of Kruskal's Tree Theorem|General Version. The pro of, essentially due to

Nash-Williams [14], has the same structure as the pro of of Higman's Lemma. Wehave to show

that there are no bad sequences of terms in T F . Supp ose to the contrary that there exist bad

sequences of ground terms. We construct a minimal bad sequence t  as follows:

i i>1

Supp ose we already chose the rst n 1 terms t ;::: ;t . De ne t to b e a smallest

1 n1 n

with resp ect to size term such that there are bad sequences that start with t ;::: ;t .

1 n

For every i > 1, let f b e the ro ot symbol of t and let A b e the set of arguments of t if t is

i i i i i

a constant then A = ?. Moreover, let w b e the string of arguments from left to right of t .

i i i

S

Finally, let A = A .

i

i>1

We claim that is a PWO on the subset A of T F . For a pro of by contradiction,

emb

S

k 1

0

supp ose a  is a bad sequence over A. Let a 2 A . Since A = A is a nite set and all

i i>1 1 k i

i=1

0

elements of a  are di erent, only nitely many elements of a  b elong to A . Thus there

i i>1 i i>1

0

exists an index l>1 such that a 2 AnA for all i > l . Because a is a prop er subterm of t , the

i 1 k

sequence

t ; ::: ; t ; a ; a ; a ; :::

1 k 1 1 l l+1

must be good. Clearly t 4 t 1 6 i

i emb j i i>1

t 4 a 1 6 i 6 k 1 and j =1 or l 6 j  contradicts the badness of t  since a 4 t

i emb j i i>1 j emb m

0

for some m > k |recall that a is a prop er subterm of t and if j > l then a 2 AnA |and

1 k j

thus t 4 t . Hence we must have a 4 a for some 1 6 i

i emb j i emb j

contradicting the badness of a  . Hence is aPWO on A. From Higman's Lemma we

i i>1 emb

 

infer that isaPWOonA .

emb

Since isaPWOonF , the in nite sequence f  contains a chain, sayf  . Consider

i i>1 i i>1

   

the in nite sequence w  over A . Since is a PWOonA ,wehave w 4 w for

i i>1 i j 

emb emb



some 1 6 i

i j  i j 

emb

imply t 4 t . Hence we obtained a contradiction with the badness of t  . We

i emb j  i i>1

conclude that there are no bad sequences over T F . 

PWOs are closely related to the more familiar concept of well-quasi-order. 10

Definition 4.11. A wel l-quasi-order WQO for short is a preorder that contains a PWO.

The ab ove de nition is equivalent to all other de nitions of WQO found in the literature.

Kruskal's Tree Theorem is usually presented in terms of WQOs. This is not more p owerful than

the PWOversion: notwithstanding the fact that the strict part of a WQO is not necessarily a

PWO, it is very easy to show that the WQO version of Kruskal's Tree Theorem is a corollary

of Theorem 4.7, and vice-versa.

Let beaPWO on a signature F . A natural question is whether we can restrict while

emb

retaining the prop erty of b eing a PWO on T F . In particular, do we really need all rewrite

rules in E mb F ; ? In case there is a uniform b ound on the arities of the function symb ols in F ,

we can greatly reduce the set E mb F ; . That is, supp ose there exists an N > 0 such that all

function symb ols in F have arity less than or equal to N . Nowwe can apply Lemma 4.5: cho ose

' to b e the function that assigns to every function symb ol its arity and take A to b e the empty

0 0

relation on f1;:::;Ng. Hence the partial order on F de ned by f g if and only if f and g

0

have the same arity and f g isaPWO. The corresp onding set E mb F ;  consists, b esides

all rewrite rules of the form f x ;::: ;x  ! x , of all rewrite rules f x ;::: ;x  ! g x ;::: ;x 

1 n i 1 n 1 n

with f and g n-ary function symb ols such that f g . This construction do es not work if the

arities of function symb ols in F are not uniformly b ounded. Consider for instance a signature

F consisting of a constant a and n-ary function symb ols f for every n > 1 and let be any

n

PWOonF . The sequence

f a; f a; a; f a; a; a; :::

1 2 3

0

is bad with resp ect to . Finally, one may wonder whether the restriction to all rewrite

emb

rules f x ;::: ;x  ! g x ;::: ;x  with f an n-ary function symb ol, g an m-ary function

1 n i+1 i+m

symb ol, n > m > 0, n m > i > 0, and f g is sucient. This is also not the case, as can b e

seen by extending the previous signature with a constant b and considering the sequence

f b; b; f b; a; b; f b; a; a; b; ::: :

2 3 4

Of course, if the signature F is nite then the rules of E mb F  are sucient since the empty

relation is a PWOonany nite set.

5. Simple Termination | In nite Signatures

Kurihara and Ohuchi [13] were the rst to use the terminology simple termination. They call

a TRS F ; R simply terminating if it is compatible with a simpli cation order on T F ; V .

Since compatibility with a simpli cation order do esn't ensure the termination of TRSs over

in nite signatures, see the example at the b eginning of the previous section, this de nition of

simple termination is clearly not the right one. Ohlebusch [15] and others call a TRS F ; R

simply terminating if it is compatible with a wel l-founded simpli cation order on T F ; V . This

is a very arti cial way to ensure that every simply terminating is terminating, more precisely,

termination of simply terminating TRSs has nothing to do with Kruskal's Tree Theorem; simply

terminating TRSs are terminating by de nition. We prop ose instead to bring the de nition of

simple termination in accordance with the general version of  Kruskal's Tree Theorem.

Definition 5.1. A simpli cation order is a rewrite order on T F ; V  that contains for

emb

some PWO on F . A TRS F ; Rissimply terminating if it is compatible with a simpli cation

order on T F ; V . 11

This de nition coincides with the one in Section 3 in case of nite signatures:

Lemma 5.2. A rewrite order A on T F ; V  with F nite is a simpli cation order if and only if

it has the subterm prop erty, i.e., B A.

Proof.

 By de nition there exists aPWO on F such that A. Since B , A has the

emb emb

subterm prop erty.

 The empty relation ? isaPWOonany nite set. The subterm prop erty yields ? = B A.

emb

Hence A is a simpli cation order.



Theorem 5.3. Every simply terminating TRS is terminating.

Proof. Let F ; R b e compatible with a simpli cation order A on T F ; V . Let be anyPWO

such that is included in A. Theorem 4.7 shows that the restriction of to ground terms

emb emb

is a PWO. Hence the extension A of is well-founded on ground terms. Therefore F ; Ris

emb

terminating. 

The following result extends the very useful Lemma 3.5 to arbitrary TRSs. In the pro of of

Theorem 5.9 b elow and in the nal example of Section 6 we make use of this result.

Lemma 5.4. A TRS F ; R is simply terminating if and only if the TRS F ; R[Emb F ; 

is terminating for some PWO on F .

Proof.

 Let F ; R be compatible with the simpli cation order A on T F ; V . By de nition there

exists a PWO on F such that A. If l ! r 2 E mb F ;  then l r and

emb emb

therefore l A r . Hence E mb F ;  is also compatible with A. So F ; R[Emb F ;  is

simply terminating. Theorem 5.3 shows that F ; R[Emb F ;  is terminating.

 Supp ose F ; R[E mb F ;  is terminating for some PWO on F . Let A b e the rewrite order

asso ciated with the TRS F ; R[Emb F ; . Clearly A. Hence A is a simpli cation

emb

order. Since F ; R is compatible with A,we conclude that it is simply terminating.



It should b e stressed that there is no equivalent to the ab ove lemma if we base the de nition

of simpli cation order on WQOs. This is one of the reasons whywefavor PWOs.

In the remainder of this section we generalize Theorem 3.7 and hence Theorem 3.6 to

arbitrary TRSs. Our pro of is based on the elegant pro of sketch of Theorem 3.6 given by Plaisted

[16]. The pro of employs multiset extensions of preorders. A multiset is a collection in which

elements are allowed to o ccur more than once. If A is a set then the set of all nite multisets

over A is denoted by MA. The multiset extension of a partial order on A is the partial order

de ned on MA de ned as follows: M M if M =M X  ] Y for some multisets

mul 1 mul 2 2 1

X; Y 2 MA that satisfy ? 6= X M and for all y 2 Y there exists an x 2 X such that

1

x y . Using Higman's Lemma, it is quite easy to show that multiset extension preserves PWO.

From this we infer that the multiset extension of a well-founded partial order is well-founded,

using the well-known facts that 1 every well-founded partial order can b e extended to a total

well-founded order in particular a PWO and 2 multiset extension is monotonic i.e., if A

then A . Using Konig's Lemma, Dershowitz and Manna [5] gave a direct pro of that

mul mul

multiset extension preserves well-founded partial orders. 12

Definition 5.5. Let  b e a preorder on a set A. For every a 2 A, let [a] denote the equivalence

class with resp ect to the equivalence relation  containing a. Let An = f[a] j a 2 Ag b e the

set of all equivalence classes of A. The preorder  on A induces a partial order on An as

follows: [a] [b] if and only if a b. The latter denotes the strict part of the preorder .

For every multiset M 2 MA, let [M ] 2 MAn denote the multiset obtained from M by

replacing every element a by[a]. Wenow de ne the multiset extension  of the preorder 

mul

= =

as follows: M  M if and only if [M ] [M ] where denotes the re exive closure

1 mul 2 1 2

mul mul

of the multiset extension of the partial order on An.

It is easy to show that  is a preorder on MA. The asso ciated equivalence relation

mul

 =  \ - can b e characterized in the following simple way: M  M if and only

mul mul mul 1 mul 2

if [M ]=[M ]. Likewise, its strict part =  n- =  n has the following simple

1 2 mul mul mul mul mul

characterization: M M if and only if [M ] [M ]. Observe that we denote the strict

1 mul 2 1 mul 2

part of  by in order to avoid confusion with the multiset extension of the strict

mul mul mul

part of , which is a smaller relation.

The ab ove de nition of multiset extension of a preorder can be shown to be equivalent to

the more op erational ones in Dershowitz [3] and Gallier [7], but since we de ne the multiset

extension of a preorder in terms of the well-known multiset extension of a partial order, we get

all desired prop erties basically for free. In particular, using the fact that multiset extension

preserves well-founded partial orders, it is very easy to show that the multiset extension of a

well-founded preorder is well-founded.

Definition 5.6. If t 2 T F ; V  then S t 2 MT F ; V  denotes the nite multiset of all

subterm o ccurrences in t and F t 2 MF  denotes the nite multiset of all function symbol

o ccurrences in t. Formally,

8

>

ftg if t isavariable,

<

n

]

M t=

>

ftg] M t  if t = f t ;::: ;t .

i 1 n

:

i=1

8

>

? if t isavariable,

<

n

]

F t=

>

ff g] F t  if t = f t ;::: ;t .

i 1 n :

i=1

Lemma 5.7. Let  b e a preorder on T F ; V  with the subterm prop erty. If s t then S s

mul

S t.

0 0

Proof. We show that s t for all t 2 S t. This implies fsg S t and hence also

mul

0 0 0

S s S t. If t = t then s t by assumption. Otherwise t is a prop er subterm of t and

mul

0

hence t  t by the subterm prop erty. Combining this with s t yields s t. 

Lemma 5.8. Let  b e a preorder on T F ; V  which is closed under contexts. Supp ose s  t and

let C b e an arbitrary context.

 If S s S t then S C [s] S C [t].

mul mul

 If S s  S t then S C [s]  S C [t].

mul mul 13

Proof. Let S = S C [s] S s and S = S C [t] S t. For b oth statements it suces to

1 2

prove that S  S . Let p 2PosC [s] be the p osition of the displayed s in C [s]. There is

1 mul 2

a one-to-one corresp ondence b etween terms in S S  and p ositions in P osC  fpg. Hence it

1 2

0 0 0 0

suces to show that s  t where s = C [s] and t = C [t] are the to p osition q corresp onding

jq jq

0 0

terms in S and S , for all q 2 P osC  fpg. If p and q are disjoint p ositions then s = t .

1 2

0 0 0 0 0

Otherwise q

0 0

s  t. Closure under contexts yields s  t . We conclude that S  S . 

1 mul 2

After these two preliminary results we are ready for the generalization of Theorem 3.7 to

arbitrary TRSs.

Theorem 5.9. A TRS F ; R is simply terminating if and only if there exists a preorder  on

T F ; V  that is closed under contexts, contains the relation A for some PWO A on F , and

emb

satis es l r for every rewrite rule l ! r 2R and substitution  .

Proof. The \only if " direction is obvious since the re exive closure < of the simpli cation

order used to prove simple termination is a preorder with the desired prop erties. For the

\if " direction it suces to show that F ; R[Emb F ; A is a terminating TRS, according to

Lemma 5.4. First we show that either S s S t or S s  S t and F s A F t

mul mul mul

whenever s ! t is a reduction step in the TRS F ; R[Emb F ; A. So let s = C [l ] and

t = C [r] with l ! r 2R[Emb F ; A. We distinguish three cases.

 If l ! r 2R then l r by assumption and S l  S r according to Lemma 5.7.

mul

The rst part of Lemma 5.8 yields S s S t.

mul

 If l ! r 2Emb F  then l = f t ;::: ;t  and r = t for some i 2f1;:::;ng. Therefore

1 n i

S l  S r since S t  is prop erly contained in S f t ;::: ;t . Clearly l A r

mul i 1 n emb

and thus also l  r. An application of the rst part of Lemma 5.8 yields S s S t.

mul

 If l ! r 2Emb F ; A EmbF  then l = f t ;::: ;t  and r = g t ;::: ;t  with f A g ,

1 n i i

1 m

n > m > 0, and 1 6 i <  1. Wehave of course l A r and

1 m emb

thus also l  r. Since the multiset ft ;::: ;t g is contained in the multiset ft ;::: ;t g,

i i 1 n

1 m

we obtain S l   S r and F l  A F r. The second part of Lemma 5.8 yields

mul mul

S s  S t. We obtain F s A F t from F l  A F r.

mul mul mul

Kruskal's Tree Theorem shows that A is a PWO on T F . Hence  is a well-founded

emb

preorder on T F . Since multiset extension preserves well-founded preorders,  is a well-

mul

founded preorder on MT F . Because A is a PWO on the signature F it is a well-founded

partial order. Hence its multiset extension A is a well-founded partial order on MF . We

mul

conclude that F ; R[Emb F ; A is a terminating TRS. 

6. Other Notions of Termination

In this nal section we investigate the relationship between simple termination and other re-

stricted kinds of termination as intro duced in [17]. First we recall some terminology. Let F be

a signature. A monotone F -algebra A;  consists of a non-empty F -algebra A and a partial

order on the carrier A of A such that every algebra op eration is strictly monotone in all its

co ordinates, i.e., if f 2F has arity n then

f a ;::: ;a ;::: ;a  f a ;::: ;b ;::: ;a 

A 1 i n A 1 i n 14

for all a ;::: ;a ;b 2 A with a b i 2 f1;::: ;ng. We call a monotone F -algebra A; 

1 n i i i

wel l-founded if is well-founded. We de ne a partial order on T F ; V  as follows: s t if

A A

[ ]s [ ]t for all assignments : V ! A. Here [ ] denotes the homomorphic extension of .

Finally, a TRS F ; R is said to b e compatible with A; ifF ; R and are compatible.

A

It is not dicult to show that the relation is a rewrite order on T F ; V , for every

A

monotone F -algebra A; . If A;  is well-founded then is a reduction order. It is also

A

straightforward to show that a TRS F ; R is terminating if and only if it is compatible with

a well-founded monotone F -algebra. Simple termination can be characterized semantically as

follows.

Definition 6.1. A monotone F -algebra is called simple if it is compatible with the TRS

E mb F ;  for some partial well-order on F .

It is straightforward to show that a TRS F ; R is simply terminating if and only if it is

compatible with a simple monotone F -algebra.

Definition 6.2. A TRS F ; R is called total ly terminating if it is compatible with a well-

founded monotone F -algebra A;  such that is a total order on the carrier set of A. If the

carrier set of A is the set of natural numb ers and is the standard order then the TRS is called

! -terminating. If in addition the op eration f is a p olynomial for every f 2 F , the TRS is

A

called polynomial ly terminating .

Total termination has b een extensively studied in [6]. Clearly every p olynomially terminating

TRS is ! -terminating and every ! -terminating TRS is totally terminating. For b oth assertions

the converse do es not hold, as can be shown by the counterexamples R = ff g hx !

1

g f hg xg and R = ff g x ! g f f xg resp ectively. An easy observation [17]

2

shows that every totally terminating TRS over a nite signature is simply terminating. Again the

converse do es not hold as is shown by the well-known example R = ff a ! f b;gb ! g ag.

3

Somewhat surprisingly, for in nite signatures total termination do es not imply simple termi-

nation any more: we prove that the non-simply terminating TRS F ; R iseven p olynomially

4

terminating. Here F is the signature ff ;g j i 2 N g and R consists of all rewrite rules

i i 4

f g x ! f g x

i j j j

where i; j 2 N with i

4

PWO on F . Consider the in nite sequence f  . Since every in nite sequence is good, we

i i>1

have f f for some i

j i j i

the in nite reduction sequence

f g x ! f g x ! f g x ! 

i j j j i j

in the TRS F ; R [Emb F ; . Lemma 5.4 shows that F ; R  is not simply terminating.

4 4

For proving p olynomial termination of F ; R , interpret the function symb ols as the follow-

4

ing p olynomials over N :

3 2 2

x=x +2i x=x ix + i x and g f

i i

A A

for all i; x 2 N . Let i 2 N . The interpretation g of g is clearly strictly monotone in its single

i i

A

argument. The same holds for the interpretation of f since

i

2 2

x = x +1 i +2x +2x + i > 0 x +1 f f

i i

A A 15

for all x 2 N . It remains to show that f x for all i; j; x 2 N with if g

i j j j

A

A A A

x=x +2j . Then Fix i, j , x and let y = g

j

A

y =y j iy j i > 0 x = f y  f g x f f g

i j j j i j

A A

A A A A

since j>iand y > 2j>j+ i>0. We conclude that F ; R  is p olynomially terminating.

4

in nite nite

signatures signatures

R R

1 4

p olynomial

R R

2 5

 

R R

3 6

termination

 

 

! -termination

total termination

simple termination

Figure 1.

Summarizing the relationship b etween the various kinds of termination we obtain Figure 1;

for R and R we simply take the union of R with R and R resp ectively. Uwe Waldmann

5 6 4 1 2

p ersonal communication was the rst to prove total termination of a non-simply terminating

system similar to R , using a much more complicated total well-founded order.

4

The class of simply terminating TRSs is prop erly included in the class of all TRSs that are

compatible with a well-founded rewrite order having the subterm prop erty. Nevertheless, it's

quite big. For instance, it includes all TRSs whose termination can b e shown by means of the

recursive path order Dershowitz [2] and its variants. This can b e seen as follows. It is known

that is a rewrite order on T F ; V  with the subterm prop erty cf. [2]. It is not dicult

rpo

to show that extends , for any precedence on the signature F . Hence is a

rpo emb rpo

simpli cation order whenever the precedence is a PWO. In particular, if the signature is nite

then every is a simpli cation order. If is a well-founded precedence on an arbitrary

rpo

signature then is included in a simpli cation order and hence well-founded. This follows

rpo

from the incrementality of the recursive path order i.e., if A then A  and the

rpo rpo

well-known fact that every well-founded partial order can be extended to a total well-founded

partial order. Hence every TRS F ; R that is compatible with for some well-founded

rpo

precedence on F is simply terminating.

Acknow ledgements. We thank Enno Ohlebusch for scrutinizing the pap er.

References

1. N. Dershowitz, A Note on Simpli cation Orderings, Information Pro cessing Letters 95, pp. 212{

215, 1979. 16

2. N. Dershowitz, Orderings for Term-Rewriting Systems, Theoretical Computer Science 173,

pp. 279{301, 1982.

3. N. Dershowitz, Termination of Rewriting, Journal of Symb olic Computation 31, pp. 69{116, 1987.

4. N. Dershowitz and J.-P. Jouannaud, Rewrite Systems, in: Handb o ok of Theoretical Computer

Science, Vol. B ed. J. van Leeuwen, North-Holland, pp. 243{320, 1990.

5. N. Dershowitz and Z. Manna, Proving Termination with Multiset Orderings, Communications of

the ACM 228, pp. 465{476, 1979.

6. M.C.F. Ferreira and H. Zantema, Total Termination of Term Rewriting, Pro ceedings of the 5th

International Conference on Rewriting Techniques and Applications, Montreal, Lecture Notes in

Computer Science 690, pp. 213{227, 1993.

7. J. Gallier, What's so Sp ecial ab out Kruskal's Theorem and the Ordinal ? A Survey of Some

0

Results in Pro of Theory, Annals of Pure and Applied Logic 53, pp. 199{260, 1991.

8. G. Higman, Ordering by Divisibility in Abstract Algebras, Pro ceedings of the London Philosophical

So ciety 32, pp. 326{336, 1952.

9. G. Huet and D. Lankford, On the Uniform Halting Problem for Term Rewriting Systems, rep ort

283, INRIA, 1978.

10. G. Huet and D.C. Opp en, Equations and Rewrite Rules: A Survey, in: Formal Language Theory:

Persp ectives and Op en Problems ed. R.V. Bo ok, Academic Press, pp. 349{405, 1980.

11. J.W. Klop, Term Rewriting Systems, in: Handb o ok of Logic in Computer Science, Vol. II eds.

S. Abramsky, D. Gabbay and T. Maibaum, Oxford University Press, pp. 1{112, 1992.

12. J.B. Kruskal, Well-Quasi-Ordering, the Tree Theorem, and Vazsonyi's Conjecture,Transactions of

the American Mathematical So ciety 95, pp. 210{225, 1960.

13. M. Kurihara and A. Ohuchi, Mo dularity of Simple Termination of Term Rewriting Systems, Journal

of the Information Pro cessing So ciety Japan 315, pp. 633{642, 1990.

14. C.St.J.A. Nash-Williams, On Well-Quasi-Ordering Finite Trees, Pro ceedings of the Cambridge

Philosophical So ciety 59, pp. 833{835, 1963.

15. E. Ohlebusch, A Note on Simple Termination of In nite Term Rewriting Systems, rep ort nr. 7,

Universitat Bielefeld, 1992.

16. D.A. Plaisted, Equational Reasoning and Term Rewriting Systems, To app ear in: Handb o ok of

Logic in Arti cial Intelligence and Logic Programming, Vol. I eds. D. Gabbay and J. Siekmann,

Oxford University Press, 1993.

17. H. Zantema, Termination of Term Rewriting byInterpretation, Pro ceedings of the 3rd International

Workshop on Conditional Term Rewriting Systems, Pont- a-Mousson, Lecture Notes in Computer

Science 656, pp. 155{167, 1993. Full version to app ear as Termination of Term Rewriting: Interpre-

tation and Typ e Elimination in Journal of Symb olic Computation, 1994.

18. H. Zantema, Termination of Term Rewriting by Semantic Lab elling, rep ort RUU-CS-93-24, Utrecht

University, 1993. Submitted. 17