• Aucun résultat trouvé

Termination of Linear Bounded Term Rewriting Systems

N/A
N/A
Protected

Academic year: 2021

Partager "Termination of Linear Bounded Term Rewriting Systems"

Copied!
23
0
0

Texte intégral

(1)

HAL Id: hal-00949526

https://hal.archives-ouvertes.fr/hal-00949526

Submitted on 19 Feb 2014

HAL is a multi-disciplinary open access archive for the deposit and dissemination of sci- entific research documents, whether they are pub- lished or not. The documents may come from teaching and research institutions in France or abroad, or from public or private research centers.

L’archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d’enseignement et de recherche français ou étrangers, des laboratoires publics ou privés.

Irène Durand, Géraud Sénizergues, Marc Sylvestre

To cite this version:

Irène Durand, Géraud Sénizergues, Marc Sylvestre. Termination of Linear Bounded Term Rewriting Systems. Rewriting Techniques and Applications 2010, Jul 2010, France. p. 341–356. �hal-00949526�

(2)

TERMINATION OF LINEAR BOUNDED TERM REWRITING SYSTEMS

IR `ENE DURAND1AND G ´ERAUD S ´ENIZERGUES1AND MARC SYLVESTRE1

1LaBRI, Universit´e Bordeaux 1

351 Cours de la lib´eration, 33405 Talence cedex, France E-mail address, I. Durand:[email protected] E-mail address, G. S´enizergues:[email protected] E-mail address, M. Sylvestre:[email protected]

ABSTRACT. For the whole class of linear term rewriting systems and for each integer k, we define k-bounded rewritingas a restriction of the usual notion of rewriting. We show that the problem of the existence of an infinite k-bounded derivation, called the k-bounded termination problem, is decidable. Thek-boundedclass (BO(k)) is, by definition, the set of linear systems for which every derivation can be replaced by a k-bounded derivation. In general, the k-bounded termination problem for BO(k) systems is not equivalent to the termination problem. This leads us to define more restricted classes for which those problems are equivalent: the classes BOLP(k) ofk-bounded systems that have the length preservation property. By definition, a system is BOLP(k) if every derivation of length n can be replaced by a k-bounded derivation of length n. We define the class BOLP ofbounded systems that have the length preservation propertyas the union of all the BOLP(k) classes. The class BOLP contains (strictly) several already known classes of systems: the inverse left-basic semi-Thue systems, the linear growing term rewriting systems, the inverse Linear-Finite-Path-Ordering systems, the strongly bottom-up systems.

1. Introduction

General context. A Term-Rewriting System (TRS in short) is saidterminatingwhen it does not ad- mit any infinite derivation. Such a property is part of the definition of acompleteTRS, which is a useful algebraic notion. This property is also pertinent for TRSs which are models of functional programs or any kind of computational process. Thetermination-problemis the problem to know whether a given TRS Ris terminating or not. It is well-known that this problem is undecidable for general finite TRS ([7]) and even for quite restricted subclasses of TRS (see [2],[10] for exam- ple). Nevertheless, because of its importance, many techniques have been developed in order to prove termination of TRSs (see in particular [3],[9, section 1.3], [14, chap. 6]) or even to decide automatically termination, but for specific classes of TRS.

1998 ACM Subject Classification: regular research paper.

Key words and phrases: term rewriting, termination, rewriting strategy.

c

° I. Durand, G. S ´enizergues, and M. Sylvestre Confidential — submitted to RTA

(3)

Contents. The present paper follows the last trend of research quoted above:

1- we show that termination is decidable for a particular strategy that we call bounded rewriting, 2- we deduce from this decision procedure that the usual termination problem is decidable for some classes of TRS.

We define a new rewriting strategy for linear systems calledbounded rewriting. Let k ∈ N.

Intuitively, a derivation is said to be k-bounded (bo(k)) if when a rewriting rule is applied, the parts of the substitution located at a depth greater thankare not used further in the derivation, i.e.

do not match a left-handside of a rule applied further. A rewriting systemR will be said to be k-bounded(bo(k)) if for any derivations→R t, there exists ak-bounded derivationsbo(k)R t.

The class of k-bounded systems is denoted byBO(k), and the class of bounded systems BO is S

k∈NBO(k). A rewriting system will be said to bo(k)-terminates if there is no infinite bo(k)- derivation. The main result of this paper is the decidability of thebo(k)-termination problem. This rewriting strategy is closely related to thebottom-up strategy introduced in [4]: every bottom-up system is bounded, and for every bounded system, there is an equivalent system which is bottom- up. Both strategies are defined using marking tools, but the definition of the bounded strategy is simpler and more intuitive. For every linear system(R,F)and every integer k, there is a system (R,F)such that∀n∈N,→nR=→Rn and bo(k)◦→nR= bo(0)◦→nR. Thus, it is sufficient to prove that thebo(0)-termination problem is decidable to obtain the decidability of thebo(k)-termination problem, fork ∈ N. Following the idea developed for the bottom-up strategy, we use a ground rewriting systemS ∪ A to simulatebo(0)-derivations. This construction is made in such a way that the existence of an infinitebo(0)-derivation in Ris equivalent to the existence of an infinite derivation inS ∪ A. It follows from the decidability of the termination problem for ground systems that thebo(0)-termination problem is decidable. The systemAhas rules which allow to replace any subterm of a termtlocated at an internal node by a leaf labeled by the constant symbol#, and the systemSconsists of a set of rules of the formlσ→rσwherel→r∈ Randσis a substitution that maps variables to an element ofF0∪ {#}. Abo(0)-stepC[lσ]→C[rσ]inRis simulated in two steps : first, usingA, we reduceC[lσ]toC[lσ]wherelσ ∈ LHS(S), and then we apply the rule lσ →rσ ∈ S. We define a subclass ofBO(k), the length preservation bottom-up classBOLP(k), for which the termination problem and thek-bounded termination problem are equivalent. ABO(k) system isBOLP(k)iff for every derivations→Rtthere is abo(k)derivation of same length. The class of length preservation bounded systemBOLPisS

k∈NBOLP(k). This class contains several already known systems: the inverse left-basic semi-Thue systems [12], the linear growing term rewriting systems [8], the inverse Linear-Finite-Path-Overlapping systems [13], and the strongly bottom-up systems [4].

2. Preliminaries

2.1. Words and Terms

The setNis the set of positive integers. A finitewordover an alphabetAis a map

u : [0, ℓ−1] → A, for someℓ ∈ N. The integerℓis thelengthof the worduand is denoted by

|u|. The set of words overAis denoted byAand endowed with the usualconcatenationoperation u, v ∈ A 7→ u·v ∈ A. Theemptyword is denoted byε. A wordu is a prefix of a wordv iff there exists somew ∈Asuch thatv=u·w. We denote byu ¹vthe fact thatuis a prefix ofv.

Assuming a total order onA, we denote by¹Lex the lexicographic order on words.

We assume the reader familiar with terms. We callsignaturea setFof symbols with fixed arity ar:F →N. The subset of symbols of aritymis denoted byFm.

(4)

As usual, a setP ⊆Nis called atree-domain(or,domain, for short) iff for everyu∈N, i∈N:

(u·i∈P ⇒u∈P) & (u·(i+ 1)∈P ⇒u·i∈P).

We callP ⊆P asubdomainofP iff,Pis a domain and, for everyu∈P, i∈N:

(u·i∈P &u·(i+ 1)∈P)⇒u·(i+ 1)∈P.

A (first-order)termon a signatureFis a partial mapt:N → Fwhose domain is a non-empty tree-domain and which respects the arities. We denote byT(F,V)the set of first-order terms built upon the signatureF ∪ V, whereF is a finite signature andV is a denumerable set of variables of arity0.

The domain oftis also called its set ofpositionsand denoted byPos(t). The set of variables oftis denoted byVar(t). The root symbol oft,t(²)is also denoted byroot(t). The set of variable positions (resp. non variable positions) of a termtis denoted byPosV(t)(resp.PosV(t)). The set ofleavesoftis the set of positionsu∈ Pos(t)such thatu·N∩ Pos(t) =∅. It is denoted byLv(t).

We writePos+(t)forPos(t)\{²}. Givenv ∈ Pos+(t), itsfatherfth(v)is the positionusuch that v=u·wand|w|= 1. Given a termtandu∈ Pos(t)thesubterm oftatuis denoted byt/uand defined byPos(t/u) = {w | u·w ∈ Pos(t)}and∀w ∈ Pos(t/u), t/u(w) = t(u·w). A term which does not contain twice the same variable is calledlinear. Given a linear termt ∈ T(F,V), x∈ Var(t), we shall denote bypos(t, x)the position ofxint. Thedepthof a termtis inductively defined by:

• dpt(t) :=0 ift∈ V,

• dpt(t) :=1 ift∈ F0,

• dpt(t) :=1 + max({dpt(t/i)),i ∈ {0, ...,n}})ifroot(t)∈ Fn.

A term containing no variable is calledground. The set of ground terms isT(F). Among all the variables, there is a special one¤. A term containing exactly one occurrence of¤is called a context. A context is usually denoted as C[]. If v is the position of ¤ in C[], C[t] denotes the termC[] where thas been substituted at position v. We also denote byC[]v such a context and by C[t]v the result of the substitution. We denote by|t| := Card(Pos(t))the sizeof a term t. A substitution σ is a mapping from V to T(F,V). The substitution σ extends uniquely to a morphism σ : T(F,V) → T(F,V), where σ(f(t1, ..., tn)) = f(σ(t1), ..., σ(tn)), for each f ∈ F,ti ∈ T(F,V). Lettbe a linear term andPosV(t) ={u1, ..., un}, where theuiare given in lexicographic order. The termtis said to be standardized if for alli,1≤i≤n,t/ui =xi.

2.2. Term rewriting systems

Arewrite rulebuilt upon the signatureF is a pairl → r of terms inT(F,V)which satisfies Var(r)⊆ Var(l). We calll(resp.r) theleft-handside(resp.right-handside) of the rule (lhsandrhs for short). A rule islinearif both its left and right-handsides are linear. A rule isleft-linear if its left-handside is linear. Given a set of rulesR, we denote byLHS(R)the set{l|l→r∈ R}. Aterm rewriting system(systemfor short) is a pair (R,F)whereF is a signature andRa set of rewrite rules built upon the signatureF such thatLHS(R)∩ V =∅. WhenF is clear from the context or contains exactly the symbols ofR, we may omitF and write simplyR. Given a rewriting system (R,F), and two termst1, t2, we say that there exists aR-rewriting step betweent1 andt2 inR and writet1R t2if there exists a contextC[], a rulel → r ∈ R, and a substitutionσ such that t1 = C[lσ]and t2 = C[rσ]. The term lσis called a redex oft1, andrσ is called a contractum oft1. Given some n ≥ 0, a derivation inR of length n froms tot is a sequence of the form s = s0R s1R ... →R sn. The relation→nR is defined as follows: s →n tif there exists a

(5)

derivation of lengthnfromstot. The relation→R(→+R) is defined by:s→ t(s→+ t) if there is somen ≥0(n >0) such thats→nR t. More generally, the notation defined in [9] will be used in proofs.

A system islinear(resp.left-linear) if each of its rules is linear (resp. left-linear). A systemR isgrowing[8] if for every rulel→ r∈ R, all variables inVar(l)∩ Var(r)occur at depth0or1in l. Two rewriting systems(R,F)and(R,F)are said to beequivalentif for alln≥0,→nR=→nR. A systemRis said toterminateif there is no infinite derivation inR.

3. Bounded rewriting

In order to definebounded rewriting, we need some marking tools. In the following we assume thatFis a signature. We shall illustrate many of our definitions with the following system

Example 3.1. F ={a,b,f,g,h,i},R1 ={f(x)→g(x),g(h(x))→i(x),i(x)→a,a→b}.

3.1. Marking

We mark the symbols of a term using natural integers.

3.1.1. Marked symbols.

Definition 3.2. We define the (infinite)signature of marked symbols:FN:={fi|f ∈ F, i∈N}.

For j ∈ N, we denote by F≤j the signature: F≤j := {fi | f ∈ F, i ≤ j}. The mapping m:FN→Nmaps every marked symbol to its mark:m(fi) =i.

3.1.2. Marked terms.

Definition 3.3. The terms inT(FN,V)are calledmarkedterms.

The mappingmis extended to marked terms by: ift∈ V,m(t) := 0, otherwise, m(t) :=m(root(t)). For everyf ∈ F, we identifyf0 andf; it follows thatF ⊂ FN, T(F)⊂ T(FN)andT(F,V)⊂ T(FN,V).

We usemmax(t)to denote the maximal mark of a marked termt:

mmax(t) := max{m(t/u)|u∈ Pos(t)}.

Example 3.4. m(a1) = 1,m(i0(a2)) = 0,m(h3(a0)) = 3,m(h1(x)) = 1,m(x) = 0, mmax(i0(a1)) = 1,mmax(x) = 0.

Definition 3.5. Givent∈ T(FN,V)andi∈N, we define the marked termtiwhose marks are all equal toi:

iftis a variablex ti :=x

iftis a constantc ti :=ci

otherwiset=f(t1, . . . , tn),wheren≥1 ti :=fi(t1i, . . . , tni)

This marking extends to sets of termsS(Si:={ti |t∈S}) and substitutionsσ(σi:x7→(xσ)i).

Notation:in the sequel, given a termt∈ T(F,V),twill always refer to a term ofT(FN,V)such thatt0=t.

(6)

Definition 3.6. For every marked termt, we denote bybtthe unique marked term such that:

Pos(bt) :=Pos(t), ∀u∈ PosV(t),m(bt/u) := max(m(t/u),|u|+ 1).

We extend this definition to marked substitutions (bσ:x7→xσ) and sets of termsc (Sb :={bs|s∈S}).

Example 3.7. Lett1=f0(f1(x)), andt2=f2(f2(h2(a2))). We have:tb1 =f1(f2(x)), tb2 =f2(f2(h3(a4))).

3.2. Marked rewriting

LetRbe a left-linear system,s∈ T(FN). Let us suppose thatsdecomposes as

s=C[lσ]v, with (l, r)∈ R, (3.1)

for some marked contextC[]vand substitutionσ. We then writes◦→twhen

s=C[lσ], t=C[rbσ]. (3.2)

More precisely, an ordered pair of marked terms(s, t)is linked by the relation ◦→iff, there existsC[]v,(l, r), l, σfulfilling equations (3.1-3.2). (This is illustrated by Figure 1, where the marks are noted between brackets[. . .]).

C C

l r

s t

v

[m(s/w)] [0]

[k]

[max(k,|w|+ 1)]

xbσ xσ w

Figure 1: A marked rewriting step

The map s 7→ s0 (from marked terms to unmarked terms) extends into a map from marked derivations to unmarked derivations: every

s0 =C0[l0σ0]v0 ◦→C0[r00]v0 =s1◦→. . . ◦→Cn−1[rn−1σ[n−1]vn−1 =sn (3.3) is mapped to the derivation

s0 =C0[l0σ0]v0 →C0[r0σ0]v0 =s1→. . .→Cn−1[rn−1σn−1]vn−1 =sn. (3.4) The contextCi[]vi, the rule (li, ri), the marked versionl¯i ofli and the substitution σi completely determinesi+1. Thus, for every fixed pair(s0, s0), this map is a bijection from the set of derivations (3.3), to the set of derivations (3.4).

(7)

From now on, each time we deal with a derivations→ tbetween two termss, t∈ T(F,V), we may implicitly decompose it as (3.4) wherenis the length of the derivation,s=s0andt=sn. 3.3. Bounded derivations

Definition 3.8. The marked derivation (3.3) isk-bounded(bo(k)) if

for every0 ≤i < n,mmax(li) ≤k. The derivation (3.4) isbo(k)if the correspondingk-marked derivation (3.3) isbo(k).

In particular, the marked derivation (3.3) isbo(0)iff for every0≤i < n,li=li. Example 3.9. Let us consider the following derivations inR1:

(1) f(h(a))→g(h(a))→i(a)→a

(2) f(h(a))→g(h(a))→g(h(b))→i(b)→a

The first derivation isbo(1)since the associated marked derivation isbo(1):

f(h(a))◦→g(h1(a2))◦→i(a2)◦→a.The second one isbo(2):

f(h(a))◦→g(h1(a2))◦→g(h1(b))◦→i(b1)◦→a.

Letk ∈ N. It is clear that the composition of twobo(k)marked derivations isbo(k) too, but the composition of two unmarkedbo(k)derivations might not bebo(k), as shown in the following example:

Example 3.10. The two derivations inR1: f(h(a))→ g(h(a))andg(h(a))→ i(a)→aarebo(0) while the derivation:f(h(a))→g(h(a))→i(a)→ais notbo(0)(but isbu(1)).

In the following we thus (mainly) manipulatemarkedbo(k)-derivations. Let us introduce some convenient notations.

Definition 3.11. Let n, k ∈ N. The binary relation bo(k)◦ →nR over T(FN) is defined by:

s bo(k)◦ →nR t iff there exists a bo(k)-marked derivation from s to t of length n. The binary relation bo(k)◦→Ris defined by:sbo(k)◦→Rtiff there existsm∈Nsuch thatsbo(k)◦→mR t. The binary relation bo(k)nRoverT(F)is defined by: sbo(k)nR tiff there exists abo(k)-derivation fromstotof lengthn. The binary relation bo(k)R is defined by: sbo(k)R tiff there exists m∈Nsuch thatsbo(k)mR t.

Next lemma shows that the study ofbo(k)-derivations can be reduced to the study ofbo(0)- derivations.

Lemma 3.12. LetRbe a linear rewriting system and letk >0. There exists an equivalent linear systemRsuch that: for alln∈N, bo(k)nR= bo(0)nR.

Sketch of proof. LetRbe the rewriting system consisting of the rules:

{lσ→rσ|l→r∈ R, σ:V → T(F,V), lσis standardized,dpt(σ)≤k}.

One can easily check thatRis finite, equivalent toRand that, for alln∈N, bo(k)nR= bo(0)nR.

(8)

Example 3.13. Let us consider thebo(1)-derivation in example3.9

f(h(a))→g(h(a))→i(a)→aand the systemRbuilt forR1andk= 1. We have:

R ={f(x1)→g(x1),f(f(x1))→g(f(x1)),f(g(x1))→g(g(x1)),

f(h(x1))→g(h(x1)),f(i(x1))→g(i(x1)),f(a)→g(a),f(b)→g(b), g(h(x1))→i(x1),g(h(f(x1)))→i(f(x1)),g(h(g(x1)))→i(g(x1)), g(h(h(x1)))→i(h(x1)),g(h(i(x1)))→i(i(x1)),g(h(a))→i(a), g(h(b))→i(b),i(x1)→a,i(f(x1))→a,i(g(x1))→a,

i(h(x1))→a,i(i(x1))→a,i(a)→a,i(b)→a,a→b}

and the followingbo(0)-derivation inR:

f(h(a))◦→f(h(x1))→g(h(x1)) g(h(a1))◦→h(x1)→i(x1) i(a1)◦→i(x1)→aa.

3.4. Bounded systems

We introduce here a hierarchy of classes of rewriting systems, based on their ability to meet the bounded restriction over derivations.

Definition 3.14. Letpbe some property of derivations. A system(R,F)is calledPif∀s, t∈ T(F) such thats→Rtthere exists ap-derivation fromstot.

We denote byBO(k)the class ofBO(k)systems. One can check that, for everyk >0, BO(k−1)(BO(k). Finally, the class ofbounded systemsBOis defined by:BO=S

k∈NBO(k).

The membership problem forBO(k)is shown to be undecidable in the appendix, using a result of [4].

Definition 3.15. We say that the systemRbo(k)-terminatesiff there is no infinitebo(k)-derivation inR.

Thebo(k)-termination problem for a linear systemRis the following problem:

INSTANCE: A linear systemR, and an integerk.

QUESTION: DoesRbo(k)-terminate ?

The main result of this paper is the decidability of thebo(k)-termination problem.

4. Simulation of bounded derivations by a ground rewriting system

In this section, we prove that abo(0)-derivation can be simulated using a ground term rewriting system.

Definition 4.1. Let#be a constant such that#∈ F/ 0. LetAbe the (infinite) rewriting system on T(F ∪ {#}N)consisting of the rules:

{fi(a1, . . . , an)→#i|i∈N, f ∈ Fn, n >0, a1, . . . , an∈(F0∪ {#})N}.

Forj∈N, we denote byA≤jthe restriction ofAonT((F ∪ {#})≤j)consisting of the rules:

{fi(a1, . . . , an)→#i|i≤j, f ∈ Fn, n >0, a1, . . . , an∈(F0∪ {#})≤j}.

Lemma 4.2. Lets, t∈ T((F ∪ {#})N). Ifs→At, thenbs→Abt.

(9)

Definition 4.3. A marked termt∈ T((F ∪ {#})N,V)is said to besmoothly-increasing (s-increasing in short) iff for every branchb, the sequence of marks onbhas the form:

0,0, . . . ,0,1,2, . . . , ℓ

i.e. more formally: for everyw∈Lv(t), there exists someu¹wsuch that,

• ∀v¹u,m(¯t/v) = 0,

• ∀vºu,∀i∈N, ifv·i¹wthenm(¯t/v·i) =m(¯t/v) + 1.

A substitutionσis said to be s-increasing if for everyx∈ V, the termxσis s-increasing.

Note that by definition of a s-increasing termt, and since the variables are all marked by0, for all positionsu∈ PosV(t), for allv¹u,m(t/v) = 0.

Example 4.4. The termsf0(h1(x))andf2(h1(a2))are not s-increasing. The termsf0(f0(h1(a2))) andf1(a2)are s-increasing.

Lemma 4.5. LetC[]andtbe s-increasing. The termC[t]is s-increasing.

Proof. Since¤∈ V, it is an immediate consequence of the definition of s-increasing.

Lemma 4.6. Letsbe a s-increasing term andsbo(0)◦→R t. The marked termtis s-increasing.

Proof. Let us prove that the result holds by induction onnthe length of the derivationsbo(0)◦→Rt.

Ifn= 0, the result holds. Letn >0. There is a termsn−1such thatsbo(0)◦→n−1R sn−1bo(0)◦→R

sn. By induction hypothesis,sn−1 is s-increasing. By definition of abo(0)marked rewriting step, there existsC[]v,l→r∈ Randσsuch that:sn−1 =C[lσ]v,andt=C[rbσ]v.Assn−1is

s-increasing, sincem(sn−1/v) = 0, the contextC[]v is s-increasing. By definition ofb, for every x∈ Var(r),xbσ is s-increasing. Since the termris s-increasing, several applications of lemma4.5 at each positionu∈ PosV(r)show thatrbσis s-increasing. We can conclude using the same lemma thatC[rbσ]v is s-increasing.

Definition 4.7. Lett∈ T((F ∪ {#})N,V)be a marked term andPbe a subdomain ofPos(t)such thatPosV(t) ⊆ P. We defineRed(t, P)as the unique term such thatPos(t) = P and such that t→ARed(t, P).

The termRed(t, P)is obtained fromtby substituting the subtreet/uby the symbol#m(t/u), for every positionu∈P\Lv(t)such that∀i∈N, u·i /∈P.

Lemma 4.8. Lett∈ T((F ∪ {#})N,V)andP be a subdomain ofPos(t)such thatPosV(t)⊆P. We haveRed(bt, P) =Red(t, P\ ).

Proof. Since bacts only on marks, we haveRed(bt, P)0 = (Red(t, P\ ))0. Letv∈P. By definition ofb,m(bt/v) = max(m(t/v),|v|+ 1), andm(Red(t, P\ )/v) = max(m(Red(t), P)/v,|v|+ 1). By definition ofA,m(t/v) =m(Red(t, P)/v). Hence,Red(bt, P) =Red(t, P\ ).

(10)

4.0.1. Topof a term.

Definition 4.9(Top domain of a term). Lettbe a s-increasing term. We define the top domain oft, denoted byTopd(t)as: u∈Topd(t)iffu∈ Pos(t)∧m(t/u)≤1.

Note that by definition of a s-increasing term,Topd(t)is a subdomain oftand since for every u∈ PosV(t),m(t/u) = 0, we havePosV(t)⊆Topd(t).

Definition 4.10 (Top of a term). Let t be a s-increasing term. We denote by Top(t) the term Red(t,Topd(t)).

Example 4.11. Lett1 =f0(h1(a2)),t2 =f0(h0(a1)). We have:Topd(t1) ={²,0}, Topd(t2) =Pos(t2),Top(t1) =f(#1),Top(t2) =t2.

Intuitively, the top of a termtwill be the only part oftwhich could be used in abo(0)-derivation starting ont. We extend this definition to sets of s-increasing terms (Top(S) :={Top(t)|t∈S}) and to s-increasing marked substitutions (Top(σ) :x7→Top(xσ)).

Lemma 4.12. LetC[]v, t1 be s-increasing and lett=C[t1]. We have:

Top(t) =Top(C[]v)[Top(t1)]v.

Proof. By lemma4.5, t is s-increasing. Since¤ is a variable and sinceC[]v is s-increasing, for everyu¹v,m(t/u) = 0. So,v ∈Topd(t), and by definition ofTop, the result holds.

Lemma 4.13. Lettandσbe s-increasing. We have:Top(tσ) =Top(t)Top(σ).

Proof. This lemma is obtained by applying lemma4.12several times at each positionv∈ PosV(t).

4.0.2. The ground systemS.

Definition 4.14. We consider the following ground rewriting systemS over

T((F ∪ {#})≤1)consisting of all the rules of the form:lσ→S rσ, whereb l→ris a rule ofR, and σ:V →(F0∪ {#})≤1.

Note that sinceσ :V →(F0∪ {#})≤1, by definition ofb,bσ:V →(F0∪ {#})≤1. The system S ∪ A≤1will be used to simulate thebo(0)-derivations inR.

4.0.3. Lifting lemma.

Lemma 4.15. Lets ∈ T((F ∪ {#})N),s,t ∈ T((F ∪ {#})≤1). Assume thatsA s →S t.

There exists a termt ∈ T((F ∪ {#})N)such thatsbo(0)◦→R tAt.

bo(0) A ∗

∗ s

s t

S A

t R

Figure 2: Lemma 4.15

(11)

Proof. We haves →S t. This means thats = C[lσ]v, t = C[rbσ]v, for some rule l → r ∈ R, marked context C[]v, and marked substitution σ : V → (F0 ∪ {#})≤1. Since sA s, and sinceA goes from bottom to top, there exists a contextC[]v, a substitution σ such that s is of the forms = C[lσ]v. withC[]v such thatC[] →A C[], andσ such that for everyx ∈ Var(l), xσAxσ.By definition of bo(0)◦→,s=C[lσ]v bo(0)◦→R t:=C[rbσ]v.By Lemma 4.2, for everyx ∈ Var(r),xσbA xbσ.Hence,t =C[rσb]→A C[rσb]→A C[rbσ] =t.We have built a derivation:sbo(0)◦→tAt.The result holds.

Example 4.16. Let us consider the systemSbuilt from the systemR1.

S ={f(#)→g(#1),f(#1)→g(#1),f(a)→g(a1),f(a1)→g(a1), f(b)→g(b1),f(b1)→g(b1),g(h(#))→i(#1),g(h(#1))→i(#1), g(h(a))→i(a1),g(h(a1))→i(a1),g(h(b))→i(b1),g(h(b1))→i(b1), i(#)→a,i(#1)→a,i(a)→a,i(a1)→a,i(b)→a,i(b1)→a,a→b}.

We have the following derivation:

g(h(a))→A,a→#g(h(#))→S,f(h(#))→i(#1))i(#1)).

In the proof of lemma4.15, we build the derivation:

g(h(a))bo(0)◦→R1,g(h(x))→i(x)i(a1))→A,a1→#1 i(#1).

4.0.4. Projecting lemma.

Lemma 4.17(projecting lemma). Lets∈ T(FN)be s-increasing, andsbo(0)◦→R t.There is a derivation:Top(s)→A≤1STop(t).

bo(0) t

s

Top(t) Top(s)

A R A

A≤1 S

Figure 3: Projecting lemma

Proof. By definition of bo(0)◦→, there exists a contextC[]v, a marked substitutionσ, and a rule l → r ∈ R such that s = C[lσ]v andt = C[rbσ]v.Since sis s-increasing, by lemma 4.6, tis s-increasing, andTop(t)is well defined. Moreover, the marked contextC[]v, the substitutionσ, and the termsr andlare s-increasing. So, by lemmas4.12and4.13: Top(s) =Top(C[]v)[lTop(σ)]v, and, Top(t) = Top(C[]v)[rTop(bσ)]v. By definition of Top, Top(s) ∈ T((F ∪ {#})≤1). Let us define the substitution τ by τ : x 7→ Red(xTop(σ),Topd(xTop(bσ))).By definition of Red, Top(s) →A Top(C[]v)[lτ]. Moreover,Top(s)∈ T((F ∪ {#})≤1). Thus, we haveTop(s) →A≤1

Top(C[]v)[lτ]v.Letx ∈ Var(l). Let us prove thatxτ ∈ (F0 ∪ {#})≤1. Let u ∈ Pos(xσ). If

|u| ≥1, by defintion ofb, we havem(xbσ/u) ≥2, andu /∈ Topd(xTop(bσ)). Thus,xτ is reduced

(12)

to a constant, and sinceTop(s)∈ T((F ∪ {#})≤1),xτ ∈(F0∪ {#})≤1. Hence, the rulelτ →rbτ belongs toSandTop(s)→A≤1 Top(C)[lτ]→S Top(C)[rbτ].By lemma4.8, for allx∈ Var(r),

xbτ =Red(xTop(σ),\Topd(xTop(bσ))) =Red(xTopσ),\ Topd(xTop(bσ)) =xTop(bσ).

So,bτ = Top(bσ), andTop(t) = Top(C[]v)[rTop(bσ)]v = Top(C[]v)[rbτ]v.We have built a deriva- tion:Top(s)→A≤1S Top(t).The result holds.

Example 4.18. Let us consider the systemR1, S built for this system, and the followingbo(0) rewriting step:s=f(f(g1((a2))))◦→R1,f(x)→h(x)t=h(f1(g2(a3))).

We haveTop(s) =f(f(#1)),Top(t) =h(#1),and the following derivation:

f(f(#1))→A≤1 f(#)→S,f(#)→h(#1) h(#1).

5. Decidability of the termination

In this section, we prove that thebo(k)-termination problem is decidable.

Proposition 5.1. If the systemS ∪ A≤1does not terminate, thenRdoes notbo(0)-terminate.

s1 s2 s3

s4

bo(0)

s0

bo(0)

t1

t2

A≤1

A

A≤1 S A R

S

R

Figure 4: Proposition 5.1

Proof. Assume thatS ∪ A≤1 does not terminate. Then there exists an infinite rewriting sequence of terms inT((F ∪ {#})≤1). The system A≤1 is obviously terminating. Thus, such an infinite derivation contains an infinite number of steps inSand is of the form:

s0A≤1 s1S s2A≤1 s3S s4A≤1 . . .→S s2nA≤1 . . . .

We now show that repeated applications of lemma 4.15 yields an infinite markedbo(0)-derivation inR: first, considers0A≤1 s1S s2. By lemma 4.15 there existst1 such thats0 bo(0)◦→R

t1A s2. Sincet1A s2, we can apply lemma 4.15 tot1A s3S s4. We obtain a term t2 such thats0 bo(0)◦→R t1 bo(0)◦→R t2A s4. Following this process, we obtain an infinite sequence such thats0bo(0)◦→Rt1bo(0)◦→R t2 bo(0)◦→R. . . bo(0)◦→Rtn. . .. We conclude that Rdoes not terminate.

(13)

Proposition 5.2. IfRdoes notbo(0)-terminate, thenS ∪ A≤1does not terminate.

Proof. IfRdoes notbo(0)-terminate, there is an infinite derivation:

s0 =s0bo(0)◦→R s1bo(0)◦→R. . . snbo(0)◦→R. . . .

The terms0 is s-increasing since it has no mark. Moreover, the derivation steps0 bo(0)◦→R s1 is bo(0). By lemma 4.17,s0 = Top(s0) →A≤1S Top(s1).Another application of lemma 4.17 on s1 bo(0)◦→R s2 leads to a derivation: Top(s0) →+S∪A≤1 Top(s1) →+S∪A≤1 Top(s2). Following this process, we obtain an infinite derivation:

Top(s0)→+S∪A≤1 Top(s1)→+S∪A≤1 . . .Top(sn)→+S∪A≤1 . . . andS ∪ A≤1does not terminate.

Theorem 5.3. Thebo(0)-termination problem is decidable.

Proof. By propositions5.1 and5.2, a linear systemR bo(0)-terminates iff the systemS ∪ A≤1 terminates. It is well known that the termination problem for ground systems is decidable (see e.g.[1, page 99-100]) and we can decide whether the systemS ∪ A≤1terminates. Thus, thebo(0)- termination problem is decidable.

Corollary 5.4. Thebo(k)-termination problem is decidable.

Proof. It is just a consequence of theorem5.3and lemma3.12.

Note that in general, for aBO(0)system, thebo(0)-termination property and the termination property are not equivalent.

Definition 5.5. LetRbe aBO(k)system. We say thatRhas thebo(k)length preservation property if for everyn∈N:→nR= bo(k)nR.

We denote byBOLP(k) the class of BO(k) systems that have thebo(k) length preservation property. Finally, the class ofbounded systems with the length preservation propertyis denoted by BOLP. One can check that for everyk >0,BOLP(k−1)(BO(k).

Example 5.6. LetR2 = {f(x) → g(x),g(a) → f(a)}. This system isBO(0)but does not have thebo(0)length preservation property. There is a derivation of length2:f(a) →g(a)→ f(a),but there is nobo(0)-derivation of length2fromf(a)tof(a)(there is one of length0). Moreover, this system does not terminate butbo(0)-terminates.

Corollary 5.7. The termination problem for systems inBOLP(k)is decidable.

Proof. Let us prove that, for a systemR ∈ BOLP(k), the bo(k)-termination and termination are equivalent properties. Clearly, ifRdoes notbo(k)terminate, then the systemRdoes not terminate.

Conversly, let us suppose that there is an infinite derivation:s0R s1Rs2R. . .→Rsn. . . . Since R has the bo(k) length preservation property, there is for each m ∈ Na marked bo(k)- derivationDm such thatDm =s0 bo(k)◦→mR sm. The systemRhas a finite number of rules, so there is only a finite number of possible one step rewriting starting ons0. Hence, there exists a term s1 such that the set{m |Dm = s0 bo(k)◦→R s1 bo(k)◦→mR−1 sm}is infinite. Repeating this process, we obtain an infinite derivation:

s0bo(k)◦→Rs1 bo(k)◦→R . . . bo(k)◦→Rsnbo(k)◦→. . . . Hence, the systemRdoes notbo(k)-terminate. We have established that:

Rbo(k)-terminates ⇔ Rterminates.

(14)

By corollary5.3, thebo(k)-termination problem is decidable. Hence, the termination problem for systems inBOLP(k)is decidable.

We prove in the appendix that several classes of rewriting systems are (stricly) included in the class ofBOLPrewriting systems :

• the inverse left-basic semi-Thue systems (viewed as unary term rewriting systems) [12],

• the linear growing term rewriting systems [8],

• the inverse Linear-Finite-Path-Overlapping systems [13],

• the strongly bottom-up linear systems [4].

As a consequence, these systems have a decidable termination problem. Note that, using the same method as the one used to prove the decidability of the termination problem forBOLP(k)systems, one can decide for everyR ∈ BOLP(k)and everyt ∈ T(F)whether there exists some infinite derivation inRstarting fromt. It is also shown in the appendix, using a result of [4], thatBO(k) systems inverse preserve rationality.

6. Related works and perspectives

Related works. We borrowed from [4] the idea of simulating derivations according to a special strategy by some ground system. Note however, that the classBO(k) itself is new. Its advantages over the class BU(k) is that its definition is simpler, it allows a simpler proof of the projecting lemma and it makes lemma 1 true, while this lemma, mutatis mutandis, does not hold for the class BU(k).

The principle of replacing the original rewriting relation over a signature F by some other binary relation over a marked-alphabetFNwas already used in [5] in order to get an algorithm for termination. However, the two marking mechanisms turn out to be different:

- in the case ofword rewritingsystems, the marked derivation used here is not generated by a semi- Thue system while the marked derivation of [5] is generated by an (infinite) semi-Thue system;

- the direct image of a rational setRby a system which is match-bounded overRis rational while the direct image of a rational set by aBO(0)system needs not be rational; from this point of view ourBO(0)-semi-Thue systems resemble the inverses of match-bounded systems (though, they are not comparable for inclusion);

- the marking process used here extends naturally to terms while the notion of [5] seems more difficult to extend to terms (although interesting ways of doing such an extension have been studied in [6] and successfully implemented).

Perspectives. Let us mention some natural perspectives of development for this work:

• it is tempting to extend the notion ofboundedrewriting (resp. system) to left linear systems.

This class would extend the class of growing systems studied in [11];

• we think that the direct image of a context-free language through bounded rewriting is context-free;

• the whole class ofbounded systems (at least semi-Thue) should have a decidable termina- tion problem;

• one should try to devise a class of semi-Thue systems that includes both the class ofBO(k) systems and the class of inverses of match-bounded systems, and still possesses the inter- esting algorithmic properties of these classes.

Some work in these directions has been undertaken by the authors.

(15)

References

[1] F. Baader and T. Nipkow.Term rewriting and all that. Cambridge University Press, New York, NY, USA, 1998.

[2] M. Dauchet. Simulation of Turing machines by a regular rewrite rule.Theoret. Comput. Sci., 103(2):409–420, 1992.

[3] N. Dershowitz and J.P. Jouannaud. Rewrite Systems. InHandbook of theoretical computer science, vol.B, Chapter 2, pages 243–320. Elsevier, 1991.

[4] I. Durand and G. S´enizergues. Bottom-up rewriting is inverse recognizability preserving. InProceedings RTA’07, volume 4533 ofLNCS, pages 114–132. Springer-Verlag, 2007.

[5] A. Geser, D. Hofbauer, and J. Waldmann. Termination proofs for string rewriting systems via inverse match-bounds.

J. Automat. Reason., 34(4):365–385, 2005.

[6] A. Geser, D. Hofbauer, J. Waldmann, and H. Zantema. On tree automata that certify termination of left-linear term rewriting systems.Inform. and Comput., 205(4):512–534, 2007.

[7] G. Huet and D. Lankford.On the uniform halting problem for term rewriting systems. Rapport Laboria, 1978.

[8] F. Jacquemard. Decidable approximations of term rewriting systems. InProceedings of the 7th International Con- ference on Rewriting Techniques and Applications, volume 1103, pages 362–376, 1996.

[9] J.W. Klop. Term rewriting systems. InHandbook of Logic in Computer Science, Vol. 2, pages 1–116. Oxford Uni- versity Press, 1992.

[10] Y. Matiyasevich and G. S´enizergues. Decision problems for semi-Thue systems with a few rules.Theoret. Comput.

Sci., 330(1):145–169, 2005.

[11] T. Nagaya and Y. Toyama. Decidability for left-linear growing term rewriting systems. InRTA ’99: Proceedings of the 10th International Conference on Rewriting Techniques and Applications, pages 256–270, London, UK, 1999.

Springer-Verlag.

[12] J. Sakarovitch.Syntaxe des langages de Chomsky, essai sur le determinisme. Th`ese de doctorat d’ ´Etat, Universit´e Paris VII, 1979.

