Language-theoretic problems in certain matrix monoids

Language-theoretic problems in certain matrix monoids

Theoretical Computer Science 601 (2015) 21–28 Contents lists available at ScienceDirect Theoretical Computer Science www.elsevier.com/locate/tcs La...

252KB Sizes 0 Downloads 65 Views

Theoretical Computer Science 601 (2015) 21–28

Contents lists available at ScienceDirect

Theoretical Computer Science www.elsevier.com/locate/tcs

Language-theoretic problems in certain matrix monoids Juha Honkala Department of Mathematics and Statistics, University of Turku, FI-20014 Turku, Finland

a r t i c l e

i n f o

a b s t r a c t

Article history: Received 30 December 2013 Accepted 10 April 2015 Available online 20 July 2015

We study problems inspired by language theory in certain matrix monoids which are extensions of free monoids. In particular, we characterize free two-element sets, morphisms and morphic equality sets in these monoids. © 2015 Elsevier B.V. All rights reserved.

Keywords: Matrix monoid Two-element code Equality set Post correspondence problem

1. Introduction It is well known that free monoids can be embedded in the monoid of upper-triangular 2 × 2 integer matrices. Such embeddings can be applied in proving various language-theoretic results. A well-known example is the proof of Ehrenfeucht’s conjecture given by Guba which uses the representation of words by 2 × 2 integer matrices (see [2]). As explained in detail in [2], Ehrenfeucht’s conjecture is equivalent to the statement that any system of equations over a finite monoid has an equivalent finite subsystem. In this paper we study problems inspired by language theory in certain matrix monoids. We will work mostly with matrices of the form



na 0

b 1



(1)

,

where n ≥ 2 is a fixed integer, a is a nonnegative integer and b is an arbitrary integer. Denote by Zn the monoid consisting of all these matrices. The monoid Zn is an extension of the free monoid Wn generated by the matrices



n 0

0 1

and given by

Wn =

     n 1 n n−1 , ,...,



0 1

na 0

b 1



0

1

 | a, b ∈ N, 0 ≤ b < na .

The freeness of Wn follows easily from the basic facts concerning the representation of integers in base n (see [2, page 464]). If we regard the given generators of Wn as letters of an n-letter alphabet, the exponent a of n in the matrix (1) gives the length of the corresponding word. Based on this, we will call a the length of the matrix (1).

E-mail address: juha.honkala@utu.fi. http://dx.doi.org/10.1016/j.tcs.2015.07.022 0304-3975/© 2015 Elsevier B.V. All rights reserved.

22

J. Honkala / Theoretical Computer Science 601 (2015) 21–28

When we consider the monoid Zn instead of Wn we get a larger monoid which contains infinitely many matrices having length 1. It also contains infinitely many matrices of length zero. Using language-theoretic terminology, Zn contains an infinite number of empty words and infinitely many letters. It is easy to see that all empty words in Zn are integer powers of one specific empty word obtained by taking a = 0 and b = 1 in (1). Further, all letters of Zn are obtained by multiplying one specific letter (obtained by taking a = 1 and b = 0) from the left by the various empty words. We now outline the contents of the paper. Section 2 contains basic definitions. In Section 3 we study what does it mean that a matrix is a prefix (resp. suffix, factor) of another matrix. We will also study what form the language-theoretic notions of conjugacy and primitivity take for matrices. In Section 4 we generalize for matrices of Zn the well-known fact that a two-element subset of a free monoid is a code if and only if the two words are not powers of a single word. In Section 5 we characterize the morphisms of Zn . In Section 6 we apply this result to find out all morphic equality sets in Zn . As a consequence we show that the Post correspondence problem is decidable in Zn . In the final section we show that Kleene’s theorem does not hold in Zn . In Section 7 we assume that the reader is familiar with the basics concerning recognizable and rational subsets of monoids (see [1,4]) but otherwise the paper is mostly self-contained. The motivation to study the problems we consider comes from language theory (see [3]). 2. Definitions As usual, let N, Z and Q be the sets of nonnegative integers, all integers and rational numbers. If n ≥ 2 is an integer, define



Zn = and

 Qn =



na 0

b 1

na 0

b 1



| a ∈ N, b ∈ Z 

 | a ∈ N, b ∈ Q .

These sets are multiplicative monoids. If s ≥ 1, a1 , . . . , as ∈ N and b1 , . . . , b s ∈ Q, we have



