This content was uploaded by our users and we assume good faith they have the permission to share this book. If you own the copyright to this book and it is wrongfully on our website, we offer a simple DMCA procedure to remove your content from our site. Start by pressing the button below!
1, be an alphabet. The set of all words over V is denoted by V*, the empty word by A, and V+ = V* \ {A}. Together with the concatenation operation, V+ forms a semigroup, and V* is a monoid with A as its neutral element. For w G V*, the length of w is denoted by \w\, the number of appearances of the • E* /p so t h a t if a = J(ao,tu) for some w G E*, then a^> = uV/°. Let us verify t h a t f : A —>• B is an epimorphisms of DR EX-recognizers. (1) T h e value aip is defined for every a E A since A is connected, and it is also well-defined as a = <J(ao,u) = 6(ao,v) implies u/p = v/p. Moreover, 1, / 6 E m and a £ 4 . If a = S(ao, w), then / B ( a ^ ) = (wfi/p,---,wfm/p) where ( a j , . . ., a m ) = / (a a : 5 —> T a mapping. (1) 4> is a prehomomorphism if and only if it preserves the restricred product and the natural order. (2) (/) is a homomorphism if and only if it is a prehomomorphism which satisfies ief)4> = (e<j>)(f<j>)foralle,feP{S). 1 £ d{f[)-dq,o_f{, f[(xe,i) = « i > n ^ e ( a ; e , i , ^ ' _ i ) G d(fl)-dq>_^J-_i, f((nvle(xg}i, z'^^) = z'i} where q'i_1 is the end state of the path /{ . . . / / _ ! , 1 < i < p. As o(z,) = 0(2,'), using the output-distinguishability property for $ it follows t h a t / ; = /,', 1 < i < p. Hence / { ( x i ) . .. f'p{xv) £ L(P', {x}). As y = z and /,• = / / , 1 < i < p, it follows t h a t y £ L(F", {x}). Consequently the claim made has been proven. D C o r o l l a r y 5.1 Let P = (X,Q,$,F,q0,d,O,o) and P' = (X,Q',$,F',q'0, d,0,o) be two X-machines that are quasi non-deterministic, testing-compatible and output-distinguishable and let t be a test function of P such that P is output delimited with respect to t and U C $ * . If U is a test set of A{P) and A(P') then E(P,t(U)) is an extended test set of P and P'. Proof. See Corollary 4.1. D T h e o r e m 5.2 Let P = (X,Q,$>, F,q0,d,o) and P' = (X,Q' , $ , F',q'0,d,o) be two quasi non-deterministic X-machines that are testing-compatible and outputdistinguishable. If there exists an n natural test function of P for n sufficiently large then there exists a natural extended test set Ie of P and P'. Proof. Let U be a test set of A(P) and A(P'), n the length of the longest sequence in U and I a n n natural test function of P. From Corollary 5.1 it follows t h a t Ie = E(P,t(U)) is an extended test set of P and P'. Since t is n natural, from Definition 5.4 it follows that Ie C X{e}*. T h a t is, the existence of a n natural test function for n sufficiently large will ensure t h a t any path in U can be exercised using as initial d a t a values the head elements of the sequences in Ie. Thus, Ie is a natural extended test set of P and and >fi(Si) C S2. For y? surjective this implies ip(S\) — S2For a signature f2, let Cn and C^ be the (small) categories of f2-algebras and pointed fi-algebras, respectively. In the sequel we shall be mostly concerned with (an)}: 1. (j>{a.i) / e for any i £ {1, • • • ,n}. 2. The statements below hold for any i,j£ {1, • • • ,n}: (i) There exist no j,S £ V* such that j • last( (aj)) • 8 £ Z. (ii) If 4>{ • A by the requirement that ip\A — i A and K =. (\JieK Ti) U A is an ideal o / $ . (P5) > s 0 w e obtain J < (a(3)ip). It follows now by (ii) t h a t S Pi a(3. Next, consider the case when a, (3 G A . It now suffices to show t h a t for any 7 G Tj- such that 7 P; a and 7 Pi /?, we have 7 P,- a/?. We have 7 ^ < a G A " and •yip < (3 £ Au. Since by Theorem 1 (vii), A u is a chain and so the product af3 in A is either a or else (3. T h u s -yip < a/? G A " and so 7 P,- a/3 by (iii). Finally, consider the case when a G T; and /? G A . If ai/? < /? G A " , then by (iii), a P; /? and so the meet of a and (3 is a . If /? < a ^ , then by (ii) we have , aPt 0 implies that aip < 0ip. Proof. Suppose that aP 0. Then for some % G / , we have a,0 G T,- U A. Since <£>|r UA is a homomorphism, it follows t h a t aip < j3tp. T h e l e m m a follows now by induction. • L e m m a 4 For any i G / , let a G T,- and /? £ $ \ T;. Tften a Pt 0 if and only if aip < /fy> G A " . Proof. Suppose t h a t a = 71 P 72 P • • • Pfn = P f ° r some 71, 72, • • • , 7n G $• Since 7 i = a £ r,- and fn = /? ^ T,-, there exists fc with 1 < fc < n — 1 such t h a t 7fc £ Tj- but 7^+1 ^ Tj. But then, since P = U»e/-^»> t n e r e exists j E I with 7fc Pj Jk+i and so 7^,7^+1 G Tj U A. By Theorem 1 (i) and (ii), and the fact t h a t 7fc G r,- D {Tj U A ) , it must be t h a t i = j . Thus 7^+1 G (F,- U A) \ Tt = A , and so yi. Pi jk+i gives fkf < lk+i G A " . We may apply L e m m a 7 to ji P* ji, and 7/j + i P*7„ to obtain 7 1 ^ < -yk¥> < lk+i = lk+i¥> < ~1n or (3 )(/3 into a semilattice. It remains to verify that (PI) through (P5) hold. (PI) and (P2) follow from (Ml), (M2) and (M3). For (P3), suppose that A' ^ 0, and let S G A' and a <£ A1. If a G A", then by Theorem 1 (viii), we have Sa G A'. Suppose now that a G T; for some i G /. It follows from (M3) that aS = (a K = A = A', which is an ideal of $ by the preceding argument. Otherwise, K ^ 0. Let a G $K, 13 G $. If a £ A = A', then a0 G A C $K. Suppose that a <£ A. Then for some i £ K, we have a G F;. If /? £ Ti U A, then by Lemma 7, we have a/3 £ r,- U A C $ # . Otherwise, /? G Fj for some j G / with j ^ i. Since A" = 0, we then obtain by (M4) that a(3 = (aip)((3ip) G A C $K. Finally, it is evident that preserves the product of a G Tj- and /? G Tj for i ^ j follows from (M4). This concludes the proof of Theorem 1. 3 by Theorem 1 (v) and the definition of ip. Case 3: a G r,-, /? G A. By (M3), we have if q(aS] =[9a ^ a ^ = " V < /? = 5/? G A " ^ ' I a y / ? = (ga) $xG|.Fy • x G is completely semisimple, and so the ,7-classes are either groups or else Brandt groupoids, will allow us to utilize Green's l e m m a to coordinatize a 2?-class in terms of pairs of idempotents and a group %-class from the 2?-class. As was observed in ([2], 1.2(iv)), such an %-class is isomorphic to the stabilizer subgroup of the idempotent which determines the %-class. For each a £ $ , let S(a) denote the stabilizer of a. Since there is a natural one-to-one correspondence between Ga x {e} and G/S(a), we may use pairs of elements of G/S(a) rather than pairs of idempotents from J(a,e) for our description of the J^-class J^a,e)As well, for each a £ $ , let Qa be a complete set of (left) coset representatives for G/S(a), with the convention t h a t e represents S(a), and for g,h £ Qa, let Ha' = R{ga,e) H i(ft a ,e)- Finally, let Ja — J(a,e) factor of (a, e). P r o p o s i t i o n 16 For each a £ <£, we have Ha9' Proof. By L e m m a 9 (ii), we have Hi9' ) = G. Thus ( J a ) 2 C Ja U J°"p. Moreover, we had a G F; for some i £ I and so adij gkh~x. The description that we have obtained for these semidirect products shows that they can be easily constructed from very simple components; namely groups and Brand semigroups. We shall illustrate this construction with a simple example. Let r = { a, /?} be a two element chain, with a < /?, and take three copies of T, indexed by the elements of / = Z3 = { 0,1, 2 }, so that we have T{ — {a;, /?,•} with a; < Pi for i £ Z3. For each i, j £ Z3, let 0,-j : I\ —>• Fy be the isomorphism defined by 8ij(cti) = ctj and Sij(Pi) = Pj- Let A be a two element chain as well, say A = { £ , £ } , with S < £, and for i £ Z3, let 9?; : F; —>• A be the constant map with image {C}- Furthermore, let A' = A. It is easily verified that all of the conditions of Theorem 1 are satisfied. Let $ denote the resulting semilattice. The poset diagram of $ is shown in Figure 1.
131 letter a G V in w is denoted by |iu| a . The Parikh mapping associated with V is a m a p \t : V* —> N n such that ^(w) = ( | i u | a i , . . . , | u > | 0 - For a language L C \/*, we define the Parikh set of L by * ( L ) = {#(«;) | to £ I } . Two languages L i , L2 C V* are called better equivalent iff their Parikh sets are equal. For a word w, let Perm(w) denote the set of all words obtained by permuting the symbols of w. For a language L, we define Perm(L) = UwgL P e r r n ( u ; ) . A context-free grammar is a quadruple G = (N,T,P,S), consisting of a nonterminal alphabet N, a terminal alphabet T, N D T — 0, a set of rules P C N x (N L)T)*, and a start symbol S. A string a G (N U T)* directly derives the string /? G (Af U T)*, denoted as a => (3, iff there is a rule A —>• 7 in P such that a = a\Aa^ and /? = 01702. The language generated by G is L(G) = {w G T* I 5 => w } , where =>• denotes the reflexive and transitive closure of =>. For a derivation A in G which applies the rules Pi,P2, • • • ,Pn (in this sequence), the control word of A is defined as c(A) = P1P2 • • .pn. Finally, we define the central concepts of this paper. A (context-free) valence grammar over the monoid M = (M, o,e) is a construct G = (N, T, P, S, M ) , where N, T, S are defined as in a context-free g r a m m a r , i.e., N is the alphabet of nonterminals, T (with T D Af = 0) is the alphabet of terminals, S <= N is the start symbol, and P C N x (N U T)* x M is a finite set of valence rules. For a valence rule p = (A —> a, TO), the rule ^4 —> a is called the core rule of p, while m is called the valence of p. T h e yield relation => over (Af U T)* x M is defined as: (w, m) =>• (u/, m') iff there is a rule (yl —> a, n) such t h a t w = W1AW2, w' = wiaw2 and ml — mon. The language generated by G is L{G) = {w£T* I (5,e)^(u»,e)}. A valence g r a m m a r is called regular or, more specifically, right-linear if all its core rules are right-linear, i.e., they are all of the form A -> wB with A G N, w G T* and 5 G AT U {A}; a valence g r a m m a r is A-free if it has no core rule of the form A —> A. The language families generated by context-free, contextfree A-free and regular valence grammars over M are denoted by £(Val, C F , M ) , £(Val, C F - A, M ) and £(Val, R E G , M ) , respectively. For brevity, let Z ° denote the trivial monoid. Then, £(Val, X, Z°) = C(X) for X G {REG, C F - A, C F } . A (context-free) valence grammar with target set over the monoid M = (M, o, e) is a construct G = (N, T, P,S,M, Mt) such t h a t (N, T, P, S, M) ( = : G') is a valence g r a m m a r and Mt C M. The yield relation =S> is the same as defined above for the valence g r a m m a r G'. Then, let L(G) = {w G T* \ 3m G Mt such t h a t (5, e) =^ (w,m)} be the language generated by G. For type X G { C F , C F - A, R E G } , let C(ValTs,X,M, Mt) be the language family generated by valence g r a m m a r s of type X over M with target set Mt, £ ( V a f r s , X, M , FIN) be the language family generated by valence g r a m m a r s of type X over M with finite target sets, £(Valx.s, X, M , REG) be the language family generated by va-
132 lence grammars of type X over M with regular target sets, and £(ValTS, X, M) be the language family generated by valence grammars of type X over M with arbitrary target sets. A valence grammar (with target set) can be seen as a special case of a grammar with control language, which is a quintuple G = (N, T, P, S, C), where G' = (N, T, P, S) is a context-free grammar and C C P* is the control language. A derivation in G is legal iff its control word is in C. For a valence grammar (with target set), the control language is the set of those words which are mapped by the valence morphism on the neutral element (into the target set). Several other types of control languages have been studied. In a grammar with regular control, the control language is regular. In a grammar with permuted regular control, the control language is the permutation of a regular language. In a matrix grammar, the control language has the form M* where M C P* is a finite set of control words which are called matrices. In an unordered vector grammar, the control language has the form Perm(M*) where M C P* is finite. The families of languages generated by grammars with regular control, grammars with permuted regular control, matrix grammars, unordered vector grammars, respectively, of type X £ {CF, CF - A, REG} are denoted by C{vG,X), £(prC,X), C(M,X), C(VV,X), respectively. It is well-known that C{vC,X) = £{M,X) and £(\JV,X) = £(Val,X,Q+) [2]. In what follows, we show that, additionally, £(prC, X) = £(UV, X) (as conjectured by Jantzen [8]) and that £(rC, X) coincides with the family of languages generated by valence grammars over finite monoids with target sets. 3 3.1
Results General Properties
We start with some results on valence grammars with target sets over arbitrary monoids. Completely analogous to the case of valence grammars [4], we may conclude the following three theorems, which we therefore mention without proof: T h e o r e m 3.1 Let M = (M, o,e) and M ' be isomorphic monoids. Then, for X £ { R E G , C F - A , C F } , £(Val T S ,X, M) = £ ( V a l T s , * , M ' ) . Similar equalities are true for £(Val T S , X, M, Y) ifY G {FIN, REG} U {Mt \ Mt C M } . T h e o r e m 3.2 Let M = (M,o,e) be an arbitrary monoid, and let ^"(M) be the family of finitely generated submonoids of M. For X 6 {REG, CF — A, CF},
jC(Va,\TS,X,M)=
(J M'e^(M)
C(ya\TS,X,M').
133
Similar equalities are true for L(ValTS,X,M,Y) Mt C M}.
if Y £ {FIN, REG} U {Mt \
T h e o r e m 3.3 For each monoid M = (M, o,e) and each X £ {REG,CF — A, CF}, the class £(ValTs, X, M) is a semi-AFL which is full in the cases X — REG and X = CF. Moreover, £(ValTs,^>M) is closed under substitution by £{X)languages. Similar results are true for £(Vafrs, X, M, Y) if Y £ {FIN, REG} U {Mt | Aft C M } . We are now going to compare the generative power of valence grammars with and without target sets. From definition, the following lemma easily follows: L e m m a 3.4 For any monoid M and X £ {REG, CF - A, CF}, £(Val,X,M) C £ ( V a l T S , X , M , F I N ) C £(Va\TS,X,
M,REG)
C £(ValTS,X,M). In the sequel we discuss under which circumstances, i.e., for which monoids, some of the above inclusions turn into equality and in which cases we have a strict inclusion. We start by showing that regular target sets do not improve the power of valence grammars over groups. T h e o r e m 3.5 Let M be a group and X £(Val, X, M) = £(Val T 5 , X, M, REG).
£ {REG, CF - A,CF}.
Then,
Proof. Let G = (N,T, P, 5, M, Mt) be a valence grammar with target set, let R C X* a regular language, and
^B',<j>'(w)) \A',B'
->wB' £ P1} U
£N',weT*,A'
U{{A' -> S,
->we
P'}.
Obviously, a valid derivation in G' has the form (5", e) => (S, r') => (w, e) where r' £ 4>'{R!) = { r - 1 | r £ cj)(R)}. Hence, (w,e) is derivable in G' iff, for some r £ Mt, (w,r) is derivable in G, i.e., L{G) = L(G'). •
134
3.2
The Control Groups Zk
As regarding (classical) valence grammars, the groups 7Lk are the best investigated control monoids. There is also a simple algebraic reason for the importance of this class of regulation monoids: due to the Fundamental Theorem for finitely generated Abelian (i.e., commutative) groups [11], any finitely generated commutative group is isomorphic to some group M x Zfc, where k > 0 and M is a finite commutative group. We shall discuss this important case in detail for the extension to target sets, too. Firstly, the following can be shown as in [4] based on the Fundamental Theorem for finitely generated Abelian groups: Theorem 3.6 Let M = (M, o, e) be a commutative monoid and X £ {REG, C F - A , CF}. Then, the class £ T S ( V a l , X , M ) equals either £ T s(Val, A",Q+) or C-TS(Val, X, ~Lk) for some k > 0. Similar equalities are true for £(Valj-5,.Y, M, Y) if Ye {FIN, REG} U {Mt \MtCM}. We need the following observation on regular subsets of 7Lk: Proposition 3.7 The regular subsets ofZk are the semilinear sets over Zfc, i.e., finite unions of sets of the form m
{v"0 + ^
aiVi | v"0,Vi £ 7Lk, at £ N, 1 < i < m}.
As an immediate consequence, we can prove the conjecture of Jantzen [8] regarding grammars with permuted regular control languages. Theorem 3.8 For X £ {CF, CF - A, REG}, £(prC,.Y) = £(Val, X,Q+) =
£(UV,X). Proof Let G = (N, T, P, S, Perm(R)) be a grammar with permuted regular control language, where R C P* is regular. Let k be the cardinality of P and \P : P* —)• 7Lk be the Parikh mapping. Obviously, a control word is in Perm(-ff) iff its Parikh vector is in ^{R)- The valence grammar with target set G" = (N,T,P',S,Z,k,y(R)) with P' = {(p,\P(p)) | p £ P} permits the same control words as G and thus generates the same language. By Theorem 3.5, there is an equivalent valence grammar H over Z*, and we have shown that £(prC,X) C £(Val, X, Q+). The other inclusion has been observed in [8]. • Theorem 3.9 For X £ {REG, CF - A, CF}, k > 1, and any non-regular subset Mt C Zk, £(Val, X, Zk) = £(Val T S , X, Zk, REG) C £(Val T 5, X, Zk, Mt).
135
Proof. Let Xj, be the alphabet Xk — {a\,... valence grammar with target set G = ({S},Xk,P,
, ak, b\,... , &/.}. Consider the S, Mt) with
P = {(S -> a i , el), (5 ->• 6,-, - e l ) , {S -> A, 0) | 1 < : < k}. Obviously, L[G) =
\ n > l}k+1
is not in
\ n > 1}* is not in £(Val T S , C F , Q + ) .
Proof. The proof of Vicolov showing that L/. is not in £(Valys, CF, Zfc) [13] does also hold for valence grammars with target sets. If Lt could be generated by a valence grammar with target set over Q+, then L* would be in £(Val T 5 ,CF,Z f c ), for some k. As Lk = L» n (a*b*c*)k+l and £(Val T S , CF, Zk) is closed under intersection with regular languages, we obtain a contradiction.
• Theorem 3.11 For k > 1 and any target set Mt C Zk, £(Val T S , CF, Zfc, Mt) = C{Va\TS,CF-\,Zk,Mt) Proof. In [4] it is shown that, for any context-free valence grammar G — (N,T, P,S,Xk), one can construct a context-free valence grammar G' = {N',T,P',S',Zk) without erasing rules such that (S",0) ^>G. {w,f} iff (S, 0) ^>G (w,r), for any w £ T+ and any f G 7Lk. By exactly the same construction we obtain, given a context-free valence grammar H with target set Mt, a A-free valence grammar H' with target set Mt such that L(H') = L(H) \ {A}. Finally, if L(H) contains the empty word, one can add a rule generating in one step (A, r), for some r £ Mt. However, note that in general it cannot be effectively decided whether H generates the empty word. • It remains open whether a Chomsky normal form exists for valence grammars over 7Lk with target sets. Anyway, it can certainly not be effectively constructed. Maybe, the algebraic view presented in [6] is helpful here. Summarizing our results, we obtain (see also [13,4]):
136
Corollary 3.12 For k > 1, we have 1. £(Val, CF, 7Lk) = £(Val T s, CF, Zfc, REG) C £(Val T s, CF, Z*), 2. £(Val T S , CF - A, Zk, Mt) = £(Val T s, CF, Zk, Mt) for any Mt C Zfc, 5. £(Val T s,CF,Z*,M t ) C £(ValTS,CF,Z* + 1 , Mt) for any Mt C Zfc. 4. For 1 < j < k, £(Va,\TS,CF,Zi)
and £(Val, CF,Z fe ) are incomparable.
5. £(UV,CF) = £(Val,CF,Q+) = (J£=i £(Val,CF,Z*). 6. £(Val T 5 ,CF,Q+) = [J™=l
77ie CWro/ Monoids N*
In the case of valence monoids, the restriction to acceptance by the neutral element is quite severe. In particular, valence grammars over NA make no sense, and valence grammars over finite monoids can be reduced to valence grammars over finite groups [4]. We discuss the power of target sets for these specific cases in this and the next subsections. Valence grammars over Nk have been discussed by Hoogeboom [6], who showed that valence grammars over Z f c _ 1 are equivalent to valence grammars over NA with the specific target set { ( n , . . . , n) | n £ N}. We extend this result by showing that valence grammars over 7Lk~l are equivalent to valence grammars over N^ with regular target sets. To obtain the result, we give characterizations of £(Val
Zk~l).
137
Proof. By Parikh's theorem, LA is the permutation of a regular language. In [4], we have mentioned that permutation over E/j is a valence transduction" over 7Lk. However, a valence transducer over 7Lk~l is sufficient and works as follows. Let t>(a,-) = ei_i, for 2 < i < k, and v(ai) = 0. In each transduction step, an input symbol x is replaced by an output symbol y, the valuation of this step is v{x) — v{y). A value of 0 is obtained iff, for any 2 < i < k, the output contains as many appearances of a,- as the input. Since the output has the same length as the input, this is the case iff the output is a permutation of the input. Hence, LA is the image of a regular language under a Zfc_1-valence transduction. Thus, we can conclude that LA G £(Val, R E G , ^ " 1 ) . • T h e o r e m 3.15 For
k>l,
£(CF) = £(Val, CF, Nk) = £(Val T S , CF, N*, FIN) C £(Val T s,CF,N*,REG) = £(Val, CF,Z*) C£(Val T S ,CF,N f c ). Proof. For a single target element v G Nfe, we can give the following pair construction to show that £(CF) = £(Val T S , CF,N fc , v). Let G- (N,T,P,S,fik,{v}) be given. Let N' = N x {u G Nfe | u < v}, and define the monoid morphisms h : [N' U T)* -> {N U T)* and <j> : (N1 U T)* ->• N'8 by h((A, u)) = A for {A, u) G N', h(a) = a for a G T, <j>({A, u)) = u, (A, u) G N', <j>(a) = 6,a£T. The equivalent context-free grammar is G' = (N',T, P', (S, v)) with P' = {A' -)• a' | (h(A') -)• / i ( a ' ) X ^ ' ) - ^(a')) G P } . To prove the correctness of the construction, it can be shown by induction on the length of the derivation that (A,u) =>G' W, f° r {A,u) G N',w G T*, iff (^,0) 4>G (w,u). Now, the claim £(CF) = £(Val T S , CF,N fc , FIN) follows, as L((N,T,P,M,Mt))=
(J
L((JV,r,P,M,{z}))
ceAft
for any monoid M and any target set Mt, and as the family of context-free languages is closed under union. Finally, the inclusion £(Val T 5 ,CF,N f e ,REG) C £ ( V a l T S , C F , Z ' ! - 1 , REG) follows from Theorem 3.13 and Lemma 3.14, while the opposite inclusion was shown in [6]. Q °For precise definitions of valence transducers, we refer to [4].
138
3.4
Finite Control Monoids
We finally prove that valence grammars with target sets over finite monoids are as powerful as matrix grammars, correcting an error in Theorem 5 in the conference paper [3], where we incorrectly claimed that valence languages over finite monoids (with the neutral element as target) characterize the corresponding class of matrix languages; we also refer to [4]. Theorem 3.16 For the class of finite monoids F M and X £ {REG, CF — A, CF}, we obtain U M 6 F M £(Val T s, X, M) = £(rC, X). So, UMeFMAValTS.REG.M) = £(REG). Proof. Let M = (M, o,e) be some finite monoid, and let G = (N, T, P, S, M, Mt) be a valence grammar with target set over M. One can easily construct a finite automaton „4M accepting mirn^ . . . mk 6 M iff mi o m? o . . . o mk £ Mt, and starting with , 4 M , a finite automaton AG accepting TT £ P* iff the multiplication of the monoid elements appearing in w (in that order) yields some target element from Mt. The equivalent grammar with regular control is
G' =
(N,T,P,S,L(AG)).
Conversely, let G = (N,T,P, S,R) be a grammar with regular control. Let A — (Z, P, zo,6, F) be the deterministic finite minimal automaton accepting R. Consider now the syntactic monoid M of R and the natural bijection ^ mapping M onto Z. Let Mt := tf-^F). G' = (N,T,P,S,M,Mt) is a valence grammar with target set satisfying L(G) = L(G'). • Furthermore, observe that £(Val T 5 ,A:,M) = £(Val T s,X,M,FIN) = £(Val T S ,X, M, REG) for any finite monoid M. The characterization given in Theorem 3.16 allows us to show the strict inclusion of the trivial relation presented in Lemma 3.4. Theorem 3.17 For the class of finite monoids F M and X £ {CF - A, CF},
(J
£(VaI,A-,M)C
M€FM
(J
jC(Va\Ts,X,M).
MgFM
Proof. Let M be a finite monoid. Consider a context-free valence grammar G = (N, T, P, S, M). According to Lemmas 4.7 and 4.10 of [4], we may assume, without loss of generality, that M is a finite group. Then, [4, Theorem 4.11] implies that L(G) satisfies a context-free pumping lemma. Especially, there is no finite monoid M such that L :={anbncn
| n > 0 } £ £(Val, CF, M).
139
On the other hand, [2, Example 1.1.1] shows that L <E C{rC,X). rem 3.16 shows the claim.
4
Then, Theo•
Conclusion
In this paper, we introduced valences with target sets in context-free and regular grammars and discussed their relation to the corresponding classes of valence grammars. We focussed on finite valence monoids and the groups 7Lk as valence monoids. It is certainly of interest to discuss the control monoids Zfe and N* with specific classes of (non-regular) target sets. It might be interesting to discuss other monoids, as well. Finally, it could be interesting to review some concepts like subregular control as considered in [1] since they (also) extend the class £(Val, CF, Q+), which is also possible with the target set mechanism discussed in this paper. References 1. J. Dassow, Subregularly controlled derivations: context-free case, Rostock, Mathematisches Kolloquium, 34 (1988), 61-70. 2. J. Dassow, Gh. Paun, Regulated Rewriting in Formal Language Theory, volume 18 of EATCS Monographs in Theoretical Computer Science, SpringerVerlag, Berlin, 1989. 3. H. Fernau, R. Stiebe, Regulation by valences, in Proc. of MFCS'97, LNCS, 1295, 1997. 4. H. Fernau, R. Stiebe, Sequential grammars and automata with valences, Technical Report WSI-2000-25, Universitat Tubingen (Germany), Wilhelm-Schickard-Institut fur Informatik, 2000. To appear in Theoretical Computer Science. 5. H. Fernau, R. Stiebe, Valuated and valence grammars: an algebraic view, Proceedings of DLT 2001, 2001, to appear. 6. H. J. Hoogeboom Context-free valence grammars-revisited, Proceedings of DLT 2001, 2001, to appear. 7. J. E. Hopcroft, J. D. Ullman, Introduction to Automata Theory, Languages, and Computation, Addison-Wesley, Reading (MA), 1979. 8. M. Jantzen, A note on vector grammars, Information Processing Letters, 8 (1979), 32-33. 9. Gh. Paun, A new generative device: valence grammars, Rev. Roumaine Math. Pures Appi, 25, 6 (1980), 911-924. 10. V. Red'ko, L. Lisovik, Regular events in semigroups (in Russian), Problems
140
of Cybernetics, 37 (1980), 155-184. 11. J. J. Rotman, An Introduction to the Theory of Groups, Springer-Verlag, New York, 5th edition, 1995. 12. A. K. Salomaa, Formal Languages, Academic Press, New York, 1973. 13. S. Vicolov, Hierarchies of valence languages, Developments in Theoretical Computer Science (J. Dassow, A. Kelemenova, eds.), Gordon and Breach, 1994, 191-196.
141
ON ISOMORPHIC REPRESENTATIONS OF M O N O T O N E TREE A N D N O N D E T E R M I N I S T I C TREE AUTOMATA
FERENC GECSEG, BALAZS IMREH Department Arpdd E-mails:
of Informatics, University of Szeged ter 2, H-6720 Szeged, Hungary gecseg/imreh@inf .u-szeged.hu
In this paper, the monotone tree and nondeterministic tree automata are studied. First, the isomorphically complete systems of tree automata for the class of monotone tree automata are characterized with respect to the ao-product. Then it is proved that every monotone nondeterministic tree automaton can be embedded into a suitable a o - P o w e r of a monotone nondeterministic tree automata of three states. Finally, it is shown that there is no isomorphically complete system for the class of monotone nondeterministic tree automata with respect to the ao-product which consists of two-state monotone nondeterministic automata.
1
Introduction
Comparatively, there are a few results on the isomorphic representations of tree and nondeterministic tree automata. In [10], the isomorphically complete systems of tree automata are characterized with respect to the general product. The notion of the a,-product introduced in [2] is generalized for tree automata and the isomorphically complete systems are characterized with respect to the ai-products in [5]. The isomorphic representations of the elements of particular classes of tree automata is initiated in [6], where the isomorphic representations of nilpotent tree automata are studied with respect to the a,-products. Another particular class, the class of definite tree automata is investigated in [1], where it is proved that every definite tree automata can be embedded into a suitable ao-power of a two-state definite tree automata. The isomorphic representations of nondeterministic tree automata is initiated in [4], where the isomorphically complete systems are described regarding the general product. For the a;-products, the isomorphically complete systems of nondeterministic tree automata are characterized in [8]. In this work, a further particular class of tree and nondeterministic tree automata are studied, namely, the classes of monotone tree and nondeterministic tree automata. The paper is organized as follows. In Section 2, we recall a few notions and notation necessary in the sequal. Section 3 deals with the monotone tree automata, and the isomorphically complete systems for this class are characterized with respect to the ao-product. Section 4 is devoted to the isomorphic representations of monotone nondeterministic tree automata. First, an isomorphically
142
complete system, consisting of monotone nondeterministic tree automata with tree states, is presented regarding the ao-product. Then it is proved that there is no isomorphically complete system for this class with respect to the ao-product which consists of two-state monotone nondeterministic tree automata. 2
Preliminaries
In what follows, we shall use some particular equivalence relations. For their definition, let A be a nonempty set. For an arbitrary pair a, b £ A, let us denote by 0(a, b) the equivalence relation defined as follows. For every u, v £ A, uQ(a,b)v
if and only if u = v or {u,v} = {a,b}.
By a set of operational symbols we mean a nonvoid union E = Eo U Ei U ..., where E m , m = 0 , 1 , . . . , are pairwise disjoint sets of symbols. For every m > 0, E m is called the set of m-ary operational symbols. It is said that the rank or arity of a symbol a £ E is m, if
143 t h a t under R = {1} the relation < is the reachability relation and we obtain the notion of the monotone ordinary a u t o m a t a in this particular case. For every rank-type R, let us denote by MR the class of all monotone tree a u t o m a t a with rank-type R. T h e next statement can be easily proved. L e m m a 1. If A is a monotone tree automaton of A, then B is monotone as well.
and B is a homomorphic
image
T h e nondeterministic tree a u t o m a t a can be introduced as generalized tree a u t o m a t a in which the operations are replaced by relations. Since the notions are not unique, we recall here the notions and notation necessary in the sequal. By a set of relational symbols we mean a nonvoid union £ = E i U £2 U .. ., where the sets E m , m = 1 , 2 , . . . are pairwise disjoint. E m is called the set of m-ary relational symbols. T h e rank or arity of a symbol a £ E is m if a £ E m . Let a set E of relational symbols be given. It is said t h a t a set R of positive integers is the rank-type of E if for every integer m > 1, E m ^ 0 if and only if m £ R- Now, let E be a set of relational symbols with rank-type R. By a nondeterministic H-algebra A we mean a pair consisting of a nonempty set A of the elements of A and a mapping t h a t assigns to every relational symbol a £ E an m-ary relation <xA C Am, where the arity of a is equal to m.
n=
{ain, . .
.,am_i/j,)aB
144 holds for every m £ R, a £ E m , and a\,... . a m _ i € A In this case, it is said t h a t B is a homomorphic image of A. If a homorphism is one-to-one, then it is called an isomorphism of A onto B . Then it is said t h a t A and B are isomorphic. If A has a s u b a u t o m a t o n C such t h a t B and C are isomorphic, then we say t h a t B can be embedded into A . For every equivalence relation 0 on A, one can define a factor n.d. tree a u t o m a t o n of A = (A, E) as follows. If 1 G R, then for every a £ E i , let aA'@ = { 0 ( a ) | a G A and
( 6 i , . . . , 6 m _ 1 )
It is important to note t h a t A / 0 is not a homomorphic image of A in general. The montone n.d. tree a u t o m a t a can be defined in a similar way as the monoton tree a u t o m a t a . Let A = (^4,E) £ fi/j be an arbitrary n.d. tree aut o m a t o n . Let us define the binary relation K on A as follows. For every a, 6 G A, anb if and only if a = b or 6 G ( a i , . . . , a , _ i , a, a ; + i , . . . , a m _i)
I s o m o r p h i c C o m p l e t e n e s s for
image of A, then B G TR as
MR
A product family, the a;-product, i = 0 , 1 , . . . , was introduced in [2]. T h e first member of this family is the ao-product which is the serial connection of aut o m a t a . T h e notion of the ai-product is generalized for tree a u t o m a t a in [5], where the isomorphically complete systems of tree a u t o m a t a with respect to the aj-product are characterized. We recall here the notion of the ao-product of tree automata. Let i J b e a rank-type, A = (A,E) G UR and Aj = (Aj,^^) £ UR, j = 1 , . . . , n arbitrary tree a u t o m a t a . Moreover, let
x E
m
4 E ^ } , m £ R, 1 < j < n.
145
It is said that the tree automaton A is the ao-product of Aj, j = 1,.. ., n with respect to ip if the following conditions are satisfied:
(i) A = nuAi> (2) for all me R, (an, • • •, aln), •. •, (aml,...,
amn) G (Ai x • • • x An),
a ((an, • • •, a in), • • •, (ami, • • •, amn)) — (af1 ( a n , . . . , a m i ) , . . . , o-£n(aln,...,
amn)),
where
Cj —
l,...,n.
In particular, if the component tree automata Aj are equal, say Aj = B, j = 1 , . . . , n, then it is said that the ao-product A is an ct^-power of B. The next assertion expresses the following obvious fact. If two serial products of tree automata are connected in a serial way, then the new network is also a serial product of the original tree automata. L e m m a 3. If the tree automata A\ and Ai can be embedded into the ao-products n " - i -4i(^> (f) and Ylj=i •4n+j(£'i f ' ) , respectively, and a tree automaton B can be embedded into an ao-product of A\ and A2, then B can be embedded into an ao-product of the tree automata Ai,l = l,...,n+k. Let R be an arbitrary rank-type. A system M C UR of tree automata is called isomorphically complete for MR with respect to the ao-product if every tree automaton in MR can be embedded into an ao-product of tree automata in M. We need a particular monotone tree automaton belonging to the given rank-type. By the tree elevator belonging to the rank-type R we mean the tree automaton £R — ({0,1}, HE) defined as follows. For every m £ R, S m = {(rmo, Cmi}• Moreover, for every m-dimensional binary vector u, SRI \ - / ° "moW I :
ifu = 0, otherwise,
<#i(u) = l In particular, if m = 0, then a0Q = 0 and cr0f = 1. It is obvious that 8R £ MR. Regarding the isomorphic completeness, the following statement holds. T h e o r e m 1. A system M C UR of tree automata is isomorphically complete for MR with respect to the ao-product if and only if M contains such a tree
146 automaton A that SR can be embedded into an ao-product of A with a single factor. Proof. If R = {0}, then the statement is obviously valid. Let us suppose now that R ^ {0}. To prove the necessity of the condition, let us assume that J\[ is isomorphically complete for MR with respect to the ao-product. Since SR € MR, there are tree automata A\, • • • ,An £ A/" such that SR can be embedded into an ao-product \\j=\ AJC^B, f)- Let yu denote a suitable isomorphism, and let 0/i = (aoi,cto2, • • • >a0n),
lfi=
(an,ai2,...,ain)-
Let k denote the least positive integer for which aofc ^ a\k- Then it is easy to see that £R can be embedded into an ao-product of Ak with a single factor. In order to prove the sufficiency of the condition, let us suppose that Af contains such an automaton A that SR can be embedded into an ao-product of A with a single factor. Then, by Lemma 3, it is sufficient to prove that any automaton in MR can be embedded into an ao-power of SR. We prove this statement by induction on the number of states. It is obvious that if A = (A, 12) £ MR with \A\ < 2, then A can be embedded into an ao-product of SR with a single factor. Let n > 2 be an arbitrary integer, and let us assume that the statement is valid for every monotone tree automaton having n states. Now, let A = (A, E) G MR with \A\ = n + 1. Since A is monotone, (A, <) is a partially ordered set. We distinguish two cases depending on the number of the maximal elements of (A, <). Case 1. (A, <) has only one maximal element denoted by d. It is worth noting that this holds if E m ^ 0 for some m > 2. Indeed, if c,d G A would be two different maximal elements, then c,d < a£(c,d,.. .,d) would be valid contradicting the maximality of c and d. Since d is the only maximal element in (A, <) and \A\ > 3, there is at least one maximal element in (A \ {d}, <) which is denoted by c. Since A is monotone, 0(c, d) is a congruence relation of A, and therefore, A/Q(c, d) is a homomorphic image of A. Now, let Q = {c, d} and let us define the a 0 -product A/Q{c, d) x ) as follows. For every m G R, and (v1,...,vm) G(,4/e(c,d))m,let
^ r n 2 ( » l , • • -,Vm,Crm)
=
147 if Vi = {di} C A \ Q, i = 1 , . . . , m and aA(ai,..., a m ) = d or u^ = . . . = uifc — Q for some 1 < i\ < ii < ... < ik < rn, vt = {at}CA\Q, t £{l,...,m}\{ii,...ik} and c m ( a i , . . . , a , j _ i , c , a ; 1 + i , . . . , a,-fc_i, c, a i t + i , . . . , a m ) = d crmo otherwise. Let us define the mapping \x : A —> A/Q(c, d) x {0,1} by a\x = ({a},0), for all A\Q, cn = {Q,0), dn={Q,l). ami
Then it is easy to check t h a t fi is an isomorphism of A into the ao-product under consideration. Now, Lemmas 1 and 3 and the induction hypothesis result in t h a t A can be embedded into an ao-power of £ R . Case 2. (A, < ) has at least two maximal elements which are denoted by c, d. In this case, E = Eo U E i . Let Q = {c, d} again. Since both c and d are maximal elements, 0 ( c , d) is a congruence relation of A. Let us define the ao-product A/Q(c,d) X £ R ( E , ( £ > ) as follows. For every
^ uoo /
\
if CTQ4 =
d,
else,
f ""ii
if i> = {a} C ^4 \ Q and cr^fa) = d,
l_ CTJO
otherwise.
Let us define the mapping n : A —>• A/Q(c, afi=
({a},0), for all
cti =
{Q,0),
dji=
(Q,l).
d) x {0,1} as follows:
A\Q,
It is easy to see t h a t fx is an isomorphism of the tree a u t o m a t o n A into the aoproduct A/Q(c, d) x £ R ( E , y>), and therefore, Lemmas 1 and 3 and the induction assumption yield t h a t A can be embedded into an ao-power of SR. This ends the proof of Theorem 1. • In particular, if R = {1}, then we obtain the following characterization of the isomorphically complete systems for the class of the monotone a u t o m a t a with respect to the ao-product.
148 C o r o l l a r y 1. A system AI' of monotone automata with such an automaton A that product of A with a single
4
of automata is isomorphically complete for the class respect to the ao-product if and only if Af contains the ordinary elevator can be embedded into an aofactor.
Isomorhic R e p r e s e n t a t i o n of n.d. Tree A u t o m a t a
T h e notion of the aj-product is generalized for n.d tree a u t o m a t a in [8], where the isomorphically complete systems of n.d. tree a u t o m a t a with respect to the a,-product are characterized. We recall here the notion of the ao-product of n.d. tree a u t o m a t a . Let R be a rank-type, A = (A, E) G £lR and A j = (Aj,E^) G QR, j = l , . . . , n arbitrary n.d. tree a u t o m a t a . Moreover, let
(i) A =
of Aj,
l<j
\rJ=1Aj,
(2) for every m G R, a £ E m , and {an,... ( ( a n , . . . , a\n),
, a i „ ) , . . ., ( o m - 1 , 1 , . . . , a m _ i | n ) G (A\ x • • • x . . . , (flm-1,1] • • • , « m - l , n ) ) c
( a n , . . . . a m - i ^ o - f - 1 x • • • x (aln,.. Cj =
An),
=
., a m _ i | f l ) ( T ^ " , where
• • • , O l J - l ) , • • -i («m-1,11 • • • . " r a - l j - l ) , " ' ) , j = 1,. .
-,n.
In particular, if the component n.d. tree a u t o m a t a A j are equal, say A j = B , j = 1 , . . . , n, then the ao-product A is called an ao-power of B . The next statement can be obtained directly from the definitions. L e m m a 4 . If the n.d. tree automata A i and A? can be embedded into the aoproducts fliLi A j ( E , f) and Y\j=i •^•n+j('^', f ' ) , respectively, and an n.d. tree automaton B can be embedded into an ao-product of A\ and A2, then B can be embedded into an ao-product of the n.d. tree automata A;, / = 1,... ,n+ k.
149
Let R be an arbitrary rank-type. A system A C CIR of tree automata is called isomorphically complete for TR with respect to the ao-product if every n.d. tree automaton in TR can be embedded into an ao-product of n.d. tree automata in A. We use a particular n.d. monotone tree automaton B = ({0,1,2},!!) which is defined as follows. For every positive integer m £ R, let E m = {o-m,{o,i},crm,{o,2},crm,{o,i,2}}- Furthermore, if 1 £ R, then let a
'U 1 , {o0., i1)}
= {M},
ffr B
2 uo,2l 1,{0,2} = {°> },
I
1 2 r ""l,10,1,2) l,{0,1,2} = { 0 . - } -
Moreover, for every 1 < m £ R and u £ {0,1, 2 } m 1, let {0,1}
ifu = 0,
{2}
otherwise,
m , { 0 , l } ~~ <(o,i= W ifo/ue^ir1, ;
_/{0,2} B m,{o,2} - I | 2 }
ucr
{0,1,2} u <7 m(, o{ 0,, li, .2 )2 )_H { M l {2}
ifu = 0, otherwise,
ifu = 0, ifO^uG^,!}—1, otherwise.
It is easy to check that B is a monotone n.d. tree automaton. Now, we are ready to present a sufficient condition of the isomorphic completeness for TR with respect to the acrP r oduct of n.d. tree automata. T h e o r e m 2. A system A C Q,R is isomorphically complete for TR with respect to the ao-product, if A contains such an n.d. tree automaton A that B can be embedded into an ao-product of A with a single factor. Proof. By Lemma 4, it is sufficient to prove that any n.d. tree automaton in TR can be embedded into a suitable ao-power of B. We prove this statement by induction on the number of states. It is esay to show that if A = (A, E) £ TR and |J4| < 2, then A can be embedded into a suitable ao-power of B with a single factor, namely, A is isomorphic to the subautomaton of this ao-power which is determined by the subset {1,2}. Now, let n > 2 be an arbitrary integer and let
150 us suppose t h a t the statement is valid for every monotone n.d. tree a u t o m a t a having n states. Let A = (A, S) G TR with \A\ — n+ 1. Since A G TR, (A, < ) is a partially ordered set. We distinguish two cases again depending on the number of the maximal elements of (A, <). Case 1. (A,<) has only one maximal element. We note t h a t this case holds whenever E m ^ 0 for some 2 < m G R- Let us denote this maximal element by d. Since \A\ > 3, (A \ {d}, < ) contains at least one maximal element denoted by c. Set Q = {c, d}. Obviously, A / 0 ( c , d) £ r ^ . Let us define now the a 0 - p r o d u c t C = A / 6 ( c , d) x B ( E ,
{
if ^i,{o,i} o-AC\Q= {c}, 0"i,{o,2} ifcrAnQ={d}, "•l,{0,1,2} otherwise. Furthermore, for every 1 < m G R, cr G E m , and ( { a i } , . . . , { a m _ i } ) G (A \ Q)m'\let
( o-m,{o,i} < crm, {0,2} [ cm,{0,1,2}
=
if ( a i , . . . , a m _ i ) c r A f l Q = {c}, if ( a i , . . . , a m _ i ) < r A n Q = {d}, otherwise.
Finally, let 1 < m 6 i?, cr £ E m , and vu ...,vm_1
e (A/e(c,d))m-1
\(A\Q) m — 1
Then there exist integers 1 < ii < i-2 < . . . < i* < m — 1 such t h a t Vj = {cij} C A \ Q if j G { 1 , . . -,m - 1} \ {z'i,.. . , 4 } , moreover, V(t = Q, t = 1,.. .,k. Let ( a x , . . . j O j i - ^ c , a,- 1+ i . . . , a j t _ i , c , a , k + i , . . . , a m _i)
= P.
Furthermore, let
V? m 2 (vi,. • .,vm-i,a)
|V m ,{o,i} ifPng={c}, = < 0"m,{o,2} if PnQ - {d}, [
Let us define the mapping fx of A into A / 0 ( c , d) x { 0 , 1 , 2} as follows:
151 a[i — ({a},0), for all a G A \ Q, c/i = ( Q , l ) , dii=(Q,2). Let 5 denote the set {({a},0) | a £ ,4 \ Q} U {(Q, 1), (Q, 2)}. We prove t h a t fi is an isomorphism of A onto the s u b a u t o m a t o n of C which is determined by the subset S. If 1 G R and cr G S i , then by distinguishing three cases depending on the elements of the intersection crA flQ, it is easy to see t h a t aAfi
= acC)S=
(
Now, let 1 < m G R, cr G E m , ( a i , . .. , a m _ i ) G A We have to prove the validity of the following equality: (i)
D S. be arbitrary elements.
( a i , . . . , a m _ 1 ) c r A p = (ai/x,. . . , a m _ i / i ) < r c n 5.
For proving (i), two subcases are distinguished. Subcase 1. ( a i , . . ., a m _ i ) G (^4 \ < 5 ) m _ 1 . Then one can easily check t h a t for any of the four further cases, which depend on the elements of the intersection ( a i , . . . , a m _ i ) c r A D Q, equality (z) is valid. Subcase 2. ( a i , . . . , am-i) G A m _ 1 \ (A \ Q)"1'1. In this case at G {c, d} for some i G { l , . . . , m — 1}. Since A is monotone, this fact implies t h a t ( a i , . . . , a m _ i ) < r A C {c, d } . Now, distinguish two cases, depending on if d is contained in the set { a i , . . . , a m _ i } or not, it is easy to check again t h a t (i) is valid in both further cases considered here. Summarizing, we have t h a t (i) holds for every m G R, cr G S m i and ( a i , . . . , a m _ i ) G A " 1 - 1 , i.e., /i is an isomorphism. Thus, L e m m a 4 and the induction hypothesis result in that A can be embedded into an ao-power of B in Case 1. Case 2. (A, < ) has at least two maximal elements. Then E = E i U £ 2 . Let us denote by c and d two different maximal elements of (^4,<), and let Q = {c, d}. Obviously, A/Q(c,d) is monotone. Let us define the ao-product D = A / 0 ( c , d) x B ( £ , ip) as follows. For every a G £ 1 , let (
ipu{cr) = cr,
Furthermore, for every
if aAf)Q=
{c},
if o"A n Q = {d}, otherwise.
d) \ {Q}, let
152
f22({v},a)
r<7 2 , { o,i } = I
if{v)crAnQ = {c}, if (v)aA n Q = {d}, otherwise.
Finally, let
^22(<5,Cr) = 0"2,{O,1}Let us define the mapping fi of A into A/Q(c,
d) x { 0 , 1 , 2} as follows:
ap. = ({a}, 0), for all a £ A \ Q, c\i =
(Q,l),
dfi=(Q,2). Let S = {{a} | a £ A \ Q} U {(Q, 1), (<5, 2)}. Then it is easy to prove t h a t p. is an isomorphism of A onto the s u b a u t o m a t o n of D which is determined by S. Then, L e m m a 4 and the induction assumption yield t h a t A can be embedded into an ao-power of B . This ends the proof of Theorem 2. • Let B ' denote the n.d. a u t o m a t o n which can be obtain from the n.d. tree a u t o m a t o n B under R = {2}. Then for the class of ordinary monotone n.d. a u t o m a t a , we get the following statement as a consequence of Theorem 2. C o r o l l a r y 2. A system A of n.d. automata is isomorphically complete for the class of monotone n.d. automata if A contains such an n.d. automaton A that B ' can be embedded into an a^-product of A with a single factor. T h e next result shows t h a t , disregarding the trivial system of monotone n.d. tree a u t o m a t a which is isomorphically complete with respect to the acrproduct must contain n.d. tree a u t o m a t a with at last three states. T h e o r e m 3. For every rank-type R with R ^ {1}, there is no isomorphically complete system with respect to the ao-product which consists of two-state monotone n.d. tree automata. Proof. T h e proof of this statement is a generalization of the idea presented in [9]. For the sake of the completeness, we present this generalization here. Since R ^ {1}, there exists at least one integer k such t h a t 1 < k £ R. Let E^ = {a} and R' = R\ {k}, and for every m £ R', let E m = {am}. Let us define the n.d. tree a u t o m a t o n A = ( { 0 , 1 , 2, 3}, E) as follows. For every m £ R', v £ { 0 , 1 , 2, 3}™" 1 , and u £ { 0 , 1 , 2, 3 } * - 1 , let
153
v ^ = {3}, ({1,3} u,rA = ^ { 2 } [ {3}
i f u = 0, ifu=(l,...,l), otherwise.
It is obvious t h a t A £ FR. NOW, we prove t h a t A can not be embedded into any ao-product of two-state monotone n.d. tree a u t o m a t a . Contrary, let us suppose t h a t A can be embedded into an a 0 - p r o d u c t C = n " = i At (£,<£>), where A t is a two-state monotone n.d. a u t o m a t o n , for all t (E {1, . . ., n]. W i t h o u t loss of generality, we may assume t h a t the states of At are 0 and 1, moreover, there is no edge from 1 into 0 in the corresponding transition graph, for any t = 1 , . . . , n. Let now fi denote a suitable isomorphism and let j/j, = ( e j i , . . . , e j n ) , j = 0 , 1 , 2 , 3 . Then the vectors j / i , j = 0 , 1 , 2, 3 are binary vectors and 0/i < 1/i < 2/z < 3/i hold since At is monotone, t — 1 , . . . , n. Since fi is an isomorphism, ( 0 , . . . . , 0)(jAyu = ( 0 , . . . , 0)/i
ejn)
| 0 < j < 3}.
,n and e,j £ { 0 , 1 } , ( e 2 i , . . ., e 2 „) € Q which is a •
Let us note t h a t , by the proof of Theorem 3, it is valid for the general product of n.d. tree a u t o m a t a . (For the definition of the general product, see [7].) N o t e . This work has been supported by the the Hungarian National Foundation for Scientific Research, Grant T030143, and the Ministry of Culture and Education of Hungary, Grant F K F P 0704/1997. References 1. Z. Esik, Definite tree a u t o m a t a and their cascade compositions, Publicationes of Mathematicae, 4 8 (1996), 243-261. 2. F. Gecseg, Composition of a u t o m a t a , Proceedings of the 2nd Colloquium on Automata, Languages and Programming, Saarbriicken, LNCS, 14 (1974), 351-363.
154
3. F. Gecseg, Products of Automata, Springer-Verlag, Berlin, Heidelberg, New York, Tokyo, 1986. 4. F. Gecseg, B. Imreh, On completeness of nondeterministic automata, Acta Math. Hungar., 68 (1995), 151-159. 5. F. Gecseg, B. Imreh, On aj-product of tree automata, Acta Cybernetica, 8 (1987), 135-141. 6. F. Gecseg, B. Imreh, On a special class of tree automata, Proceedings of the 2nd Conference on Automata, Languages and Programming Systems, Salgotarjan, 1988, 141-152. 7. B. Imreh, On isomorphic representation of nondeterministic tree automata, Acta Cybernetica, 12 (1995), 11-22. 8. B. Imreh, On the aj-products of nondeterministic tree automata, Acta Cybernetica, 13 (1997), 41-54. 9. B. Imreh, M. Ito, On commutative asynchronous nondeterministic automata, Acta Cybernetica, to appear. 10. M. Steinby, On the structure and realizations of tree automata, Second Coll. sur les Arbres en Algebre et en Programmation, Lille, 1977, 235-248.
155 M I N I M A L R E C O G N I Z E R S A N D S Y N T A C T I C M O N O I D S OF D R TREE LANGUAGES
FERENC GECSEG Department Arpdd E-mails:
of Informatics, University of Szeged ter 2, H-6720 Szeged, Hungary gecseg/imreh@inf .u-szeged.hu MAGNUS STEINBY
Department
of Mathematics, University FIN-20014 Turku, Finland E-mail: s t e i n b y © u t u . f i
of
Turku
The sets recognized by deterministic root-to-frontier tree recognizers, the DR tree languages, are determined by their path languages. A path language of a tree language T consists of the words describing the paths leading from the root of a tree in T to its leaves labeled with a given leaf symbol. The Nerode path congruence of a tree language T is defined as the greatest right congruence saturating all path languages of T. We prove a Nerode-like theorem for DR tree languages and show how Nerode path congruences correspond to minimal DR recognizers. Similarly, the greatest congruence saturating the path languages yields the syntactic path monoid of T which is finite for a path closed T exactly in case T is a DR tree language.
1
Introduction
The family DRec of tree languages, the DR tree languages, recognized by deterministic root-to-frontier (top-down) tree recognizers form a proper subfamily of the family Rec of all regular tree languages. This was noted already by Magidor and Moran [12]. On the other hand, it is easy to see, for example, that every context-free language is the yield-set of a DR tree language, and the family DRec and its extensions have actually been studied rather extensively. For this theory and further references, we refer the reader to [7,11]. In particular, in [6] minimal DR tree recognizers were considered using an algebraic approach based on "root-to-frontier algebras" in which the operations are of the form f : A —t Am. In [13] Nivat and Podelski use Nerode congruences on the semigroup of "pointed trees" to obtain minimal DR recognizers. In this paper we relate the minimal DR recognizer of a DR tree language T with the Nerode congruence of certain string languages associated with T. Using the same languages, we may also define a syntactic monoid for T. A characteristic feature of any DR tree language T is that it is closed in the sense that it contains every tree t such that any labeled path, in which also the
156 direction taken at each node is indicated, leading from the root of / to a leaf with a given label, appears in some tree belonging to T. To define the paths formally, we convert the ranked alphabet E of labels of the inner nodes of trees into an ordinary alphabet E consisting of letters of the form fi, where / £ E and i indicates the direction taken at the node in question. For each leaf symbol x from the leaf alphabet X, the path language Tx is defined as the set of all words over E describing a path in a tree in T from the root to an ^-labeled leaf. We can then state a Nerode-type theorem for D R tree languages in terms of the right congruences saturating the path languages. In particular, the Nerode path congruence of a D R tree language T is the greatest of these congruences. It also turns out t h a t the Nerode path congruence of a D R tree language T corresponds in a natural way to the minimal D R recognizer of T. T h e D R tree languages do not form a variety of tree languages in the sense of [15,16], so it seems t h a t neither syntactic algebras nor the syntactic monoids introduced in [17,18] can be used directly for classifying subfamilies of DRec. We shall define the syntactic path congruence of a tree language T as the intersection of the syntactic congruences of the path languages of T, and the syntactic path monoid of T is the corresponding quotient monoid. We prove t h a t a closed tree language is DR-recognizable iff its syntactic path monoid is finite, and we also show how the monoid can be computed as a transition monoid. 2
General Preliminaries
Let A be a set. T h e power-set of A is denoted by pA. For any n > 0 and i such t h a t 1 < i < n, the ith projection mapping An —• A, {a\,..., an) H-» a,- is denoted by 7T,-. If / : A —> B is a mapping, the image / ( a ) of an element a £ A may be denoted also by af. An equivalence relation 9 on a set A saturates a subset B of A if B is the union of some ^-classes. An equivalence relation with a finite number of equivalence classes is said to have finite index. Let X be a finite non-empty alphabet. T h e set of all (finite) words over X is denoted by X* and the empty word by e. An X-recognizer is a system A = (A, X, 8, a0,F), where A is the finite non-empty set of states, X is the input alphabet, 5 : A x X —>• A the transition function, a^ the initial state, and F C A the set of final states. T h e transition function is extended in the natural way into a function S* : A x X* —>• A, which we also denote by S, and the language recognized by A is then defined as the set L(A) = {weX*
|<S(a0)u>)
£F}.
A language L C X* is called recognizable, or regular, if L = L(A)
for some X-
157 recognizer A . The basic theory of regular languages needed here can be found in any text-book on a u t o m a t a and formal languages. In what follows, E is always a ranked alphabet, i.e., a finite set of operation symbols, and for each m > 1, we denote by E m the set of m-ary symbols in E. We assume t h a t there are no miliary symbols in E, but instead a finite nonempty leaf alphabet X is used. T h e set Ts(X) of H-terms over X is the least set such t h a t (1) X C T S ( X ) , and (2) f{ti,..
.,tm)
£ Ts(X),
and whenever m > 1, / £ E m and t \,. . . , i m £
Such terms are regarded as trees in the usual way and we call t h e m EX-trees (or just trees). A T,X-tree language is any subset of Ts(X). Let £ be a new symbol. A HX-context is a E(X U {£})-tree in which £ appears exactly once. T h e set of all EX-contexts is denoted Cs(X). For any P> q G C E ( ^ Y ) , let p-g be the EX-context obtained from g by replacing the unique occurrence of £ by p. Obviously, C^{X) forms with respect to this product a monoid in which £ is the unit. If q £ Cs(X) and t £ Ts(X), then £ • q is the E X - t r e e obtained when the £ in q is replaced by i. A E-algebra A consists of a nonempty set A and a E-indexed family of operations fA on .A such that if / £ E m (m > 0), then fA : Am —> A is an m-ary operation. We write simply .4 = (A, E ) , and call A finite if A is a finite set. Subalgebras, morphisms, congruences etc. are defined as usual (cf. [1], for example). In particular, the HX-term algebra Tz(X) = [T%(X), E) is defined so that for any m > 1, / £ E m and t\,.. . ,tm £ T%(X),
fT^X){tly...,tm)
=
f{h,...,tm).
If A = (A, E) is a E-algebra, any mapping a : X —> A has a unique extension to a homomorphism a^ : Ts{X) —> A. A EX-recognizer A = (.4, a, F) consists of a finite E-algebra A = (A, E ) , an initial assignment a : X —> A, and a set F C A of final states; the elements of A are the states of A . T h e EX-tree language recognized by A is defined as the set T(A)
=
{i£TE(X)
|
A E X - t r e e language is called recognizable, or regular, if it is recognized by some EX-recognizer. Let R e c s ( X ) denote the set of all recognizable E X - t r e e languages. T h e recognizers defined above are known as deterministic frontier-to-root, or bottom-up, tree recognizers. It is well-known t h a t the regular tree languages are
158 defined also by non-deterministic frontier-to-root as well as by non-deterministic root-to-frontier, or top-down, tree recognizers. For the basic theory of such tree recognizers and regular tree languages the reader is referred to [7], [8] or [2]. 3
D R Tree Recognizers
In what follows, the frequently recurring phrase deterministic root-to-frontier is usually abbreviated directly to DR. As before, E is a ranked alphabet without miliary symbols and X is a frontier alphabet. A (finite) DR Yj-algebra consists of a non-empty (finite) set A and a Eindexed family of root-to-frontier operations fA:A-^Am
(/GE),
where the arity m is that of / ( G E m ) . Again we write simply A = ( A , E ) . A DR E X -recognizer is now defined as a system A = (A, ao,a), where A = (A, E) is a finite DR E-algebra, ao G A is the initial state, and a : X —>• pA is the final state assignment. T h e procedure by which such a DR E-recognizer accepts or rejects a given input tree t G Ts(X) can be described as follows: (1) A starts at the root oft in state ao; (2) if A has reached a node u of t labeled with a symbol / G E m in state a, then it continues its working at the ith immediate successor node of u in state a,- (1 < i < m), where (a\,..., am) = / (a); (3) the tree is accepted iff A reaches every leaf in a state which matches the label of t h a t leaf, i.e., if the label is x(£ X), A should reach the leaf in a state belonging to xa. To define formally the tree language recognized by A , we extend a to a mapping a^ : T%(X) —t pA thus: (1) xa^
= xa for each x G X;
(2) taA
= {ae
A\ fA(a)
£tiaA
x . . . x tmaA]
fori =
f[h,...,tm).
T h e tree language recognized by A is now defined as the set T(A)
= {teTx{X)
\a0etaA}.
A E X - t r e e language is DR-recognizable if it is recognized by some DR E X recognizer. We denote the set of all DR-recognizable E X - t r e e languages by Di?ecs(X).
159 Let A = (A,a0,a)
be a DR EX-recognizer. For any a G A, let T(A,a) = { i e T E ( X )
\a<EtaA}.
A state a is called a 0-state if T(A, a) = 0, and A is said to be normalized if for all m > 1, / G E m and a G A, either every component in /"^(a) = (ai, • • • , a m ) is a 0-state or then no ai is a 0-state. Furthermore, A is reduced if T(A, a) = T(A, &) only in case a = b (a,b £ A). A state a is reachable in A if ao =^* a, where =>* is the reflexive, transitive closure of the relation => (C A x A) defined so that a => 6 iff there exists an / G E such that b appears as a component in fA(a), and A is connected if all of its states are reachable. Let A = (A, a0, a) and B = (B, &o, /?) be two DR EX-recognizers. A homomorphism of DR EX-recognizers from A to B is a mapping ip : A —> B such that (1) fB(a(p)
= (a\tp,.. ., amip) whenever m > 0, / G £ m , a G A and fA{a)
=
a
(dl, • • • i m):
(2) aov? = &o, and (3) x(3
A homomorphism is an epimorphism if it is surjective, and it is an isomorphism if it is bijective. Two DR EX-recognizers A and B are isomorphic, A = B in symbols, if there is an isomorphism tp : A —> B. As shown in [6] (and in [7]), any DR EX-recognizer A can be converted into an equivalent EX-recognizer B which is connected, normalized and reduced, and such a B is a minimal DR EX-recognizer of T(A). Moreover, the minimal DR EX-recognizer of any DR-recognizable EX-tree language is unique up to isomorphism. 4
Path Languages and Path Closures
An essential feature of any DR-recognizable tree language is that it contains any tree composed of paths appearing in some of its trees. The path alphabet associated with a ranked alphabet E (without 0-ary symbols) is defined as the set
E = U Em x { l , . . . , m } . m>0
Any element (/, i) of E is regarded as a letter of an ordinary alphabet, and for convenience we write it as /,-. Words over E are used for representing paths
160
leading from the root to a leaf in a EX-tree. In a letter /,• appearing in such a representation, the component / gives the label of a node while the i indicates the direction taken at that node. For any x £ X, the set gx(t) of x-paths in a given EX-tree t is defined as follows: (1) gx(x) = {e}; (2)
• ••Vfm9x(tm)
for t = f(ti,...
,tm).
The mappings gx are extended to EX-tree languages in the natural way, and for any T C T E ( X ) and x £ X, we write Tx = gx(T). These sets Tx C E* are called the path languages of T. A EX-tree language T is said to be closed if t £ T for any EX-tree t such that gx{t) C Tx for every x £ X. As shown in [3] and in [19], a regular tree language is DR-recognizable iff it is closed. For these matters we refer the reader also to [7] and [11]. The following obvious fact is frequently used. Lemma 1 The path languages of any DR-recognizable T,X-tree language are regular. Proof. If T = T(A) for a normalized DR EX-recognizer A = (A,aa,a), then for each a; £ X, the language Tx is recognized by the E-recognizer Ax = (A, E, S, ao, xa), where S is defined so that
S(a,fi) = ni(fA(a)), for all a £ A and /; £ E.
•
Remark 2 ./Vote iftai
Nerode Path Congruences
Let us first recall (cf. [7] or [8], for example) that the Nerode congruence pr of a EX-tree language T is the greatest congruence on the term algebra 7s (X)
161
which saturates T. The quotient algebra Tz(X)/pT (called the syntactic algebra of T in [15], [16]) gives the minimal EX-recognizer of T. The congruence may be defined by the condition sPTt
<=^ ( V p G C E ( X ) ) ( s - p G T f M - p G T ) .
The Nerode path congruence p\ of a EX-tree language T is the relation on E* defined so that for any u , » e E ' , upTv
<^=> (Vz G X)(Vw G
E*)(WWJ
G Tx f» vw &TX).
Hence, pr is the intersection of the usual Nerode congruences of the path languages Tx (x G X). Since each of these, denoted here by pr,x, is the greatest right congruence on the monoid E* saturating the corresponding language Tx, the following fact is obvious. Lemma 4 For any EX-iree language T, the relation px is the greatest right congruence on E* saturating all of the path languages Tx (x G X). We may now state the following Nerode-type characterization of DRrecognizable tree languages. Theorem 5 For any closed Y*X-tree language T, the following conditions are equivalent: (1) T G DRecx{X); (2) there is a right congruence on E* of finite index saturating all of the path languages Tx (x G X); (3) px is of finite index. Proof. If T G D_RecE(X), then every pr}X is of finite index by Lemma 1. Hence (1) implies (3). The equivalence of (2) and (3) follows immediately from Lemma 4. To prove that (2) implies (1), assume that p is a right congruence on E* of finite index which saturates the path languages Tx. First we define A = (E*//?, E) as the DR E-algebra such that fA(u/p)
=
(uhlp,...,ufmlp),
for all m > 0, / G E m and u G £*. Now, let A = (A,a0,a) be the DR EX-recognizer with ao = e/p and xa — {u/p \ u £ Tx} for every x G X. The operations fA are well-defined as p is a right congruence, and for every x G X, we have (J xa = Tx as p saturates Tx. Moreover, it is clear that for the corresponding path language recognizers Ax — (£*/p,T,,8,ao,xa), S(u/p, v) = uv/p
162 holds for all u,v G E*, and therefore T{AX)
= { « 6 E ' | u/p G xa) = Tx
for every x G X. Consider now an arbitrary S X - t r e e t. If t G T, then
corresponding
to any right T-congruence
is con-
b. Let p and 9 be two right T-congruences, and let A and B be the corresponding DR YX-recognizers. If p C 8, then there exists an epimorphism f : A —> B of DR Y,X-recognizers. c. Any connected normalized DR YJX-recognizer of T has the DR E X recognizer corresponding to some right T-congruence as an epimorphic image. Proof. To prove the first part of the lemma, let A = (.4, e/p, a) be the D R £X-recognizer corresponding to the right T-congruence p. It is clear t h a t for any u G E*, we may choose t G T%(X) and i £ l s o t h a t u G gx(t). Hence every state u/p is reachable in A . To show t h a t A is normalized, consider any m > 0, / G E m and u G E*. If some component ufi/p of fA(u/p) is not a 0-state, there is a tree s G T ( A , ufi/p). Then for any x £ X and v G gx{s), S(e/p, ufiv)
- 6(ufi/p,
v) G xa
in the p a t h recognizer Ax, and hence ufiv G Tx. This means t h a t ufiv G gx{t) for some tree t G T, and therefore every T ( A , ufj), 1 < j < m, contains at least the subtree of t rooted at the node reached from the root by the p a t h labeled with the word ufj. For proving the second claim of the lemma, assume t h a t p C 0, and let A = (A, e/p, a) and B = (B, e/0, /?). It is a straightforward task to verify that ip : E * / p —> Yi*/0, u/p t-> u/8,
163 yields the required epimorphism. Let us just note t h a t x0ip i £ l . Indeed, since p and 6 saturate Tx, u/p £ xa
<=> u/9 £ x0
1
= xa for every
<=> (u/p)
for any u G E*. To prove the last assertion, we consider any connected normalized DR Y,Xrecognizer A = (A,ao,a) of T. Using the path language recognizers Ax = (A, £,<$, ao, i a ) we define first a relation p on E* so t h a t upv
<^=>- (Vi 6 I ) ( V t o £ S*)(
It is easy to see t h a t p is a right T-congruence. Let B = (B, e/p, 0) be the DR EX-recognizer corresponding to p. We define now a mapping
=
(aiip,...,am
(a) as a; = <J(ao, u;/,-) for each i = 1, . . ., m.
(3) a0y? = e/p. (4) x0(p~x = I Q for every x £ X. Indeed, for any a = S(ao, w) G ^4, atp G K/? •£=> u)/p G X0 <£=> tu G Tx •<=>• c5(ao, u») G xa <=> a G z a , which concludes the proof.
•
Since the Nerode p a t h congruence fix is the greatest T-congruence (Lemma 4), the following result is a direct consequence of L e m m a 6. T h e o r e m 7 For any T £ DRec-s(X), the DR T,X-recognizer corresponding to PT is the minimal DR E X -recognizer of T. 6
Syntactic Path Monoids
T h e syntactic monoid congruence of a E X - t r e e language T is the congruence on the monoid of £ X - c o n t e x t s defined by the condition pp,T q <=> fyt G T s p O ) ( V r G Cs(X)){t
• p • r £ T «• * • g • r £ T ) .
164
T h e quotient monoid M[T) = C's(X)/ /IT is called the syntactic monoid of T. These notions were introduced by T h o m a s [17], [18], and they have been studied further and used, for example, in [14] and [9]. We shall now present our path versions of them. T h e syntactic path congruence of a E X - t r e e language T is the relation on E* defined by the condition w\ fir W2 <^> (Vx G X)(Vu,v
G T,*)(uu>iv G Tx <-> uio 2 v G Tx).
T h e following fact is obvious since (IT is the intersection of the usual syntactic congruences of the languages Tx (x G X). L e m m a 8 For any HX-tree language T, the relation fix is the greatest ence on E* which saturates all of the path languages Tx (x G X).
congru-
T h e following result can be proved similarly as Theorem 5, but it may also be derived from this theorem since obviously (IT C PT and for any w\, w2 G E*, w\ (IT
W2
^ = > (Vw G E*) uw\
(T
UW2,
where it suffices to consider just one u from each py-class. T h e o r e m 9 For any closed Y,X-tree language the following conditions alent: (1)
are equiv-
TEDRecz(X);
(2) there is a congruence guages Tx (x G X);
on E* of finite
index saturating
all of the path lan-
(3) (LT is of finite index. T h e quotient monoid PM(T) = E*/(IT we call the syntactic T ( C TY,{X)). Immediately from Theorem 9 we get C o r o l l a r y 10 A closed tree language is DR-recognizable monoid is finite.
path monoid of
iff its syntactic
path
T h e syntactic monoid of a regular language L may be computed by using the fact t h a t it is isomorphic to the transition monoid of the minimal recognizer of L (cf. [4], for example), and in [14] this result was extended also to syntactic monoids of regular tree languages. We shall now show how the syntactic p a t h monoid of a DR-recognizable tree language can be obtained as a transition monoid. Let Y be a finite alphabet and / be a finite set. By a Yj 1-recognizer we mean a system A = (A,Y, S, a0, (F,- | i G J)), where A, Y, S and a0 are exactly as in an ordinary Y-recognizer, but (F,- | i G / ) is an /-indexed family of subsets of A. T h e family of languages recognized by A is (£(A,-) | i G I), where for each
165
i G /, Aj = (A, Y, S, ao, Fj) is the Y-recognizer obtained by letting Ft be the set of final states. It is easy to see (using the standard theory of Moore-automata; cf. [5], for example) that every family (Li \ i G /) of regular languages over Y has a minimal Y//-recognizer, and that this is unique up to isomorphism. In fact, A = (A,Y,5,ao, (Ft | i G /)) is the minimal Y//-recognizer of (L(A,-) | i G / ) , if (1) all states are reachable from ao, and (2) for any two distinct states a and 6, there exist an i G / and a word t o E Y ' such that exactly one of the states S(a, w) and S(b, w) is in F;. The transition monoid T M ( A ) of the Yj/-recognizer mappings wA : A—> A, a (-» S(a, w)
A is formed by the
(w£Y*)
with the composition uAvA — (uv)A as the operation. T h e o r e m 11 If T e DRecz(X) and A = (A,t,S,a0,(Fx \ x G X)) is the minimal E/'X -recognizer of the family (Tx \ x G X) of path languages ofT, then PM(T)^TM(A). Proof. Let us consider the mapping
w/fiT^wA.
ip:PM(T)—>TM(A),
First of all, ip is well-defined and injective since for any w\,W2 G £*, (wi/jxT)if
- (W2/(IT)>P
<=3- wA = wA
<=> (Vo G ^4) 8(a, ffii) = 8(a, w2) <$=> (Vw G S*) 6(a0,uw1) = S(a0,uw2) <=>(\/x eX)(\fu,vet*) (S(a0luwiv) G Fx
-
W2/flT-
Since
Acknowledgements. The work of the first author was supported by the Hungarian National Foundation for Scientific Research under Grant T 014888 and by the Ministry of Culture and Education of Hungary under Grant FKFP 0704/1977. The work of the second author was supported by the Academy of Finland under Grant 44087.
166 References 1. S. Burris, H.P. Sankappanavar, A Course in Universal Algebra, SpringerVerlag, New York, 1981. 2. H. Comon, et al., Tree Automata and Applications, http://13ux02.univlille3.fr/tata. 3. B. Courcelle, A representation of trees by languages I. Theoretical Computer Science, 6 (1978), 255-279. 4. S. Eilenberg, Automata, Languages, and Machines, Vol. B., Academic Press, New York, 1976. 5. F. Gecseg, I. Peak, Algebraic Theory of Automata, Akademiai Kiado, Budapest, 1972. 6. F. Gecseg, M. Steinby, Minimal ascending tree automata. Acta Cybernetica, 4 (1978), 37-44. 7. F. Gecseg, M. Steinby, Tree Automata, Akademiai Kiado, Budapest, 1984. 8. F. Gecseg, M. Steinby, Tree languages, Handbook of Formal Languages, Vol. 3 (G. Rozenberg, A. Salomaa, eds.), Springer-Verlag, Berlin 1997, 1-69. 9. U. Heuter, Definite tree languages, Bulletin of the EATCS, 35 (1988), 137142. 10. E. Jurvanen, The Boolean closure of DR-recognizable tree languages, Acta Cybernetica, 10 (1992), 255-272. 11. E. Jurvanen, On Tree Languages Defined by Deterministic Root-to-Fronties Recognizers, Doctoral Thesis, Department of Mathematics, University of Turku, Turku, 1995. 12. M. Magidor, G. Moran, Finite Automata Over Finite Trees, Technical Report 30, Hebrew University, Jerusalem, 1969. 13. M. Nivat, A. Podelski, Minimal ascending and descending tree automata, SIAM J. Computation, 26 (1997), 39-58. 14. K. Salomaa, Syntactic Monoids of Regular Forests (in Finnish), Master's Thesis, Department of Mathematics, University of Turku, Turku, 1983. 15. M. Steinby, Syntactic algebras and varieties of recognizable sets, Les Arbres en Algebre et en Programmation (Proc. 4th CAAP, Lille 1979), University of Lille, Lille, 1979, 226-240. 16. M. Steinby, A theory of tree language varieties. Tree Automata and Languages (M. Nivat, A. Podelski, eds.), North-Holland, Amsterdam, 1992, 57-81. 17. W. Thomas, On non-counting tree languages, Grundlagen der Theoretische Informatik (Proc. 1st Intern. Workshop, Paderborn, 1982), 234-242. 18. W. Thomas, Logical aspects in the study of tree languages, in 9th Colloquium on Trees in Algebra and Programming (Proc. 9th CAAP, Bordeaux
167
1984) (B. Courcelle, ed.), Cambridge University Press, London, 1984, 31-49. 19. J. Viragh, Deterministic ascending tree automata I, Acta Cyhernetica, 5 (1980), 33-42.
This page is intentionally left blank
169
VISUALIZING L A N G U A G E S USING PRIMITIVE P O W E R S T O M HEAD Mathematical Sciences, Binghamton University Binghamton, New York 13902-6000, USA E-mail: t o m 6 m a t h . b i n g h a m t o n . e d u The fact that each word in a free semigroup is uniquely expressible as a positive integer power of a primitive word allows the words in a free semigroup to be displayed in a coherent manner as co-ordinate pairs on a half plane. The traditional rr-axis is labeled with primitive words and the upper portion of the j/-axis is labeled with positive integers in the usual fashion of elementary algebra. Since languages are subsets of free semigroups they may then be viewed as subsets of the resulting half plane. This suggests new, visually motivated, language concepts and questions for investigation. In order to produce a simple visual display of any given language, we allow the primitive words to be ordered along the £-axis in whatever manner will yield a suggestive and coherent display of the language. We say that two languages are sketch equivalent if two, possibly distinct, orderings of the set of primitive words can be found with respect to which the displays of the two languages coincide. We associate a set of invariants with each language in such a way that two languages are sketch equivalent if and only if they have the same set of invariants. For each regular language the set of invariants is finite. Moreover, an effective procedure is given for computing the set of invariants of a regular language. Definitions are given for ten classes of languages suggested by visual considerations. Membership of a language in each of the ten defined classes can be determined by inspecting the invariants of the language. We hope that the visual approach taken here will stimulate the development of additional concepts and that the effective procedures given can be extended beyond the class of regular languages.
1
Introduction
One of the fundamental facts of the combinatorics on words is that each non-null word, w, consisting of symbols from an alphabet A, can be expressed in a unique way in the form w = qn where q is a primitive word and n is a positive integer. Recall that a word, q, is said to be primitive if it cannot be expressed in the form xk with x a word and k > 1. The uniqueness of the representation, w = qn, suggests that it may be useful to display the free semigroup A+, consisting of the non-null strings of symbols of A, in the form of a Cartesian product, Q x N, where Q is the set of all primitive words in A* and N is the set of positive integers. Each word w = qn would then be identified with the ordered pair (q,n). The purpose of the present article is to provide the groundwork for investigations of concepts that are suggested by the visualization of languages as subsets of Q x N. In the suggested visualizations, the order structure of N is respected. We regard N as labeling a vertical axis (j/-axis) that extends upward only. We regard Q as
170
providing the context-free language L = {w in A+ \ a and b occur equally often in w} is either empty or full: Sp(w, L) is full if w is in L and empty otherwise. For the regular language L = (aa)+ + (bbb) +, Sp(an, L) is full if n is even and intermittent if n is odd. 5(6™, L) is full if n is divisible by three and intermittent otherwise. Finally, Sp(w,L) = 0 if both a and b occur in w. 2
The Spectral Partition of A+ Induced by a Language L
Let L be a language contained in A+. L provides an equivalence relation, ~, defined for words u and v in A+, by setting u ~ v provided w and v have identical spectra, i.e., Sp(u) = Sp(v). We call the partition provided by ~ the spectral partition, P(L), of A+ induced by L. This partition is a fundamental tool for the present article. In Section 7 it is observed that, when L is regular, P(L) consists of a finite number of constructible regular languages. On combining this information with the algorithms provided in [10], a precise view, within Q x N , of regular languages can be obtained. The spectral partitions determined by the languages discussed in Section 2 are given next as examples. Let A = {a}. For the language L = A+, the spectrum of every word in A+ is full. Consequently P(L) = P(A+) consists of a single class, i.e., P(A+) = {A+}. For the empty language, 0, the spectrum of every word in A+ is 0. Thus P(0) also consists of the single class {^4+}. For L = {a, aaa}, P(L) = {{a}, {aaa}, ^ 4 + \ J L } . For L = a + aaaa*, P(L) = {{a},{aa},aaa+}. For L - (aa)+, P{L) - {{an | n n is odd}, {a | n is positive and even}}. Now let A — {a, b}. For L = {w in A+ | a and 6 occur equally often in w}, P(L) = {L,A+\L}. For L = (aa)+ + (bbb)+, P(L) = {L, a(aa)*,b{bbb)* + bb(bbb)*,A*abA* + A*baA*}. For visualizing a language, L, in the rectangle Q x N, the spectra of the primitive words in A+ provide the whole picture. If desired, the spectrum of a non-primitive word, qn, can be obtained from the spectrum of its primitive root, q. In fact, for the task at hand here, there is little motive for interest in the spectra of individual non-primitive words. For each equivalence class, C, in P(L) we are actually only interested in C fl Q. The single reason for providing the definition of the spectra of non-primitive words is that each resulting spectral class, C, can often provide satisfactory access to the crucial set of primitive words CC\Q. The first three crucial questions we ask about a set CC\Q are: (a) Is C<~\Q empty? (b) If not, is C D Q infinite? (c) If C f) Q is finite, can its elements be listed? These questions are answered for the languages discussed in the previous paragraph in order to provide examples. For a one letter alphabet, A = {a}, the letter itself is the only primitive word. Consequently C D Q is empty for each C other than the one containing the letter a. Now let A = {a,b}. For L = {w in A+ | a and 6 occur equally
171
often in w}, each of the two classes in P{L) = {L, A+\L} contains an infinite number of primitive words. For L — (aa)+ + (bbb) +, we previously obtained P{L) = {L, a{aa)*,b{bbb)* +bb(bbb)*, A*abA* + A*baA*}. For these four spectral classes we have: LnQ is empty; (a(aa)*)nQ = {a}; (b{bbb)* +bb(bbb)*)C\Q = {b}; and (A*abA* + A*baA*) (~l Q is infinite. 3
The Support of a Language
For each language L contained in A+, th e set Su(L) — {q in Q \ Sp(q,L) is not empty} will be called the support of L. For a one letter alphabet, A = {a}, the support each non-empty language L is A itself. Now let A = {a, b}. For the language L — {w in A + | a and 6 occur equally often in w), Su(L) is the infinite set LnQ. For L = (aa)+ + (666)+, Su(L) is the finite set {a, 6}. Languages for which the support is finite are of special significance for the investigations introduced here. The computability of the support of a language is also of special significance, even in the case in which the support is finite. 4
Languages on a Half Plane
In order to spell out the visualization of a language L within Q x N, we begin with the usual x-y plane with each point having associated real number coordinates (x,y). We use only the upper half plane, {(x,y) | y > 0}. With each integer i and each positive integer n we associate the unit rectangle R(i,n) = {(x, y) | i — 1 < x < i, n — 1 < y < n). In this way Q x N is partitioned into non-overlapping unit squares {R(i,n) \ i an integer, n in N } . To visualize a specific language L in A+ we first identify the set Q with the set Z of integers by means of a bijection B: Q —>• Z. (The bijection B is chosen only after a study of the spectral partition of the specific language L has been made, as illustrated below.) Once the bijection B is chosen, each word qn in A+ is associated with (figuratively, 'placed on') the unit square R(B(q),n). Finally, the language L is visualized by defining, using B, a sketch function S: {R(B(q),n) | q in Q, n in N} -> {Black, White} for which S{R{B(q),n)) = Black if qn is in L and White otherwise. For a given language L, each choice of the bijection B and the resulting sketch function is said to provide a sketch of the language L. By the sketch we mean the image of the sketch function that provides it. Thus we regard the sketch as a half plane in which each of the unit squares is either black or white. Since there are many possible choices for B, there may be many possible sketches of L. For many languages, coherent sketches can be given by basing the choice of the bijection B o n a determination of the spectral decomposition of the language. Examples follow for which we use the alphabet A = {a, b}.
172
These examples suggest several formal language concepts that we believe are worthy of theoretical development. Each definition given in this section follows immediately below one or more examples that illustrate or clarify the concept being defined. In Section 7 these concepts are explicated for the class of regular languages. Example 4.1 For L = {w in A+ \ a and b occur equally often in w}, each of the two spectral classes in P(L) = {L,A~*~\L} contains an infinite number of primitive words. The spectrum of each word in L is full and the spectrum of each word in A+\L is empty. Let B be any bisection for which B(LnQ) = {i in Z | i < 0} and B((A+\L) D Q) = {i in Z | i > 1}. The sketch provided by this choice of B gives a black left quadrant and a white right quadrant. The support of this language is the infinite set Lf)Q. Definition 4.1 A language L is cylindrical if, for each word w in A+, Sp(w, L) is either empty or full. The language L of Example 4.1 is cylindrical. There are numerous 'naturally occurring' examples of cylindrical languages: The fixed language L = {w in A+ | h(w) = w} of each endomorphism h of A+ is a cylindrical regular language and so is the stationary language of each such endomorphism [6], [7]. Retracts and semiretracts [6], [3], [2], [1] of free monoids are cylindrical languages. Investigations of various forms of periodicity in the theory of Lindenmayer systems have lead to additional examples of cylindrical languages [8], [11]. Example 4.2 For L = aa + aaa + aaaa + aaaaaa + bbb + bbbb + ababab, only three primitive words have non-empty spectra: a, b, and ab. Let B be any bijection for which B(a) = 1, B(b) = 2, and B(ab) = 3. The sketch provided by such a B gives a half plane that is white except for the three columns above the three primitive words a, b, and ab. The column above a reads, from the bottom up, white, black, black, black, white, black, and white thereafter. The column above b reads white, white, black, black, and white thereafter. The column above ab reads white, white, black, and white thereafter. The support of this language is the finite set Su(L) = {a, b, ab}. Example 4.3 For L = {anbn \ n in N } , each of the words in L is primitive. Let B be any bijection for which, for each n in N, B(anbn) = n. The sketch provided by such a B gives a white left quadrant and a right quadrant that is white except for one black stripe at the bottom level (at which n = 1). The support of this language is this context-free language L itself. Example 4.4 For L = {(amb)n | m, n in N, m > n), the support of L is Su(L) — {amb | m in N } . Let B be any bijection for which, for each m in N, B(amb) = m. The sketch provided by such a B gives a white left quadrant. The right quadrant is white above a sequence of black squares ascending upward at 45
173 degrees and black below this sequence of squares. the infinite regular set Su(L) — a+b.
The support of this language is
D e f i n i t i o n 4.2 A language L is bounded above if, for each word w in A+, Sp(w,L) is finite. L is uniformly bounded above if there is an upper bound m in N for the set {n in N | n in Sp(w,L), w in A+}. Any finite language, such as the one given in Example 4.2, is necessarily uniformly bounded above. An infinite languages may be uniformly bounded above, as illustrated by Example 4.3, or bounded above without a uniform bound, as illustrated in Example 4.4. E x a m p l e 4.5 For L = a + aaa + aaaaa + b(a + b)*, each word that begins with b has a full spectrum and each word that begins with an a and contains a b has empty spectrum. Let B be any bisection for which B{a) = 1; B(b(a + b)*) = {n in N | n > 2 } . The sketch provided by such a B gives a white left quadrant and a right quadrant that is black except for the column above a which reads black, white, black white, black, and white thereafter. The support of this language is the infinite non-regular set Su(L) = LnQ. E x a m p l e 4.6 For L = a + aaa + (ab)+ + b+, only three primitive words have powers in L: a, ab and b. Let B be any bisection for which B(a) — 1; B(ab) = 2; B{b) = 3. The sketch provided by such a B gives a half plane that is white except for the three columns above the three primitive words a, ab, and b. The column above a, is black, white, black, and white thereafter. The column above ab is purely black and so is the column above b. Note that this infinite language has finite support: Su(L) = {a,ab,b}. E x a m p l e 4.7 For L = {(amb)n | m, n in N , m odd, m > n} U {(amb)n | m, n in N , m even, m < n}, the support of L is Su(L) = {amb \ m in N } . Let B be any bijection for which, for each m in N , B(amb) = m. The sketch provided by such a B gives a white left quadrant. The right quadrant has a sequence of black squares ascending upward at 45 degrees. For each odd positive integer m, (amb)n is black for n < m and white for n > m. Whereas, for each even positive integer m, [amb)n is white for n < m and black for n > m. Su(L) = a+b. D e f i n i t i o n 4.3 A language L is eventual if, for each word in w in A+, Sp(w, L) is either finite or cofinite. L is uniformly eventual if there is an m in N for which, for each word w in A+, either Sp{w,L) C {n in N | n < m} or Sp(w,L) D {n in N | n > m}. T h e languages of Examples 4.5 and 4.6 are uniformly eventual. T h e language of Example 4.7 is eventual but not uniformly eventual. Note t h a t each cylindrical language is uniformly eventual (where any n in N may be taken as the uniform bound). Note also that each language that is (uniformly) bounded above is (uniformly) eventual. It is an elementary exercise to confirm t h a t every uniformly
174 eventual language is the symmetric difference of a cylindrical language and a language that is uniformly bounded above. Each non-counting language [13] is uniformly eventual as was pointed out in [7] where the concept of an eventual language was first introduced. E x a m p l e 4.8 For L = aa + aaa + (aabaab)+ + (ababab)+ + b(a + b)*, each word that begins with a b has a full spectrum. Each primitive word that begins with an a has an empty spectrum except for the primitive words a, aab, and ab. Let B be any bijection for which B(a) = 1; B(aab) = 2/ B(ab) = 3; and B(b(a + b)* fl Q) = {n in N | n > 4 } . The sketch provided by such a B gives a white left quadrant and a right quadrant that is black except for three columns. The column above a reads: white, black, black and white thereafter. The columns above aab and ab are both intermittent with the first having period two and the second having period three. Su(L) = {a, aab, ab} U (Q fl (bA*)). E x a m p l e 4.9 For L = (AA) +, the spectrum of each word of even length is full and the spectrum of each word of odd length is intermittent. Let B be any bijection for which B({q in Q | q of even length}) = {i in Z | i < 0} and B({q in Q | q of odd length}) = {i in Z | i > 1}. The sketch provided by such a B gives a black left quadrant and a right quadrant that consists of alternating white and black stripes. Su(L) = Q. D e f i n i t i o n 4.4 A language L is almost cylindrical (respectively, almost bounded above, almost uniformly bounded above, almost eventual, almost uniformly eventual if it is the union of a language with finite support and a language t h a t is cylindrical (respectively, bounded above, uniformly bounded above, eventual, uniformly eventual). T h e language of Example 4.8 is almost cylindrical and therefore also almost uniformly eventual. The language of Example 4.9 has none of the five properties defined in Definition 4.4. The language of Example 4.5 is almost cylindrical and therefore also almost uniformly eventual. The language of Example 4.6 is almost cylindrical, almost uniformly bounded above and therefore also almost uniformly eventual. T h e union of the languages of Example 4.4 and Example 4.6 is almost bounded above, but not almost uniformly bounded above. T h e union of the languages of Example 4.7 and Example 4.6 is almost eventual, but not almost uniformly eventual. John Harrison provided the first application of the concept of an almost cylindrical language in [4]. In joint work with John Loftus [5] he has given also a second application.
175 5
T h e S k e t c h P a r a m e t e r s of a L a n g u a g e
Each sketch of a language L in A+ is given by a sketch function S t h a t is determined entirely by L and the choice of a bijection B: Q —>• Z. Given two sketches of the same language L, each can be obtained from the other by an appropriate permutation of columns appearing in the sketches. Mathematically, distinguishing between different sketches of the same language L is rather artificial. T h e distinctions have been made because we prefer the more visually coherent sketches to the less visually coherent ones. T h e class of all sketches of a given language is determined by any one of its members. Observe t h a t the sketches of a language L are determined by what we call the sketch parameters of L. There is one sketch parameter for each spectral class C t h a t contains at least one primitive word. The parameter associated with such a C is the ordered pair consisting of the spectrum associated with C and the cardinal number of the set of primitive words in C. Formally expressed, the set sketch parameters is {(Sp(q), K) | q in C D Q, K = cardinal number of C fl Q, where C in P(L)}. In the discussion of the examples that follows, the cardinal number of N , i.e., the denumerable infinite cardinal, is denoted by the symbol oo. For Example 4.1, there are only two sketch parameters, ( N , o o ) and (0,oo). For Example 4.2 of the same Section, there are four sketch parameters, ({2, 3,4, 6 } , 1), ({3,4}, 1), ({3}, 1), and (0, oo}. For Example 4.3 the parameters are ( { l } , o o ) and (0,oo). Example 4.4 has an infinite set of parameters, {(n, 1) | n in N } and (0, oo). Example 4.5 has parameters ({1, 3, 5}, 1), ( N , oo), and (0, oo). Example 4.6 has the three parameters ( { 1 , 3 } , 1), ( N , 2), and (0,oo). Example 4.7 has an infinite set of parameters: for each m in N with m odd, ({n in N | m > n}, 1); for each m in N with m even, ({n in N | m < n } , 1); and (0, oo). Example 8 has five parameters ({2, 3}, 1), ({2n | n in N } , 1), ({3n | n in N } , 1), ( N , o o ) , and (0,oo). Example 4.9 has only two parameters, ( N , o o ) and {{2n | n in N } , o o ) . We say t h a t two languages are sketch equivalent if they can be represented by a common sketch. For example, the context-free language L of Example 4.1 is sketch equivalent to the regular language b(a + b)* since each can be represented by a sketch t h a t has a black left quadrant and a white right quadrant. Similarly the context-free language of Example 4.3 is sketch equivalent to the regular language ba* since each can be represented by a sketch t h a t has a white left quadrant and a right quadrant t h a t is white except for one horizontal black stripe at n = 1. Since the sketch parameters of a language determine the class of all possible sketches of a language, two languages are sketch equivalent if and only if they have the same sketch parameters. Consequently if L and V are languages for which the sketch parameters can be determined, then one may be
176 able to decide whether L and L' are sketch equivalent by comparing the sketch parameters of L and L'. 6
Sketches of Regular Languages
Associated with each language L in A* is a specific a u t o m a t o n M(L) t h a t recognizes L. The concept of the recognition of a language by an a u t o m a t o n is thoroughly classical, at least for the regular languages. A concise presentation in the general case has been included here as an Appendix. In this article we restrict our attention to the application of M(L) to the study of the spectra of regular languages, although we suspect t h a t similar applications are possible in additional contexts. T h e notation of the Appendix is used to give a thorough discussion of sketches of regular languages. Assume now t h a t L is a regular language in A+ and t h a t M{L) is its recognizing a u t o m a t o n . Let m be the number of states of M(L). By a flag F of length k in M(L) we mean a finite sequence of states F = {qi | 0 < i < k} for which qo is the initial state, k > 1, and the only state t h a t is a repeat of a preceding state is q^. Since M(L) has only m states, the m a x i m u m length of a flag is m. Consequently the regular languages possess only finitely many flags. Each such flag F determines a flag language L(F) = n{L(qi, <7i+i) | 0 < i < k — 1}, where each L(qi, <7;+i) is the language t h a t consists of all words x for which q\x = <7,+i. Since each of the languages L(qi,qi+\) is regular, each flag language is regular. Each word w in A+ belongs to one of the flag languages of L: Consider the infinite sequence of states, {[wn] \ n in N } . Since M(L) has only m states, there is a least integer i in N for which there is a j in N for which [w'] = [wl+i]. Let k be least in N such t h a t [wl] = [wt+k]. For every word x, we define x° to be the null word 1 so t h a t [a;0] = [1] is the initial state of M(L). Observe t h a t the sequence {[wn] \ 0 < n < i + k} is a flag and t h a t w lies in the language of this flag. Let P'(L) be the partition of A+ into the flag languages determined in A+ by L. T h e spectrum of any word w in A+ can be read from the flag of w. This is merely a m a t t e r of noting which of the states in the flag of w is a final state of M(L). There are several notable consequences of this fact: (1) When L is regular, Sp(w,L) is a regular ( = eventually periodic) subset of N ; (2) The projection o f Q x N into N preserves regularity; (3) T h e flag partition P' of A+ refines the spectral partition P\ (4) A regular language has only finitely many distinct spectra; and finally the fact t h a t allows the computation of the sketch parameters: (4) The spectral classes of a regular language are regular. To compute the sketch parameters of a language L we need the ability to determine the cardinal number of C C\ Q, for each C in P(L). Fortunately, the
177 delightful paper by M. Ito, M. Katsura, H.J. Shyr, and S.S. Yu [10] provides the algorithmic tools for determining these cardinal numbers when L is regular. T h e o r e m 1 The sketch parameters
of a regular language are
computable.
Procedure. Let L be a regular language and let M(L) be its recognizing automaton. List the flags determined by M(L). Compute each flag language. C o m p u t e the spectrum associated with each flag language. Construct the spectral partition P(L) of A+ by uniting those flag languages t h a t have the same associated spectra. To each of the spectral classes C apply the algorithms of [10] to decide whether C f) Q is empty, finite and non-empty, or infinite. If C D Q is finite and non-empty, count its elements. For each spectral class C, let Sp{C) = Sp{w, L) for any w in C. The sketch parameters of L are the ordered pairs (Sp(C), cardinal number of C fl Q), where C ranges through the set of spectral classes for which C fl Q is not empty. An Example Computation. Let L = (a + b)a*b*. One may verify t h a t M(L) has four states: [1], [a] = [b] = [6a], [ab], [aba] = [66a]. There are six distinct flags t h a t have non-empty flag languages: F(a): [1], [a], [a]; F(b): [1], [6], [66], [66]; F(ab): [1], [ab], [aba], [aba]; F(bb): [1], [66], [66]; F(ba): [1], [6a], [66a], [66a]; and F(aba): [1], [aba], [aba]. T h e languages of these six flags are: L{F{a)) = a+; L{F(b)) = 6; L(F{ab)) = a+b+ + ba+b+; L(F{bb)) = 66+; L(F{ba)) = ba+; L(F(aba)) - {a + b)a*b+a{a + 6)*. T h e spectra of these flag languages are: Sp{a) = N ; Sp(b) = N ; Sp{ab) = {1}; Sp{bb) = N ; Sp{ba) = {1}; and Sp(aba) — 0. The three flag languages, containing a, 6, and 66, respectively, have the same spectrum N . T h u s the union of these three flag languages, which is a + + 6 + 66+ = a + + 6 + , constitutes a spectral class. T h e two flag languages, containing a& and 6a, respectively, have the same spectrum {1}. T h u s the union of these two flag languages, which is a + 6 + + 6 a + 6 + + 6 a + = a + 6 + + 6a + 6* constitutes a second spectral class. Finally, the flag language containing a6a, namely (a + 6)a*6 + a(a + 6)*, constitutes the third spectral class of L. (In a more complicated example it would be necessary to apply the procedures of [10] to the each spectral class. The present example is sufficiently simple t h a t it is not necessary to explicitly invoke [10].) T h e first class contains exactly two primitive words, namely, a and 6. This gives the parameter ( N , 2 ) . We observe t h a t the second class contains the infinite set, a 6 + , of primitive words, which is adequate information to establish the parameter: ( { l } , o o ) . T h e third class contains the infinite set, 66 + a, of primitive words which gives the parameter: (0,oo). Once the sketch parameters of a language L have been computed, one can specify sketches of L. Each sketch is specified by a bijection of Q onto Z. Using the sketch parameters from the example above we provide a sketch of L: Let
178
B: Q -» Z be any bijection for which: B(a) = 1; B(b) = 2; B establishes a one-one correspondence between the second (infinite) spectral class above with the set {z in Z | z < 0}; and B establishes a one-one correspondence between the third (infinite) spectral class above with {z in Z | z > 3}. In this sketch of L, there is a vertical black stripe two units wide above a &. b (i.e., x = 1 & a; = 2). The remainder of the right quadrant is white. The left quadrant is white except for one horizontal black stripe at the level n = 1. Although this language is not bounded above, it is almost uniformly bounded above. It is not almost cylindrical, but it is uniformly eventual. From any given sketch of a language, all the other sketches can be obtained by permuting the columns of the product set Q x N. Observe that, from the sketch parameters of L, one can decide which of the ten language properties defined in Definitions 4.1, 4.2, 4.3, and 4.4 is possessed by L. Corollary 1 Sketch equivalence is decidable for each pair of regular languages. Each of the ten language theoretic properties defined in Section 4 is decidable for a regular language. Procedures. These decisions can be made after computing the sketch parameters of the languages in question, as described in the theorem. Two languages are sketch equivalent if and only if they have the same set of sketch parameters. The ten decisions concerning a regular language are easily made by an examination of the sketch parameters of the language. A Personal Footnote. The author finds pleasure in thinking about the sketching of languages in relation to the visual arts. In this article we have considered only black & white sketches of languages. Paintings in Barnet Newman's series 'The Stations of the Cross' can be viewed as black & white sketches of cylindrical languages. One can replace black & white by various pairs of colors. Moreover, one can imagine sketches of several different languages made on the same Q x N background. For each of these languages one can choose a different pair of colors. At this level one can view many classic paintings by Piet Mondrian, even ones as complex as 'Broadway Boogie-Woogie', as sketches of languages. One could consider attempting to relate formal language theory with conceptual art as well as visual art, possibly hybridizing the two. Appendix: The Minimal Automaton of an Arbitrary Language We review the following fundamental system of concepts from the classical theory of formal languages and automata: For each language L contained in A* and each word u in A*, let [u] = {x in A* \ ux is in L}. It is convenient to think of the
179
words in [u] as right contexts of u with respect to L. It is easily confirmed that the relation ~ in A* defined by u ~ v if and only if [u] = [v] is an equivalence relation in A* and that, when u ~ v holds, uy ~ vy holds for all y in A*. We call the equivalence classes [u], with « in A*, that are determined in this way by the language L, the states of L. We obtain an automaton, M(L), that is said to be the minimal automaton recognizing L as follows: Choose the state [1], where 1 is the null string in A*, as the initial state. Consider the set of states {[u] \ u is in L) to be the set of final states. For each letter a in A, define the state transitions determined by the letter a, by [u]a = [ua]. The words in L are then precisely those strings s = aia% • • .a„ which determine a walk in the automaton from the initial state to a final state in the following sense: [1], [l]a\ — [a\\, [ai]a2 = [ajc^],..., [ai<X2 • • • «n-i] a n — [01^2 • • • an] = [s]- In this letter-by-letter walk from [1] to [s], a state may be entered several times. In introductory courses in the theory of formal languages and automata it is often assumed that the set of states is finite. The discussion above did not require finiteness of the number of states of L, i.e., of the number of distinct equivalence classes [u] where u is in A*. We have not assumed that the number of states of the minimal automaton M(L) is finite. Those languages L for which the set of states of M(L) is finite are the regular languages. Acknowledgment. The author thanks G. Thierrin for initiating him into the study of periodic phenomena in formal language theory by inviting him to participate in the joint work reported in [9]. The present work stems from the author's continuing interest in such periodicity. References 1. J.A. Anderson, Semiretracts of a free monoid, Theor. Computer Sci., 134 (1994), 3-11. 2. J. A. Anderson, T. Head, The lattice of semiretracts of a free monoid, Intern. J. Comput. Math., 43 (1992), 127-131. 3. W. Forys, T. Head, The poset of retracts of a free monoid, Intern. J. Comput. Math., 37 (1990), 45-48. 4. J. Harrison, On almost cylindrical languages and the decidability of the DOL and PWDOL primitivity problems, Theor. Computer Sci., 164 (1996), 29-40. 5. J. Harrison, J. Loftus, On almost cylindrical languages and the 2-code infix problem, manuscript. 6. T. Head, Expanded subalphabets in the theories of languages and semigroups, Intern. J. Computer Math., 12 (1982), 113-123.
180
7. T. Head, Cylindrical and eventual languages, in Mathematical Linguistics and Related Topics (Gh. Paun, ed.), Editura Academiei Romane, Bucurefti, 1995, 179-183. 8. T. Head, B. Lando, Periodic DOL languages, Theor. Computer Sci., 46 (1986), 83-89. 9. T. Head, G. Thierrin, Hypercodes in deterministic and slender OL languages, Information & Control, 45 (1980), 103-107. 10. M. Ito, M. Katsura, H.J. Shyr, S.S. Yu, Automata accepting primitive words, Semigroup Forum, 37 (1988), 45-52. 11. B. Lando, Periodicity and ultimate periodicity of DOL systems, Theor. Cornput. Sci., 82 (1991), 19-33. 12. M. Lothaire, Combinatorics on Words, Addison-Wesley, Massachusetts, 1983. 13. R. McNaughton, S. Papert, Counter-Free Automata, MIT Press, Cambridge, MA, 1971. 14. A. Salomaa, Formal Languages, Academic Press, New York, 1973.
181 O N S P A R S E OL L A N G U A G E S O V E R T H E B I N A R Y
ALPHABET
JUHA HONKALA
Turku
Department of Mathematics University of Turku FIN-20014 Turku, Finland E-mail: [email protected] and Centre for Computer Science (TUCS) Lemminkaisenkatu 14 FIN-20520 Turku, Finland
Latteux and Thierrin have characterized sparse context-free languages by showing that a context-free language L is sparse if and only if L is bounded. We prove a similar result for binary OL languages which are not DOL languages.
1
Introduction
A language L is called sparse if there exists a polynomial P(n) such that for any nonnegative integer n, L contains at most P(n) words of length n. Latteux and Thierrin [5] have shown that a context-free language L is sparse if and only if L is bounded. By definition, a language L C X* is bounded if there exist words wi,..., wm £ X* such that L C w\w*2 ...w*m. The result of Latteux and Thierrin implies various decidability results for sparse context-free languages (see Ginsburg [1]). In this paper we show that a binary OL language L which is not a DOL language is sparse if and only if L is bounded. Hence, in this respect binary OL languages behave exactly as context-free languages. This is certainly surprising since the definitions of context-free and OL languages are entirely different. For binary DOL languages sparseness and boundedness are not equivalent. In fact, every DOL language is sparse but only some binary DOL languages are bounded. We assume that the reader is familiar with the basics concerning OL languages (see Rozenberg and Salomaa [7,8]). In the proofs we use methods from combinatorics of words (see Lothaire [6]). Note that sparse languages are called polynomially limited in Latteux and Thierrin [5] and poly-slender in Hie, Rozenberg and Salomaa [4].
182 2
Definitions and Results
Let X be a finite alphabet and X* be the free monoid generated by X. The length of a word w is denoted by |iy|. By definition, the length of the empty word e equals zero. A nonempty word w £ X* is called primitive if there does not exist a positive integer p > 1 and a word u £ X* such that w = up. If u £ X* is a nonempty word, then the number of occurrences of u as a factor of a word w £ X* is denoted by \w\u. If L C X* is a language, a nonempty word u £ X* is said to be unbounded in L, if for every integer ./V, there exists a word w £ L such that |io| u > N. A OL system is a triple G = (X, r, w) where X is a finite alphabet, T is a finite substitution on X and w £ X* is the axiom. The language L(G) of G is defined by oo
L(G) = (J r»M. n=0
If G = (X, r, it;) is a OL system, a letter x £ X is said to be deterministic if 7"" (a;) is a one-element set for any n > 0. If every letter of X is deterministic, G is called a DOL system. If G = (X, r, w) is a OL system and a; £ X we denote G s = (X,T ) a : ). We will prove the following theorem. Theorem 1 Let X — {a, 6} and G = (X, r, w) be a OL system which is not a DOL system. Then L(G) is sparse if and only if L(G) is bounded. By the result of Latteux and Thierrin [5] bounded languages are sparse. Hence to prove Theorem 1 it suffices to show that sparseness implies boundedness for binary OL systems which are not DOL systems. This will be done in the next section by using ideas from Honkala [3]. It is necessary to exclude DOL languages in Theorem 1. Example 1. Let X = {a, 6} and define the DOL system G = (X, r, a) by r(a) = ab, r(b) = 6a. Then every word of L(G) is a prefix of the Thue-Morse word. Hence no word of L(G) contains a factor u 3 where u £ X* is a nonempty word (see Salomaa [9]). Therefore L(G) is not bounded. It is not difficult to see that every DOL language is sparse (see, e.g., Rozenberg and Salomaa [7]). Head and Lando [2] have shown that boundedness is decidable for DOL languages. Theorem 1 cannot be generalized to OL systems over arbitrary alphabets.
183
Example 2. Let X = {a, 6, c, d) and define the OL system G = (X, r, cd) by r(a) — a,
r(6) = 6,
T(C) = c2,
r(d) = {da, cc?6}.
Denote £o = a and x\ = b. We prove inductively that Tn(cd) = {c2K+i^n-1+-+i^-2+i'dxi,Xin_1
. ..Xil
|
ia G {0,1} for 1 < a < n}
(1)
for all n > 0. First, if n = 0, it is clear that (1) holds. If (1) holds for n > 0 we have Tn + l(cd)=T{Tn{cd))
=
{ c 2 n + l +*i-2 n +...+i»- l -4+i n -2 d a a .. i i a .. i i _ i
^
{c2n+1+ii-2"+...+U-i-*+i«-2+idbx.nX.n_i {c2n+1+i^n+-+i^2+i^dxin+1xin
|ia Xii\
. ,.Xil
G{0,1} ia G
for l < a < n } U
{o, 1} for 1 < a < n} =
| ia G {0,1} for 1 < a < n + 1}.
Hence (1) holds for all n > 0. Therefore L(G) = {c2n^2n-1+-+i—2+">dxinxin_1...xil
|
n > 0 and i a G {0,1} for 1 < a < n}. Now, if n > 0 and the n-tuples ( i i , . . . , i„) and ( j i , . . . ,jn) are different, we have | „ 2 n + i 1 - 2 n - 1 + ...+i„_i-2+f„ .
| _
2n+h-2n~1
+ ... + in+n
+
l^
2n+j1-2n~1
+ ... + j n + n+l
=
1
I 2 " + j 1 2 — + ...+j„_i-2+jn . .
|
Hence Tn(cd) contains no two words of equal lengths. Furthermore, if y G rn(cd), we have 2n +n+l<\y\
<2n+l
+n.
Consequently L(G) contains no two words of equal lengths showing that L(G) is sparse. On the other hand, every word in {a, b}* occurs as a factor in some word of L{G). Therefore L(G) is neither a D0L language nor a bounded language (see Rozenberg and Salomaa [7] and Ginsburg [1]).
184
3
Proofs
We start with a lemma concerning the distribution of letters in OL languages. Lemma 1 Let X = {a, b] and G = (X, r, w) be a OL system such that a and b are unbounded in L(G). Then there exists a positive real number a such that the set {v e L(G) I \v\a > \v\°}
(2)
is infinite. Proof. Assume that (2) is a finite set if a = | . It follows that r(b) C 6*. Because a is unbounded in L(G), r(a) contains a word with at least two as. Hence for each n > 1 there exists a word vn G Tn(w) such that
kU>2n. Clearly, there exists a positive integer s such that \Vn\
<
S"
for all ri > 1. Consequently \v„\a>
\vn\a
for all n > 1 if a satisfies sa < 2. Hence the set (2) is infinite for this value of a.
• The following two lemmas give necessary conditions for sparseness. Lemma 2 Let X = {a,b} and G = (X,T,W) be a OL system such that a and b are unbounded in L{G). If there exists a positive integer k such that Tk(a) contains two different words having equal lengths then L{G) is not sparse. Proof. By Lemma 1 there exists a positive real number a such that (2) is an infinite set. Suppose w\,W2 G Tk(a) have equal lengths and w\ ^ wi- Choose a word u G Tk{b). If v G L(G) satisfies
H«>IHa then L[G) contains at least 2'"' different words of length \v\a
• \W\\+
\v\b
• \u\.
If P(n) is a polynomial we have
2 H ° < P ( M a > 1 | + M 6 >|) only for finitely many words v. This shows that L(G) is not sparse.
CI
Of course, Lemma 2 remains true if the letter a is replaced by the letter b.
185 L e m m a 3 Let X = {a,b} and G = (X,r,w) be a OL system such that a and b are unbounded in L(G). If there exist a nonempty word u G X* which is unbounded in L(G) and a positive integer k such that rk(u) contains two different words having equal lengths, then L(G) is not sparse. Proof. Because u is unbounded, u is a factor of some word in L(Ga)UL(Gb). Hence there is a letter x G X, a positive integer m and two different words 2/i 12/2 £ Tm{x) of equal lengths. By L e m m a 2, L{G) is not sparse. • T h e following l e m m a proves Theorem 1 in a special case. L e m m a 4 Let X — {a, 6} and G = (X, T, W) be a OL system such that r(a) — a, and r(b) C 6 U ba{a, ba}*b, where r(b) is not a one-element
set. If L(G) is sparse, then L{G) is bounded.
Proof. W i t h o u t restriction we assume t h a t w g- a*. Suppose L(G) is sparse. Then L(Gb) is sparse. It suffices to prove t h a t L(Gb) is bounded. Let i be the smallest integer such t h a t ba%b is a factor of some word of r(b). Hence balba% is unbounded. By L e m m a 3 there exist a nonempty word u G X* and integers t > 1, i\ < . . . < it such t h a t r(fea i ) = u ! l + . . . + u i ' .
(3)
(Here and in the sequel we denote r{x) = y\ + ... + yq if T(X) = {yi,..., x G X.) We claim t h a t
yq},
L{Gb) C (6a*')*&. Suppose on the contrary that there exist words y\,.. ba'yiba'y2
•. .ba'yrb
G L(Gb)
(4) ., yr G a* such t h a t (5)
where at least one of the words yj, 1 < j < r — 1, is nonempty. Because the set {a,u} is a code, (3) and (5) imply t h a t T{ba'y\baly2 •. .ba'yrb) contains at least two different words of equal lengths. By L e m m a 2 this is not possible because L{Gb) is sparse. Therefore (4) holds. This implies t h a t L{Gb) is bounded. • Now we can conclude the proof of Theorem 1. T h e proof of the final l e m m a is a modification of the proof of Theorem 1 in Honkala [3]. L e m m a 5 Let X = {a, 6} and G = (X, r, w) be a OL system which is not a DOL system. If L{G) is sparse, then L(G) is bounded. Proof. W i t h o u t restriction we assume t h a t L(G) is infinite. We may also assume t h a t if x G X is nondeterministic then T(X) contains at least two words. If necessary, we replace G by the OL systems G(u) = (X, r 2 , u) where u G WUT(W).
186 If L(G) is sparse, so are L(G(u)). Furthermore, if L(G(u)) is bounded for all u G w U T(W), SO is L(G). If a or 6 is bounded in L(G), then it is clear t h a t L(G) is bounded. We suppose t h a t a and 6 are unbounded in L[G). C a s e 1. T{O) C a*. C a s e 1.1. 6 2 is unbounded. If there are words u, v G r(6) such t h a t uv ^ rnt, L e m m a 3 implies t h a t L(G) is not sparse. We continue with the assumption t h a t there exists a word v £ X* such t h a t r(b) C v*. C a s e 1 . 1 . 1 . r{b) C o ' . This is not possible because 6 is unbounded. C a s e 1.1.2. r{b) Cb*. Let t be an integer such t h a t w G (a*b*)1. Then L(G) C (0*6*)', implying t h a t L(G) is bounded. C a s e 1.1.3. |v| a > 1, \v\b > 1 and r(6) contains a nonempty word. Because 6 is nondeterministic, there exist nonnegative integers t > 2, «'i < i
If r ( a ) = e, then we have L(G) C w U v*. Hence L(G) is bounded. Suppose r ( a ) ^ e. Because 6 is unbounded, there exists a positive integer j such t h a t ba?b is unbounded. Furthermore, because the set {a,v} is a code, r(baJb) contains two different words of equal lengths. Hence L(G) is not sparse. C a s e 1.2. b2 is bounded. Because 6 is unbounded, r(b) contains a word v with \v\b > 2. Because b2 is bounded, no element of r(6) contains two consecutive 6s. Hence 6 is nondeterministic. Let v\,V2 G T ( 6 ) with i»i ^ ^2 and |DI|{, > 1. Then, for sufficiently large N, the words v\aNv% and V2dNvx are different. Therefore, if there exist infinitely many M such that baMb is unbounded and r(a) ^ s, then L(G) is not sparse. C a s e 1.2.1. e G r(a). Now r(by C L(G) for infinitely many values of j . Hence, if there exist V\,V2 G r(b) such t h a t V1V2 7^ ^2^1, -^(G) is not sparse. Suppose then t h a t there is a word v G X* such t h a t r(b) C v*. If r(a) = e, then -t(G) C « i U » * is bounded. If r ( a ) 7^ e, then there exist infinitely many M such t h a t baMb is unbounded implying t h a t L(G) is not sparse. C a s e 1.2.2. There is an integer j > 2 such t h a t a-7 G i"(a). Now, there again exist infinitely many M such t h a t baMb is unbounded. Hence L(G) is not sparse. C a s e 1.2.3. r(a) = a.
187
If e £ r(b) or r(6) contains a word which begins or ends with a, then we again have infinitely many M such that baMb is unbounded. Otherwise, we have r(b) C
bUba{a,ba}*b
and the claim follows by Lemma 4. Case 2. r(b) C 6*. This case is symmetric with Case 1. Case 3. a2 is unbounded. If L(G) is sparse, then there exists a primitive word v £ X* such that T2 (a) C v*. Case 3.1. r2(a) contains a word having both as and 6s. Consequently, a is nondeterministic. Hence there exist integers t > 2, i\ < . . . < it, such that r2(a) =vh
+... + vu.
If there exists a word u £ T2(b) such that u ^ v*, then there exist at least two words in T4(a2) of the same length. Hence L(G) is not sparse. If, on the other hand, r 2 (6) C v*, then the equation L(G)
= wU T(W) U T2(L(G))
CWU
T(W) U V*
implies that L(G) is bounded. Case 3.2. r{a) C a*. Now we use Case 1. Case 3.3. r(a) C 6*, r(a) ^ e. Because a2 is unbounded, it is not possible that r(6) C 6*. By Case 3.1 it remains to consider the case T2(a) C a*. Now the claim follows by Case 1, because
L(G) =
(J
L(G(u))
where G(u) = (X, r2,u). (Note that no G(u) is a DOL system.) Case 4. b2 is unbounded. This case is symmetric with Case 3. Case 5. a2 and b2 are bounded. In this case there is a positive integer M such that L{G)C{ueX*\\u\a2+\u\b2<M}.
(6)
The claim follows because the right hand side of (6) is a bounded language. D N o t e . Research supported by the Academy of Finland.
188
References [1] [2] [3] [4] [5] [6] [7] [8] [9]
S. Ginsburg, The Mathematical Theory of Context-Free Languages, McGraw-Hill, New York, 1966. T. Head, B. Lando, Bounded DOL languages, Theor. Computer Set., 51 (1987), 255-264. J. Honkala, On slender OL languages over the binary alphabet, Acta Inform., 36 (2000), 805-815. L. Hie, G. Rozenberg, A. Salomaa: A characterization of poly-slender context-free languages, Theoret. Inform. AppL, 34 (2000), 77-86. M. Latteux, G. Thierrin, On bounded context-free languages, J. Inform. Process. Cybern., 20 (1984), 3-8. M. Lothaire, Combinatorics on Words, Addison-Wesley, Reading, Mass., 1983. G. Rozenberg, A. Salomaa, The Mathematical Theory of L Systems, Academic Press, New York, 1980. G. Rozenberg, A. Salomaa, eds., Handbook of Formal Languages, Vol. 1-3, Springer, Berlin, 1997. A. Salomaa, Jewels of Formal Language Theory, Computer Science Press, Rockville, 1981.
189 ON G E N E R A L I Z E D S L E N D E R N E S S OF C O N T E X T - F R E E LANGUAGES
L U C I A N ILIE Department
of Computer Science, University of Western N6A 5B7 London, Ontario, Canada E-mail: i l i e 6 c s d . u w o . c a
Ontario
A language L is k-poly-slender if the number of words of length n in L is of order 0(nk) and Parikh k-poly-slender if the number of words with the same Parikh vector is of order 0(71*). We give a characterization of Parikh fc-poly-slender context-free languages and prove the decidability of both fc-poly-slenderness and Parikh /c-poly-slenderness for context-free languages.
1
Introduction
The notion of the number of words of the same length in a language is certainly a very basic one in language theory. An infinite sequence ( # i ( n ) ) n ^ o can be associated in a natural way with a language L: # L ( T I ) is the number of words of length n in L. This idea appeared already in [2], where Berstel considered the notion of the population function of a language L which associates, with every n, the number of words of length at most n in L. Showing the importance of the problems, some results in this area have been proved several times. We recall briefly in the following the history of such results. The languages for which # i ( n ) ' s bounded from above by a fixed constant were called semidiscrete by Kunze, Shyr and Thierrin in [14] and slender in Andra§iu et al. [1]. The slender regular languages have been characterized as finite unions of sets of the form uv*w in [14] but the result was not well known and it was proved again independently by Paun and Salomaa [19] and Shallit [22]. In the context-free case, Latteux and Thierrin [15] characterized the slender context-free languages as finite unions of sets of the form {uvnwxny | n J> 0}, which they called iterative languages. Again, the result was not widely known and the same characterization was conjectured by [19] and shown to be true independently by Hie [11] and Raz [20]. The characterization has been strengthened in [12] where some upper bounds on the lengths of the words u,v,w,x,y were given. Another proof of this characterization has been given later as a corollary of a theorem of Honkala [10]. Also, the decidability of the slenderness problem for context-free languages was proved by [15]. The decidability was proved again by [20] and as a simple consequence of the stronger characterization of [12]. The case when #1,(71) is bounded by a polynomial (we call such L poly-slender, according to Raz [20]) has been
190
considered by Latteux and Thierrin [16] who proved that, for context-free languages, the notions of poly-slenderness and boundedness coincide. The result appeared then in [20]. In the case of regular languages, Szilard et al. [23] gave a fine characterization based on the order of the polynomial which bounds # L ( n ) . Languages L for which # i ( n ) = Q(nk) were called k-poly-slender by Hie et al. [13] who gave a characterization of fc-poly-slender context-free languages which has as a corollary the result of [23]. Another notion of slenderness, called Parikh slenderness, was introduced and studied by Honkala [7] in connection with ambiguity proofs of context-free languages. A language L is Parikh slender if the number of words in L which have the same Parikh vector is bounded by a fixed constant. In [8] it is shown that Parikh slenderness is decidable for context-free languages. Honkala has then generalized several results we mentioned above by proving in [9] that both slenderness and Parikh slenderness are decidable for all bounded semilinear languages. A characterization of Parikh slender contextfree languages was shown also by Honkala in [10]. Besides the above mentioned results, there has been recently a lot of attention devoted to other aspects of slenderness. We mention only that some applications of the slender languages to cryptography are shown in [1], Shallit [22] investigated slender regular languages in connection with numeration systems, and the slenderness of L-languages has been considered by Dassow et al. [4], and Nishida and Salomaa [18]. In this note, we generalize the notion of Parikh slenderness by introducing Parikh k-poly-slenderness, which means that the number of words with the same Parikh vector is bounded by a polynomial of order k. We characterize the context-free languages which are Parikh fc-poly-slender, generalizing the result for Parikh slender languages by Honkala [10]. We also prove that both Parikh kpoly-slenderness and A-poly-slenderness are decidable for context-free languages, thus generalizing the corresponding results for slenderness in [15,20,12] and for Parikh slenderness in [8]. Some other effective constructions are also given. Finally, we introduce a further generalization, which has both slenderness and Parikh slenderness as particular cases.
2
Slenderness
We give in this section the basic definitions of various notions of slenderness. Let us fix first some notations. For an alphabet S, we denote by E* the free monoid generated by T, and by e its identity. For a word w and a letter a, \w\ is the length of w and # a ( w ) is the number of occurrences of a in w. For basic notions and results of combinatorics on words and formal languages we refer to [3,17] and [5,21], respectively. For a language L, we define the function # L : N —> N
191
by # i ( n ) = card({to G L | |w| = n}). This is referred to as the complexity (function) of L. For an integer k ;> 0, L is called k-poly-slender (see [13]) if # i ( n ) = 0(n fc ). L is poly-slender (as defined in [20]) iff it is fc-poly-slender, for some k ^ 0. Clearly, 0-poly-slender means slender as defined in [1]. We give next the characterization of [15,11,20]. Theorem 1 (Latteux and Thierrin [15], Hie [11], Raz [20]). A contextfree language is slender (or, 0-poly-slender) iff it is a finite union of sets of the form {uvnwxny \ n ^ 0}. The characterization of ^-poly-slender languages from [13] is given in the next section as we need some more definitions. Next we recall the connection between poly-slenderness and boundedness. A language L C E* is called bounded if there are some words w\, tu2> • • • , wn G E* such that i C t n j i o j . . . ^ . It is clear that the class of poly-slender languages is the same with the class of languages with the population function polynomially limited. Therefore, the characterization theorem of [16] can be written as below (it appears in this form in [20]). Theorem 2 (Latteux and Thierrin [16], Raz [20]). A context-free language is poly-slender iff it is bounded. Assume the alphabet is E = {a\, a?, •. • , ap}. The Parikh mapping is defined as # : E* —• N p , ¥(u>) = ( # a i H , # a 2 H , . . . , # a , H ) , for any w; G S*. For a vector a G N p , a = ( a i , a 2 , . . . ,ap), we denote \a\ = Y^=iailanguage L C E, consider the function ^L : N —> N defined by
F° r
a
^^(n) = maxp c a r d ( L n l ' ~ 1 ( a ) ) . a£» \a\~n
This is refered to as the Parikh complexity (function) of L; it gives the maximum number of words in L with the same Parikh vector, where maximum is taken from all vectors with the same sum of components. Put otherwise, the Parikh complexity of L at point n gives the maximum number of words with the same Parikh vector among all words of length n in L. For an integer k ~>> 0, L is called Parikh k-poly-slender if * L ( n ) = 0(n fc ).
192 L is Parikh poly-slender if it is Parikh fc-poly-slender, for some k ;> 0. Clearly, Parikh 0-poly-slender means Parikh slender as defined in [7]. 3
Dyck Loops
We start with the definition of a Dyck loop, as given in [13]. A similar notion (called DL language) has been introduced independently by Honkala [10]. Consider the Dyck language of order m,m^ 1, Dm C {[;,]; | 1 ^ i
nm : (E U {[,-,],• | 1 ^ i ^ m})* —>E*, by /*«!,... ,nTO (a) = a, f° r
/,
1 _,/*,
"til,..
,"mUW
~~ "»
an
y a G E,
for any
l^i^m.
»
Put z — z\Z2 • • -Z2m, Zj £ {[i, ]i | 1 ^ i ^ m}. Then D C E* is a m-Dyck loop if, for some u,-, u,-, WJ, Z as above, -D = {hnu...
tnm{wQZiWiZ2W2
. . . Z2mU>2m) | n,- ^ 0, 1 ^ 2 ^ m } .
(1)
We shall call z an underlying word of D. (Clearly, z is not unique.) Also, h will stand for /zi,1,... ,1 and will be called an underlying morphism of D. D is a £>j/cA; Zoop iff it is a m-Dyck loop, for some m. Notice that if / < m, then any /-Dyck loop is also a m-Dyck loop. We give below two examples of Dyck loops which will be used also later. Example 3. For the underlying Dyck word z — [ljikbja^, w e construct the Dyck loop Dj = {(aa)ni(ba)n'b{ababab)n*an3{bb)nsbn'
\ n,- J> 0}.
(2)
About the underlying morphism we mention only that the images of any of ]4 and ]6 are empty. Example 4. The underlying Dyck word for the Dyck-loop D2 = {(abab)nia{bababa)n2aabn2{bb)n:ibn
| m ^ 0}, (3)
is z = [lbhUUkMsJsh and we assume ft(]5) = e. We can give now the characterization of [13] (which is a generalization of Theorem 1). (Notice that a 1-Dyck loop is an iterative language as in [15] or a paired loop as in [19,11,20].)
193 T h e o r e m 5 (Hie, R o z e n b e r g , a n d S a l o m a a [13]). For any k ;> 0, a context-free language is k-poly-slender iff it is a finite union of (k + \)-Dyck loops. We have in the following lemma several connections between the above notions. L e m m a 6. Consider a language L and an integer k ^ 0. Then (i) If L is k-poly-slender, then L is also Parikh k-poly-slender, (ii) If L is Parikh k-polyslender, then L is [k + p — 1)-poly-slender (p = card(E)^. (Hi) If L is Parikh k-poly-slender context-free, then L is a finite union of [k + p)-Dyck loops. Proof, (i) is clear from the definitions. For (ii), it is enough to notice t h a t there are 0 ( r t p _ 1 ) different vectors a £ N p with | a | = n. (iii) follows from (ii) by way of Theorem 5. • 4
Bounded Languages
T h e following result of Ginsburg and Spanier [6] will be useful for our purpose. T h e o r e m 7 ( G i n s b u r g a n d S p a n i e r [6]). The family of bounded contextfree languages is the smallest family which contains all finite languages and is closed under the following operations: (i) union, (ii) catenation, (in) (x,y)*L = U n > o x"Lyn, forx,y words. R e m a r k 8. Clearly, Theorem 7 is still valid if, instead of finite languages, one starts from unary languages (that is, languages containing one word only). Moreover, if one starts from unary languages and uses only the operation (ii) and (iii) from Theorem 7, then what is obtained is always a Dyck loop. Conversely, any Dyck loop can be obtained in this way. Indeed, this is clear from the definition of the Dyck loops; the role of the production S —> SS is the same with the one of the catenation and the role of a production S —>• [,-5],- is the same with the one of the operation *, in the sense t h a t we use (u,-, V{) -k L. Therefore, from Theorems 2 and 7 and L e m m a 6, we get the following result. T h e o r e m 9. For a context-free language L, the following assertions are equivalent: (i) L is bounded, (ii) L is poly-slender, (iii) L is Parikh poly-slender, (iv) L is a finite union of Dyck loops. Proof, (i) and (ii) are equivalent by Theorem 2. (ii) and (iii) are equivalent by L e m m a 6. (i) and (iv) are equivalent because of Remark 8. • 5
C h a r a c t e r i z a t i o n of P a r i k h
We give in this section a context-free languages, for given for the case k = 0 { a i , a 2 , • •. ,ap}. We have
fc-Poly-Slenderness
complete characterization for Parikh fc-poly-slender a fixed k ^> 0. This generalizes the characterization by Honkala [10]. Recall t h a t our alphabet is £ = seen in L e m m a 6(iii) that any Parikh fc-poly-slender
194
context-free language is a finite union of (k + p)-Dyck loops (or, equivalently, (k + p — l)-poly-slender). The converse of this assertion is false, as proved by the following example. Consider the language L = a*b*ca*b*c. L is 3-polyslender and Parikh 2-poly-slender but not Parikh 1-poly-slender. (Here p = 3 and k = 1.) Some additional hypotheses are needed for the converse. One notion which we need about Dyck loops is that of irreducibility. An m-Dyck loop D is called irreducible if it cannot be written as a finite union of (m — 1)-Dyck loops. D is called reducible if it is not irreducible. Notice that, if I < m, then any irreducible /-Dyck loop is a m-Dyck loop but not an irreducible one. In order to understand the irreducibility of Dyck loops, we shall recall few things from the proof of Theorem 5 in [13] (Theorem 8 there). We only show on some examples when and how a reducible Dyck loop can be reduced. For a thorough analysis of the reducibility of Dyck loops, we refer to [13]. Example 10. Consider the Dyck loop D\ from Example 2; we emphasize the primitive root of each word u, or v,: Di = {a 2 n i (6a) n i 6(a6) 3 n 2 a n 3 6 2 n 3 6" 2 | n,- ^ 0}. By grouping together the ns-powers whenever possible (that is, when appropriate conjugated primitive roots are found), D\ is written as Dx = { a 2 n i 6 ( a 6 ) n i + 3 n 2 a n 3 6 n 2 + 2 n 3 | m J> 0}. To see when a new tuple (ni, ri2,113) gives a new word in D\, we have to analyze the system 2nx = 0 n\ + 3n 2 = 0 n3 = 0 n 2 -I- 2n 3 = 0 Because the above system has only trivial solutions, D\ is irreducible. As seen above, we have associated a matrix A with a Dyck loop D: A = (aij) ! < ^ c where
0>ij 3-1*6
(4)
from the associated system (as above for D\) t
y dijjij = 0, for any 1 ^ i ^ c,
(5)
195 and c is the number of equations obtained after grouping the rij-powers in D. In Example 10, c = 4 and the associated matrix A is
/200\ 1 30 A = 00 1 \012/ In general, a Dyck loop is irreducible if and only if the columns of A are linearly independent, as it is the case for D\ above. (By a linearly independent set of vectors from N p , we mean linearly independent over Q p .) We notice t h a t always c ^ m + 1 and when c = m + 1, then rank(yl) = m. Next we give an example of a reducible Dyck loop which we also reduce. E x a m p l e 1 1 . Consider the Dyck loop in Example 3; again, we emphasize the primitive roots: D2 = {{ab)2nia(ba)3n'aabn2b2n3bn'abania3n:iansa2ni
\ m £ 0}.
We then group the powers as much as possible and get D2 = { a ( 6 a ) 2 n i + 3 n 2 a a 6 n 2 + 2 n 3 + n ' ' a 6 a 2 n i + 3 n 3 + n - + n 5 | m J> 0 } . T h e m a t r i x A corresponding to D2 (as in (4)) is /2 3 0 0 0\ , 4 = 0 12 1 0 . \2 0 3 1 1/ Now the columns of A are linearly dependent. We have the relation A3 = 2A4 + A$ between the columns A, of A which allows us to write D2 as D2 = { a ( 6 a ) 2 m i + 3 m 2 a a 6 m 2 + m 3 a 6 a 2 m i + m 3 + m 4 | m* > 0 } . T h e column A3 (together with the pair of parentheses [3J3) dissapeared. T h e current m a t r i x has still linearly dependent columns and therefore the Dyck loop can be reduced further. See [13] for details. So far we have associated with a Dyck loop D a m a t r i x A and seen that D is irreducible if and only if the columns of A are linearly independent. In general, the irreducibility of D is equivalent with several facts as seen in the next result. L e m m a 1 2 . For any m-Dyck loop D, we have that the following assertions are equivalent: (i) D is reducible, (ti) ^D(n) = 0 ( n m - 2 ) , (in) the columns of the matrix A associated with D (from (4)) are linearly dependent (over Qp), that is, i&nk(A) ^ m — 1. Therefore, #£>(«) *'* of order Q(nk) for some 0
196 For a Dyck loop associated a m-Dyck how many
proof of Lemma 12, we refer to [13]. We define the A-rank of a D, denoted va,nkA(D), as being the rank of the m a t r i x A (from (4)) with D. Next, we associate another matrix to a Dyck loop. Consider loop D given by (1). For any vector a £ M p , when trying to find out words in D have a as Parikh vector, we analyze the system 2m
m
(ujVj)rij j=i
in unknowns rij,l
= a*, for all 1 ^ i ^ p,
(6)
j=\
<; j ^ m. We therefore associate with D the matrix: B
= (bij) i < : ^ P > bij = #at{ujvj).
(7)
There is a £ N p such that the number of solutions of the system (6) is of order For a 0 ( n m - r a n k ( B ) ) a n d i w h e n r a n k ( £ ) < m > j t j s n o t 0 f order 0( n ™-rank(B)-i) m-Dyck loop D, we define the B-rank of D, denoted r a n k s (-D) as the rank of the associated matrix B. For a m-Dyck loop D, we say t h a t m is the order of D, and denote it by ord(Z)). W i t h this notation, D is irreducible iff r a n k ^ ( D ) = o r d ( D ) . It is i m p o r t a n t to notice that ord(D) depends on the representation of D as in (1). This is not true for r a n k ^ D ) and r a n k s { D ) . When we reduce D (if possible), the newly obtained Dyck loop(s) will have the order ord(D) — 1 but the same ranks r a n k ^ ( D ) and r a n k s [D). For example, the Dyck loop £>2 in Example 11 has initially order 4 but, after the reduction, the order is reduced to 3. In what follows, it will be understood t h a t , when considering ord(D) for some Dyck loop D, a representation of D as in (1) is tacitly assumed to be given and ord(D) is the number of n,-s in t h a t representation. T h e following l e m m a t a will be essential for both the characterization and the decidability of Parikh fc-poly-slenderness. L e m m a 1 3 . For an irreducible Dyck loop D, if we denote kr> = ord(D) — r a n k s ( J D ) , we have that (i) either ko = 0 and D is Parikh Q-poly-slender (ii) or kr) > 0 and D is Parikh kp-poly-slender but not Parikh [kr> — \)-poly-slender. Proof. Consider the matrix from (7) and the system from (6) associated with D. As we already noticed, the m a x i m u m number of solutions of the system (6), which gives the m a x i m u m number of words with the same Parikh vector, is of order 0(nkr>) but, when ko > 0, not of order 0{nkD~1). Therefore, if ho = 0, then D is Parikh 0-poly-slender. If krj > 0, then D is Parikh &£>-poly-slender but not Parikh (krj — l)-poly-slender. • Using L e m m a 13, we obtain the following relation between the Parikh kpoly-slenderness and the Dyck loops of a language. L e m m a 1 4 . Let L be a bounded context-free language written as a finite union
197 of irreducible Dyck loops. Then min{& | L is Parikh k-poly-slender } = max{ord(JD) - ranks (£>) | D Dyck loop ofL).
(8)
Proof. We notice first that, due to Theorem 9, L is both Parikh poly-slender and finite union of Dyck loops, and thus both sides of (8) are well defined. Denote the value of the left-hand side of (8) by k0. Obviously, k0 ;> 0. For any Dyck loop D of L (we assume D irreducible!), we have that D is Parikh fco-poly-slender since L is. Therefore, by Lemma 13, we get ord(D) — ranks (-D) ^ &o- If &o = 0, then any Dyck loop D will be Parikh 0-poly-slender and, by Lemma 13, will have ord(D) = ranks(D) a n d (8) is true. If ko > 0, since L is Parikh &o-poly-slender but not Parikh (k^ — l)-poly-slender, there must be a Dyck loop Do with the same property. But then, by Lemma 13, it follows that oid(Do) — ranks(-Do) = &oAgain, (8) is true. • We can give now the characterization of the Parikh fc-poly-slender contextfree languages. It generalizes the following characterization of Parikh slender context-free languages from [10]. Theorem 15 (Honkala [10]). A context-free language is Parikh slender if and only if it is a finite union of Dyck loops D with ord(I?) = ranks (D). Theorem 16. For any k J> 0, a context-free language is Parikh k-poly-slender iff it is a finite union of irreducible Dyck loops D such that ranks(D) ^ oid(D) — k. Proof. Follows directly from Lemma 14. • One notices that something is missing in Theorem 15: the Dyck loops are not required to be irreducible as in the statement of Theorem 16. As we shall see in a moment, ord(D) = ranks(D) implies that rankyi(-D) = ord(D), that is, D is irreducible, and thus Theorem 15 appears indeed as a partciular case of Theorem 16. In fact, we shall see that there is a close connection between the two ranks. We shall give in what follows another characterization of Parikh ft-poly-slender context-free languages which is, in some sense, less restrictive than the one in Theorem 16. Consider a Dyck loop D given by (1) and its associated matrices A (from (4)) and B (from (7)). The equations in the system (5), corresponding to the rows of A, are obtained by grouping n;-powers in D. This grouping is possible because of the common primitive roots of the n,-powers to be grouped together. (For instance, in D2 (Examples 2 and 10), we grouped (abab)ni a(bababa)n2 = a(6a) 2 n i + 3 " 2 because of the common primitive root 6a.) Denote the primitive root corresponding to the ith row of A by pi. If we denote
198
the «'th row of A by A(i) and of B by B(i), we have that c
£(O=;C#«..(WM(J). We have therefore proved Lemma 17. Let D be a Dyck loop and A and B its associated matrices from (4) and (7), respectively. Then ranks (I?) ^ ranka(£)) ^ ord(£>). As an example, for the Dyck loop D^ (Examples 3 and 11), we have p\ = ba, p2 = b, p3 = a and 5(1) = A{\) + ,4(3), 5(2) = A{1) + A(2). We can give now our second characterization of Parikh Ar-poly-slender context-free languages. Theorem 18. For any k ^ 0, a context-free language is Parikh k-poly-slender iff it is a finite union of Dyck loops D such that rank^(D) — ranks(D)
| m £ 0}.
It can be written as D3 = {ani+nHni+n>cn3+n
AA
-
° ooii \ 1 0 0 1/
-B ~B
| m ^ 0}
199
Clearly, rank^-Da) = ranks(D 3 ) = 3. According to Theorem 18, .D3 is Parikh 0poly-slender. Alternatively, D3 can be written, noticing that A\ +A4 = A2 + A3 (these are the columns of A), as D3 = { a ' " i + m 2 f e m 2 c m 4 d m 4 + m l m
U {a H
m2+m3 m3+m
c
mi
| m . ^ ()}
J rut ^ 0 } .
The associated matices for the two Dyck loops are
A1
=
/110\ 0 10 = BX 00 1
/100\ 11 0 A2 = = B, 01 1
\ioiJ
V001/
with rank(A,) = rank(B;) = 3. Thus, we decomposed D3 as a union of two irreducible Dyck loops such that, for each of them, the 5-rank equals the order. Therefore, either of those is Parikh 0-poly-slender by Theorem 16 and so is D3. 6
Decidability
We consider in this section the decidability of the fc-poly-slenderness and Parikh fc-poly-slenderness problems for context-free languages and prove that both are decidable. Our results generalize the following two theorems. Theorem 20 (Latteux and Thierrin [15], Raz [20], Hie [12]). It is decidable whether an arbitrary context-free language is slender. Theorem 21 (Honkala [8]). It is decidable whether an arbitrary context-free language is Parikh slender. We first notice that a result analogous to Lemma 14 holds for the k-polyslender case. Lemma 22. Let L be a bounded context-free language written as a finite union of Dyck loops. Then mm{k I L is k-poly-slender } = max{rankA(D) — 1 \ D Dyck loop of L}. Proof. Clear from Theorem 5 and Lemma 12.
(8) •
We show next that a decomposition as finite union of Dyck loops can be effectively found for any context-free language, as soon as there is one. Let L C E* be a context-free language. First, we can decide (see [5]) whether or not L is bounded. (Thus, any of the properties in Lemma 6 is decidable for context-free languages.) If L is not bounded, then it is neither Parikh polyslender nor poly-slender. If L is bounded, then (see [5]) we can find effectively words w\, u>2, • • • , wr G E* such that L C. WiW2
••
.wr.
200 Consider another alphabet A = {61,62, • • • , 6 r } such t h a t A fl £ = 0 and the morphism g : A* —» E* given by g(b{) = wt, 1 ^ i ^ r. If we put
V = g-l(L) n 6J 6J ...b* = ( W • • • Kr I *j ^ 0, < u/22 . . . < e i } then L' is effectively bounded context-free and L = g(L>). By Parikh's theorem, \P(£') is effectively semilinear. T h e structure of the set *l!(L') will give us a decomposition of L' as a finite union of Dyck loops (over A*). Then we find a decomposition of L as finite union of Dyck loops from the relation L = g(L'). Having this decomposition of L, we can then decide, for a given k ^ 0, whether L is Parikh Ar-poly-slender or fc-poly-slender, using the results in L e m m a t a 14 and 22, respectively. We have therefore proved the following theorems. T h e o r e m 2 3 . For any context-free language L and any k ^ 0, we have that (i) It is decidable whether L is k-poly-slender, (ii) If L is poly-slender, the minimum k such that L is k-poly-slender is effectively computable. (Hi) If L is k-poly-slender, then it can be effectively written as a finite union of (k + l)-Dyck loops. T h e o r e m 2 4 . For any context-free language L and any k ^ 0, we have that (i) It is decidable whether L is Parikh k-poly-slender, (ii) If L is Parikh poly-slender, the minimum k such that L is Parikh k-poly-slender is effectively computable. (Hi) If L is Parikh k-poly-slender, then it can be effectively written as a finite union of irreducible Dyck loops D for which rank^(D) ^ ord(D) — k.
7
Further Generalization
In this last section, we only introduce a further generalization of slenderness which has both /s-poly-slenderness and Parikh fe-poly-slenderness as particular cases. When defining Parikh fc-poly-slenderness, we considered the m a x i m u m number of words of fixed length which have the same Parikh vector. Now, we do not require a single Parikh vector but rather a set of vectors, still all with the same sum of components, that is, we still consider words of the same length. Let our alphabet be S = { a i , a 2 , . . . , ap} and denote N£ = {a G N p | | a | = n). For a language L C E* and two nonnegative integers / and k, we say t h a t L is (/, k)-slender iff max card(LD I J ^ _ 1 ( a ) ) = card(S) = 0(n')
afc
0{nk).
201
It is not difficult to verify that (0, &)-slender is the same as Parikh fc-polyslender and (p — 1, fc)-slender is the same as fc-poly-slender. Also, it is clear that, for any /' ^ / and k ^ k', (/, fc)-slender implies (/', &')-slender. Thus, we refined the implication in Lemma 6 (i) (fc-poly-slender implies Parikh &-poly-slender) by introducing p — 2 intermediate properties. Of course, by choosing differently the bound on cardinality of the set S in the definition, we can obtain further refinements but it remains to investigate the relevance of any such notions. N o t e . Research supported by the Natural Sciences and Engineering Research Council of Canada grant R3143A01. References 1. M. Andra§iu, J. Dassow, Gh. Paun, A. Salomaa, Language-theoretic problems arising from Richelieu cryptosystems, Theor. Computer Sci., 116 (1993), 339-357. 2. J. Berstel, Sur la densite asymptotique de langages formels, in Automata, Languages, and Programming (M. Nivat, ed.), North-Holland, 1972, 345358. 3. C. Choffrut, J. Karhumaki, Combinatorics of Words, in Handbook of Formal Languages (G. Rozenberg, A. Salomaa, eds.), Springer-Verlag, Berlin, Heidelberg, 1997,329-438. 4. J. Dassow, Gh. Paun, A. Salomaa, On thinness and slenderness of L languages, Bull. EATCS, 49 (1993), 152-158. 5. S. Ginsburg, The Mathematical Theory of Context-free Languages, McGrawHill, New York, 1966. 6. S. Ginsburg, E. H. Spanier, Bounded ALGOL-like languages, Trans. Amer. Math. Soc, 113 (1964), 333-368. 7. J. Honkala, On Parikh slender languages and power series, J. Computer System Sci., 52 (1996), 185-190. 8. J. Honkala, A decision method for Parikh slenderness of context-free languages, Discrete Appl. Math., 73 (1997), 1-4. 9. J. Honkala, Decision problems concerning thiness and slenderness of formal languages, Acta Inform., 35 (1998), 625-636. 10. J. Honkala, On Parikh slender context-free languages, Theor. Computer Sci., 255 (2001), 667-677. 11. L. Hie, On a conjecture about slender context-free languages, Theor. Computer Set., 132 (1994), 427-434. 12. L. Hie, On lengths of words in context-free languages, Theor. Computer Sci., 242 (2000), 327-359.
202
13. L. Hie, G. Rozenberg, A. Salomaa, A characterization of poly-slender context-free languages, Theoret. Inform. Appl. (RAIRO), 34 (2000), 77-86. 14. M. Kunze, H.J. Shyr, G. Thierrin, /i-bounded and semidiscrete languages, Inform, and Control, 51 (1981), 147-187. 15. M. Latteux, G. Thierrin, Semidiscrete context-free languages, Internat. J. Corn-put. Math., 14 (1983), 3-18. 16. M. Latteux, G. Thierrin, On bounded context-free languages, Elektron. Informtionsverarb. Kybernet., 20 (1984), 3-8. 17. M. Lothaire, Combinatorics on Words, Addison-Wesley, Reading, MA., 1983. 18. T. Nishida, A. Salomaa, Slender 0L languages, Theoret. Comput. Sci., 158 (1996), 161-176. 19. Gh. Paun, A. Salomaa, Thin and slender languages, Discrete Appl. Math., 61 (1995), 257-270. 20. D. Raz, Length considerations in context-free languages, Theoret. Comput. Set., 183 (1997), 21-32. 21. A. Salomaa, Formal Languages, Academic Press, New York, 1973. 22. J. Shallit, Numeration systems, linear recurrences, and regular sets, Inform. and Comput., 113 (1994), 331-347. 23. A. Szilard, S. Yu, K. Zhang, J. Shallit, Characterizing regular languages with polynomial densities, Proc. of the 17th MFCS (Prague 1992), Lecture Notes in Comput. Sci., 629, Springer-Verlag, Berlin, 1992, 494-503.
203
P R E H O M O M O R P H I S M S ON LOCALLY I N V E R S E •-SEMIGROUPS TERUO IMAOKA Department of Mathematics and Computer Science Shimane University Matsue, Shimane 690-8504, Japan E-mail: [email protected]. jp Introducing a new partial product on a locally inverse *-semigroup, we characterize a prehomomorphisms between locally inverse *-semigroups.
1
Introduction
A semigroup S with a unary operation * : S —» S is called a regular *-semigroup if it satisfies (i) (a;*)* = x; (ii) (xy)* = y*x*; (iii) xx*x — x. Let S be a regular *-semigroup. An idempotent e in S is called a projection if e* = e. For a subset A of S, denote the sets of idempotents and projections of A by E{A) and P{A), respectively. It is well-known that P(S)2 = E(S). A regular ^-semigroup S is called a locally inverse ^-semigroup if for any e 6 E(S), eSe is an inverse subsemigroup of S. If E(S) satisfies the identity xyzw — xzyw, S is called a generalized inverse ^-semigroup. Let S be a regular *-semigroup. Define a relation < on 5 as follows: a < b 4=^ a = eb = bf for some e, / 6 P(S). Result 1.1 [1] Let a and b be elements of a regular ^-semigroup S. Then the following conditions are equivalent: (1) a < b, (2) aa* = 6a* and a*a = b*a, (3) aa* — ab* and a*a = a*b, (4) a = aa*b = ba*a. Result 1.2 [1] The relation < on a regular *-semigroup, defined above, is a partial order on S which preserves the unary operation. We call the partial order <, defined above, the natural order on S. Lemma 1.3 If S is a locally inverse ^-semigroup, then < is compatible.
204
Proof. Assume that a < b and let c be any element of 5. By Result 1.1(2), (ac)*(ac) = c*{a*a)c = c*{b*a)c = {bc)*{ac). By Result 1.1(4), a = ba*a = (bb*b)a*(aa*b) = bb*aa*b. Since bb*aa*bb* and bcc*b* are contained in E(bb*Sbb*), we have (ac)(ac)* = ace* a* = {{bb*b)a*(aa*b))cc*{aa*b)* = {bb*aa*bb*){bcc*b*)aa* = {bcc*b*)(bb*aa*bb*)aa* = bcc*(b*aa*) = (bc)(ac)*, by Lemma 1.1(2) and (4). Thus ac < be. Similarly, we have ca < cb, and hence < is compatible. • Let S and T be regular *-semigroups. A mapping 4> : S —Y T is called a prehomomorphism11, if it satisfies (i) (ab)
I t is called a V-prehomomorphism in [4]
as morphisms, constitute a
205 We obtained a generalization of the Preston-Vagner representation to a locally [generalized] inverse *-semigroups in [2]. A non-empty set X with a reflexive and symmetric relation
£ a.
We consider the empty set to be an t-single subset. We remark t h a t if {X;cr) is a transitive t-set, a subset A of X is an t-single subset if and only if, for x, y £ J4, (x, y) £ a- implies x = y. A mapping a in I x , the symmetric inverse semigroup on X, is called a partial one-to-one t-mapping on (X;cr) if d(a),r(a) are b o t h t-single subsets of (X; a), where d(a) and r(a) are the domain and the range of a, respectively. Denote the set of all partial one-to-one t-mappings of (X;a) by For any t-single subsets A and B of (X;a), define 9A,B by 9AiB = {(a, 6) £ A x B | (a, b) £
we have the
following:
(1) The *-groupoid CX^xta)i defined above, is a locally inverse ^-semi-group. Moreover, any locally inverse -^-semigroup can be embedded [up to *isomorphism) in CX^x-a) on some t-set (X;cr). (2) E{CT(X;o))
— M and P(CX(x-a))
- { 1 A | A is an t-single subset
of(X;a)}.
(3) / / (X\o~) is a transitive t-set, then CX(x-,a) is a generalized inverse *semigroup. In this case, we denote it by GX<X-,<J) instead of CXix-a)Moreover, any generalized inverse ^-semigroup can be embedded [up to *isomorphism) in QX(x,a) on some transitive t-set (X\a).
206
(4) / / a is the identity relation on X, then CZ(x-,o) *s the symmetric semigroup Xx on X.
inverse
We call £T(x;a) \G^-{xta)\ the i-symmetric locally [generalized] inverse *semigroup on the t-set [the transitive t-set] {X;cr) with the structure sandwich set A4. In the proof of the later half of Result 1.5(1), for a given locally inverse •-semigroup S, define the following relation f2 on S, f2 = {(x,y) £ S x S | xpe = y for some e £ E(S)}, where pa (a £ S) is the mapping of Sa* onto Sa defined by xpa = xa. Then (S,Q) is an t-set, and pa £ jCl(s-n) f° r a n y » £ S . Moreover, #,,„,,,(, = pa'abf and the mapping
(ab if Sa = S{a*abb*)* and 56 = Sa*abb* \ undefined otherwise
By using the restricted product, we characterize prehomomorphisms of locally inverse *-semigroups in Section 2 which is a generalization of [3]. 2
Prehomomorphisms
Let S be a locally inverse *-semigroup. For any element a £ S, aa* and a*a by d{a) and r(a), respectively. Define a new partial product • on S as follows: a
b_{ab
if r(a) =d{a*abb*) and d(b) = r{a*abb*) \ undefined otherwise
The partial product • is called a restricted product of S. Lemma 2.1 Let a and b be elements of a locally inverse ^-semigroup S. (1) a • b is defined if and only if a*a = a*abb*a*a and bb* = bb*a*abb*. (2) If a • b is defined, then d(a • b) = d(a) and r(a • b) = r(6). Proof. (1) It is obvious. Assume that a • 6 is defined. Since a* a = a* abb*a*a and bb* = bb*a*abb*, d(a • b) — (a • b)(a • b)* — a{(a*a)bb*(a*a)}a* = a(aa*)a* = aa* = d(a). Similarly we have r(a • b) = r(b). Lemma 2.2 Let S be a regular -^-semigroup.
•
207
(1) Let x be an element of S and e a projection of S such that e < x*x. a = xe is the unique element in S such that a < x and a* a = e.
Then
(2) Let x be an element of S and e a projection of S such that e < xx*. a = ex is the unique element in S such that a < x and aa* = e.
Then
(3) For any elemants x,y £ S, xy = a -b where a — xe, b = fy, e = x*xyy*x*x and f = yy*x*xyy* . Proof. (1) Since e < x*x, we have aa*x = xe(xe)*x = xex*x = xe = a, xa*a = x(xe)*xe = xex*xe = xe = a. By Result 1.1(4), we have a < x. Also, we have a*a = (xe)*xe = e*x*xe = e. Asuume that b < x such that b*b = e. By using Result 1.1(4) again, b = xb*b = xe = a. Dually, we can obtain (2). (3) By a simple calculation, we have that r(a) = d(a*abb*) = xx*y*yxx*, d(b) = r(a*abb*) = y*yxx*y*y and that a • b — ab = x(x*xyy*x*){yy*x*xyy*)y
= xy,
which completes the proof.
•
Lemma 2.3 Let S and T be locally inverse ^-semigroups. If <j> : S —» T is a prehomomorphism, then aa*
we have a
208
Proof. (1) Let
< a*a<j> =
(a*abb*a*a)<j>.
Thus we have (a*abb*a*a)0 — (a*a0)(66*0)(a*a0). By Lemma 2.3, (a<j))*a(j) = a*a
= (a*a0)(66*0)(a*a0) = (a
S i m i l a r l y , we h a v e b(f>{b(j>)* — b<j>{b<j>)* (acj))*a<j>b(j)(b
Since {(a • b)cf>)*(a • b)4>) = ({a • b)*(a • 6 ) ) 0 = {b*{bb*a*abb*)b)
we have ((a -b)<j>)* (a -6)0) = (a0 -60)*(a0 -60). It is ovious that (a-6)0 < a0-60. It follows from Lemma 1.1(4) that (a • 6)0 = (a0 • 60)((a • 6)0)*((a • 6)0) = (a0-60)(a0-60)*(a0-60) = a0•60. Thus 0 preserves the restricted product. Next, we prove the converse. Suppose that 0 preserves the restricted product and the natural order. Let ab be the original product of 5. By Lemma 2.2(3), ab — (ae) • (fb) where e = a*abb*a*a and / = bb*a*abb*. By assumption, a60 = (ae)0 • (/6)0. On the other hand, ae < a and fb < b imply that ae0 < a0 and /60 < 60. Since < is compatible, a&0 < a060. Hence 0 is a prehomomorphism. (2) Let 0 : S —)• T be a prehomomorphism satisfying e/0 — e<j>f
209 On the other hand, (a<j>e(/>)* (a
CI
References 1. T. Imaoka, Prehomomorphisms on regular ^-semigroups, Mem. Fac. Sci. Shimane Univ., 15 (1981), 23-27. 2. T. Imaoka, M. Katsura, Representations of locally inverse ^-semigroups, II, Semigroup Forum, 55 (1997), 247-255. 3. M.V. Lawson, Inverse Semigroups, World Scientific, Singapore, 1998. 4. D.B. McAlister, V-Prehomomorphisms on inverse semigroups, Pacific J. Math., 67 (1976), 215-231.
This page is intentionally left blank
211 TESTING USING X-MACHINE
TRANSLATIONS
FLORENTIN IPATE Faculty of Sciences, Pitesti University Str. Tdrgu din Vale 1, 0300 Pitesti, Romania MARIAN GHEORGHE Department Regent
Court,
of Computer Portobello
Science, Street,
Sheffield
Sheffield,
University SI 4DP,
UK
MIKE HOLCOMBE Department of Computer Science, Sheffield University Regent Court, Portobello Street, Sheffield, Si 4DP, UK TUDOR BALANESCU Str.
Faculty of Sciences, Pitesti University Tdrgu din Vale 1, 0300 Pitesti, Romania
In 1988 X-machines were proposed as a basis for a possible specification language and since then a number of further investigations have demonstrated the value of this idea. A number of classes of X-machines have been identified and studied, most importantly the class of stream X-machines. A theory of testing based on stream X-machine translators has also been developed. This allows the generation of test sets that are proved to guarantee the correctness of implementation against the specification under certain circumstances. This paper extends this theory in more than one way. Firstly, it considers the general X-machine model rather than the particular stream X-machine class. Secondly, a non-deterministic device is considered and two different testing strategies are defined.
1
Introduction
Formal specifications and models can help in the production of high quality software. They eliminate the opportunity for ambiguity and allow the application of, possibly automated, formal analysis. Furthermore, in recent years there has been some interest in trying to use the information in a formal specification as a basis for test set generation. However, for most approaches the emphasis is on generating efficient test sets and nothing is said about their effectiveness, i.e., how many faults may remain after testing is completed (see for example [16], [27], [25]). Testing is all about finding faults and very seldom the issue of the number of faults that remain in the implementation after testing is discussed. Bernot et al. [5] and Dauchy et al. [8] consider the generation of test sets from algebraic specifications, here there is a more comprehensive framework
212
(the "hypothesis") which allows for the issue of test effectiveness to be discussed but the test generation process does not exploit this particularly. The problem of test effectiveness is best addressed if the test set can be guaranteed to find all faults of the implementation. One approach is to consider two algebraic objects (the specification and the implementation), each of them characterised by an input/output behaviour, and to prove that, if the behaviours of these objects coincide for any input in the test set, they will coincide for any input in the domain. Thus, the specification and the implementation will be guaranteed to have identical behaviour provided that they behave identically when supplied with the inputs in the test set. Obviously, such an approach would only be applicable to certain systems and specification languages; it will not be applicable to an arbitrary computer system (an arbitrary Turing machines), otherwise the halting problem for Turing machines, for example, will be contradicted. This approach has been employed in the area of test generation for the software modelled by finite state machines (FSM) (see [7], [12], [13], [19]). Here, the assumption is that the control aspects of the software are separated from the system data and can be modelled by a FSM. However, in many situations it is very difficult, or even impossible, to separate the system control from its data, so a more complex specification model that integrates these two aspects is needed. Such a model is the X-machine, a blend of FSMs, data structures and processing functions. In its essence an X-machine is like a FSM but with one important difference. A basic data set, X, is identified together with a set of basic processing functions, <J>, which operate on X. Each arrow in the finite state machine diagram is then labelled by a function from $ , the sequences of state transitions in the machine determine the processing of the data set and thus the function or relation computed. The data set X can contain information about the internal memory of a system as well as different sorts of output behaviour so it is possible to model very general systems in a transparent way. Introduced by Eilenberg [9] in 1974, X-machined are proposed by Holcombe [17] as a basis for a possible specification language and since then a number of further investigations have demonstrated that the model is intuitive and easy to use ( see [19], [22], [23], [11]). A number of classes of X-machines have been identified and studied (see [19], [21]). Typically, these classes are defined by restrictions on the underlying data set X and the set of basic processing functions, $, of the machines. Among all these, the class of stream X-machines (SXM) has received the most attention. As suggested by their name, stream X-machines are those in which the input and output sets are streams of symbols. The input stream is processed in a
213 straightforward manner, producing, in turn, a stream of outputs and a regularly updated internal memory. Each processing function processes a memory value and an input to produce an output and a new memory value. Particular types of SXMs (having stacks [20] or sequences of symbols [4] as memory) or slightly different SXM models (that use relations instead of functions [15] or output sequences instead of single output symbols [2]) have also been considered. Thus SXMs are generalisations of finite state machines, similar to extended finite state machines (EFSM) [26], [6]: here, the variables are replaced by a memory and the sets of predicates and assignments are replaced by a set of processing functions. The current approach to EFSM testing [26], [6], [28] is a straightforward application of the testing methods for FSMs: given an EFSM, if each variable has a finite number of values then there is a finite number of configurations (tuples of states and variable values) and there is an equivalent FSM with configuration as states, so testing EFSMs reduces in principle to testing of FSMs. A testing strategy for systems specified by stream X-machines has also been developed [21], [18], [19]. Here, a number of transition are grouped into processing functions and these are assumed to be implemented correctly. Thus, testing the SXM reduces to testing its transition diagram (the associated FSM of the stream X-machine). The correctness of the processing functions is checked by a separate process: depending on the nature of the function, these can be tested using the same method or alternative functional methods [19], [22]. Furthermore, the method can only be applied if the processing functions meet some "design for test conditions", completeness and output-distinguishability. The stream Xmachine testing method does not rely on the finiteness of the memory set (since there is no need to construct the equivalent finite state machine) and furthermore it avoids the state explosion problem. The method was first developed in the context of deterministic stream X-machines [21] and then extended to the non-deterministic case [24]. Apart from the testing strategies, model checking approaches have been proposed in the context of X-machine theory [10] with the aim of checking if the model has all the desired properties. This paper generalises the existing stream X-machine testing theory in more than one way. Firstly, it considers the general X-machine model rather than the specialised stream X-machine class. Secondly, the results proved in the context of non-deterministic X-machine translators can give rise to two distinct testing strategies from which the one that suits more the particular nature of the system under testing can be selected. The differences between the two strategies are highlighted. The paper is structured as follows. Section 2 contains concepts from FSM theory and FSM testing. Section 3 introduces the X-machine model and related
214 concepts. Sections 4 and 5 present the two testing strategies and the corresponding theoretical concepts and results. Conclusions are drawn in section 6.
2
Finite s t a t e machine concepts
This section defines the finite state machine and presents related concepts and results t h a t will be used later in the paper. Before we go any further, we introduce the notation used in this paper. When considering sequences of inputs or outputs we will use A* to denote the set of finite sequences with members in A. A will denote the empty sequence. For a, b £ A*, ab will denote the concatenation of sequences a and b. For U,V C A*, UV = {ab\aeU,be V}. For a (partial) function / : A — • B, dom(f) denotes the domain off. For UCA,f(U) = {f(a)\aeU} For a finite set A, card(A) denotes the number of elements of A. D e f i n i t i o n 2.1 A finite state machine (FSM) is a system A = (E, Q, F, qo) where: E is the finite set of inputs; Q is the finite set of states; F is the next state function, a (partial) function F : Q x $ —> 2 ^ ; qo £ Q is the initial state. N o t e 2 . 1 In general, a FSM may be non-deterministic in the sense that for each state q and input a there may be more than one next state. A FSM is called deterministic if F is a (partial) function, F : Q x $ —> Q. Definition an arc from qi, . . .,qn+i we say that
2.2 If q,q' £ Q, cr £ £ and q' £ F(q,cr) we say that a : q —>• q' is q to q' and write cr : q —» q'. If q,q' £ Q are such that there exist £ Q, n > 0, with qi — q, qn+\ = q' and &i : q, -)• g» + i, 1 < i < n, we have a path s = a\ . . . crn from q to q' and write s : q —>• q'.
D e f i n i t i o n 2.3 For q £ Q, Lq = {s £ E* | 3r £ Q such that s : q —> r } is called the language accepted by A in q. If q — qo then Lq is simply called the language accepted by A. D e f i n i t i o n 2.4 For V C E*, two states, q,q' £ Q are called "[/-equivalent if Lq n V = Lq' fl V. Otherwise q and q1 are called ^-distinguishable. 2/ V = E* then q and q1 are simply called equivalent or distinguishable. Two FSMs are called V—equivalent (or equivalent) if their initial states are V—equivalent (or equivalent). N o t e 2.2 Two FSMs are equivalent if and only if they accept the same
language.
D e f i n i t i o n 2.5 A set W C E*, is called a characterisation set of A if any two distinct states q,q' £ Q are W-distinguishable. D e f i n i t i o n 2.6 A set S C E*, is called a state cover of A if for any state q £ Q there is a path s : qo —^ q.
215
Definition 2.7 A FSM for which there exists a state cover and a characterisation set is called minimal. Further details concerning the construction of state covers and characterisation sets may be found in [7]. Theorem 2.1 [9] Given a FSM A there is a minimal FSM A1 equivalent to A. Furthermore, A' is equivalent up to a renaming of the state set. A' is called the minimal FSM of A. We now turn our attention to FSM testing and, in particular, to the generation of test sequences from a FSM specification. Given two FSMs (one representing the specification and the other the implementation), we construct a set of sequences that, when applied to the two machines with identical results, guarantees their identical behaviour. Such a set of input sequences will be called a test set of A and A'. The test set will be generated from the specification A and, in principle, no information is available about the implementation A'. However, it is obvious that no such finite set exists for an arbitrary FSM A', thus the implementation has to meet some further requirements. There are a number of more or less realistic assumptions that can be made about the form and size of the implementation and these, in turn, give rise to different techniques for generating test sets [26]. The least restrictive assumption refers to the size of A' (i.e., the number of states of A') and is the basis for the W-method [7]: the difference between the number of states of the implementation and that of the specification has to be at most k, a positive integer estimated by the tester. Definition 2.8 Let A — (E, Q, F, qo) and A' = (E, Q', F', q'0) be two deterministic FSMs. Then U C E* is called a test set of A and A' if whenever A and A' are U-equivalent, A and A' are also equivalent. Theorem 2.2 [7] Let A = (E, Q, F, q0) and A1 = (E, Q', F', q'0) be two minimal deterministic FSMs and let S and W be a state cover and a characterisation set of A, respectively. If card(Q') - card{Q) < k then U = S f ^ ^ U E * . . .U{X})W is a test set of A and A'. The idea of the W-method (Theorem 2.2) is that the set T = 5 USE ensures that all the states and all the transitions of A are also present in A1 while the set R= (E f c UE f c - 1 U...U{A})W checks that A' is in the same state as A after each transition is used. Notice that R contains W and also all sets E'W, 1 < i < k. This ensures that A' does not contain extra states. If there were up to k extra states, then each of them would be reached by some input sequence of up to length k from the existing states. Thus U = TR is a test set of A and A'. Various authors (see for example [14]) have devised improved variants of the W-method that may generate smaller test sets in certain cases. Usually, the gain in obtaining a smaller test set is partially offset by the increased complexity of
216
the process of generating it. 3
X-machine concepts
This section presents the X-machine model and illustrates it with an example. Definition 3.1 An X-machine is a system P = (X, Q, $, F, q0, c, d, 0, o) where: • X is a (possibly infinite) set called the data set; • Q is the finite set of states; • $ is the set of basic processing functions, $ = {/ | / : X may be partial functions; • F is the next state function, a (partial) function F : Q x $
X); the 2«;
• <7o 6 Q is the initial state; • c is the stopping condition of P, a predicate on X; • d is the testing domain of P, a function d : $ —> 2X such that V/ E $ d(f) C dom(f); • O is the output set; • o is the output function of P, o : X —>• O. Note 3.1 For an X-machme P as above, o is extended to a free-semigroup morphism o : X* —> O*. Thus o(A) = A, and o(x\ . . . xp) = o(x\) . .. o(xp),p > 1. In what follows we will refer to this extension. The testing domain (d), Output set (O) and output function (o) are introduced in the definition of an X-machine only for testing purposes. They will not be used in this section, nor they affect the concepts presented here. Their use will become apparent in the following sections, when testing will be discussed. It is sometimes helpful to think of an X-machine as an automaton with the arcs labelled by symbols from $. Definition 3.2 For an X-machine P as above, the associated FSM is A(P) = {$,Q,F,q0). Example 3.1 Let us consider the X-machine with Q = {go, gi, 92,93}, F defined by F(q0,fi) = 9i, F(q0,f3) = 92, F(q0,f4) = 93, F(qi,f2) = 9o, £ = {a, b, c, d, dh d2}, X = (S*) 4 , $ = {h,h,h,fi}, where
217 fi{ahx,an,W,cq) = {ak-lx,an+\F+1,ci), where x G {d,d1,d2}, h > 1, n,p,q> 0, f2{ahx,an,bP,ci) = (ah-lx,an+1,bP,ci+1), where x G {d,d1,d2}, h > 1, n , p , g > 0, / 3 ( z , a 2 n , 6", c n ) = (A, a2ndu bn, cn), where x G {d, d^, n > 1, / 4 ( a : , a 2 n , & n , c n ) = ( A , a 2 n d 2 ) 6 n , c n ) , where x G { d , d 2 } , n > 1. We will take O = £*, o(a,/3,j,S) = a(3fS, c(\,a,f3, 7) = irwe, and c = / a / s e otherwise, a,/?, 7, 5 G £*. D e f i n i t i o n 3.3 Ifq,q' G Q, / £ $ , and ' G F(q,f) we say that f • q -> q' is an arc / r o m g to 5' and wriie f : q -+ q'. If q,q' £ Q are such that there exist tfi, • • •, 9n+i G Q, n > 0, wii/i 91 = 9, qn+i = g' and /,• : q{ -> g i + i , 1 < i < n, we say that we have a path pt = /1 . . . / „ /rom g to q1 and write pt : q —> g'. D e f i n i t i o n 3 . 4 i?acn path pt — f\ .. . fn gives rise to a (partial) function (the p a t h function,) fpt : X — • X where fpt{x) = x' if and only if3x\,..., xn+\ G X such that fi(xi) = Xj+i, 1 < i < n, where x\ — x,xn+i = x'. A machine computation takes the form of a traversal of a p a t h in the state space and the application, in turn, of the path labels (which represent basic processing functions). This gives rise to the relation computed by the machine, as defined next. D e f i n i t i o n 3.5 The relation computed by P, fp : X i—> X is defined by xfpx' if and only z/3g G Q and a path pt : go —> g such that fpt{x) = x1 and c(x') is true. In general, an X-machine may be non-deterministic, in the sense t h a t the application of an initial d a t a value x may produce more t h a n one value of the d a t a set. An X-machine is deterministic if its associated a u t o m a t o n is deterministic, any two processing functions t h a t emerge from the same state have disjointed domains and no processing function can process values for which the stopping condition is true. D e f i n i t i o n 3.6 An X-machine
P is called deterministic when
• F : Q x $ —> Q; • for any two distinct processing functions f, g G <£, if 3g G Q such F(q, / ) # 0 and F{q, g) ^ 0, then dom(f) n dom(g) = 0; • for any processing function
f, if x G dom(f)
then c(x) =
that
false.
T h a t is, an X-machine can have 3 types of non-determinism, as defined next. D e f i n i t i o n 3.7 An X-machme P has state non-determinism if there exist q G QJ G $ with card{F{q,f)) > 1.
218
Definition 3.8 An X-machine P has domain non-determinism if there exist q G QJ1J2 E $ with (g,/i),(g,/ 2 ) £ dom(F),fx ^ / 2 and dom{fx) n dom(f2) ^ 0. Definition 3.9 An X-machine P has termination non-determinism if there exist i £ X , / 6 $ with x £ dom(f) and c(x) = true. State non-determinism and termination non-determinism can be removed by rewriting the X-machine. Indeed, state non-determinism can be removed by using standard algorithms that take a non-deterministic automaton and produce an equivalent deterministic finite automaton. The transformation does not preserve the domain determinism, as can be seen from the Example 3.2. Example 3.2 Let us consider an X-machine having the following next state function: F{0,f) = {1, 2}, F(1, fx) = 3,F(2,/ 2 ) = 3 where dom(f1)Ddom(f2) ^ 0. It is state non-deterministic but domain deterministic. An equivalent deterministic automaton is F'(0,f) = 12,F'(12,fi) = F'(\2,f2) = 3. The new equivalent X-machine is state deterministic but domain nondeterministic. In order to remove termination non-determinism, a new set X1 = X x {0,1} will be introduced, the processing relations will be defined on subsets of X x {0}, c(x) will only be true on a subset of X x {1} and for each state new loop-back transition will be added that will translate X x {0} into X x {1}. Therefore, termination non-determinism can be transformed into domain non-determinism. On the other hand, domain non-determinism cannot be removed in all the cases by rewriting the X-machine so there seems no good reason to outlaw this type of non-determinism which can be part of the system definition, as illustrated in Example 3.1 where (d, a, (3, 7) G dom{fz) fl dom{fi),a,P,f G £*. Indeed, if the system is designed to be able to process inputs of the form (d, a,/?,7) then fs and /4 must leave the unique initial state go (note that neither /1 nor fa can process inputs of this form). On the other hand, for testing purposes, we have to be able to exercise uniquely any path in the machine using appropriate data values. In order to express this condition formally, for q G Q,f G $ with (q,f) G dom(F) we define dq_j = Uf^ft(qj<)edom(F)d{f). Using this notation, the condition can be written as: for any q G Q, f G $ if {q, f) G dom(F) then d{f) — dq-f 7^ 0. For Example 3.1 we can consider d(h) = d(f2) = {{ahx, an, bP,c")\h >l,n,p,q>0,xe {d, di, d 2 }}, d(f3) = {(x,a2n,bn,cn)\n >l,x = dx}, d(f4) = {(x,a2n,bn,cn)\n >l,x = d2}, that satisfy the above condition for the state go and the functions / i , / 3 , / 4 emerging from it. Allowing only domain non-determinism and imposing the above condition gives the following definition of a quasi non-deterministic X-machine. Definition 3.10 A quasi non-deterministic X-machine is a system P — (X, Q, $, F, go, c, d, O, o) where:
219 • X is a (possibly infinite) set called the data set; • Q is the finite set of states; • $ is the set of basic processing functions that the machine can use, $ =
{f\f:X-+X}; • F is the next state function, a (partial) function F : Q x $ —> Q; • 1o £ Q is the initial state; • c is the stopping condition of P, a predicate on X such that for any f £ $ , i 6 X , if x £ dom(f) then c(x) = false. • d is the testing domain of P, a function d : <J> —> 2X such that V/ £ $ d{f) C dom(f); furthermore, for any q (zQ,j; € $ if(q,f) £ dom(F) then
d(f) - dq-} ± 0; • O is ifte output set; • o is i/je output function of P, o : X —> O. In what follows we will refer to X-machines that conform to this definition. 4
The breakpoint test set of X-machines
We turn now our attention to testing. As stated in the introduction, the approach used is to consider two X-machines and to generate a, finite set of sequences that, when applied to the two machines with identical observable results, guarantees that the two machines have identical behaviour. This is formalised next. The section also introduces the concepts that are required in the testing process and shows how a test set can be generated. Definition 4.1 Two X-machines P and P' are called testing-compatible if their data sets, sets of processing functions, output functions, testing domains and stopping conditions coincide. Definition 4.2 Let P be an X-machine and I C X* such that if x £ / then there is a unique decomposition x = x\ .. ,xp, with X{ 6 X for all I
define
L{P,I) = {y\y = yi...yPe
X*,3xy = xl...xp£i,fi,...,fpe
$,pt = fx ...fp
is a path starting at qo, such that X{ £ d(fi) — dq^_1^fi, fi(xi) = y;, 1 < i < p, where qi-\ is the end state of the path f\ .. ./j_i}
220
N o t e 4.1 The cardinality of L(P,I) cannot exceed that of I. In particular, for x G X*, L(P, {x}) is either the empty set or contains exactly one element. Note 4.2 When the elements £,• in the above definition are such that a;,- ^ y,_i, 2 < i < p, we call them breakpoint values. Example 4.1 For P as in Example 3.1 and I = {x\x2x3x4x^} where xi = (a3d,X,\,\), x2 — (a2d,a,b,X), x3 = (ad, a2,b,c), x4 = (adi,a3,b2,c), 4 2 2 x5 = (di,a ,b ,c ). we have L(P,I) - {yxy22/32/42/5}, where 2/i = (a2d, a,b,X), 2/2 = (ad, a2,b,c), 2/3 = (d,a3,b2,c), 2/4 = (di,a 4 ,6 2 ,c 2 ), 2/5 = (X,a4dub2,c2), since x\ G d(fi) - dqo-Sl,fi(xi) = 2/1 and F(q0,fx) = 9^ «2 G d(f2) - dqi^h,f2(x2) =2/2 and F(qi,f1) = q0, X3 G d(fi) - dqa_h,fx(x3) = 2/3 anc/ F(q0,f1) = q1: XA G d(f2) - dqi-J2,f2(xA) =y4 and F(ql,f2) = q0, X5 G d(f3) - dqo-f3,f3(x5) =2/5 a«c? F(q0,f3) = q2. It may be observed that X4 (x4 7^ y3) is a breakpoint value. Definition 4.3 Let P = (X, Q, $, F, q0, c, d, O, o) and P' = (X, Q', $, F', q'Q, c, d,0,o) be two X-machines that are testing-compatible. Then a finite set I C X* is called a breakpoint test set of P and P1 if whenever o(L(P, {x})) = o(L(P', {x}))Vx G I, we have fP - fP,. Note 4.3 For two X-machines P and P1 if A(P) and A(P') are equivalent FSMs then fP — fPi. However, the converse implication is not true, as it is easy to construct two testing compatible X-machines that compute identical relations and have non-equivalent associated FSMs. The idea of our testing method is to prove a stronger requirement, that is that the two associated FSMs are equivalent. In this way, in order to test the two X-machines we can use the test sets of the associated FSMs. However, this idea can only work if it is possible to distinguish between any two processing functions using appropriate values. Definition 4.4 An X-machine is called output-distinguishable ifif,g g, ifxe d(f) D d(g) then o(f(x)) ^ o(g(x)).
G $, / ^
It is easy to see that the X-machine in Example 3.1 is output-distinguishable. Indeed o(/i (aa, /3, 7, 5)) = a/3a~/bS, o(f2 (aa, f3,7, )) = afiaySc,
221
o(f3(x,(3,f,S)) x = d2,
= /3dii6,x = dor x = dx, o(f4(x,p,f,
6)) = (3d2jS,d = d or
We now need a mechanism for translating sequences of processing functions into sequences of data. This is a test function, as defined next. Definition 4.5 Let P = (X, Q, <3>, F, go, c, d, o) be an X-machtne and let t : $* —> X*, be a function recursively defined as follows: • t{\) = X; • for p > 0, consider t defined for any string f\-..fp string / i . . . fpfp+i, <(/i . . . fPfP+i) «s either of:
£ $*; then for any
~ tf fi • • • fp 2S a P ° ^ *n -P ^ a ^ emerges from the initial state qo then t{fi •••fpfp+i) = t(fi • • • fp)xp+i with xp+1 £ d(fp+1) - dqp_fp+l, where qp is the end state of the path / i . . . / p ; note that such xp+i will always exist since P is quasi non-deterministic; - otherwise t(fi ... fPfP+i)
= <(/i
-..fp).
• - t(u) has a unique decomposition t(u) = X\ ...xp, 1 < i < p.
with X{ £ X for all
The function t above defined is called a test function of P. In other words, for any sequence of processing functions f\ ... fp, t(f\ ... fp) is a sequence of data that exercises the longest prefix of p that is a path of the machine state and also tries to exercise the function that follows after this prefix, if this exists. Note that a test function is not uniquely defined, there may be many test functions of the same X-machine. Example 4.2 For the X-machine in Example 3.1, a test function for the sequence /1/2/1/2/2/2 can be constructed as follows: • t{fi) = xi • t{hh) • ttflhfl)
= xix2 = XiX2X3
• t{fif2flf2)
= XiX2X3X4
• ^(71/2/1/2/2) = • t{f\f2flf2f2f2)
xix2x3x4x'5 = XiX2X3X4x'5
222 where xi,X2,xa,X4 are those in Example 4-1 and x'5 = (di, a 4 , b2, c 2 ). The construction is correct since x\ G d ( / i ) - (f, 0 -/,, £2 € <^(/2) - ^ g i - ^ . ^ s G ^ ( / l ) - rfgo-/i. x 4 e c/(/ 2 ) - d ? 1 _/ 2 , x'5 G d ( / 2 ) - d ? 0 _/ 2 , / 1 / 2 / 1 / 2 is a pa£/i /rom q0 but / 1 / 2 / 1 / 2 / 2 is «oi a pai/i /rom g 0 . D e f i n i t i o n 4 . 6 J4 tesi function t is called n natural, n > 1, z//or any fi-..fp $*, a?i . . . Zp G X*, 1 < p < n for which t(fi ... fp) — xi .. .xp we have xi+i fi(xi), 1 < i
G =
T h a t is, a test function is n natural when, for a sequence of processing functions of length at most n, the corresponding values are chosen such t h a t t h e next value are obtained from t h e current value through t h e application of t h e corresponding processing function. Example 4.2 shows t h e construction of a 3 natural test function which is not 4 natural since X2 = fi{xi),X3 = /2(#2) b u t £4 ± fi(x3)D e f i n i t i o n 4 . 7 An X-machine is output delimited with respect to a test function t if for all x = t(u),x = X\ ... xp, X{ G X for all 1 < i < p , from o{fi(xi) ...fp(xp)) = o(gi(xi) ...gp(xp)) we deduce o(/,-(a; i )) = 0(0,-(a,-)) for all 1 < i < p. T h e o r e m 4 . 1 Let P = (X,Q,$,F,q0,d,O,o) andP' = (X, Q1, $ , F', q'0, d, O, o) be two X-machines that are quasi non-deterministic, testing-compatible and output-distinguishable. Let us consider that P is output delimited with respect to a test function t. If U C $* and o(L{P,{x})) — o(L(P',{x})), for all x G t(U), then A(P) and A(P') are U-equivalent. Proof. Let u = f\ ... fp G U and x = t(u). There are two cases: • If u = /1 . . .fp is accepted by A{P), then x = x\ .. .xp. According to Definitions 4.2 and 4.5 and Note 4.1 there exists exactly one y = yi • • .yp € L(P, {x}) and X{ G d(ft) — dqi_1^fi, fi(xj) = yt, where ,-_i is t h e end state of t h e p a t h / i . . . / , - _ i , 1 < i < p. From o(L(P,{x})) = o(L(P',{x})) it follows t h a t there exists exactly one y' G L(P', {x}) such t h a t o(y) = o(y'). T h u s y' = y[ .. .y' and there exists a path /{ . . . / ' , such t h a t //(a?,-) = y'it for all 1 < i < p. As P is output delimited with respect to t it follows t h a t o(yi) — o(y'i) for all 1 < i < p. Since $ is output-distinguishable, we have t h a t /,• = /,', 1 < i < p. Hence fi-..fp is a path in A(P'). • If /1 . . . fp is not accepted by A(P) then let i > 0 be t h e m a x i m u m number for which f\ .../,- is accepted by A{P). Then according to t h e first part of this proof /1 . . . fi is accepted by A(P'). Let us denote by ; G Q and q[ G Q1 the end states of t h e paths generated by this string in t h e two machines. Now, supposing t h a t there exists an arc / J + i from q'i: using t h e outputdistinguishability property it follows t h a t there is an arc /,- + i from ;, which
223
contradicts the initial assumption. Consequently the string f\ ... fp is not accepted by A(P'). • Corollary 4.1 Let P = {X,Q,<1>, F,q0,d,O,o) and P' = {X,Q',$,F',q'0, d,0,o) be two X-machines that are quasi non-deterministic, testing-compatible and output-distinguishable and let t be a test function of P such that P is output delimited with respect to t. If U is a test set of A(P) and A(P') then t(U) is a breakpoint test set of P and P'. Proof. Indeed from Theorem 4.1 it follows that A(P) and A(P') are [/-equivalent and from Definition 2.8 it follows that they are equivalent and consequently a fp =fp>Corollary 4.2 Let P = ( X , Q , $ , F,q0,d,O,o) and P' = (X,Q',Q,F',q'0, d,0,o) be two X-machines that are quasi non-deterministic, testing-compatible and output-distinguishable and let t be a test function of P, such that P is output delimited with respect to t and U C $*. If o(L(P,{x})) = o(L(P',{x})), x e t(U), then L{P,t{U)) = L{P',t[U)). Thus, Corollary 4.1 can be used to generate a breakpoint test set of P and P'. This is / = t(U), where U = S{T,k+1 U E ' , . . U {A})iy is a test set of A{P) and A{P'). Note that the test set defined in this section consists of a number of sequences of data set elements. Each such sequence exercises a path of the machine and each element of the sequence is applied to the function that labels the corresponding arc, regardless of the result computed by the previous arc. That is, the application of the test set happens as though after processing an arc the machine stops and receives a new data set value from the test set. We call this the breakpoint testing strategy for X-machines. Although not unusual in practice, the need to place breakpoints after each arc of the machine is processed will obviously complicate the testing process. Ideally, only the initial value of the data set have to be supplied to the machine, the subsequent values will be computed by the functions that make up the path followed by the machine (this is also the idea behind the concept of n natural test function defined above). This may not always be possible, since in general not all the paths of the machine can be exercised by appropriate initial values of the data set. However, if a value in the sequence can be obtained by applying the appropriate processing function to the previous value in the sequence then there is no need to supply that value to the machine, since it will be simply computed by it. Thus the sequence does not need to contain that value, and this can be replaced by a symbol that indicates this. This idea leads to the concept of extended test
224
set as presented next. 5
The extended test set of X-machines
Definition 5.1 Let e £ X and Xe — X U {e}. Then for x £ Xe, y £ X we define nvle(x,y) by: if x ^ e then nvle(x,y) = x, else nvle(x,y) = y. For x G Xe, y G X we define eqle(x, y) by: if x = y then eqle(x, y) = e, else eqle(x,y) = x. Definition 5.2 Let P be an X-machine and Xe as above and Ie C XX* such that every element of I has a unique decompostion over Xe. We define Le{P, Ie) = {y | y = 2/1 •••2/p G X*,3xy
= xx ...xp G Ie,fi,---,fP
G $,
pt — fi • • • fp is a path starting at qo such that x\ G d(/i) — dqo-j1, fi(x\) nvle(xi,yi_i)
G d(fi) - dqi_1-fi,fi(nvle(xi,yi-.i))
= j/i,
= yit2 < i < p,
where g,-_i is i/ie enrf state of the path / i . . . / j - i , 1 < i < p} Example 5.1 For i 3 as in Example 3.1 and Ie = {^ieea;4e}, we have Le(P,Ie) = {j/ij/2J/32/42/5}! where £,• and j/,-, 1 < i < 5 are those from Example 4-1Definition 5.3 Let P = (X, Q, $, F, q0, d, O, o) and P' = {X, Q', $', F', q'0, d,0,o) be two X-machines that are testing-compatible and Ie C XX* a finite subset such that every element of I has a unique decompostion over Xe. The set Ie C XX* is called an extended test set of P and P' if whenever o{Le{P, {x})) = o(Le{P',{x}))\lx £le,we have fP = fP,. An extended test set Ie is called natural if Ie C X{e}*. That is, a natural extended test set is made up of sequences whose all elements, except the first, are e. Lemma 5.1 If I £ X* is a breakpoint test set of P and P' then I is also an extended test set of P and P'. Proof. Follows directly from Definition 5.3 by taking Ie = I. • Definition 5.4 For an X-machine P and Xi .. .xp £ X*, p > 0 we define E(P, x\ . .. xp) — z\ ... zp G XX* as follows: • Z\ — X\
• if there is a path f\ .. . / m - i , 1 < m < p, such that x,- G d(fi) — dqt_l-ji, fi(xi) = 2/i, where g,_i is the end state of the path f\ .. .fi-\, then zm — eqle(xm,ym-i); otherwise Z{ = x,-, m < i < p.
225 Note that E(P, z) is uniquely defined. For I £ X*,
E(P,I)={J{E(P,x)} T h a t is, if x, is computed by applying the corresponding processing /,-_! to X{-i then z,- = e, otherwise z,- = a;,-. Thus, breakpoint values are only when the corresponding processing function cannot be exercised the previous computed value. As E(P,I) is a set included in XX*, Le(P, E(P, I)) may be defined as in Definition 5.2.
function provided by using the set
E x a m p l e 5 . 2 For P as in Example 3.1 and I = {x1X2X3X4X5} as in Example 4.1, we have E{P,I) = {Xleex4e}, so Le(P,E(P,I)) = L{P,I). T h e result stated in the above example is true for any set / , as shown by the next lemma. L e m m a 5.2 For any X-machine P = (X, Q, <J>, F, qo, d, O, o) and any I C X* we have L(P, I) = Le{P, E(P, I)). Proof. Let x £ / and x1 = E(P,x). According to Note 4.1, there exists at most one y £ L(P,{x}) and one y' £ Le(P,{x'}). By induction on i, 1 < i < p, we show t h a t y,- = y\ and thus y = y'. Since x\ — x[ we have y± = y[. For 1 < i < p — 1 we assume t h a t j/j = j/'-, 1 < j < i. If x ^ + 1 ^ e then z £ + 1 = X{+\ and thus j / ; + 1 = y,-+i. Otherwise as nvle(e,y'i) = y[ = yt, it follows t h a t 2/j'+1 = /j(j/j) = fi{yi) = j/j+i- Since a; £ I was arbitrarily chosen we have L(P,I) = Le(P,E(P,I)). n T h e o r e m 5.1 Lei P = (X, Q, $ , F , ? 0 , d, O, o) anrf P ' = {X,Q',$,F',q'0, d,0,o) be two X-machines that are quasi non-deterministic, testing-compatible and output-distinguishable and let t be a test function of P such that P is output delimited with respect to t and U C <E>*. / / o(Le(P, E(P, {x}))) = o(Le(P', E(P, {x}))), x £ t(U), then A(P) and A{P') are U-equivalent. Proof. For I C X let us consider the set E(P,I). We show now t h a t for any x e I, if o(Le(P, E(P, {x}))) = o(Le(P>,E{P,{x}))), then o(L(P,{x})) = o(L(P', {x})). Assuming t h a t the above statement is true then according to Theorem 4.1 it follows t h a t A(P) and A(P') are [/-equivalent. Let x = Xi ... xp £ / and xe = £ e ,i • • • xe,p — E(P, x). According to the proof of L e m m a 5.2, if y £ L(P, {x}) and z £ Le(P, {xe}) then y and z are unique and y = z; let y = z = z\ ... zp. Now, from o(Le(P,{xe})) = o(Le(P',{xe})) it follows t h a t there exists an unique z' £ Le(P',{xe}) such t h a t o(z') = o(z); let z' = z[ . .. z'. From z £ Le(P,{xe}) it follows t h a t there exist / ; £ $ , 1 < i < p, qi £ Q, 0 < i < p, F(qi-i,fi) = qi, such t h a t xe>i £ d(fx) -dqo-fl, fi(xe>i) = Z\, nvle{xei, Zj_i)) = 2j, where (/i_i is the end state of the path
226 / l • • -fi-i, I < i
P'.
•
N o t e 5.1 As it follows from Example 3.1 the X-machines introduced may translate regular sets into non-context-free languages. The above theorem shows that if L is an arbitrary language and V a family of X-machines satifying the conditions stated in the above theorem (quasi non-deterministic, testing-compatible, output-distinguishable), then for the family C 1, — {L'\V = fp(L),P £ V} the languages equality is decidable. 6
Conclusions
T h e paper investigates, from theoretical point of view, the problem of generation of test sets in the context of quasi non-deterministic X-machines. For the purpose of this paper, a test set is a finite set of sequences of elements that
227
guarantees that two machines have identical behaviour when the application of this set to the two machines produces identical results. In fact, the implication is stronger: not only the behaviours of the two machines coincide, but also their associated finite state machines. Thus the approach is to generate sequences of arcs that can test this equivalence (using the existing testing theory for finite state machines) and to exercise these using appropriate sequences of elements in the data set. Two approaches are investigated. The first is to supply each arc in a path with a suitable value of the date set and this corresponds in practice to placing breakpoints after each function has been processed. This gives rise to the breakpoint test set. The extended test set strategy eliminates the breakpoints whenever this is possible by reusing values from the previous computation. Ideally, only the first value in the sequence would be supplied, this corresponds to the case when a n natural test function can be constructed for a sufficiently large n. The theoretical results in this paper are generalisations of the results in [21]. The use of these results in the case of stream X-machines as well as some practical applications of them will be the subject of another paper. The method presented in this paper may also be considered in the context of various other types of (stream) X-machines. It will be worth investigating to what extent the testing method proposed in this paper is suitable for stream X-machines that use relations instead of processing functions [15], or having functions that yield sequences of symbols rather than single symbols [2], or more challenging, whether it can cope with the complex structure of different variants of communicating stream X-machine systems ([1], [3]). References 1. J. Barnard, J. Whitworth, M. Woodward, Communicating X-machines, Information and Software Technology, 38 (1996), 401-407. 2. T. Balanescu, Generalised stream X machines with output delimited type, Fornal Aspects of Computing, 12 (2000), 479-484. 3. T. Balanescu, T. Cowling, H. Georgescu, M. Gheorghe, M. Holcombe, C. Vertan, Communicating Stream X-machines Systems are no more than Xmachines, Journal of Universal Computer Science, 5, 9 (1999), 494-507. 4. T. Balanescu, M. Gheorghe, M. Holcombe, Deterministic stream Xmachines based on grammar systems, in Words, Sequences, grammars, Languages: Where Biology, Computer science, Linguistics and Mathematics Meet (C. Martin-Vide, V. Mitrana eds.), Kluwer, 2000. 5. G. Bernot, M. Gaudel and B. Marre, Software testing based on formal specifications: a theory and a tool, Software Engineering Journal, 6 (1991),
228
387-405. 6. K.-T. Cheng, A.S. Krishnakumar, Automatic functional Test generation using the extended finite state machine mode, Proc. DAC, 1993, 1-6. 7. T.S. Chow, Testing software design modelled by finite state machines, IEEE Transactions on Software Engineering, 4, 3 (1978), 178-187. 8. P. Dauchy, M Gaudel, B. Marre, Using algebraic specifications in software testing: a case study on the software of an automatic subway, Journal of Systems Software, 21 (1993), 229-244. 9. S. Eilenberg, Automata, languages and machines, Vol. A, Academic Press, 1974. 10. G. Eleftherakis, P. Kefalas, Model checking safety critical systems specified as X-machines, Analele Universitd^ii Bucure§ti, Matematica-Informatica, 49, 1 (2001), 59-70. 11. M. Fairtlough, M. Holcombe, F. Ipate, C. Jordan, G. Laycock, Z. Duan, Using an X-machine to model a video cassette recorder, Current Issues in Electronic Modelling, 3 (1995), 141-161. 12. S. Fujiwara, G. von Bochmann, F. Khendek, M. Amalou, A. Ghedamsi, Test selection based on finite state models, Publication #716, Departement d'informatique et de recherche operationnelle, University of Montreal, 1990. 13. S. Fujiwara, G. von Bochmann, Testing non-deterministic finite state machines, Publication #758, Departement d'informatique et de recherche operationnelle, University of Montreal, 1991. 14. S. Fujiwara, G. von Bochmann, F. Khendek, M. Amalou, A. Ghedamsi, Test selection based on finite state models, IEEE Transactions on Software Engineering, 17, 6 (1991), 591-603. 15. M. Gheorghe, Generalized stream X-machines and Cooperating Distributed Grammar Systems, Formal Aspects of Computing, 12 (2000), 459-472. 16. R.M. Hierons, Testing from a Z specifications, Journal of Software Testing, Verification and Reliability, 7 (1997), 19-33. 17. M. Holcombe, X-machines as a basis for dynamic system specification, Software Engineering Journal, 3, 2 (1998), 69-76. 18. M. Holcombe, F. Ipate, A. Grondoudis, Complete functional testing of safety-critical systems, Safety and Reliability in Emerging Control Technologies: A Postprint volume from the IF AC Workshop on Safety and Reliability in Emerging Control Technologies, Daytona Beach, Florida, USA, 1-3 November 1995, 199-204. 19. M. Holcombe, F. Ipate, Correct Systems: Building a Business Process Solution, Springer Verlag, Berlin, 1998. 20. F. Ipate, M. Holcombe, Another look at computability, Informatica, 20 (1996), 359-372.
229
21. F. Ipate, M. Holcombe, An integration testing method that is proved to find all faults, Intern. J. Computer Math, 63, 3/4 (1997), 159-178. 22. F. Ipate, M. Holcombe, Specification and testing using generalized machines: a presentation and a case study, Software Testing, Verification and Reliability, 8 (1998), 61-81. 23. F. Ipate, M. Holcombe, A method for refining and testing generalised machine specifications, International Journal of Computer Mathematics, 68 (1998), 197-219. 24. F. Ipate, M. Holcombe, Generating test sequences from non-deterministic generalized stream X-machines, Formal Aspects of Computing, 12 (2000), 443-458. 25. G. T. Laycock, Formal specification and testing, Journal of Software Testing, Verification and Reliability, 2 (1992), 7-23. 26. D. Lee, M. Yannakakis, Principles and methods of testing finite state machines - A survey, Proceedings of the IEEE, 84, 8 (1996), 1090-1123. 27. P. Stocks, D. Carrington Test template framework: a specification-based test case study, SIGSOFT Software Engineering Notes, 18, 3 (1993), 11-18. 28. C.-J. Wang, M.T. Liu, Generating test cases for EFSM with given fault models, Proc. INFOCOM, 1993, 774-781.
This page is intentionally left blank
231
SOME F U N D A M E N T A L THEOREMS ON BCK KIYOSHI ISEKI Sakuragaoka-Kita-Machi 13-6 Takatsuki 569-0817, Japan E-mail: isekiejaponext .jams.or.jp In this note we present some new results on BCK structures, mainly about finite BCK. First, we give a new definition of BCK which is equivalent to an old definition (for example, see [1], [5], [7], [8]). Let P be a set with a partial order <. We assume that P has a least element 0, and that a binary operation * is defined on P. The partial relation < is reflexive, antisymmetric, and transitive. We say that P is a BCK if the binary operation * on P satisfies the following conditions: BCK1) (x * y) * [x * z) < z * y, BCK2) x * (x * y) < y, BCK3) x*x = Q,
BCK4) 0*x = 0, BCK5) x * y — 0 is equivalent to x < y. There are some special classed of BCK. Let X be a BCK: 1. X is positively implicative if (x * y) * y = x * y for all x, y 6 X. 2. X is commutative if x * (x * y) = y * (y * x) for all x, y £ X. Then x * (x * y) gives the greatest lower bound of x,y. Let us denote it by a; A y. This operation defines a lower semi-lattice on X. 3. X is implicative if X is positively implicative and commutative. 4. X has property S if for all a, b G X, the non-empty set {x £ X | x * a < b] has the greatest element in X. This element is denoted by a o 6. In this case, X is a partially ordered commutative semigroup with respect to the just introduced operation o, and this is referred to as the associated semigroup of X. The operation o has the following basic properties. BCK6) x,y < x o y = y o x, BCK7) x o (y o z) = (x o y) o z,
232
BCK8) x * (y * z) = x * (y o z), BCK9) x < y => x o z < y o z, for all z G X. 5. Let X be a BCK with property S. X is a BCK with supremum iixo(y*x) y o [x * y) for all x, y £ X.
=
A supremum x V y of x, y is defined by a; o (y * a;). The operation xV y gives an upper semi-lattice structure on X. This concept was introduced by Cornish, [2], [3]. Many basic and useful properties of these classes can be found in [7] and [8]. We only mention some of them. BCK10) x*0 = x, BCK 11) {x * y) * z = (x * z) * y (permutation rule), BCK12) x * [x * (x * y)] = x * y. R e m a r k 1. The class of all BCK structures is not a variety, so we do not use the terminology "BCK algebra", but we only refer it as a BCK. A system / satisfying BCK1) - BCK3), BCK5) and such that there is no element smaller than 0 (in symbols, x < 0 implies x — 0) is called a BCI. Then 0 is not necessarily the least element in /. Theorem 1. There exists at least one BCK structure on any partially ordered set with a least element 0. This BCK structure is given in the following way: x*y=<
f 0, ' [ x,
if x < y, \, ~ otherwise.
Proof. Properties BCK3) and BCK4) are obvious from the definition of x*y. To prove BCK2), let us consider two cases: if x * y = 0, then x < y and x*(x*y)=x*0
=
x
= x*x =
0
If x * y = x, then x*(x*y)
Thus, we have BCK2). Finally, we prove BCK1). Suppose first that x * y = 0. We get (x * y) * (x * z) = 0 * [x * z) = 0 < z * y. Second, if we have x * y = x, then either x*z subcase we have
= xoix*z
(x * y) * (x * z) — x * x — 0 < z * y,
= 0. In the former
233
and in the latter subcase we have x < z and (x * y) * (x * z) = x * 0 = x. On the other hand, x*y = 0orz*y = z. If z*y = 0, then z
234
There exists no other BCK (maximal) structure on any Chinese style fan and all subsets including 0 are subalgebras. On the other hand, any Japanese style fan has some other BCK structures. Problem 1. Find all (finite and infinite) BCK with only one BCK structure. Are there finite BCK with only one structure which are not of the Chinese style? The answer may depend on the order. Example 1. Let us consider the Japanese style fan of order 5. Then the *-table of the maximal BCK is given in the left side of the following table. In this case, there exist further three different BCK structures on it. * 0 1 2 3 4 * 0 1 2 3 4 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 1 1 0 0 0 0 2 2 2 0 2 2 2 2 1 0 1 1 3 3 3 3 0 3 3 3 1 1 0 1 4 4 1 1 1 0 4 4 4 4 4 0 The above right structure is commutative. Other two structures are mentioned in the following tables, but it seems that none of these structures has any special property. * 0 1 2 3 4
0 0 1 2 3 4
1 0 0 1 3 4
2 0 0 0 3 4
3 0 0 1 0 4
4 0 0 1 3 0
* 0 1 2 3 4
0 0 1 2 3 4
1 0 0 1 1 4
2 0 0 0 1 4
3 0 0 1 0 4
4 0 0 0 1 0
All elements in a BCK X appear in the column containing 0 in the *-table of X. All elements which appear in the diagonal of the table are 0. Let us consider the part of the triangle placed to the left side of the diagonal, and eliminate the first column (the 0-column). For example, from the above first two tables, we obtain the following two parts: 2
3 4
1
3 4
4
1 1 1 1 1
Such a triangle is called the essential part of X. Similarly, we can define the quasiessential part of X. Let us consider the triangle formed to the right side of the diagonal; we eliminate the first row (the 0-row) of it. The obtained triangle is called the quasiessential part of X. The quasiessential parts of the first two cases in Example 1 are as follows:
235
0
0 2
0 0 0 0 2 1 1 3 1 For any BCK linearly ordered, all elements of its quasiessential part are 0, as it can be easily seen. Definition 3. A BCK is called minimal if all elements of the essential and quasiesential parts are 0 or 1. The above Japanese style fan has a minimal structure, but for a Chinese style fan this is not always true. We have the following important result. T h e o r e m 3. A BCK is of type Y if and only if it is minimal. Proof. Let X be a partially ordered set with a least element 0. We assume that X is of type Y. Then x * y, for x,y £ X, is defined as follows: Of course, if x < y, then we have x * y = 0. For other cases, _ ( x, * ~\l,
X y
if y = 0, if y ^ 0
<mdx£y.
We check that x * y gives a BCK structure on X. It is obvious that BCK3) - BCK5) hold in X. To prove BCK2), we consider two cases: i) x * y = 0. Then x < y, so we have x*(x*y)=x*Q
=
x
ii) x * y = 1. Then y = 0 or y = 1, or 1 < y. If y = 0, then x = 1 and BCK2) holds. For the other two cases, since x * (x * y) < 1, BCK2) also holds. Finally, for BCK1), ifa;*j/ = 0 o r a : * j / = l , a;*2 = l, then BCKI) is true. Let x * y = I, x * z = 0. Then x < z and (x * y) * (x * z) — 1 * 0 = 1. If z * y = 0, then z < y. Hence x
236
The essential parts of the latter two structures are 1 3 4
1 3 4
4
4
1 1 4
4
The first element of these essential parts are 1. They are smaller than the first element 3 of the maximal structure and greater than the first eelement 1 of the minimal structure. There are the same situations among the corresponding elements. The same fact holds for the quasiessential part. Therefore we can say that each structure is between the maximal and minimal structures (this is valid for a non-minimal case). For every finite BCK, we can theoretically find all BCK structures, but the calculation is not easy. Problem 2. Find an algorithm to determine all finite BCK structures. In what follows, we consider a factor (branch) of a partially ordered set P with a least element 0. Definition 4. Each member of the family {Pn} of subsets of P is called a factor [branch) if it satisfies the following conditions: (Fl) Each Pn is a partially ordered set with 0. (F2) P is the union of {Pn}. (F3) P m n P„ = {0} for m ^ n . Then each Pn is a BCK and for x G P m ,2/ G Pn, with m ^ n, we have x * y = x. Conversely, let {Pn} be a family of partially ordered sets. Let us suppose that the least element 0 is common in all P„, and that {Pn} is a disjoint family except the element 0. Moreover, we suppose that each of {Pn} has a BCK structure. Then the following result holds. Theorem 4. On the union P of Pn, a BCK structure is uniquely introduced, and each Pn is a subalgebra under the structure on P. For x G Pm and y G Pn, with n ^ m, we have x * y = x. Proof. Under the above definition, BCK3) - BCK5) hold in P. If x, y are in the same branch, then BCK2) holds. If x, y belong to distinct branches, x*y — x, then for any element y in P, x*(x*y)=x*x
=
0
Hence BCK2) holds in P. To verify BCK1), three cases are considered, namely, for m^n: 1) x, y G Pm, z G P„; 2) x,z<= Pm,y £ P„; 3) y,z G Pm,x € P„.
237
1. Let x,y £ Pm,z £ Pn. Then, by x * y < x, (x * y) * (x * z) = (x * y) * x — 0 < z * y. 2. Let x,z e Pm,y€
Pn- Then
(x * y) * (x * z) = x * (a; * z) = £ * x = 0 < z * y. 3. Let y, z £ Pm,x € -Pn- Then (2; * j/) * (x * z) = x * x = 0 < z * y. Therefore, BCK1) holds. Conversely, we prove that x * y = x for x £ P m and y £ Pn,m ^ n. Since x * y < x, x *y belongs to Pm. From £ * (a; * y) < x, x * (x * y) £ Pm. On the other hand, by BCK2), x * (x * y) < y, hence x * [x * y) < y. The fact that y £ Pn implies that x * (x * y) belongs to Pn. Consequently, x * (x * y) £ Pm n Pn = {0}. Therefore we have x * (x * y) = 0 . Hence x < x * y. Since x * y < x holds, we obtain x = x * y, which completes the proof. • It follows from the proof that the BCK structure of each Pn is preserved in P. Theorem 4 is very useful for constructing various kinds of special BCK. For instance, the union of several two elements BCK is a Chinese style fan, and the BCK structure is given by the above equation. The uniqueness of the BCK structure on a Chinese style fan also follows from Theorem 4. Moreover, the BCK structure of each branch is positively implicative (or commutative) if and only if P is positively implicative (or commutative). This follows from (x*y)*y = x*y for x £ Pm, y £ Pn,m ^ n. On the other hand, we can easily construct many interesting commutative BCK by using Theorem 4. References 1. M. Abe, K. Iseki, A survey on BCK and BCI algebras, Congresso de Logica Aplicada a Tecnologia, LAPTEC 2000, 431-443. 2. W.H. Cornish, BCK algebras with asupremum, Math. Japonica, 27 (1981), 63-73. 3. W.H. Cornish, BCK algebras with a supremum II. Distributivity and interpolations, Math. Japonica, 29 (1982), 439-447. 4. J.M. Harper, J.E. Rubin, Variations of Zorn's lemma, principles of cofinality, and Hausdorff's maximal principle I, II, Notre Dame Journal of Formal Logic, 17 (1976), 565-588, 18 (1977), 161-163.
238
5. K. Iseki, A way to BCK and related systems, Math. Japonica, 52 (2000), 163-170. 6. K. Iseki, On finite BCK with condition S, Proc. Colloq. Algebra, Languages, and Computations, 2000, 16-25. 7. K. Iseki, Sh. Tanaka, An introduction to the theory of BCK algebras, Math. Japonica, 23 (1978), 1-21. 8. J. Meng, Y.B. Jun, BCK Algebras, Kyung Moon Ss. Co., 1994.
239 A C H A R A C T E R I Z A T I O N O F P A R I K H S E T S O F ETOL L A N G U A G E S IN T E R M S OF P S Y S T E M S
MASAMI ITO Department of Mathematics, Faculty of Science Kyoto Sangyo University, Kyoto 603-8555, Japan E-mail: ito€ksuvxO.kyoto-su.ac. j p CARLOS MARTIN-VIDE Research group on Mathematical Linguistics Rovira i Virgili University PL Imperial Tarraco 1, 43005 Tarragona, Spain E-mail: cmv6astor.urv.es GHEORGHE PAUN Institute of Mathematics of the Romanian Academy PO Box 1-764, 70700 Bucuresti, Romania E-mail: [email protected] We prove that the Parikh sets of ETOL languages are exactly the sets of vectors of natural numbers computed by P systems (without cooperating rules, without priorities, and without target indications) which can create new membranes as a result of objects evolution (at any moment of a computation, the number of membranes is bounded by a given constant; two membranes at any moment are sufficient).
1
Introduction
P systems are a class of distributed parallel computing models introduced in [4], inspired from the way the alive cells process chemical compounds, energy, and information. In short, in the regions delimited by a membrane structure (see Figure 1 for an illustration of this notion), one places multisets of objects, which evolve according to evolution rules associated with the regions; a computation consists of transitions among system configurations; the result of a halting computation is the vector of the multiplicities of objects present in the final configuration in a specified output membrane or of objects which leave the external membrane of the system (the skin membrane) during a computation. That is, a P system computes a set of vectors of natural numbers. Many variants characterize the family of recursively enumerable sets of vectors of natural numbers, which are exactly the Parikh sets associated with recursively enumerable languages. Details can be found in [4], [1], etc. When membrane division is allowed, NP-complete
240
problems can be solved in linear time, [7], [3]. (The current bibliography of the domain, as well as many downloadable papers, can be found at the web address http://bioinformatics.bio.disco.unimib.it/psystems.) In [2] it is proved that the vectors computed by P systems without cooperating rules and without priorities are Parikh sets of ETOL languages, but the converse is left open. We do not solve here this question (we do not necessarily believe that the converse is even true), but we consider a slight modification of P systems which is able to lead to a characterization of Parikh sets of ETOL languages. Namely, we add the possibility that a membrane can be created as a result of an object evolution (this supposes that a possible list of membranes is given, so that the rules which can act in the region of the new membrane are identified by the label of the membrane; always a new membrane is an elementary one). The P systems with this feature, without cooperating rules and without using a priority relation among its rules and with the communication of objects controlled by indications here, out, in (hence without using the powerful indication irij, which also specifies the label, j , of the target membrane), and which at any time have a number of membranes bounded by a given constant, exactly generate the Parikh sets of ETOL languages; specifically, two membranes suffice (but we need membranes of three types). membrane
skin
elementary membrane
membrane
region
Figure 1: A membrane structure We do not know whether or not systems without a bound on the number of membranes can generate sets of vectors which are not Parikh sets of ETOL languages. (In order to positively solve this question we would first need to
241 know sets of vectors of natural numbers which are not the Parikh sets of ETOL languages, and such examples are not at all frequent in the "classic" L systems theory; for instance, from [9] we find only one example, {an \ n a prime number}.) 2
P Systems with M e m b r a n e Creation
We refer to [10] for the elements of formal language theory we use here. We only specify t h a t for a string x E.V* and a symbol a 6 V, we denote by \x\ the length of x and by \x\a the number of occurrences of the symbol a in the string x. T h e families of context-free, context-sensitive, and recursively enumerable languages are denoted by CF,CS,RE, respectively. For w 6 V*,V = {a\,.. .,an}, we denote by ^y(w) the Parikh vector of w, t h a t is, \Py(u;) = (|tu| a i , • • •, l w | a „ ) ; this is extended to languages in the natural way. For a family FL of languages, we denote by PsFL the family of Parikh sets of vectors associated with languages in FL. A membrane structure will be represented by a string of matching labeled parentheses. For instance, the membrane structure in Figure 1 is represented by U U *2 U J3 U U J5 U 1-8 J8 U J9 -U L7 J7 -U Jl A multiset over an alphabet V is represented by a string over V and each string precisely identifies a multiset; the Parikh vector associated with the string indicates the multiplicities of each element of V in the corresponding multiset. Thus, when speaking of a "multiset" w £ V* we understand the multiset identified by w. We are now ready to introduce the class of P systems we will investigate in this paper, and we introduce it in the particular variant we will consider below. A P system
with membrane
creation is a construct
Y{=
(V,T,^,wi,...,wk,Ri,,...,Rn),
where: (i) V is an alphabet; its elements are called objects; (ii) T C V (the output alphabet); (iii) /i is a membrane structure consisting of k membranes, with the membranes and the regions labeled (not necessarily in a one-to-one manner) by elements of a given set A; let us assume t h a t the possible labels are 1,2,... ,n, and t h a t the skin membrane and only this membrane is labeled with 1; then, the membranes in fi are labeled by i\, 12,..., ik, for some 1 < ij < n, 1 < j < k, with /"i = 1;
242
(iv) w\,. .., Wk, are multisets over V associated with the regions i\, ii, • • •, ik of (v) Ri, 1 < i < n, are finite sets of evolution rules over V. These rules are of the form a —> v, a —> v8, or a —> [.v]., where o £ V , 1 < i < n, v is a string over V x {here, out, in} and J is a special symbol not in V. In R\ no rule can contain 6 and no rule of the form a —> [lv]l can appear in any set Ri. When presenting the evolution rules, the indication "here" is in general omitted. The membrane structure and the multisets in II constitute the initial configuration of the system. Note that the initial configuration can contain a number k of membranes which has no relation with n, the number of possible types of membranes. The rules in a set Ri are applicable to objects in each region delimited by a membrane with the label i (that is, the identification between regions and sets of rules is given by the labels of membranes, which appear as subscripts of sets of rules). The passing from a configuration of the system to another configuration is done by a maximal parallel application of rules: all objects, from all membranes, which can be subject of local evolution rules should evolve by means of these rules. The choice of rules to be used and of objects to which these rules are applied is done in a nondeterministic way. The application of a rule a —> v in a region containing a multiset w means to remove a copy of the object a from w and to add the objects specified by v, following the prescriptions given by v. If an object appears in v in the form (a, here), then it remains in the same region; if it appears in the form (a, out), then a copy of the object a will be introduced in the region of the membrane placed directly outside the region of the rule u —> v (if the rule is applied in the skin membrane, then a is sent out of the system); if it appears in the form (a, in), then a copy of a is introduced in one of the membranes placed directly inside the region of the rule a —> v, nondeterministically chosen, if such a membrane exists, otherwise the rule cannot be applied. If the special symbol S appears, then the membrane which delimits the region where we work is dissolved, and all the objects in this region become elements of the region placed immediately outside, while the rules of the dissolved membrane are removed. When applying a rule a —>• [ .v]. in a region j , a copy of a is removed and a membrane with the label i is created, containing the multiset v, inside the region of membrane j . In this new membrane, the set Ri of rules will be applied. In this way, several membranes with the label i (and hence the same rules) can be present in various
243
places of the membrane structure of the system. The skin membrane is never dissolved and we can never create a new membrane with label 1. A sequence of transitions between configurations of II is called a computation of II. A computation is successful if and only if it halts, that is, there is no rule applicable to the objects present in the last configuration, The result of a successful computation is ^T{W), where w describes the multiset of objects from T which have left the skin membrane during the computation; we say that this vector is generated by II. (Note that we take into account only the objects from T.) We denote by N(U) the set of all vectors generated by II and by Nm(U) the set of vectors generated by computations whose configurations contain at most m membranes, for a given m > 1. The family of all sets N(H) is denoted by CP(S); if only systems without using the membrane dissolving action are used, then we replace S by nS. For each m > 1, the family of all sets Nm(U) is denoted by CPm(a) and their union over m is denoted by CP*(a),a £ {S,nS}. When the membrane creation is not used, we remove the letter C from the front of notations of these families. We close this section with an example: let us consider the P system II = ({a,a',6,c},{6},[ 1 [ 2 ]7}vX,a'c,Ri,R2,
R3),
with the following sets of rules: R1 = {a —> a',a' —>• (a,in), c—>[ 3 c] 3 , b —> (a, out)}, R2 = {a' —> a, a —» a 2 , c —> c, c —> cS}, R3 = {a -> 6, 6 ->• 63, c -)• c, c ->• S}. Initially, we have only two membranes, with only two objects, in membrane 2, a copy of a' and one of c. We produce 2 n copies of a, for some n > 0, in n + 1 steps; in the first step we pass from a' to a, in the last one the membrane is dissolved and 2" copies of a and one copy of c are left free in membrane 1. In the next step, each a is replaced by a' and, simultaneously, a copy of membrane 3 is produced. All objects are sent to this membrane, where first we replace a by b, then we multiply by 3, repeatedly, the number of objects 6. At any moment, also membrane 3 is dissolved. At the next step, all copies of 6 are sent out of the system. Consequently, N(Il) = {(2"3 m ) \ n,m > 0}. Note that we always have at most two membranes in our system, hence iV(II) = A^II).
244
3
Some Preliminary Remarks
We mention here some results about the generative capacity of the P systems with membrane creating possibilities which either directly follow from the definitions or are consequences of results proved in [4], [2], [8]. Note that our systems are more general than those in the mentioned papers, in the sense that if we skip the membrane creation feature we get a system as in those papers. A slight difference appears in what concerns the way of defining the result of a computation. Here we consider the multiset of objects leaving the system, while in [4], [2] one deals with the multiset of objects present in a specified output membrane at the end of a computation, and in [8] one considers the strings of objects which leave the system, arranged in the order they exit from the skin membrane. However, these differences are not important in what concerns the generative power, systems with the output defined in one way can be simulated by systems with the output defined in another way (sometimes, one further membrane is necessary). In our case, we have chosen to read the result of a computation outside the system because the membrane structure can dramatically change its shape by dissolving and creating membranes; moreover, we do not have a one-to-one labeling of membranes, thus we cannot indicate in advance an output membrane. In what follows, we need the notion of an ETOL system, which is a construct G= [V,T,w,Px,. . .,Pm), m > 1, where V is an alphabet, T C V, w £ V*, and Pi, 1 < i < m, are finite sets [tables) of context-free rules over V such that for each a £ V there is at least one rule a —> x in each set P, (we say that these tables are complete). In a derivation step, all the symbols present in the current sentential form are rewritten using one table. The language generated by G, denoted by L(G), consists of all strings over T which can be generated in this way, starting from w. An ETOL system with only one table is called an EOL system. Details can be found, e.g., in [9]. We denote by EOL and ETOL the families of languages generated by EOL and ETOL systems, respectively. The following inclusions are known: PsGF c PsEOL C PsETOL C PsCS. For instance, {(2 n ) | n > 1} £ PsEOL - PsCF, {(2 n 3 m ) | n,m > 0} £ PsETOL - PsEOL (according to Exercise II.4.4 from [9], {a2"3™ | n,m > 0} £ ETOL — EOL; note that this set is computed by the P system in the example from the previous section, hence we get the fact that CP2(nPri,S) — PsEOL ^ 0), and {(n) \ n prime} £ PsCS - PsETOL (see Exercise VI.2.6 in [9]). Using these relations, from the definitions and from [4], [2], [8], we obtain the following relations:
245 (i) PsCF
= CPi(n6)
C PsEOL
(ii) Pi{a) C CPi(a),a
C
CP2{S).
G {<$, nS} for all i > 1.
(iii) Pi(a) C P ; + i ( a ) for a l i i > 1 a G {<5, rcJ}. If catalysts are used, hence (non-context-free) rules of the form ca —» cv, where c is an object which only assists other objects when evolving and it is not changed during a computation, and also a priority relation among rules is considered, then a characterization of Parikh sets of recursively enumerable languages is obtained. In [2] it is proved t h a t the Parikh sets of ETOL languages can be generated by P systems with priorities and without using the m e m b r a n e dissolving action (Theorem 6) and t h a t P*(S) C PsETOL (Theorem 7), but the relations between PsETOL and P,-(a),i > I,a G {6,nS}, are not settled. In the case of using the membrane creation feature, the inclusion PsETOL C CPi(S) is easy to be obtained, even for a small value of i, namely, i = 2, as we shall immediately see. 4
Characterizing
PsETOL
We summarize the main result of this paper in the next theorem, then we give its proof in two lemmas: T h e o r e m 1. PsETOL L e m m a 1. PsETOL
= CPm(S) C
= CP*{6), for
allm>2.
CP2(S).
Proof. According to Theorem 1.3 in [9], for each language L G ETOL there is an ETOL system G which generates L and contains only two tables, t h a t is, G = (V,T,w, Pi, P2). Moreover, if we examine the proof of t h a t theorem, we find t h a t after each use of table Pi we either use again table Pi or we use table P2, but after each use of table P2 we always use table P\\ at the first step of a derivation, we use table P i . Making use of this observation, we construct a P system as follows. Denote V' = {a' | a G V } , V" = {a" \ a G V} and define the morphism h by h(a) = a',a G V. Then, let us consider the system U=(VUV'uV"UTU{c},T,{1[2}2]l,X,wc,R1,R2,R3), with the folowing sets of rules: P i = {a -> h(v) | a -)• v G P2) U {a1 ->• [a, in) \ a G V]
246 U {a" -> (a, out) | a G T } U { a " -)• a" | a G V -
T]
U { c - > [ 2 c] 2 , c - > [ 3 c ] 3 } , i?2 = Pi U {c -> c, c -)• cS},
R3= U
{a^a"
| a G 1/}
{C-KJ}.
T h e system works as follows. In the initial configuration we have only two membranes, fi = [1[2 ]2]i- Table P i is simulated in m e m b r a n e 2 any number of times; when the rule c —>• cS is used, the membrane is dissolved and its contents is left free in membrane 1. We simulate here the use of table P 2 (all symbols are primed during this simulation) and, at the same time, either a membrane 2 or a m e m b r a n e 3 is created by c. At the next step, all objects are sent to the newly created membranes (without primes). If the created m e m b r a n e was 2, then the process can be iterated. In this way, we can simulate any derivation in G, and this is correct, because of the parallel mode of using the rules in the ETOL system G and the P system II and because of the way of using the tables of G (always after using P 2 we pass to using at least once P i ) . If the membrane with label 3 is introduced, then all objects sent to it are doubly primed and at the same time the membrane is dissolved. In the skin membrane, the double primed symbols are either sent out - providing t h a t they are from T - or can evolve for ever - in the case t h a t they are from V — T. In this way, we check whether or not the derivation in G was terminal; in the latter case, the computation in II never stops. Consequently, N(H) = Ps(L(G)). Because we always have at most two membranes present in our system, the proof is complete. • Note t h a t although at any m o m e n t we have at most two membranes present in the current configurations of our system, these membranes can be of three types. We do not believe that the number of types can also be decreased to two. We pass now to the difficult part of the proof, an extension of the technique from the proof of Theorem 7 from [2] to the case when also the membrane creating feature is present. L e m m a 2. CP*{5) C
PsETOL.
Proof. Let us consider a P system II — (V, T, /i, w\,..., Wk, P i , . • ., Rn), for some k > 1 and n > 1. Our goal is to construct an ETOL system G such t h a t ^T{L(G)) = Nm(H), for some given m > 1. To this aim, the following notations are useful.
247 In order to distinguish the copies of the same m e m b r a n e which m a y be simultaneously present in a configuration, we will label t h e m with pairs (i,j) of integers, such t h a t 1 < i < n identifies the type of the m e m b r a n e and 1 < j < m identifies the copy of the membrane of type i. Always, the skin membrane will be labeled with (1,1) and only one copy of this membrane is present. Consider all symbols e* '? , for 1 < i,i' < n and 1 < j,j' < m, plus the symbol e^°j°°. These symbols identify each membrane by the pair (i,j) and the membrane directly containing membrane (i, j); in the case of the skin membrane, we consider the outside region, identified by (oo,oo), as the covering "membrane". We denote by E the set of all symbols of this form. Consider now the language F over E consisting of all strings u such t h a t |u| < m, associated with all possible membrane structures consisting of at most m membranes, labeled with (j, j) as above, such t h a t the labels are distinct (if two copies of a membrane of the same type i are present, then one is labeled with (i, j) and the other with (i,j'), for j ^ j ' ) . For instance, for the membrane structure described by the string [(1,1)1(2,1) i(2,l)[(3,2) ](3,2)[(4,3)[(2,2) ](2,2)] (4,3)](1,1) a possible string of this type is 1,1 00,00 1,1 1,1 4,3 2 , l e l , l e 4,3 e 3,2 e 2,2' Note t h a t any permutation of the same string in F determines the same membrane structure and, indeed, such a string precisely identifies a membrane structure, because the subscripts and the superscripts of symbols in E correspond to edges in the tree associated with the membrane structure. For each u £ F we denote by u the classs of all permutations of u; let F be the set of all classes u, for u £ F. Note also t h a t not all strings in E* of length at most m are in F; for instance, 3 if e\ - appears in a string, and (i',j') ^ (oo, oo), then also e\, 'I should appear, for some i",j". Consider also the sets e
C ~ ici,i I l < i < 7 T . , l < j < m } , c
'
= Wij \l
<m},
D = {d{j I 1 < 1'< n, 1 < j < m } , D
' = {d'i,j I 1 < ?'< n , l < i < m } .
T h e elements of C and D identify all possible membranes in a membrane structure. When some c ; j (resp., d{j) will be replaced by cj- • (resp., rfj -), this
248 will indicate the fact t h a t a membrane with the label (i,j) was created (resp., dissolved). Let u 6 F describe a membrane structure / i u and let v £ D'* be a string such t h a t for each d\ • appearing in v, the symbol e\ '? appears in u (we say t h a t v identifies a substructure of u). Let us interpret the string v as identifying membranes of \iu which are dissolved. T h e membrane structure obtained from the membrane structure described by u by dissolving the membranes identified by v is described by a string z in F; we denote the class J by f(u, v) (that is, / is an operator which associates with any membrane structure and with any set of dissolved membranes from this structure a description of the resulting membrane structure). Clearly, / is a computable operator. Consider now the objects appearing in the regions of LT. If an object a 6 V is present in the region of a membrane labeled with (i,j), then we also mark the object with (i,j), and write a ( ' J ) . For u 6 F, v £ D'* such t h a t v identifies a substructure of u, and for (i,j) such t h a t there is a symbol e\ j in u, we denote by g(i,j; u, v) the pair (i",j") of integers which identify the region of the membrane structure identified by / ( u , v) where the objects from membrane (i,j) of u will be placed after dissolving the membranes identified by v. Clearly, g(i,j; u, A) = (i, j ) . Note t h a t knowing u and v we precisely know the place of all objects from the membrane structure described by u after dissolving the membranes indicated by v, hence also g is a computable operator. Let uo be the string from F which identifies the initial m e m b r a n e structure, ji, of n , let wo be the concatenation of the strings describing the initial multisets of n , after replacing each object a by a ( ' , J ' \ according to the region (i,j) where a is placed, let zc, ZD be the concatenation of all symbols from sets C, D, respectively. We now pass to define the ETOL system G we look for. Its total alphabet is T U C U C" U D U D' U {[u] | u G F} U {X, # } U { a ( i ' j ) | a £ V, 1 < i < n, 1 < j < m}, the terminal alphabet is T (X and # are new symbols; # is a trap-symbol, which can never be removed), the axiom is XW0[UO]ZCZD,
while the set of tables is constructed as follows (for each table we specify only the rules of interest for our proof, but not the completion rules for symbols a for which no rule of the form a —>• x is already given; t h a t is, rules of the form a —i a should be added to all tables when necessary).
249 1. For each t i G f w e consider the following table: Pu = {X -»• X', X' -» # , [u] -> [«]} U {[^]->#|^7Gi?-{M}} U {a -> # | for all a i n D ' U C'} U {a ( '' J,) -> v' | 1 < i < n, 1 < j < m, a —> v £ Ri, ej• •? appears in u for some i', j ' , and ?/ is obtained from v in the following way: if (6, Ziere) appears in v, then we put b^''3' in i/, if (6, out) appears in t>, then we put 6^
J
' in i/,
(% 3 J
if (6, in) appears in t>, then we put b for some (i",j")
'
in u
associated with a membrane
which is directly inside membrane
(i,j),
but if (6, out) appears in v and we have (i,j) = (1,1), then we put b in v' if 6 £ T, and we replace it by A if b £ 1/ — T} U {a ( i ' j ) ->• t/, dij -> d'ij | 1 < i < n, 1 < j < m, a —>• t;i5 £ Ri,e]3j appears in u for some i', j ' , and i/ is obtained from v in the same way as above} U {a^
->• « ( * ,0 eVj,c*, ( -» 4 , | 1 < i < n, 1 < j < m,
a —>• [kv]k £ it!,-, for some (k,l) which does not appear as a superscript in u and */fe<<) is obtained by replacing each symbol 6 which appears in v by the symbol 6^ • '}. 2. For each u £ F, z £ /?'*, and y £ C* such that f(u,z)y £ F we consider the following table (u indicates existing membranes, z indicates membranes of u which were dissolved at the previous step, and y indicates membranes which were created, hence they are added to membranes of u after removing the membranes indicated by z): Pu.z.y
= {X^X,
A _ - » # , [u] - » [ / ( « , z ) u ] }
7
U {[w ]-^# K £ F - { u } } U {a(i'j) -» a 9 ^ " ' 2 ) | 1 < i < n, 1 < j < m, a £ V, for each (i,j) which appears as a subscript in u}
250 U {dtj
-> djjjdij
—)• # | for d\ • appearing in 2}
U {c^ ^ —>• # I for
i c i,i -»• ci,j> c i,i ->• # I for c(-^ appearing in y}
U {c(- • —»• # I for Cj- • not appearing in j / } . 3. For each u £ F we consider the following table:
u {[«']^#|«'ei?-{w}} U {a -> # I for all a in C" U D'} U { a ^ -)• a I (i, j) appears as a subscript in u and no rule a —> v exists in i?,} # I ( i , j ) appears as a subscript in u and there is a rule a —> v in /?,-} U { d , j -> A, c,-j —>• A I 1 < i < n, 1 < j <
m}.
This ETOL system works as follows. T h e nonterminal symbols [u], for u £ -F, precisely identify the membrane structure. The symbols in D and C are associated with all possible copies of membranes, while the symbols in D' and C" indicate the membranes which are deleted, respectively created, at a given step of a computation. Initially, all symbols from D and C are present in the axiom of G, together with a description of the initial membrane structure and of the initial multiset. It is also present the control symbol X. In the presence of X only tables of the form Pu, P'u can be used (if a rule X1 —> # is used, then the derivation will never be a terminal one, because # can never be eliminated). T h e tables of the form Pu simulate the transitions in the P system II. Because each object a present in the region of a membrane (i,j) is present in G in the form a^'j', we precisely know the rules which can be applied to this object, namely, those from Ri. T h e application of such rules is simulated in such a way to take care of the communication commands here, out, in, the dissolving actions, and the membrane creation. Note t h a t the string u contains the necessary information for correctly handling the indication in: we know which are the membranes placed inside the membrane where we work, hence we can choose one of them, nondeterministically. T h e membranes which are dissolved are identified with symbols from D' and the membranes which are created are identified with symbols from C".
251
At the next step, we have to use a table of the type Pu,z,y, for u £ F identifying the existing membranes, z £ D'* identifying the dissolved membranes, and y £ C* identifying the created membranes. This table will both check whether or not the strings z,y indicate exactly the dissolved and created membranes, indeed (in the negative case, the trap-symbol # will be introduced) and it also computes the new string in F identifying the current membrane structure, as well as the new superscripts (i',j') of objects. This is done by means of the operators / and g defined at the beginning of the proof. Because X' is again replaced by X, we can iterate this procedure, hence any computation in II can be simulated by a derivation in G. At any moment, we can use a "terminal" table P'u, for some u £ F. It erases both the description u of the membrane structure and the symbol X, hence no further derivation step is possible. We check now also whether or not we have reached a halting configuration in II: if any further rule can be applied in II to the multisets corresponding to the obtained sentential form of G, then the trap-symbol # is introduced. All nonterminals in D U C are removed. If the derivation is terminal, that is, no occurrence of # is present in the string x obtained in this way, then $T{X) is exactly the vector of multiplicities describing the multiset computed by II: each object a £ T which is sent out of the skin membrane during the computation in II is introduced by a table of type Pu in the form a, and the only rules which process such a symbol are the completion rules a —> a; when a symbol a £ V — T is to be sent out of the skin membrane of II, this symbol is simply erased, hence it does not appear in the final string generated by G. In conclusion, * T (L(G)) = N(U). • The reader can check that we can work also with types of P systems different from that considered above and the inclusions in Lemmas 1 and 2 still hold. For instance, we can consider target indications of the form inf. when (a,irij) appears in the right hand of a rule b —y v which is applied in a membrane i, then a copy of a is sent to the membrane with the label j , providing that it appears immediately inside membrane i. Such a communication feature was considered in [4] and in many other papers. Note that this is a much stronger communication command than in, where the object is sent to one of the lower membranes, nondeterministically choosing it. Another possibility is to use electrical charges associated with objects and membranes, as proposed in [6]. Because in Lemma 1 we have only one internal membrane and because the construction in Lemma 2 can handle the electrical charges (which are markings +, —, 0), again the result in Theorem 1 holds also for this variant.
252
5
Final R e m a r k s
Up to now, most results about various classes of P systems have provided characterizations of recursively enumerable sets of vectors of natural numbers; for some very particular cases, characterizations of PsCF were easily obtained. The result proved above is the first one giving a characterization of the Parikh sets of languages in a family different from CF and RE. The fact that this family is ETOL is not unexpected: both P systems and ETOL systems use context-free rules, applied in a parallel manner, both of them use auxiliary symbols (this is not an essential feature in P systems, but it is crucial for ETOL systems). It would be of interest to also find characterizations by P systems of Parikh sets of other families of languages in the Chomsky or Lindenmayer areas. In particular, it is of interest to get a characterization of Parikh sets of deterministic ETOL languages (to this aim it is probably necessary to consider a sort of determinism also for P systems). Another important problem is to make use of the enhanced parallelism provided by the membrane creation feature in order to solve hard problems in a feasible time (trading space for time). For instance, by a rule a —>• aa, in n steps we can generate 2" copies of the object a, then, by a rule a —> [.v]. we can create 2" copies of the same membrane. By using exponentially many membranes, in [7] and [3] one solves NP-complete problems in linear time. Maybe this is possible also for P systems with membrane creation features; the difficulty seems to be the fact that all copies of the membrane i introduced by a rule a —>• [.ti]. as above contain the same objects, those identified by v (in [7], [3] we have much more freedom from this point of view). N o t e . The work of Gh. Paun was partially supported by a grant of NATO Science Committee, Spain, 2000-2001. References 1. C. Calude, Gh. Paun, Computing with Cells and Atoms, Taylor and Francis, London, 2000 (Chapter 3: "Computing with Membranes"). 2. J. Dassow, Gh. Paun, On the power of membrane computing, J. of Universal Computer Set., 5, 2 (1999), 33-49 (www.iicm.edu/jucs). 3. S. N. Krishna, R. Rama, A variant of P systems with active membranes: Solving NP-complete problems, Romanian J. of Information Science and Technology, 2, 4 (1999), 357-367. 4. Gh. Paun, Computing with membranes, Journal of Computer and System Sciences, 6 1 , 1 (2000), 108-143 (paper circulated in a preliminary form
253
5. 6.
7. 8. 9. 10.
as Turku Center for Computer Science Research Report No 208, November 1998). Gh. Paun, Computing with membranes. An introduction, Bulletin of the EATCS, 67 (1999), 139-152. Gh. Paun, Computing with membranes - A variant: P systems with polarized membranes, Intern. J. of Foundations of Computer Science, 11, 1 (2000), 167-182. Gh. Paun, P systems with active membranes: Attacking NP-complete problems, J. Automat, Languages and Combinatorics, 6, 1 (2001), 75-90. Gh. Paun, G. Rozenberg, A. Salomaa, Membrane computing with external output, Fundamenta Informaticae, 4 1 , 3 (2000), 259-266. G. Rozenberg, A. Salomaa, The Mathematical Theory of L Systems, Academic Press, New York, 1980. G. Rozenberg, A. Salomaa, eds., Handbook of Formal Languages, SpringerVerlag, Heidelberg, 1997.
This page is intentionally left blank
255 DISJUNCTIVITY
HELMUT JURGENSEN
E-mail:
Department of Computer Science The University of Western Ontario London, Ontario, Canada, N6A 5B7 and Institut fiir Informatik Universitdt Potsdam Am Neuen Palais 10 14469 Potsdam, Germany helmutSuwo.ca, h e l m u t @ c s . u n i - p o t s d a m . d e
We introduce the concepts of disjunctivity and syntactic morphism for general algebras; these specialize to the usual ones for semigroups and monoids. Moreover we review some of the results on disjunctivity, in particular, those that are due to G. Thierrin or related to his work.
1
Introduction
T h e historical origin of the term disjunctive in algebra is difficult to trace. It seems to originate in the theory of semigroups, in particular the theories of homorphisms of semigroups and of subdirectly irreducible semigroups. It is closely related to the notion of principal congruence on a semigroup. T h e first papers to use these terms or one of these, albeit with sometimes differring meanings, are those by P. Dubreil [5], M. Teissier [51], R. Pierce [36], G. Thierrin [52], R. Croisot [4], B. M. Schein [40,41,42], A more detailed and more complete account can be found in Volume 2 of [3] and in [42]. In the specific context of language theory, one of the first occurrences of the term of disjunctivity seems to be in E. Valkema's doctoral thesis [54]. Since then, the term of disjunctivity has acquired several different, but intuitively related meanings. The aim of this paper is to provide a survey on disjunctivity in various contexts. To survey the complete literature on disjunctivity would require a voluminous book. Rather than covering everything, we focus on questions treated in or raised by, the work of G. Thierrin. Our list of references contains some items which are not actually treated in this paper, but which we deemed to be directly relevant; nevertheless, the list is still far from being comprehensive. In the course of preparing the survey we decided to start with the notion of pointed algebra - suggested by the notion of pointed monoid, which has turned out to be useful for the algebraic study of non-regular languages - and to derive
256
the basic concepts in this framework. Recently, M. Steinby arrived at an equivalent generalization to algebras in [50] starting not with the category of pointed algebras, but with algebras in general and the concept of saturation. Not surprisingly, these two generalizations, while starting from different points, achieve, in essence, the same basic results. This paper is structured as follows: In Section 2 we introduce some the notation used throughout the paper and some basic notions. Section 3 gives a general introduction to pointed algebras, their congruences and morphism, their syntactic algebras, syntactic morphisms and syntactic congruences, and to disjunctivity. In Section 4 we consider the special case of pointed monoids and summarize known results for this case. In particular, we show that usual definitions form a special case of our general treatent. Section 5 reviews the role of the syntactic conguences in automaton theory. In Sections 6-8 we review a few results concerning disjunctive languages, disjunctive w-languages and disjunctive elements in semigroups. Generalizations to other structures and variants of disj u n c t vity are briefly discussed in Sections 9 and 10. The paper ends with a list of open problems in Section 11. 2
Basic Notions and Notation
In this section we introduce the notation used and we review some basic notions. We assume the reader to be familiar with classical semigroup theory as presented in [3,35], automata and language theory [14,6,29,55], the basics of algebra and category theory [7,32] in general, and combinatorics on words [45]. By N we denote the set of positive integers; No = N U {0}. For sets S and T, the notation / : S —> T means that / is a partial mapping of S into T, that is, a mapping the domain dom/ of which is a subset of S; when dom/ = S we write / : S —» T instead. The codomain codom/ of / is the set / ( d o m / ) . We identify f[S) with / ( d o m / ) . A mapping of S into S is called a transformation of S; the set of all transformations of S is a monoid, the full transformation monoid of S, with the identity mapping as identity element and multiplication {fg){x) — f{d{x)) f° r a ll transformations / and g and all x £ S. An alphabet is a non-empty set. While alphabets are usually assumed to be finite in language theory, we also consider infinite alphabets in this paper. The elements of an alphabet are called symbols. Let X be an alphabet. Then X* and X+ are the free monoid and the free semigroup generated by X, respectively. Their elements are words over X including the empty word e; one has X+ = X* \ {e}. The length of a word w £ X* is denoted by |iu|. Any subset of X* is a language over X. The set Xw is the set of w-words over X, that is, the set of right-infinite sequences of
257
symbols in X. For a word w G X* and j G No, we define w3 by re. tyJ; zz < w,
if j = 0, if j = 1,
I IUUJ-7'-1,
if j > 1.
+
A word w G X is said to be primitive if there is no v G X+ and i G N, i > 1, such that ID = vl. Let Q be the set of primitive words (over X). For j G N and a language I C X * , let L^ = {ioJ | w G £ } . For a semigroup S, the monoid 5 1 is denned by Qi
_ ( S, 1 5U{1},
—
if S is a monoid, if S is not a monoid,
where, in the latter case, 1 is a symbol not contained in 5 and si = Is = s for all s G Sl. For instance, X* = {X+)1 letting 1 = e. 3
Algebras and Pointed Algebras
In this section we introduce the notions of pointed algebra, congruence and morphism of pointed algebras, syntactic congruence, syntactic morphism, syntactic pointed algebra and disjunctive set. These notions are generalizations of notions common in the theories of semigroups and languages. We prove some basic properties, which specialize to known theorems in language theory. To keep the presentation simple, we consider only algebras in which all operations are total. Most of what follows can be extended to partial algebras requiring, however, a far more subtle treatment of details. A signature is a pair Q, = (P, v) with P a set of operation symbols and v a mapping of P into No. For / G F, v(f) is the arity of / . An Q-algebra is a pair (C, t) with C the non-empty carrier (set) and i the interpretation of the operation symbols as mappings, that is, t(/) : C ^ ) —> C for / G F. A pointed 0,-algebra is a pair (A, S) with A an fi-algebra and 5 a subset of the carrier of A. In the sequel we omit the mention of fi when Q, is understood from the context, that is, we write algebra instead of Q-algebra. Let Pi = (Ai,Si) and P2 = (^2,^2) be pointed algebras with A{ — (Ci,ii) for i = l , 2 . A (pointed) morphism of Pi into P2 is a morphism tp of A\ into Ai satisfying the additional condition of ip~1(S2) — S\. It is surjective, injective or bijective if it is so as a morphism of A\ into A^. The condition of
258
the categories S, M and 7£ of semigroups, monoids and rings, respectively, or other types of algebras for which the signature is known by convention; in such cases we omit the mention of the signature and its interpretation and identify the algebra with its carrier. For fi-algebras A\ and A?, a morphism p of A\ into Ai and elements x,y in the carrier of A\, the equivalence relation = v is defined by x ~ ^ y if and only if
yeC. If x ("10 y, then x $ y for all i3 £ Q. This implies y G S. If x V© y then, by the definition of the join operation, there is an n G N and there are sequences a: 1, £2, • • -xn-\ G C and 1? 1, i?2 > • • •) ^n £ © such that X tii X\ $2 £2 • • -Xn-l tin V-
259 As each di saturates S, one has x\, X2, • • •, xn-i, y £ S.
•
Let P — (A, S) be a pointed algebra. A congruence on P is a congruence of A which saturates S. The minimum of the lattice of congruences on P is the identity relation ~id,p, that is, x ~id,p y if and only if x = y; the maximum is the join of all congruences on P, denoted by ~Syn,p- In language theory, ~syn,p is known as the syntactic congruence. We extend this term to arbitrary pointed algebras. Moreover, we define the syntactic pointed algebra syn P to be the factor pointed algebra P/~syn,p — (^4/~syn,p, <S7~syn,p)- Let
+ i,.
..,Zv(S)_ij
and i(/)(zi,---.>z»,Z/,Zi+i>--->M/)-i) are in S or in C\S. Then ~ s y n = • Proof. As a is a congruence relation on A which saturates S, one has a C ~syir
Now suppose that x ~ s y n V and (x,y) £ a for some x,y £ C. Either both x and y are in S or not in S. Therefore, there exist / £ F, z\,..., zv^^\ £ C and i £ { 0 , . . . , v{f) — 1} such that i(f)(zi,..
.,Zi,x,zi+i,..
.,zv(j)-i)
£ S
and i(/)(zi,...,z,-,y, Zi + i,...,z„(/)_i) £ S, possibly with the roles of x and y exchanged. From
=
^ s y n ( i ( / ) ( z i , . . . , Z i , y , Zi + l , . . . , Z „ ( / ) _ l ) )
£
260 T h u s VsyniVsynlS1)) 2 S, contradicting the fact t h a t ~ s y n saturates This proves ~ S yn C a.
In [50], the syntactic congruence is defined in terms of translations, t h a t is, iterations of the conditions defining a in Theorem 3.3, in essence. Above, the iterations are not used as a is a congruence by definition. Consider a pointed algebra P = (A,S). The set S is said to be disjunctive in P if ~ s y n , p = ~ i d , p E x a m p l e 3.1 Consider the additive group Z of integers with addition as binary operation and with additive inverse as unary operation. A set S C Z is disjunctive in Z if and only if, for all x, y G Z, x ~ s y n y implies x = y. Now x ~ s y n y is equivalent to
xes
-x G S <-» -y G S,
V z G Z : X + Z G S 0 2 / + 2GS, z+ i e S H z + j e S by Theorem 3.3. As 0 is an additive identity element and Z is commutative these conditions can be simplified to x G S <-» y G 5, - z G 5 <-»• - j / G 5, V2 G Z : x + z G S ^ y + z G S . Thus, for instance, every singleton subset 5 is disjunctive. Indeed, let S = {x} for some x G Z. Then a; ~ s y n 2/ implies x = y as ~ s y n saturates 5 . On the other hand, consider y,y' £ Z \ {x} such t h a t y ~ s y n y'. Then y + k — x for a unique fc G Z and hence y' + k = ar; this implies y = y'. To show t h a t every singleton subset of Z is disjunctive only the additive group structure of Z was used in Example 3.1. T h e following characterization of disjunctive subsets of arbitrary groups is well-known. P r o p o s i t i o n 3.1 Let G be group and S C G. Then S is disjunctive if and only if there is no normal subgroup N of G other than {1} such that S is a union of cosets with respect to N. Proof. For S to be disjunctive, the normal subgroup N defining (psyn must be trivial, t h a t is, {1}. In this case, S is indeed a union of cosets of N. Conversely, assume that S is not disjunctive. Then there are distinct x, y EG with ^syn(^) = fsyn{y)- Thus, there is a normal subgroup N of G with |7V| > 1 defining ?syn and, as S is saturated by ~ S yn, S is a union of cosets of N. • Let P = (A, S) be a pointed algebra as in Theorem 3.3. T h e residue of P is
261
the set Wp of those elements x £ C satisfying the following two properties: (1) x £ S; (2) there is no / £ F, there are no z\,.. ., .z„(/)_i £ C and there is no ie {0,...,v(f) - 1} such that l(f)(zi,
. . . , Zi, X, Zi + 1, . . . , Z^tfyx) £ S.
For the purposes of this paper, a non-empty subset / of an algebra A is said to be an A-ideal of A if, for all x £ /, for all / £ F, for all z\,..., zv^_i £ C and for all i £ { 0 , . . . , z/(/) — 1} one has t(/)(2l,...,Z,-,X,Zi
+
i,...,Z„(/)_1)
£
/.
The A-ideals are subalgebras of A. Proposition 3.2 Let P be a pointed algebra. Then Wp is either empty or a ~syn-class. Moreover, Wp H 5 = 0. If non-empty, Wp is an A-ideal of A Proof. The proof of the residue being a class with respect to ~ s y n follows from the characterization of ~ s y n . By (1) of the definition, the residue is disjoint from S. Part (2) of the definition implies that Wp is an A-ideal. • For a pointed fi-algebra P = (A,S) with ft = [F,i>), A = »'€ { 0 , . . . , i > ( / ) - 1 } and
fAx)
= \ (/.*> z i>--->M/)-i
f £ F,
(C,L),
zi, • • -,zi/(/)-i 6 C, i(/)(2i,...,2i,:c,2«+i>---.M/)-i)
G
S
and
C(x)=U J€F
(J
C/^x).
ie{0,...,i/(/)-l}
Theorem 3.4 For x,y £ C one has x ~Syn 2/ */ a»<^ °»'y if C(x) — C(y) and both x and y are in S or not in S. Proof. This follows by Theorem 3.3. • 4
Pointed Monoids and Pointed Semigroups
Consider the signatures Cls = {Fs,vs) and Q M = [FM,VM) with Fs = {•}, FM = {-,1}, ^s(-) = ^M(-) = 2 a n d vM{l) = 0. The fts-algebras A - (C,i) for which t(-) is associative are called semigroups; the ftjvf-algebras A = (C,i) for which i(-) is associative and t(l) is an identity element for t(-) are called monoids. In the sequel we write • instead of t(-) and 1 instead of t(l) as long as there is no risk of confusion; moreover we often omit • altogether or replace it by a differnt symbol, depending on the context. Finally, we identify semigroups and monoids with their carriers as usual.
262
Proposition 4.1 Let P = (A,S) be a pointed semigroup and x,y G A. Then x ~syn y if and only if, for all u,v G A1, either both uxv and uyv are in S or not in S. Proof. The statement is a special case of Theorem 3.3. As this is not quite obvious we provide the details. Consider the relations 6>! = {(x,y)
| x,y G A,x
G S <-» y € 5, Vw G A : ux G S <-» uy 6 S} ,
9T = {(x,y)
\ x,y £ A,x
E S H- y e S,Vv e A : xv E S <-> yv e S} ,
and let a be the largest congruence on A which is contained in B\ C\9r. Then, by Theorem 3.3, a = ~SynLet p be the congruence p = {(x, y) | x, y G A, Vu, B g i 1 : ua;^ E ^ f ) uyv G 5 } . We prove that p — a. Consider (x, y) G
263
We continue considering a pointed semigroup P = [A, S). For a, b £ A and a^b-- = {c\ c e A 1 ,ac= b}, a^H
= uJ- ^, 1
-.
ab^ --= {c\ c e i 1 , a = c&},
= Ua ^ ,
HbW --
1 Cs(a) ~-= {(*. y) 1 z>y £ ^ , x a y G 5 } . The definiton of ^4-ideals specializes to the case of ideals in the usual sense for semigroups or monoids. Therefore, by Proposition 3.2, the residue of a pointed semigroup or monoid is either empty or an ideal. It consists of exactly the elements a £ A for which Cs{a) = 0. Moreover, a ~ s y n b if and only if Cs(a) = Cs[b). The set Cs{a) is sometimes called the set of permitted contexts of o, a term that has its roots in distribution theory of linguistics (see [31], for a survey and references). This characterization specializes the one of Theorem 3.4 to semigroups. The following alternative notation has been used in various publications:
H •.a = W - 1 ] , H . - a = a[~1]H, H ..a = Cs(a). Again there are two variants depending on whether the factor of 1 is included or not. 5
Automata
In this section we point out the connection between syntactic monoids and automata. Most of this is well-known and explained in detail in (older) textbooks; hence, proofs and references are omitted. Consider a pointed monoid P = (^4,5) with non-empty set of generators X. Let i) be the morphism of X* into A which extends the embedding X C A. The P-automaton is a quintuple P =
{A,X,8P,1,S)
where A is the set of states, X is the input alphabet, Sp : A x X ->• A : (a, x)
H>-
ax
264 is the transition function, 1 is the start state, and S is the set of final states. As usual, Sp is extended to arbitrary words in X* by
{
a,
if w = s,
aw, if w G X, Sp(ax, v), if w = xv for some x G X and v G X* for a G A and tu £ X*. The language accepted by P is the set L ( P ) = {w | w e r , ( f p ( l , u ) ) <E 5 } . Each ID G X* induces a mapping T^ : A —t A defined by rw(a) = Sp(a,w). By I"VTW = TWV, the set of these mappings is a monoid, the transition monoid T ( P ) of P . T(P) is a submonoid of the full transformation monoid of A. P r o p o s i t i o n 5.1 The P-automaton
P accepts the language
{w\weX*,r,(w)eS}. T w o states x,y E A oiP are said to be equivalent if, for all w G X * , either both Sp(x,w) and 8p(y,w) are in 5 or not in S. Let p be this equivalence relation. Let P/p be the automaton for the pointed monoid P/p, t h a t is,
P/p =
(A/p,X,SP/p,l/p,S/p)
with A/p as the set of states, X as the input alphabet, Sp/p : A/p x X —> A/p : (a/p, x) i-»-
[ax)/p
as the transition function, 1/p as the start state and Sjp as the set of accepting states. P r o p o s i t i o n 5.2 IfP' is a complete connected automaton accepting L(P) then there is an automaton morphism mapping P1 onto P/p. Thus, P/p is, up to isomorphisms, the unique reduced automaton accepting the set {w\w
e X*,T](W)
G
S}.
Moreover, T(P/p) is isomorphic with syn_P with TW I-» w / ~ s y n as isomorphism. E x a m p l e 5.1 Consider the alphabet X = {a, b} and the pointed monoid P = (X* ,S) with S - {anbn | n > 0 } . Let a, I and 0 be new symbols. T h e states of P/p are as follows: e/p,a/p,a2/p,... — ~ — _o
0,1, a, a
,...
265 where e/p = {e}, ai / p = {a*} for i <E N , 0 = WP) 1 = 5 \ {e} and a/ ~ {ai+1b)/p = {an+ibn \ n > 0} for i G N . The start state is e/p and the final states are e/p and 1. The transition function is given by a/p, a1+1/p, i p ( s , £) = •( 1, a', 0,
if s = e / p and x = a, if s = a'/P) i > 0 and £ = a, if s = a / p or s = a, and x = b, if s = a ! + 1 or s = a , + 1 , i > 0 and x = b, otherwise,
for a state s and x E X. This a u t o m a t o n reflects, directly, the structure of a deterministic push-down acceptor for 5 . In fact it is a one-counter machine. T h e reduced a u t o m a t o n of Example 5.1 is a special case of generalized BruckReilly extensions of semigroups in which every singleton subset is disjunctive [25]. A semigroup is said to be totally disjunctive if every singleton subset is disjunctive [25]. P r o p o s i t i o n 5.3 Let X be a finite alphabet and L C X*. Then L is the language interpretation of a regular expression over X if and only if the pointed monoid syn(X*, L) is finite. When syn(X*, L) is finite, it is isomorphic with the finite transition monoid of a reduced finite a u t o m a t o n accepting L. T h e connection between syntactic pointed monoids (usually just called syntactic monoids) and transition monoids of reduced a u t o m a t a described in Proposition 5.2 provides an algorithm, when the a u t o m a t o n is finite, for computing a concrete representation of the syntactic monoid by transformations of the finite set of states. T h u s , decision questions about languages can often be reduced to decision questions about finite concrete monoids and, thus, be decided effectively and possibly even efficiently. This is exploited, in particular, in the theory of codes (see [27] for details and further references). A similar connection has been established for tree a u t o m a t a in [49,50]. 6
Disjunctive Sets and Languages
In this section, we consider the rudiments of a theory of disjunctive subsets of free algebras. Consider a signature fi and an alphabet X. Let A x be the free (term) fialgebra generated by X. An (^l,X)-language is a subset of the carrier of A x ; when there is no risk of confusion, we say just language or language over X instead. Let I be a language and let P = ( A x , L) be the corresponding pointed algebra. L is disjunctive if and only if ~ S yn,p is the identity relation on A x -
266 Practically nothing is known about disjunctive languages in general. For the case of X finite and A x = X* being the free monoid generated by X, nearly everything ever published is contained in H. J. Shyr's book [45], especially Chapter 4. The results quoted in the sequel can be found there with their proofs and original references. T h e o r e m 6.1 Let X = {a}. syn(X*, L) is infinite.
A language L C X* is disjunctive
if and only if
For the rest of this section, let X be a finite alphabet with \X\ > 1. T h e o r e m 6.2 Let Q be the set of primitive words over X. Then, for j G N , the language Q^> is disjunctive.
every
C o r o l l a r y 6.1 X+ is a disjoint union of infinitely many disjunctive languages. + T h e o r e m 6.3 Every right ideal of X is a disjoint union of infinitely many disjunctive languages. Corollary 6.1 and Theorem 6.3 suggest an investigation of the decomposition of languages into disjoint unions of disjunctive languages. T h e main results on this can be found in [45], reflecting the state of approximately 1990. Several additional related results have been published since then, in particular also concerning disjunctive domains, by H. J. Shyr and S. S. Yu. T h e o r e m 6.4 A language L C X* is disjunctive if and only if for any u,v G Q with \u\ = \v\ and for the pointed monoid P = (X* , L), it follows from u ~ S yn,P v that u = v. T h e o r e m 6.5 If L C X* is disjunctive
then also L^
is disjunctive
for
every
I'GN.
Further properties of disjunctive languages can be found in [45]; a full characterization of such languages has not been obtained so far. Additional related references are [12,15,16,17,18,38,46,47,48,56,44]. 7
Disjunctive w-Languages
Three different notions of syntactic congruence for w-languages where introduced in the literature (see [30] for definitions and a comparison). Disjunctivity has been investigated for only the following one, which was originally defined in [19]. Consider a finite alphabet X with \X\ > 1 and an w-language L C Xw. For w G X* let CL{w) - {(u,v) \ u e X*,v e Xu,uwv G L). T h e relation ~ L on X* defined by w ~ L w' if and only if CL(W)
=
for w,w' G X* is a congruence relation, the syntactic sense of [19].
CL(W')
congruence
of L in the
267 We quote only one result from [19]. T h e o r e m 7.1 Let L — {w} with w 6 Xw. L is disjunctive if and only if every word v £ X* is an infix of w or, equivalently, the set of all prefixes of w is a disjunctive language. This implies, in particular, t h a t every w-word, which when considered as a sequence is random (see [1], for instance), is disjunctive. As shown in [28], there are disjunctive w-words, which are non-random. In a natural fashion, w-words can be considered as representations, at base \X\, of numbers in the interval [0,1]. Disjunctive words cannot represent rational numbers. In [28] the following questions were raised: (1) is disjunctivity preserved under change of base? (2) is randomness preserved under change of base? T h e former question has a negative answer [13]. T h e answer to the latter one is positive [2]. Syntactic monoids of w-languages in the sense considered in this section are also studied in [22], 8
Disjunctive Elements
Consider an algebra A and an element x of A. x is disjunctive if, for the pointed algebra P = (A, {x}), the syntactic congruence ~ s y n , p is the identity. In analogy to [25], we say t h a t A is totally disjunctive if every element of A is disjunctive. Again, very little is known about disjunctive elements of arbitrary algebras. As shown in 3.1, every group is totally disjunctive. For semigroups and monoids, some properties of disjunctive elements are known; however, a complete characterization is still missing. In the sequel, let P — (A,S) be a pointed semigroup with at least two elements. T h e set S is said to be neat if u /
_ ( 0, \ {0},
if A has no zero element, if A has a zero element 0.
An element x of A is neat if the set {x} is neat. T h e o r e m 8.1 [42] An element tive if and only if it is neat.
of a semigroup
with disjunctive
zero is
disjunc-
T h e least ideal of a semigroup A - if it exists - is the kernel of A. If A has a zero then the kernel exists and is equal to {0}. The least ideal of cardinality greater than 1 of a semigroup A with 0 - if it exists - is the core of A. T h e o r e m 8.2 [42] / / A is subdirectly irreducible, then A has at least two disjunctive elements. C o r o l l a r y 8.1 [52] If A is subdirectly irreducible, then A has a core.
268
Theorem 8.3 [42] If A has a disjunctive zero, then A is subdirectly irreducible if and only if A contains at least two disjunctive elements or, equivalently, if and only if A has a core. Further results along these lines can be found in [42]. They form the foundation on which to build a theory of disjunctive elements in semigroups. They have been exploited in [21] to characterize certain types of Rees matrix semigroups, which are totally disjunctive. In [25] they are used to characterize generalized totally disjunctive Bruck-Reilly extensions of semigroups and their relation to generalized push-down automata and generalized Dyck languages. Theorem 8.4 [43] If A is inverse and [0]-bisimple then every element of A and different from 0 is disjunctive. This statement, together with the preceding ones, was used in the investigation of monoids with disjunctive identity in [20]. We quote only one of the easier results of this work. Theorem 8.5 Each monoid can be embedded into a bisimple monoid with a disjunctive identity element. Typical examples of monoids with disjunctive identity include the groups, the bicyclic monoid and the polycyclic monoids, the latter two being closely related to Dyck languages. On a completely different line of thought, disjunctive elements show up in the context of the syntactic monoids of certain kinds of codes - we mention only some special cases; for details, a more general treatment and definitions, see [27,26]. For example, on a pointed monoid P = (A, S), consider the following condition Jj: Vxi,x2,y
€ A: (y E S Axiyx2
eS)->
xix2 = l.
For A = X*, a set S satisfying I\ is an infix code. Similar conditions exist for many other classes of codes. Under certain conditions they are invariant under morphisms of pointed monoids. For any monoid A we consider the following properties: • Mo: A is finitely generated. • Mi: A \ {1} is a subsemigroup of A. • M2: A has a zero. • M3: A has a disjunctive element c distinct from 1 and 0 such that c = xcy implies x = y = 1.
269 • M4: A has a disjunctive zero. • M5: There is an element c distinct from 0 in the annihilator of A such t h a t {c, 0} is the core of A. • MQ: There is an element c distinct from 0 which is contained in the intersection of the core and the annihilator of A. T h e following theorem generalizes a result due M. Petrich and G. Thier-
rin [34], T h e o r e m 8.6 [26] Let I be an invariant condition such that, for every S C X*, if I is true for P = (X*, S) then I\ is also true for P. The following conditions are eqivalent for a monoid A: 1. A is isomorphic
with the syntactic
monoid of some P = (X*, S) satisfying
I.
2. A has the properties monoid (A, {c}).
Mo, M i , M2 and M3, and I is true on the
pointed
3. A has the properties monoid (A, {c}).
Mo, M i , M4 and M5, and I is true on the
pointed
4- A has the properties monoid (A, {c}).
Mo, M i , M4 and Me, and I is true on the
pointed
9
Generalization to Other Structures
There have been few a t t e m p t s to investigate disjunctivity in structures different from semigroups or monoids. Special types of semigroups, like inverse semigroups or semilattices are considered in papers by H. Jiirgensen [23,24] and J. Zapletal [57,58]. T h e only publication we know of, which deals with algebras not contained in the category of semigroups, is [53]. This work concerns right-disjunctive elements in rings. 10
V a r i a n t s of D i s j u n c t i v i t y
Several variants of disjunctivity were introduced by G. Thierrin, H. J. Shyr and their co-authors. For example, a language L C X* with X a finite alphabet is said to be f-disjunctive if all ~ s y n -classes are finite (see [11], for example). Further variants are quasi-disjunctivity, relative disjunctivity, . . . [8,9,10,33,37]. Further references can be found in G. Thierrin's list of publications in this volume and in publications by H.J. Shyr and S. S. Yu.
270
11
Questions
In this section we list questions raised by the results derived or cited above; of course, this list could be extended by many more items. 1. For which kinds of f2-algebras, is there a connection between subdirect irreducibilty and the existence of special disjunctive elements as exhibited in [42] for semigroups? 2. When does an algebra have a disjunctive element? 3. When is an algebra totally disjunctive? 4. Characterize disjunctive subsets for certain types of algebras. 5. Characterize pointed algebras P such that syn P is finite. Is there a generalized kind of finite automata and a generalized kind of (regular) expressions, both reflecting the structure of f2, connecting finiteness with regularity? Could tree automata help? 6. Characterize disjunctive languages. 7. Develop the theory for algebras with types and for partial algebras. 8. Investigate and compare disjunctivity for w-languages using the other syntactic congruences discussed in [30]. 9. Can one define positional disjunctivities for algebras in general on the basis of the sets C/if- - analogous to left and right disjunctivity in semigroups and then characterize disjunctivity through the positional ones? 10. Can aspects of Montague's theory of the syntax and semantics of (natural) languages be expressed usefully by the terminology of Section 3? 11. Develop a general theory of the principal congruences in the sense of [36,4] for general pointed algebras and identify cases when these saturate and coincide with ~ sy nEven partial answers for special types of algebras might clarify both the notions of disjunctivity and syntactic congruence as well as properties of homomorphisms of the respective algebras. Acknowledgement. Work supported by the Natural Sciences and Engineering Research Council of Canada, Grant OGP0000243.
271
References 1. C. Calude, Information and Randomness — An Algorithmic Perspective, Springer-Verlag, Berlin, 1994. 2. C. Calude, H. Jiirgensen, Randomness as an invariant for number representations, in Results and Trends in Theoretical Computer Science (H. Maurer, J. Karhumaki, Gh. Paun, G. Rozenberg, eds.), Lecture Notes in Computer Science, 812, Springer-Verlag, Berlin, 1994, 44-66. 3. A. H. Clifford, G. B. Preston, The Algebraic Theory of Semigroups, Vols. I, II, Mathematical Surveys 7, American Mathematical Society, Providence, Rhode Island, 1961, 1967. 4. R. Croisot, Equivalences principales bilateres definies dans un demi-groupe, J. Math. Pures et Appl. (N. S.), 36 (1957), 373-417. 5. P. Dubreil, Contribution a la theeorie des demi-groupes, Mem. Acad. Sci. France (2), 63 (1941), 52 pp. 6. S. Eilenberg, Automata Languages and Machines, Volumes A, B, Academic Press, New York, 1974, 1976. 7. G. Gratzer, Universal Algebra, Springer-Verlag, New York, 1979. 8. Y. Guo, C. M. Reis, G. Thierrin, fd-Domains and rf-disjunctive languages, Chinese Sci. Bull, 34 (1989), 356-360. 9. Y. Q. Guo, C. M. Reis, G. Thierrin, Relatively f-disjunctive languages, Semigroup Forum, 37(3) (1988), 289-299. 10. Y. Q. Guo, H. J. Shyr, G. Thierrin, qf-disjunctive languages, in Papers on automata and languages, VII, DM 85-1, Karl Marx Univ. Econom., Budapest, 1985, 1-28. 11. Y. Q. Guo, H. J. Shyr, G. Thierrin, f-disjunctive languages, Internat. J. Computer Math., 18 (1986), 219-237. 12. Y. Q. Guo, G. W. Xu, G. Thierrin, Disjunctive decomposition of languages, Theoret. Computer Sci., 46, 1 (1986), 47-51. 13. P. Hertling, Disjunctive w-words and real numbers, J. UCS, 2 (1996), 549568. 14. J. M. Howie, Automata and Languages, Oxford University Press, Oxford, 1991. 15. M. Ito, H. Jiirgensen, H. J. Shyr, G. Thierrin, n-Prefix-suffix languages, Internat. J. Computer Math., 30 (1989), 37-56. 16. M. Ito, M. Katsura, H. J. Shyr, Relations between disjunctive languages and regular languages, in Proceedings, 12th Symposium on Semigroups. Tokushima, Japan, 1988, 9-11. 17. M. Ito, H. J. Shyr, G. Thierrin, Disjunctive languages and compatible orders, RAIRO Inform. Theor. Appl., 23, 2 (1989), 149-163.
272
18. M. Ito, G. Tanaka, Dense property of initial literal shuffles, Intemat. J. Computer Math., 34 (1990), 161-170. 19. H. Jurgensen, H. J. Shyr, G. Thierrin, Disjunctive w-languages, Elektron. Informationsverarb. Kybernet., 19, 6 (1983), 267-278. 20. H. Jurgensen, H. J. Shyr, G. Thierrin, Monoids with disjunctive identity and their codes, Acta Math. Hungar., 47, 3-4 (1986), 299-312. 21. H. Jurgensen, G. Thierrin, Semigroups with each element disjunctive, Semigroup Forum, 21, 2-3 (1980), 127-141. 22. H. Jurgensen, G. Thierrin, On w-languages whose syntactic monoid is trivial, Intemat. J. Computer Math., 12, 5 (1983), 359-365. 23. H. Jurgensen, Inf-Halbverbande als syntaktische Halbgruppen, Acta Math. Acad. Sci. Hung., 31 (1978), 37-41. 24. H. Jurgensen, Disjunktive Teilmengen inverser Halbgruppen, Arch. Math. (Brno), X V (1979), 205-207. 25. H. Jurgensen, Total disjunktive Bruck-Reilly-Erweiterungen von Halbgruppen und formale Sprachen, in Recent Developments in the Algebraic, Analytical, and Topological Theory of Semigroups (H. Jurgensen, K. H. Hoffmann, H. J. Weinert, eds.), Lecture Notes in Mathematics, 998, SpringerVerlag, Berlin, 1983, 281-309. 26. H. Jurgensen, Syntactic monoids of codes, Acta Cybernet., 14 (1999), 117133. 27. H. Jurgensen, S. Konstantinidis, Codes, in [39], 511-607. 28. H. Jurgensen, G. Thierrin, Some structural properties of u-languages, in 13th Nat. School with Intemat. Participation "Applications of Mathematics in Technology", Sofia, 1988, 56-63. 29. G. Lallement, Semigroups and Combinatorial Applications, John Wiley & Sons, Inc., New York, 1979. 30. O. Maler, L. Staiger, On syntactic congruences for w-languages, Theoret. Computer Sci., 183 (1997), 93-112. 31. S. Marcus, Contextual grammars and natural languages, in [39], 215-235. 32. S. McLane, Categories for the Working Mathematician, Springer-Verlag, Berlin, 1971. 33. A. D. Paradis, H. J. Shyr, G. Thierrin, Quasidisjunctive languages, Soochow J. Math., 8 (1982), 151-161. 34. M. Petrich, G. Thierrin, The syntactic monoid of an infix code, Proc. Airier. Math. Soc, 109 (1990), 865-873. 35. M. Petrich, Introduction to Semigroups, Charles E. Merrill Publ. Comp, Columbus, Ohio, 1973. 36. R. S. Pierce, Homomorphisms of semigroups, Ann. Mathematics, 59 (1954), 287-291.
273
37. C. M. Reis, f-Disjunctive congruences and a generalization of monoids with length, Semigroup Forum, 41 (1990), 291-306. 38. C. M. Reis, H. J. Shyr, Some properties of disjunctive languages on a free monoid, Inform, and Control, 37 (1978), 334-344. 39. G. Rozenberg, A. Salomaa, eds., Handbook of Formal Languages, SpringerVerlag, Berlin, 1997. 40. B. M. Schein, Embedding of semigroups in generalized groups, Matem. Sborn. (N. S.), 55 (1961), 379-400, in Russian. 41. B. M. Schein, On subdirectly irreducible semigroups, Dokl. Akad. Nauk. SSSR, 144 (1962), 999-1002, in Russian. Correction: 148 (1963), 996. 42. B. M. Schein, Homomorphisms and subdirect decompositions of semigroups, Pacific J. Math., 17 (1966), 529-547. 43. B. M. Schein, A remark concerning congruences on [0]-simple inverse semigroups, Semigroup Forum, 3 (1971), 80-83. 44. H. J. Shyr, Disjunctive languages on a free monoid, Inform, and Control, 34 (1977), 123-129. 45. H. J. Shyr, Free Monoids and Languages, Hon Min Book Company, Taichung, second ed., 1991. 46. H. J. Shyr, G. Thierrin, Disjunctive languages and codes, in Fundamentals of computation theory (Proc. Internat. Conf., Poznari-Kornik, 1977), Lecture Notes in Computer Sci., 56, Springer-Verlag, Berlin, 1977, 171-176. 47. H. J. Shyr, G. Thierrin, Primitive words and disjunctive languages, Soochow J. Math., 7 (1981), 155-163. 48. H. J. Shyr, S. S. Yu, Solid codes and disjunctive domains, Semigroup Forum, 41 (1990), 23-37. 49. M. Steinby, A theory of tree language varieties, in Tree Automata and Languages (M. Nivat, A. Podelski, eds.), Elsevier Science Publishers, Amsterdam, 1992, 57-81. 50. M. Steinby, General varieties of tree languages, Theoret. Computer Sci., 205 (1998), 1-43. 51. M. Teissier, Sur les equivalences regulieres dans les demi-groupes, C. R. Acad. Sci. Paris, 232 (1951), 1987-1989. 52. G. Thierrin, Sur la structure des demi-groupes, Publ. Sci. Univ. Alger. Ser. A, 3 (1957), 161-171. 53. G. Thierrin, Rings with right disjunctive elements, Simon Stevin, 55(1-2) (1981), 37-40. 54. E. Valkema, Zur Charakterisierung formaler Sprachen durch Halbgruppen, Dissertation, Universitat Kiel, 1974. 55. D. Wood, Theory of Computation, Harper & Row, New York, 1987.
274
56. S. S. Yu, Quasi-completely right disjunctive languages, Semigroup Forum, 41 (1990), 39-48. 57. J. Zapletal, Distinguishing subsets of semilattices, Arch. Math. (Brno), IX (1973), 73-83. 58. J. Zapletal, On the characterization of semilattices satisfying the descending chain condition and some remarks on distinguishing subsets, Arch. Math. (Brno), X (1974), 123-128.
275 STRING OPERATIONS SUGGESTED BY D N A BIOCHEMISTRY: THE BALANCED CUT OPERATION
LILA K A R I , A N D R E I P A U N Department of Computer Science University of Western Ontario London, Ontario, Canada N6A 5B7 E-mails: lkari/[email protected] We introduce and investigate an operation with strings suggested by DNA processing (by means of exonucleases): the operation of cutting strings of equal length from the beginning and the end of a string. A related operation is that of cutting a square of a string from the prefix of a string. The closure properties of families in the Chomsky hierarchy are investigated (and, with some exceptions, settled).
1
Introduction
This paper deals with DNA computing in info: inspired from what happens in vivo and what can be accomplished in vitro, we define certain operations with strings and languages and we study them as formal operations. More precisely, we consider the action of certain exonucleases on DNA molecules, resulting in cutting off nucleotides from the two ends of a (linear) DNA molecule. An example is given in Figure 1. In a known elementary time unit, Sa/31 cuts one pair of complementary nucleotides from the beginning of a DNA molecule and a pair from the end. Thus, in a given interval of time, (approximately) the same number of nucleotide pairs is removed from each end of the molecule. This is a rather interesting operation on strings. We extend it to languages in the natural way and investigate the closure properties of families of languages under this new operation. 2
Language Theory Prerequisites
We mainly introduce here the notations which we shall use in the sequel; for further details of formal language theory we refer to [6]. For an alphabet V we denote by V* the free monoid generated by V under the operation of concatenation; the empty string is denoted by A and V* — {A} is denoted by V+. The length of x £ V* is denoted by |x|. If x = x\X2X^, then we say that x\ is a prefix, x% is a substring, and X3 is a suffix of x. The sets of substrings, prefixes, and suffixes of a string x 6 V* are denoted by Sub(x), Pref(x), Suf(x), respectively.
276
The circular permutation of a string x £ V* is defined by cp(a;) = {vu | x = uv, for u, t; £ ^ * } The left quotient of a language L\ C V* by a language Li C V* is Li\Li = { i £ l / ' | utt £ Lj for some w £ £2}; the ngrfti quotient of Li by L2 is L\j'L? = {x £ V* I n o £ Li for some ui £ L2}. The /e/< derivative of a language I C K ' with respect to a string x £ V* is defined by dlx(L) = {w £. V* \ xw £ L}; the right derivative of L with respect to x is defined by dTx(L) = {w £ V* \ wx £ L}. 5'
3'
NNN NNN
a
NNN NNN 5' BalZl 3'
5'
NN NN
a
NN NN 5'
3'
5' N
3'
a
3'
N N 5' 3'
5'
a 3'
5'
Figure 1: Balanced cut by an exonuclease A finite automaton is given in the form A = (K, V, s0, F, P), where K is the set of states, V is the alphabet, s0 is the initial state, F is the set of final states, and P is the set of transitions, presented as rewriting rules of the form sa ->• s' (in the state s, the automaton reads the symbol a and changes its state to s'). A gsm (= generalized sequential machine) is a finite automaton with output: g = (K, Vi,V2, so, F,P), where K is the set of states, V\,V2 are the input and the output alphabets, s0 is the initial state, F is the set of final states, and P
277
is the set of transitions of the form sa —> xs', for s, s' £ K, a £ Vi, a; £ V2* (in state s, the machine reads the symbol a, changes its state to s' and produces the output string x). If in all rules sa —^ xs' we have x ^ A, then g is said to be X-free. A Chomsky grammar is denoted by G = (N,T,S,P), where N is the nonterminal alphabet, T is the terminal alphabet, S £ N is the axiom, and P is the finite set of rewriting rules, given in the form x —> y, with x, y £ (iVUT)* and x containing at least a nonterminal. Finally, by REG, LIN, CF, CS, RE we denote the families of regular, linear, context-free, context-sensitive, recursively enumerable languages, respectively. It is worth noting that all these families are closed under union, intersection with regular languages, restricted morphisms, left and right derivatives, and inverse morphisms; REG, CF, CS, RE we also closed under concatenation, Kleene closure, and circular permutation, but LIN is not closed under these three operations. All families above but CS are closed under arbitrary gsm mappings and under left and right quotients by regular languages; CS is closed under A-free gsm mappings only. 3
T h e Balanced C u t O p e r a t i o n
The basic operation we deal with in this paper, a model of the exonuclease action as shown in Figure 1, is defined as follows: for x £ V*, we consider the set of strings bc(x) = {x2 | x — xix2xz,
for xi,x2,x3
£ V* with \xi\ = |a?3|}.
We extend this operation - called balanced cut - to languages in the natural way: for LC V*,
bc(L) = (J bc(x). This operation is related to the double prefix cut operation: for x £ V*, we define dpc(:c) = {x2 | x = xxx\X2,
for some x\,x2
£ V"*}.
The relationship between these two operations is specified in the following lemma: L e m m a 1. If F is a family of languages closed under double prefix cut, circular permutation, and X-free gsm mappings, then F is also closed under balanced cut.
278
Proof. Let us first note that the closure under A-free gsm mappings also ensures the closure under intersection with regular languages. Consider a language L C V* and two new symbols, a, b. Consider the gsm g which maps any string x G V*, nondeterministically, into a string of the form albyaH, for some i,j > 0 such that all transitions of g are of the form sa —> f3s', where s,s' are states and a G V, 0 G V U {a, 6} (that is, g is A-free and if a'byaH G #(£), then \x\ = \y\ + i + j + 2). We obtain the equality: bc(L) = (dpc(cp(flf(L)) (~1 a*ba*bV*)) l~l 7*. Indeed, # transforms a prefix x\ and a suffix xs of a string cci^a^ G £ into alb,a,ib, respectively, with \xi\ = i + I, \x3\ = j + l,i,j > 0; by a circular permutation followed by the intersection with the regular language a*ba*bV* we obtain strings of the form a%ba3bx2] because no prefix zz of such a string can strictly contain the string a%baJb, the double cut operation followed by the intersection with V* means cutting the prefix a'ba^b; the only possibility is to have i — j , that is \x\\ = ja?31, which is equivalent to X2 G bc(ar). • We now investigate the closure properties of families in the Chomsky hierarchy under the operations be and dpc. The family of regular languages is closed under both these operations, as a consequence of the following result (a proof of it can be found in [7]): Lemma 2. The family of regular languages is closed under left and right quotients with arbitrary languages. Because we have dpc(L) = {xx | x G V*}\L, we obtain the closure of REG under double prefix cut; Lemma 1 ensures that we also have the closure of REG under balanced cut. The proof of Lemma 2 is not constructive, hence it makes sense to give a direct, effective proof of the closure of REG under our operations. Lemma 3. REG is effectively closed under the operation dpc. Proof. Let A — (K, V, so, F, P) be a finite automaton. For s G K, let s be a new state and let K = {s | s G K}. We construct the gsm g=
(K',V,V,s0,F,P'),
where A" = K U K U (K x K x K),
279 and P' contains the following transitions: 1. sa —>• s', for each sa —> s' £ P, 2. sa —>• ( s i , s i , so), for each sa —»• si G P , 3. ( s i , s 2 , s 3 ) a ->• ( s i , s ' 2 , s 3 ) , for all si G K,s2a
-)• s'2 G P, s 3 a ->• s 3 G P ,
4. ( s i , S2, S3)a —>• S4, for s 2 a -> S4 £ P, s 3 a —> si G P , 5. s i a —>• a s 2 , for each s i a —• s 2 G P . We have the equality g(L(/l)) = dpc(L(A)). Indeed, transitions of type 1 (followed by a transition of type 2) remove a prefix x of the scanned string such t h a t SQX = ^ * si in the a u t o m a t o n A, for some s\ G K\ one introduces the state ( s i , s i , s o ) and one continues by using transitions of type 3 (followed by one transition of type 4); the state s\ is memorized and one scans a string z such t h a t s\z =>* S4 and SQZ =>* s\\ therefore, also SQZZ =^>* S4 is a correct sequence of transitions with respect to the a u t o m a t o n A; the use of transitions of type 5 follows a p a t h in A which scans a string w. To summarize, zzw G L(A) and the o u t p u t of g under input zzw is w. Therefore, w G dpc(L(A)). • Of course, also the family RE is closed under the operations dpc, b e . In contrast, no other family in the Chomsky hierarchy is closed under these operations - with the note that it is an open problem whether or not LIN or CF are closed under the balanced cut operation. Of course, the non-closure of the family CF under the operation be would imply t h a t CF is not closed under the operation dpc. An upper bound for the family of languages of the form b c ( L ) , for L G CF, is provided by the family of m a t r i x context-free languages. A m a t r i x g r a m m a r is a construct G = (N,T,S, M ) , where N,T,S are as in a context-free g r a m m a r and M is a finite set of matrices, t h a t is sequences (Ai —• x\, . . . ,An —• xn) of context-free rules. Using such a m a t r i x means to apply the rules A\ —> x\,..., An —> xn one by one, in this order. T h e family of languages generated by such g r a m m a r s is denoted by MATX; when only A-free rules are allowed, the superscript is removed. It is known t h a t CF C MAT C CS,CF C MATX C RE,CS - MATX ^ 0 (see [2] for details), and t h a t each X one-letter language in MAT is regular (see [4]). L e m m a 4 . If L is a context-free
language, then bc(L) G
MATX.
Proof. Let L C V* be a context-free language. Consider the gsm g which transforms strings x\x2xz G V* into strings of the form clxid?, with i = | x i | , j =
280
|a?31; c, d are new symbols. The language g{L) is context-free. Let G = (N, V U {c,d},S, P) be a context-free grammar for g(L). Denote by h the morphism which leaves all symbols in N U V unchanged and maps the symbols c, d into C, D, respectively. We construct the matrix grammar G' = (AT U {C, 13}, V, 5, M), where M = {(X -+h{x)) \X -*x U {{C ^\,D-*\)}.
EP}
The use of a matrix of the form (C —> A, D —>• A) erases one occurrence of C and one occurrence of £). Therefore, a string C'yD^ with y £ V* (hence from h(g{L))) is transformed into y only when i = j . Consequently, L(G') = bc(L), which concludes the proof. D By an easy modification of the proof above, we get: Corollary 1. The family MATX is closed under the operation be. The above statement is not true if the operation be is replaced by dpc. In fact, a much stronger result is true, also proving the non-closure of LIN under the operation dpc: Lemma 5. There are linear languages L such that dpc(L) ^
MATX.
Proof. Let us consider the following language: L= {ahbai2b .. .ba^-'ca^-'b
.. .ba2i3ba2hc2a2il
|
k > 1, ij > 1, for all 1 < j < 2k - 1}. Clearly, this is a linear language. Consider also the gsm g which works as follows when scanning a string in L: - we scan the prefix wc, w 6 {a, b}*, and we leave it unchanged, - when scanning the substring czc2,z G {a, b}*, we replace one occurrence of 6 by bab (that is, a substring ab is inserted in an arbitrary place in z); all other symbols are left unchanged; - we leave the suffix a 2 ' 1 unchanged. The language g(L) is linear. Let us note that the strings in L have two "halves", separated by the central occurrence of c; the blocks of symbols a in the right half are of double length as compared to the corresponding blocks in the left half; the substring c2 separates the last blocks of a occurrences in the right half. When generating g{L), one
281 more block of a occurrences is introduced, consisting of one symbol only. In this way, the substring delimited by the occurrences of c have the same number of blocks of symbols a as the string placed at the left of the central occurrence of c. We have the equality dpc(#(L)) n ca+ = {ca2^'1
| n > 1}.
(*)
Let us examine the way of producing a string in ca+ by a double prefix cut operation, starting from a string in g(L). T h e strings in g(L) are of the form w = a^bJH
. ..ba^-'ca2^"-^..
.ba2irbabali'-1
.ba2hc2a2il,
..
for some k > l,ij > 1,1 < j < 2k - 1, and 3 < r < 2k — 1. In order to get the string ca2''1, we have to cut a prefix xcxc of w, t h a t is x = ailbai2b...bahk'1
= a 2 '' 2 *" 1 6 .. .ba2irbaba2i'-1
..
.ba2i\
W i t h a string w £ g(L) with this property, we associate an undirected graph T(w) as follows: - associate the nodes a i , . . . , «2/c-i with the blocks a'1,..., a'2k~1 and the nodes p1;...,/32k with the blocks a2'2"-1,..., a 2 '", a, a 2 ' ' - 1 , . . . , a2'2, a2*1; - draw an arc (a,-, /?;) for each i = 1, 2 , . . . , 2k — 1; call these arcs lower arcs; they express the equality of the substrings as of u; as imposed by the fact t h a t w = xcxcca2'1; - draw an arc (as,(3t) for each pair (s,t), 1 < s < 2k — 1,1 < t < 2k, such t h a t jt = 2is and a^i,at> are blocks which correspond to each other in the definition of L; call these arcs upper arcs; they express the relation between substrings a' of w placed to the left and to the right of the "central" occurrence of c, as imposed by the definition of L. Figure 2 presents the graph for the case of k = 3; the upper and the lower arcs are drawn in the corresponding positions. Let us denote by val(ai),val(/3i) the length of the substring as of w associated as mentioned above with a,-, Pi, respectively. Several facts about the graph T(w) are useful for the subsequent reasoning: - The node fak has the degree 1 (one upper arc and no lower arc reaches it). - T h e node f3p having val((3p) = 1 (that is, corresponding to the substring inserted by the gsm g in the strings of L) cannot be reached by an upper arc: otherwise, val{(3v) has to be an even number, the double of val(at) for
282
some t, which is not the case. Because all nodes /?i,... ,/?2fc-i a r e reached by a lower arc, it follows that /?/. is reached by a lower arc only, it has the degree 1. If ai,/3j are linked by an upper arc, then val(/3j) = 2 • val(aj); if they are linked by a lower arc, then val(ai) = val(j3j).
Figure 2: The graph T(w) for k = 3 - All nodes different from fak anc * PP mentioned above have the degree 2: all nodes a,-, 1 < i < 2k — 1, are reached both by upper and lower arcs; all nodes different from j3p are reached by an upper arc, all nodes different from /?2P are reached by a lower arc. - There is no cycle in T(w). Indeed, this is a bipartite graph, always nodes a,- are linked by nodes f3j. Assume that there is a cycle. It must contain the same number of nodes of type a,- as nodes of type f3j. Let a/a, • • -,ckk.,Pilt • • -,01, be these nodes. Because of the links by lower arcs, we must have the equality {val^a^^,..., val(aks)} = {ua/(/?( 1 ),..., val(/3is)}. Let q be the maximum of val(akt),l < t < s. Because of the upper arcs, 2q should be an element of the set {val((3it) | 1 < t < s}. However, 2q (£ {val(akt) \ 1 < t < s}, therefore { v a / f a / j j , . . . , val{aj.B)} ^ {val{Pit),..., val(/3is)}, a contradiction. Because T(w) contains no cycle and all nodes have the degree one or two, it follows that it is a connected graph. According to Euler theorem (a connected graph with nodes of even degree with the exception of two nodes contains an Eulerian path, starting in one of the two nodes of odd degree and ending in the other node of odd degree), T(w) contains a path starting in (3p, ending in fok and using all arcs (an Eulerian path). As we have seen above, val(/3p) = 1, val((32k) = 2i\. On this path, all the 2fc — 1 upper arcs are used. They relate nodes Q,-,/?J
283 such t h a t val(/3j) = 2 • val(cti). Consequently, the values are doubled Ik — 1 times. We start from val{/3p) = 1, hence val{j32k) = 22k'1 • val(/3p) = 22k~l. This concludes the proof of Equality (*). T h e language {ca2 " | n > 1} is not in the family MATX (the family MATX is closed under arbitrary morphisms and {a2 | n > 1} is a one-letter non-regular language). T h e family MATX is also closed under intersection with regular languages. Consequently, dpc((L)) ^ M ATX. • C o r o l l a r y 2. The families dpc.
LIN and MATX
are not closed under the
operation
As we have mentioned above, the closure of LIN under the balanced cut operation remains to be clarified. Note t h a t , because LIN is not closed under circular permutation, the non-closure of LIN under the operation be does not imply - via L e m m a 1 - the non-closure under the operation dpc. T h e case of the family CS is easy to be settled. T h e following more general result is true: L e m m a 6. / / a family F is closed under concatenation with regular sets, right derivative, and the operation be, then it is closed under the operation Suf of taking suffixes. Proof. For L CV*
and c, d ^ V, we can write Suf(L)=drd(bc(Ldc*)).
T h e equality can be easily checked: by a balanced cut operation, any prefix x of a string w £ L can be cut, as a prefix of wdc'; only when i = |a;| the derivative by d is defined. Thus, all and exactly the suffixes of strings in L can be obtained, and this completes the proof. • C o r o l l a r y 3. The family
CS is not closed under the operations dpc and b e .
For the sake of readability, we collect the results in the previous lemmas in a theorem: T h e o r e m 1. The closure properties
in Table 1 hold.
T a b l e 1: Closure properties under operations be and dpc be dpc
REG YES YES
LIN
CF
?
?
NO
?
CS NO NO
Note the interesting case of the family MAT operation be but not under the operation dpc.
MATX YES NO
RE YES YES
, which is closed under the
284
4
Related Operations
Several operations related to the previous ones can be imagined. For instance, instead of cutting a prefix and a suffix of the same length, we can cut a prefix and a suffix which are one the mirror image of the other (mirror balanced cut, mbc), or even identical strings (double balanced cut, dbc). All the closure properties proved in the previous section, with the exception of those referring to the family LIN, remain true for these new operations with similar proofs. (For instance, in the proof of Lemma 6 we can take V* instead of c* and we obtain the same result for each of mbc and dbc.) For the family of linear languages we need new proofs. L e m m a 7. The family LIN is not closed under the operation mbc. Proof. Consider the linear language L = {ahbai2b .. .baikba2ikb .. .ba2i2ba2ilba
| k> l,ij > 1,1 < j < k}.
We obtain mbc(L) n ba+b = {ba2"b \ n > 1}. Indeed, a string in ba+b is obtained by cutting from a string w = ailbai2b...baikba2ikb
..
.ba2i2ba2ilba
a prefix and a suffix which are one the mirror image of the other only when ailba'H...baik = mi(a2ik-ib.. .ba2'2ba2ilba). This implies that h = l,ij = fc_1 2ZJ_!, 2 < j < k, which means that ik = 2 . Because mbc(w)n6a+6 = {ba2'k}, we get mbc(w) n ba+b = {ba2 }. • L e m m a 8. The family LIN is not closed under the operation dbc. Proof. Consider the linear language L= {ahbahb k > ljj
.. .ba^-'ba2^-^
.. .ba2i3ba2i2b2a2il
|
> 1, for all 1 < j < 2k - 1}.
We proceed as in the proof of Lemma 5. Let again g be the gsm which inserts a new substring a'b in the "right half of strings in L, namely with i — 1. We obtain dbc(g(L)) n ba+b = {ba2^~lb
\ n > 1}.
This can be seen as in the proof of Lemma 5. For instance, the graph describing the links between the blocks a1 of the strings in g(L) which lead by a double balanced cut to a string in ba+b looks like that in Figure 3, where we have
285
considered the case k = 3. Ths substring to be obtained after the double balanced cut and the intersection with ba+b is the central one, corresponding to fa in the graph. •
c*i
«2
a3
a4
a5
fa
fa
fa
fa
fa
fa
Figure 3: The graph for the proof of Lemma 8 Another possibility is not to cut but to grow the strings at the two ends. Thus, we define the balanced growth of x £ V* by bg(z) = {xixx2
| xi,x2
£ V*, \xi\ = \x2\}.
It is very easy to prove that REG is not closed under this operation, but all other families considered above are closed. For instance, if G = (N, T, S, P) is a context-free grammar, the grammar with the rules P U {S' —> aS'b \ a, b 6 T} U {S' -> 5 } , with S' as the new axiom, generates the language bg(L(G)). This also shows that bg(L) £ LIN for each regular language L. Finally, instead of deleting or adding strings at the ends of a string, we can only mark a prefix and a suffix of the same length. More formally, we consider the operation of balanced marking, defined by bm(a;) = {xicx2cxz
\ x = Xix2xz, \x]\ =
\x3\}.
(For x £ V*, c is a symbol not in V.) Again, it is clear that REG is not closed under this operation, but CS and RE are closed. Neither LIN and CF are closed: for the linear language L = {anb2n | n > 1} we ha bm(I) n a+cb+cb+ = {ancbncbn | n > 1}, which is a non-context-free language.
286
However, bm(L) 6 LIN for L G REG: consider a finite automaton A = (A', V, s0, F, P) and construct the linear grammar G = (N, T, S, P'), where tf = { S } U {(«,«'), [«,«']
\s,s€K},
and P' contains the following rules: 1. S —> [s0, Sf], for all Sf G F, 2. [si,s 2 ] —>• a[s3, s4]6, for all sia ->• s3 G P, s46 4 s 2 6 P , 3. [si,s 2 ] -> c(si,s 2 )c, for all si,s2 G A', 4. S —> c9so, «/)c, for all Sf G F , 5. (si, s2) —>• a(fi3, S2), for all sja —)• S3 G P and s 2 G A', 6. (si, s2) -> a, for Sia —> s 2 G P, 7. [si, s2] -> cc, for si = s 2 , 8. S - > c c , if A e L ( i ) . The equality L(G) = bm(L(A)) is obvious. We conclude this paper by emphasizing the fact that the biochemistry of DNA suggests many new problems interesting from the formal language theory point of view. In particular, many new operations on strings and languages can be found in this area. Such operations have already been studied for example in [5], [1], but the investigation is by no means complete, [3]. Acknowledgement. Research supported by the Natural Sciences and Engineering Research Council of Canada, Grant R2824A01 and a graduate scholarship. References 1. J. Dassow, V. Mitrana, On some operations suggested by genome evolution, Proc. Second Pacific Symposium on Biocomputing (R. B. Altman, A. K. Dunker, L. Hunter, T. Klein, eds.), World Scientific, Singapore, 1997, 97108. 2. J. Dassow, Gh. Piiun, Regulated Rewriting in Formal Language Theory, Springer-Verlag, Berlin, Heidelberg, 1989. 3. J. Dassow, Gh. Piiun, Remarks on operations suggested by mutations in genomes, Fundamenta Informaticae, 36, 2-3 (1998), 183-200.
287
4. D. Hauschild, M. Jantzen, Petri nets algorithms in the theory of matrix grammars, Acta Informatica, 31 (1994), 719-728. 5. Gh. Paun, G. Rozenberg, A. Salomaa, DNA Computing. New Computing Paradigms, Springer-Verlag, Berlin, 1998. 6. G. Rozenberg, A. Salomaa, Handbook of Formal Languages, Springer-Verlag, Berlin, 1997, vols. 1-3. 7. S. Yu, Regular languages, a chapter in vol.1 of [6], 41-111.
This page is intentionally left blank
289 H O W TO G E N E R A T E B I N A R Y CODES U S I N G CONTEXT-FREE GRAMMARS
LASZLO K A S Z O N Y I Department of Mathematics, Berzsenyi College, H-9700 Szombathely, Hungary E-mail: k a s z o n y i @ f s 2 . b d t f . h u It is proved by Ito et al. in [8] that the construction of 2-codes defined over an alphabet V consisting of at least two elements may be reduced to the construction of primitive words over Y. In this paper we give some grammars generating sets of primitive words.
1
Introduction
The notion of n-codes was defined by M. Ito et al. in [8]. The family C2(Y) of 2-codes defined over the alphabet Y consisting of at least two elements is of particular interest, namely it was proved in [2] that C*2(Y) coincides with the family of antichains with respect to the partial order > c on Y* defined by x >c y
<=> 3u G Y* : y = xu = ux.
(1)
It is also proved in [8] that the construction of 2-codes may be reduced to the construction of primitive words over Y. In order to get such constructions it would be convenient to find a context-free grammar generating the language Q of all primitive words. Unfortunately, the existence of such a grammar may not be guaranted, more precisely, it is still now an open problem whether Q is context-free or not. (See [3,4,5,19,17].) In the sequel we will give some grammars generating primitive words of special types. In our notations we follow [8]. Let Y = {a, 6} be a fixed alphabet, denote Y* the free monoid generated by Y, i.e., the set of all words over Y including the empty word 1, and Y + = Y \ 1. For w G Y* and a G Y, by |iy| we denote the length of w, and |w| a is the number of occurrences of a in w. A language over Y is a set L C Y*. For any language L and any n G IN, where IN = {0,1,2,...} let L^n' = {w | there is v G L such that vn = w}. A word w is called primitive if w = un implies n = 1. Let Q denote the set of all primitive words over Y, where the alphabet Y is understood. For w G Y + let ^/w the unique word « e Q such that W = un for some n G IN. Let Y be a finite alphabet, \Y\ > 2, and let n G IN. A language L over Y is said to be an n-code if L C Y + , L is nonempty, and every subset of L with
290
at most n elements is a code. Although the characterization of n-codes is an open problem for n > 3, 2-codes may be easily characterized. It is well known that a pair x, y £ Y+ forms a code if and only if xy ^ yx or, equivalently, if \fx ^ y/y (see, e.g., [8]). It is easy to see that there is a 1-1 correspondence between 2-codes over Y and mappings / : Q —>• IN (see, e.g., [8]). For a 2-code L over X let / j , : Q —> IN be given by u£L
& fL{y/u)
+ 0 A y/UfL{VU)
= u.
Conversely, if / is a mapping of Q into IN, then define Lf = {p^\peQAf(p)^Q}.
(2)
Clearly, fif = / and LjL — L for every / : Q —y IN and every L 6 C2(Y). This representation of (^(-X') implies the following corollary. Corollary 1.1 (Ito et al. [8]) For \Y\ > 2 one has \C2{Y)\ = Hi; thus \C2(Y)\ is not recursively enumerable. In particular, there are 2-codes which are not even type-0 languages. The 1-1 correspondence described above enables us to produce 2-codes by generating elements of Q. (See equality (2).) E.g., in order to construct 2-codes it is enough to give a subset Q\ of Q and to form powers of elements of Q\. It is conjectured in [5] that the language Ln = Q fl (ab*)n is context-free for all n £ IN + . The conjecture is verified in [15] for the case when for the prime factors pi,... ,Pk of n the following relation holds l/pi + . . . + l / p f c < 4 / 5 .
(3)
The method used in [15] for the proof of this statement is constructive in the sense that it enables us to give a grammar generating the elements of Ln. Unfortunately, the elements of Ln are not suitable for the construction of codes because of their asymmetry with respect to a and 6; i.e., the elements of Ln are of the form u = abei • • -ab6"-1. The language Kn — Q C\ (a+b+)n is symmetric in a and b, therefore the words in Kn are useful for constructing codes. In this paper we will show that the method used in [15] may be adopted for the proof of context-freness of Kn and for construction of codes. 2
Basic Notions and Preliminary Results
A grammar is an ordered quadruple G — (N, Y, S, P) where N and Y are disjoint alphabets, S £ N is the so-called start symbol, and P is a finite set of ordered pairs (u,v) such that v is a word over the alphabet N UY and u is a word over N U Y containing at least one letter of N. Elements (u, v) of P are called
291
productions and are written u-t v. If u -»• v G P implies u G N, then G is called context-free. A word u; over N UY derives directly a word w', in symbols, u; => w', if and only if there are words w\, u, w2, v such that IU = wiuw2, w' = W1UW2 and u —> v belongs to P. w derives w', or in symbols, w =>• w' if and only if there is a finite sequence of words w0,...,Wk (k > 0) over N UY with w0 = w,Wk = w' and ifj ^> if,+i for 0 < i < k — 1. The language generated by G is defined by L{G) = {w£Y*
I
S^w}.
A language L generated by a context-free grammar is called context-free. Let n G {1, 2,...} and consider an arbitrary subset W of (a+6+) n . Elements of W are of the form w = ae°bei • • • ae2n-2b62n-1, where e,- > 1 (i = 0 , . . . , 2 n - l ) . Denote by e(ti>) the vector (e 0 ,. . ., e 2 n _i) corresponding to w and put E(W) = {e(w) I w G V^}. The index set 2n = {0,...,(2n — 1)} will be considered as a "cyclically ordered" set, i.e., the "open intervals" (i, j) of 2n are given by (i, j) = {k \ i < k < j} if i < j and by (i, j) = {k \ k < jork > i] if i > j . The "closed" and "semi-closed" intervals are defined as usual: [i,j) — {i}U(i, j), (i,j] — (i, j ) U { j } and [i,_;] = {i} U (i,.?) U {j}. The addition in 2n is the addition with respect to the modulus In. We say that the pairs of indices {i,j} and {&,/} are crossing if k G (i,i) and / G {j,i) or if / G {hi) and k G (j, *')• ^he subsets R and T of 2n are said to be non-crossing sets, if there exist two elements i and j of 2ri such that R C [i, j) and T C [j, i) holds. For the expression "non-crossing" and "pair-wise non-crossing" the abbreviations n.c. and p.n.c. will be used, respectively. In general, a language L C Y*, is a bounded language if and only if there exists non-empty words WQ, ..., ui m _i such that L C wj$ . . . t^m-i- The words wo, • • •, wm-i are said to be the corresponding words of language L. Obviously, Kn is a bounded language. One interesting subclass of the bounded languages is the class of bounded context-free languages, because of their simple structure. It's quite clear that not every bounded language is context-free. A necessary and sufficiant condition for a bounded language to be context-free was given by Ginsburg: Theorem 2.1 (Ginsburg [6]) Let L be a bounded language over the alphabet S. Language L is context-free iff set E(L) = { ( e 0 ) . . . , e m _ i ) G IN™ | we0° ... w ^
where words WQ, ..., wm-\ stratified linear sets.
1
G L },
are the corresponding words of L, is a finite union of
292 The meaning of the notion of a stratified linear set is given as follows: Definition 2.1 A set F C INm where IN = {0,1,...} and m > 1 is called a stratified linear set iff either F = 0 or there exist r > 1 and v0,. .., vr £ INm such that (1). F = {v0 + Y?i=1 km
\ki>0}
and for the vector set P = { v,- | 1 < i < r } f,2j. every » £ P /aas ai mosi
£«JO
nonzero components, and
(3). there exist no natural numbers i, j , k, I, with Qo, • • •, fflm-i) from P such that UiWjUkwi
^ 0.
The vector VQ and the vector set P appearing in (1) are often called as preperiod and the set of periods of F, respectively. A set F is called linear either F = 0 or there exist vectors vo,... ,vr such that (1) holds. The set E is semilinear if it is a finite union of linear sets. We refer to these linear sets as the components of E. The set E is called stratified semilinear iff all its components are stratified linear sets. In the followings we make use of graph theoretical representation of stratified linear sets. We define a hypergraph H = H(P) corresponding to the set P of periods, in order to get a graphical description of (2)—(3). The hypergraph H is defined as follows: (a). The point-set of the graph consists of the vertices of a convex polygon numbered according to their cyclical order. (b). The edges of H are the supports of the vectors from P, i.e., if v, = (vi o,. .. ,Vi m-i) G P, then the corresponding edge hi of H is given by hi - {j | vitj ^0}. We may assume that the null-vector is not contained in the set P of periods, therefore the empty-set is not an edge of H. In the language of graph-theory property (2) may be formulated by (2'). 1 < \hi\ < 2 f o r i = l , . . . , r . To give the graph-theoretic version of (3) we introduce the notion of crossing edges in the hypergraph H: Two edges / and g of the hypergraph H are crossing,
293 if and only if there exist vertices i,j of f and k,l of g such that either i < k < j < loTk
B = £(£; S)={Z + p\p = J2 PiU2n/qi,Pi G {0,1}}. »=i
For a vector e = (eo,.. .,e 2 „-i) G IN difference is defined by:
2n
and for the box B, the corresponding
Ae(B) = A e (£;5)= J2
(-ir+-+'^+,
In other words, a difference defined for a vector e and box B is a signed sum of such components of e whose indices belong to B, and if the index-pair (i,j) is an "edge" of the box B, then the corresponding members e* and ej of the sum have opposite signs. 3
Preliminary Results
For a 7r-scale S and e G IN2", consider the subset Q e (5) of 2n defined by the rule £le(S) — {£ G 2n|A e (£;S) ^ 0). In the following a basic role will play the investigation of the question whether or not f2e(5) is the empty set. The following lemma says that the answer to this question is independent of the choice of scale S. Lemma 3.1 For n-scales S and S', ile(S) ^ 0 if and only ifQe(S') ^ 0.
294
Proof. Let S = {ti/qu . . . ,tr/qr} and S" = {t[/qlt there exists s,- such that s,i; = £,- (mod ,). Hence ^•e{^,\ti/q\,...,tr/qr) $1 — 1
Z
For any i,
=
5r—1
Ae
'''Z
j,=0
. . ., t'r/qr).
^ + Ji 2 n /?i + • • • + JrZn/qr-A/qi,. .
-XM-
jr=0
Thus fie(5') = 0 implies fie(5) = 0.
D
We will say that fie(7r) / 0 if tte(S) ^ 0 for some (and thus any) ?r-scale S. In the following lemma we give a necessary and sufficiant condition for words v G {a+b+)n to be primitive, i.e., for v G /sT„. Lemma 3.2 Let e = ( e 0 , . . . , e 2 „_i) G IN^.". Then ae°bei • • •a^-^b"2"-' e Q if and only ifQ,e{pi) ^ 0 /jo/rfs /or i = 1 , . . . , k Proof. For any i = 1 , . . . , k word a e °6 ei • • • a e 2 " - 2 6 e 2 n - 1 is not a p;-power if n there is a number j G 2n such that ej 7^ e.j\2nhiThe following lemma shows that the vector set E(Kn) Lemma 3.3 Let Kn = (a+b+)n. Then E(Kn)
is semilinear.
= U?1,...i5;[g2n{(eo,. . .,e 2 „-i) | e
£i 7^ e ? i + 2 n / p i . - ' - > e a 7^ e a + 2 n / p J -
(4)
Proof. Notice that u G A'n if and only if there is no i G {1, •.., k) such that u is a pi-power. Apply the statement of the previous lemma for i = 1 , . . . , k. • Unfortunately, as the following example shows, the components of the decomposition (4) are not necessarily stratified semilinear sets. Example 3.1 Let n — 6 = 3 • 2; then the component {(e 0 , . . . , e n ) | e0 ^ e 4 ,ei ^ e 7 } of E(KQ) appearing in (4) is not semilinear. (For the proof of this statement see the methods of [12].) On the other hand, the following lemma guarantees that sets E(B) = {e \ Ae(B) ? 0} are stratified semilinear. Lemma 3.4 (Flip-Flop lemma) For i — 0,.., m - 1 let the Si be "signs," i.e., let Si G { — 1,0,1}, and consider the set £ = { ( e 0 , . . . , e m _ i ) G N m | S0e0 + • • • + 6m-j.em-i Then E is a stratified semilinear set.
^ 0}.
295 For the proof of Lemma 3.4. see [9]. Corollary 3.1 Let BU...,B v pairwise non-crossing boxes. Then the vector set E{B1 ,...,Bv)
= {ee INf | A e (Bi) + 0 , . . . , Ae{Bv)
± 0}.
is stratified semilinear. For a nonempty subset 7r = {q\,..., qr} of { p i , . . . ,pk] and e £ IN + n , the 7r-box B(£; 1/qi,. • •, l/qr) is simply denoted by 5(£; 7r). (In the sequel we will use only such type of boxes.) For a partition {ni,.. .nv} of {pi,.. .,pk} let £(7Ti, . . . , 7T„) = U { £ ( 5 ( 6 , TTi), . . . , B{ZV,1TV))
I
S^^TTX),.
..,5^,^)
are p.n.c.}
(5)
(Remember that p.n.c. is the abbreviation of "pairwise non-crossing".) Using the methods developed in [15] one can show that if for the prime factors of n we have 1/pi + . . . + 1/pfc < 4/5,
(6)
then E{Kn) = U{E(m,...,irv)
| {7n,...,7r4en},
(7)
where II is the set of all partitions of the set{pi,.. -,Pk}Corollary 3.2 If 1/pi + . . . + \jpk < 4/5, then Kn is context-free. 4
The C o n s t r u c t i o n of G r a m m a r s G e n e r a t i n g Kn
In this section we will show, how to apply the results of the previous sections to the construction of grammars generating Kn. We will use the generalized form of the Flip-Flop lemma, the so-called Flip-Flop Theorem. In order to formalize the theorem we need a definition. Definition 4.1 The set E(Q, 5,e,R)=
f]{
( e 0 , . . . , e m _ x ) 6 INm | e(I) £
SieiR(I)0}
(8)
is a DLI-sei where (1) 0 is a non-empty system of index-sets, (i.e., of subsets ofm). Q is considered as a multi-set, i.e., elements of 0 may have multiplicity greater than one. (2) 8 = (So,..., <5m_i) is a fixed vector of signs, i.e., for i = 0 , . . .m — 1 Si 6
{-1,0,1}.
296 (3) e is a function
from 0 into the set { —1,1}.
(4) R(I) denotes either "> "-t or "> ". (More precisely, to the set {<,<}•)
If for every / G 0
R(I) = < , then we write E{0,S,e)
R is a function
0
instead of E{Q,S, e, R).
D e f i n i t i o n 4.2 The bounded language L is a DLl-language E(L)
from
if the set
= { ( e 0 ) . . . , e m _ ! ) G !N m | we0°, • • •, < T : ' G L}
of corresponding exponent-vectors corresponding words.)
is a DLl-set.
(Here wo, • •., and w m _ i are the
DLI-languages are often used as examples or counterexamples for contextfree languages. In such cases we have to decide whether or not a given D L I language is context-free. The following "Flip-Flop-Theorem" gives a necessary and sufficient condition for a DLI-set to be stratified semilinear, (Kaszonyi [10]). T h e o r e m 4 . 1 ( F l i p - F l o p T h e o r e m ) Let the set E be a T>LI-set with respect to the sign-vector 6 = (6Q, ..., <J m _i), index-set-system 0 , and function e: E = E(e,S,e)=
Q { ( e o , . . . , e m _ 1 ) G l N m | e(/) £ > e < > 0}. iee iei
(9)
E is stratified semilinear
if and only if for every e G E there exists a hypergraph
H, having the following
properties:
(i) The vertices of H are the vertices of a convex m-polygon, indexed by the elements of a cyclically ordered set m according to their cyclical order. (ii) The edges of H are one- or two-element (in)
subsets of the vertex-set
V ( i 7 ) of H.
If{i,j} is a two-element edge of H, then the signs ordered to the endpoints i and j are opposite, i.e., Sj = — Sj ^ 0.
(iv) The edge f is forbidden if there exists an index-set I G 0 such that f C\ I = {i} and e(I) = —J,-. Hypergraph H doesn't contain forbidden edges. (v) The edges of H are (vi)
non-crossing.
The degreee of each vertex i is e,-.
Note t h a t the proof of Theorem 4.1 given in [10] is constructive in the sense t h a t if we know the hypergraph H ordered to the vector e in Theorem 4.1, then we can construct the stratified linear component E' containing e as follows:
297 - First we construct the hypergraph H' which has the same points and edges as that of H but every edge with multiplicity one. - Using H' we define the set P' of periods of the stratified linear set containing the vector e as follows: P' = {v(h) | h e E(iJ'), v(h) = (v0,..., «„,_!), Vi = 1, if i G h, Vi = 0 if i £ h),
(10)
where E(-ff') denotes the edge set of H'. Then E' = { ^ k{v)v | k{v) > 0 } . veP'
(11)
The hypergraph H' posesses the properties (i) — (v) and additionally the following one: (vi)' H' doesn't contain multiple edges. Conversely, if the hypergraph H' has the properties (i) — (v) and (vi)', then the corresponding vector set P' = P'(H') is a period set of a component of E. It is also clear from the proof of the theorem that H' may be chosen of a special form, namely, such that the graph components of H' are tree-graphs. In sequel we will sketch the construction of grammars generating Kn. Let us consider the decomposition (7) of E(Kn). To every stratified semilinear component we construct a corresponding grammar. The hypergraph G is called stratified with respect to the index set 0 and sign vector 8 if G satisfies the conditions (i) — (v) of the Flip-Flop Theorem. In the sequel we define a graph operation preserving stratifiedness. Definition 4.3 Let G be a stratified hypergraph and i a point ofG. Denote by Ej and by E? the set of one- and of two-set edges incident to the point i respectively, put r\ = \E}\ and rf — |E?|. For m1 and m2 (0 < m 1 < rj, 0 < m 2 < r 2 ), we define a hypergraph K(G) = /c(G,i,m 1 ,m 2 ) corresponding to G as follows (See Figure 1.) - Let us cut the point i into two pieces, i.e., delete point i from G and replace it with the new points i\ and 12. Let the cyclic ordering of the new points be .. .i - l,h,i2,i+l • • •• - Consider the edge set E 2 = {hi,..., hri}. Assume that the elements of set E 2 are numbered according to the cyclical ordering in m, i.e., if hj = {i,s}, /ifc = {i,t} and j < k, then s < t. (Here the sign "<" denotes cyclical ordering, i.e., j < j + k for k = 1,.. .,m — 1. Note that H' may have multiple edges hence s = t is possible.)
298 Let us split the edgeset E?: join the point 12 (resp. i\) with the points of edges distinct from i in {hi,..., hmi} (resp. in {hm2+i,..., hr?}). Split also the edgeset E*: add m1 copies of one-point edge {42} and rj — m1 copies of {ii} to K(G). Let 8K(i\) = SK(ii) = 8(i) and SK(j) = S(j), if j ^ i. The set system QK is got from 0 by substituting i by two elements i\ and i? in every set in which i appears. It is easy to see that K(G) is a stratified hypergraph with respect to 5K and QK. Finally, renumber the points of K(G) corresponding to the ordering 0 , . . . , i — 1, i\, «2,2 + 1,.. •, m— 1 (i.e., let the point set of K(G) be the set { 0 , . . . , m}). In what follows, the operation G —>• K(G) will be denoted by K as well.
•
>
K{G)
Figure 1 l
The reverse operation n~ of K may be considered as a hypergraph homomorphism, contracting two neighbouring points i\ and 12 of K(G) having identical 8 signs to the point i and leaving all other points unchanged. The stratified hypergraph G is called elementary if the degree of its points does not exceed one. (The hypergraphs appearing in the following will have the degree exactly one.) It is easy to see that every stratified hypergraph may cut into an elementary hypergraph, i.e., to every stratified hypergraph G there is a sequence K\,. . .,KP of cuts such that applying them consecutively to G we get an elementary hypergraph. Let n = KP O • • • o m, where o denotes the composition of operations. The operation /C _ 1 = K J " 1 O - - - O K ~ 1 may be considered as a graph homomorphism. Let
E = {v + Y^ kee I ke > 0} be a stratified linear component of E(K„) appearing in (7) having period set P and preperiod v. Denote by H' the stratified hypergraph corresponding to P
299 and by HK = K(H') an elementry stratified hypergraph which we get from H' by a sequence of cuts. Using hypergraphs HK and H' and preperiod v = (VQ, ..., vm-i) let us define the g r a m m a r G = [N, Y, S, P) as follows: - Let m denote the number of points of the hypergraph HK, let E = E l U E 2 be the point set of HK, where E 1 and E 2 are the sets of one-point and the two-point edges of HK respectively. - L e t AT = {S}\J{Uj \j €m}U{Zij | 0 < i < j < m-l}\J{Vh \h£E(HK)} the set of nonterminals. - Y = {a, 6} the set of terminals. - T h e algorithmical description of production set P is the following: (a) At first we substitute Za:Tn-i
into 5 : S —> .Zo,m-i-
(b) Every point of HK is of degree one, hence there is an edge h G E(i7 K ) incident to the point 0. If h - {0} G E 1 , then substitute t^"1 V{ 0 }Zi,m-i into Z0iTn-i, and i f / i - { 0 , j } £ E 2 , then u v o" {o,j}Uj3Zj+i,m-i ( I f 3 = m > ^ e n let Zj+\,m-\ = A.): Zo,m-i -»• £ C V { o } ^ i , m - i , i£h = {0} £ E 1 . Z0tm-i ->• Uv0aV{atj}UyZj+ltm-l} if/» = { 0 , i } G E 2 and j < m - 1.
^ o , m - i -»• C C ^ C J } ^ , if ft = {0, j } G E 2 and j =
m-l.
(c) We can operate similarly in the general case of Zij. Let h be the edge of HK incident to the point i. If h — {i} £ E 1 , then substitute Ui'V^jZi+ij into Zij, and if h = {i, k] £ E 2 , then Ui'V{i,k}Ukk %k+i,j- T h e latter substitution is understood such t h a t if j — k, then Zk+ij
— A:
z
EI ij ->• ^ r % ^ + i , j . i f h={»}e . if ^ , j ~> ^ • ^ . f c l ^ r ^ + i . i . /» = {0>il G E 2 . a n d k < 3, Zij "» ^ ' % f c } ^ r . if /» = {0>i} G E 2 , and k = j .
(d) T h e role of the nonterminal Vh is t h a t we can give "iteration sequences" corresponding to graph edges h: If h = {i}, then consider V{i} - » UiV{i], and if h = {i,j}, then V{ij] -> UiV^jjUj. (e) T h e iteration process of [/,• may be closed in the following manner: V{i} -> A, F { i J } -> ^ + i , i - i , if (i,j) ± 0 (i.e., if i > t + 1), V{iij} -*• A, if ( i , j ) = 0 (i.e., if j = i + l ) .
(f) Finally we give the terminal form of the words, by substituting terminals into [/,-: Ui —¥ a, if K _1 (i) is an odd number, Ut —>• 6, if K -1 (i) is even. (Remember that the mapping K~X as a graph homomorphism maps the points of HK, into the set 2n.) Notes. The question of context-freeness of Kn remains open for n the prime factors of which do not satisfy inequality 3. Further results are expected from the usage of methods developped in papers [15] and [16]. Acknowledgement. This research was supported by the Hungarian-German scientific-technological research project No D 39/2000 in the scope of the treaty contracted by the Hungarian Ministry of Education and his German contractual partner BMBF. References 1. J. Berstel, L. Boasson, The set of Lyndon words is not context-free, EATCS Bulletin, Problems Column, 1996. 2. P.H. Day, H.J. Shyr, Languages defined by some partial orders, Soochow J. Math., 9 (1983), 53-62. 3. P. Domosi, S. Horvath, M. Ito, Formal languages and primitive words, Publ. Math. Debrecen, 42 (1993), 315-321. 4. P. Domosi, S. Horvath, M. Ito, L. Kaszonyi, M. Katsura, Some combinatorial properties of words and the Chomsky-hierarchy, Second International Colloquium on Words, Languages and Combinatorics, Kyoto, August 2528, 1992 (M. Ito, H. Jiirgensen, eds.), World Scientific, Singapore, 1994, 105-123. 5. P. Domosi, S. Horvath, M. Ito, L. Kaszonyi, M. Katsura, Formal languages consisting of primitive words, Fundamentals of Computer Science, Szeged, 1993, Lecture Notes in Computer Science, Springer-Verlag, 710 (1993), 194— 203. 6. S. Ginsburg, The Mathematical Theory of Context-Free Languages, McGraw-Hill Book Comp., New York, 1966. 7. M. Ito, M. Katsura, Context-free languages consisting of non-primitive words, Intern. J. Computer Math., 40 (1991), 157-167. 8. M. Ito, H. Jiirgensen, H.J. Shyr, G. Thierrin, Languages whose n-element subsets are codes, Theor. Computer Sci., 96 (1992), 325-344.
301
9. L. Kaszonyi, On a class of stratified linear sets, First joint conference on modern applied mathematics, Ilieni/Illye, Romania, 1995, PU.M.A., 6, 2 (1995), 203-210. 10. L. Kaszonyi, On bounded context-free languages, Proceedings of the First Symposium on Algebra, Languages and Computation (T. Imaoka, C. Nehaniv, eds.), University of Aizu, Japan, 1997. 11. L. Kaszonyi, Hypergraps and stratified semilinear DLI-sets, Extended abstract for the Japanese-Hungarian Symposium on Discrete Mathematics and its Applications, Kyoto, 1999. 12. L. Kaszonyi, A pumping lemma for DLI-languages, Discrete Applied Mathematics, to appear. 13. L. Kaszonyi, M. Holzer, On the generalized Flip-Flop Lemma, AFL'97, Salgotarjdn, Hungary, Publ. Math. Debrecen, 1998. 14. L. Kaszonyi, M. Katsura, On the context-freeness of a class of primitive word, Publicationes Math. Debrecen, 1997. 15. L. Kaszonyi, M. Katsura, Some new results on the context-freeness of languages Q 0 (ab*)n, AFL'97, Salgotarjdn, Hungary, Publ. Math. Debrecen, 1998. 16. L. Kaszonyi, M. Katsura, On an algorithm concerning the languages Q O (ab*)n, PU.M.A (Pure and Applied Mathematics), 1999. 17. A. Mateescu, Gh. Paun, G. Rosenberg, A. Salomaa, Parikh prime words and GO-like territories, Journal of Universal Computer Science, 1, 12 (1995), 790-810. 18. Gh. Paun, G. Thierrin, Morphisms and primitivity, Bulletin of the EATCS, 61 (1997), 85-88. 19. H. Petersen, The ambiguity of primitive words, Proc. STACS'94, SpringerVerlag, Berlin, 1994. 20. A. Salomaa, From Parikh vectors to GO territories, EATCS Bulletin, Formal Language Column, 1995.
This page is intentionally left blank
303 G E N E R A T I O N A N D P A R S I N G OF M O R P H I S M L A N G U A G E S B Y UNIQUELY PARALLEL PARSABLE G R A M M A R S
JIA LEE Communication Research Laboratory, Kobe, 651-2492, Japan E-mail: l i j i a @ c r l . g o . j p
KARC
KENICHI MORITA Hiroshima University, Faculty of Engineering Higashi-Hiroshima, 739-8527, Japan E-mail: morita@iec . h i r o s h i m a - u . a c . j p A uniquely parsable grammar (UPG) introduced by Morita et a\. (1997) is a kind of generative grammar, where parsing can be performed without backtracking. In this paper, we investigate a uniquely parallel parsable grammar (UPPG). We give a simple sufficient condition on morphism languages, and show that every such morphism language can be parsed efficiently in parallel by a UPPG. We show that the Fibonacci and Thue-Morse languages, which are instances of such languages, can be parsed in logarithmic time in parallel by UPPGs.
1
Introduction
A uniquely parsable grammar (UPG) [4] is a special kind of generative grammar where parsing can be performed without backtracking. By extending a UPG, a uniquely parallel parsable unification grammar (UPPUG) [3] has been proposed. It is a unification grammar (UG) version of a UPG in which parallel parsing is also possible. A uniquely parallel parsable grammar (UPPG) is a simplified version of a UPPUG such that every function symbol is of arity 0. Rewriting rules of a UPPG satisfy the following condition: If a suffix of the righthand side of a rule matches with a prefix of that of some other rule, then each of these portions is contained in the context portion of each rule. By this, any language generated by a UPPG can be parsed without backtracking by a sequential, parallel, or even mixed reduction process. In this paper, we investigate a problem of generating/parsing of languages defined by morphisms. If
304
parallel reduction in UPPG. 2
Preliminaries
In this section we give definitions and known results on uniquely parsable grammars and uniquely parallel parsable grammars that are needed in the following sections. See [3,4] for the detail. See also [2,5] for the basic notions of formal languages. 2.1
A Uniquely Parsable Grammar
Definition 2.1 A uniquely parsable grammar (UPG) is defined by G=(N,T,P,S,$), where N and T are nonempty finite sets of nonterminal and terminal symbols (N n T = %), S is a start symbol (S £ N), and % is an end-marker ('$ ^ N U T). P is a set of rewriting rules of the following form: a -)• /?,
$Q
- • $/?, a$ -» /?$, $a$ -> $/?$ or %A% -> $$,
where a, 0 £ (N UT) , A € iV, and a contains at least one nonterminal symbol. Furthermore, P satisfies the following condition. The UPG-condition: 1. The right-hand side of each rule in P is neither S, $S, S$, nor $S$. 2. For any two rules R\ = ax —» /?i, and R2 = 02 —> /?2 *'" -P ^ 1 and ^2 waj/ 6e the same), the following statements hold. (a) If ft = /V<J and/? 2 = <%' for some SJi,^' G (N U T U {$})+, iften ax = ai'S and a? = Sa^ for some a\ , a^ 6 (N U T U {$}) . (6; 7//?i=7/?27' /or some 7 , V € ( i V U r u {$})*, thenR1 = R2. Definition 2.2 Lei G = [N,T,P,S,%) be a UPG, and n be a string in (iVUTU {$}) + - A rule a -¥ /? in P is said to be applicable to r\ if n — -jaS for some 7,i5e (iVUTU {$})*• Applying a -> /? to n we obtain £ = j(3S, and say £ is directly derived from 77 in G. This is written as n => £. Lei => denote the reflexive and transitive closure of=>. An n-step derivation is denoted by r] =>• £. The language L(G) generated by G is defined by L(G) = { w G T* | $5$ =>• $w$ }. Definition 2.3 Lei G = (N, T, P, S, $) be a UPG, and n E a string. A rule a ->• /? is said io 6e reversely applicable to if rj — j(3S for some 7, S e (NllTU {$})*, where \j\ = j /engin 0/ 7J. i4ny sucn pair [a ->• /?, j] zs ca//ed a reversely
(NUT I) {$})+ 6e the position j of rj 1 (I7I denotes ine applicable item Jo
305
rj. We say rj is directly reduced to £ if £ = ~/a6, and write it as r\ <= £
or
77 < = £. Apparently r] <= £ iff £ => n. The relations <= and <= are defined similarly to => and =>. The following theorem states that any given string w £ T* can be parsed without backtracking provided that w £ L(G). Theorem 2.1 [4] Let G = {N,T,P,S,$) be a UPG, and n be a string in + (JVUTU{$}) . If r) £ $5$, then for any string £ £ (JVUTU{$}) + such that n <£= £, the relation n <= £ "<j= $5$ ftoMs. #.£
J4 Uniquely Parallel Parsable Grammar
Definition 2.4 Let Y, be a finite alphabet, and let "first" mappings from X* to X defined as follows:
and "last" be the
first(e) = e, first(aP) = a, last(e) = e, last(/3a) = a, where a £ X, /? £ £*, and e is an empty string. A rewriting rule with a context index is a construct R=[a^p,(l,r)} which satisfies the following conditions: There exist some a',j3',^/,S £ X* such that a =
nor$S%.
306
2. For any two rules with context indices Ri = [ai —> /?i, (/i,ri)] and R2 = [a2 —>• /?2, (h, r2)] (R\ and R2 may be the same), the following statements hold. (a) If Pr = p[S and /32 = S/3'2 for some ft, ft, 6 <E (7VU T U {$})+, then ri > \S\ andl2 > \S\. (b)Ifp1 - t M for some-,,-/' £ (NUTU {$})*, then Rx = R2. Let G = (N, T, P, S, $) be a UPPG, and let G' be a grammar obtained from G by simply removing context indices from the rules in P. Then, we can see that G' is a UPG from the definitions of them. Hence, in this sense, the class of UPPGs is a subclass of UPGs. Thus, parsing can be performed without backtracking in a sequential manner in the same steps as in the derivation process. The following two lemmas are needed in the definition of parallel reduction in a UPPG. The proofs are similar to the case of UPPUG- [3]. Lemma 2.1 [3] Let G = (N, T, P, S, S) be a UPPG, and^e{NUTU {$})+ be a string. Let h = [[«i -> j3\,{l\,ri)],ji] and I2 = [[a2 -> /?2, (k, n)], j2] be two distinct items, each of which is reversely applicable to £. Then j \ ^ j 2 . Lemma 2.2 [3] Let G = (N, T, P, S, $) be a UPPG, and £ £ (7VU T U {$})+ be a string. Let U = [[a, —> /3j, (/», »",•)], ji] (i = 1,2,3^ be three distinct items, each of which is reversely applicable to £. If ji < j 2 < jz, then j'3 — ji > \fti\. Definition 2.6 Let G = (N,T, P,S,$) be a UPPG, and £ 6 (iVUTU{$})+ be a string. Let {Ii, I2, • • •, Ik} be a set of items, where each /,- = [[a,- —> /?;, (/,-, n)],i$] fi = 1, • • •, k) is reversely applicable to £. By Lemma 2.1 ji 7^ i,' holds if i ^ i'. Hence we can assume, without loss of generality, ji < ji+i (i = 1, • • •, k — I). Moreover, by Lemma 2.2, ji+2 — ji > |A'| holds for any i 6 {1, • • •, Ar —2}, i.e. z/ ji+j' — ii < I A'I then V = 1. T/i«s, /rom £/ie definition of a UPPG, we can write £ and L as
z = CoP[ a P 2 c 2 ••• a - i 4 a /or some aJ,/?-,7;,^,Co,Ci G ( i V U T U {$})* (i = l,---,k) which satisfy the following conditions for each 1i £ {1, • • • ,j — 1}: (1) 7 l = Sk = s, and |Co| = h - 1^ 7/ji+i - ii > I A'I, ^ e n 5i = 7 i + 1 = e. (3) Ifji+i -ji < \Pi\, then Si - ji+i = £• and \Q\ < min{ri,li+1}. (4) Ifji+1-ji > |A|, then \(0(3[ • • • A'CI = Ji+i - 1^ 7/ii+i - ji < \Pi\, then \(0p[ • • • # | = i ; + 1 - 1. Letr]<E{NUTU
{$})+ 6e as follows: V = Co a'i Ci « 2 C2 ' • •
CA-I
a
/c C/e-
307
Then, we say rj is obtained from £ by a direct parallel reduction with respect to the item set {Ji, • • •, Ik}- It is written as
As defined above, we can apply any number of reversely applicable items in parallel to a given string without interfering each other. D e f i n i t i o n 2.7 Let G = (N,T,P,S,%) be a UPPG, string. Let {I\, I2, • • •, Ik} be the set of all reversely U = [[<*i -> A , C»i n ) ] , Ji] (i — 1) • • ' , k). Then, the respect to the item set {Ii, • • • ,1k] is called a direct and is written as £ The reflexive and transitive
{h,-,lk} 4= G
n
(or
and £ € ( N U T U { $ } ) + be a applicable items to £, where direct parallel reduction with m a x i m u m parallel reduction,
i-^ri). G
closure of a direct maximum
parallel reduction
*
an m-step
maximum
parallel reduction
and
m
as 4^ and •$&, respectively. G G T h e next theorem states t h a t in a U P P G , parsing can be performed without backtracking in sequential, parallel or even mixed manners. T h e o r e m 2.2 [3] Let G = (N,T,P,S, be a string. If
are written
$) be a UPPG, and£,e(N\JTU
{$}) +
£ £ $5$, G then for any set {/1, • • • , / * } of reversely f] € (N \JTU
{$})+ such that £
1 fe
applicable
^ ^
e
f0U0Wing
items
to £, and a string
relation holds
(hence
G k < m) t
£
{11..•••,Ik}
4 = G
m - k
77 <= G
n, ,-rn,
bo*.
From Theorem 2.2, we can easily obtain the next corollary. C o r o l l a r y 2.1 [3] Let G = (TV,T, P, 5, $) 6e a UPPG, and £ e (TV U T U {$})+) 6e a string. 3
If £ 4= $5$,
inen £
Parsing Morphism Languages by U P P G s
D e f i n i t i o n 3.1 Let V and W be finite alphabets. A morphism ip '• V* —> W* is a mapping that satisfies the following condition: If u = a\a2 • • • an (a,- £ V, 1 < z < n ) , i/jen V"(u) = , /'( a i)V'( a 2) • • • V'( a n) (V»o£e i/eai V(e) = e, where e is the
308
empty string). language
Let
We call the
L4>(c) = {<j>k{c) | Ar = 0,1,- - • > a morphism language defined by <j> and c, where
ttf-Hc)) (*>o).
Theorem 3.1 Let V = {ai, • • •, an}, and <j> : V* —> V* be a morphism satisfying the following condition, where Z = {
G = (MU{S,X,Y}, where S,X,Y
V, P, S, $)
^ M L)V. P is constructed as follows:
(1) Include the following rule in P. [$5$ -» $/j(a)$,
(1,1)]
(2) For each k £ {0,1, • • -,n}, if
->• $p(
(3) For each a,- £ V, include the following rules in P. [ p(ai)
-+ Yp(<j>(ai))X,
(0,0)]
[$p{ai)
-»• $n(<j>(ai))X, (1,0)]
[p(ai)$
-»• y / ^ ( a i ) ) $ ,
(0,1)]
309 (4) For each ai,a,j,aitar £ V, if a/ = last(<j>(ai)) and ar = first(<j>(a,j)), then include the following rule in P. [(i(ai)XYfi(ar)
-> fi(ai)fi(ar),
(1,1)]
(5) For each a,- £ 1/ include the following rule in P. [n{ai)
->• a;,
(0,0) ]
We can see that G is a UPPG. Due to the condition 2(i), no righthand side of a rule in (4) can be a substring of the righthand side of some other rule in P. Furthermore, by the condition 2(ii), no righthand side of a rule in (l)-(3) can match that of some other rule. In such a way we can easily verify that P satisfies the UPPG-condition. Now, we note that $[i(w)$ => $w$ holds for all w £ V+, because G has the rules in (5). Hence, by the unique parsability of G, $5$^>$w$
iff
$S$^$(i{w)$
+
holds for all w £ V . Therefore, in order to prove L(G) = L${a), it suffices to show that $S$=*$7$
iff 7 = /i(^*(a)) for some k <E {0,1,- • •}
(a)
holds for all 7 £ M+. (I) The "if part of (a): It is proved by induction on k. (i) The case k = 0: Obviously $5$ => $/i(0°(a))$ holds by the rule (1) of G. (ii) The case k > 0: Assume $5$ ^ $/i(^- 1 (a))$. If 4>k-l{a) £ V, then [ $5$ -> $/j(<^(a))$, (1, 1)] £ P (by (2)). Hence $5$ 4> %fi((pk{a))$ holds. Otherwise, to each fi(ai) in $(*(
iff $7$^= 858 for some m £ {1,2,---}.
310 Hence, it suffices to show that m
If $7$
(b)
holds for all 7 £ M+. It is proved by an induction on m. (i) T h e case m = 1: T h e statement (b) holds from the fact t h a t only the following m a x i m u m parallel reduction processes are possible for m = 1: $/u(a)$-^$5$ and $/j,(<j>k(a))$-^$S$ for k = 1,2, ••• such t h a t (pk~1(a) £ V. (ii) The case m > 1: Consider the m— 1
m a x i m u m parallel reduction $7$ = $7'$ 4= $5$ (7' is uniquely determined from 7). Since 7 £ M + and m > 1, only the rules in (4) can be used to reduce 7. Hence, $7'$ should be §i$
= $rhXYrl2XY
•••XYr]l$
for some iji, 772, • • •, r\i £ M+ (I > 1) such t h a t 7 = 771772 • • •??/. Note t h a t none of the rules in (4) can be reversely applied to each rji any more, since $7$ 4s $7'$ is a direct m a x i m u m parallel reduction. In order to further reduce $7'$ to $5$, the symbols Xs and Ys should be deleted by reversely applying the rules in (3) to each m with delimiters Y (or $) and X (or $). Now, if n~l{rn) ^ Z = {(/i -1 (7")). From the induction hypothesis, 7 " = /i((j>k(a)) for some k. Therefore, 7 = /j,(cj)k+1(a)), and (b) holds. By (I) and (II), L(G) = L^,{a) is concluded. Let &o be the m a x i m u m integer such t h a t 4>k°(a) £ V. As seen from the 2
above argument, $/i(^ f c + 1 (a))$4 £ $/j(0 f c (a))$ holds for each k > ko > 0. We can also see t h a t
$ ^ f c ( a ) $ i $fi{
$ / j ( ^ ° ( a ) ) $ i $ 5 $ . Hence, if k > 0,
$> (a)$4=$5'$ holds for some m such t h a t m > 0. Therefore, we can conclude t h a t each w =
and <j>Fib{b) = a-
311
The morphism language L<j>Fib(a) defined by
{a,b}, PFib) S, $),
where PF,^ is as below (\$B —>• %AX, (1,0)] is omitted since it is useless). PFlb
= { [ $5$ -> $A$, (1,1) ], [ $5$ -> %AB$, (1,1) ], [ A -> YABX, (0, 0) ], [ B -> YAX, (0, 0) ], [$A->$ABX, (1,0) ], [ A$ -> YAB$, (0,1) ], [ 5 $ ->• YA$, (0,1) ], [ AXYA -> AA, (1,1) ], [ BXYA -> BA, (1,1) ], [A^a, (0,0)], [B-+b, (0,0)] }.
A maximum parallel reduction process of abaababa is as follows. $abaababa$ ^%ABAABABA%
•••}•
312
A UPPG
GTM
such that
L(GTM)
= L$TM(a)
GTM = ({S,A,B,C,X,Y},
is defined by
{a,b,c},
PTM,
S, $),
where PTM is as follows (useless rules are omitted here): PTM
= { [ $S$ -t $A$, (1,1) ], [ $5$ -> $ABC$, (1,1) ], [ A -> YABCX, (0,0) ], [ B -> YACX, (0,0) ], [ C ^ y S X , (0,0)], [ $A -»• SASCX, (1,0)]
[ 5$ -»• y ^ c s , (o, i) ], [ c$ -> yfl$, (o, i) ], [ 5XY>1 -» 5A, (1,1) ], [ CXYA -+ CM, (1,1) ], [CXYB-+CB, (1,1)], [ y l - > a , (0,0)], [ S - + 6 , (0,0)], [C->c, (0,0)] }. Parsing of the word abcacbabcbac by a maximum parallel reduction in GTM ** as follows. %abcacbabcbac%
BXY AC%
can be parsed in 0(log|w|)
Finally, we note that Theorem 3.1 expresses only a sufficient condition on a morphism language so that it can be parsed efficiently in UPPUG. It is, however, not a necessary one. Consider a morphism v : {a, b} —> {a, b} defined as follows: v(a) = ab, v{b) = ba. The morphism language Lv[a) is as follows: L„(a) = { a, ab, abba, abbabaab, abbabaabbaababba, • • • } . Though the morphism v does not satisfy the condition 2(i) in Theorem 3.1, we can give a UPPG G' such that L(G') — Lv(a) as follows: G'=({S,A,B,X,Y},{a,b},P',S,$),
313
where P' is given below. P' = { [ SSS - • %A%, (1,1) ], [ SSS ^ SABS, (1,1)], [ A -> Yy45X, (0,0)], [ B -+ Y 5 A Y , (0, 0) ], [ SA-> $A5X, (1,0)], [ AS - • YAB%, (0,1) ], [ B$ -» YBAS, (0,1) ], [ AA -+ YABABX, (0, 0) ], [ BB -> YBASAX, (0,0) ], [ A Y Y A - ^ A 4 , (1,1)], [BXYB-+BB, (1,1)], M - ^ a , (0,0)], [ 5 ^ 6 , (0,0)] }. Parsing of the word abbabaabbaababba by a maximum parallel reduction is given below. %abbabaabbaababba%
By a technique similar to that used in the proof of Theorem 3.1, we can prove that L(G') = Lv[a), and each word w = i/k(a) (k > 0) in Lu(a) can be parsed in O(k) = 0(log \w\) steps by a maximum parallel reduction.
4
Concluding Remarks
UPPGs have the useful property that parsing can be performed without backtracking by any mode of reductions, i.e., even by a mixed process of sequential and parallel reductions. In this sense, parsing can be performed very easily. In order to show the efficiency of parallel parsing in UPPG, we gave a simple sufficient condition on some kinds of morphism languages, each of which can be parsed by a UPPG in parallel in linear time with respect to the number of iterative generation steps of the morphism. We also gave specific examples of morphism languages that satisfy the condition. It is left for the future study to characterize the class of languages parsable in parallel in a sublinear number of steps.
314
References 1. G.T. Herman, G. Rozenberg, Developmental Systems and Languages, NorthHolland, Amsterdam, 1975. 2. J. E. Hopcroft, J. D. Ullman, Introduction to Automata Theory, Languages, and Computation, Addison-Wesley, Reading, Massachusetts, 1979. 3. J. Lee, K. Morita, Uniquely parallel parsable unification g r a m m a r s , IEICE Trans, on Information and Systems, E 8 4 - D (2001), 21-27. 4. K. Morita, N. Nishihara, Y. Yamamoto, Z. Zhang, A hierarchy of uniquely parsable g r a m m a r classes and deterministic acceptors, Acta Informatica, 3 4 (1997), 389-410. 5. G. Rozenberg, and A. Salomaa, eds., Handbook of Formal Languages, Vols. 1-3, Springer-Verlag, Berlin, 1997.
315 ON T H E G E N E R A T I V E P O W E R OF I T E R A T E D TRANSDUCTION
VINCENZO MANCA Universita di Pisa Dipartimento di Informatica COTSO Italia, 40 - 56125 Pisa, Italy E-mail: m a n c a v @ d i . u n i p i . i t Iterated (finite state sequential) transducers are generative devices well studied in formal language theory (e.g., in relation to Lindenmayer systems, and DNA computing). It is known that such mechanisms can characterize the family of recursively enumerable languages, and recently it was proven that four states are enough in order to characterize the recursively enumerable languages, three states cover the ETOL languages, while two states can cover the EOL (hence also contextfree) languages. Here we continue the study of such devices, by showing that context-sensitive languages can be generated with only three states. This allows us to obtain another proof of the universality of four states, and some simple corollaries. Some open problems concern with the optimality of our results and with the relationship between the four states universality and the Geffert normal form for recursively enumerable languages.
1
Introduction
Iterated gsm (generalized sequential machine) mappings were investigated for a long time [20,11,1,15,12,2]. More recently, new results were obtained concerning the descriptional complexity of these devices, their computational universality, and their interest in the new computation paradigms inspired by DNA Computing [7,4,14,13,8,9,3]. An iterated (non-deterministic finite state sequential) transducer T is a generative device [9]; it is essentially a gsm g whose input and output alphabets coincide and an initial starting symbol ao is given. T derives the strings g(w) where w = ao, or w is any string already derived by g at the end of a transduction (that finishes not necessarily in a final state). The strings that are derived at the end of a transduction terminating in a final state constitute the strings generated by T. It is known that iterated gsm can characterize the family of recursively enumerable languages; in [8] the question was formulated whether or not the number of states induces an infinite hierarchy of the languages generated by iterated transducers. Somewhat surprisingly, in [9] it is proved, via the Geffert normal form for Chomsky grammars [5], that this hierarchy collapses at a rather low level: iterated transducers with four states characterize the recursively enumerable languages. As related results, it was also proved that three states suffice in order to cover the ETOL languages, while two states suffice in
316 order to obtain all EOL languages. In this paper we are concerned with the number of states t h a t are sufficient to generate all context-sensitive languages: three are sufficient. This result is obtained by means of a simulation of Turing machines with iterated transducers, and this simulation seems to be also interesting in itself. 2
Iterated Finite State Sequential Transducers
We define an iterated finite state sequential language generating device.
transducer
(in short, an I F T ) , as a
An I F T is a construct T = (A', V, so,a0, F, P), where K, V are disjoint alphabets (the set of states and the alphabet of T), SQ £ K (the initial state), OQ £ V (the starting symbol), F C K (the set of final states), and P is a finite set of transduction rules of the form sa -> xw', for s, s' £ Q, a £ V, w £ V* (in state s, the device reads the symbol a, passes to state s', and produces the string w). For s, s' £ K and u, v, w £ V*, a £ V we define usav h uws'v
iff sa —>• IDS' £ P.
This is a cftreci transition step with respect to T. We denote by h* the reflexive and transitive closure of the relation K Then, for w, w' £ V* we define w =>• w' iff SQW h* u / s , for some s £ A'. We say t h a t w derives w'; note t h a t this means that w' is obtained by translating the string w, starting from the initial state of T and ending in any state of T, not necessarily a final one. We denote by = ^ * the reflexive and transitive closure of the relation =>. If in the writing above we have s £ F (we stop in a final state), then we write = > instead of =>•; that is, w = > w' iff sow h* w's, for some s £ F. T h e language generated by T is A(T) = {w £ K* | a 0 = > * u / = 4 to, for some w' £ K*}. Therefore, we iteratively translate the strings obtained by starting from a^, without care about the states we reach at the end of each translation, but at the last step we necessarily stop in a final state. The I F T ' s as defined above are nondeterministic. If for each pair (s, a) £ K x V there is at most one transition sa —> IDS' in P, then we say t h a t T is deterministic. An IFT T is called an iterated n-transducer if T has n states.
317
We denote by IFTn,n > 1, the family of languages of the form L(T), for nondeterministic T with at most n states; when using deterministic IFT's we write DIFTn instead of IFTn. The union of all families IFTn,DIFTn,n > 1, is denoted by I FT, DIFT, respectively. We refer to [9], and [3] for detailed comparisons of these families with the families in the Chomsky hierarchy, REG, CF, CS, RE (of regular, context-free, context-sensitive, recursively enumerable languages, respectively), and with families in the Lindenmayer hierarchy, OL and EOL (of languages generated by interactionless L systems and by extended interactionless L systems, respectively), DQL, DEOL (the families corresponding to OL, EOL generated by deterministic L systems. In [3] some open problems formulated in [9] were solved, especially concerning deterministic iterated transducers. We refer to [16] and [17] for details basic concepts, notation, and the main formal language hierarchies. 3
Iterated Transducers and Turing Machines
In this section we prove the main theorem, essentially based on a simulation of Turing machines, and therefore of linear bounded automata, by means of iterated transducers. Theorem 3.1 CS C IFT3. Proof. Any language L £ CS is recognized by some linear bounded automaton, that is by a Turing machine working in a linear space. This means that L is also generated by some Turing machine in a linear space; in fact, we could generate any string a as input on the tape, then we produce a#a and try to recognize the string a before # ; if it is accepted, then what follows the symbol # is generated as the output, otherwise computation is endless, or a chosen string of L is generated. This means that any string a £ L £ CS can also be generated as an output starting from some input string (5 such that |/?| = k\a\ for some positive natural k (this is essentially the automata theoretic characterization of context-sensitive grammars proven by Kuroda [6]). By using the well-known equivalence between Turing machine with one tape and with k tapes [10], this implies that any string a £ L £ CS can also be generated as an output starting from some input string /? such that |/3| = |a|. Moreover, according to Shannon's theorem [19], any Turing machine M is equivalent to a Turing machine M' with two states: given an input a for M, M' halts on a if M halts on a, and in this case M' produces the same output produced by M; moreover, this simulation does not change the work space of the simulated machine. In conclusion, any string a £ L £ CS is generated by some Turing machine with only two states working in space |a|, that is, no enlargement of the tape is performed during the computation and therefore no external blanks must be deleted when
318
computation stops in order to produce the output of the computation. For proving our statement it is enough to simulate the input-output behavior of such a Turing machine with iterated transducers that use three states (an iterated 3-transducer). Let M be the given Turing machine with symbols A and states {91,92}, 91 being the initial state. In the simulation it is useful to adopt the following representation for the instructions of M. Introduce two new symbols {pi,P2} so that an instantaneous description .. .qjX... says that M is in the state qj (j = 1,2) and M is reading the symbol x, while .. .ypj ... says that M is in the state qj (j = 1,2) and M is reading the symbol y. We call {91,92} right (reading) state symbols and {pi,P2} left (reading) state symbols. According to this representation, instructions have the following format (i,j = 1,2): qiX —> yqj (right move for a right state symbol) qiX —> pjy (left move for a right state symbol) x Pi —t yij (right move for a left state symbol) xpi —)• pjy (left move for a left state symbol). In this format we say that the pair of symbols before the arrow is related, by the relative instruction of M, with the pair after the arrow (by the way, this representation of Turing machine instructions provides the essence of Kuroda normal form for grammars). The initial configuration is represented by a string such as q\x ...; we write / £ M for saying that / is an instruction of M; if no instruction of M starts with g,a; or xpi, we write qix (£ M, or xpi (jL M respectively (they are final configurations). The I FT T that we show to be equivalent to M has 3 states {so, 81,82}, with S2 the final one, and the following alphabet, ao being the initial string, ai the left boundary symbol and 6j the right boundary symbol of M, and 60, 02 other two symbols useful in the simulation (for generating the input strings of M, and for extracting the output strings of M) : All {a0,6o,ai,6i,a2} U {a:' I x £ Au{ai,bi}}U [x I x £ AU {cti,6i}} U {x-? I x £ A} U {9i,92,9/} U {Pl,P2} U {9T,92}-
319 T h e transducer T has the following transduction rules (for clarity, we group the rules according to the pair of states the transducer passes between). F r o m so t o so : a0 - > &0&1
6 0 -> b0x 6 0 ->•
(V
x£A)
axqi
x ->• a; ( V i e i U { a i , 6 i } ) a; —> x? (V 1 £ i )
F r o m so t o s\ : gT->- A ar? —Y x
(V 1 £ A) F r o m si t o so :
x -+x
( V i e AU{ai,6i})
x ->• 2/QTJ-
(V
xpi
-^
yqj
x-^ypj {V xpi -^yPj x^txqj (V xpi <£ M, Pi - • M ' j (V i*Pi -»• yqj P\ - • ypj (V xpi -^ypj
£ M,x
£ AU
{ai,
&i})
£ M,x£ AU{aubi}) x £ AU {ai, fei}) £M,x£ A\j{ai,bi}) £ M,x £ AU {a x ,61})
Pi ->• ajg/
(V i p i ^ t f , i £ i U {ai, 6X})
P2^yqj V2 -> yPj p2-^xq!
{V xp2->yqj £M,x£ A\j{ai,bi}) (V xp2 -^ ypj £ M,x £Al) {a 1 ; 61}) {V xp2<£ M,x £AU{aubi}) F r o m so t o s2 :
92 -> A F r o m S2 t o so : x ->x ( x->yqj x ->• ypj x-^ xqj
V i E AU{ai,6i}) (V q2x->yqj £ M,x£AU{ai,bi}) (V q2x -^ ypj £ M,x £ AU {ax, 61}) (i q2x g M,x £ Al){ai,bi}).
Now we explain the m a i n points of the simulation of the instructions of M. In the state so, starting from the initial symbol ao of T, with iterated transductions any initial configuration of M is derived. T h e simulation of an instruction of M for a right state symbol is performed by two transductions
320
in the following manner. T in s0 scans the symbols without changing them, until it reads the state symbol qi or 2. At that point the symbol is overlined and T passes into Si or into s 2 respectively. Consider the case S\ (the other one is perfectly analogous). In this state T reads a symbol x £ A U {a\,b\}; this symbol is overlined and T reaches again so where the transduction can conclude by leaving unchanged the remaining symbols. In the next transduction when qY is read T delete it and passes into si, where x~ is read (this says that x is the symbol after q{); therefore ~x is replaced by a pair that is related to q\x by some instruction of M (or by xqj is such a pair does not exist). The simulation of an instruction of M for a left state symbol can be performed by two transductions in the following manner. T in SQ scans the symbols without changing them, at some point, reading a symbol x £ A U {a\,bi}, T guesses that it is the symbol before a state symbol and changes it into x->\ then, the rest of the string is scanned without changes. In the next run if the guess is correct, when T reads x-> passes to the state S\ changing x? into x and reads p\ or p 2 , therefore the symbol state is replaced according to the instructions of the Turing machine M and T reaches again the state SQ where the transduction can conclude without any other change. If the guess is not correct, then T reads a symbol y £ A U {a\,bi} and can pass into s 0 by overlining or priming y, but in this case any further transduction starting in SQ will abort because overlined and primed symbols cannot be scanned in SQ (in the case T remains in s\ and the state symbol is not qj, the process will abort). The rules given above simulate with two transductions the application of the instructions of M; other six kinds of rules generate the output of M as transductions terminating in the final state s 2 of T: From so to s\ : a\ ->• a2 From si to s\ : x -> x' (V x £ qs -^X
AU{ai,bi}) From so to s 2 :
a2 -> A From s 2 to s 2 : x' -> x (V x £ A) b[ -> A. The whole dynamics of T is given by the diagram from Figure 1, where [rx] are the two symbols replacing rx according to the instruction of M(x £ Al){ai,bi}). Now we show that an output is generated on the tape by M iff it can be
321
generated by T in the final state S2- If an output is generated by M, then the previous simulation tells us that it is also generated by T. Now, let us prove the reverse implication. Assume that an output is generated by T. This means that at end of a transduction T reaches the state S2-a. A possible way for this situation is the following: i) the simulation of M has been completed in so] ii) with another transduction run the initial symbol a\ has been changed into a2 and all the following symbols are primed (deleting the final state symbol qf); iii) with a final transduction a^ is deleted, T passes in the final state S2, the primed symbols are restored, and the (primed) right boundary symbol b[ is deleted.
Figure 1
We show that T has no other possibility of reaching s? and completing a transduction in S2- Consider the ways T can reach S2. • During some transduction the state symbol 2 is introduced in some position such that after it all symbols are primed. In this case a next transduction run will overline q2 by ending the transduction in the final sate S2- We show that this possibility cannot occur. In fact if 92 occurs before a primed symbol this means that a priming run has been already performed, but this run can be executed by T i) either by changing a\ into a2 at beginning of the input string, passing to the state s\, or ii) by deleting !f[ and passing from SQ to s\.
322
- In case i), if q2 were a symbol of final state, it would have been erased during the priming run, against the hypothesis that q2 occurs before a primed symbol, on the other hand, if 92 would be not final, then the priming run of symbols after it would have been stopped, again, against the hypothesis that q2 occurs before a primed symbol. - In case ii), the priming starts after reading and erasing q~[ when, rather than overlining the read symbol x in the state s\ and passing to s 0 , T replaces x by x' and remains in the state si where keeps priming all the symbols after x. But this situation would imply that we already obtained a string where q2 is just before
323
From S2 to S3 x' ->x"
( V i e A , ^ b)
b'{ -» A
From S3 to s 3 x' ->• x" x" -4- x
(V x G A) (V x G A)
From s 3 to s? x " ->• x (V x E A, x ^ b) b[ -+ b'l
From so to S3 a3 -> A.
At end of a transduction T reaches the final state if and only if its behavior is of the type indicated in Figure 2, where x G A , y G A — {&}. V -> A
^
b"
^
A
y" - > y b'i
->&i'
Figure 2 We know from the proof of the theorem that T derives, at end of a transduction concluded in the state s\, a string c^a'&i for any string a obtained on the tape of M in a final configuration, where in a' all the symbols of a are primed. Let T start from a primed string a^x'... b[ (where qj has been already deleted). The initial a^ becomes a 3 and T reaches the state S2 where T deletes the initial symbols b' and passes to S3 when it reads a y' zfz &'. T primes it twice and passes to S3. In this state T continues to doubly priming x' and passes to s-} as soon as it reads b[ that transforms into &'/. In a next transduction T deletes the initial
324
symbol a3 passing to s 3 and restoring all doubly primed symbols to the original unprimed form. When the last symbol different from b" is read, T restores it and passes into S2 where the final symbols b" are deleted and finally b'{ is deleted by going in the final state s 3 . If T starts the restoring process from a doubly primed symbol that is not the rightmost one, in the state s 2 , the process will abort because doubly primed symbols different from b" cannot be scanned in this state. D Corollary 3.3 If L E IFT4, then L = V D R for some L' G IFT3, R G REG. Proof. Consider the transducer T from the proof of the main theorem, but allow M to be a Turing machine without restrictions. Remove from T the rule x' —> x from s 2 to s 2 and add to T the following rules (adding also the new symbols involved in these rules): From so to s 2 : a2 ->• a3 x" -»• x (V x G A, x ^ b) F r o m s 2 t o so : 6'->A
From s2 t o s2 : x' ->• x" (V x G A, x ^ 6) x" ->• x (V x G A, x ^ b) b[ -s-A F r o m s 0 t o so : a3
->• A
6'->A. We know from the proof of the theorem that T derives, at end of a transduction concluded in the state s\, a string a 2 a'6' 1 for any string a obtained on the tape of M in a final configuration, where in a1 all the symbols of a are primed. Let C be the alphabet A of M without the symbol 6 for blank. Now we show that with other two transduction runs, the last of them terminating in s 2 , T can transform any string of such a type into a string belonging to CA*C. In fact, let T start from a primed string a^x'.. .b\ (where qj has been already deleted). The initial a2 becomes a3 and T reaches the state s 2 where T can leave the initial 6'
325
unchanged while the primed symbols different from b' are doubly primed. When T reads the first b1 of the final blanks, then T deletes this b1 and reaches SQ where all b1 are deleted and the transduction ends leaving b[ unchanged. If T deletes a b' that is not the rightmost blank, and passes to SQ, the transduction aborts because in so no primed symbols different from b' can be scanned. In a next transduction T deletes the initial symbol a3 and all initial b'. When a x" is read (x ^ b),T passes to s 2 where all doubly primed symbols are restored to the normal form and at end b\ is deleted. •
a2 ->• a 3 x" -> x
A K ->• b[ V ->• A
a3 - >
Figure 3 Corollary 3.4 IFT3 includes nonrecursive languages. Proof. Consider a nonrecursive language L G RE. By the previous corollary L = L' n R where L £ IFT3 and R £ REG; but R is recursive, therefore, because recursive languages are closed with respect to the intersection, V has to be nonrecursive. • Corollary 3.5 CS C IFT3.
326
Proof. This follows from the previous corollary and the well-known inclusion of CS in the class of recursive languages. • 4
Open Problems 1. Find a CS language that cannot be generated by iterated 2-transducers. 2. Find a RE language that cannot be generated by iterated 3-transducers. 3. Find a proof of the Geffert Normal Form from IFT4 = RE.
Acknowledgements. I want to express my gratitude to Henning Fernau for his suggestions that were essential in improving some previous versions of this paper. References 1. P.R.J. Asveld, On controlled iterated gsm mappings and related operations, Rev. Roum. Math. Pures AppL, 25 (1980), 136-145. 2. J.-M. Autebert, J. Gabarro, Iterated gsm's and co-cfl, Acta Informatica, 26 (1989), 749-769. 3. H. Bordihn, H. Fernau, M. Holzer, On iterated sequential transducers, in Words, Languages, Grammars: Where Mathematics, Computer Science, Linguistics, and Biology Meet, Vol. II (C. Martin-Vide, V. Mitrana, eds.), Gordon and Breach, London, to appear. 4. J. Dassow, S. Marcus, Gh. Paun, Iterated reading of numbers and "blackholes", Periodica Mathematica Hungarica, 27, 2 (1993), 137-152. 5. V. Geffert, Normal forms for phrase-structure grammars, RAIRO. Th. Inform. and AppL, 25 (1991), 473-496. 6. S. Y. Kuroda, Classes of Languages and Linear-Bounded Automata, Information and Control, 7 (1964), 203-223. 7. M. Latteux, D. Simplot, A. Tertlutte, Iterated length-preserving transducers, Proc. Math. Found. Computer Sci. Conf, Brno, 1998. 8. V. Manca, C. Martin-Vide, G. Paun, Computing paradigms suggested by DNA computing: Computing by Carving, Biosystems, 52, 1-3 (1999), 4754. 9. V. Manca, C. Martin-Vide, G. Paun, Iterated GSM mappings: A collapsing hierarchy, in Jewels Are Forever (J. Karhumaki, G. Rozenberg, Gh. Paun, H. Maurer, eds.), Springer-Verlag, New-York, 1999, 182-193.
327
10. L.M. Minski, Computation: Finite and Infinite Machines, Prentice-Hall, Inc., Engleewood Cliffs, N.J., 1967. 11. Gh. Paun, On the iteration of gsm mappings, Revue Roum. Math. Pures Appi, 23, 4 (1978), 921-937. 12. Gh. Paun, The complexity of language translation by gsm's, Rev. Roum. de Lmguistique, Cah. ling. th. appl., 25, 1 (1988), 49-58. 13. Gh. Paun, G. Rozenberg, A. Salomaa, DNA Computing. New Computing Paradigms, Springer-Verlag, Berlin, 1998. 14. Gh. Paun, A. Salomaa, Self-reading sequences, Amer. Math. Monthly, 103 (1996), 166-168. 15. B. Rovan, A framework for studying grammars, Proc. MFCS 81, Lect. Notes in Computer Sex., 118, Springer-Verlag, 1981, 473-482. 16. G. Rozenberg, A. Salomaa, The Mathematical Theory of L Systems, Academic Press, New York, 1980. 17. G. Rozenberg, A. Salomaa, eds., Handbook of Formal Languages, 3 volumes, Springer-Verlag, Heidelberg, 1997. 18. W.J. Savitch, How to make arbitrary grammars look like context-free grammars, Siam Journal on Computing, 2 (1973), 174-182. 19. C.E. Shannon, A universal Turing machine with two internal states, Automata Studies, Annals of Mathematical Studies, 34, Princeton Univ. Press, 1956, 157-165. 20. D. Wood, Iterated a-NGSM maps and T-systems, Inform. Control, 32 (1976), 1-26.
This page is intentionally left blank
329 TIME-VARYING DISTRIBUTED H SYSTEMS OF D E G R E E 1 G E N E R A T E ALL R E C U R S I V E L Y E N U M E R A B L E L A N G U A G E S
MAURICE MARGENSTERN Institut Universitaire de Technologie Universite de Metz, Metz, France Laboratoire d'Informatique Theorique et Appliquee E-mail: margens©lita.univ-metz.fr YURII ROGOZHIN Institute of Mathematics and Computer Science of the Academy of Sciences of Moldova Chi§inau, Moldova E-mail: [email protected] A time-varying distributed H system (in short, a TVDH system) of degree n is a well-known model of splicing computations which has the following special feature: at different moments one uses different sets of splicing rules (the number of these sets of splicing rules is called the degree of the TVDH system). It is known that there is a universal TVDH system of degree 1. Now we prove that TVDH systems of degree 1 generate all recursively enumerable languages.
1
Introduction
Time-varying distributed H systems are well-known theoretical models of biocomputing based on splicing operations [15,16,17]. We refer the reader to [7,8,9,10,11,19,23,12] for more details on the history of this model, its extensions and connections with previous models based on splicing computations. The model introduces components (see later the formal definition) which cannot all be used at the same time but one after another, periodically. In [16] it is proved that 7 different components are enough in order to generate any recursively enumerable language. In [14], the number of components was reduced down to 4. Recently, see [12], the present authors proved that one component is enough to construct a universal time-varying distributed H system, i.e., to construct a time-varying distributed H system that is capable to simulate the computation of any Turing machine (for instance any universal Turing machine from [20,21,22]). Universality of computation and generating any recursively enumerable language are equivalent properties, but it is a priori not necessarily true that the universality of some time-varying distributed H system with n components entails that there are time-varying distributed H systems which generate all recursively enumerable languages, with only n components.
330
This is true for two components, because the present authors proved that 2 different components are enough in order to generate any recursively enumerable language [11]. Now we complete the proof that this is true also for one component, i.e., that TVDH systems of degree 1 can generate any recursively enumerable language. 2
Basic Definitions
We recall some notions. An alphabet V is a finite, non-empty set whose elements are called letters. A word (over some alphabet V) is a finite (possibly empty) concatenation of letters (from V). The empty concatenation of letters is also called the empty word and is denoted by e. The set of all words over V is denoted by V*. A language (over V) is a set of words (over V). An (abstract) molecule is simply a word over some alphabet. A splicing rule (over alphabet V), is a quadruple (ui,U2,u[,u2) of words ui,U2,u[,u2 £ V*, which is often written in a two dimensional way as follows: A splicing rule r = (ui,U2,u'1,u'2) is applicable to two molecules m\,mi if there are words wi,W2,w[,w2 £ V* with mi = W1U1U2W2 and ra2 = w'xu\u2w2, and produces two new molecules m[ = WIUIM'2W2 a n d m'2 = u>[u'1U2'W2- In this case, we also write (•WxUi\u2U>2, w[u[\u'2W2)
\~r ( w i « i « 2 W 2 ,
w[u'lU2W2)
or simply (mi, m2) Hr (m[, m'2). A pair h = (V, R), where V is an alphabet and R is a finite set of splicing rules, is called a splicing scheme or an H scheme. For an H scheme h = (V, R) and a language L C V* we define: i,w2 e L :3r e R: (wi,w2) r>
{w,w')}.
A Head-splicing-system [2,3], or H system, is a construct: H=(h,A)
=
((V,R),A),
which consists of an alphabet V, a set A C V* of initial molecules over V, the axioms, and a set R C V* x V* x V* x V* of splicing rules. H is called finite if A and R are finite sets. For any H scheme h and any language L 6 V* we define: ai+1(L)=aih(L)Uah(aih(L)), a*h(L)=Ui>0ai(L).
331 T h e language generated by the H system H is defined as L{H) =
(V,T,A,RuR2,...,Rn),
where V is an alphabet, T C V is a terminal alphabet, A C V* is a finite set of axioms, and components Ri are finite sets of splicing rules over V, 1 < i < n. At each moment k = n • j + i, for j > 0, 1 < i < n, only the component Ri is used for splicing the currently available strings. Specifically, we define Lfc+i = <7/jt(Lfc), for i = k(mod n), k > 1,1 < i < n, hi = (V, Ri). Therefore, from a step k to the next step, k + 1, one passes only the result of splicing the strings in Lk according to the rules in Ri for i = k[mod n); the strings in Lfc t h a t cannot enter a splicing rule are removed. T h e language generated by D is, by definition:
L(D) d = f (u fe >A)nr. Denote by RE the set of all recursively enumerable languages, by VDHn, n > 1, the family of languages generated by time-varying distributed H systems of degree at most n, and by VDH* the family of all languages of this type. 3
The Main Result
T h e o r e m 3.1 VDHX = VDH* =
RE.
Proof. We consider recursively enumerable sets of natural numbers instead of recursively enumerable languages, using any of the many well-known methods to encode a formal language into subsets of natural numbers. It is a well known fact from theoretical computer science t h a t for every recursively enumerable set £ of natural numbers, there is a Turing machine Tc which generates £ as follows. Let fc be a total recursive function enumerating the elements of C, i.e., C = {fc(x) \ x £ IN). It is well-known, see [4], chap.XIII, §68, Theorem XXVIII, how to construct a Turing machine Tc from the definition of fc which would compute what / does, i.e., for every n a t u r a l number x, machine Tc transforms any initial configuration q\01x+1 into the final configuration qo0l^c^+1Q . . . 0. Moreover, machine Tc never visits cells to the left of the cell 0 of the initial configuration (i.e., machine Tc has a tape t h a t is semiinfinite
332
to right) and no instruction of machine Tc is stationary, i.e., the head moves on every steps of the computation. Let us assume for a while that we succeeded to simulate the machine TcIt is not yet enough to prove the theorem. Indeed, starting from one word, say qiOlx+l for some x, we would obtain an encoding of fc{x) as go01-^ r ) + 1 . But this is not what we need, because this gives us a single word. It is not difficult to see that starting from the machine Tc, there is a Turing machine Tc which computes 01 a r + 2 g 0 01 / £ ( : r ) + 1 0 .. .0, starting from gi01 x + 1 . It will be possible for us to device a TVDH system of degree 1 T which, arriving to that stage of the computation, will split the obtained word into two parts: lfc{x)+i a s a generated word and q\Qlx+2 as a new starting configuration. This will allow us to obtain exactly C as C(T). 4
Definition of T
In what follows, in order to facilitate the reading of the formulas, we shall write f(x) instead of fc (x) when it will be clear from the context that we mean that latter function. Assume that {0,1} is the tape alphabet of the Turing machine T'c and let us number its states by qo,qi,..., Qui where q\ is the initial state and q0 the final one. From now on, we shall use Latin small letters to denote tape symbols, Greek letters for words on the alphabet of the tape symbols, bold Latin small letters for states of the Turing machine. We define the TVDH system T as follows: Its terminal alphabet is T = {1}. Let us introduce variables for qo, - tq0, trll Z <- 1, tn <- lf|2, Y', <- Y, Xqi0Z }, with a, b taking all their possible values, and s,y,z £ {0,1}.
-»
tr3,
Block " R i g h t e n d of t h e t a p e " st
1.1 :-
SLY
VsG{0,l,X}
aOY
V*G{0,1}; Block " R i g h t shift" 2.1 :- axz yb zR
V«G{0,1,X}; VzG{0,l}; Va, x,y,b G
2.1':-
axY ybY
1R\
V*G{0,1,X}; Va, z . y . b G l j j ;
syb z R 2.2: Lax z
VsG{0,l,X}; VzG{0,l}; VtG{0,l,Y}; Va, x,2/,bGli{;
Block "Left shift" 3.1 :- zaxpw b zyR Vp,zG{0,l}; V«G{0,l,y}; Va, i , ! / , b e I L ; 3.1'
zaxY b zyR
V«G{0,1,X}; V*G{0,1}; Va,a;,?/,b G i t ;
3.2
sbzy i? Lzaa;
VaG {0.1.X}; VpG{0,l,Y}; VzG{0,l}; Va,ar,y,bGlt;
334
Block "Right signal" llgoOl R\Q->t gO <j0 4.2 IQRqoO 4.1
4.3:4.4:
->1 l-ttr sl->
to€{l,Q}; T2
V*e{l,Q};
trl-+l
Block "Left signal"
si-) P Z|<-1 1<- - P 5 2
Vs£J Vse{i,g};Vpe{o,y} ;
5.1
•> 3
1«-*I2 in -f-lp
Bio ck "Result fi 1
Vp€{l,Y}; Vp€{l,r}; ?
Q<-1 5/ '
fi ^
iiQ<-Y' k-Y
6 ?!
X0
We also consider the rule
for each axiom a £ A, except
XqiQlY.
As it can be seen from the computations, these axioms must always b present for making it possible to apply most of the rules.
335
5 5.1
Checking the Simulation Checking the simulation of one step in a Turing computation
The first thing we have now to check is that starting from a word representing the current configuration of machine T'c, the application of the rules of V leads to a word representing the next configuration. In other words, given any instruction of the program of Tjr, we have to show that there are rules in T and axioms allowing to mimic the application of that instruction to a suitable configuration. There are several cases according to the move of the instruction and of the position of the scanned cell in the configuration: according to whether the move is to right or to left, according to whether the scanned cell is an interior one or a cell being at the right end of the configuration. T h e case of a n interior cell Let uJt,u>r be finite words of alphabet {0,1} and u>t&xwr be the current configuration of machine T'c with LJI — visz and u>r = pvr. Assume that T has obtained word X vi_szaxpvTY at a time, say t. Assume that instruction axLyb
applies to the current configuration.
Possibly after several steps,
T should produce word X vi sh z y pvr Y. The reader can get convinced that in two steps Y produces the expected word and no undesirable one: indeed, rule 3.1 (3.1') applies as far as the axiom Lb zy R is present, leading to words X vt sh zyR and L zaxpvr Y that can enter in rule 3.2 and, therefore, are kept for the further processing. Now, rule 3.2 straightforward applies to these words and provides us with X v^ sh z ypvr Y and L zaxR. Observe now that L zaxR is an axiom. On the other hand, word X VishzypvrY is the representation of the next configuration and we see that the previous conditions are again observed, which proves the simulation of one step of Turing computation by T, at least when an instruction with a move to left is applied. The reader can now check that in the case of an instruction ax Ryh with a move to right, rules 2.1 (2.1') and 2.2 successively apply, providing us with the expected next configuration, namely Xu>tyhuirY (where u>r may be empty). T h e case of t h e right e n d of t h e t a p e We have now to check what happens when the head has to go to the right of the right end of the configuration. As in our representation of a configuration the ends are realised by special markers, X for the left end, Y for the right one, such cases are easily characterised: XaxvY for the left end and XioaxY for the right one.
336
In the case of the left end, the case is dealt with by the already seen rules 2.1 (2.1'), 2.2 if the instruction determined by a t has a move to right. In the case of the right end there is a uniform way for solving that case: it is enough to transform representation I w a Y into the following one: X w aOY, which can be dealt with as the case of an interior cell. It is easy to check that rule 1.1 allows to obtain the just described transformation. 5.2
Checking how to resume the computation on Ol*"1"2
We now arrive at an important point of our simulation. From what we already seen, we now prove that T transforms X q\ 0 lx+1 Y into X 0 F + 2 q00 l^x)+1 0 . . . 0 Y. Let us write uim — l/( m )+ 1 , where / enumerates £, and inductively define £m by £o = {w0} Ck+i = -C/sUJw/j+i}. It will be enough to check that if at some time t/. we have obtained Ck and X 9i 0 \k+2Y, then at a later time tk+\ we shall obtain Ck+i and X q\ 0 l f c + 3 Y. And so, starting from X 0 lk+3 q0 0 l/( fc + 1 )+ 1 0 . . . 0 Y, we leave a marker, Q at the place of qoO and, at the same time, send a signal searching the first 0 following the 0 scanned by the head at that time. When the wanted 0 is found, it cuts off the superfluous O's and Y and the signal goes back to the marker. When it reaches it, it splits the word in two parts: the right one is the expected tok+i; in the left one, the marker is changed into Y and the signal goes on to left until it meets 0. At that moment it transforms what is on the left of that X0 into XqiO, and the new expected starting configuration is reached. So, we explain that in details. Starting from word X0l' c + 3 go01- f ( f c + 1 ) + 1 0 . . . 0Y the application of rules 4.1 and 4.2 allows to put marker Q on the place of go, to erase qoO and to insert in front of lf(k+1)+1 signal —>: indeed, the application of rule 4.1 yields X 0 lk+3Q -> tq0 and Rq0 0 \f(k+1)+1 0 . . . 0 7 . Both words are kept as far as they enter rule 4.2 which in its turn yields word X 0 l f e + 3 Q -> lf(k+1)+l 0 . . . 0 Y , as well as R q0 0tqo which enter no rule of T and, consequently, is ruled out. Then, rules 4.3 and 4.4 allow to cross over the block of l's constituting the expected result ui^+i- Indeed, assuming that the computation starts from word X01k+3Qlu -> 11" 0 . . . 0 Y, rule 4.3 yields X 0 lk+3 Q 1"1 -> tr2 and tri -> 1 V 0 . . . 0 Y which enter rule 4.4 yielding X0lk+3Q1U1 -> 1"0 . . . 0Y and trl ->• 1 tr2 which is ruled out, as far as it enters no rule of T. And so, by induction on the number of l's to be
337 crossed over, we see t h a t t h e appropriate iteration of rules 4.3 and 4.4 leads t o But now, rule 5.1 allows to throw word A r 0 1 f c + 3 Q l / ( * + 1 > + 1 -> 0 . . . 0 Y away t h e superfluous substring 0 . . . 0 Y and t o reverse t h e signal, leading t o XGlk+3Ql^k+1^
word
<-l
5.3 allow t o arrive t o word k+3
Now repeated applications of rule 5.2 and
X01k+3Q
u
<- l^( fc + 1 )+ 1 k
Indeed, starting from
3
X 0 l Q l 1 <- 1", rule 5.2~yTelds^' Ql ~+ ~Q~r l*-ti2 and tn < ~ 1 1 " , both word entering rule 5.3 yielding X 0 lk+3 Q lu <- 1 1" and t / i l <— i j 2 , t h e latter being ruled o u t as far as it enters no rule of T. Now, whatever is t h e value of f(k+l), rule 6.1 and 6.2 apply and allow t o separate t h e result as a word in t h e terminal alphabet, namely Uk+i from t h e other part, transformed into word
XQlk+3
Indeed, applied t o word
XQlk+3Q f- l/( f c + 1 )+ 1 rule 6.1 yields X 0 l f c + 3 Q < - Y ' and l/(fc+i)+i The latter word is the expected w^+i and the computation goes on with the former word, and it enters rule 6.2 allowing to obtain X0lk+3
338
4. 5.
6. 7.
8. 9.
10.
11.
12.
13. 14. 15.
16. 17.
vol.2 of Handbook of Formal Languages (G.Rozenberg, A.Salomaa, eds.), Springer-Verlag, Heidelberg, 1997. S. Kleene, Introduction to Metamathematics, Van Nostrand Comp. Inc., New-York, 1952. M. Margenstern, Non-erasing Turing machines: a new frontier between a decidable halting problem and universality, Lecture Notes in Computer Science, 911, in Proceedings of LATINS (1995), 386-397. M. Margenstern, Frontier between decidability and undecidability: a survey, Theor. Computer Set., 231, 2 (2000), 217-251. M. Margenstern, Yu. Rogozhin, A universal time-varying distributed Hsystem of degree 2, in Preliminary proceedings, Fourth International Meeting on DNA Based Computers, June 15 - 19, 1998, University of Pennsylvania, 1998, 83-84 M. Margenstern, Yu. Rogozhin, A universal time-varying distributed Hsystem of degree 2, Biosystems, 52 (1999), 73-80. M. Margenstern, Yu. Rogozhin, Generating all recursively enumerable languages with a time-varying distributed //-system of degree 2, Technical Report in Publications du G.I.F.M., Institut Universitaire de Technologie de Metz, ISBN 2-9511539-5-3, 1999. M. Margenstern, Yu. Rogozhin, About time-varying distributed H systems, 6th International Meeting on DNA-Based Computers, Leiden, The Netherlands, June 13-17, 2000, LNCS, 2054 (2001), 53-62. M. Margenstern, Yu. Rogozhin, Time-varying distributed H-systems of degree 2 generate all recursively enumerable languages, in Where Mathematics, Computer Science, Linguistics and Biology Meet (C. Martin-Vide, V. Mitrana, eds.), Kluwer Academic Publishers, 2000, 399-407. M. Margenstern, Yu. Rogozhin, A universal time-varying distribyted H system of degree 1, 6th International Meeting on DNA-Based Computers, Tampa, Florida, USA, 2001. M.L. Minsky, Computations: Finite and Infinite Machines, Prentice Hall, Englewood ClifFts, NJ, 1967. A. Paun, On time-varying H systems, Bulletin of EATCS, 67 (February 1999), 157-164. Gh. Paun, DNA computing: distributed splicing systems, in Structures in Logic and Computer Science. A Selection of Essays in honor of A. Ehrenfeucht, LNCS, 1261, Springer-Verlag, (1997), 353-370. Gh. Paun, DNA Computing Based on Splicing: Universality Results, Theor. Computer Set., 231, 2 (2000), 275-296. Gh. Paun, G. Rozenberg, A. Salomaa, DNA Computing: New Computing Paradigms, Springer-Verlag, Berlin, 1998.
339
18. L. Priese, Towards a precise characterization of the complexity of universal and nonuniversal Turing machines, SIAM Journal of Computation, 8, 4 (1979), 508-523. 19. L. Priese, Yu. Rogozhin, M. Margenstern, Finite H-Systems with 3 Test Tubes are not Predictable, in Proceedings of Pacific Symposium on Biocomputing, Kapalua, Maui, January 1998 (R.B. Altman, A.K. Dunker, L. Hunter, T.E. Klein, eds), World Sci. Publ., Singapore, 1998, 545-556. 20. Yu. Rogozhin, Seven universal Turing machines, Mathematical Studies, Kishinev, Academy of Sciences, 69 (1982), 76-90 (in Russian). 21. Yu. Rogozhin, Small universal Turing machines, Theor. Computer Sci., 168, 2 (1996), 215-240. 22. Yu. Rogozhin, A universal Turing machine with 22 states and 2 symbols, Romanian Journal of Information Science and Technology, 1, 3 (1998), 259265. 23. S. Verlan, On extended time-varying distributed H systems, in Proceedings of 6th DNA Based Computers Conference, Leiden, The Netherlands, 2000, 281.
This page is intentionally left blank
341 ON THE P O W E R OF
RRWW-AUTOMATA
GUNDULA NIEMANN, FRIEDRICH O T T O
E-mails:
Fachbereich Mathematik/Informatik Universitat Kassel, 34109 Kassel, Germany {niemann, o t t o } 6 t h e o r y . inf o r m a t i k . u n i - k a s s e l . d e
By proving that they accept some quite complicated languages it is shown that the RRWW-automata of Jancar et al (1998) are fairly powerful. In particular, it is shown that they accept an NP-complete language, which implies that the closure LOG-RRWW of the class of languages accepted by RRWW-automata under log-space reductions coincides with the complexity class NP.
1
Introduction
In the last decade of the twentieth century Jancar and his collegues presented a non-deterministic machine model for processing strings that are stored in a list [8]. They called this model the restarting automaton, and in addition to the basic model they developed many different variants of it [9,10,11]. The interest in these models is motivated by the fact that they mirror certain elementary aspects of the syntactical analysis of natural languages. The most general type of restarting automaton is the RRWW-automaton. An RRWW-automaton has a finite control and a read/write-head with a finite look-ahead working on a list of symbols (or a tape). It can perform three kinds of operations: a move-right step, which shifts the read/write-window one position to the right and possibly changes the actual state, a rewrite step, which replaces the contents of the read/write-window by a shorter string, moving the head to the position immediately to the right of the newly written string and possibly changing the actual state, and a restart step, which places the read/write-head over the left end of the list (or tape), and puts the automaton back into its initial state. Obviously, such an automaton works in cycles, and it is required for an RRWW-automaton that it performs exactly one rewrite step in each cycle. It should be stressed that in a rewrite step the length of the list (or tape) actually decreases, that is, the now superfluous list elements are actually removed. Hence, starting with a list of length n an RRWW-automaton can perform at most n cycles before it halts. In [10] the authors ask for the exact relationship of the class £(RRWW) of languages accepted by the RRWW-automata to the class GCSL of growing context-sensitive languages [4], In [14] we have shown that GCSL is actually already contained in the class £(RWW) of languages accepted by RWW-automata.
342
Further, we have shown that the deterministic RWW- and RRWW-automata both accept the same class of languages, which is the class CRL of ChurchRosser languages [12,1,13]. Here an RWW-automaton is an RRWW-automaton that performs a restart step immediately after each rewrite step. Thus, while an RRWW-automaton can still inspect the remaining content of the list after performing a rewrite step, an RWW-automaton returns to the left end of the list immediately after performing a rewrite step. For the nondeterministic classes we have the inclusions GCSL c £(RWW) C £(RRWW) C CSL
(1)
where CSL denotes the class of all context-sensitive languages, but it is open which of these inclusions is proper. However, as shown in [15] the Gladkij language Lciad = { w # w f l # w | ID 6 {a, b}* }, which is not growing context-sensitive [6,3], is accepted by some RRWW-automaton. Hence, we see that GCSL is properly contained in £(RRWW), and so at least one of the first two inclusions above is proper. Here we continue with the investigation of the class £(RRWW) by establishing further results on the power of the RRWW-automaton. First we will show that the language C0PY n2 := { W u,#l"' | 2 -H | w € {a, b}* }
(2)
which belongs to the difference CSLhn \ GCSL [3], is accepted by some RRWWautomaton. Here CSLun denotes the class consisting of those context-sensitive languages that are generated by a context-senitive grammar that is linearly timebounded [2]. The proof uses an extension of the technique employed in [15] for proving that the Gladkij language is accepted by an RRWW-automaton. Next we will prove that the RRWW-automata even accept a suitable encoding of the language 3SAT of satisfiable Boolean formulas in conjunctive normal form with clauses of degree 3. As this language is NP-complete under log-space reductions, and as it is easily seen that an RRWW-automaton can be simulated by a nondeterministic Turing machines in polynomial time, it follows that the closure LOGRRWW of the class of languages accepted by RRWW-automata under logspace reductions coincides with the complexity class NP. As the complexity class PSPACE coincides with the closure of the class CSL under log-space reductions, we see that the equality £(RRWW) = CSL would imply that the complexity classes NP and PSPACE coincide. Admittedly our results do not solve the question of whether or not the RWWautomata are strictly weaker than the RRWW-automata, but they may prove useful in establishing such a separation result. Further, our results indicate that
343 it is highly likely t h a t the language class £(RRWW) is strictly contained in the class CSL, but a proof of this separation is still missing. 2
The RRWW-Automaton
Here we restate the definition of the RRWW-automaton in short. A restarting automaton with rewriting, RRWW-automaton for short, is described by a 9-tuple M — ( Q , S , T,S, qo,$, $, F, H), where Q is the finite set of states, E is the finite input alphabet, T is the finite tape alphabet containing E, <7o £ Q is the initial state, | , $ 6 T \ S are the markers for the left and right border of the work space, respectively, F C Q is the set of accepting states, H C Q \ F is the set of rejecting states, and 6:{Q-,(FuH))x
T^k+1
-> P f l n ((Q x ({MVR} U 1^*)) U {restart}) n
is the transition relation. Here T-n
=
(J V,
Pf\n(S)
denotes the set of finite
j' = 0
subsets of the set S, and k > 1 is the size of the look-ahead of M. T h e transition relation consists of three different types of transition steps: 1. A move-right step is of the form [q1, MVR) G S(q, u), where q G Q^{FVJH), q' e Q and u G r f c + 1 \ (r* • {$}) or u G U } • T ^ " 1 • {$} U T^fc • {$}, u ± $, t h a t is, if M is in state q and sees the string u in its read/write-window, then it shifts its read/write-window one position to the right and enters state q', and if q' £ F U H, then it halts, either accepting or rejecting. 2. A rewrite step is of the form (q', v) G 5(q, u), where q G Q \ (FUH), q' G Q, « G T f c + 1 N (r* • {$}) or « G {<):} • T ^ ^ " 1 • {$} U T^h • {$}, u jL $, and |t)| < |u|, t h a t is, the contents u of the read/write-window is replaced by the string v which is strictly shorter than u, and the state q' is entered. Further, the read/write-window is placed immediately to the right of the string v. In addition, if q1 G F U H, then M halts, either accepting or rejecting. However, some additional restrictions apply in t h a t the border markers <j: and $ must not disappear from the tape nor t h a t new occurrences of these markers are created. Further, the read/write-window must not move across the right border marker $, t h a t is, if u is of the form u i $ , then v is of the form t>i$, and after execution of the rewrite operation the read/write-window just contains the string $. 3. A restart step is of the form restart G 6(q, u), where q G Q \ {F U H) and u G T f c + 1 \ (r* • {$}) or u G T^fc • {$}, t h a t is, if M is in state q seeing u in its read/write-window, it can move its read/write-window to the left end of
344 the tape, so t h a t the first symbol it sees is the left border marker <(:, and it reenters the initial state qo. Obviously, each computation of M proceeds in cycles. Starting from an initial configuration qo$w$, the head moves right, while move-right and rewrite steps are executed until finally a restart step takes M back into a configuration of the form qo$Wi$. It is required that in each such cycle exactly one rewrite step is executed. By \-cM we denote the execution of a complete cycle, that is, the above computation will be expressed as qo$w§ \~CM qo$wi$. An input w £ X* is accepted by M , if there exists a computation of M which starts with the initial configuration qo$w$, and which finally reaches a configuration containing an accepting state qa £ F. By L(M) we denote the language accepted by M. T h e following l e m m a can easily be proved by using standard techniques from a u t o m a t a theory. L e m m a 1 Each RRWW-automaton M is equivalent to an RRWW-automaton M1 that satisfies the following additional restrictions: (a) M' enters an accepting or a rejecting state only when it sees the right border marker $ in its read/write-window. (b) M' makes a restart step only when it sees the right border marker $ in its read/write-window. This l e m m a means that in each cycle and also during the last part of a computation the read/write-window moves all the way to the right before a restart is made, respectively, before the machine halts. By requiring t h a t a restart is performed immediately after each rewrite step we obtain the RWW-automata, which already accept each growing contextsensitive language [14]. 3
S o m e A d d i t i o n a l E x a m p l e s of L a n g u a g e s T h a t A r e A c c e p t e d by R R W W - A u t o m a t a
We study the power of the RRWW-automatain order to collect more information on the class of languages accepted by them. As pointed out before the Gladkij language L G iad belongs to the difference £(RRWW) \ GCSL [15]. Here we will show t h a t also some other quite complex languages are accepted by RRWWautomata. Let M - (Q, S, T, 8, q0, $, $, F, H) be an RRWW-automaton t h a t satisfies the additional requirements of Lemma 1. Then each cycle of a computation of M consists of three phases.
345
Let qo$w$ be the restarting configuration of the actual cycle. (1.) First M makes a number of move-right steps until it encounters the lefthand side u of a rewrite step. In this phase M behaves like a finite-state acceptor, checking whether the prefix <|;ii>i read belongs to a certain regular language R\ C.\ • T*. (2.) Now M applies a rewrite step replacing the factor u of w by some shorter string v, and moving its read-/write-head to the right of this string. (3.) Finally, M scans the remaining tape inscription until it encounters the right border marker $, upon which it accepts, rejects, or performs a restart step. Again during this part of the computation M behaves like a finite-state acceptor, making a restart only if the suffix w2$ read belongs to a certain regular language R2 C f • $. Hence, the tape contents w can be written as w = W\uw2, where §wi £ R\, w2% £ R2, and u is rewritten into v (see also [15] Corollary 6.4). To simplify the description of the RRWW-automaton M we will simply describe the above cycle through the tripel (Ri,u
-)•
v,R2),
which we call a meta-instruction. The regular languages i?i and R2 will be denoted as the regular constraints of this instruction. On trying to execute this instruction M will reject starting from the configuration q^w%, if w does not admit a factorization of the form w = w\uw2, where |toi g fli and w2% ER2. On the other hand, if w does have a factorization of this form, then one such factorization is chosen nondeterministically, and q^^w% is transformed into qQ§wivw2§. In the following we will describe RRWW-automata through finite collections of meta-instructions. At the beginning of each cycle the RRWW-automaton will nondeterministically choose the meta-instruction to be executed next. The conditions expressed by the regular constraints of the meta-instructions will ensure that only the 'correct choice' will lead to a successful execution, while all other choices will lead to rejection. We first consider the language COPYn2 (see (2)), proving the following result. T h e o r e m 1 The language C0PYn2 is accepted by some RRWW-automaton. Thus, we see that COPYn2 is another example of a language from the difference £(RRWW) \ GCSL. Proof. Below we will present an RRWW-automaton M for the language C0PY n 2. Essentially this RRWW-automaton will proceed as follows:
346
Step 1. Check that the input is of the form tu#" for some string w £ {a,b}* and some integer n > 0. Step 2. Place a special marker to divide the string w into two parts w\ and W2, and place m occurrences of a special marker D to divide the suffix # n into factors #niD,... ,#""*£), where n = J2?=i(ni + 2 )Step 3. Verify that wi and W2 coincide, that all the exponents m, 1 < i < m, coincide with \wi\ — 3, and that the number of factors m equals the length of w\. Accept if all these conditions are met. The verification process in Step 3 follows the idea of the proof that the Gladkij language is accepted by some RRWW-automaton as given in [15]. The two factors W\ and W2 and the m factors # " ' , 1 < i < m, are reduced in parallel. In each round, which consists of a number of cycles, the last two letters of w\ are compared to the last two letters of u>2, and if they coincide, they are erased, and two symbols # are deleted from each factor # n " D . Also in each round the last two occurrences of the symbol D are replaced by the symbol D. Each of these rounds is simulated by a sequence of 2 • (m + 2) cycles. From left to right we first mark the two-letter subfactor of each factor that is to be erased, which takes m + 2 cycles, and then we erase these subfactors, again from left to right, replacing the last two occurrences of D by D in the process. To achieve this two additional special symbols D' and D" are used. The regular constraints of the meta-instructions describing these cycles ensure that the cycles of a round are executed in the correct order, that is, if a particular cycle is chosen at the wrong moment, then its regular constraints will ensure that the RRWWautomaton rejects. The input alphabet of the RRWW-automaton M is E := {a, b, # } , and the tape alphabet is r := E U { [s\t], [rs\t], [st] \r,s,te
{a, b} } U {C, D,D', D", D}.
Below we give the description of the program for M in terms of meta-instructions, where w 6 T* denotes the actual tape contents at the beginning of the current cycle. (1)
if ( H < 2 0 a n d u x E C0PY n2 ) or w = a\a2[a^\ai}a2azDD'D" • Dk orw = a 1 a 2 a3[a4|a 1 ]a 2 a 3 a4# J D#£»#£)'# J D" • (#£>)fc for some a\, a^, 03, a^ £ {a, b} and k > 2 then ACCEPT else if Jw120 then choose one of the following instructions;
347 2.1) 2.2) 2.3) 2.4)
3.1) 3.2)
3.3)
3.4)
3.5)
3.6) 3.7) 3.8) 3.9) 3.10)
3.11) 3.12) 3.13) 3.14)
( $ • {a, 6}* • # • , # # $ - • £ > " $ , £ ) ; ( ^ . {a, & } * • # * , # # - + £ ' , # * • £ " • $ ) ; ($ • {a, 6}* • # * , # # - > D , ( # * D ) * • # * • D ' • # * • D " • $); (* • {a, 6}*, si -> [s|i], {a, 6}* • ( # * D ) * • # * • D ' • # * • D " • $) for some s,i £ {a, 6}; Comment: Instructions (2.1) to (2.4) realize Step (2.) from above from right to left. (<: • {a, b}*,r[s\t} -» [rs\t], {a, b}* • ( # * D ) * • # * • D ' • # * • D " • $) for some r,s,t £ {a, b}; (*•{«, &}*-r[S|i]-{a, & } * , [ s ' i ' ] # ^ # , ( # * • CT>)* • # * • CD' • # * • CL»" • ( # * • CD)* • $) for some r, s , i , s',t' £ {a, 6}; (<|: • {a, 6}* • r[s|i] • {a, 6}*, [s'<']C -»• C, D • ( # * • C D ) * • # * • C D ' • # * • CD" • ( # * • C D ) * • $) for some r,s,t,s',t' £ {a, 6}; ($ • {a, by • r[s\t] • {a, &}* • ( # * • D)* -#*,CD^D, ( # * • CD)* • # * • CD' • # * • CD" • ( # * • CD)* • $) for some r,s,t £ {a, 6}; ($ • {a, b}* • r[s\t] • {a,b}* • ( # * • D)* • #* ,CD ^ D', # * • CD • # * • C D ' • # * • C D " • ( # * • CD)* • $) for some r,s,t £ {a, 6}; (* • {a, 6}* • r[ S |i] • {a, b}* • ( # * • D)* • # * • D ' • # * , C D -> D " , # * -CD' •#* -CD" •(#* -CD)* •$) for some r , s , i £ {a, 6}; ( M a , 6 } * . r [ S | t ] . { a , & } * • ( # * - D ) * - # * • D ' • # * •£>"•#*, C D ' -> D , # * • C D " • ( # * • C D ) * • $) for some r,s,te {a, &}; (4: • {a, b}* • r[s\t] • {a, b}* • ( # * • D)* • # * • D' • # * • D " • # * • D • # * , C D " -> D , ( # * • C D ) * • $) for some r, a, i £ {a, 6}; ( { - { a , &}* • K*!*] • K &}*' ( # * ' D)* • # * • D ' • # * • D " • ( # * • D)* • # * , CD -> D , ( # * • C D ) * • $) for some r,s,te {a, b}; (+-{a,6}*)5Ht]-^[ff|t]) {a, 6}* • C D ' , # * - D " - ( # * • D)* •$) for some r , s , i £ {a, 6}; ($ • {a, 6}* • [rs|i] • {a, 6}* • [rs] • ( # * • CD)* • # * • C D ' • # * , # # D " - > C D " , ( # * - D ) * •$) for some r , s , i £ {a, 6};
348
(3.15)
ft-{a,b}* -[raW-faby -[r8]-{#* -CD)* •#* -CD1 •#* -CD" •{#* • CD)* • #*,##D -+ CD, (#* • D)* • $) for some r,s,t€ {a, b}; C o m m e n t : Instructions (3.1) to (3.15) realize Step (3.).
From the regular constraints it is obvious that the instructions (2.1) to (2.4) have to be executed in this order, and that afterwards only instructions (3.1) to (3.15) are applicable. By checking the regular constraints of these instructions we see that they verify indeed that the given input belongs to the language C0PY„2. We complete this proof with an example illustrating the way in which the RRWW-automaton M works. We present the sequence of restarting configurations of an accepting computation of M given the string w := abbababbab • # 2 0 as input: q0$w$
$ abbababbab • # 1 8 • # # $
=
q^abbababbab • # 1 4 • # # # 2 £ > " $ (2.2 } ) (23)
?0^66a6a66a6#
2
###2###2###2D'#2JD"$
3
q0$abbababbab#2D#2D#2D#2D'#2D"$
(2.4)
g04;abba[b\a}bbab#2D#2D#2D#2D'#2D"$
(3-r)
g o^a66[a6|a]fe6a6## J P#
(3.11) (3.12)
(3.14) (3.10)
(34^ (3.5^
D# 2 £># 2 £' , # 2 D / / $
q0$abb[ab\a]bb[ab]#2D #2D
qQ$abb[ab\a]bb[ab}CDCDCD#2D'#2D"$ got; abb[ab\a]bb[ab]C DC DC DC
D'#2D"$
q0$abb[ab\a]bb[ab]CDCDCDCD'CD"$ q^ab[b\a}bb[ab]CDCDCDCD'CD"% qQ\ab{b\a]bbCDCDCDCD'CD"% q^ab[b\a]bbDCDCDCD'CD"% a4ab[b\a}bbDD'CDCD'CD"$
(3.6})
gn\ab[b\a}bbDD'D"CD'CD"%
(3.7)
q0\ab[b\a}bbDD' D"
(3.8)
q^ab[b\a]bbDD' D" DD%
(!),
#2D#2D'#2D"$
3
(313)
(3.3)
2
ACCEPT.
DCDn
349 Instead of applying instruction (3.5) also instruction (3.4) could be applied again, but it is easily seen that this would lead to rejection in the next cycle. Thus, the above is the only accepting computation for the given input string w. This completes the proof of Theorem 1. • The next language we are interested in is a particularly encoded version of the satisfiability problem 3SAT of Boolean formulas in conjunctive normal form with clauses of degree 3. Let V := { Vi \ i > 0 } be a set of Boolean variables, and let So := {"", A,V}, where -i is the symbol for negation, A denotes conjunction, and V denotes disjunction. A literal is a variable from i>; or a negated variable -if,-. A clause is a disjunction X\ V x-i V • • • V xm of literals x\,... ,xm, and the number m of literals is called the degree of this clause. Finally a formula in conjunctive normal form is a conjunction C\/\C2/\- • -f\Cn of clauses. A formula a is satisfiable if there exists a truth assignment ip : V —> {0,1} such that
•
•-#ABx2akkc(a),
where k is the maximal index such that Vk occurs in a. The language L3SAT is defined as L3SAT
:= { # * ) | a G3SAT}.
Example 1 The formula a : = « 3 V t)j V -1 u2 A ->i>3 V - i ^ i V -1U3
belongs to the set 3SAT, as tp : V\ •->• 1, 1*3 >->• 0 already shows that a is satisfiable. As V3 is the variable with maximal index occurring in a, we see that the language L3SAT contains the string ABx2#ABx2a#ABx2a2#ABx2a3kx2a3
V x2a V - . z V A -^x2a3 V ~^x2a V - . x V .
It is obvious that the language L3SAT belongs to the complexity class NP. On the other hand from the proof of the NP-hardness of SAT (see, e.g. [7]) and the reduction from SAT to 3SAT as given in [5], we see that this language is
350
actually NP-complete under log-space reductions. Below we will establish the following result. Theorem 2 The language L3SAT is accepted by some RRWW-automaton. In each cycle an RRWW-automaton shortens the length of the list it is working on. Hence, given an input of length n, an RRWW-automaton can go through at most n cycles, and so it makes only a polynomial number of steps. This yields the following inclusion. Observation 1 £(RRWW) C NP. Now the fact that £(RRWW) contains the NP-complete language L3SAT means that each language from NP is reducible to a member of £(RRWW) by a log-space reduction. Thus, we obtain the following consequence, where LOGRRWW denotes the closure of £(RRWW) under log-space reductions, that is, a language belongs to LOGRRWW if and only if it is reducible by a log-space reduction to a language that is accepted by some RRWW-automaton. Corollary 1 NP = LOG RRWW. It remains to prove Theorem 2. Proof of Theorem 2. We describe an RRWW-automaton M (Q,T,,T,S, qo,$,§, F,H) for the language -L3SAT, where - £ :={->, A, V, x,a,#,k,A,
=
B},
- r:=SU{0,l,!/}, - and Q, F, H, and S are given implicitly by the following description. The RRWW-automaton M works as follows. Step 1. A value t £ {0,1} is chosen for the variable currently encoded by the string x2 or the string y2. Moving from left to right each occurrence of x2c or y2c, where c is a symbol from A := {A, V, # , &, $} is replaced by tc. For doing so a number of cycles is necessary, but the regular constraints of the corresponding meta-instructions will ensure that this is done correctly. S t e p 2. Again moving from left to right each occurrence of the factor x2a (or y2a) is replaced by y2 (or x2, respectively). In this way the index of each remaining variable is decreased by one. Step 3. Once all variables have been eliminated by steps 1 and 2, that is, a truth assignment has been specified for the Boolean formula encoded by the original input, it is checked whether the formula considered is in conjunctive normal form with clauses of degree 3, and it is verified whether it evaluates to 1 under the chosen assignment. If so, M accepts.
351
For formulating the regular constraints of the meta-instructions for M we will be using the following auxiliary regular languages: { 0 , l , - 0 , - i l } U { - i a : 2 , ; E 2 } •a*, { 0 , 1 , -.0, - 1 } U {--a:2, a:2} •a+ (e» • v • e e • v • e x • A)* 6a,• ( e ; • v • &x • v • e ; • A)* ®x•
e; Fx F' LFX RFX
e;u{v,A}, exu{v,A}, { o , i , - o , - i } u { V , y 2 } a*, { 0 , l , - i ( W } U { V , ! / 2 } a+,
ey Fy F' LFy RFy
(ey • v • Qy • v V• eA)*
:= :=
( 0 ; • V • 0 ; • V „ y A)* © y U{V,A},and 0yU{V,A}.
e:.
v-e, •v-e*, V - 6 i v-0' v
^x'
Qy 0'
0y
Below we give a description of the program for the RRWW-automaton M in terms of meta-instructions: (0) (1.1) (1.2) (1.3) (1.4) (1.5) (1.6) (1.7) (1.8) (1.9) (1.10) (1.11) (1.12) (1.13)
Nondeterministically choose one of the following instructions; ftAB, x2# -> t#, {ABx2 • a+ • #)* • ABx2 • a+ • k • Fx • $) for some <e{0,l}; ($ABt# • (ABx2 • a+ • #)* • ABx2 • a+ • & • LF*, z2V -> tV, RF* • %) for some t £ {0, 1}; (\ABt# • [ABx2 • a+ • #)* • ABx2 • a+ • k • LF£,x2A -» tA, RF* • $) for some t £ {0,1}; ($ABt# • {ABx2 -a+ • # ) * -ABx2 • a+ • k • LF*,x2% -» i$,e) for some < 6 {0,1}; ({AB, a;2& -> *&, F x • $) for some t £ {0, 1}; (\ABtk • LF;,x2V -> iV, flf; • $) for some t £ {0,1}; (\ABtk -LF*,x2A-+tA:RF; • $) for some t £ {0,1}; (<j:ABt& -LF;,a; 2 $->i$,£) for some t £ {0,1}; (e,$AB*# -»• <|:A#, (ABx 2 • a+ • #)* • ABz 2 • a+ • & • F'x • $) for some t £ {0,1}; (e,<|:ABt& -> i ^ & . F ^ • $) for some t £ {0,1}; ($AB, j / 2 # -> <#, (ABj/2 • a+ • #)* • ABy2 • a+ • k • Fy • $) for some *G{0,1}; ($ AB*# • (ABy2 • a+ • #)* • ABy2 • a+ • & • LFy*, y2V -> iV, flFy* • $) for some < G {0,1}; (\ABt# • (ABy2 • a+ • #)* • ABy 2 • a+ • k • LF;,y2A ->
352 1.14) 1.15) 1.16) 1.17) 1.18) 1.19) 1.20) 2.1) 2.2) 2.3) 2.4) 2.5) 2.6) 2.7) 2.8) 2.9) 2.10) 3.1) 3.2)
ttABt# • {ABy2 • a+ • # ) • • ABy2 • o+ • & • LF*,y2$ -> *$, s) for some* G {0,1}; ( < M 5 , 2 / 2 & - M & , i V $ ) for some t e { 0 , 1 } ; (|>lBt& • LF*,y2V ->• iV, JJFy* • $) for some f G { 0 , 1 } ; {{ABtk • LF*,y2A -> M , i?Fy* • $) for some t G { 0 , 1 } ; ( ^ A B i & - I F y * , y 2 $ - > < $ , e ) for some t G { 0 , 1 } ; ( e , ^ B < # ->• ^ 5 # , {ABy2 • a+ • # ) * • ABy2 • a+ • k • F^ • $) for some t G { 0 , 1 } ; {e,\ABtk^\Bk,F^%) for some t G { 0 , 1 } ; C o m m e n t : Instructions (1.1) to (1.20) realize Step (1.). {\A#-{ABy2-a*•#)*,ABx2a ^ ABy2,a*-{#ABx2-a+)*-k-F^-%)] 2 2 (<M# • {ABy • a* • # ) * • ^ 5 y • a* • k • RF*,x2a -+ y 2 , LF r * • $); 2 2 (e, M # -»• *, ( ^ I / • a* • # ) * • A 5 j / • a* • k • Fy • $); {\Ak-RF;,x2a-*y2,LF;-$); {e,\Ak-^\,Fy-%); (^5#-(AJBs2-a*-#)*,AS2/2a^^JBa;2,a*-(#A52/2-a+)*.&.F^$); ( ^ 5 # • {ABx2 • a* • # ) * • ABx2 • a* • k • RF*,y2a -»• a;2, LFy* • $); {s,\B#-+\,{ABx2 -a* • # ) • - A f l ^ . a * - & - F r - $ ) ; {$Bk-RFZ,y2a->x2,LF* •$)• (gr,«|:J3& —»• «j:, i ^ •$); C o m m e n t : Instructions (2.1) to (2.10) realize Step (2.). ( e , | i i V i 2 V i 3 A -> $, { 0 , 1 , -., V, A}* • $), where tut2,t3 G { 0 , 1 , -i0, - i l } such t h a t at least one of t h e m is 1 or -ifj; if w — (j;ti V t2 V t3$, where t\, £2, *3 G { 0 , 1 , -i0, - i l } such t h a t at least one of them is 1 or ->0, t h e n halt and A C C E P T .
In instruction (1.1) a value to G {0,1} is chosen for the variable VQ. Then in instructions (1.2) to (1.4) each occurrence of C{VQ) in the encoded formula is replaced by to from left to right. Instruction (1.9) ends this part. Next using instructions (2.1) to (2.2) each occurrence of x2a is replaced by 2 y . In this way each remaining variable V{ is renamed into f,-_i. Then a value is chosen for the new variable vo (the former vi), which is now encoded as y2. This continues until a value has been chosen for all variables. Finally, instructions (3.1) and (3.2) check whether the formula evaluates to 1 under the chosen assignment. The regular constraints ensure t h a t the instructions are executed in the intended order, and also they are used to check that the input is of the correct syntactic form. Also this proof is completed by an example computation of M, for which we choose the input from Example 1:
353
=
qo$ABx2#ABx2a#ABx2a2#ABx2a3kx2a3
(
-^
g04;ABO#ABx2a#ABx2a2#ABx2a3kx2a3
(
-^
qo$w$
V • • • V -nx2a3i V • • • V -x2a3$
qni;A#ABx2a#ABx2aa#ABx2aa2kx2a3
V • • • V -^2a3$
3
(
qdA#ABv2#ABv2a#ABv2a2kx2aa2
-^
( -^ (
q04;A#ABy2#ABy2a#ABy2a2ky2a2 q^ABy2#ABy2a#ABy2a2ky2a2
-^
( (
V• • • V iAa2J
^ 4 ' q0$ABl#ABy2a#ABy2a2ky2a2 2
^l'
2 2
V y2V • • • V V v V a
2 2
2
$
2
g0$ABl#ABy a#ABy a ky a
(11?)
V • • • V -y2a2$ V• • • V Va2$
V 1 V • • • V-1 V V a $
q0i;B#ABy2a#ABy2aaky2a2
V 1 V -n/ 2 a A -.j/ 2 a 2 V - a V -.j/ 2 a 2 $
2
qo\B#ABx2#ABx2aky2aa
V 1 V -.j/2a A -^y2aa V -il V -iy2aa3
4
q0$B#ABx2#ABx2akx2a (2
8
V 1 V -.a:2 A -.z 2 a V-.1V -.s:2a$
^ n j j l R^2„P _„,2 2 2 2 \ / 1 w _^,2 1 . g_ 0 l^-B£^#ylBx a&a;^2„ a V 1 V -^x A -.z,2„2 a wV_ i-.1v,V ->x ai
)
4
r
q0$AB0#ABx2akx2a
V 1 V -.a;2A-.3;2a V - . l V -.x 2 a$
-*^
q0$ABO#ABx2akx2a
V 1 V - 0 A -.;c2a V - 1 V -^x2a%
W
9oM#^lBx^o&a; 2 a V 1 V-.0A-ia; 2 a V-.1 V-.a; 2 a$
-^
qni A#ABy2kx2a
-^
q0$A#ABy2ky2
(
(
(
-^
(
^f
V1V-.QA - ^ a V -.1 V -.a 2 a$ V 1 V -.0 A -.y 2 V -.1 V -.y 2 $
?oi^y!&!/2VlVnOAVVnlvV$
goMB0&i; 2 VlV-0AVv-.lvV$ 2
^
go^AEOfcO V 1 V -iQ A ^0 V -nl V V $
{1
~^f gojABOkO V 1 V -.0 A -.0 V -.1 V ^0$
(
^
}
{
V 1 V --0 A -.0 V -.1 V -.0$
^V
gpcbO V 1 V -.QA-.Q V - . l V -.0$
(
g o ^ O V - 1 V^0$ ACCEPT.
-^ '
(3 2)
4
g^BkO
Conclusion
The class CSL of all context-sensitive languages contains the language
D
354
L cs := { x#w | £ is a binary encoding of a context-sensitive grammar, and w is a binary encoding of a string from the language generated by the grammar encoded by x. }. This language is complete for the complexity class PSPACE under log-space reductions (see, e.g., [7] Theorem 13.11). Thus, PSPACE coincides with the closure of CSL under log-space reductions, that is, PSPACE = LOGCSL. Thus, Observation 1 yields the following implication. Observation 2 / / CSL is contained in LOGRRWW, then NP = PSPACE. Thus, it is highly unlikely that each context-sensitive language is log-space reducible to some language that is accepted by an RRWW-automaton. However, we do not even have a candidate for a context-sensitive language that is not accepted by any RRWW-automaton. It may be the case that £(RRWW) = CSL is a consequence of the equality NP =: PSPACE, showing that these two equalities are equivalent, but we do not have a proof for this, either. On the other hand it is known that GCSL is contained in LOG-CFL [4]. As CFL is contained in GCSL, this yields that LOGGCSL = LOG-CFL holds. Thus, by applying the closure under log-space reductions to the chain of inclusions CFL C GCSL C £(RRWW) C CSL, we obtain the following chain of well-known complexity classes: LOG-CFL = LOGGCSL C LOGRRWW =NPC
LOGCSL = PSPACE,
where the strictness of each inclusion is a well studied, open problem in Complexity Theory. Finally the strictness of the other inclusions in (1) also remains open. Thus, an investigation of the computational power of the RWW-automaton is called for. References 1. G. Buntrock, F. Otto, Growing context-sensitive languages and ChurchRosser languages, Information and Computation, 141 (1998), 1-36. 2. R.V. Book, Grammars with Time Functions, PhD thesis, Harvard University, Cambridge, Massachusetts, February 1969. 3. G. Buntrock, Wachsende kontext-sensitive Sprachen, Habilitationsschrift, Fakultat fur Mathematik und Informatik, Universitat Wiirzburg, July 1996. 4. E. Dahlhaus, M. Warmuth, Membership for growing context-sensitive grammars is polynomial, Journal of Computer and System Sciences, 33 (1986), 456-472.
355
5. M.R. Garey, D.S. Johnson, Computers and Intractability. A Guide to the Theory of NP-Completeness, Freeman, San Francisco, 1979. 6. A.W. Gladkij, On the complexity of derivations for context-sensitive grammars, Algebri i Logika Sem., 3 (1964), 29-44. In Russian. 7. J.E. Hopcroft, J.D. Ullman, Introduction to Automata Theory, Languages, and Computation, Addison-Wesley, Reading, M.A., 1979. 8. P. Jancar, F. Mraz, M. Platek, J. Vogel, Restarting automata, in Fundamentals of Computation Theory, Proceedings FCT'95 (H. Reichel, ed.), Lecture Notes in Computer Science 965, Springer-Verlag, Berlin, 1995, 283-292. 9. P. Jancar, F. Mraz, M. Platek, J. Vogel, On restarting automata with rewriting, in New Trends in Formal Languages (G. Paun, A. Salomaa, eds.), Lecture Notes in Computer Science, 1218, Springer-Verlag, Berlin, 1997, 119-136. 10. P. Jancar, F. Mraz, M. Platek, J. Vogel, Different types of monotonicity for restarting automata, in Foundations of Software Technology and Theoretical Computer Science, 18th Conference, Proceedings (V. Arvind, R. Ramanujam, eds.), Lecture Notes in Computer Science, 1530, Springer-Verlag, Berlin, 1998, 343-354. 11. P. Jancar, F. Mraz, M. Platek, J. Vogel, On monotonic automata with a restart operation, Journal of Automata, Languages and Combinatorics, 4 (1999), 287-311. 12. R. McNaughton, P. Narendran, F. Otto, Church-Rosser Thue systems and formal languages, Journal of the Association for Computing Machinery, 35 (1988), 324-344. 13. G. Niemann, F. Otto, The Church-Rosser languages are the deterministic variants of the growing context-sensitive languages, in Foundations of Software Science and Computation Structures, Proceedings FoSSaCS'98 (M. Nivat, ed.), Lecture Notes in Computer Science, 1378, Springer-Verlag, Berlin, 1998, 243-257. 14. G. Niemann, F. Otto, Restarting automata, Church-Rosser languages, and representations of r.e. languages, in Developments in Language Theory Foundations, Applicationss, and Perspectives, Proceedings DLT 1999 (G. Rozenberg, W. Thomas, eds.), World Scientific, Singapore, 2000, 103-114. 15. G. Niemann, F. Otto, Further results on restarting automata, submitted for publication, August 2000.
This page is intentionally left blank
357 A D E F I N I T I O N OF P A R I K H C O N T R O L L E D C O N T E X T - F R E E G R A M M A R S A N D S O M E P R O P E R T I E S OF T H E M
T A I S H I N Y. NISHIDA Faculty
of Engineering, Toyama Prefectural University Kosugi-machi, Toyama 939-0398, Japan E-mail: n i s h i d a @ p u - t o y a m a . a c . j p S H I G E K O SEKI Department of Computer Science California State University Fresno Fresno, CA 93740, U.S.A. E-mail: s e k i @ c s u f r e s n o . e d u
A new controlled context-free grammar, called Parikh controlled context-free grammar, is defined. Such a grammar has a control function which maps the Parikh vector of the current sentential form to the set of productions to be applied to the current sentential form. It is shown that the family of languages generated by Parikh controlled context-free grammars coincides with the family of recursively enumerable languages. Some restricted Parikh controlled grammars are considered as well as their generative power.
1
Introduction
One of the authors (T.N.) has introduced the concept of a word length controlled DTOL system [3]. It might be natural to also consider a "word length controlled context-free grammar" in which the production to be applied to the current sentential form is selected according to the length to the sentential form. We bring, however, a more general but not more complex control mechanism to context-free grammars. A Parikh vector of a word w is a vector over nonnegative integers, each component of which is the number of occurrences of a letter in the word w. We define a Parikh controlled context-free grammar which consists of a context-free grammar and a control function. The control function maps from the Parikh vector of the current sentential form to a set of productions to be applied to the current sentential form. So "Parikh control" includes "word length control" because a Parikh control function can compute the length of a word by adding all components of the Parikh vector. The motivation of introducing a Parikh controlled context-free grammar is purely theoretical. We consider the notion of Parikh control as a generalization of that of random context with appearance checking [1]. In Parikh control, the production to be applied is selected according to the numbers of occurrences of
358
letters in the current sentential form while in random context grammars with appearance checking numbers which affect the selection of the production are restricted to either 0 (does not appear, or forbidding context) or any positive integer (appears, or permitting context). The intuition that the family of languages generated by Parikh controlled context-free grammars includes the family of languages generated by random context context-free grammars with appearance checking is proved formally in Theorem 2. Since one of the main concerns of the formal language theory is to find a language generative device whose power lies between context-free and contextsensitive grammars (see, e.g., Preface of [1]), we consider a few restricted Parikh controlled context-free grammars and Parikh controlled regular grammars. A bounded Parikh controlled context-free grammar has a control function whose value is always the empty set if at least one argument corresponding to the nonterminal is more than a given number (identically, the number of occurrences of each nonterminal is bounded by a given number). A terminal independent Parikh controlled context-free (or regular) grammar has a control function whose domain is the set of Parikh vectors over occurrences of nonterminals only. In Section 4 we will examine the size of families of languages generated by restricted Parikh controlled context-free and regular grammars. 2
Preliminaries
We assume that the reader is familiar with basics of formal language theory, see [2] or [4], We denote by W the set of all nonnegative integers. For a set X, the cardinality of X is denoted by \X\. Let V be an alphabet and let w be a word in V*. The length of w is denoted by |tu|. For a letter a £ V, \w\a is the number of occurrences of a in w. For a subset U C V, \w\u is defined by
\w\u = X] H"Let V — {ax,..., an} be an alphabet whose elements are ordered as a\,..., and w b e a word over V. The Parikh vector of w under the ordering a\,..., which is denoted by [w]v, is the n-dimensional vector given by [w]v = (\w\ai,..
an an,
.,\w\an).
For a word w, alph(w) is the set of letters occurring in w. A word u is a subword of w if there are x, y £ V* such that w = xuy. A word u is a super-word of w if there exist x,y £V* such that u = xwy.
359
We denote regular, context-free, context-sensitive, and recursively enumerable grammars by RG, CF, CS, and RE, respectively. For a class X of grammars, the family of languages generated by elements of X is denoted by C(X). We use the notion and some results about random context grammar, which are described below. Definition 1 (Definition 1.1.6 of [1]) A random context grammar is a system G = {V, T, P, S), where V, T, and S are as in a usual Chomsky grammar, and P is a finite set of random context rules, that are triples of the form
(a-+ft,Q,R), where a —> ft is a rewriting rule over V LIT and Q and R are subset of V. For t i , « £ (V U T)*, we write u =>o V if and only ifu = u'au", v = u'ftu", for some u',u" 6 ( V U T ) * , (a —• ft,Q,R) is a triple in P, all symbols of Q appear in u'u", and no symbol of R appears in u'u". The language generated by the grammar G is defined as L{G) = {w\w<=T* and S =>*G w}. T h e o r e m 1 ( T h e o r e m 1.2.5 of [1]) The family of languages generated by random context context-free grammars coincides with the family of recursively enumerable languages. 3
Parikh Controlled Grammars
First we define a Parikh controlled context-free grammar and its derivation. Definition 2 Let G = (V, T, P, S) be a context-free grammar and let f be a total recursive function from Wn to 2P where n = \V U T\. The pair (G, f) is said to be a Parikh controlled context-free grammar or PcCFG for short. For every « , » £ (VUT)*, (G,/) directly derives v from u if u = u\Aui, v = uiau2, and A-+ae
/(H(VUT))-
We denote u =>( G j) v if (G, / ) directly derives v from u. The reflexive and transitive closure of^^aj) is denoted by =>1G ,y The language L(G,f) generated by (G, / ) is defined as L(G,f)
=
{weT*\S=>lGJ)w}.
Here is a simple example of a PcCFG. Example 1 Let (G, / ) be a PcCFG where G = ({S, A, B, C}, {a, b, c}, {5 -+ ABC, A ->• aA\e, B -»• bB\e, C -> cC\e},S)
360
7(1,0,0,0,0,0,0)=
{
{S^ABC} {A -> aA, A ->• e)
if i = j = k
{B^bB} {C —> cC} 0
ifj = kandj = i - l if i = j and k = i — 1 otherwise
/(o,o,i,i,i,i,fe) = ( f ^ £ >
*/* = ; = *
[0 /(0,0,0,l,M,fc)=(f^ [ !t)
otherwise ^ = i = ^ otherwise
f(u, x, y, z,i,j, k) = 0 /or oiner combinations (u,x,y, z, i,j, k) 6 II 7 . Tnen c/ear/y L{G, f) = {aibici \ i > 0}. A PcCFG (G, f) is called a Parikh controlled regular grammar or PcRG for short if G is a regular grammar. Since there is only one context-free but regular production in Example 1, a slight modification gives an example of a PcRG which generates the language {a'blc% \ i > 0}. Example 2 Let (G, f) be a PcRG where G = {{S, A, B, C}, {a, b, c}, {S -> A\e, A -> aA\B, B -> bB\C, C -» cC|£}, 5) anc? /(I,0,0,0,0,0,0)= { 5 - » A S - » e } / ( 0 , 1 , 0 , 0 , i, 0, 0) = {X -+ cM, , 4 - ^ 5 } {£-•&£} «/i>j / ( 0 , 0 , l , 0 , i , j , 0 ) = {{B^C} zfi = j 0 «/i<j {G^cC} ifi>k f{0,0,0,l,i,i,k)= { {C ->£} z/z' = & 2/i < &
/ ( u , x, y, z, i, j , k) = 0 /or oi/ier combinations (u, x, y, z, i,j, k) £ E . .Again clearly L(G, f) — {a*6V | i > 0}. Theorem 2 and Corollary 3 show the maximum generating power of PcCFG's. Theorem 2 For every random context context-free grammar G, there exist a context-free grammar G' and a control function f such that L(G) = L(G', f).
361
Proof. Let G = (V,T,P, S) be a random context context-free grammar and let V = {Ai,. ..,An}, T= {ai,...,am}, and P = {{Ai -> 0,Q,R)\Ai
eV,0
€ {V\JTY,QCV,RC
V).
Let G' — (V, T, P', S) be a context-free grammar where P' = {Ai -> p\{At
-+ P,Q,R) e P}.
Now we construct / by: For (Ai - > / 3 , Q , U ) e P where Q = {Aqi,..., Aqk} and R = { A r i , . . ., Ar,}, f(Si,..., Sn, x\,. . ., a;m) contains Ai —•>• /? if and only if
fc > o,
follows from the fact that for every u,v G
u =>G u iff w =>(G'j) v,
(1)
and (1) is, in turn, shown by u =^G v iff u = u'Aiu", v = u'(3u", and 3(A,- ->• /?, Q, i?) € -P, Q C alph(M'w"),-Rnalph(u'w") = 0 iff .Aj —> /? G f",
[M](VUT) = (Si, • • •,
S.t., <5; > 0,5 ?J > 0 (1 < j < k),Sr} = 0 (1 < j < I) i^Ai^/3ef(S1,..., iff u =>(G'j) v. So the proof is completed.
•
Corollary 3 £(PcCFG) = £(RE). Proof The assertion follows immediately from Theorems 1 and 2.
•
4
Bounded and Terminal Independent PcCFG's and PcRG's
In this section we define and consider bounded and terminal independent PcCFG and PcRG. Definition 3 A PcCFG (G, f) where G = {V, T, P, S) with \V\ = n and \T\ = m is said to be c-bounded if there exists a positive integer c such that for every vi,.. .,v„,xll.. .,xm £ M / ( « ! , . ..,vn,xi,...,
xm) ^ 0 implies vt < c for all i.
362
A PcCFG is called bounded if it is c-bounded for some c. A PcCFG (G,f) is said to be terminal independent if for every x\,... x[, • • •, x'm, vx,..., vn G H, f satisfies f(vi,...,vn,xi,...,xm)
=
,xm,
f(vi,...,vn,x'1,...,x'm).
We denote bounded, terminal independent, and bounded and terminal independent PcCFG (resp., PcRG) by b,PcCFG, ti,PcCFG, and b,ti,PcCFG, respectively (resp., b,PcPiG, ti.PcRG, and b,ti,PcRG). Now we show a series of propositions which describe the relations among families of languages generated by bounded and/or terminal independent PcCFG and PcRG and by grammars in the Chomsky hierarchy. T h e o r e m 4 £(RE) = £(ti, PcCFG). Proof. The theorem follows from the observation that the PcCFG constructed in the proof of Theorem 2 is terminal independent. • P r o p o s i t i o n 5 (i) For every PcRG (G, f), there exists a b,PcRG (G, / ' ) such thatL(G,f) = L(G,f). (ii) For every terminal independent PcRG (G, / ) , there exists a regular grammar G' such thatL(G,f) - L{G'). Proof, (i) Obvious. (ii) Let (G = (V,T,P,S),f) where \V\ - n and \T\ - m be a terminal independent PcRG. We observe that for /(i>i,..., vn, x%,..., xm) = Q, if n
!=1
then the domain of / cannot appear in any derivation; and if n
then the domain of / cannot appear in the left side hand of any derivation. Now we construct a regular grammar G' = (V, T, P', S) where P' is given by P' -
U
f(vi,.--,vn,xi,...,xm).
We note that every domain of / appearing in the union of the above equation satisfies that for some l<j
363
Proposition 6 There is a bounded and terminal independent PcCFG which generates a language not in C(CF). Proof. Let (G = {{S, A0, A0, Au Au B0, B0, Blt S i } , {0,1}, P, S), / ) be a bounded and terminal independent PcCFG in which P and / are given by: P = {S ->• A0B0\AiBi,Ao
-> i 0 0 | A i O , i 0 -» A 0 |e,Ai -»• i 0 l | ^ i M i -» 4 i | e ,
So ^ S o O l B ^ B o ^ 5o|e,Si ^ - B o l | S i l , B i - > 5 i | £ }
/ ( l , 0,0, 0,0,0,0,0,0,z,y) = /(0,1,0,0,0,1,0,0,0,1,1/) = /(0,0,1,0,0,1,0,0,0,z,y) = /(0,0,0,0,1,1,0,0,0, x,y) = /(0,0,0,1,0,0,0,1,0, z,y) = /(0,0,l,0,0,0,0,l,0,z,y) = /(0, 0,0,0,1,0,0,1,0,z,y) = /(0,0,l,0,0,0,l,0,0,z,y) = /(0,1,0,0,0,0,1,0,0,^,2/) = 7(0,0,0,0,1,0,0,0,1,1^) = /(0,0,0,1,0,0,0,0,1,*^) = /(0,0,0,0,0,0,l,0,0,z,y) = /(0,0,0,0,0,0,0,0, l,x,y) = / ( « ! , U 2 , « 3 , « 4 , « 5 , « 6 , "7, MS, « 9 , « , 2/) =
^Ar Bi] {S-+A0B0,S {Ao -» Ao0,At -+ A 0} {Bo - > 5 0 0 } {Bo ^ B i O } {Ai -> A0l,Ai ->A
L1}
{Bi ^B01] {Bi - • B i l } {Ao -> Ao,A0 - > £ } {Bo -+Bo] {Ai -+AuAi
-+e}
{Bi ^ 5 i } {B0 ->£} {Bi ^6} 0 otherwise,
where the arguments of / are the numbers of occurrences of 5, AQ , Ao, A\, A\, Bo, 5 0 , - B i , B i , 0 , l from left to right. Then clearly L{G,f) = {»t« | w G {0,1}+}. D
Theorem 7 For etiery bounded and terminal independent PcCFG ( G , / ) , there exists a linear bounded automaton M such that L(G,f) — L(M), that is, £(b,ti, PcCFG) C £ ( C S ) . Proof. Let (G = (V,T,P,S),f) be a c-bounded and terminal independent PcCFG. Since (G,f) is bounded and terminal independent, the computation of / is expressed by a finite table and hence is done in the finite control of a linear bounded automaton M. For every w £ L(G,f) and every sentential form u appearing in the derivation of w, u satisfies |u| < |UJ| + c\V\ because (G, / )
364
is c-bounded. So every derivation by (G, / ) is simulated by a nondeterministic Turing machine with linear space. • The next lemma says that bounded and terminal independent PcCFG over a unary alphabet can generate unary regular language only. L e m m a 8 For every bounded and terminal independent PcCFG (G, / ) whose terminal alphabet is unary, there exists a regular grammar G' such that L{G, / ) = L(G'). Proof. Let (G = (V, {a}, P, S), f) be a c-bounded and terminal independent PcCFG where V = {S = X\,X^, • • • ,Xn}. We construct a regular grammar G' = (V, {a}, P', S") as follows: n
V = {[ii,..., in] | ij G M, 0 < ij < c^ij
> 1}
i=i
5 , = [1,0 ) ...,0], and for every Xi —>• a 6 f(v\,..., [vi,...,vn]
provided [a]vu{a} = (pi,.. . ,pn,l)
vn, x), P' contains [v'x,...,v'n]al
->•
and vr + pr
ii r ^ i
vr — 1 + pr
if r = i '
P ' also contains [•yi,..., vn] -> a' if iij- = 1, vr — 0 for r ^ «', and a = a1. Since V is a finite set, G' is a well defined left-linear grammar. • T h e o r e m 9 There is a language L which is generated by a bounded PcCFG and by a context-sensitive grammar such that L cannot be generated by any bounded and terminal independent PcCFG. Thus £(b, ti, PcCFG) C £(CS). Proof. The language L = {a 2 " | 0 < n) is CS but not CF. The bounded PcCFG (({S}, {a}, {S -> Sa,S ->• a},S), f) where / is given by }[
_ r{S-+Sa,S-»a} 'X> ~ \{S-^Sa}
f{y,x)=9
ify^l
ifz = 2 " - l f o r s o m e n > 0 otherwise
365 generates L.
•
T h e final theorem in this section shows t h a t there is a language in £ ( C S ) — £ ( b , P c C F G ) . It is an open problem whether £ ( b , P c C F G ) C £ ( C S ) or not. T h e o r e m 10 There is a context-sensitive erated by any bounded PcCFG.
language L such that L cannot
gen-
Proof. Let L — {wn | 2 < n,w £ {0,1}*, w is obtained from (01) fc by replacing one 1 with 0 and one 0 with 1, i.e., w has H a m m i n g distance 2 from (01)fc and the same number of occurrences of O's and l ' s for 2 < k}. Let us assume t h a t there is a bounded P c C F G (G = (V,T,P,S)J) such t h a t L(G,f) = L. Let r =
m a x \a\. X-+a£P
For every wn £ L and every / satisfying 1 < / < n\w\, there exists a sentential form u such t h a t / < | « | < I + r and 5 =>\G t\ u =>1G t\ wn. Because (G, / ) is bounded, say c-bounded, u has at most c\V\ occurrences of nonterminals. So u can be written as U = U^XyUx • • -XmUm where UQ • • • um £ {0,1}*, Xi,.. .,Xm £ V, and m < c\V\. Since every w; is a subword of wn and w has the same number of occurrences of O's and l ' s , the occurrences of O's in u; differs at most 3 from the occurrences of l ' s in it,- for every u; (i = 1 , . . . , m). Then there are at most TVo = ( c + l ) ' v l 7 c | ^ l possible Parikh vectors of u, where the factor ( c + 1 ) ' ^ ' corresponds t o the nonterminals and the factor 7c| V| corresponds to the terminals. Let no and ko be integers satisfying no > c\V\ and iVo < |Lo| where LQ = {w | w has H a m m i n g distance 2 from (01)fc° and has the same number occurrences of O's and l ' s }. For sufficiently large /, every sentential form u satisfying / < \u\ < / + r, S =>*(G f\
u
^ ( G f) u>n, w £ Lo, and n > no, is factorized u = UQX\UI
• •
-Xmum
such t h a t some w; is a super word of w. Since the cardinality of the set of Parikh vectors of such w's is at most iVo, there exist u and u' such t h a t [uWuT) = [w'](i/uT), u ^ ( G f) w"> u' ^ ( G f) w'n' a n c ^ w 7^ w'• ^ u * u' ^ a s * n e s a m e derivation as u because u' has the same Parikh vector as u. So u' derives a word which has b o t h w and w' as subwords. This is a contradiction. •
366
5
Conclusion
We have defined Parikh controlled context-free and regular grammars and some restricted versions of them. The relationship among the families of languages generated by these grammars and the Chomsky hierarchy is stated in the next theorem. PcCFG = ti,PcCFG
b,ti,PcCFG
RG = ti,PcRG = b,ti,PcRG Figure 1. Relationship among families of PcCFG's, PcRG's, and the Chomsky hierarchy.
Theorem 11 The families C(x, y, PcCFG), C(x, y, PcRG), £(RE), £(CS), £(CF), and £(RG) (where x = e or b and y = s or ti^ satisfy the relationship shown in Figure 1, where solid lines stand for proper inclusions, dashed lines stand for open problems conjectured to be incomparable, and '?' stand for open problems conjectured to be proper inclusions.
367
Proof. The theorem is proved by Theorems 2, 4, 9, and 10, Propositions 5 and 6, and Corollary 3. • Besides the open problems shown in Figure 1, the standard language theoretic problems, closure properties under language operations, decision problems, computational and descriptional complexities, and so on, are upcoming issues on PcCFG and PcRG. References 1. J. Dassow, G. Paun, Regulated Rewriting in Formal Language Theory, Springer-Verlag, Berlin, 1989. 2. J. E. Hopcroft, J. D. Ullman, Introduction to Automata Theory, Languages, and Computation, Addison Wesley, Reading, 1979. 3. T. Y. Nishida, Word length controlled DTOL systems and slender languages, in Jewels are Forever. Contributions on Theoretical Computer Science in Honor of Arto Salomaa (J. Karhumaki, H. Maurer, G. Paun, G. Rozenberg, eds.), Springer-Verlag, Berlin, 1999, 213-221. 4. A. Salomaa, Formal Languages, Academic Press, New York, 1973.
This page is intentionally left blank
369 W O R D S , DYCK PATHS, TREES, A N D
BIJECTIONS
HELMUT PRODINGER The John Knopfmacher Centre for Applicable Analysis and Number Theory Department of Mathematics, University of the Witwatersrand P. 0. Wits, 2050 Johannesburg, South Africa E-mail: h e l m u t @ g a u s s . c a m . w i t s . a c . z a In [l] the concept of nondecreasing Dyck paths was introduced. We continue this research by looking at it from the point of view of words, rational languages, planted plane trees, and continued fractions. We construct a bijection with planted plane trees of height < 4 and compute various statistics on trees that are the equivalents of nondecreasing Dyck paths.
Personal reminiscences about Gabriel Thierrin Gabriel Thierrin invited me to London, Ontario, for six weeks in February/March 1982. My memories about that trip are still very much alive since it was my first crossing of the Atlantic ocean, and I was a very inexperienced traveller at t h a t time, and everything was new to me. Snow storms, arctic temperatures, clear blue skies, frozen sidewalks! I had the opportunity to visit Waterloo, to give a talk, and to see the Niagara falls, and to learn t h a t C a n a d a has best proportion of great rock bands versus total population. I am only guessing, but I think t h a t Gabriel Thierrin was the referee of [4] and was attracted by the combination of formal languages and other m a t h e m a t i c a l concepts, perhaps not the standard ones in this context. I always liked the concepts of words, languages, g r a m m a r s , and a u t o m a t a , but I also wanted to see t h e m in a wider context, mostly in a combinatorial one. This is still true today, when I only occasionally b u m p into some (formal) languages. Gabriel Thierrin invited me to his house several times, and he and his wife were extremely friendly and helpful. Once, he gave a party, and David Borwein also attended. Later in life I met his sons J o n a t h a n and Peter. We also wrote the paper [5] together. I remember much more, more than about any other trip I guess, but perhaps I should rather stop here. In the technical part of this paper, I want to demonstrate a charming interplay of Dyck paths (related to Dyck words, of course), certain rational languages and their associated generating functions (being best described as continued fractions), and some families of trees. The form of the generating functions cries
370 out for bijections, and they are described in the sequel. Several characteristic parameters are also counted.
1
Introduction
In the paper [1], the Italian authors come up with the lovely new concept of nondecreasing Dyck paths. Dyck words are geometric renderings of Dyck paths where an open bracket is coded by an upward step, and a closing bracket by a downward step. The condition "nondecreasing" means roughly t h a t the sequence of the altitudes of the valleys must be nondecreasing. We prefer to think about it in terms of planted plane trees; there is an obvious and well-known bijection,
[2,6].
\ Figure 1. A nondecreasing Dyck path with valleys indicated and the corresponding planted plane tree
In honour of one of the authors, we decide to call the corresponding trees Elena trees, or simply Elenas".
Figure 2. A typical Elena; the short lines indicate paths of various lengths
In [1] the generating function of nondecreasing Dyck p a t h s of length 2n was already found to be . _3~1 \-2 • We find it practical also to include the empty path, which gives us z(l-z) +
l-3z + z
_ 2
l-2z
~~ 1 - iz + z 2 '
"In the literature, there are also Patricia trees (tries).
371 Since the length 2n corresponds to an Elena of size (=number of nodes) n + 1, we find the generating function of Elenas as E(z) = 2_, [number of Elenas of size n] zn = n>0
zi-\
J.
_
2?\
r .
oZ ~J~ Z
Now here is an easy argument to see that directly. We use the letter p to describe an arbitrary path of length > 1 and the letter a which means 'advance to next node on the rightmost branch'. Then the set of Elenas £ is given by the symbolic equation (a rational language) £ = (ap*)*a . Now mapping a H z and p continued fraction form
H- J-ZTJ
(1)
we find the generating function in the nice
E(z) =
-
.
11
1- z The continued fraction form suggests a relation to planted plane trees of height < 4; a bijection is constructed in the next section. The following sections consider average values of several simple parameters of Elenas. For simplicity, we give only first order asymptotics, but explicit values (in terms of Fibonacci and Lucas numbers) and also variances should not be too hard to obtain. Then we deal with the harder problem of the average height of (random) Elenas of size n. We will use the number a = 1 - y 5 frequently in this paper, since it is prominent in the asymptotics of Fibonacci numbers (and thus also Elenas). 2
A Bijection
The continued fraction representation for E(z) is well known in tree enumeration; it enumerates the set of planted plane trees with height < 4 (compare, e.g., [2,6]). Now we will describe a bijection between Elenas and those trees. We start from the representation (ap*) a and give an alternative interpretation of the words in this set as height restricted trees. First, a path with n nodes (coded by p n ) will be interpreted as a root, followed by n — 1 subtrees of size 1. Then, a word ap .. .p will be interpreted as a root, followed by subtrees given by the p's.
372
•'As Figure 3. Interpretation of a path with 5 nodes
I
I
I
I
r~^
I
r~—i
Figure 4. Interpretation of a a p p p p ; the boxes are the interpretations of the respective paths
Finally, the last a will be the root, and the ap .. .p's become subtrees of it. Figure 6 describes the process.
Ii==)l
|i==i|
li==)l
lt==)l
Figure 5. Interpretation of a (ap*)(ap*)(ap*)(ap*)a; the boxes are the interpretations of the respective (ap*)'s; the last a serves as the root
Figure 6. Interpretation of ( a p 5 P 3 P i ) ( a p 4 ) ( a ) ( a p 3 P i P i ) a ; p , stands for a path with i nodes
Geometrically, one rightmost branch of an horizontal position and the root. The attached
can imagine the process as follows. We consider the Elena, take its right node as a root, move the rest into rearrange the edges so that the nodes are successors of paths are then rearranged as described.
373
aaaa
A
•
•
Elena Height restricted
apiaa
ap2a
aapia
apipia
A A A -A A*
- \
A\ •
Figure 7. The bijection exemplified on trees with 5 nodes
3
Average Degree of the Root
We use a second variable u to label the degree of the root and obtain easily
T(z,u) = z +
z
uz(l - 1z) uz 1 — 3z + z2 11 -z
To compute the average value, we have to differentiate T(z, u) with respect to u and then to set u = 1. This yields
z\\-zf
•x-T(z,u)
ou
„ = i ~ ( l - 2 ^ ) ( l - 3 z + z2)
Around the (dominant) singularity z — 1/a 2 we have z2(l-z)2 ( l - 2 z ) ( l - 3 z + z2
5-V^
1 1 - ZQ2 '
10
so that
5-V5
zHl-z) ( l - 2 z ) ( l - 3 z + z2
•m
z(l-2z)
l - 3 z + z2
V1
In
75 ' "
the average degree of the root is asymptotic to 3
~V
,„
10
= 2.618033989
374
4
Average Number of Leaves
Replace a 4 z and p i-» -^ in (1) and multiply the whole thing by u to get the bivariate generating function
zu
1
1- z z{\ — 5z + 8z2 — 3z3) Differentiate w. r. t. u, then set u — 1 to get —-— — -. Around the (1 — 3z + z Y singularity z = l/a2 we have z{l-5z + 8z2 - 3 z 3 ) - 2 + V5 1 ( l - 3 z + z2)2 5 (1-za2)2 ' so that ^(l-5z + 8z2-3;3) L* J (l-3z + .2)2
-2 + 75 5—
ni
2„ n
"
Since
m *(!-2*) J L I ] ^ 2
L J
l-3z + z
V
V5
the average number of leaves is asymptotic to 4 = = 0.4472135956 n. 5
Average Number of Paths
Replace a ^ z and p >->• ^ J _ t 0 get the bivariate generating function
z
1
zu 1- 1- z Differentiate w. r. t. u. then u — 1 yields 3
[z n ]-
z (l — z) —- ~ 1 -3z + z 2 \ 2
—2 + -\/5 n o ".
z3(l-z)
(1 - 3z +
r-x. Hence zly
Thus the average number of paths is
375
asymptotic to -^= = 0.4472135956 n. 6
Average Number of Nodes 'a'
Replace a ^ z u and p i->- j ^ to get the bivariate generating function zu 1 1
\~z z(\-2z)2 Differentiate w. r. t. u, then u = 1 yields -—
^rz- Hence
( 1 - 3 2 + Z2)2
1
z(l-2z)2 J ( l - 3 z + z2)2
7-3\/5 10
2n
Thus the average number of a's is asymptotic to 5 — \/5 —n = 0.2763932022 n . As a corollary, we get that the average number of nodes lying in paths is asymptotic to _ ^ / l n = i±^ n = 0.7236067978 n . 10 10 And furthermore the average number of nodes in one path is asymptotic to
5 + V5
In
l + VZ
. „,„„,„„„„
— n / —y= = — - — = 1.618033989 . 10 / V5 2 7
Number of Descendants
The number of descendants of a node is the size of the as the root. The paper [3] deals, e.g., extensively with to know the average number of descendants. This is an Elenas, and the nodes in an Elena. Thus it is meaningful t/)(i) ;=
2> v a node of t
subtree with this node this subject. We want average over both, the to define for an Elena t
[number of descendants of v]
376 and
:=Y^zltlu i,(t)
D(z,u)
tee then we find the desired average as -\zn\-K-D{z, u)\ .. Now we want to derive a functional equation for this function D(z, u). Of course we follow the general decomposition (1). The contribution of each path attached to the root is ^zmw(m2+1) .
Q{z,u)=
m>l
T h e contribution of the root is zun, which is handled by first neglecting it and then substituting zu for z. Altogether we find D(z,u)
zu D(zu,
= zu
u)
1 — Q(zu, u)
Now let us differentiate this w. r. t. to u and plug in u = 1. We can also use the special values D(z,l)
= E{z)
and
^ ( z , 1)
=
{\ =
^ +
**
as well as and Q(z> !) = "j -jrQ{z, 1— z az
1) = T: ^ and j-Q{z, (1 — zy ou
1) =
^ . (1 — z)A
T h e resulting equation contains only one unknown function, -^D(z, Maple solves it as d ^-D(z,u) Ou
u)\ _., and
z{\ - 7 z + 20z 2 - 2 6 z 3 + l l z 4 )
7 - 3\/5
1
(l-z)(l-3z+z2)3
10
( 1 - ^ a 22 )\ 3
u=i
'
Hence 7 - 3 ^ n
ou
u= l
10
2n
2"
Dividing this quantity by the asymptotic equivalent for the total number, (l — - | = ) a 2 n , we get the average number of descendants as
5-75 20
n = 0.1381966011 n.
377 8
N u m b e r of A s c e n d a n t s
The number of ascendants of a node is defined to be the number of nodes on the p a t h of the node to the root. It is also called the depth. And the sum over all depths (summed over all nodes in the Elena) is called the path length. It is very similar to the area, studied in the paper [1]. However, it is quite easy to see t h a t the average number of ascendants equals the average number of descendants: Consider two nodes i and j such t h a t i lies on the path from the root to j . Then i appears in the count of j of the number of ascendants, and j appears in the count of i of the number of descendants. Since these quantities are summed over all nodes, we are done. (This argument is general and not restricted to Elenas.) 9
A v e r a g e H e i g h t of E l e n a s
T h e recursion £ = a + (ap*)£ translates into E — z + i J ^ ' - E 1 and also into the recursion for Eh, the generating functions of Elenas of height < h,
E h
_ -
Z +
z(l -z) l - 2 z +
z>Eh-1'
Denoting the generating functions of Elenas of height > h by [//,, we find by taking differences + zh)Uh = \ _
(l~2z
3
'
2
+ *(1 - *)Uh-i
•
We find the average height as
[z-]E(z) Now define U(z,w)
:= J2h>0
Uh (z)wh.
Summing up we get
(l-2z)U(z,w)+U{z,zw) 2z(l - z)(l - 2z) z3w(l-z) V = —\ ^ ^ + 7 „w ^ r +WZ(1V l - 3 z + z2 ( l - 3 z + z2)(l-u)z) The instance w = 1 is of special interest; [l-3z
+
zz)U{z,l)+U{z,z)
z ( 2 - 6 z + 5z 2 ) l - 3 z + z2
;
Z)U(Z,W) K) '
378
From this we see that U(z,\) has a double pole at the dominant singularity z = A := 1/Q 2 . Since for all h > 0 TT (A
A 1 ( ~2A) 1 - 3 Z + 22
A(1-2A) 1 we infer that U(z, z) ~ — Hence y 1 A 1 3 2 + 7z22 ' 1-A l-3z + 47-21^ 1 7-3\/5 1 W(z,l) ( l - 3 z + z2)2 10 (1-za)2 and [^"]^,1)~7 Dividing this by (l equivalent
^na2".
|=)a2™, we find for the average height the asymptotic
~ 10
3
n = 0.2763932022 n .
Conclusion
For the reader's convenience we collect our findings in a small table. References 1. E. Barcucci, A. Del Lungo, S. Fezzi, R. Pinzani, Nondecreasing Dyck paths and ^-Fibonacci numbers, Discrete Mathematics, 170 (1997), 211-217. 2. N. G. De Bruijn, D. E. Knuth, S. O. Rice, The average height of planted plane trees, in Graph Theory and Computing (R.C. Read, ed.), Academic Press, 1972, 15-22. 3. C. Martinez, A. Panholzer, H. Prodinger, Descendants and ascendants in random search trees, Electronic Journal of Combinatorics, 5, R20, 1998. 4. H. Prodinger, Congruences defined by languages and filters, Information and Control, 44 (1980), 36-46. 5. H. Prodinger, G. Thierrin, Towards a general concept of hypercodes, Journal of Information and Optimization Sciences, 4 (1983), 255-268. 6. R. Sedgewick, P. Flajolet, An Introduction to the Analysis of Algorithms, Addison-Wesley, 1996.
379
Degree of root
Number of leaves
Number of paths
3 + v^ 2 n
71 n
7!
Number of nodes on rightmost branch
5 - 75 io n
Number of nodes in paths
5 + V5 io n
Number of nodes in one path
Number of ascendants
Number of descendants
1 + ^5 2
5-V5 20
U
5 - VE 20
n
5-\/5 n 10
Height Table 1. Several averages on Elenas
This page is intentionally left blank
381 SEMILATTICE AMALGAMS A N D SEMIDIRECT
PRODUCT
STUART A. RANKIN The University of Western Ontario Department of Mathematics London, Ontario, Canada E-mail: srankinGuwo .ca
1
Introduction
T h e semidirect product of groups (in the category of groups) is well known because of its importance in the theory of group extensions. As well, the semidirect product of a semilattice by a group acting as a group of semilattice automorphisms plays an i m p o r t a n t role in the structure theory of inverse semigroups. In particular, the P-semigroup construction of D. B. McAlister [2] is closely related to the semidirect product, and Ross Wilkinson [4] has shown t h a t every inverse semigroup is an idempotent-separating homomorphic image of an inverse subsemigroup of a semidirect product of a semilattice by a group acting as a group of semilattice automorphisms. Our objective in this paper is to introduce a family of semilattices which come equipped with a n a t u r a l group action, and to study the corresponding semidirect products. Instances of these inverse semigroups can be found in [1] and [3], for example. 2
Semilattice Amalgamation
We have discovered an interesting scheme for what amounts to the amalgamation of a collection of identical copies of a given semilattice T over a subsemilattice A of T, such t h a t the result is again a semilattice. A case of particular significance occurs when T is a chain. T h e following notation will be used throughout. For any nonempty subsets A and B of a semilattice E, we write A < B if a < b for every a £ A and b £ B. T h e o r e m 1 Let A be a semilattice, A1 a subset of A, and Au = A \ A ' . Further, suppose that I is a nonempty set such that for each i £ J, we have a semilattice Ti and a homomorphism tp, : I \ —y A, and for each i,j £ / , we have an isomorphism $ij : Ti —> Tj for which the following conditions are satisfied. (i) r,- n A = 0 for each i £ I. (ii) Ti n Tj = 0 for i,j £ I with i^ (iii) 6i j — i r . for each i £ / .
j .
382
(iv) (v) (vi) (vii)
Oi:jOjik = ei
(viii) A' < A" if A' ±%. Let $ = ((Jjg/ F,) U A, and define a mapping
If (3 // //
a,/3 € Ti for some i £ /, then a/3 is the product of a in F,. a, (3 £ A, then a(3 is the product of a and (3 in A. a £ $ \ A and f3 £ A, then [ (a
(M4) If a £ r,- and /? £ Tj for i,j £ / with i ^ j , then
{
a
if cup < p
P ifP
383 (i) a < (3 with either a,/3e A, or a,(3e T;. (ii) a G A , /? G 7;, and a < /fy>. (iii) of G Ti, (3 G A " , and aip < (3. L e r a m a 2 For each i G / , Pi is a partial order relation on F; U A making T,- U A into a semilattice for which r,- and A are subsemilattices. The product o / a £ Tj and S G A is given by , fa if acp r T < tf G A " ad = da = < . . . y (aipjd otherwise. Proof. Let i G / . Observe that (i) ensures t h a t P; is reflexive. To verify t h a t Pi is antisymmetric, suppose t h a t a, (3 G I\- U A are such t h a t a Pi (3 and (3 Pi a. If either a , / ? £ r,- or a , / ? G A , then a = /?. Otherwise, one of a , / ? belongs to Ti, the other to A. We may suppose without loss of generality t h a t a G r , so t h a t j3 G A . Then aip < (3 and (3 < aip, which is not possible. It follows now t h a t Pi is antisymmetric. It remains to verify t h a t P; is transitive. Suppose t h a t a,/?, 7 G T; U A are such t h a t a Pi (3 and (3 Pij. If a,/3,7 G F; or a , / 3 , 7 G A, it follows from (i) t h a t aPij. Suppose now t h a t a, (3 G I\- but 7 G A . Then a < (3 and /?? < 7 G A " . Since ip|r is a homomorphism, we have Q<^ < /?y> < 7 G A u , and so by (iii), aPij. Next, suppose t h a t a,j G I \ and /? G A. Then aip < /? G A " and /? < 79?, from which we obtain aip < fcp. By Theorem 1 (vi), we have a < 7, and so by (i), aPif. Now suppose t h a t a G rsand /?,7 G A . Then ay? < /? G A " and (3 < 7. By Theorem 1 (viii), we have 7 G A u and so it follows from (iii) that aPif. Next, consider the case when a G A with P,f G IV Then a < f3tp and /? < 7. As in the second case, we have /?y> < 7 ^ and so a < 7?, and so aPij by (ii). If a, 7 G A and /? G Tj, then of < (3p < 7 and so a < 7, whence a P; 7 by (i). Finally, suppose t h a t a , /? G A and 7 G T;. Then a < j3 < 'yip, and so 0 ^ 7 by (ii). T h u s in every case, a Pi (3 and (3 Pi 7 implies t h a t a Pi 7, whence P,- is transitive and thus a partial order relation on F; U A. We now prove t h a t any two elements of Tj U A have a meet equal to t h a t specified in the statement of the lemma. To begin with, consider a,f3 G T. It suffices to establish t h a t for any S G A, if S Pi a and 5 Pi (3, then 6 Piaf3. We have 6 < aip and S < (3
384 (3 Pi a and so the meet of a and /? is /?. Otherwise, neither (ii) nor (iii) holds, and certainly (i) does not hold, so a and /? are incomparable under Pi. We claim t h a t in this case, (aip)(P) is the meet of a and /?. Since (aip)/3 < aip, it follows from (ii) t h a t {a
aPfp.
L e m m a 5 For each i £ / , we have P ' | r
a UA
= P,-.
Proof. Let a,/? £ F, U A. Since P* C P ' , it suffices to show t h a t a Pl 0 implies a Pi p. Suppose t h a t a Pl p. First of all, consider the case when a £ T; and /? £ A. By L e m m a 4, we
385 have a f < f3if £ A " which, together with ftf = ft, establishes t h a t a P, ft by (iii). Next, consider the case when a £ A . By L e m m a 3, we have a = af < ftf. Either /? 6 A, in which case f3f = ft and so a Pi (3 by (i), or else /? £ Ti and then a Pi/? by (li). T h e last case occurs when both a, ft £ T,-. Let n £ N be minimal subject t o the requirement t h a t there exist a — 7 1 , 7 2 , - • • ,7n = ft in $ with 7i -P72 -P • • • PInSuppose t h a t n > 2. Then by the transitivity of P,- and the minimality of n, there exists j with 2 < j < n — 1 with 7,- ^ T; U A . Let j be the least such integer. Then fj-i £ Ti U A and 7j £ Tfc for some k £ / with & 7^ i. But then 7 , - ! P 7 ; implies t h a t 7 ^ £ ( r , - U A ) n ( I \ U A ) = A . Moreover, since 7j P 7 J + i , we must have 7 j + i £ T^ U A, whence 7 j _ i Pk ~lj Pj lj+i and so by the transitivity of Pfc, we obtain 7 j _ i Pkjj+i, contradicting the minimality of n. T h u s n < 2 and so a Pi ft, as required. • L e m m a 6 Pf is a partial order relation on $ . Proof. Since $ = (\JieJ I \ ) U A and P = U i g / P,- C P ' , reflexive, and it is transitive by definition. To verify t h a t P ' let a,/3 £ $ be such t h a t aPt ft Pl a. By L e m m a 5, we see consider only a £ T; a n d /? £ Tj for i 7^ j . B u t by L e m m a af ??< a
we see t h a t Pt is is antisymmetric, t h a t it suffices to 4, we would have D
L e m m a 7 The partial order relation P J makes $ w i o a semilattice with products as specified by (Ml), (M2), (M3) and (M4). Proof. Let a , / ? £ $ . Consider first the case when there exists i £ / with both a,/3 £ r,-. By (i) and the fact t h a t Ti is a chain, a and /? comparable by Pl. T h u s their meet exists and equals their product in r,-, as required for ( M l ) . Next, suppose t h a t both a, /? £ A . By (i) and the fact t h a t A is a chain, a and (3 are comparable by P ' , Thus their meet exists and equal their product in A, as required by (M2). We now consider the case when j3 £ A but a £ Ti for some i £ / . By L e m m a 4, we have a Pl /? if and only if af < (3f = /? £ A " , and if a P ! /?, then their meet exists and is equal to a. Suppose now t h a t a P ' / ? does not hold. Then by L e m m a 5 and L e m m a 2, we see t h a t (atp)P is the meet of a and ft in the subsemilattice Ti U A . Let 7 £ Tj, j ^ i, be such t h a t 7 P ' alpha and 7 ? ' /?. Then by L e m m a 4, we have jf
386
is equal to (a(p)(f3ip). Let 7 £ $ be such that 7 Pt a and 7 Pt (3. By Lemma 3, we have j(p < (aip)(f3p). If 7 G A, then 7 = y
Symmetry and the Semidirect Product
As a consequence of the symmetry among the subsemilattices Ti of <E>, it is possible to extend any group action on the index set / to an action on $. The study of the resulting semidirect products is the focus of this section. Throughout this section, we shall assume that /, T;, A, A', ifi, and 6{j are fixed and satisfy the requirements of Theorem 1, and that
387 $ are as defined in Theorem 1. Furthermore, G shall denote a group with a fixed (left) action on I. Let e denote the identity of G. P r o p o s i t i o n 8 The action of G on I can be extended to an action of G on <3> by semilattice automorphisms as follows: y
1
otOil9i if a £ F,-
a
i/»eA.
Proof. For any a £ T;, we have ea = a#j?; since ei = i. By Theorem 1 (iii), we have aOi^ — a so ea = a. Thus e acts as the identity on $ . Next, let g,h G G and a G <3>. If a G A, then g(ha) = a = (gh)a. Otherwise, a G T; for some i G /• Let j = /»' and A; = gj. Then A; = <7(W) = {gh)i and so by Theorem 1 (iv), we have g(ha) = g(a0jj) = adijdj^ — aOij, = (gh)a. Thus the formula in the statement of the proposition does give an action of G on $. It remains to verify that the action is by semilattice automorphisms. Let a, /3 G $ and g G G. We must show that g(a/3) = (get)(g/3). We proceed case by case. Case 1: a,/? G A. Then a/? G A and so g(a/3) = <*/?= {ga)(g/3). Case 2: a,/? G I\ for some i G /. Then a/? G I\ and since 0,-iS,- : T, —»• r 9 , is a homomorphism, we obtain g(a{3) = (a/?)0ji9j = (aditgi)((39iigi) — (ga)(g(3). For the remaining cases, we shall make use of the observation that for i G / and 7 G Ti, (gj)
Now since g a G Tgj and gfj = f3 G A, it follows from (M3) t h a t g(afS) = Case 4: a G T;, /? G T j , i 7^ j . By (M4), we obtain
{
(ga)(g(3).
ga
if (fifa)v? = a
/?
if ( 5 /?)VP = /?y < ^
= {ga)ip G A "
{aip){j3ip) = (ga)ip(gj3)ip otherwise and since ga G Tgi, g/3 G r s j and i ^ j implies t h a t gi ^ gj, we obtain by (M4) t h a t 5 (a/?) = (<7a)(/?). T h u s each g G G acts as a semilattice automorphism of <3>. • Let $ x G denote the semidirect product of $ by G with the action described in Proposition 8. For o £ $ , the orbit of a will be denoted by G a , and the set of all orbits of <3> under the action of G shall be denoted by $ / G . T h e remainder of this section will be devoted to a study of the structure of $ xi G. We shall require some facts about Green's relations on certain inverse subsemigroups of $ x G. T h e following basic facts will be useful.
388
Lemma 9 ([2], 1.2) For (a,g),(/3,h) (i) (ii) (iii) (iv) (v)
E
(a,, 7 )- 1 = ( < r 1 a , < r 1 ) , (a, g) H (/?, h) if and only if a = j3, (a,g)£((3,h) if and only if g~la = h~l(3, (a, g) V (/3, h) if and only if Ga = G(3, J{a,g) < J(P,h) if and only if a < k/3 for some k G G.
Moreover, the semilattice £•($ xi G) of $ >
G y for all /? G Y}.
L e m m a 10 ([2]) Py = {(a,g) G $ x G | a,g~1a G 7 } /or any $-ideal Y. It is well-known that the restriction of Green's relations C and V, on an inverse semigroup to an inverse subsemigroup are just C and 7£, respectively, for the subsemigroup, and that in general this is not so for V. However, if Y is an ideal of «3>, then the restriction of the T> relation on $ x G to the inverse subsemigroup Py is the V relation on Py. L e m m a 11 For any idealY o / $ , VpY =V$-AG\P • Proof. Let V = V^^G- It is sufficient to show that V\p C VpY. Let (a,g),(P,h) G Py be Z>-related. By Lemma 9 (iv), we have a = k/3 for some k e G. Then (a,g)TZ(a,kh), and (kh)-ya = /i -1 /? G Y so (a,kh) G Py and (a,kh) £(f3,h). Thus (a,g)T>pY (f3,h), as required. • As one might expect, the symmetry of the semilattice $ should endow $ x G with some very special properties. Proposition 12 The semidirect product $ x G is completely semisimple. Proof. It is well-known that any inverse semigroup, and so $ x G in particular, is completely semisimple if and only if any two 2?-related idempotents are incomparable. Suppose that (a, e) V (/?, e) and (a,e) < (f3,e). Then Ga — G/? and a < /?. If a G A or j3 G A, then {a} = Ga = G/3 = {/?}. Otherwise a G T,-, (3 G Lj, for some i, j G /• Since a = g/3 for some G G, we have (jy = i and /30J- j- = a. Suppose that j ^ i. Then a < j3 implies by (M4) that a
JT — T>T- In partic-
389 Proof. Any inverse subsemigroup of <J> x G is completely semisimple.
•
When Y is an ideal of $ for which GY = $ , then the partial ordering on jT-classes of Py is the restriction to Py of the partial ordering on jT-classes of <3> x G. More precisely, we have the following observation. L e m m a 1 4 Let Y be an ideal of $ swc/i that GY — $ . isomorphic to ( $ xi G)/J.
Then Py j J
is order
Proof. Let /J be the mapping defined by A -> A D P y for A G ( $ xi G)/ J. We show first t h a t AnPy G P y / J - Let (a, e) G A. Then a G $ and G Y = $ so there exists g G G and /? G Y with #/? = a. T h u s G a = G/3 and so by Corollary 13 and L e m m a 9 (iv) we have A = J(a,e) — J(p,e)- But (/3, e) G Py and again by Corollary 13, we obtain (JpY)(p,e) = J(p,e)^Py — AnPy. T h u s p is a mapping from (<£ xi G)/J into Py/J. It is obvious t h a t /i is injective. From Corollary 13, it follows t h a t /i is surjective. To see that \i is order-preserving, suppose t h a t J(a,e) < J(P,e)- By the above argument, we may assume t h a t a , / ? G Y . By L e m m a 9 (v), we have a < g/3 for some g G G. Suppose t h a t Q / j a . Then a ^ A whence a G Tj for some i £ I, and j = gi ^ i. By Theorem 1 (v) and (M4), ga < f3 implies t h a t av? = ( a ^ , j ) ^ = (.9a) f < /3<£> G A " . If /3 G T;, then a < /? follows from Theorem 1 (vi), while if (3 ^ Tj, then a < (3 follows from (M3) or (M4). T h u s \i is order-preserving. Since it is obvious t h a t / i _ 1 is order-preserving, we have shown t h a t \i is an order-isomorphism. • In the event t h a t the action of G on the index set / is transitive, the partial ordering on (<& x G)/ J has a simple description. L e m m a 1 5 If the action of G on I is transitive, isomorphic to T,- U A for any i G I•
then ( $ xi G)j3
is order
Proof. Suppose t h a t the action of G on / is transitive and let i G / . Define a mapping /i : I \ U A —y ( $ xi G)/J by fi : a i-> J ( a i e ) . By Corollary 13 and L e m m a 9 (iv), we have J(a,e) = G a x G. To see t h a t fi is injective, let a,/3 G Tj U A and suppose t h a t i7(a,e) = <J{/3,e)- Then G a = G/3 and so a — g(3 for some g G G. If /3 G A, then a = g/3 = f3. If /? £ A , then /? G I\- and 5/? = /?0; ]3 ; = a 6 Tj so t h a t gi = i and we obtain a = gj3 = /?#,-,• = /?. T h u s /i is injective. Now let A G ( $ xi G)/J and choose (/?, e) G A, whence A = G/3 x G. Suppose t h a t (3 £ A . Then /3 G Tj for some j G / . Since G acts transitively on / , there is g G G with w e see t h a t yu is order-preserving. To show that n~l is also order-preserving, we proceed by cases. Let a,/? G I \ U A and suppose that J(a,e) < <J(/3,e)Case 1: a G A . Then »7(a,e) = { « } x G and thus ( a , e ) < (/?, e), whence a < (3.
390 Case 2: a £ T,. Then (ga, e) < (/?, e) for some g £ G. Let j = gi. If j = i, then a = ga < p. Otherwise, we have ga £ Tj and /? £ Tj- U A with i ^ j . By (M3) if/? £ A or by (M4) if /3 £ ]?;, we have (
an
d Pa be the principal gS(a)h~1.
' — {ga} x
' C {ga} x G. Moreover, (ga,k)
£
9,
Ha ' if and only if (ga, k) C (ha, e). By Lemma 9 (iii), the latter occurs if and only if k~lga = ha, or equivalently, k £ gS(a)h~l, as required. D C o r o l l a r y 17 For a £ $ with S(a)
— G, we have Qa = {e} and Hae'e
=
J(a,e) = {"} X G. Proof. By Proposition 16, we have Ha = { a } x G. Since Ga = { a } , we obtain by Corollary 13 and L e m m a 9 (iv) t h a t J(a,e) — {«} x G. • When 5 ( a ) ^ G, the description of Ja will involve the B r a n d t semigroup B(G,I).
P r o p o s i t i o n 18 For a £ <£ tuii/j 5 ( a ) 7^ G, £fte following
hold.
(i) 77ie mapping f (ga,gkh'1) x
' I 0
H-> (,fc,h)(g,heQa, H->0
ke
S(a))
391 is an isomorphism of Pa onto B(S(a),Qa)(ii) (Ja) = JaU Ja^, and Ja^ = {a
{g\ot)gikihXl)x(92tt,g2k2h2l)x in B(S(a),Qa).
^ 0
Moreover, when this is the case, then
({gia, gikih^1)(g2a,
g2k2h2l))x
= {gia, gikik2h^1)x (9i,kik2)h2) {gi,ki,hi)(g2,k2,h2) = {g\a,9ikihil)x{g2a,g2k2h2l)x-
Thus x is a n isomorphism. (ii), (iii): Observe that in the proof of (i), it was shown that if {git*,gikihi1)(g2a,g2k2h2~1)
£ Ja,
then their product is (af, gikih^1g2k2h^ x) G {a
= ({ga){gkh~1 (aip)),gkh~lgi)
£ {aip} x G
since S(a
= ((aip)(giha),gigkh~1)
£ {aip} x G.
392 Thus JaJa«> C Jav and JavJa C Jaip whence (Ja) C J a U J " " . Finally, since 5(a) 7^ G, there exists g £ G \ 5(a). Then for any /i £ G, we have (5a, e)(a, /i) = ((^a)a, /i) = (aip, h) as shown above since ga £ Tffi, a £ I\ and £fi ^ i. Thus {a^} x G C (Ja)2 and so we obtain (Ja) = Ja U J av> and J 0 ^ i s an ideal of (Ja). Finally, we have (Ja) /Jav
= (Ja U Jaip)/Jaip
S Pa.
The partial homomorphism Ja —>• J a¥> giving the ideal extension is given by (ga, x) H-y (a
For any r £ $ —A, S(T) is trivial, while for r £ A, S(T) = Z3. Furthermore, the action of X3 on itself (as the index set) is transitive, so by Lemma 15, $ xi G/J is order isomorphic to T U A, a four element chain. By Corollary 17, two of the four J'-classes are Js — {6} x Z3 and J f = {C} x Z3, while by Proposition 18, the remaining two ^7-classes are Ja = {00,01,02} x Z3 and
393 J@ — {/?o,/?i,/?2} x ^3- For the sake of simplicity, we have used the isomorphism described in Proposition 18 to represent the two Brandt j7-classes Ja and J® as £({0},Z3) (since Za — Qp = Z3, where we have suppressed the middle coordinate (since it is always equal to 0).
The formula for the partial order Jf>
(i,3)
(i,3)
(6,0)1
(6,1) i
/
J<
(d-j)
j6
(S,i-j)
Figure 2
References 1. P.R. Jones, Inverse semigroups whose full inverse subsemigroups form a chain, Glasgow Math. J., 22 (1981), 159-165. 2. D.B. McAlister, Groups, semilattices and inverse semigroups II, Trans. Amer. Math. Soc, 196 (1974), 351-370. 3. J. Meakin, One-sided congruences on inverse semigroups, Trans. Amer. Math. Soc, 206 (1975), 67-82. 4. R. Wilkinson, A description of i?-unitary inverse semigroups, Proc. Roy. Soc. Edinburgh, Sect. A, 95, 3-4 (1983), 239-242.
This page is intentionally left blank
395 CHARACTERIZATION OF FINITE AUTOMATA B Y T H E IMAGES A N D THE KERNELS OF THEIR T R A N S I T I O N FUNCTIONS TATSUHIKO SAITO Mukunoura 374, Innoshima Hiroshima, Japan, 722-23221 E-mail: [email protected]. jp
1
Introduction
By an automaton A, we mean here a 3-tuple (X,A,6), where X is a finite set (the set of states), A is a finite alphabet (the set of inputs) and 8 is a mapping of X x A into X (the transition function). As usual, A* and A+ denote the free monoid and free semigroup generated by A, respectively, and S is extended from X x A to X x A*. In this case, S(x, s) is denoted simply by xs for x £ X, s £ A* Let p = {(s, t) £ A* x A* : xs = xt for every x £ X}. Then p is a congruence on A* and A* jp is a finite transformation semigroup on X by defining the action of sp £ A* jp on X as x(sp) = xs. The semigroup A*jp is called the characteristic semigroup of A. Let V be a class of semigroups not necessarily a variety. Then an automaton A is called of the V-type if A+ jp £ V. For s £ A*, let im s = {xs : x £ X] = Xs and kers = {(x,y) £ X x X : xs = ys}, which are called the image and the kernel of s, respectively. Then ker s is an equivalence on X. Let V and U be two classes of semigroups. Then the direct product of V and U is defined by V x U = {V x U : V £ V, U £ U}. Let U £ U and let S be a semigroup. If for each s £ V, there exists Us £ U such that 5 = U{(7S : s £ [/} and Us • Ut — {usut : vs £ Us, vt £ Ut) C £A,t, then we say that 5 belongs to V(Z/), where U denotes a disjoint union.. As our start, we consider the following classes of semigroups: £?={groups}, CZ—{\eit zero semigroups [st = s]}, 7?.2={right zero semigroups [si = t]} and .S£={semilattices [st = ts,s2 = s]}. We first characterize, for the classes Q,CZ xQ,Q x TZZ and CZ xQ x 1ZZ, their types automata by the images and the kernels of their transition functions. By using the results, we characterize V(W)-type automaton in the same way, for V £ {SC, £Z,7ZZ} and U £ {G,CZ x G,g x 71Z,£Z x Q x TZZ}. As an example, we show later that an automaton A is a SC(CZ x (J)-type if and only if im st = im s fl im t for every s, t £ A+.
396
2
Preliminaries
For a set Y, \Y\ denotes the cardinality of Y, for an equivalence A, xX denotes the A-class containing x, |A| denotes the number of A-classes. i.e., |A| = \{x\ : x G X}\, and for s G A+, |s| denotes the length of s. Then clearly |im s\ = |ker s| for every s G A+. For s G A*, let fix s = {x G X : xs - x}. Let E(A+) = {e £ A+ : (e,e 2 ) G p}. Then it is easy to see that e G E(A+) if and only if im e = fix e, and that (ei f) £ P f° r e . / G •E'(^+) if a n d only if im e = im / and ker e = ker / . Since A+/p is finite, for every s G ^4 + , there exists a positive integer m such that sm G £(,4+). Lemma 1. Let s,t G v4+. Tnen (1) / / |ker st\ = |ker i|, iften im st = im i. (2) / / |im st\ = |im s\, then ker si = ker s. Proof. (1) Since |im st\ = |ker st\ = |ker i| = |im t\ and im st C im t, we have im st = im i. (2) is similarly proved. • Lemma 2. Let s G A+. Then the following assertions are equivalent: (1) im s fl sker s ^ 0 /or ewery i £ l , (2) im sm — im s and ker s m = ker s /or euery m G N + . (3) There exists e G £'(y4+) suc/i inai im s = im e, ker s = ker e, (s, se) G /» and (s, es) G p. Proof. (1) => (2). We use the induction on m G N+. Suppose that im sk — im s for k G N + . Clearly im sk+1 C im s. Let y G im s. Then y — xs for some x G X. Since im sfe fl sker s = im s n xker s / 8, we can take z G im sfc fl xker s. Then z = usk for some u G X and a;s = zs, so that y = xs = zs = usk+1 G im sk+1. Thus im s fc+1 = im s. From Lemma 1, it follows that im s = im s m if and only if ker s = ker sm. (2) =^ (3). For s G A+, let s m G ^ ( ^ + ) for some m G N+, and let e = s m . Then clearly im s = im e and ker s = ker e. Since (x,xe) G ker e = ker s, we have zs = xes, and since im s = im e = fix e, we have sse = xs. (3) <=> (1). Let x £ X. Since ze G im e = im s and (x, xe) G ker e = ker s, we have xe G im s fl a;ker s. D Lemma 3. The following assertions are equivalent: For every s,t G >t + , (1) im s fl sker t ^ 0 /or ewrj/ i f l , (2) im si = im t. (3) ker si = ker s.
397 Proof. (1) =>• (2) Let y G im !. Then y = xt for some x G X. Let z £ im s fl zker t. Then 2 = us for some « 6 l and zt — xt, so t h a t y — xt — zt = ust £ im s(. Therefore im t C im si. Clearly i m s i C im t. T h u s im st = im t. (2) =>• (3). Since |ker t\ = |im t| = |im st| = |ker st\ and since ker s C ker st, we have |ker t\ = |ker st\ < |ker s| and similarly |ker s\ < |ker t\, so t h a t |ker s| = |ker t\ = |ker st\. Therefore |im s\ = |im st|. By L e m m a 1 ker s = ker si. (3) =>• (2) is similarly obtained. (2) => (1). For i £ I , we have si! = j/st for some y £ X, Then ys G im s fl xkev t. • Let A = (X, A , J ) be an automaton, and let Y = U{im a : a £ A} and K = fl{ker a : a £ A}. Then we have Y = U{im s : s G A+} and K = fl{ker s : s £ A+}. In fact, if s G A + , then s = s'a = bs" for some a,b £ A,s's" £ A*, so t h a t im s'a C im a and ker b C ker 6s". Since Ys C Y for every s G A+, the restriction sy of s to Y can be defined. Let Ay = {ay : a G A}. Then the a u t o m a t o n _4y = (Y,Ay,S) is called the subautomaton of A with respect to Y. Let s,t £ A+ and x £ X. Since (xs)ty = (a;s)i, the action of sty on X is defined by x(sty) — x(st). Let K be as above. Define the action of s G A+ on X/K by (KK)S = ( I S ) K . Then the action is well-defined. In fact, if XK — yre, then (x, y) £ K C ker s, so t h a t z s = ys. When the action of s is on X/K, S is denoted by sK. Let AK = {a K : a G a}. Then the a u t o m a t o n AK = {X/K, A K , S) is called the automaton induced from A by K. Let s,t £ A+ and 2: G X. Then clearly (sker s)s = xs. Since K C ker s, we have (XK)S = xs, so t h a t ((xn)sK)t = ((XS)K)2 = (xs)t, T h u s the action of sKt on X is defined by x[sKt) = x(st). For an a u t o m a t o n A — (X,A,S), i £ / } , i.e., for each i £ I, Y,- = im for every s £ A+, and let A'er(>l+) Im(A+) — {im sK : s £ A+} - {Zt A+} = {/c^ : fi £ M'}. In this case, if and x £ X, then Im(A+) = Im(E(A+)) 3
let Im(A+) — {im s : s G A+} = {Y; : s for some s G ^4 + and im s £ Im(A+) + = {ker s : s £ A } = {K^ : fi £ M}, : i £ J'} and Ker(A^) = {ker sY : s £ im s fl xker s 7^ 0 holds for every s G A + and A e r ^ ) = Ker{E{A+)).
Main Results
A semigroup in CZ x Q is called a left group whose class is denoted simply by CQ, i.e., CQ = CZ x Q.
398 T h e o r e m 1. Let A — (X, A, S) be an automaton. Then the following statements are equivalent: (1) There exists a subset Y of X such that im a — Y and Y fl a;ker a ^ 0 for every a £ A and x £ X. (2) There exists a subset Y of X such that im s = Y for every s £ S. (3) A is of a left group type. Proof. (1) <=> (2) By induction on the length \s\ of s. Suppose t h a t i m s = Y for s £ A+ with \s\ = k. Then im sa C im a for every a £ A. Let y £ im a. Then y = xa for some x £ X. Since im s D xker a = Y fl a?K 7^ 0, let z £ im s fl arker a. Then za = xa and z = us for some w £ X, so t h a t we have y = xa = u s a £ im sa. Therefore im sa = im a = Y. T h u s i m s = 7 for every s £ (2) =>• (1) Let a £ A. Then clearly im a = Y. Since im a = im a m for every m £ N + , by L e m m a 1 ker a = ker am, and by L e m m a 2 im a fl sker a = Y flicker a / 0 . (2) => (3) Let s £ A+. Since 7 = Xs2 = XssY = YsY, the action of sY on Y is a bijection. Thus AY/p is a group. Let e, / £ i?(^4 + ) and let x £ X. Then are/ = xe, since are £ Y — im / = fix / , so t h a t E(A+)/p is a left zero semigroup. (Notice t h a t (s,se) £ p for every s £ A+,e £ E(A+).) By L e m m a 2, for each s £ A+, there exists e £ E(A+) such t h a t (s,es) £ p. Since (es,esy) £ p, we have (s, esY) £ p. T h u s A+/p - (E{A+) • A$)/p. Suppose that ( e s y , ftY) £ p for s,t £ A+,e,f £ E(A+), and let y £ Y. Since Y = im e = fix e and V = fix / , we have ysy = yesy = j//
E(A+)/pxAy/P££Zxg. (3) => (2). For s,i £ A+, there exist s ' , i ' £ A+ such t h a t ( s ' M ) £ p and {t's,t) £ p. Thus we have im s = im s't C im t, and similarly im 2 C im s. Consequently im s = im t for every s, t £ A + . • From Theorem 1 we obtain the following results C o r o l l a r y 1.1. An automaton A = (X, A, 8) is of SC{CQ)-type im si = im s fl im ( for every s,t £ A^.
if and only if
Proof. Suppose t h a t im st — im s n im t for every s,t £ A+. For Yi £ Im(A ), let Ay, = {s £ A : im s = Y{} and let s,t £ AYi. Then st £ AY>, since im st = im s fl im t = Y,. Thus by Theorem 1 Ayjp is a left group. Let s £ AYt and t £ AYj. Then im st = Yt n Y,- £ i m ( A + ) , so t h a t Im(A+) we nave is a D-semilattice. Since Ay, • Ayi C Ay^Yj t h a t A is a 5 £ ( £ £ ) - t y p e . +
399 Suppose t h a t A is a <S£(£(?)-type. Then we m a y assume t h a t A+ / p — \j{Ai/p : i G I}, where each Ai/p is a left group and I is a semilattice, i.e., i2 = i and ij = ji for every i, j G J, and where Ai • Aj C Aij. By Theorem 1, for each i £ / , there exists a subset Y; such t h a t im s = Y; for every s £ 4 ; . Let e G E(Ai) and / G -E^-Aj). Then Yij = im e / C im / = Yj similarly Yij C Yj, so t h a t Y;J C YJ fl Yj-. Since Yj = im e = fix e and Yj = fix / , we have Yi fl Y} C fix e / C im e / = Yij. Consequently im st = Y,j = Y8- fl Yj = im s f l i m t for every s,t G A + . • C o r o l l a r y 1.2. An automaton A — (X,A,S) im st = im t for every s , i £ A + .
is of HZ(CQ)-type
if and only if
Proof. Suppose t h a t im st = im t for every s,t £ A+. For Y,- G / m ( y 4 + ) , let Ai = {s G A + : im s — Yi}. Then .A,- • Aj C Aj for every i . j G / and by Theorem 1 each Ai/p G CQ. Thus A is of ftZ(££)-type. Suppose t h a t A is of TZZ(CG)-type. Then we m a y assume t h a t A+ /p = \J{Ai/p : i G / } , where each Ai/p is a left group, and Ai • Aj C Aj for every i,j G / . By Theorem 1, for each i £ / , there exists a subset Yi of X such t h a t im s = Yi for every s G A{. For s G Ai,t G A j , since si G Aj, we have im st = Yj = im t. • A semigroup in Q x 7?~Z is called a right group whose class is denoted by Tig, i.e., KG = g xTZZ. T h e o r e m 2. Let A are equivalent: (1) There exists for every a G A. (2) There exists (3) A is a right
= (X, A, S) be an automaton.
Then the following
assertions
an equivalence K on X such that ker a = K and im aClxK ^ 0 an equivalence K on X such that ker s = K for every s G A+. group type.
Proof. (1) =>• (2). Again we use the induction on the length of s G A+. Suppose t h a t kers = K for s G A+ with \s\ = k. Then ker a C ker as for every a G A. If (x,y) G ker as for x , j £ X , then (xa,ya) G ker s = ker a, so t h a t (K, J/) G ker a 2 . Since ker a2 = ker a by L e m m a 2, we have ker as C ker a. T h u s ker as = ker a = K. Consequently ker s = K for every s G A+. (2) => (1) can be shown similarly to the proof of Theorem 1. (2) =>• (3). Let e , / G £ ( A + ) and x £ X. Since (a;,a;e) G ker e = ker / , we have xef = xf. Thus E(A+)/p is a right zero semigroup. (Notice t h a t (s, es) £ p for every s G A + , e G i ? ( A + ) . ) If (KK)S K = (yn)sK for s G A + , £ , y G X , then (XS)K = (j/s)/c. Since (xs,ys) G K = ker s, we have ( x , y ) G ker s 2 = K, SO t h a t XK = yK, which shows t h a t the action of sK on X/K is an injection. Since \K\
400 is finite, it is a bijection. Thus A^/p is a group. For s G A+, let e 6 E(A+) with (s, se) G p. Since (se^^e) G p, we have (s,sKe) G p. T h u s A+/p = ( A + K - £"(A+))/V. Suppose that (sKe,tKf) £p for s , i G A + , e , / G E(A+). From the fact that ker e = ker se,ker / = ker tf and (se,tf) 6 p, using L e m m a 1 we obtain ( e , / ) G p, so t h a t (se,ie) G p. Therefore (xs,xt) G ker e = K for every £ G X, which shows t h a t (XK)SK — (XS)K = (xi)K = (xK)tK T h u s (sK,tK) G pFor s, i G A + , e, / G £ ' ( A + ) and t £ I , we have x(sKie)(tK,f) = xsetf = xstf = xstef = x(st)K{ef). Thus, A+//9 = A+/p x £ ( A + ) / p G Q x ftZ. (3) => (2). For every s,t G A+, there exist s ' , i ' G A+ such t h a t ( s i s ' ) G p and (i, si') G P- T h u s we have ker s C ker s i ' = ker t and similarly ker t C ker s. Consequently ker s = ker i for every s,t G A + . • C o r o l l a r y 2 . 1 . An automaton A = (X,A,S) ker si = ker s V ker t for every s,t G A + .
is of SC(JZQ)-type
if and only if
Proof. Suppose t h a t ker st = ker s V ker i for every s,t G A*- For K^, let v4« = {s G A+ : ker s = n^}. If s , i G AKf<, then st G A K ; j , so t h a t by Theorem 2 AKfi Ip is a right group. If s G AK and i G AKt/, then /c^ V K„ = ker s V A;er i = ker si G ker(A+), so t h a t Jm(^4+) is a V-semilattice and AKfi • AKli C A R/[ VK>/. T h u s A is a 5£(7£C/)-type. Suppose t h a t A is a SC(TZG)-type. Then we m a y assume t h a t A+ /'p = U{Afi/p : p. G M } , where each A^/p is a right group, M is a semilattice and A/i • Av C Ay.v. By Theorem 2, for each p G M , there exists an equivalence K^ such t h a t ker s — K^ for every s G A^. Let e G A^ and / £ A „ . Since KM = ker e C ker ef = KMi/ and similarly KU C K^,,, we have K^V K^ C K^,,. Let (a;, y) G K ^ = ker ef for x,y (E A + . Then (se,2/e) G ker / = KV. Since (x,xe),(y,ye) G ker e = K^,, we have K ^ „ C KM V «;„. T h u s KMi, = K^ V Kj,. Consequently ker si = ker s V ker i for every s,t 6 A + . • C o r o l l a r y 2 . 2 . An automaton A — (X,A,S) im st — im i / o r ef en/ s,f 6 A + .
is of CZ(1ZQ)-type
if and only if
Proof. By L e m m a 3, im st = im i if and only if ker st = ker i for every s , i G A+. Suppose t h a t ker st = ker s. For n^ G A ' e r ( A + ) , let A^ = {s G A + : ker s — K ^ } . Then A; • Aj C A; and, by Theorem 2, A j / p is a right group. T h u s .4isof£Z(7ea)-type. If A is of £Z(7£(?)-type, then we can show similarly to Corollary 2.2 t h a t ker st = ker s. • From Corollaries 1.2 and 2.2 we obtain: C o r o l l a r y 2 . 3 . An automaton type.
is ofTZZ(jCQ) type if and only if it is of
CZ{JIQ)
401 Remark. It can be easily show that CZ{CQ) - CZ(Q) = HQ and 112(110) =
nz{g)=ng. Theorem 3. Let A = (X,A,S) be an automaton. Then the following assertions are equivalent: (1) There exist a subset Y of X and an equivalence K on X such that im a — Y and ker a = K for every a £ A and Y fl XK ^ 0 for every x £ X. (2) There exist a subset Y of X and an equivalence K on X such that im s = Y and ker s = K for every s £ A+, (3) A is of a group-type. Proof. (1) <£> (2) follows from Theorems 1 and 2. (2) =*• (3). Let e , / £ E{A+). Then (e,/) £ /?, since im e = im / = Y and ker e = ker / = K. Thus |£(A+)/p| = 1. For s £ A+, let sm = e £ £(A+) for someTO£ N + . Then (ep)(sp) = (sp)(ep) = s/> and s m_1 /? is the inverse of sp. Thus A+ /p is a group. (3) => (2). For s £ A+, let (sp)'1 = s'p. Then for every t,s £ ,4+, we have sp = (st't)p = (tt's)p, so that im s = im si'i C im i and ker t C ker tt's = ker s, similarly im i C im s and ker s C ker t. Thus im s = im i and ker s = ker t for every s,t £ A+. • A semigroup of SC(Q) is called a Cliford
semigroup,
Corollary 3.1. An automaton A = (X,A,6) is of a Cliford smigroup type if and only if im st = im s Him t and ker st = ker s V ker £ /or every s,t £ A+. Proof. Suppose that im si = im s f] im i and ker st = ker s V ker £ for every s,t £ A+. For ( Y , , ^ ) £ 7m(A+) x t f e r ( A + ) , let A(Yi,Kll) = {s £ A+ : im s = Y; and ker s = K ^ } . By Theorem 3, A{yxK\jp is a group. From the results obtained in the proofs of Corollaries 1.1 and 1.2 we have that Im(A+) x Ker(A+) is a semilattice under (fl, V) and that A(yi|K ) • AryjKv) C -A^ny,-,* VR„)' Thus .4 is of 5£((/)-type. Suppose that A is of <S£(£)-type. Then we may assume that A+ fp — U{Ai/p : i £ I}, where each Ai/p is a group and / is a semilattice, and At • Aj C Aij. By Theorem 3, for each i £ /, there exist a subset Y,- of X and an equivalence K; on X such that im s = Y; and ker s = «;,-. for every s £ .A,-. Let e £ Ai and f £ Aj. Then similarly to Corollaries 1.1 and 2.1 we obtain that Yij = im e / = im e n im / = Yj n Yj and K;J = ker e / = ker e V ker / = «,- V Kj. Thus im si = im s fl im i and ker si = ker s V ker t for every s, i £ A+. • Theorem 4. Let A = (X, A,<5) 6e an automaton, and Let Y = U{im a : a £ A},K = n{ker a : a £ A}. Suppose that im s fl zker s ^ I /or euery s £ A+, x £ X. 77ien i/ze following statements are equivalent:
402 (1) A is of CZ xQ x TlZ-type. (2) ker sy = ker ty for every s,t £ A+. (3) im s K = im tK for every s,t £ yl+. Proo/. (1) => (3). We may assume t h a t A+ /p = {(i,g,p) £ / x G x M}, where / and M are sets and G is a group, and the multiplication is defined by (i,g,p)(j,h,v) = (i,gh,v). Then it is easy to see t h a t (st,set) £ p for every s,t £ A+ and e £ E(A+). Let e , / £ £ , ( / l + ) and x £ X . Since z e / s = xes, (xef,xe) £ ker s for every s £ A+, so t h a t (xef,xe) £ K, which shows t h a t (£/-c)eK/K = (xef)n = (xe)K = (x/c)e K . T h u s (eKfK,eK) £ /?, so t h a t im eK = im eKfK C im / K and similarly im fK C im eK. Thus im eK = im fK for every e,f £ £ ' ( A + ) . For s £ A + , let e £ ^(A"1") with im s = i m e and ker s = ker e. Let yK £ im s K . Then J/K = (XK)SK = (XS)K for some x £ X. Since im s = im e, we have xs = ze for some z £ X. Then we have yK = (XS)K = (ze)«; = (zK)eK £ im e K . T h u s im s K C im eK and similarly im eK C im sK, so t h a t im sK = im e K . Consequently im sK = im tK for every s,t £ / 1 + . (3) => (2). Let s,i £ A+,e £ E(A+) and z £ X. Then (a;K)sKeK = (XK)SK, since (XK)SK £ im sK = im eK = fix e K . T h u s we have xset = a;(sKeK<) = x(sKt) = xst, so t h a t (set,st) £ p. Let e,f £ £'(yl + ) and y £ Y. Then + y = xs for some s £ A ,x £ X . Thus we have yey fy = z s e / = K S / = yfy, so t h a t (ey fy, fy) £ p, Therefore we have ker ey C ker e y / y = ker fy and similarly ker fy C ker e y . T h u s ker ey = ker / y . For every s £ A + , there exists e £ £ , ( / l + ) such t h a t ker s = ker e.= Then clearly ker sy = ker e y . Consequently ker sy = ker t y for every s,t £ A + . (2) => (1). By Theorem 2, , 4 y / p is a right group. Let s,t £ ^4 + ,e £ -E(>1+) and a; £ X. Since (a;s, xse) £ ker ey = ker i y , we have xst = xsty = xesty = z s e i , so t h a t (st,set) £ p. If / £ .E^/l"1"), then (/, fef) £ /?, so t h a t im / = im fef C im ef C im / . Thus im ef = im f for every e, / £ J E , (T4 + ). For Y8- £ 7 m ( A + ) , let £ = {e £ E(A+) : im e = Y 8 }. Let e , / £ E. Since im e / = im / = Y,-, ef £ E, and since im ef = Y,- = im e, by L e m m a 1 ker ef = ker e, so t h a t (ef, e) £ p. Thus i?//? is a left zero semigroup. For s £ A+, let £ E(A+) with im s = im 5 and ker s = ker g and let e £ E. Then im ge = im e, so that ge £ E, and xgesy = xges = x^s = £s. Thus
A+/p=(E-A+)/p. Suppose t h a t (esy, fty) £ p for s,t £ yl + and e , / £ E. Let j / £ Y. Since (y,ye) £ ker ey = ker s y , we have ysy = yesy = yfty = yty, so t h a t (sy,ty) £ p. Since ( e s y , / s y ) £ p, we have z e s y = xfsy fo every £ £ X, so t h a t (a;e, xf) £ ker sy = ker e y . Thus we have xe = zeey = z / e y = xfe = x / , so t h a t (e, / ) £ p. For every s,t £ / l + and e,f €. E, we have a;(esy)(/£y) = s e s / t = zesi =
403 xef{st)Y
• T h u s A+/p
= E/p x A$/p
e CZ xTZQ = CZ x Q x TZZ.
C o r o l l a r y 4 . 1 . With the assumption of Theorem 4, the following are equivalent: (1) A is ofSC(CZ x g x TZZ)-type. (2) ker syty — ker sy V ker ty for every s , i E A+. (3) im s K i K = im sK fl im
• statements
Proof. (2) =^ (1). For K^ G A'er(,4+), let A K(j = {s G A+ : ker sy = K ^ } . Since, for s G AK(J and t G ^4K„, ker (st)y = ker syty = ker sy V ker < = K^ V K„ G A ' e r ( A y ) , we have Ker (Ay) ia a V-semilattice, and by Theorem 4 \ e £ 2 x ? x ftZ and AK„ • AKu C ^ v « „ - Thus .4 is of SC{CQTZytype. (1) => (2). We may assume t h a t A+ jp = \J{Afi/p : p G M } , where each ^W/? G £ 2 x £/ x ftZ, M is a semilattice and A^ • Av C A ^ . By Theorem 4, for each p G M , there exists an equivalence K^ on Y such t h a t ker sy = K^ for every s g ^ . Ler e G A ^ / i ) and / G E(AU). Then we obtain similarly to Corollary 2.1 t h a t K^ = ker ey fy = ker ey Vker fy — K^ V K„. Since, for every s G A + , there exists e G A ( / l + ) such t h a t ker s = ker e, so t h a t ker Sy = ker e y , we have t h a t ker syty = ker sy V ker Ty for s,t G J 4 + (1) •£> (3) can be shown similarly to Corollary 1.1. • Suppose t h a t an a u t o m a t o n A is of CZ x Q x TZZ-type. As is seen proof of Theorem 4, A+/p — {(i,g,p) : i G I,g G G, p G M } . For i £ p£M, let At/p= {(i,g,p) : g G G , p G M } and ^ = {(i,5,/i) :*' e 1,5 respectively. Then A j / p G 7££ and A^/p G £ £ • For sp = (i,g.v),tp — since (st)p = (i,gh,p), by Theorems 1 and 2, we have ker st = ker i m s i = i m ( . T h u s we obtain: C o r o l l a r y 3 . 2 . 7/ an automaton TZZ{CQ)-type. The converse is not
A is of CZ x Q x TZZ-type, true,
There is a simple example of an a u t o m a t o n of 1ZZ(CQ)-type CZxQ x TZZ-type.
in the / and G G}, (j,h,p), s and
then it is of which is not of
References 1. J.H. Howie, Fundamentals of Semigroup Theory, Oxford Science Publications, Oxford, 1995. 2. J.M. Howie, Automata and Languages, Oxford Science Publications, Oxford, 1991. 3. M. Petrich, Lectures in Semigroups, John Wiley and Sons, London, 1977. 4. T. Saito, Band-type acts over free monoids, manuscript, 2001.
This page is intentionally left blank
405 ITERATED MORPHISMS WITH COMPLEMENTARITY THE DNA ALPHABET
ON
ARTO SALOMAA Turku Centre for Computer Science, Lemminkdisenkatu 14, 20520 Turku, Finland E-mail: a s a l o m a a e u t u . f i
TUCS
Watson-Crick complementarity can be viewed as a language-theoretic operation: "bad" words obtained through a generative process are replaced by their complementary ones. This idea seems particularly suitable for Lindenmayer systems. DOL systems augmented with a specific complementarity transition, Watson- Crick DOL systems, have turned out to be a most interesting model and have already been extensively studied. In the present paper, attention is focused on WatsonCrick DOL systems, where the alphabet is the original four-letter DNA alphabet {A, G, T, C } . Growth functions and various decision problems will be investigated. Previously known cases about growth functions that are not Z-rational deal with alphabets bigger than the DNA alphabet, and it has been an open problem whether similar constructions can be carried out for the DNA alphabet. The main result in this paper shows that this is indeed the case.
1
Introduction
The idea of Watson-Crick complementarity is central in Adleman's initial experiment, [1]. The idea is also behind the computational universality of many models of DNA computing, [13,9]. DNA (deoxyribonucleic acid) consists of polymer chains, referred to as DNA strands. A chain is composed of nucleotides or bases. The four DNA bases are customarily denoted by A (adenine), C (cytosine), G (guanine) and T (thymine). A DNA strand can be viewed as a word over the DNA alphabet ^DNA = {A,G,T, C}. The bondage of two strands gives rise to the DNA double helix. The Watson-Crick complementarity comes into the picture in the formation of such double strands. The bases A and T are complementary, and so are the bases C and G. Bonding occurs only if the bases in the corresponding positions in the two strands are complementary. This can be described mathematically as follows. Consider the letter-to-letter endomorphism hw of T,*DNA defined by hw{A)
= T, hw{T)
= A, hw(G) = C, hw{C)
= G.
The morphism hw will be referred to as the Watson-Crick morphism. Then a DNA strand ar bonds with hw (#) to form a double strand.
406
Complementarity can also be considered as a tool in developmental models: undesirable conditions in a string trigger a, transition to the complementary string. We have in mind a class of bad strings, also referred to as a trigger. Whenever a bad string x is about to be produced by a generative process, the string hw(x) is taken instead of x. If the generative process produces a unique sequence of strings (words), the sequence continues from hw(x). Sometimes the class of bad strings satisfies the soundness condition: whenever x is bad, the complementary string hw{x) is not bad. Under such circumstances, no bad strings appear in the sequence. While the operational complementarity can be investigated in connection with any generative process for words, it seems particularly suitable for Lindenmayer systems, the systems themselves being developmental models. The simplest L system, namely the DOL system, has been thoroughly investigated, [10,11]. DOL systems can be augmented with a trigger for complementarity transitions, as described above. The investigation of such "Watson-Crick DOL systems" (see [7,8,14] for basics and [2,5,17,18,15] for further developments) has opened new views for the classical study of iterated morphisms, apart from being itself an interesting and natural branch of DNA computing. The following point should be observed. We have been speaking only of the four-letter DNA alphabet. In the general considerations about Watson-Crick DOL systems the alphabet will be of an arbitrary size. Indeed, one considers DNA-like alphabets E n = {ai, . . . , a„, ai, . . . , an}
(n > 1)
and refers to the letters a,- and a,, i = 1, . . . , n, as complementary. endomorphism h\y of E* defined by
The
hw(aj) = a,-, hw{a%) = a», i = 1, . . . , n, is also now referred to as the Watson-Crick morphism. The purpose of this paper is to return to the original DNA alphabet, and investigate Watson-Crick DOL systems over the alphabet {A, G, T, C}. It has been an open problem whether this basic setup is sufficient to create strange phenomena such as growth that is not Z-rational, [6,8,15]. This particular question will be answered positively below in Section 6. In spite of their seeming simplicity and very limited means of expression, our DNA systems are amazingly powerful in some respects. However, we do not want to enter into any speculations about the possible significance of this fact to evolution or DNA computing. We will use standard language-theoretic notation and terminology. If needed, [12] or [10] should be consulted. The paper is self-contained in the sense that all fundamental definitions about Watson-Crick DOL systems will be given.
407
2
Basics About Watson-Crick DOL Systems
Although we do not enter any discussion about Lindenmayer systems, the basic notion underlying our subsequent investigations is given in the following definition, for the sake of completeness. Definition 1 A DOL system is a triple H — (£,, w 0 ), where E is an alphabet, wo G E* (the axiom) and g is an endomorphism of E*. (In the sequel g is often defined in terms of productions, indicating the image of each letter.) A DOL system defines the sequence S(H) of words W{, i > 0, where u»,-+i = g{wi), for all i > 0. It defines also the language L(H), consisting of all words in S(H), the length sequence |tu,-|, i > 0, as well as the growth function f(i) = |u>i|. In view of Definition 1, it should be clear what is meant by the various equivalence problems for DOL systems. We now introduce the complementarity. Consider a DNA-like alphabet E n and the Watson-Crick morphism hw • A trigger TR is any recursive subset of E*. Definition 2 A Watson-Crick DOL system is a construct Hw = (H,
TR),
where H = (E n , g, WQ) is a DOL system, TR is a trigger and WQ € E* — TR. The sequence S(Hw), consisting of words W{, i = 0, 1, ..., is defined by the condition w.
_ihw{g{wi))\ig{wi)eTR, 1^ #(UJ;) otherwise,
for all i > 0. The language, length sequence and growth function of Hw are defined as in Definition 1. Definition 3 Given a Watson-Crick DOL system Hw, an infinite word r\V2 • • • over the alphabet {0,1}, referred to as the Watson-Crick road or briefly road of Hw, is defined as follows. Let Wi, i — 0, 1, ..., be the sequence of Hw • Then, for all j > 1, rj = 0 (resp. rj = I) ifwj = g(wj-i) (resp. Wj = hw{g{wj-i)))Thus, the road of Hw indicates the positions in the sequence, where complementarity transitions take place. If the road equals 0W, then no complementarity transitions take place. The road 00110'" tells us that in the sequence exactly 1^3 and W4 have been obtained by a complementarity transition. Definition 3 has been formulated for the needs of this paper. The reader is referred to [14] for a definition in a more general framework in terms of WatsonCrick graphs. Definition 4 A Watson-Crick DOL system is called stable if its road equals 0W. It is called ultimately stable if its road equals wO", for some (finite) word w.
408
The same equivalence problems can be formulated for Watson-Crick DOL systems as for ordinary DOL systems and, in addition, the problem of road equivalence: decide of two given systems whether or not they have the same road. The following theorem summarizes some decidability results. Detailed considerations concerning similar topics can be found from [14,8,5,15]. Theorem 1 Every ultimately periodic infinite binary word can be expressed as the road of a Watson-Crick DOL system with a finite trigger. The stability problem is decidable for Watson-Crick DOL systems with a regular trigger but undecidable for systems with a context-sensitive trigger. The road, growth, sequence and language equivalence problems are all decidable for Watson-Crick DOL systems with regular triggers but undecidable for systems with context-sensitive triggers. As obvious from the definitions and Theorem 1, the properties of a WatsonCrick DOL system are largely determined by the trigger. Clearly, in interesting cases the trigger is not too complicated. In a regular Watson-Crick DOL system the trigger is a regular language. In this paper, attention will be restricted to regular and standard systems. The latter will now be defined. The nucleotides A and G are purines, whereas T and C are pyrimidines. This terminology is extended to concern DNA-like alphabets: the non-barred letters a\, ..., an are called purines, and the barred letters a\, . . . , an are called pyrimidines. The language PYR consists of words where the pyrimidines form a majority. Thus PYR consists of words over the alphabet £ „ , where the number of occurrences of barred letter exceeds that of non-barred letters. Or, if we are dealing with the DNA alphabet, PYR consists of words w satisfying \w\{T,C]
>
\™\{A,G}-
(Thus, words containing equally many purines and pyrimidines are not in PYR.) Clearly, PYR is a context-free non-regular language. Definition 5 A Watson-Crick DOL system with the language PYR as its trigger is called standard. In many respects, PYR is a very natural choice for a trigger. It satisfies also the soundness condition mentioned in the Introduction. However, standard Watson-Crick DOL systems represent a vast extension of ordinary DOL systems. For instance, the growth function is not necessarily Z-rational, [8]. However, the known examples use alphabets bigger than the DNA alphabet. For standard Watson-Crick DOL systems, the decision problems problems mentioned in Theorem 1 are open and, indeed, closely linked, [8,14,15], with the well-known problem, [16,6,10], of deciding whether or not a given Z-rational sequence consists of nonnegative integers.
409
3
D N A Systems
We now come to the basic notion investigated in this paper. Briefly, a DNA system is a Watson-Crick DOL system, where the underlying DNA-like alphabet has two barred and two non-barred letters. Hence, we are back in the original DNA alphabet. We prefer using the DNA notation. The association of letters is understood as follows: a\ = A, a.2 = G, ai = T, a.2 = C. Observe that this conforms with the two definitions of the Watson-Crick morphism, as well as with the definition of purines and pyrimidines. Definition 6 A Watson-Crick DOL system over the DNA alphabet {A,G,T,C} is referred to as a DNA system. A DNA system whose trigger is a regular language (resp. the language PYR) is called regular (resp. standard,). Since DNA systems are a special case of Watson-Crick DOL systems, the definitions of the sequence, language, length sequence and growth function of the system, as well as the definitions of road and stability, carry immediately over to DNA systems. The next definition introduces a notion central in the considerations in Section 6 below. Definition 7 A Watson-Crick DOL system is termed weird if its growth function is not Z-rational. Z-rational sequences of integers can be defined in many ways. Intuitively a simple way is to consider a square matrix M with integer entries and read the sequence from the upper right corners of the powers M\ i = 1,2,3,... . Further discussion about Z-rational sequences and their different representations can be found in [16,10,6]. While examples of standard Watson-Crick DOL systems that are also weird have been presented earlier, [8,14,15], we will show in Section 6 the existence of such DNA systems. It is easy to give examples of regular or standard DNA systems that are stable, by making sure that a word in the trigger is never reached in the sequence. For instance, the standard DNA system with the axiom AC and productions
A-tAG,
G^G,
C->CT,
T^T
defines the sequence AC, AGCT, AGGCTT,
AGGGCTTT,...
AGnCTn,...,
where no complementarity transition takes place. Clearly, the system is stable and, thus, its road equals 0W.
410
The following standard DNA system H\ will be of interest for our theoretical considerations. The axiom is AGTC, and productions are A -» TC, G->C,
T-+G,
C-^AG.
Observe that purines produce only pyrimidines, and vice versa. When the right sides of the productions are replaced by their complementary ones, we get as the "purine part" A ->• AG, G-tG, and as the "pyrimidine part" T ->• C, C ->• TC. While the former gives rise to linear growth, the latter is the well-known system for (exponential) Fibonacci growth. In the sequence of H\ both parts appear intertwined. The beginning of the sequence is: AGTC, TCCGAG,
GAGAGCTCC,
and, further, CTCCTCCAGGAGAG,
AGGAGAGGAGAGTCCCTCCTCC,
TCCCTCCTCCCTCCTCCGAGAGAGGAGAGGAGAG. So far no complementarity transitions have taken place and, thus, only the morphism of the system (not composed with the Watson-Crick morphism) has been applied. This is because pyrimidines have never exceeded purines in number. Indeed, the pairs (u, y) indicating the number of purines and pyrimidines in a word are for the first ten words in the sequence as follows: (2,2), (3,3), (5,4), (7,7), (12,10), (17,17), (29,24), (41,41), (70,58), (99,99). In spite of the alternating role of purines and pyrimidines in the productions, stability seems to prevail. This will be established in the next section. 4
Stability
It has been shown in [5] that the road of a regular Watson-Crick DOL system is ultimately periodic and, moreover, effectively contructable. The following results concerning regular DNA systems are immediate or almost immediate consequences. The following notion is defined in the general case. Clearly, the road of a DNA system equals either 0U, in which case the system is stable, or else O^IJE, where k > 0 and x is an w-word, in which case (following [15]) we refer to the number k + 1 as the transition point of the system. Thus, the transition point of a system indicates the position of the first bit 1 (if any) in the road of the system. For instance, the transition point of the standard DNA system defined by the axiom AC and productions
A-tT,
T->\,
G-¥G,
C^C
411
equals 1. (Observe that the language {AG, AC, TG, G] generated by the system is not a DOL language.) An upper bound, depending only on the size of the alphabet and the cardinality of the state set of the minimal finite automaton accepting the trigger, was given for the transition point of a regular Watson-Crick DOL system in [15]. Consequently, we obtain the following result. Theorem 2 Stability and ultimate stability are decidable for regular DNA systems. An upper bound, depending only on the cardinality of the state set of the minimal finite automaton accepting the trigger, can be given for the transition point of a regular DNA system. In connection with Lindenmayer systems it is customary to consider also schemes: a scheme is simply a system without the axiom. This idea can be readily extended to concern DNA systems. A DNA scheme is called universally stable if every system resulting from the scheme by adding an axiom is stable. All axioms turning a given regular Watson-Crick DOL scheme unstable were effectively characterized in [15] as a finite union of regular languages. This implies the next result. Theorem 3 Universal stability is decidable for regular DNA schemes. We still define the notion of the delay of stability. If the system is stable (resp. not ultimately stable), the delay of stability is 0 (resp. oo). If the system is ultimately stable but not stable, its road is of the form wlQu, where \w\ — k, in which case k + 1 is defined to be the delay of stability. Theorem 4 The delay of stability is effectively computable for regular DNA systems. Proof. The construction given in [5] can be applied almost directly. Consider a DNA system H with the axiom WQ, morphism g and regular trigger TR. We associate to the two morphisms g and ghw the letters 0 and 1 of the binary alphabet {0,1}, respectively. (In this proof we read compositions of morphisms from left to right, to be an accordance with the customary way of reading input words for a finite automaton. Thus ghw indicates that we apply first g and then the Watson-Crick morphism.) The association is extended to concern words over the binary alphabet and compositions of the two morphisms mentioned. Thus, the word 01101 is associated to the composition gghwghwgghw • Since the language (^(TT?) is regular, it is an old result due to [3] that the language
R=
{xe{o,iy\{Wo)xeg-1{TR)}
is accepted by a finite deterministic automaton A. For a state q and input word x, denote by qx the state where A goes from q by reading x. Let go be the initial state and F the set of final states of A. An infinite word wr = i\i-2,h . . . is now
412 defined by the condition , J
_ (0 '+1~\1
if q0ii • • -ij £ F, if9oii...«i€F.
Here j > 0, and «o is understood as the empty word. Observe t h a t qoh ...ij£F
<^=^
(w0)ii
...ijQe
TR
and, consequently, wr constitutes the road of H. (On the right-hand side of the equivalence the characters 0 and 1 stand for their associated morphisms.) Thus, when we have found a repetition of states of A in the sequence qoii • • • ij, j = 1 , 2 , . . . , we have characterized the road and, hence, the theorem follows. • In the rest of this section we will consider standard DNA systems. When PYR is the trigger, m a t t e r s become very involved. Indeed, ultimate stability is undecidable for standard Watson-Crick DOL systems, [18]. For standard DNA systems, most of the central decision problems remain open. On the other hand, because of the limited expressive power of the four-letter alphabet, interconnections with the problem of positiveness of Z-rational sequences are not the same as in case of general alphabets, [8,15]. Consider, for instance, the transition point. No upper bound analogous to the one given for regular systems in the second sentence of Theorem 2 is possible for standard systems. For instance, consider standard systems with the productions
A->A,
G->G,
T->T,
C^CT,
and axioms of the form AmC, m > 1. All such systems are ultimately stable, but the transition point and delay of stability can be arbitrarily large. We now illustrate the techniques and constructions possible for standard DNA systems. Let us first return to the system Hi, discussed at the end of Section 3. L e m m a 1 The DNA system Hi is stable. Proof. A more detailed analysis is needed t h a n the one we already carried out in Section 3. T h e order of letters in the words of the sequence will be ignored; we are only interested in the number of occurrences of each letter. Let us denote by a , 7, r, K the number of occurrences of A, G, T, C, respectively. Let wo, wi, u>2, • • • be the sequence of Hi and, for i > 0, let the ordered quadruple (a,-, 7,-, TV, Kj) indicate the numbers of occurrences of the four letters in w,. Thus, ao — 7o = To =
KQ
= 1
413 and, because of the productions, for every i > 0, Q,- + l = Ki, 7i + i = Ti + Ki}
Tj + i = a ; , Ki + i = Oti + 7,-.
Thus, the quadruples associated to the first ten words in the sequence are: (1,1,1,1), (1,2,1,2), (2,3,1,3), (3,4,2,5), (5,7,3,7), (7,10,5,12), (12,17,7,17), (17,24,12,29), (29,41,17,41), (41,58,29,70). We now assume, inductively, that the formulas Oti + Ji = T( + Ki , 7; = 2ri
are satisfied for some i. The basis of induction is clear: the formulas are satisfied for i — 1 (but not for i = 0). We may now write the quadruple associated to ID,in the form (a,
IT,
T,
a + r),
where we have omitted the index i. By our recursion formulas, the quadruples associated to iu,-+i and u>i+2 are {a + T, a + 2r, a, a + 2r) and (a + 2r, 2a + 2r, a + r, 2a + 3r), respectively. This shows that Oj + l + 7» + l > r»' + l + Ki + 1 and " i + 2 + 7»' + 2 = n- + 2 + K. + 2i 7i + 2 = 2 r i + 2 .
From these relations the lemma now follows by induction. The system Hi has the particular property that in every purines, as well as the pyrimidines, are mapped into themselves. character of the system is also reflected in the fact that two steps the induction in the above proof.) Indeed, one can divide H\ into purine DOL system with the productions
• two steps the (This two-step are required in the underlying
A -> GAG, G -> AG, and pyrimidine DOL system with the productions
T^C,
C -> TCC.
Since we know by Lemma 1 that the sequence of H\ is an ordinary DOL sequence, we may use the two underlying DOL systems to compute the growth function of
414
Hi by standard techniques, [10,16]. Indeed, the growth function / can be written as
f{2i + 1) = (3 + 2V2)(1 + V2)4 + (3 - 2-s/2)(l -
V2){,
the formulas being valid for all i > 0. We still consider the standard DNA system H2 with the same productions A ->• TG, G -» C, T -> G, C -> AG as .ffi but now with the axiom GG. The beginning of the sequence of H2 is GC, CAG, TCAGG, CTCAGGG, AGGAGTCCCC, TCCCTCCGAGAGAGAG, CTCTCTCCTCTCGAGGAGGAGGAGG, where complementarity transitions have been indicated by boldface. The following lemma shows that the road of H2 equals 0110010^. Lemma 2 The system H2 is ultimately stable, with the delay of stability 6. Proof. The argument is similar as in Lemma 1. Let w$, W\, U>2, •.. be the sequence of # 2 and let again the ordered quadruple (a,-, 7,-, r,-, Ki) indicate the numbers of occurrences of the four letters in W{. Thus, we have now «o = 7"o = 0, 70 =
K0
= 1
but, because the productions are unchanged, for every i > 0, Cti + l = K{, 7; + i = T{ + Ki, Tj + i = a,-, Ki + 1 = Of; + 7 ; .
We computed above the sequence of H2 already up to the word WQ . Continuing the sequence, we see that the quadruples corresponding to the words 107- w%o are (7,12,4,13), (13,17,7,19), (19,26,13,30), (30,43,19,45), and no complementarity transition occurs in this part of the sequence. We assume, inductively, that for some i the quadruple associated to iu,- satisfies the inequalities a<2r
+ T, 2a < T + n,
where we have omitted the lower index i for simplicity. Observe that the quadruple associated to wio satisfies the inequalities. Observe also that, whenever the
415 inequalities are satisfied, then the purines form a strict majority in the associated word because 7 7 7 7 By our recursion formulas, the quadruple associated to io;+i is (/c, r + K, a, a + f). We now claim t h a t this quadruple satisfies the inequalities required for wi+i: K<2a
+ K
+ j
+ a, 2K < 2a + f.
Indeed, it is easy to see that each inequality in the claim follows by the inductive hypothesis. T h e last inequality follows because 2K < 2(a + r) and 2T < 7. We have K < 2a because 2 r < a + T implies r < a, and we also have K < a + T. The inequalities 2a < T + K and a + 7 < K + a are direct consequences of the inductive hypothesis, and the remaining inequality, T + K < a + 7, was already established. This completes the induction. By going through the first ten words in the sequence, we conclude t h a t the delay of stability is 6, which proves the lemma. • T h e argument in the proof of Lemma 1 is "tighter" than t h a t in L e m m a 2, because in L e m m a 1 the same equations are reached at every second step. Consequently, one step (from u>,- to iu,-+i) suffices in the induction in L e m m a 2. 5
Equivalence Problems
T h e following result is an immediate corollary of Theorem 1. T h e o r e m 5 The road, growth, sequence and language equivalence problems are all decidable for regular DNA systems. In spite of this result, the situation here is essentially more complicated t h a n in connection with DOL systems. Consider the following facts. For DOL systems, the sequence equivalence is decidable but no reasonable bound k is known such t h a t , to decide the equivalence, it would suffice to compare the first k words in the two given sequences. However, according to a well-known conjecture it suffices to choose k to be twice the size of the alphabet of the given systems. (All known examples satisfy this conjecture. See also [4] for a recent contribution.) The following result shows t h a t nothing analogous to this "2n-Conjecture" can hold for regular or standard DNA systems. L e m m a 3 For any integer k, one can find two regular (resp. standard) DNA systems such that their sequences coincide with respect to the first k words but the systems are not sequence, language, growth or road equivalent.
416
Proof. The construction is straightforward. For regular systems, consider the two systems with the axiom A and trigger Gk{A, G,T, C}*, where the productions A-+GA,
G^G,
T^X
are in both systems but the productions for C are different: C —• C2 and C —> G. For standard systems, consider the two systems with the axiom AkG such that the productions A-+A,
G^GT,
T -)• T
are in both systems but in one system we have C —> C and, in the other, C —> C2. Clearly, the claims of the lemma are satisfied in both cases. • We hope to return to the contruction in Lemma 3 in cases, where the length of the axiom and/or the trigger are independent of k. (See also [15].) The decidability of the equivalence problems is open for standard DNA systems. Because of the limited construction possibilities in the four-letter alphabet, it is also not known to what extent the equivalence problems are interconnected with the well-known open problems concerning Z-rational sequences, as they are in the case of general alphabets, [14,15,18]. 6
Weird Growth
Examples are known, [8,14,15], of standard Watson-Crick DOL systems that are weird, that is, the growth function is not Z-rational. However, the examples involve alphabets with more than four letters. It has been an open problem whether the construction can be carried out in the four-letter alphabet, that is, whether there are standard DNA systems whose growth function is not Zrational. The purpose of this section is to give a positive answer to this problem. Theorem 6 There are standard DNA systems whose growth function is not Zrational. The proof will be carried out below. In fact, every standard DNA system H{p, (?), where p and q are different primes, with the axiom TG and productions A-*A,
G-+G, T-+Tp,
C^Cq
satisfies our theorem. We will present the argument in detail, considering the system H(2, 3) = H. Thus, the productions of H are A->A,
G^G,
T^T2,
C -+C3,
417 and the beginning of the sequence is TG, A2C, T2G3, j.32^81
rp64Q81
A4C3, 4l28/-f81
TAG9,
T 8 G 9 , A16C9,
j.128/^243 ^ 2 5 6 ^ 2 4 3
T16G27, j.256^.729
A32C27, :T.512Q729
where boldface now indicates words not obtained by a complementarity transition. Complementarity transitions occur very frequently in this sequence, as seen already from the beginning of the road: 111101111011110110111101111011011110111101111011011110... Let m,-, i = 1 , 2 , . . . be the sequence of positive powers of 2 and 3, arranged in the increasing order of magnitude. Thus, m i = 2, and m , + 1 is the smallest number of the form 2 J or V t h a t exceeds ra;. T h e following l e m m a is obvious by the definition of the system H. L e m m a 4 In the road rir^r^ ... of the system H, we have r\ = r 2 = 1, and rj+i = 0 exactly in case rrij = 2rrij_i. T h e condition in L e m m a 4 can be expressed also in the form: both rrij and m j _ i are powers of 2. We now establish some properties of the road r\r2 • • • Lemma 5 1. There are always either two or four l's between two consecutive O's. 2. The road is not ultimately periodic. Proof. T h e first claim follows by Lemma 4 and because between two consecutive powers of 3 there are always one or two powers of 2, whereas between V and 3 J + 2 there are always three or four powers of 2. T h e second claim is obvious by number theory; it can also be shown by a direct argument as follows. Assume the contrary: the road of H is ultimately periodic. Then by L e m m a 4 the powers of 2 and 3 occur in an ultimately periodic fashion in the sequence of numbers m,. Consequently, there are integers c and a such t h a t , for all i > 0, there is always the same number, say b, of powers of 2 between 3 c + s a and d C 3 c+(i+i)a. Let 2 be the smallest power of 2 greater t h a n 3 . Thus, 3C < 2d < ... < 2d+b~l
< 3c+a <
and, for all i > 1, nd+ib— 1 ^ qc+ia ^ t\d-\-ib
Denoting (5 = w f i
we
obtain d + ib - 1 < /3(c + ia) < d + ib
2d+b
418
and further
b + —— < a/3 + 4 1 < b + -. i
i
i
Considering large enough i, we infer 6 = a/?, which is impossible. This contradiction completes the proof. D We now characterize the growth function of the DNA system H in terms of the road r ^ .... The following lemma is a direct consequence of the definition of H and Lemma 4. L e m m a 6 The growth function f of H can be written as /(i) = 2 s ( ! ')+3 / j ( , ' ) , where g(0) = h(0) - h(l) = 0, #(1) = 1 and, for i > 1,
^'
+ 1)
' 5 ( i - l ) + l i f r, = l, -^) + l ifr^O,
«' + HJg:!! +1 5
_ / / » ( « - 1) + 1 if r,- = 1, 0.
In our final lemma we consider an auxiliary function f\, defined in terms of the growth function / of the DNA system H: h{i) = f(i + 1) - 3/(0 + 2/(t - 1), * > 1. L e m m a 7 For any i > 1, /i(z) = 0 if and only if r,- = 0. Proof. The assertion holds for i = 1 and, for i > 2, the word r,_irj-r, + i = y equals one of the four words 101, 011, 110, 111, by Lemma 5. We consider the four cases separately, applying Lemma 6 for the values of/. Assume t h a t / ( i - 1 ) = 2t + 3". If y = 101, we have/(i) = 2 * + 1 + 3 " and f(i + 1) = 2*+2 + 3". Consequently, /!(,') = 4 • 2f + 3" - 3(2 • 2* + 3") + 2(2* + 3U) = 0. If y= 011, we have f{i) = 2 i + 1 + 3 u and/(» + l) = 2 t + 1 + 3 U + 1 , yielding /i(i) = 2 ( 3 u - 2 ( ) # 0 . If y= 110, we have/(i) = 2* + 3 " + 1 and f(i + 1) = 2t+1 + 3 U + 1 , yielding /i(i) = 2* — 4 • 3" ^ 0. Finally, if y = 111, we are back in the case
419 y = 110 or y = Oil, depending on whether the string y = 111 begins or ends a sequence of four l's in the road. Thus all cases are verified. • We are now in the position to establish Theorem 6. Assume that the growth function / of the standard DNA system H is Z-rational. Then also the function / i is Z-rational, [16]. By the Skolem-Mahler-Lech Theorem (Lemma 9.10 in [16]), the number 0 occurs in an ultimately periodic fashion in the sequence fi(i), i > 0. However, this contradicts Lemmas 5 and 7. 7
Conclusion
We have shown that Watson-Crick DOL systems over the four-letter DNA alphabet offer possibilities for rich functional constructions. Many of the basic decision problems, especially as regards standard DNA systems, remain still open. References 1. L. Adleman, Molecular computation of solutions to combinatorial problems, Science, 266 (1994), 1021-1024. 2. E. Csuhaj-Varju, A. Salomaa, Networks of Watson-Crick DOL systems, to appear in Proc. 3rd International Colloquium on Words, Languages and Combinatorics (M. Ito, ed.), March 14-18, 2000, Kyoto. 3. S. Ginsburg, G. Rozenberg, T0L schemes and control sets, Information and Control, 27 (1975), 109-125. 4. J. Honkala, Easy cases of the DOL sequence equivalence problem, Discrete Applied Mathematics, to appear. 5. J. Honkala, A. Salomaa, Watson-Crick DOL systems with regular triggers, Theoretical Computer Science, to appear. 6. W. Kuich, A. Salomaa, A. Semirings, Automata, Languages, SpringerVerlag, Berlin, Heidelberg, New York, 1986. 7. V. Mihalache, A. Salomaa, Lindenmayer and DNA: Watson-Crick DOL systems, EATCS Bulletin, 62 (1997), 160-175. 8. V. Mihalache, A. Salomaa, Language-theoretic aspects of DNA complementarity, Theor. Computer Set., 250 (2001), 163-178. 9. Gh. Paun, G. Rozenberg, A. Salomaa, DNA Computing - New Computing Paradigms, Springer-Verlag, Berlin, Heidelberg, New York, 1998. 10. G. Rozenberg, A. Salomaa, The Mathematical Theory of L Systems, Academic Press, New York, 1980. 11. G. Rozenberg, A. Salomaa, eds., Handbook of Formal Languages, Vol. 1-3. Springer-Verlag, Berlin, Heidelberg, New York, 1997.
420
12. A. Salomaa, Formal Languages, Academic Press, New York, 1973. 13. A. Salomaa, Turing, Watson-Crick and Lindenmayer. Aspects of DNA complementarity, in Unconventional Models of Computation (C. Calude, J. Casti, M. Dinneen, eds.), Springer-Verlag, Singapore, 1998, 94-107. 14. A. Salomaa, Watson-Crick walks and roads on DOL graphs, Acta Cybernetica, 14 (1999), 179-192. 15. A. Salomaa, Uni-transitional Watson-Crick DOL systems, submitted 2000. 16. A. Salomaa, M. Soittola, Automata-Theoretic Aspects of Formal Power Series, Springer-Verlag, Berlin, Heidelberg, New York, 1978. 17. P. Sosik, DOL systems + Watson-Crick complement = universal computation, Proc. MCU 2001, Chisjnau, LNCS, 2055, Springer-Verlag, 2001, 308-319. 18. P. Sosi'k, Watson-Crick, Lindenmayer, while programs and Zpos problem, submitted, 2001.
421 T O P O L O G I E S F O R T H E SET O F D I S J U N C T I V E w - W O R D S LUDWIG STAIGER Institut fur Informatik Martin-Luther- Universitat Halle- Wittenberg von-Seckendorff-Platz 1, D-06099 Halle, Germany E-mail: [email protected] In 1983 two papers dealing with the w-language of disjunctive w-words appeared [7,8]. In the latter it was shown that this w-language is a natural example of an w-language having a trivial (finite) syntactic monoid but not being accepted by a finite automaton. For a more detailed account see [12,9]. Subsequently, disjunctive w-words became of interest in connection with random and Borel normal sequences (see, for instance, [1,6]). In contrast to Borel normality, "disjunctivity" is a natural qualitative property which is satisfied, in particular, by Borel normal and by random w-words. As in [7,8] we say that an w-word is disjunctive if it contains any (finite) word as a subword. In this paper we are going to investigate topological properties of the set of all disjunctive sequences (w-words). Usually, one considers the space of all w-words over a finite alphabet X as the infinite product space of the discrete space X. Introducing the Baire metric, this space can be considered as a metric space (Cantor space) (Xw ,p), that is, a compact totally disconnected space. In this paper we consider topologies on the set of all w-words over a finite alphabet X in which the set of all disjunctive w-words has a special property: First, we consider the topology of "forbidden words" in which the set of disjunctive w-words is the smallest G^-set. The second topology is a special case of the topologies derived from formal languages (cf. [13]). Here the set of disjunctive w-words turns out to be the largest closed and dense in itself set.
1
Notation
By IN = {0,1,2,...} we denote the set of natural numbers. Let X be our alphabet of cardinality #X = r, r G IN, r > 2. By X* we denote the set of finite strings (words) on X, including the empty word e. We consider the space Xw of infinite sequences (w-words) over X. For w G X* and r\ G X* U Xw let w • 77 be their concatenation. This concatenation product extends in an obvious way to subsets W C X* and B C X* U Xu. We extend the operations * and w to arbitrary subsets W C X* in the usual
422
way: W* := ( J Wn where W° := {e}, Wn+1
:= Wn • W , and
W"" := {w0 • u>i • . . . • u;,- • . . . | i G IN A Wi G W \ {e}} is the set of w-words in Xu formed by concatenating members of W. We will refer to subsets of X* and Xu as languages or w-languages, respectively. By "C" we denote the prefix relation, that is, w C rj if and only if there is an rf such that w-T}1 = 77, and A(rj) := {w | u; G X*Ato C 77} and A ( 5 ) := \J„€B A ( 5 ) are the languages of finite prefixes of r\ and B, respectively. The set of subwords (infixes) of r) G X* U I w will be denoted by T{r]) := {w I w G X* A 3v(vw C 77)}. An w-language F is called regular provided there is an n £ IN and regular languages W,-, V{ (1 < J: < n) such that n
F=|J*W-
(1)
:' = 1
Similarly, an w-language F is called context-free if F has the form of Eq. (1) where Wi and Vi are context-free languages. Observe, that Vu - 0, ^ w = {v}" or V™ D {v, u}w for some words v,u£V* with |v| = |u| > 0 and v ^ u. Thus, every at most countable context-free u>language consists entirely of ultimately periodic w-words (cf. [14]). 2
Preliminary Considerations
In the study of w-languages it is useful to consider Xu as a metric space (Cantor space) with the following metric. /?(?7,0 :=inf{r- | u , l | r a C i ) A i « C ( }
(2)
or an equivalent one". In this paper, however, we will consider also a topology on X" which cannot be specified by a metric, that is, a so-called non-metrizable topology. To this end we introduce topologies on Xw in the general way (cf. [10,4]). A topology in Xw is a family O C 2X" of subsets of Xw such that « , I u G O and O is closed under finite intersection and arbitrary union. The sets in O are called open subsets of Xw. The complements of open subsets are referred to as °For example, the Baire metric e(v,£) topology.
'•— inf{ 1 + '| w | I w C V A w C 1} generates the same
423
closed. Since an arbitrary intersection of closed sets is again closed, every set F C Xw is contained in a minimal closed set, its closure Co{F). Having defined open and closed sets for some topology in X", we proceed to the next classes of the Borel hierarchy (cf. [10]): Gg is the set of countable intersections of open subsets of Xw, Fa is the set of countable unions of closed subsets of Xw. A metric g generates the set of open sets Oe in the following way: First we define the open balls Be(£) := {r) \ g{£,,r]) < e] for e > 0. Then a set is open in the space {Xw, g) if it is a union of open balls. In the Cantor space, open balls are of the form w • Xw, and, consequently, the set of open subsets of Xw is Oc = {W • X" | W C X*}. From this it follows that a subset F C Xw is closed in the Cantor space if and only if A(£) C A(F) implies £ € F, and the closure in the Cantor space can be specified as C(F) := {£, | A(£) C A(F)}. In Section 4 we shall consider the so-called topology of "forbidden" words which is specified by the set of open sets Or := {X* • W • Xu | W C X*}.b This topology is a subtopology of Cantor topology Oc D Or, or, equivalent^, the Cantor space is a refinement of the topology of "forbidden" words. Finally, we define for a language W C X* its S-limit of W, W6, which consists of all infinite sequences of Xw that contain infinitely many prefixes in W,
ws = {^exw \ #(A(0 n w) = oo}. For G^-sets in the Cantor space we have the following characterization via languages (cf. [16,13,14]). It explains also why we call Ws the <5-limit of the language W. Theorem 2.1 In the Cantor space, a subset F C X^ is a Gs-set if and only if there is a language W C X* such that F = Ws. 3
The w-Language of Disjunctive Sequences
In this section we will present a few simple general properties of the w-language of all disjunctive sequences over X, D, and its topological properties in the Cantor space. Some of the results in this section are reported in [2,15]. As in [7,8] an w-word £ £ Xw is called disjunctive provided T(£) = X*. Thus £> = {£ | T ( | ) =X*}. The term forbidden refers to the fact that closed subsets are specified by forbidding a certain set W of infixes.
424
From this definition we obtain D=
f]
X*wX" .
(3)
w£X'
Our next lemma shows that D is an example of a w-language which has a trivial finite syntactic congruence but is not context-free. The proof refers to the investigations of Jurgensen and Thierrin [8,9]. The syntactic congruence ~ ^ of an w-language F C Xw is defined as follows0 w ~ p v <4> VuV£(u E l ' A ^ r - } ( « < G F <-> uv£ G F)) . As usual, we call ~p of finite index iff its number of equivalence classes is finite. Observe that T(uw\) = X* iff T(£) = X*. Thus it is clear that w ~D v for arbitrary w,v £ D, and ~ # has exactly one equivalence class which coincides with X*. Thus we have proven the first part of the following. Lemma 3.1 ([8]) The ui-language D has a syntactic congruence of finite index but is not context-free. Proof. As T ( n w E X . w) = X* and T(wvw) ^ X*, D is nonempty and does not contain an ultimately periodic a;-word wvu. Following Eq. (1) the aj-language D cannot be context-free. • The representation of Eq. (3) verifies that D is a G^-set in the Cantor space. Thus, in view of Theorem 2.1 it can be represented as the (J-limit of a language. In case of D we construct such a language Wo explicitly (cf. [15]). Proposition 3.2 Let WD = {vox \w EX* hx £X A 3n(n < \w\ + 1 A T(wx) D X" A T(w) ^ Xn)}- Then D = WD. Finally, we are going to show that the topological complexity of D in the Cantor space cannot be decreased. To this end we quote Theorem 21 from [12]. T h e o r e m 3.3 ([12]) If F C Xw has a syntactic congruence of finite index and is simultaneously an FCT- and a Gs-set in the Cantor space, then F is regular. Combining Theorem 3.3 with Lemma 3.1 and Eq. (3) we get: Proposition 3.4 In the Cantor space, D is not an ¥a-set. c
There are other notions of syntactic congruences for w-languages in use (cf. [11]).
425
4
The Topology of Forbidden Words
In this section we investigate the topology of forbidden words described above and its relations to the set of disjunctive sequences. It turns out that this topology is not a metric one. Recall 0T = {X* WXW | W C X*} from Section 2. As X* VX" C\X* WXW = (X*WX* nX*VX*)Xu this family 0T is closed under finite intersection. The closure under arbitrary union is obvious. Thus it defines a topology on Xu. An w-language F C Xw avoids words of a language W C X* provided F C Xw \ X*WXW, that is, no word w G W occurs as a subword (infix) of an w-word £ G F. Therefore, the closed sets in the topology O-j- are characterized by the fact that their w-words do not contain subwords from W. The following theorem gives a connection to closed sets in the Cantor space. To this end we define F/w := {£, | w£ G F}. Theorem 4.1 Let F C Xw.
Then the following conditions are equivalent:
1. F is closed in the topology of forbidden words. 2. F is closed in the Cantor space and Vw(w G X* =>• F D F/w). 3. F is closed in the Cantor space and A(F) = T ( F ) . I
V((AK)CT(F)^(£F),
Proof. "1. =>• 2": As we noticed above, every w-language closed in the topology of forbidden words is also closed in Cantor's topology. Let w G X* and F = XU\X*WXW. Then F/w = Xw \ (X*WXu)/w, and the assertion follows from the obvious inclusion {X*WXu)/w D X*WXU. u 2. => 3T follows from the identity A((J W(EX . F/W) = T ( F ) . " 5 . =>• 4 .": If F is closed in the Cantor space we have F = {£ | A ( 0 C A ( F ) } . Now the assertion 4- follows from A(F) = T ( F ) . Finally, we show that Condition 4 implies F = Xu \ X* • (X* \ T(F)) • Xw. Since X* \T(F) = X* • {X* \T{F))-X* it suffices to prove that F = XU\{X*\ w T(F)) -X . The inclusion F CX"\(X*\ A(F)) • Xu C X" \ {X* \ T(F)) • Xu follows from A(F) C T ( F ) . To prove the converse inclusion let £ (/ F. Then in view of Condition 4 there is a prefix w C £ such that w £ T ( F ) . Consequently, £G {X* \T(F)) • X". O In view of the equivalence " 1. <S> 4 •" w e obtain the following representation of the closure operator Cj defined by the topology of forbidden words: CT(F) = {£ | A ( 0 C T ( F ) } .
426
Recall that the closure in the Cantor space was definable as C(F) = {£ | A(£) C A(F)}. The additional requirements \/w(w 6 X* =>• F D F/w) and A(F) = T(F) in 2. and 3. are, however, not equivalent in general. The following example shows that there is an w-language (necessarily not closed in the Cantor space) which satisfies A(F) = T(F), but not the condition Vw(io E X* => F D F/w). Example 4.2 Let F = (X2)*bba" U X(X2)*aabw.
Then A(F) = T(F) = X*,
but F/a £ F. Since the family of regular w-languages is closed under Boolean operations, the w-language Fw = Xw \ X* WXW is a regular if the language of forbidden patterns W C X* is regular. In connection with Eq. (1) and the considerations on Vw immediately following it this yields as a consequence the following generalization of a result of El-Zanati and Transue [5]. Theorem 4.3 Let W C X* be a regular language. If Fw is uncountable, then Fw contains a subset of the form w{u, v}u, where « / » and \u\ = \v\ > 0. We continue with some more examples. The first is an example of a countable regular w-language Fw which requires an infinite set of forbidden patterns. Example 4.4 Let X = {a, b} and W = ba*b. Then Fw = Xw \ X*WXW = a*bau U aw is a countable w-language. It is clear that Fw ^ Fy, for any finite language V C X*. Though the regularity of W implies the regularity of Fw this same relation is not true for context-free languages and w-languages. Example 4.5 Let X = {a, b} and W = {66} U {6a!'6a-''6 | j £ i + 1}. Clearly, W is a deterministic context-free language, and Fw = a*({% | i 6 IN} U {rjij | i,j £ K A J < j}) where rji = ba'ba'+H • • • and r]itj = ba*bai+1 • ••bajbaw. Since Fw is countable but does not consist entirely of ultimately periodic w-words, Eq. (1) shows that Fw is not context-free. Finally, we discuss a characterization of the w-language of disjunctive sequences D by means of the topology of forbidden words. From Eq. (3) we obtain immediately Proposition 4.6 In the topology of forbidden words, D is the smallest nonempty Gs-set.
427
A set F C Xu is dense in Xw in case Xw is the smallest closed set containing F, that is, Xu \ F does not contain a nonempty open set. Since £ £ Xw is disjunctive, we have T(£) = X*, and therefore {Z}CiX*wX" ^ 0 for all tu £ X*. Thus we have shown the following. Proposition 4.7 An ui-word £ £ Xu is disjunctive if and only if the set {£} is dense in Xu in the topology of forbidden words. This proposition shows that every closed set in the topology of forbidden words which contains some £ £ D must coincide with the whole space Xu. Consequently, every F^-set containing £ £ D equals Xu. Corollary 4.8 D is not an Fa-set in the topology of forbidden words. Above we mentioned, the topology of forbidden words is not a metrizable topology, that is, it is not definable by a metric. Proposition 4.7 gives evidence of this fact, because the sets {£}, £ £ D are not closed, and in a metrizable topology every finite set has to be closed. 5
A Metric Related to Languages
The definition of the topologies considered in this part is related to the wellknown fact that every G^-set of a complete metric space is a complete metric space itself (cf. [10]), possibly using a different metric. We use here the construction presented in [13]. Related investigations were carried out in [3] As we have seen in Theorem 2.1, in the Cantor space a G^-set is of the form Us for some U C X*. We use this language U to define a new metric pu on Xu which makes Us a closed set in the metric space (X w ,p[/): , . _ J 0 , if £ = 77, and PVK> m - J r i-#A(OnA(,)nU } otherwise.
, , (4)
This metric, in some sense, resembles the metric p in the Cantor space; in fact, p — px' • Moreover, since pu(£,, v) > p{£> v)> the [/-topology refines the topology of the Cantor space. In particular, every closed set in the Cantor space is also closed in the [/-topology. We denote by Cu(F) the smallest closed (with respect to pu) subset of Xw containing F. A point £ £ Cu{F) is called an isolated point of F provided 3e(e > 0 A Vrj(rj £ F A t) ^ £ => pu{(,, TJ) > e)). It should be mentioned that an arbitrary set of isolated points of Xw is open. A point £ £ CJJ(F) which is not an isolated point of F is called an accumulation point of F.
428
Theorem 5.1 Let U C X*. whole space in (Xw,pu).
Then U is the set of accumulation points of the
Proof. It suffices to show that every point £ ^ Us is isolated. Let # A(£) fl U = n < oo. From the definition of pu we have pu{(,, v) •> r 1 _ n for all rj G X w .
• s
As an immediate consequence we obtain the following property of II in the space [Xw,pu) which explains that the /7-topology may be indeed finer than the topology of the Cantor space. Corollary 5.2 If F D U6 then F is a closed subset
of{Xw,pu).
Proof. Theorem 5.1 shows that every point £ G Xu \ F is an isolated point of X . Consequently, Xw \ F is open in {Xw ,pv). • u
It should be mentioned that, although Us is the set of accumulation points of the whole space (Xw ,pu), it may contain isolated points with respect to itself. Example 5.3 Let U := a* Ua*ba* C {a,b}*. Then every w-word £ G a*baw is an isolated point of Us = aw U a*baw. In the case of the w-language of disjunctive sequences, D, we can prove even more. To this end we derive the following relationship between accumulation points in the [/-topology and in the Cantor space. Lemma 5.4 Let U C X* and let F C Us. Then £ is an accumulation point of F in (Xu, pu) if and only if £ is an accumulation point of F in (Xu ,p). Proof. Let £ be an accumulation point of F in (Xw,pu)Then for every e > 0 there is an r)e G F \ {£} such that pu{£,,rjc) < £• Since p(£,r]c) < pu(£,rie), £ is also an accumulation point of F in the Cantor space. Conversely, let £ be an accumulation point of F in the Cantor space, and let I; E Us. Then A(£) fl U is infinite. Hence there is a surjective function i\> : A(£) ->• IN such that ip(w) := # A(£) n U. If for every n G IN there is an r]n 6 F such that p(£,7?„) < r " n then pu{l,Vn) < r~^w^ where wn G A(£) D A(?7n) and \wn\ = n. Since the function i/> is surjective, for every e > 0 one can find an »?n G F such that /?[/(£, Vn) < £• Hence, £ is also an accumulation point of F in the [/-topology. D In Proposition 3.2 we constructed a language Wo for which D = WD. The following theorem shows that D is the set of its accumulation points, that is, D is closed in (Xw,pu) and is dense in itself.
429 Theorem 5.5 Let U6 = D. In the space (Xu,pu) set of its accumulation points.
the ui-language D equals the
Proof. From Corollary 5.2 we know that D is closed in the [/-topology. Thus no point rj (jt D is an accumulation point of D. On the other hand, since w G X* and £ G D imply wC, G D, every point £ G D is an accumulation point of D in the Cantor space. The assertion follows with Lemma 5.4. • References 1. C. Calude, Information and Randomness. An Algorithmic Perspective, Springer-Verlag, Berlin, 1994. 2. C. Calude, L. Priese, L. Staiger, Disjunctive Sequences: An Overview, CDMTCS Research Report 063, 1997. 3. Ph. Darondeau, D. Nolte, L. Priese, S. Yoccoz, Fairness, Distances and Degrees, Theoret. Comput. Sci, 97 (1992), 131-142. 4. R. Engelking, General Topology, PWN - Polish Scientific Publishers, Warszawa 1977. 5. S.I. El-Zanati, W.R.R. Transue, On dynamics of certain Cantor sets, J. Number Theory, 36 (1990), 246-253. 6. P. Hertling, Disjunctive w-words and real numbers, Journal of Universal Computer Science, 2, 7 (1996), 549-568. 7. H. Jiirgensen, H.J. Shyr, G.Thierrin, Disjunctive w-languages..EYeA^ron. Informationsverarb. Kybernetik EIK, 19, 6 (1983), 267-278. 8. H. Jiirgensen, G. Thierrin, On w-languages whose syntactic monoid is trivial. Intern. J. Comput. Inform Sci., 12, 5 (1983), 359-365. 9. H. Jiirgensen, G. Thierrin, Which monoids are syntactic monoids of uilanguages, Elektron. Informationsverarb. Kybernetik EIK, 22, 10/11 (1986), 513-536. 10. K. Kuratowski, Topology I, Academic Press, New York, 1966. 11. 0 . Maler, L. Staiger, On syntactic congruences for ^-languages, Theoret. Comput. Set., 183, 1 (1997), 93-112. 12. L. Staiger, Finite-state w-languages, /. Comput. System. Sci., 27 (1983), 434-448. 13. L. Staiger, Sequential mappings of w-languages. RAIRO Infor. theor. et Appl., 21, 2 (1987), 147-173. 14. L. Staiger, w-languages, in Handbook of Formal Languages (G. Rozenberg, A. Salomaa, eds.), Vol. 3, Springer-Verlag, Berlin, 1997, 339-387. 15. L. Staiger, How large is the set of disjunctive sequences? to appear in Proc.
430
Discrete Mathematics and Theoretical Computer Science (DMTCS'Ol) (C.S. Calude, M.J. Dineen, S. Sburlan, eds.), Springer-Verlag, London, 2001. 16. W. Thomas, Automata on infinite objects, in Handbook of Theoretical Computer Science (J. Van Leeuwen, ed.), Vol. B, Elsevier, Amsterdam, 1990, 133-191.
431
GABRIEL THIERRIN
Gabriel Thierrin was born in Switzerland, in December 1921. He studied at the universities in Fribourg and Paris. His doctoral thesis of 1951 was a study of certain properties of permutation groups. His 1954 These de Doctorat d'Etat was a "contribution to the theory of equivalences in semigroups". After transitional appointments in Fribourg and Tunis, he joined the University of Montreal in 1958. He then became a faculty member of the Department of Mathematics, the University of Western Ontario in London, Canada, in 1970, and later also an Honorary Professor in Computer Science. He retired in 1987. He now still works on his research topics. In his first fifteen years of research, almost all his work was on the theory of semigroups and rings. The main theme of his early work was related to invertibility properties and to properties of equivalence relations. His research interest started to change from pure algebra to automata, formal languages, and codes since his paper on permutation automata in 1968 and his paper on simple automata in 1970. He has done a tremendous work in research and published a large number of papers. We include a list of his publications in the following to celebrate his eightieth birthday.
The Publications of Gabriel Thierrin 1. Sur les repartitions imprimitives des i-uples et les groupes qui les engendrent, These de Doctorat, Fribourg 1951 (Jouve Editeur, Paris). 2. Sur les groupes semi-abeliens, Actes de la Societe Helvetique des Sciences Naturelles, 1951, 86-87. 3. Sur une condition necessaire et suffisante pour qu'un semi-groupe soit un groupe, Comptes Rendus de I'Academie des Sciences de Paris, 232 (1951), 376-378. 4. Sur les elements inversifs et les elements unitaires d'un demi-groupe inversif, Comptes Rendus de I'Academie des Sciences de Paris, 232 (1952), 33-34. 5. Sur une classe de demi-groupes inversifs, Comptes Rendus de I'Academie des Sciences de Pans, 234 (1952), 177-179. 6. Sur une classe de transformations dans les demi-groupes inversifs, Comptes Rendus de VAcademie des Sciences de Paris, 234 (1952), 1025-1017.
432
7. Sur les demi-groupes inverses, Comptes Rendus de I'Academie des Sciences de Pans, 234 (1952), 1336-1368. 8. Sur les homogroupes, Comptes Rendus de I Academie des Sciences de Paris, 234 (1952), 1519-1521. 9. Sur quelques classes de demigroupes, Comptes Rendus de VAcademie des Sciences de Pans, 236 (1953), 33-35. 10. Sur quelques equivalences dans les demi-groupes, Comptes Rendus de I Academie des Sciences de Paris, 236 (1953), 565-567. 11. Quelques proprieties des equivalences reversibles generalisees dans un demigroupe, Comptes Rendus de VAcademie des Sciences de Paris, 236 (1953), 1399-1401. 12. Sur les homodomaines et les homocorps, Comptes Rendus de VAcademie des Sciences de Paris, 236 (1953), 1595-1597. 13. Sur une equivalence en relation avec l'equivalence reversible generalisee, Comptes Rendus de VAcademie des Sciences de Paris, 236 (1953), 17231725. 14. Quelques proprietes des sous-groupoides consistants d'un demi-groupe abelien D, Comptes Rendus de VAcademie des Sciences de Paris, 236 (1953), 1837-1839. 15. Sur la caracterisation des equivalences regulieres dans les demi-groupes, Academie Royale de Belgique, Bulletin de la Classe des Sciences, 39 (1953), 942-947. 16. Sur quelques classes de demi-groupes possedant certaines proprietes des demi-groupes, Comptes Rendus de VAcademie des Sciences de Paris, 238 (1954), 1765-1767. 17. Sur la caracterisation des groupes par leurs equivalences regulieres, Comptes Rendus de VAcademie des Sciences de Paris, 238 (1954), 1954-1956. 18. Sur la caracterisations des groupes par leurs equivalences simplifiables, Comptes Rendus de VAcademie des Sciences de Paris, 238 (1954), 20462048. 19. Sur la caracterisation des groupes par certaines proprietes de leurs relations d'ordre, Comptes Rendus de VAcademie des Sciences de Paris, 239 (1954), 1453-1455.
433
20. Sur quelques proprietes de certaines classes de demi-groupes, Comptes Rendus de I'Academie des Sciences de Paris, 239 (1954), 1335-1337. 21. Contribution a la theorie des equivalences dans les demi-groupes, These de Doctorat d'Etat, Universite de Paris, Bulletin de la Societe Mathematique de France, 83 (1955), 103-159. 22. Demi-groupes inverses et rectangulaires, Academie Royale de Belgique, Bulletin de la Classe des Sciences, 41 (1955), 83-92. 23. Sur une propriete caracteristique des demi-groupes inverses et rectangulaires, Comptes Rendus de I'Academie des Sciences de Paris, 241 (1955), 1192-1194. 24. Sur la theorie des demi-groupes, Commentarii Mathematici Helvetici, 30 (1956), 211-223. 25. Sur quelques decompositions des groupoides, Comptes Rendus de I'Academie des Sciences de Paris, 242 (1956), 596-598. 26. Sur les automorphismes interieurs d'un demigroupe reductif, Mathematici Helvetici, 31 (1956), 145-151.
Commentarii
27. Sur la structure des demi-groupes, Annates de I'Universite d'Alger, 3 (1956), 161-171. 28. Contribution a la theorie des anneaux et des demi-groupes, Mathematici Helvetici, 32 (1957), 93-112.
Commentarii
29. Sur les ideaux completement premiers d'un anneau quelconque, Bulletin de la Classe des Sciences de I'Academie Royale de Belgique, 43 (1957), 124— 132. 30. Sur les ideaux fermatiens d'un anneau commutatif, Commentarii matici Helvetici, 33 (1958), 241-247. 31. Quelques problemes concernant la structure des anneaux, d'Algebre, Universite de Paris, 2, 1959-60.
Mathe-
Seminaire
32. Sur le radical corpoidal d'un anneau, Canadian J. of Mathematics, (1960), 101-106.
12
33. Sur la structure d'une classe d'anneaux, Canadian Math. Bulletin, 3 (1960), 1-16.
434
34. On duo rings, Canadian Math. Bulletin, 3 (1960), 167-172. 35. Extensions radicales et quasi-radicales dans les anneaux, Canadian Math. Bulletin, 5 (1962), 29-35. 36. Sur les anneaux partiellement ordonnes, Canadian Math. Bulletin, 5 (1962), 123-128. 37. Une caracterisation des groupes d'ordre premier, Abstracts, Congress of Mathematicians, Stockolm, 1962.
International
38. Anneaux metaprimitifs, Canadian J. of Mathematics, 17 (1965), 199-205. 39. Demi-groupes separateurs, Canadian Math. (with J.C. Derderian).
Bulletin, 9 (1966), 611-619
40. Quelques caracterisations du radical d'un anneau, Canadian Math. Bulletin, 10 (1967), 643-648. 41. Permutation automata, Mathematical Systems Theory, 2 (1968), 83-90. 42. Decomposition des langages reguliers, Revue d'Informatique et de Recherche Operatwnnelle, r-3 (1969), 45-50. 43. Ideaux a droite minimaux d'un anneau primitif, Canadian Math. 3 (1970), 385-386.
Bulletin,
44. Simple automata, Kybernetika, 6 (1970), 343-350. 45. Irreducible automata, Proceedings of the Canadian Math. Congress, 1971, 245-262. 46. Ideaux a droite maximaux, Acta Mathematica Acad. Sci. Hung., 23 (1971), 321-323. 47. (T-reflexive semigroups and rings, Canadian Math. Bulletin, 15 (1972), 185— 188 (with M. Chacron). 48. Finitness conditions for finitely generated monoids, Semigroup Forum, 3 (1972), 252-254. 49. On semigroups in which every Rees one-sided congruence is a congruence, Semigroup Forum, 3 (1972), 215-223 (with G. Baird). 50. Decomposition of locally transitive semiautomata, Utilitas Mathematica, 2 (1972), 25-32.
435
51. Convex languages, Automata, Languages and Programming, IRIA Symposium, Paris 1972, North-Holland Publ. Company, 1972, 481-492. 52. The syntactic monoid of a hypercode, Semigroup Forum, 6 (1973), 227-231. 53. Hypercodes, Information and Control, 24 (1974), 45-54 (with H. Shyr). 54. Some conditions for the existence of an optimal solution of a linear program, Canadian J. of Operational Research and Information Processing, 12 (1974), 109-111. 55. Power-separating regular languages, Mathematical (1974), 90-95 (with H. Shyr).
Systems
Theory, 8
56. Ordered automata and associated languages, The Tamkang J. of Mathematics, 5 (1974), 9-20 (with H. Shyr). 57. Left noncounting languages, International J. of Computer and Information Sciences, 4 (1975), 95-102 (with H. Shyr). 58. A mode of decomposition of regular languages, Semigroup Forum, 10 (1975), 32-38. 59. Some properties of the (n,k)-language, The Tamkang J. of Mathematics, 6 (1974), 281-284 (with H. Shyr). 60. An algebraic dependence over the quasi-centre, Annali di Mathematica, C X (1976), 1-14 (with M. Chacron). 61. Preorder relations associated with developmental systems and languages, Automata, Languages, Development (A. Lindenmayer, G. Rozenberg, eds.), North-Holland Publ. Co., 1976, 301-311 (with H. Shyr). 62. A characterization of the commutator subgroup of a group, Canadian Math. Bulletin, 19 (1976), 93-94. 63. Regular prefix codes and right power-bounded languages, Semigroup Forum, 13 (1976), 77-83. 64. Codes and binary relations, Springer Lecture Notes in Mathematics, 586 (1977), 180-188 (with H. Shyr). 65. Right local semigroups, J. of Algebra, 46 (1977), 134-147 (with S. Rankin and C. Reis).
436
66. 7r-independent languages, The Tamkang J. of Mathematics, 8 (1977), 87-97 (with L. Y. Kuan). 67. Disjunctive languages and codes, Proceedings of the 1977 International Conference on Fundamentals of Computation Theory, Poznan, Poland, Springer Lecture Notes in Computer Science, 56 (1977), 171-176 (with H. Shyr). 68. 77-simple reflective semigroups, Semigroup Forum, 14 (1977), 283-294 (with G. Thomas). 69. Codes, languages and MOL schemes, R. A. I. R. 0., Theoretical Computer Science, 11 (1977), 293-301 (with H. Shyr). 70. a-recognizable semigroups, Proceedings Amer. Math. Soc, 70 (1978), 9399 (with C M . Reis and S.A. Rankin). 71. On the reverse of a linear program, Soochow J. of Mathematics, 4 (1978), 1-5. 72. Reflective star languages and codes, Information and Control, 42 (1979), 1-9 (with C M . Reis). 73. Decomposition of some classes of subsets in a semigroup, Proceedings of the Conference on Semigroups 1979, Oberwolfach, Springer Lecture Notes in Mathematics, 855 (1981), 182-188. 74. Context-free and stationary languages, International J. of Computer Mathematics, 7 (1979), 297-301. 75. Strong endomorphisms of connected automata, Proceedings of the International Conference on Fundamentals of Computation Theory, Berlin 1979, Akademie Verlag, 1979, 318-324 (with A. Paradis). 76. Strong endomorphisms of 7r-connected automata, Semigroup Forum, 20 (1980), 91-93 (with A. Paradis). 77. Right subdirectly irreducible semigroups, Pacific J. Mathematics, 85 (1979), 403-412 (with C M . Reis and S.A. Rankin). 78. Locally regular and locally finite languages, The Tamkang J. of Mathematics, 10 (1979), 253-262 (with H. Shyr). 79. Locally nonconting languages, Soochow J. Mathematics, 5 (1979), 39-44 (with L.Y. Kuan).
437
80. Hypercodes in deterministic and slender OL languages, Information and Control, 45 (1980), 251-262 (with T. Head). 81. Semigroups with each element disjunctive, Semigroup Forum, 21 (1980), 127-141 (with H. Jiirgensen). 82. Rings with right disjunctive elements, Simon Stevin Journal, 55 (1981), 37-40. 83. Hypercodes, right convex languages and syntactic monoids, Proc. Math. Soc, 83 (1981), 255-258.
Amer.
84. DOL schemes and the periodicity of string embedding, J. of Theoretical Computer Science, 23 (1983), 83-89 (with T. Head and J. Wilkinson). 85. Primitive words and disjunctive languages, Soochow J. of Mathematics, 7 (1981), 155-163 (with H. Shyr). 86. Languages of primitive words associated with set of natural integers, Proceedings of the Conference on Semigroups and Applications, Oberwolfach 1981, Springer Lecture Notes in Mathematics, 998 (1983), 404-411 (with A. Paradis). 87. H-bounded and semi-discrete languages, Information (1981), 174-187 (with M. Kunze).
and Control, 51
88. Quasi-disjunctive languages, Soochow J. of Mathematics, 8 (1982), 151-161 (with A. Paradis and H. Shyr). 89. Maximal common subsequences of pairs of strings, Proceedings of the Eleventh Annual Conference in Numerical Mathematics and Computing, Winnipeg 1981, Congressus Numerantium, 34 (1982), 299-311 (with M. Kunze). 90. Common subsequences and supersequences of finite sets of words, Proceedings of the Conference on Combinatorics, Graph Theory and Computing, Boca Raton 1982, Congressus Numerantium, 36 (1982), 221-234 (with M. Kunze). 91. Disjunctive w-languages, Elektronische Informationsverarbeitung bernetik, 19 (1983), 267-278 (with H. Jiirgensen and H. Shyr).
und Ky-
92. Towards a general concept of hypercodes, J. of Information and Optimization Sciences, 4 (1983), 255-268 (with H. Prodinger).
438
93. Polynornially bounded DOL systems yield codes, Combinatorics On Words: Progress and Perspectives, Academic Press, 1983, 167-174 (Proceedings of Conf. on Combinatorics on Words, Waterloo 1982 (with T. Head). 94. Semi-discrete context-free languages, International J. of Computer Mathematics, 14 (1983), 3-18 (with M. Latteux). 95. On w-languages whose syntactic monoid is trivial, International J. of Computer and Information Sciences, 12 (1983), 359-365 (with H. Jiirgensen). 96. On bounded context-free languages, Elektronische Informationsverarbeitung und Kybernetik, 20 (1984), 3-8 (with M. Latteux). 97. Codes and commutative star languages, Soochow J. of Mathematics, 10 (1984), 61-71 (with M. Latteux). 98. Strict linear programs and tight matrices, J. Information and Optimization Science, 5 (1984), 217-225. 99. Some structural properties of w-languages, Proc. of the Conf. on Computer Science and Engineering, Varna 1984, 56-63, Sophia, 1988 (with H. Jiirgensen). 100. Varieties of monoids and classes of w-languages, Proceedings of the Conference on Theory and Applications of Semigroups, Greifswald, G.D.R., 1984, 62-67 (with H. Jiirgensen). 101. QF-disjunctive languages, Papers on Automata Theory and Languages, 7 (1985), 1-28 (with Y. Guo and H. Shyr). 102. Infix codes, Proc. Fourth Hung. Computer Sci. Conf, Gyor, 1985, 25-29 (with H. Jiirgensen). 103. Monoids with disjunctive identity and their codes, Acta Mathematica, 47 (1986), 299-312 (with H. Jiirgensen). 104. Codes and compatible partial orders on free monoids, Proc. of the International Symposium on Ordered Algebraic Structures, 1984, Heldermann Verlag, Berlin, 1986, 323-333 (with H. Jiirgensen and H. Shyr). 105. F-disjunctive languages, Intern. J. Computer Mathematics, 18 (1986), 219237 (with Y. Guo and H. Shyr). 106. DOL schemes and recurrent words, in The Book of L (G. Rozenberg, A. Salomaa, eds.), Springer-Verlag, Berlin, 1986, 157-166 (with M. Ito).
439
107. E-convex infix codes, Order, 3 (1986), 55-59 (with Y. Guo and H. Shyr). 108. Disjunctive decomposition of languages, Theoretical Computer Science, 46 (1986), 47-51 (with Y. Guo and G. Xu). 109. Which monoids are syntactic monoids of w-languages?, J. of Information Processing and Cybernetics, 22 (1986), 513-526 (with H. Jurgensen). 110. Congruences associated with DOL-schemes, Proc. Amer. Math. Soc, 102 (1988), 787-793 (with M. Petrich). 111. Languages induced by certain homomorphisms of free monoids, Proc. Conference on Semigroups, Oberwolfach, 1986, Lecture Notes in Mathematics, 1320, Springer-Verlag, 1988, 260-280 (with M. Petrich). 112. Characterizations of locally transitive semiautomata, Papers on Automata Theory and Languages, IX (1987), 1-8 (with F. Gecseg). 113. Semaphore codes and ideals, J. Information and Optimization Science, 9 (1988), 73-83 (with Y. Guo and S.H. Zhang). 114. Relatively f-disjunctive languages, Semigroup Forum, 37 (1988), 289-299 (with Y. Guo and C. Reis). 115. Disjunctive languages and compatible partial orders, Theoretical Informatics and Applications, 23 (1989), 149-163 (with M. Ito and H. Shyr). 116. Anti-commutative languages and n-codes, Discrete Applied Mathematics, 24 (1989), 187-196 (with M. Ito, H. Jurgensen, and H. Shyr). 117. p-discrete languages, Proc. of the Conf. on Algebraic Theory of Codes and Related Topics, Kyoto, Japan, 1989, RIMS Kokyuroku, 697, 40-56 (with H. Shyr and S. Yu). 118. Adherence in semigroups, Proc. of the 13th Symposium on Semigroups, Kyoto Univ., Japan, 1989, 53-56 (with M. Ito and C. Reis). 119. n-prefix-suffix languages, Intern. J. Computer Mathematics, 30 (1989), 3756 (with M. Ito, H. Jurgensen, and H. Shyr). 120. A model of a five-dimensional universe, Speculations in Science and Technology, 13 (1990), 101-111. 121. The syntactic monoid of an infix code, Proc. Amer. Math. Soc, 109 (1990), 865-873 (with M. Petrich).
440
122. Outfix and infix codes and related classes of languages, J. Computer and System Sciences, 43 (1991), 484-508 (with M. Ito, H. Jiirgensen, and H. Shyr). 123. Shuffle relations and codes, J. Information and Optimization Sciences, 12 (1991), 441-449 (with S. Yu). 124. Skew-morphisms and systems, in Lindenmayer Systems (Memorial Volume), Springer-Verlag, Berlin, 1992, 437-454 (with M. Ito). 125. Languages whose n-elements subsets are codes, Theoretical Computer Science, 30 (1992), 325-344 (with M. Ito, H. Jiirgensen, and H. Shyr). 126. Congruences on free monoids and generalizations of codes, Soochow J. of Mathematics, 18 (1992), 419-430 (with M. Petrich). 127. Monogenic e-closed languages and dipolar words, Discrete Mathematics, 126 (1994), 339-348 (with H. Shyr and S. Yu). 128. Q-morphisms and QDOL systems, PU. M. A., Ser. A, 1, 3-4 (1990), 325327 (with M. Ito). 129. Right k-dense languages, Semigroup Forum, 48 (1994), 313-325 (with M. Ito). 130. Adherence in finitely generated free monoids, Congressus Numerantium, 95 (1993), 37-45) (with C. Reis and M. Ito). 131. Congruences, infix and cohesive prefix codes, Theoretical Computer Science, 136 (1994), 471-486 (with M. Ito). 132. Aperiodic languages and generalizations, in Mathematical Aspects of Natural and Formal Languages (Gh. Paun, ed.), World Scientific, Singapore, 1994, 233-243 (with L. Kari). 133. Languages and compatible relations on monoids, Mathematical Linguistics and Related Topics (Gh. Paun, ed.), The Publ. House of the Romanian Academy, Bucharest, 1995, 212-220 (with L. Kari). 134. Right shifting languages and their decompositions, Mathematical Linguistics and Related Topics (Gh. Paun, ed.), The Publ. House of the Romanian Academy, Bucharest, 1995, 195-199 (with M. Ito). 135. K-catenation and applications: k-prefix codes, J. Information and Optimization Sciences, 16 (1995), 263-276 (with L. Kari).
441
136. K-insertion and k-deletion closure of languages, Soochow J. Math., 21 (1995), 479-495 (with L. Kari). 137. Morphisms and associated congruences, Proc. of the 2nd Intern. Conf. Developments in Language Theory, Magdeburg, 1995, World Scientific, Singapore 1996, 119-128 (with L. Kari) 138. Languages and monoids with disjunctive identity, Collectanea Mathematica, 46 (1995), 97-107 (with L. Kari). 139. Omega-syntactic congruences, J. of Automata, Languages and Combinatorics, 1 (1996), 13-26 (with L. Kari). 140. Shuffle closed languages, Publicationes Mathematicae Debrecen, 48 (1996), 317-338 (with M. Ito and S. Yu). 141. The syntactic monoid of the semigroup generated by a maximal prefix code, Proc. Amer. Math. Soc, 124 (1996), 655-663 (with M. Petrich and C. Reis). 142. Contextual insertions/deletions and computability, Information and Computation, 131 (1966), 47-61 (with L. Kari). 143. Maximal and minimal solutions to languages equations, J. Computer and System Sciences, 53 (1996), 487-496 (with L. Kari). 144. Insertion and deletion closure of languages, Theoretical Computer Science, 183 (1997), 3-19 (with M. Ito and L. Kari). 145. Morphisms and primitivity, Bulletin of the EATCS, 61 (1997), 85-88 (with Gh. Paun). 146. At the crossroads of DNA computing and formal languages: Characterizing RE using insertion-deletion systems, Proc. 3rd DIMACS Workshop on DNA Based Computing, Philadelphia, 1997, 318-333 (with L. Kari, Gh. Paun, and S. Yu). 147. Word insertions and primitivity, Utilitas Mathematica, 53 (1998), 49-61 (with L. Kari) 148. Shuffle and scattered deletion closure of languages, Theoretical Computer Science, 245 (2000), 115-133 (with M. Ito and L. Kari).
442
149. Multiset processing by means of systems of finite state transducers, PreProc. of Workshop on Implementing Automata WIA99, Potsdam, August 1999, Preprint 5/1999 of Univ. Potsdam (0. Boldt, H. Jiirgensen, and L. Robbins, eds.), XV 1-17 (with Gh. Paun). 150. On the robustness of primitive words, Discrete Applied Mathematics, 2001 (with Gh. Paun, N. Santean, and S. Yu). 151. Tree-systems of morphisms, submitted, 2000 (with J. Dassow, Gh. Paun, and S. Yu).
•••»
ffi8iWords'
Semigroups,
Transductions F e s t s c h r i f t in H o n o r of • Gabriel Thierrin T h i s is an e x c e l l e n t c o l l e c t i o n of papers dealing w i t h c o m binatorics
on w o r d s ,
codes,
semigroups, automata, languages,
molecular
computing,
t r a n s d u c e r s , logics, etc., related t o the impressive w o r k of Gabriel T h i e r r i n . This v o l u m e is in honor of Professor T h i e r r i n on
the
o c c a s i o n of his 8 0 t h b i r t h d a y .
ISBN 981-02-4739-7
www. worldscientific. com 4802 he
Recommend Documents
Sign In