[13] T. Takai, Y. Kaji, and H. Seki. Right-linear finite path overlapping term rewriting systems effectively preserve recognizability. InRTA, pages 246–260, 2000.

[14] Terese.Term Rewriting Systems. Cambridge University Press, 2003.

(16)

Appendix A. Appendix

A.1. Bottom-up derivations

The class ofBOlinear systems is closely related to the class of bottom-up systemsBUintro- duced in [4] in the following sense: everyBUsystem isBO, and for everyBOsystem, there is an equivalent system which isBU. TheBUsystems are also defined using marking tools. The marked derivation used to definedBUsystem will be denoted by ⊲→. Let us recall some of the definitions given in [4].

The right-action¯of the monoid(N,max,0)over the setFNconsists in applying the operation maxon every mark: for every¯t∈ FN, n∈N,

Pos(¯t¯n) :=Pos(¯t), ∀u∈ Pos(¯t),m((¯t¯n)/u) := max(m(¯t/u), n), (¯t¯n)0 = ¯t0

For every linear marked term¯t∈ T(FN,V)and variablex∈ Var(¯t), we define:

M(¯t, x) := sup{m(t/w)|w <pos(t, x)}+ 1. (A.1) Lets∈ T(FN)andt∈ T, and let us suppose thats∈ T(FN)decomposes as