na1 0

b1 1



na2 0

b2 1





···

nas 0

bs 1





=

na1 +···+as 0

d 1



where

d = na1 +···+as−1 b s + · · · + na1 +a2 b3 + na1 b2 + b1 . In particular, if k ≥ 0 and a ≥ 1 are integers and b ∈ Q, we have



na 0

b 1



k =

nka 0

nka −1 b na −1



1

and



1 b 0 1

k

 =

1 kb 0 1

 .

A special role in Zn is played by two matrices E and F defined by



E=

1 1 0 1





and

F=

n 0 0 1

If a ∈ N and b ∈ Z we have



Eb =

1 b 0 1



and

 Eb F a =



na 0

.

b 1

 .

Hence

Zn = { E b F a | a ∈ N, b ∈ Z}. It follows that as a monoid Zn is generated by E, E −1 and F . In Zn we have F E = E n F . Next, regard N as an additive monoid and define the mapping  : Qn → N by

J. Honkala / Theoretical Computer Science 601 (2015) 21–28

23

  a n b )=a ( 0

1

for a ∈ N, b ∈ Q. The mapping  is a monoid morphism, because ( I ) = 0 and ( M N ) = ( M ) + ( N ) for M , N ∈ Qn . (Here I is the identity matrix.) The number ( M ) is called the length of the matrix M. In Zn a matrix M has length zero if and only if there is an integer b such that M = E b . Let M , N ∈ Zn . Then N is a prefix (resp. suffix) of M if there is a matrix K ∈ Zn such that M = N K (resp. M = K N). More generally, N is a factor of M if there exist matrices K , L ∈ Zn such that M = K N L. 3. Prefixes, suffixes and factors of matrices in Zn The following proposition indicates what it means that a matrix is a prefix, a suffix or a factor of another one. We also consider the problem whether two given matrices are both prefixes of a third one.

 Proposition 1. Let M = (i) (ii) (iii) (iv) (v) (vi)

na 0

b 1



 and N =

nc 0

d 1

 where a, c ∈ N and b, d ∈ Z.

N is a prefix of M if and only if a ≥ c and b ≡ d (mod nc ). N is a suffix of M if and only if a ≥ c. M is a suffix of N or N is a suffix of M. N is a factor of M if and only if a ≥ c. N is a factor of M if and only if N is a suffix of M. There exist matrices K , L ∈ Zn such that M K = N L if and only if b ≡ d (mod nmin{a,c } ).









nx y nu v Proof. Let K = and L = where x, u ∈ N and y , v ∈ Z. 0 1 0 1 Then M = N K if and only if a = c + x and b = nc y + d. This implies (i). If M = K N, then a = x + c. Hence a ≥ c. Conversely, if a ≥ c, then M = K N if we choose x = a − c and y = b − na−c d. This implies (ii). Now, by (ii) M is a suffix of N if a ≤ c and N is a suffix of M if a ≥ c. This implies (iii). Next, if M = K N L, then a = ( M ) ≥ ( N ) = c. The remaining part of (iv) is immediate by (ii). Now (v) follows by (ii) and (iv). Finally, to prove (vi) it suffices to observe that M K = N L if and only if a + x = c + u and na y + b = nc v + d. 2 As a corollary of Proposition 1 we obtain Levi’s lemma for Zn . Proposition 2. Let M , N , K , L ∈ Zn . Assume that ( M ) ≥ ( N ). If

MK = NL then there exists P ∈ Zn such that

M = NP

P K = L.

and

Proof. Let M and N be as in Proposition 1. Assume that M K = N L. By Proposition 1, (vi) we have b ≡ d (mod n( N ) ). By Proposition 1, (i), N is a prefix of M. Hence there exists P ∈ Zn such that M = N P . Consequently, N P K = N L which implies P K = L because N is nonsingular. 2 A nonempty word w is called primitive if there do not exist a word w 1 and an integer k ≥ 2 such that w = w k1 . We next consider a similar condition for matrices in Zn . (Observe that it is not advisable to call such matrices primitive since this term already has a different meaning for matrices.)

 Proposition 3. Let M =

na 0

b 1

 where a ∈ N and b ∈ Z. There is a matrix N ∈ Zn and an integer k ≥ 2 such that M = N k if and

only if either a = 0 and b = ±1 or a > 1 and there is a proper factor x ∈ N of a such that

na −1 nx −1

divides b.

Proof. If a = 0 and b = uv, where u , v ∈ Z and v ≥ 2, then



M=

1 0

u 1

v

.

If a > 1 and there exist x, y ∈ N and z ∈ Z such that a = xy, x < a and

na −1 z nx −1

= b, we have

24

J. Honkala / Theoretical Computer Science 601 (2015) 21–28

 M=

nx 0

z 1

y . 

Conversely, assume there is a matrix N =

nx 0

y 1

 ∈ Zn and an integer k ≥ 2 such that M = N k . If a = 0 then x = 0 and

b = ky. Hence b = ±1. If a > 0 we have



na 0

b 1



 =

nkx −1 n x −1

nkx 0



y

1

and, consequently, x is a proper factor of a (hence a > 1) and

na −1 nx −1

divides b.

2

Observe that if M ∈ Qn and ( M ) > 0, then there always exists N ∈ Qn such that M = N ( M ) . Two words w 1 and w 2 are called conjugates if there exist words w 3 and w 4 such that

w1 = w3 w4,

w2 = w4 w3.

We next consider a similar condition in Zn .









na b nc d and N = where a, c ∈ N and b, d ∈ Z. There exist matrices K , L ∈ Zn such that M = K L 0 1 0 1 and N = L K if and only if a = c and there exist integers u ∈ {0, 1, . . . , a} and v such that d = nu b + (1 − na ) v.

Proposition 4. Let M =

Proof. If M = K L and N = L K , then ( M ) = ( N ). Hence a = c. Assume a = c. If



M=

nx 0

y 1



nu 0

v 1





N=

and

nu 0

v 1



nx 0

y 1

 (2)

where x, u ∈ N, y , v ∈ Z, we have b = nx v + y and d = nu y + v. Hence d = nu b + (1 − na ) v where u ∈ {0, 1, . . . , a}. Conversely, if a = c and there exist integers u ∈ {0, 1, . . . , a} and v such that d = nu b + (1 − na ) v, then (2) holds if we take x = a − u and y = b − na−u v. 2 4. Free sets having two elements A set S ⊆ Zn is called free if for all s, t ≥ 0 and M 1 , . . . , M s , N 1 , . . . , N t ∈ S the condition

M 1 M 2 · · · M s = N 1 N 2 · · · Nt implies that s = t and M 1 = N 1 , . . . , M s = N s . It is well known that a two-element subset of a free monoid is a code if and only if the two words are not powers of a single word. In this section we prove a similar result for two-element subsets of Zn . Lemma 5. If M , N ∈ Zn , M = N and ( M ) = ( N ) > 0, then { M , N } is free. Proof. Let a = ( M ) = ( N ) and the upper right entries of M and N be b and d, respectively. If s ≥ 1 and K 1 , . . . , K s ∈ { M , N }, then the upper right entry of K 1 K 2 . . . K s is congruent with the upper right entry of K 1 modulo na . Hence the claim holds if b and d are not congruent modulo na . If, on the other hand, b = d + na x where x ∈ Z, then { M , N } is free if and only if { M 1 , N 1 } is free where M 1 and N 1 are matrices obtained from M and N by replacing b and d in the upper right corners of M and N by na x and 0, respectively. But now the freeness of { M 1 , N 1 } is obvious. 2 Theorem 6. Let M , N ∈ Zn and suppose M = N. Then { M , N } is not free if and only if ( M ) = 0 or ( N ) = 0 or there exist nonnegative integers s and t and a matrix K ∈ Zn such that M = K s and N = K t . Proof. First, assume that ( M ) = 0. Let M = E b and N = E d F c where c ∈ N and b, d ∈ Z. Then c

c

N M = Ed F c E b = En b Ed F c = Mn N . Hence { M , N } is not free. The case ( N ) = 0 is symmetric. Further, if there exist K and s, t having the desired properties, then M N = N M which implies that { M , N } is not free. Conversely, assume that { M , N } is not free. We prove the result by induction on ( M ) + ( N ). If ( M ) = 0 or ( N ) = 0, there is nothing to prove. Assume that ( M ) > 0 and ( N ) > 0 and assume that the claim holds for any two matrices of Zn such that the sum of their lengths is less than ( M ) + ( N ).

J. Honkala / Theoretical Computer Science 601 (2015) 21–28

25

Since { M , N } is not free, Lemma 5 implies that ( M ) = ( N ). By symmetry, assume that ( M ) > ( N ). By Proposition 1 there exists a matrix L ∈ Zn such that M = LN. If L = N, the claim holds. Assume L = N. Since { M , N } is not free, neither is { L , N }. Because ( L ) + ( N ) = ( M ) < ( M ) + ( N ), the inductive hypothesis implies that there exist nonnegative integers s and t and a matrix K ∈ Zn such that L = K s and N = K t . Hence M = LN = K s+t and N = K t . This implies the claim. 2 Corollary 7. Let M , N ∈ Zn . Then M N = N M if and only if at least one of the following conditions holds: (i) (ii) (iii) (iv)

M = I, N = I, ( M ) = ( N ) = 0, ( M ) > 0, ( N ) > 0 and there exist integers s, t ≥ 1 and K ∈ Zn such that M = K s and N = K t .

Proof. If at least one of (i)–(iv) holds it is easy to see that M N = N M. Assume conversely that M N = N M, M = I and N = I . If ( M ) > 0 and ( N ) > 0, we have (iv) by Theorem 6. Assume that ( M ) = 0. Then M = E b where b ∈ Z, b = 0. If N = E d F c where c ∈ N, d ∈ Z, the equation M N = N M implies that b = nc b. Hence ( N ) = c = 0. Finally, the case ( N ) = 0 is symmetric. 2 Since the monoid Zn is generated by the three matrices F , E , E −1 , a straightforward generalization of the defect theorem is not interesting for sets having at least four elements. For three-element sets it is false. The set { F , E , E −1 } is not free but there do not exist two matrices M , N ∈ Zn such that F , E , E −1 could be expressed as products of M and N. 5. Morphisms of Zn The aim of this section is to characterize the morphisms of Zn . Lemma 8. Let h : Zn → Zn be a morphism. Then (h( E )) = (h( E −1 )) = 0. Proof. Since E E −1 = I we have (h( E )) + (h( E −1 )) = 0 which implies that (h( E )) = (h( E −1 )) = 0.

2

Lemma 9. Let h : Zn → Zn be a morphism. If h( E ) = I then (h( F )) = 1. Proof. Assume that h( E ) = I . Let

 h( E ) =

1 e 0 1



 and h( F ) =

nc 0

d 1



where c ∈ N, d, e ∈ Z and e = 0. Since E n F = F E we have d + ne = nc e + d. Now e = 0 implies that (h( F )) = c = 1.

2

A morphism h : Zn → Zn is length preserving if (h( M )) = ( M ) for all M ∈ Zn . Similarly, h is length increasing (resp. erasing) if (h( M )) > ( M ) (resp. (h( M )) = 0) for all M ∈ Zn having nonzero length (resp. for all M ∈ Zn ). We show next that any morphism of Zn is of one of these three types. Theorem 10. Let h : Zn → Zn be a morphism. Then h is length preserving, length increasing or erasing according to whether (h( F )) = 1, (h( F )) > 1 or (h( F )) = 0. Proof. Let M = E b F a where a = ( M ) ∈ N and b ∈ Z. Then

(h( M )) = (h( E b F a )) = (h( E b )) + (h( F a )) = a(h( F )) = (h( F ))( M ). 2

This implies the claim.

We next characterize the morphisms of these three types. Proposition 11. A mapping h : Zn → Zn is a length preserving morphism if and only if there exist d, e ∈ Z such that for all a ∈ N, b ∈ Z we have



h(

na 0



b )= 1



na 0

na −1 d n −1

1

+ be



.

(3)

26

J. Honkala / Theoretical Computer Science 601 (2015) 21–28

Proof. Suppose h is a length preserving morphism. Then there exist d, e ∈ Z such that h( E ) = E e and h( F ) = E d F . Hence, for a ∈ N, b ∈ Z, we have

 h(

na 0



b ) = h( E b F a ) = 1



1 e 0 1

b 

n d 0 1

a

 =

1 be 0 1



na −1 d n −1

na 0



 =

1

na −1 d n −1

na 0

+ be

 .

1

Conversely, if h satisfies (3) and x, u ∈ N, y , v ∈ Z, we have h( I ) = I and

 x n h( 0

y 1



nu 0

v 1

    x+u n nx v + y nx+u ) = h( )= 0

 = Hence h is a morphism.

1

n −1 d n −1 x

nx 0

+ ye



1

nx+u −1 d n −1

0

nu 0

n −1 d n −1 u

+ ve



+ (nx v + y )e 1

 x n = h( 0

1

y 1



  u n )h( 0

v 1

 ).

2

Proposition 12. A mapping h : Zn → Zn is a length increasing morphism if and only if there exist c , d ∈ Z, c > 1, such that for all a ∈ N, b ∈ Z we have

 h(

na 0



b )= 1



nac 0

nac −1 d n c −1



1

(4)

.

Proof. Suppose h is a length increasing morphism. By Lemma 9, h( E ) = I . Let c and d be integers such that h( F ) = E d F c . Since h is length increasing, c > 1. Then for a ∈ N, b ∈ Z we have

 h(

na 0



b ) = h( E b F a ) = 1



nc 0

d 1

a

 =



nac −1 d n c −1

nac 0

.

1

Conversely, if there exist c , d ∈ Z, c > 1, such that (4) holds and x, u ∈ N, y , v ∈ Z, we have h( I ) = I and

 x n h( 0

y 1



nu 0

v 1

    x+u n nx v + y n(x+u )c ) = h( )= 0

 =

1

nxc −1 d n c −1

nxc 0

0



1

Hence h is a length increasing morphism.

n(x+u )c −1 d n c −1

nuc 0

nuc −1 d n c −1

1





1

 x n = h( 0

y 1



 u n )h( 0

v 1

 ).

2

Proposition 13. A mapping h : Zn → Zn is an erasing morphism if and only if there exists d ∈ Z such that for all a ∈ N, b ∈ Z we have

 h(

na 0



b )= 1



1 ad 0 1

 (5)

.

Proof. Suppose h is an erasing morphism. By Lemma 9, h( E ) = I . Let h( F ) = E d where d ∈ Z. Then for a ∈ N, b ∈ Z, we have

 a    a  n b 1 d 1 ad b a ) = h( E F ) = . h( = 0

1

0 1

0

1

Conversely, if there exists d ∈ Z such that (5) holds and x, u ∈ N, y , v ∈ Z, we have h( I ) = I and

 h(

nx 0

y 1



nu 0

v 1

     x+u n nx v + y 1 (x + u )d ) = h( )= 

0

=

1 0

Hence h is an erasing morphism.

2

xd 1



1

1 0

ud 1



0

 x n = h( 0

1

y 1



 u n )h( 0

v 1

 ).

J. Honkala / Theoretical Computer Science 601 (2015) 21–28

27

6. Equality sets of morphisms If g : Zn → Zn and h : Zn → Zn are morphisms, their equality set E ( g , h) is defined by

E ( g , h) = { M ∈ Zn | g ( M ) = h( M )}. We also consider the subsets E 0 ( g , h) and E 1 ( g , h) of E ( g , h) defined by

E 0 ( g , h) = E ( g , h) ∩ { M ∈ Zn | ( M ) = 0} and

E 1 ( g , h) = E ( g , h) ∩ { M ∈ Zn | ( M ) > 0}. The following lemma is obvious. Lemma 14. Let g : Zn → Zn and h : Zn → Zn be morphisms. If g ( E ) = h( E ), then E 0 ( g , h) = { E b | b ∈ Z}. If g ( E ) = h( E ), then E 0 ( g , h ) = { I }. Also the next lemma is immediate. We say that two morphisms g and h of Zn are of the same type if both of them are erasing or both are length preserving or both are length increasing. Lemma 15. Let g : Zn → Zn and h : Zn → Zn be morphisms of different types. Then

E ( g , h) = E 0 ( g , h). It remains to compute the sets E 1 ( g , h) when g and h are morphisms of the same type. This is done in the following three lemmas. Lemma 16. Let g : Zn → Zn and h : Zn → Zn be two different length preserving morphisms. Let d1 , d2 , e 1 , e 2 be integers such that for all a ∈ N and b ∈ Z we have



g( and

na 0



b )= 1



na 0

1

+ be 1

na −1 d n −1 2

+ be 2



1

 a   a n b n h( )= 0

na −1 d n −1 1

0

1

 .

If e 1 = e 2 , then E 1 ( g , h) = ∅. If e 1 = e 2 , then



na E 1 ( g , h) = { 0

b 1



| a ∈ N, b ∈ Z and b =

na − 1 d1 − d2 n − 1 e2 − e1

}.

If e 1 = e 2 , there is an eventually periodic set S ⊆ N such that



E 1 ( g , h) = {

na 0

na −1 d1 −d2 n−1 e 2 −e 1

1



| a ∈ S }.

Proof. For a ∈ N, b ∈ Z, a ≥ 1, we have

   a  a n b n b ) = h( ) g( 0

1

0

1

if and only if

na − 1 n−1

d1 + be 1 =

na − 1 n−1

d2 + be 2 .

This implies the first two claims. The third claim follows because the sequence ((na − 1)(d1 − d2 ))a≥1 modulo (n − 1)(e 2 − e 1 ) is eventually periodic. 2 Lemma 17. Let g : Zn → Zn and h : Zn → Zn be two different length increasing morphisms. Then E 1 ( g , h) = ∅.

28

J. Honkala / Theoretical Computer Science 601 (2015) 21–28

Proof. The claim follows immediately by Proposition 12.

2

Lemma 18. Let g : Zn → Zn and h : Zn → Zn be two different erasing morphisms. Then E 1 ( g , h) = ∅. Proof. The claim follows immediately by Proposition 13.

2

By the previous lemmas, the equality set E ( g , h) of two given morphisms g : Zn → Zn and h : Zn → Zn can be computed effectively. This implies, in particular, that the PCP is decidable in Zn . This is stated more precisely in the following theorem. Theorem 19. It is decidable, given two morphisms g : Zn → Zn and h : Zn → Zn whether E ( g , h) = { I }. The intuitive reason for the decidability of the PCP in Zn is the scarcity of morphisms in Zn . Most free monoid morphisms cannot be lifted to a morphism of Zn . 7. Kleene’s theorem does not hold in Zn If Z is an arbitrary monoid, the class of recognizable (resp. rational) subsets of Z is denoted by Rec(Z ) (resp. Rat(Z )). If Z is a finitely generated free monoid, then Kleene’s theorem states that Rec(Z ) = Rat(Z ). In this final section we show that Rec(Zn ) is a proper subset of Rat(Zn ). Hence, Kleene’s theorem does not hold in Zn . To keep this section short we assume that the reader is familiar with the basics concerning recognizable and rational subsets of monoids (see [1,4]). For completeness, we recall one of the equivalent ways to define the classes of recognizable and rational subsets of a finitely generated monoid M. For this, let X be a finite alphabet and let α : X ∗ → M be a surjective morphism. Then

Rec(M) = {A ⊆ M | α −1 (A) is a rational language} and

Rat(M) = {A ⊆ M | there is a rational language L ⊆ X ∗ such that α (L) = A}. Because Zn is finitely generated, it follows directly that

Rec(Zn ) ⊆ Rat(Zn ) (see also [1,4]). To see that this inclusion is proper it is enough to show that { F } ∈ / Rec(Zn ). Assume on the contrary that { F } ∈ Rec(Zn ). Let x, y , z be three letters and define a morphism h : {x, y , z}∗ → Zn by

h(x) = E −1 ,

h( y ) = F ,

h( z) = E .

Then

h−1 ({ F }) ∩ x∗ yz∗ is a recognizable language (see [1,4]). On the other hand for a, b ∈ N we have h(xa yzb ) = F if and only if E −a F E b = F which holds if and only if E −a+nb = I or, equivalently, a = nb. Hence

h−1 ({ F }) ∩ x∗ yz∗ = {xnb yzb | b ∈ N}, which is not a recognizable language. This contradiction proves that { F } ∈ / Rec(Zn ) and concludes the proof that Kleene’s theorem does not hold in Zn . References [1] [2] [3] [4]

J. Berstel, Transductions and Context-Free Languages, Teubner, Stuttgart, 1979. T. Harju, J. Karhumäki, Morphisms, in: G. Rozenberg, A. Salomaa (Eds.), Handbook of Formal Languages, vol. 1, Springer, Berlin, 1997, pp. 439–510. G. Rozenberg, A. Salomaa (Eds.), Handbook of Formal Languages, Vols. 1–3, Springer, Berlin, 1997. J. Sakarovitch, Elements of Automata Theory, Cambridge University Press, Cambridge, 2009.