Florent Jacquemard
Reachability and confluence are undecidable for flat term rewriting systems Research Report LSV−03−6, Mar. 2003
Ecole Normale Supérieure de Cachan 61, avenue du Président Wilson 94235 Cachan Cedex France
http://www.lsv.ens−cachan.fr/Publis/ Research Report LSV−03−6, Lab. Spécification et Vérification, CNRS & ENS de Cachan, France, Mar. 2003
Rea hability and on uen e are unde idable for at term rewriting systems Florent Ja quemard INRIA Futurs & LSV/CNRS UMR 8643, ENS de Ca han, 61, avenue du president-Wilson 94235 Ca han Cedex, Fran e Tel: +33-1 47 40 75 44 Fax: +33-1 47 40 24 64
Abstra t Ground rea hability, ground joinability and on uen e are shown unde idable for
at term rewriting systems, i.e. systems in whi h all left and right members of rule have depth at most one. Key words:
Theory of omputation, Term rewriting.
Introdu tion The on uen e of a term rewriting systems (TRS) guaranties that every term has at most one normal form. This property is unde idable in general, and has been shown de idable for ground TRS in [1,2℄. The main result of [1℄ also implies the de idability of the rea hability and joinability problems for ground TRS. More re ently, the on uen e has been shown solvable in polynomial time for several lasses of TRS, every lass embedding the previous one: some restri ted ground TRS in [3℄, ground TRS in [4℄, shallow (variables o
ur at depth at most 1 in rewrite rules) and rule linear (in every rewrite rule, every variable o
urs at most on e) TRS in [5℄, and shallow, linear (in every left or right member of rewrite rule, every variable o
urs at most on e) TRS in [6℄. The polynomial time omplexity result of [4℄ is also valid for the de ision of rea hability and joinability, whi h was already shown in [1℄. Email address: florent.ja quemardlsv.ens- a han.fr (Florent
Ja quemard).
Preprint submitted to Elsevier S ien e
13 Mar h 2003
Rea hability, joinability and on uen e are unde idable for linear (non-shallow) TRS [7℄, but it was not known whether we an relax the linearity assumptions on variables of the systems of [5,6℄, keeping these properties de idable 1 . We answer here by the negative, showing, with a redu tion of the Post Corresponden e Problem, that the problems of ground rea hability, ground joinability and on uen e are unde idable for at TRS (every terms in rewrite rules have depth at most 1) with non linear variables. The proof for ground rea hability uses the same olored te hniques as an older proof of unde idability of rigid rea hability [8℄, though this latter result ould not be reused dire tly in this
ontext.
1 Preliminaries Given a signature , and a set of variable symbols X , we note T (; X ) the set of terms build with symbols of and X and T () its subset of ground terms. The set of fun tion symbols of of arity i is denoted . i
A term rewriting system (TRS) on is de ned as a nite set of rewrite rules denoted ` ! r with `; r 2 T (; X ). We note ! the rewrite relation (on terms of T (; X )) de ned by the TRS R, and ! the re exive and transitive of this relation. R
R
De nition 1 A TRS R is alled shallow (respe tively at), if all its rewrite rules have the form f (t1 ; : : : ; t ) ! g(s1 ; : : : ; s ) or x ! g(s1 ; : : : ; s ) or f (t1 ; : : : ; t ) ! x where every t and s is either a variable of X or a ground term of T () (respe tively a variable of X or a symbol of 0 ), and where x 2 X , and n, m an be 0 (if f or g have arity 0). n
n
i
m
m
i
We are interested in the following de ision problems:
(ground) rea hability. Given a TRS R on a signature and two (ground) terms s; t 2 T (; X ), do we have a redu tion s ! t? (ground) joinability. Given a TRS R on and two (ground) terms s; t 2 T (; X ), does there exists v 2 T (; X ) su h that s ! v t?
on uen e. Given a TRS R on , do we have: for all s; t 2 T (; X ) su h t for some u 2 T (; X ), does there exists v 2 T (; X ) that s u ! su h that s ! v t ? R
R
R
R
R
R
R
We shall show below that the ground rea hability, ground joinability and on uen e problems are unde idable for at TRS, by redu tion of the Post orresponden e problem. 1
Rea hability, joinability and on uen e are shown NP-hard in [6℄. 2
2 Post Corresponden e Problem, oding and oloring We onsider an instan e of the Post Corresponden e Problem (PCP) given by a nite set of pairs of words: PCP := f(u ; v ) j u ; v i
i
i
i
2 fa; bg; 1 i N g
(1)
The following problem is unde idable: [9℄: Does there exist a nite sequen e (i )0 with 1 that u u : : : u = v v : : : v ? j
i0
i1
ik
i0
i1
j
k
i0; : : : ; i N , su h k
ik
We shall represent the hypotheti al solutions of PCP by ground terms from the sets des ribed in Se tion 2.1, and provide in Se tions 3, 4, and 5 some redu tions to the rea hability, joinability and on uen e de ision. The ingredients for the onstru tion of the TRSs used in the redu tions are two automata (Se tion 2.2), four TRSs (beginning of Se tion 3) and some oloring (Se tion 2.3). 2.1 Produ t and string terms
Let be a new symbol. We shall use a produ t operator whi h asso iate to two words of fa; bg a word of fa; b; g2 as follows:
1 : : : n
01 : : : 0
m
:= h 1 ; 01 i : : : h
k
; 0k
i
where 1; : : : ; ; 01 ; : : : ; 0 2 fa; bg, k = max(n; m), and for all i with n < i k , if any, (resp. all j with m < j k ), = (resp. 0 = ). n
m
i
j
bab = ha; bih ; aih ; bi. Let us onsider the signature := fa; b; "g, where a, b and " have the respe tive Example 2
a
arities 1,1 and 0.
We write: := ℄ f g, where has arity 0 in , and := fa; b; g2 [ f"g, where " has arity 0 in , and every other symbols have arity 1 in .
Remark 3 We make no distin tions below between a word 1 : : : 2 fa; bg (resp. d1 : : : d 2 fa; b; g2 ) and the ground term 1 (: : : (")) 2 T ( ) (resp. d1 (: : : d (")) 2 T ()). n
n
n
n
In this manner, the operator is extended to T ( ) T ( ) ! T (). 3
2.2 Automata asso iated to PCP
Let A be a nite automaton omputing on fa; b; g2 , re ognizing the set: L(A) = fu v j 1 i N g . We denote Q the set of states of A, and q its initial state. i
i
A
Let B be a automaton L(B ) = a; b .
f g
with state set
A
and initial state
QB
qB
re ognizing
Following Remark 3, we shall onsider L(A) and L(B ) as subsets of, respe tively, T () and T ( ). We asso iate to A and B two ground TRS T and T on the respe tive signatures ℄ Q and ℄ Q , where the states symbols of Q and Q have arity 0, as follows: A
A
B
B
A
B
f ! d(q0) j q; q0 2 Q ; d 2 ; q ! q0 is a transition of Ag [ fq ! q0 j q; q0 2 Q ; q ! q0 is an epsilon-transition of Ag [ fq ! " j q 2 Q is a nal state of Ag := fq ! (q0 ) j q; q0 2 Q ; 2 ; q ! q0 is a transition of B g [ fq ! q0 j q; q0 2 Q ; q ! q0 is an epsilon-transition of B g [ fq ! " j q 2 Q is a nal state of B g
TA := q
d
A
A
A
TB
(2)
B
B
B
(3)
2.3 Coloring terms and TRS
We assume given 19 disjoint opies of the above signatures, olored with olor () i for 0 i 18: ( ) := f ( ) j 2 g, Q := fq ( ) j q 2 Q g, () () Q := fq ( ) j q 2 Q g, ( ) := fh ( ) ; 0 i j h ; 0 i 2 g. i
i
i
i
A
A
i
i
i
i
i
B
B
Let be the following signature := [ [ Q [ Q , where the symbols of and keep their respe tive arities in and the symbols of Q and Q have arity 0 in , and let and ( ) (0 i 18) be the olored opies of , ( ) := ( ) [ ( ) [ Q( ) [ Q( ) . A
B
A
B
i
i
i
i
i
i
A
B
For 0 i 18, the i- oloring t( ) 2 T (( ) ; X ) of a term of t 2 T (; X ) is re ursively de ned by: f (t)( ) := f ( ) (t( ) ), and x( ) := x for all x 2 X . i
i
i
i
i
i
Given a set U T (), we write U ( ) := ft( ) j t 2 U g, and given a TRS R on , we let R( ) := fl( ) ! r( ) j l ! r 2 Rg and R( ) := R( ). i
i;j
i
i
j
i
4
i;i
3 Redu tion of PCP to rea hability for at TRS We asso iate a TRS R1 to the above problem PCP in (8), see also Figure 1. Its de nition refers to the following two trivial and two proje tions TRS:
f ! (x) j 2 1g [ f" ! "g f ! d(x) j d 2 1g [ f" ! "g 1 := fh ; 0 i(x) ! (x) j 2 1 ; 0 2 g [ fh ; 0i(x) ! x j 0 2 1g [ f" ! "g 2 := fh ; 0 i(x) ! 0 (x) j 2 ; 0 2 1 g [ fh ; i(x) ! x j 2 1g [ [f" ! "g S := (x) P := d(x)
(4) (5) (6) (7)
The identity TRS S and P shall of ourse be used only in their olored form S ( ) and P ( ) . i;j
i;j
Example 4 Assume that u1 = a, v1 = bab, u2 = ab, v2 = b. The term (u1 v1 )(u2 v2 ) 2 L(A) is redu ed as follows by the left proje tion 1 is, with an outermost strategy: (u1 v1 )(u2 v2 ) = ha; bi(h ; ai(h ; bi(ha; bi(hb; i("))))) ! a(h ; ai(h ; bi(ha; bi(hb; i("))))) ! a(h ; bi(ha; bi(hb; i(")))) ! a(ha; bi(hb; i("))) ! a(a(hb; i("))) ! a(a(b("))) 1
1
1
1
1
S
() The TRS R1 is de ned on an extended signature: = =18 =0 ℄ ff; g; 0; 1g where f; g; 0; 1 are new fun tion symbols of respe tive arities 8, 8, 0, 0 in . i
i
i
8 9 >> 0 ! f (q(3); q(4); q(5); q(13); q(14); q(6); q(15); q(16)); >> >< >= R1 := R0 [ f (x1 ; x2 ; x1 ; y11 ; y12 ; x2 ; y11 ; y12 ) ! g (x1 ; x2 ; x1 ; y11 ; y12 ; x2 ; y11 ; y12 ); >> >> >: g(x0; x0; y17; y17; y18; y18; y10; y10) ! 1 >; (3) (4) (5) (6) (13) [ T (14) [ T (15) [ T (16) [ R0 := T [ T [ T [ T [ T P (3 1) [ P (4 2) [ P (5 1) [ S (13 11) [ S (14 12) [ P (6 2) [ S (15 11) [ S (16 12) [ (1 17) [ S (11 17) [ S (12 18) [ (2 18) [ S (11 10) [ S (12 10) P (1 0) [ P (2 0) [ 1 (8) 2 A
A
A
;
;
A
A
A
A
;
;
;
;
B
B
B
A
B
;
B
B
;
;
B
B
;
;
;
;
;
;
;
Note that R1 is a at TRS.
De nition 5 A 01-derivation witness for R1 is a tuple (s0 ; s1 ; s2 ; t10 ; t11 ; t12 ; t17 ; t18 ) of terms of T (; X ) su h that: f (q(3) ; q(4) ; q(5); q(13) ; q(14); q(6) ; q(15); q(16)) ! f (s1 ; s2 ; s1 ; t11 ; t12 ; s2 ; t11 ; t12 ) ! g (s1 ; s2 ; s1 ; t11 ; t12 ; s2 ; t11 ; t12 ) ! g (s0 ; s0 ; t17 ; t17 ; t18 ; t18 ; t10 ; t10 ). A
A
R1
A
B
B
A
B
B
R1
5
R1
0 ! f ( q(3); A
(4)
(5)
qA ; qA ;
(3) T (4) T (5)
TA
A
A
(13)
(14)
qB ;
(6)
qB ;
(13)
qA ;
(14)
TB
(6)
TB
TA
(15)
(16) )
qB ;
qB
(15)
(16)
TB
TB
P (3;1) P (4;2) P (5;1) S (13;11) S (14;12) P (6;2) S (15;11) S (16;12) f ( x1 ;
x2 ;
x1 ;
y11 ;
y12 ;
x2 ;
y11 ;
y12 )
g ( x1 ;
x2 ;
x1 ;
y11 ;
y12 ;
x2 ;
y11 ;
y12 )
#
P (1;0) P (2;0) g ( x0 ;
x0 ;
17) S (11 17) S (12 18) (2 18) S (11 10) S (12 10) (1 2 1 ;
y17 ;
;
;
;
y17 ;
y18 ;
y18 ;
;
;
!1
y10 )
y10 ;
Fig. 1. The TRS 1. The pla ement of the rules illustrates the equivalen e between the existen e of a solution to PCP and the existen e of a redu tion 0 ! 1. A solution is represented by a term 2 ( ) su h that ! for some 2 ( ). The terms and are dupli ated in the redu tion (with dierent olors), they orrespond to the variables and respe tively. In the redu tion, the rules of the top part (above ( ) ! ( )) ensures that the (instan es of) and belong respe tively to ( ) and ( ) and the rules of the bottom part ensure the above relation between and , namely 1 and 2 are the same term 0, modulo
oloring, the proje tion with 1 of 1 is 17, the proje tion with 2 of 2 is 18, and 17 and 18 are the same term 10 modulo oloring. R
R1
s
t
L B
s
L A
xi
s
yj
xi
yj
L B
t
x
x
Lemma 6 0
2
s
g :::
L A
y
1
t
t
f :::
y
s
x
x
y
x
y
y
! 1 i there exists a 01-derivation witness for R1.
R1
Proof: The if dire tion is immediate. For the only if dire tion, let us remark that, by onstru tion of R1 , the se ond and last-but-one terms of the derivation 0 ! 1 are ne essarily respe tively the rst and last terms of the derivation in De nition 5, for some terms s0 , t17 , t18 , t10 . R1
Moreover, a ase analysis on the rules of R1 also shows that the derivation (3) (4) (5) (13) (14) (6) (15) (16) f (qA ; qA ; qA ; qB ; qB ; qA ; qB ; qB ) R1 g (s0 ; s0 ; t17 ; t17 ; t18 ; t18 ; t10 ; t10 ) has to involve the rule f (x1 ; x2 ; x1 ; y11 ; y12 ; x2 ; y11 ; y12 ) g(x1 ; x2 ; x1 ; y11 ; y12 ; x2 ; y11 ; y12)
!
!
at the root position. This implies the existen e of a 01-derivation witness.
2
Lemma 7 Every 01-derivation witness for R1 w = (s0; s1 ; s2 ; t10 ; t11 ; t12 ; t17 ; t18 ) is su h that:
2 L(A)(0), s1 2 L(A)(1), s2 2 L(A)(2), t10 2 L(B )(10), t11 2 L(B )(11), t12 2 L(B )(12) , t17 2 L(B )(17) and t18 2 L(B )(18) ,
(1) s0
6
(2) s1 ! s0 (3) s1 ! t17 P
(1;0)
s2 ,
P
(1;17) 1
(2;0)
S
(11;17)
and t11 t11 , and t12 S
! t10 t12, ! t18 s2.
(11;10) S
S
(12;10)
(2;18) 2
(12;18)
Proof: We an show (e.g. by indu tion on the length of the derivation) that every term t su h that f (q(3); q(4) ; q(5) ; q(13); q(14); q(6) ; q(15); q(16)) ! t veri es either t = 1 or t ontains exa tly one o
urren e of f or g at root position and does not ontain any o
urren e of 0 or 1. Hen e, all the redu tions in (3) (4) (5) (13) (14) (6) (15) (16) f (q ; q ; q ; q ; q ; q ; q ; q ) ! f (s1 ; s2 ; s1 ; t11 ; t12 ; s2 ; t11 ; t12 ) of De nition 5 and in g(s1 ; s2 ; s1 ; t11 ; t12 ; s2 ; t11 ; t12 ) ! g(s0 ; s0 ; t17 ; t17 ; t18 ; t18 ; t10 ; t10 ) involve only rules of R0 applied at non root positions. A
A
A
A
B
B
A
A
A
B
B
B
B
A
B
B
R1
R1
R1
Therefore, we have on one hand (see also Figure 1) q(3) ! s1 , q(4) ! s2 , (5) ! s , q (13) ! t , q (14) ! t , q (6) ! s , q (15) ! t , q (16) ! t , q 1 11 12 2 11 12 and on the other hand s1 ! s0 s2 , s1 ! t17 t11 , t12 ! t18 s2 , t11 ! t10 t12 . A
A
B
R0
B
R0
R0
R0
A
R0
R0
R0
R0
B
A
R0
B
R0
R0
R0
R0
R0
R0
R0
We shall now show that the use of olors in the onstru tion of R0 implies (1){ (3) for w, by redu ing in rementally the possible domain of ea h omponent of w.
(3)
(5) . Be ause of the hoi e of the olors 3 and 5, the left 17) derivation an only involve rules of the sub systems T (3) , P (3 1), P (1 0), (1 1 , and the right derivation an only involve rules of the sub systems T (5) , P (5 1), (1 17) . Hen e, s 2 T ((0) [ (1) [ (17) ). P (1 0) , 1 1 (4) (6) q ! s2 0 q implies similarly that s2 2 T ((0) [ (2) [ (18) ). 0 s1 ! s0 s2 implies that s0 2 T ((0) ), s1 2 T ((0) [ (1) ) and 0 0 s2 2 T ((0) [ (2) ). (13) ! t (15) implies that t 2 T ( (10) [ (11) [ (17) ). q 11 0 q 11 0 (14) (16) q ! t12 0 q implies that t12 2 T ( (10) [ (12) [ (18)). 0 t11 ! t10 t12 implies that t10 2 T ( (10) ), t11 2 T ( (10) [ (11) ) and 0 0 t12 2 T ( (10) [ (12) ). s1 ! t17 t11 implies that s1 2 T ((1) ), t11 2 T ( (11) ) and t17 2 0 0 T ( (17) ). t12 ! t18 s2 implies that s2 2 T ((2) ), t12 2 T ( (12) ) and t18 2 0 0 T ( (18)).
! s1
qA
R0
R0
qA
;
;
;
A
;
A
;
;
A
R
R
A
R
R
B
R
R
B
B
R
R
B
R
R
R
R
R
R
Altogether, we have shown (1). The onditions (2) and (3) follow then from the above redu tions and the olors of the omponents of w. 2
Lemma 8 There exists a 01-derivation witness for R1 i there exists a solution for PCP. 7
Proof: For the if dire tion, assume that the sequen e (i )0 is a solution of PCP, and let s := (u v )(u v ) : : : (u v ) and t := u u : : : u . By onstru tion of R1 , and be ause t = v v : : : v , the tuple (s(0) ; s(1); s(2) ; t(10) ; t(11) ; t(12) ; t(17) ; t(18) ) is a 01-derivation witness for R1. j
i0
i0
i1
i0
i1
i1
ik
ik
i0
j
k
ik
i1
ik
For the only if dire tion, let (s0 ; s1 ; s2 ; t10 ; t11 ; t12 ; t17 ; t18 ) be a 01-derivation witness for R1. The onditions s0 2 L(A)(0), s1 2 L(A)(1), s2 2 L(A)(2) of (1) in Lemma 7, and s1 !s0 s2 of (2) in Lemma 7 ensure that there exist a sequen e (i )0 su h that, for ea h ` = 0; 1; 2: P
j
s`
j
(1;0)
P
(2;0)
k
= (u( ) v( ) ) (u( ) v( ) ) `
`
`
`
i0
i0
ik
ik
We an show that The other onditions in (1){(3) in Lemma 7 imply that (i )0 is a solution of PCP. j
j
k
Indeed, s1
! t17 and t17 2 L(B )(17)) imply that t17 = u
(1;17) 1
Also, s2
! t18 and t18 2 L(B )(18)) imply that t18 = v
(2;18) 2
i0
i0
: : : uik (")(17) .
: : : vik (")(18) .
Moreover, t11 ! t17 , t12 ! t18 , and t11 2 L(B )(11), t12 imply that t11 = u : : : u (")(11) and t12 = v : : : v (")(12) . S
(11;17)
S
i0
Finally, t11 v : : : v (").
S
i0
! t10
(11;10)
(12;18)
ik
S
(12;10)
i0
t12 ,
2
L(B )(12) ,
ik
permits us to on lude that u
i0
: : : uik (")
ik
=
2
Lemmas 6, 7 and 8 establish a redu tion of the unde idable PCP into the rea hability problem for (R1; 0; 1). Hen e we an on lude with the following theorem.
Theorem 9 The ground rea hability problem is unde idable for at TRS.
4 Redu tion of PCP to joinability for at TRS The unde idability for the joinability follows from a redu tion presented in [7℄ (we an also observe that the joinability problem for R1, 0 and 1 is equivalent to the rea hability problem for R1 , 0 and 1).
Corollary 10 The ground joinability problem is unde idable for at TRS. 8
5 Redu tion of PCP to on uen e for at TRS We shall modify the TRS R1 built for the proof of Theorem 9 in order to redu e PCP to on uen e 2 . More pre isely, we shall onstru t a TRS R2 su h that 0 ! 1 i R1 [ R2 is on uent. R1
The TRS R2 is de ned on the extended signature: 0 = [ f2g, where 2 has arity 0 in 0 . R2 :=
f2 ! 0; 2 ! 1g [ f ! 0 j 2 0 n f0; 1gg [ fd(x) ! 0 j d 2 1g [ fd(1) ! 1 j d 2 1g [ ff (z1; : : : ; z8) ! 1; g(z1; : : : ; z8) ! 1 j one of the z is 1; the others are distin t variablesg (9) i
We re all that 0 and 1 denote the set of symbols of of arity respe tively 0 and 1. Note that R2 is at.
Lemma 11 R1 [ R2 is on uent i 0
! 1.
R1
Proof: For the only if dire tion, assume that 0 6 ! 1. It means that 0 and 1 are not joinable by R1 (sin e 1 is in normal form for R1 [ R2 ) and hen e also not joinable by R1 [ R2. Hen e R1 [ R2 is not on uent be ause of the peak 0 2 ! 1. R1
R2
R2
For the if dire tion, assume that 0 ! 1, and let R3 := (R1 [ R2 ) n R4, where R4 ontains the rules of T (3) , T (4) , T (5) , T (6) , T (13), T (14), T (15), T (16) and 0 ! f (q(3) ; q(4); q(5) ; q(13); q(14) ; q(6); q(15); q(16) ), 2 ! 0, 2 ! 1. R1
A
A
A
A
B
B
A
A
A
B
A
B
B
B
B
B
Let u, t, s be some terms su h that s [ u [ ! t. Suppose that the redu tion u [ ! s uses some rules of R4. It means that some term in this redu tion ontains a onstant symbol of 0 . We an show (by indu tion on the redu tion length) that if s1 [ ! s2 then s1 ontains a onstant of 0 i s2 also ontains a onstant of 0 . Hen e in our ase, u, s and t ontain at least a onstant of 0 . It implies that s ! 1 t (be ause 0 ! 1). R1
R1
R2
R1
R2
R2
R1
R2
R2
R2
R1
Hen e, it is suÆ ient to show that R3 is on uent in order to show that R1 [ R2 is on uent. We an show that R3 is terminating, by exhibiting a redu tion ordering ompatible with R3, for instan e, a multiset path ordering [10℄ based on a well founded pre eden e on su h that: d
for all d 2 ( ), 2 i
( ) , 0 i; j j
2
18,
A similar te hnique is used in [6℄ to show the NP-hardness of on uen e for shallow TRS. 9
for all 2 , and (i; j ) = (13; 11), (14; 12), (15; 11), (16; 12), (11; 17), (12; 18), (11; 10), (12; 10), d( ) d( ) for all d 2 , and (i; j ) = (3; 1), (4; 2), (5; 1), (6; 2), (1; 0), (2; 0), "(1) "(17) , "(2) "(18) ,
0 for all 2 0 [ 1 , f g , g 1.
(i)
(j )
i
j
Using Newman's lemma, we show the on uen e of R3 by observing that all its riti al pairs an be joined by R2. We detail below all the ases of riti al pairs. Ea h of the following riti al peaks of the form s in zero or one step with a rule of R2 (i.e. s ! t):
R3
! t an be joined
`
R3
R2
"(j )
()
R
"(i)
! 0, where R = S ( ) [ P ( ) [ (1 ) [ (2 ), ( ) ( d( ) (x) ! 0, where R = S ( ) [ P ( ) [ 1 [ 2 i;j
i;j
i;j
i;j
R2
) and
i i;j i;j d0 (x) R R2 0 d; d 1 , (i;j ) (i;j ) and d; d0 (j ) d0 (1) R d(i) (1) R2 1 where R = S (i;j ) P (i;j ) 1 2 g (1; z2 ; 1; z4 ; z5 ; z2 ; z4 ; z5 ) R1 f (1; z2 ; : : : ; z8 ) R2 1, and similarly for rule f (z1 ; : : : ; z8 ) 1 R2 su h that one zi = 1, 1 R1 g(1; z2 ; : : : ; z8 ) R2 1, and similarly for any rule g(z1 ; : : : ; z8 ) R2 su h that one zi = 1. i;j
j
2
!
[
[ !
! 2 !
i;j
[
2 1 ,
any
!12
Ea h of the following riti al pairs of the form s two steps with R2 by s ! 0 t: R2
R3
`
! t an be joined in
R3
R2
! "( ), where R = S ( ) [ P ( ) [ (1 ) [ (2 ), R0 = S ( ) [ ( ) [ ( ) , P ( ) [ 1 2 (1 )(x) 0( )(x) ! 2( )(x), where R = S ( ) [ P ( ) [ (1 ) [ (2 ), ( ) [ ( ) , and ; ; 2 , R 0 = S ( ) [ P ( ) [ 1 0 1 2 1 2 h (0); 0(0)i(x) h (1); 0(1)i(x) ! 17(x), h (2); 0(2)i(x) ! 018(x). h (0); 0(0)i(x)
"(j )
i;j
R
"(i)
0
i;j
j
j
R
0
i;j
0
i;j
i;j
i;j
0
0
i
R
i;j
i;j
i;j
0
R
0
i;j
P
P
0
j
0
i;j
0
0
i;j
i;j
i;j
i;j
i;j
0
(1;0)
(1;17) 1
(2;0)
(2;18) 2
2 By Lemmas 6, 7, 8 and 11, there is a redu tion of PCP into the on uen e for the at TRS R1 [ R2.
Theorem 12 The on uen e is unde idable for at TRS. 10
Con lusion We have shown that the properties of rea hability, joinability and on uen e are unde idable for at (and hen e shallow) TRS. This is a big ontrast with the shallow linear ase, for whi h all these properties are known to be de idable in polynomial time [6℄. One an note that all the known de idability results for on uen e on ern
lasses of linear TRS. Two sub lasses of (non-linear) shallow TRS remain out of the s ope of the redu tions onstru ted here: the shallow right-ground TRS { rea hability and joinability are de idable for right-ground rewrite systems [11℄, and, more generally, sub lasses of shallow TRS with synta ti restri tion on the relative o
urren es of variables between left and right members of rules, e.g. shallow TRS su h that a variable with more than one o
urren e in the left member an not o
ur in the right member of a rewrite rule.
A knowledgements The author wishes to thank Ralf Treinen who has arefully read and ommented a preliminary version of this paper, and Harald Ganzinger for his useful suggestions.
Referen es
[1℄ M. Dau het, T. Heuillard, P. Les anne, S. Tison, De idability of the on uen e of nite ground term rewrite systems and of other related term rewrite systems, Information and Computation 88 (1990) 187{201. [2℄ M. Oyamagu hi, The Chur h-Rosser property for ground term-rewriting systems is de idable, Theoreti al Computer S ien e 49 (1) (1987) 43{79. [3℄ A. Hayrapetyan, R. Verma, On the omplexity of on uen e for ground rewrite systems, in: Bar-Ilan International Symposium on the Foundations of Arti ial Intelligen e, 2002. [4℄ H. Comon, G. Godoy, R. Nieuwenhuis, The on uen e of ground term rewrite systems is de idable in polynomial time, in: 42nd Annual IEEE Symposium on Foundations of Computer S ien e, Las Vegas, Nevada, USA, 2001. [5℄ A. Tiwari, De iding on uen e of ertain term rewriting systems in polynomial time, in: G. Plotkin (Ed.), IEEE Symposium on Logi in Computer S ien e, IEEE So iety, 2002, 447{456. 11
[6℄ G. Godoy, A. Tiwari, R. Verma, On the on uen e of linear shallow term rewrite systems, in: H. Alt (Ed.), 20th Intl. Symposium on Theoreti al Aspe ts of Computer S ien e, Le ture Notes in Computer S ien e, Springer, 2003, to appear. [7℄ R. Verma, M. Rusinowit h, D. Lugiez, Algorithms and redu tions for rewriting problems, Fundamenta Informati ae 43 (3) (2001) 257{276, also in Pro . of Intl Conferen e on Rewriting Te hniques and Appli ations 1998. [8℄ H. Ganzinger, F. Ja quemard, M. Veanes, Rigid rea hability, in: Pro . Asian Computing S ien e Conferen e, Vol. 1538 of Le ture Notes in Computer S ien e, Springer-Verlag, Berlin, 1998. [9℄ E. L. Post, A variant of a re ursively unsovable problem, Bulletin of the AMS 52 (1946) 264{268. [10℄ N. Dershowitz, Orderings for term rewriting systems, Theoreti al Computer S ien e 17 (3) (1982) 279{301. [11℄ M. Oyamagu hi, The rea hability and joinability problems for right-ground term-rewriting systems, Journal of Information Pro essing 13 (3) (1990) 347{ 354.
12