s=C[lσ]v, with (l, r)∈ R, (A.2)

for some marked contextC[]vand substitutionσ. We define a new marked substitutionσ(such that σ00) by: for everyx∈ Var(r),

xσ:= (xσ)¯M(l, x). (A.3)

We then writes ⊲→twhen

s=C[lσ], t=C[rσ]. (A.4)

The map s 7→ s0 (from marked terms to unmarked terms) extends into a map from marked derivations to unmarked derivations: every derivationd:

s0=C0[l0σ0]v0 ⊲→C0[r0σ0]v0 =s1⊲→. . . ⊲→Cn−1[rn−1σn−1]vn−1 =sn (A.5) is mapped to the derivationd:

s0 =C0[l0σ0]v0 →C0[r0σ0]v0 =s1→. . .→Cn−1[rn−1σn−1]vn−1 =sn. (A.6) Definition A.1([4]). The marked derivation (A.5) isweakly bottom-upif, for everyi,0≤ i < n, m(li) = 0,.

Definition A.2([4]). The derivation (A.6) isweakly bottom-upif the corresponding marked deriva- tion (A.5) starting on the same terms=sisweakly bottom-up.

We shall abbreviate “weakly bottom-up” towbu.

Definition A.3 ([4]). A derivation isbu(k) (resp. bu(k)) if it is wbuand, in the corresponding marked derivation∀i,0≤i≤n,mmax(si)≤k(resp.∀i,0≤i < n,mmax(li)< k).

Note that abu(k)derivation isbu(k+ 1).

Lemma A.4. Letk∈N. If the derivation (A.6) isbu(k)then it isbu(k).

(17)

Sketch of proof. One can check, by induction on n the length of the derivation (A.6), that the associated marked derivation (A.5) satisfies:

∀i,0≤i≤n−1,mmax(si+1) = max(mmax(si),mmax(li) + 1).

If the derivation (A.6) isbu(k), then the derivation (A.5) satisfies:

∀j,0≤j < n,mmax(lj)< k.

Hence, for allj,0≤j≤n,mmax(sj)≤kand the derivation (A.6) isbu(k).

Let us introduce a convenient notation.

Definition A.5. Letk≥1. The binary relation bu(k)⊲→RoverT(FN)is defined by: sbu(k)⊲→Rt if and only if there exists abu(k)marked derivation fromstot. The binary relation bu(k)Rover T(F)is defined by: sbu(k)R tif and only if there exists abu(k)-derivation fromstot.

Lemma A.6([4]). LetRbe a linear system andn∈N. Ifs→nRtthen there exists awbuderivation betweensandtof lengthn.

A.2. Bottom-up systems

We denote byBU(k)the class ofbu(k)systems, byBU(k)the class ofbu(k)systems. We define the class ofbottom-up systems, denotedBU, by:

BU= [

k∈N

BU(k).

By definitions ofbuandbu, for allk >0,BU(k−1)⊆BU(k). By lemma A.4, for allk∈N, BU(k)⊆BU(k). Hence, we have:

BU= [

k∈N

BU(k).

A system is said to be stronglybu(k)iff everywbuderivation isbu(k). The class of stronglyBU(k) systems is denoted bySBU(k). We definestrongly bottom-up systems, denotedSBUby:

SBU= [

k∈N

SBU(k).

A.3. Bottom-up systems and Bounded systems

Before proving the equivalence betweenBOandBU, we start by giving some technical lemmas.

Let us considerdandd: the derivation (A.6), and its associated marked derivation (A.5) using ⊲→.

We denote bydethe associated derivation using ◦→:

e

s0 =Cf0[le00]v0 ◦→se1 =Cf0[r0σcf0]v0 ◦→. . . ◦→sen=C]n−1[rn−1σ[]n−1]vn−1

Lete:= max({dpt(l)|l ∈LHS(R)}). Note that sinceLHS(R)∩ V =∅,e≥1.

Lemma A.7. For alli,0≤i≤n, for allu∈ Pos(si),

m(sei/u) = 0⇔m(si/u) = 0.

(18)

Proof. We made this proof by induction onnthe length of the derivationd. Ifn= 0, then

sn=sen =sn, and the result holds. Let us suppose thatn >0. By induction hypothesis onn−1, for alli,0≤i≤n−1, for allu∈ Pos(sn−1),

m(sei/u) = 0⇔mmax(si/u) = 0.

Let us prove that for allu∈ Pos(sn),

m(sen/u) = 0⇔mmax(sn/u) = 0.

Letu∈ Pos(sn). We distinguish three cases.

• case 1:u≺vn−1oru⊥vn−1.

Thenu∈ PosV(Cn−1[]vn−1), and by induction hypothesis,

m(sen/u) =m(sgn−1/u) = 0⇔mmax(sn/u) =m(sn/u) = 0.

The result holds.

• case 2:∃w∈ PosV(rn−1)such thatu=vn−1·w.

Then,m(sen/u) =m(rn−1/w) =m(sn/u) = 0.The result holds.

• case 3:∃x∈ Var(rn−1),∃w∈ Pos(xσn−1)such thatu=vn−1·pos(rn−1, x)·w.

Then, by definition ofσ,m(sn/u) =m(xσ/w)>0,and by definition ofbeσ, m(sen/u) =m(xbeσ/w)>0.The result holds.

Lemma A.8([4]). Ifdiswbu, the following assertion holds:

∀i,0≤i≤n,∀u, v∈ Pos(si), u¹v⇒m(si/u)≤m(si/v).

Lemma A.9. If d is wbu, the following assertion holds: for all i,0 ≤ i ≤ n, for all u, v ∈ Pos(si), u¹v,

m(sei/v)>0⇒m(sei/u)−m(sei/v)≥ |u| − |v|.

Proof. We make this proof by induction onn. Ifn= 0, the result holds. Let us suppose thatn >0, and that the result holds for everyi,0 ≤i≤ n−1. Letu ∈ Pos(sn)and letv ¹ u. We have to prove that:

m(sen/v)>0⇒m(sen/u)−m(sen/v)≥ |u| − |v|.

• case 1:v≺vn−1.

Sincediswbu,m(ln−1) = 0, and by lemmaA.8,m(sn−1/v) = 0. So, m(sn/v) =m(sn−1/v) = 0. By lemmaA.7,m(sen/v) = 0. The result holds.

• case 2:v⊥vn−1.

Then, sinceu ⊥ v, m(sgn−1/v) = m(sen/v), and m(sgn−1/u) = m(sen/u).By induction hypothesis onn−1,

m(sgn−1/v)>0⇒m(sgn−1/u)−m(sgn−1/v)≥ |u| − |v|.

The result holds.

• case 3:∃w∈ PosV(rn−1)such thatv=vn−1·w.

Then,m(sen/v) =m(rn−1/w) =m(sn/v) = 0. The result holds.

• case 4:∃x∈ Var(rn−1),∃w∈ Pos(xσn−1)such thatv=vn−1·pos(rn−1, x)·w.

There existsw1,w¹w1such thatu=vn−1·pos(rn−1, x)·w1.

Letv =vn−1·pos(ln−1, x)·w, andu =vn−1·pos(ln−1, x)·w1. By definition of e, m(sen/v) = max(m(sgn−1/v),|w|+ 1),

(19)

and,

m(sen/u) = max(m(sgn−1/u),|w1|+ 1). (A.7) We distinguish two subcases:

- case 4.1:m(sen/v) =m(sgn−1/v).

Thenm(sgn−1/v)>0, and by induction hyptothesis,

m(sgn−1/u)−m(sgn−1/v)≥ |u| − |v|.

By equation (A.7),m(sen/u)≥m(sgn−1/u).Since|u| − |v|=|u| − |v|, m(sen/u)−m(sen/v) =m(sen/u)−m(sgn−1/v)

≥m(sgn−1/u)−m(sgn−1/v)≥ |u| − |v|.

The result holds.

- case 4.2:m(sen/v) =|w|+ 1.

By equation (A.7),m(sen/u)≥ |w1|+ 1.Moreover,|w1|=|w|+|u| − |v|. Hence, m(sen/u)−m(sen/v)≥ |w1|+ 1−(|w|+ 1) =|u| − |v|.

The result holds.

Corollary A.10. Ifdiswbu, then for alln,0≤i≤n, for everyu, v∈ Pos(si), u¹v⇒m(si/u)≤m(si/v).

Proof. It is a immediate consequence of the lemmaA.9.

Definition A.11. Lettbe a marked term. We denote byNu(t)the number of positionsv≺usuch thatm(t/v) =m(t/u):

Nu(t) :=|{v|v≺u,m(t/v) =m(t/u)}|.

Note that by lemmaA.8, ifdiswbu, for alli,0≤i≤n,Nu(si) =|u| − |vu|, where vu := inf({v|v¹u,m(si/v) =m(si/u)}).

Lemma A.12. Ifdiswbu, then for alli,1≤i≤n, for allu∈ Pos(si), m(sei/u)≤m(si/u)·e+Nu(si).

Proof. The proof is made by induction onnthe length of the derivationd. Ifn= 0,s0 =se0 =s0, and the result holds. Letn >0. We have to prove that for everyu∈ Pos(sn),

m(sen/u)≤m(sn/u)·e+Nu(sn).

We distinguish three cases.

- case 1:u≺vn−1oru⊥vn−1.

Then,u∈ PosV(C[]vn−1), andNu(sn) =Nu(sn−1). By induction hypothesis onn−1, the result holds.

- case 2:∃w∈ PosV(rn−1)such thatu=vn−1·w.

Then,m(sen/u) =m(sn/u) =m(rn−1/w) = 0, and the result holds.

- case 3:∃x∈ Var(rn−1),∃w∈ Pos(xσn−1)such thatu=vn−1·pos(rn−1, x)·w: Letu =vn−1·pos(ln−1, x)·w. By definition,

m(sen/u) = max(|w|+ 1,m(sgn−1/u)), (A.8) By definition ofσn−1,xσn−1=xσn−1¯M(C[ln−1]vn−1, x).By lemmaA.8, and sinceln−1 ∈ V/ ,

M(C[ln−1]vn−1, x) =M(ln−1, x) =m(ln−1/fth(pos(ln−1, x))) + 1.

Références

Documents relatifs

L’archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des

L’archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des

Unité de recherche INRIA Lorraine LORIA, Technopôle de Nancy-Brabois - Campus scientifique 615, rue du Jardin Botanique - BP 101 - 54602 Villers-lès-Nancy Cedex France Unité

In this article, we generalize this approach from monoids presented by convergent string rewriting systems to algebraic theories presented by convergent term rewriting systems, and

The protection of electronic consumers is of great importance in view of economic development and increased competition in production and marketing methods, and if

Bien que la Clozapine soit le traitement de référence dans le cadre de la schizophrénie résistante, certains patients n’y répondent que partiellement ou pas ;

Second, the translation can be seen as a generic strategy compiler and thus can be used as a portable implementation of strategies which could be easily integrated in any

Unité de recherche INRIA Rennes, Irisa, Campus universitaire de Beaulieu, 35042 RENNES Cedex Unité de recherche INRIA Rhône-Alpes, 655, avenue de l’Europe, 38330 MONTBONNOT ST