Finite Semigroups and Recognizable Languages An Introduction (1995)

# Finite Semigroups and Recognizable Languages An Introduction (1995)

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: FINITE SEMIGROUPS AND RECOGNIZABLE LANGUAGES: AN INTRODUCTION Bull Research and Development, rue Jean Jaures, 78340 Les Clayes-sous-Bois, FRANCE. Jean-Eric Pin ( ) This paper is an attempt to share with a larger audience some modern developments in the theory of nite automata. It is written for the mathematician who has a background in semigroup theory but knows next to nothing on automata and languages. No proofs are given, but the main results are illustrated by several examples and counterexamples. What is the topic of this theory ? It deals with languages, automata and semigroups, although recent developments have shown interesting connections with model theory in logic, symbolic dynamics and topology. Historically, in their attempt to formalize natural languages, linguists such as Chomsky gave a mathematical de nition of natural concepts such as words, languages or grammars: given a nite set A, a word on A is simply an element of the free monoid on A, and a language is a set of words. But since scientists are fond of classi cations of all sorts, language theory didn't escape to this mania. Chomsky established a rst hierarchy, based on his formal grammars. In this paper, we are interested in the recognizable languages, which form the lower level of the Chomsky hierarchy. A recognizable language can be described in terms of nite automata while, for the higher levels, more powerful machines, ranging from pushdown automata to Turing machines, are required. For this reason, problems on nite automata are often under-estimated, according to the vague | but totally erroneous | feeling ( ) 1. Foreword From 1st Sept 1993, LITP, Universite Paris VI, Tour 55-65, 4 Place Jussieu, 75252 Paris Cedex 05, FRANCE. E-mail: pin@litp.ibp.fr 2 J.E. Pin that \if a problem has been reduced to a question about nite automata, then it should be easy to solve". Kleene's theorem 23] is usually considered as the foundation of the theory. It shows that the class of recognizable languages (i.e. recognized by nite automata), coincides with the class of rational languages, which are given by rational expressions. Rational expressions can be thought of as a generalization of polynomials involving three operations: union (which plays the role of addition), product and star operation. An important corollary of Kleene's theorem is that rational languages are closed under complement. In the sixties, several classi cation schemes for the rational languages were proposed, based on the number of nested use of a particular operator (star or product, for instance). This led to the natural notions of star height, extended star height, dot-depth and concatenation level. However, the rst natural questions attached to these notions | \do they de ne strict hierarchies ?", \given a rational language, is there an algorithm for computing its star height, extended star height", etc. ? | appeared to be extremely di cult. Actually, several of them, like the hierarchy problem for the extended star height, are still open. A break-through was realized by Schutzenberger in the mid sixties 53]. Schutzenberger established the equivalence between nite automata and nite semigroups and showed that a nite monoid, called the syntactic monoid , is canonically attached to each recognizable language. Then he made a non trivial use of this invariant to characterize the languages of extended star height 0, also called star-free languages. Schutzenberger's theorem states that a language is star-free if and only if its syntactic monoid is aperiodic. Two other \syntactic" characterizations were obtained in the early seventies: Simon 57] proved that a language is of concatenation level 1 if and only if its syntactic monoid is J -trivial and Brzozowski-Simon 9] and independently, McNaughton 29] characterized an important subfamily of the languages of dot-depth one, the locally testable languages. These successes settled the power of the semigroup approach, but it was Eilenberg who discovered the appropriate framework to formulate this type of results 17]. Recall that a variety of nite monoids is a class of monoids closed under the taking of submonoids, quotients and nite direct product. Eilenberg's theorem states that varieties of nite monoids are in one to one correspondence with certain classes of recognizable languages, the varieties of languages. For instance, the rational languages correspond to the variety of all nite monoids, the star-free languages correspond to the variety of aperiodic monoids, and the piecewise testable languages correspond to the variety of J -trivial monoids. Numerous similar results have been established during the past fteen years and the theory of nite automata is now intimately related to the theory of nite semigroups. This had a considerable in uence on both theories: for instance algebraic de nitions such as the graph of a semigroup or the Schutzenberger product were motivated by considerations of language theory. The same thing can be said for the systematic study of power semigroups. In the other direction, Straubing's wreath product principle FINITE SEMIGROUPS AND RECOGNIZABLE LANGUAGES 3 has permitted to obtain important new results on recognizable languages. The open question of the decidability of the dot-depth is a good example of a problem that interests both theories (and also formal logic !). The paper is organized as follows. Sections 2 and 3 present the necessary material to understand Kleene's theorem. The equivalence between nite automata and nite semigroups is detailed in section 4. The various hierarchies of rational languages, based on star height, extended star height, dot-depth and concatenation level are introduced in section 5. The syntactic characterization of star-free, piecewise testable and locally testable languages are formulated in sections 6, 7 and 8, respectively. The variety theorem is stated in section 9 and some examples of its application are given in section 10. Other consequences about the hierarchies are analyzed in section 11 and recent developments are reported in section 12. The last section 13 contains the conclusion of this article. The terminology used in the theory of automata originates from various founts. Part of it came from linguistics, some other parts were introduced by physicists or by logicians. This gives sometimes a curious mixture but it is rather convenient in practice. An alphabet is a nite set whose elements are letters . Alphabets are usually denoted by capital letters: A, B , : : : and letters by lower case letters from the beginning of the latin alphabet: a, b, c; : : : A word (over the alphabet A) is a nite sequence (a1 ; a2 ; : : : ; an ) of letters of A; the integer n is the length of the word. In practice, the notation (a1 ; a2 ; : : : ; an ) is shortened to a1 a2 an . The empty word, which is the unique word of length 0, is denoted by 1. Given a letter a, the number of occurrences of a in a word u is denoted by juja . For instance, jabbabja = 2 and jabbabjb = 3. The (concatenation) product of two words u = a1 a2 ap and v = b1 b2 bq is the word uv = a1 a2 ap b1 b2 bq . The product is an associative operation on words. The set of all words on the alphabet A is denoted by A . Equipped with the product of words, it is a monoid, with the empty word as an identity. It is in fact the free monoid on the set A. The set of non-empty words is denoted by A+ ; it is the free semigroup on the set A. A language of A is a set of words over A, that is, a subset of A . The rational operations on languages are the three operations union, product and star, de ned as follows (1) Union : L1 + L2 = fu j u 2 L1 or u 2 L2 g (2) Product : L1 L2 = fu1 u2 j u1 2 L1 and u2 2 L2 g (3) Star : L = fu1 un j n 0 and u1 ; : : : ; un 2 Lg It is also convenient to introduce the operator L+ = LL = fu1 un j n > 0 and u1 ; : : : ; un 2 Lg 2. Rational and recognizable sets 4 J.E. Pin Note that L+ is exactly the subsemigroup of A generated by L, while L is the submonoid of A generated by L. The set of rational languages of A is the smallest set of languages of A containing the nite languages and closed under nite union, nite product and star. For instance, (a + ab) ab + (ba b) denotes a rational language on the alphabet fa; bg. The set of rational languages of A+ is the smallest set of languages of A+ containing the nite languages and closed under nite union, product and plus. It is easy to verify that the rational languages of A+ are exactly the rational languages of A that do not contain the empty word. It may seem a little awkward to have two separate de nitions for the rational languages: one for the free monoid A and another one for the free semigroup A+ . There are actually two parallel theories and although the di erence between them may appear of no great signi cance at rst sight, it turns out to be crucial. The reason is that the algebraic classi cation of rational languages, as given in the forthcoming sections, rests on the notion of varieties of nite monoids (for languages of the free monoid) or varieties of nite semigroups (for languages of the free semigroup). And varieties of nite semigroups cannot be considered as varieties of nite monoids. The simplest example is the variety of nite nilpotent semigroups, which, as we shall see, characterizes the nite or co nite languages of the free semigroup. If one tries, in a naive attempt, to add an identity to convert each nilpotent semigroup into a monoid, the variety of nite monoids obtained in this way is the variety of all nite monoids whose idempotents commute with every element. But this variety of monoids does not characterize the nite-co nite languages of the free monoid. Rational languages are often called regular sets in the literature. However, in the author's opinion, this last term should be avoided for two reasons. First, it interferes with the standard use of this word in semigroup theory. Second, the term rational has a sound mathematical foundation. Indeed one can extend the theory of languages to series with non commutative variables over a commutative P ring or semiring( ) k. Such series can be written as s = u2A (s; u)u, where (s; u) is an element of k. In this context, languages appear naturally as series over the boolean semiring. Now the rational series form the smallest set of series R satisfying the following conditions: (1) Every polynomial is in R, (2) R is a semiring under the usual sum and product of series, P (3) If s is a series in R such that (s; 1) = 0, then s = n 0 sn belongs to R. ( ) A semiring is a set k equipped with an addition and a multiplication. It is a commutative monoid with identity 0 for the addition and a monoid with identity 1 for the multiplication. Multiplication is distributive over addition and 0 satis es 0x = x0 = 0 for every x 2 k. The simplest example of a semiring which is not a ring is the boolean semiring B = f0; 1g de ned by 0 + 0 = 0, 0 + 1 = 1 + 1 = 1 + 0 = 1, 1:1 = 1 and 1: 0 = 0 : 0 = 0 : 1 = 0 . FINITE SEMIGROUPS AND RECOGNIZABLE LANGUAGES 5 Note that if k is a ring, then s = (1 ? s)?1 . In particular, in the one variable case, this de nition coincide with the usual de nition of rational series, which explains the terminology. We shall not detail any further this nice extension of the theory of languages, but we refer the interested reader to 4] for more details. A nite (non deterministic) automaton is a quintuple A = (Q; A; E; I; F ) where Q is a nite set (the set of states ), A is an alphabet, E is a subset of Q A Q, called the set of transitions and I and F are subsets of Q, called the set of initial and nal states, respectively. Two transitions (p; a; q) and (p0 ; a0 ; q0 ) are consecutive if q = p0 . A path in A is a nite sequence of consecutive transitions 3. Finite automata and recognizable sets e0 = (q0 ; a0 ; q1 ); e1 = (q1 ; a1 ; q2 ); : : : ; en?1 = (qn?1 ; an?1 ; qn ) qn?1 an?1 qn ?! The state q0 is the origin of the path, the state qn is its end , and the word x = a0 a1 an?1 is its label . It is convenient to have also, for each state q, an empty path of label 1 from q to q. A path in A is successful if its origin is in I and its end is in F . The language recognized by A is the set, denoted L (A), of the labels of all successful paths of A. A language X is recognizable if there exists a nite automaton A such that X = L (A). Two automata are said to be equivalent if they recognize a0 a1 q0 ?! q1 ?! q2 also denoted the same language. Automata are conveniently represented by labeled graphs, as in the example below. Incoming arrows indicate initial states and outgoing arrows indicate nal states. Example 3.1. Let A = (f1; 2g; fa; bg; E; f1g; f2g) be an automaton, with E = f(1; a; 1); (1; b; 1); (1; a; 2)g. The path (1; a; 1)(1; b; 1)(1; a; 2) is a successful path of label aba. The path (1; a; 1)(1; b; 1)(1; a; 1) has the same label but is unsuccessful since its end is 1. a, b 1 a 2 an a. Figure 3.1. An automaton. The set of words accepted by A is L (A) = A a, the set of all words ending with In the case of the free semigroup, the de nitions are the same, except that we omit the empty paths of label 1. In this case, the language recognized by A is denoted L+ (A). Kleene's theorem states the equivalence between automata and rational expressions. 6 J.E. Pin Theorem 3.1. A language is rational if and only if it is recognizable. In fact, there is one version of Kleene's theorem for the free semigroup and one version for the free monoid. The proof of Kleene's theorem can be found in most books of automata theory 21]. An automaton is deterministic if it has exactly one initial state, usually denoted q0 and if E contains no pair of transitions of the form (q; a; q1 ); (q; a; q2 ) with q1 6= q2 . a q a q 2 q1 In this case, each letter a de nes a partial function from Q to Q, which associates with every state q the unique state q:a, if it exists, such that (q; a; q:a) 2 E . This can be extended into a right action of A on Q by setting, for every q 2 Q, a 2 A and u 2 A : Figure 3.2. The forbidden pattern in a deterministic automaton. q:1 = q n q:(ua) = (q:u):aned if q:u and (q:u):a are de ned unde otherwise One can show that every nite automaton is equivalent to a deterministic one, in the sense that they recognize the same language. States which cannot be reached from the initial state or from which one cannot access to any nal state are clearly useless. This leads to the following de nition. A deterministic automaton A = (Q; A; E; q0 ; F ) is trim if for every state q 2 Q there exist two words u and v such that q0 :u = q and q:v 2 F . It is not di cult to see that every deterministic automaton is equivalent to a trim one. Deterministic automata are partially ordered as follows. Let A = (Q; A; E; q0 ; F ) 0 and A0 = (Q0 ; A; E 0 ; q0 ; F 0 ) be two deterministic automata. Then A A0 if there 0 is a surjective function ' : Q ! Q0 such that '(q0 ) = q0 , '?1 (F 0 ) = F and, for every u 2 A and q 2 Q, '(q:u) = '(q):u. One can show that, amongst the trim deterministic automata recognizing a given recognizable language L, there is a minimal one for this partial order. This automaton is called the minimal automaton of L. Again, there are standard algorithms for minimizing a given nite automaton 21]. FINITE SEMIGROUPS AND RECOGNIZABLE LANGUAGES 7 In this section, we turn to a more algebraic de nition of the recognizable sets, using semigroups in place of automata. Although this de nition is more abstract than the de nition using automata, it is more suitable to handle the ne structure of recognizable sets. Indeed, as illustrated in the next sections, semigroups provide a powerful and systematic tool to classify recognizable sets. We treat the case of the free semigroup. For free monoids, just replace every occurrence of \A+ " by \A " and \semigroup" by \monoid" in the de nitions below. The abstract de nition of recognizable sets is based on the following observation. Let A = (Q; A; E; I; F ) be a nite automaton. To each word u 2 A+ , there corresponds a boolean square matrix of size Card(Q), denoted by (u), and de ned by n 1 if there exists a path from p to q with label u (u)p;q = 0 otherwise It is not di cult to see that is a semigroup morphism from A+ into the multiplicative semigroup of square boolean matrices of size Card(Q). Furthermore, a word u is recognized by A if and only if (u)p;q = 1 for some initial state p and some nal state q. Therefore, a word is recognized by A if and only if (u) 2 fm 2 (A+ ) j mp;q = 1 for some p 2 I and q 2 F g. The semigroup (A+ ) is called the transition semigroup of A, denoted S (A). Example 4.1. Let A = (Q; A; E; I; F ) be the automaton represented below a a 1 b 2 a,b 4. Automata and semigroups Figure 4.1. A non deterministic automaton. Here Q = f1; 2g, A = fa; bg and E = f(1; a; 1); (1; a; 2); (2; a; 2); (2; b; 1); (2; b; 2)g, I = f1g, F = f2g, whence (a) = 1 1 0 1 (ab) = 1 1 1 1 (b) = 0 0 1 1 (ba) = (bb) = (b) (aa) = (a) Thus (A+ ) = f 0 0 ; 1 1 ; 1 1 g. 1 1 0 1 1 1 This leads to the following de nition. A semigroup morphism ' : A+ ! S recognizes a language L A+ if L = '?1 '(L), that is, if u 2 L and '(u) = '(v) implies v 2 L. This is also equivalent to saying that there is a subset P of S ? ? ? 8 J.E. Pin such that L = '?1 (P ). By extension, a semigroup S recognizes a language L if there exists a semigroup morphism ' : A+ ! S that recognizes L. As shown by the previous example, a set recognized by a nite automaton is recognized by the transition semigroup of this automaton. Proposition 4.1. If a nite automaton recognizes a language L, then S (A) recognizes L. The previous computation can be simpli ed if A is deterministic. Indeed, in this case, the transition semigroup of A is naturally embedded into the semigroup of partial functions on Q under composition. Example 4.2. Let A be the deterministic automaton represented below. a 1 b 2 Figure 4.2. A deterministic automaton The transition semigroup S (A) of A contains ve elements which correspond to the words a, b, ab, ba and aa. If one identi es the elements of S (A) with these words, one has the relations aba = a, bab = b and bb = aa. Thus S (A) is the aperiodic Brandt semigroup BA . Here is the transition table of A: 2 a b aa ab ba ? 1 ? ? 1 ? ? 2 1 2 ? 2 Conversely, given a semigroup morphism ' : A+ ! S recognizing a subset X of A+ , one can build a nite automaton recognizing X as follows. Denote by S 1 the monoid equal to S if S has an identity and to S f1g otherwise. Take the right representation of A on S 1 de ned by s:a = s'(a). This de nes a deterministic automaton A = (S 1 ; A; E; f1g; P ), where E = f(s; a; s:a) j s 2 S 1 ; a 2 Ag. FINITE SEMIGROUPS AND RECOGNIZABLE LANGUAGES s a s(a) 9 This automaton recognizes L and thus, the two notions of recognizable sets (by nite automata and by nite semigroups) are equivalent. Example 4.3. Let A = fa; b; cg and let S = f1; a; bg be the three element monoid de ned by a2 = a, b2 = b, ab = b and ba = a. Let ' : A+ ! S be the semigroup morphism de ned by '(a) = a, '(b) = b and '(c) = 1 and let P = fag. Then '?1 (P ) = A ac and the construction above yields the automaton represented in gure 4.4: c 1 a b a,c a a b b,c b Figure 4.3. The transitions of A. Now, Kleene's theorem can be reformulated as follows. + Figure 4.4. The automaton associated with S . Theorem 4.2. Let L be a language of A . The following conditions are equivalent. (1) (2) (3) (4) L is recognized by a nite automaton, L is recognized by a nite deterministic automaton, L is recognized by a nite semigroup, L is rational. Kleene's theorem has important consequences. Corollary 4.3. Recognizable languages are closed under nite boolean operations ( ) , inverse morphisms and morphisms. The trick is that it is easy to prove the last property (closure under morphisms) for rational sets and the other ones for recognizable sets. Here are two examples to illustrate these techniques: ( ) Boolean operations comprise union, intersection, complementation and set di erence. 10 + J.E. Pin + let L = a b + bab be a rational set. Then '(L) = (aba) ca + caabaca is a rational set. Example 4.4. (Closure of recognizable sets under morphism). Let ' : fa; bg ! fa; b; cg be the semigroup morphism de ned by '(a) = aba and '(b) = ca and Example 4.5. (Closure of recognizable sets under complement). Let L be a recognizable set. Then there exists a nite semigroup S , a semigroup morphism ' : A+ ! S and a subset P of S such that L = '?1 (P ). Now A+ n L = '?1 (S n P ) and thus the complement of L is recognizable. The patient reader can, as an exercise, prove the remaining properties by using either semigroups or automata. The impatient reader may consult 16,37]. Let L be a recognizable language of A+ . Amongst the nite semigroups that recognize X , there is a minimal one (with respect to division). This nite semigroup is called the syntactic semigroup of L. It can be de ned directly as the quotient of A+ under the congruence L de ned by u L v if and only if, for every x; y 2 A , xuy 2 L () xvy 2 L. It is also equal to the transition semigroup of the minimal automaton of L. This last property is especially useful for practical computations. It is a good exercise to take a rational expression at random, to compute the minimal automaton of the language represented by this rational expression and then to compute the syntactic semigroup of the language. See examples 6.1 and 7.2 below for outlines of such computations. Kleene's theorem shows that recognizable languages are closed under complementation. Therefore, every recognizable language can be represented by a extended rational expression , that is, a formal expression constructed from the letters by mean of the operations union, product, star and complement. In order to keep concise algebraic notations, we shall denote by Lc the complement of the language L( ) , by 0 the empty language and by u the language fug, for every word u. In particular, the language f1g, containing the empty word, is denoted 1. These notations are coherent with the intuitive formul 1L = L1 = L and 0L = L0 = 0 which hold for every language L. For instance, if A = fa; bg, the expression ?0c(ab + ba)0c c + (aba) c represents the language (A abA A baA ) n (aba) of all words containing the factors ab and ba which are not powers of aba. Thus we have an algebra on A with four operations: +, :, and c . Now a natural attempt to classify recognizable languages is to nd a notion analogous with the degree of a polynomial for these extended rational expressions. It is a remarkable fact that all the hierarchies based on these \extended degrees" suggested so far lead to some extremely di cult problems, most of which are still open. ( ) 5. Early attempts to classify recognizable languages If L is a language of A , the complement of L is A complement is A+ n L n L; if L is a language of A , the + FINITE SEMIGROUPS AND RECOGNIZABLE LANGUAGES 11 The rst proposal concerned the star operation. The star height of an extended rational expression is de ned inductively as follows: (1) The star height of the basic languages is 0. Formally sh(0) = 0 sh(1) = 0 and sh(a) = 0 for every letter a sh(ec ) = sh(e) (2) Union, product and complement do not a ect star height. If e and f are two extended rational expressions, then sh(e + f ) = sh(ef ) = maxfsh(e); sh(f )g sh(e ) = sh(e) + 1 (3) Star increases star height. For each extended rational expression e, Thus the star height counts the number of nested uses of the star operation. For instance (a + bc a ) + (b ab ) (b a + b) is an extended rational expression of star height 3. Now, the extended star height ( ) of a recognizable language L is the minimum of the star heights of the extended rational expressions representing L esh(L) = minfsh(e) j e is an extended rational expression for L g The di culty in computing the extended star height is that a given language can be represented in many di erent ways by an extended rational expression ! The languages of extended star height 0 (or star-free languages ) are characterized by a beautiful theorem of Schutzenberger that will be presented in section 6.1. Schutzenberger's theorem implies the existence of languages of extended star height 1, such as (aa) on the alphabet fag, but, as surprising as it may seem, nobody has been able so far to prove the existence of a language of extended star height greater than 1, although the general feeling is that such languages do exist. In the opposite direction, our knowledge of the languages proven to be of extended star height 1 is rather poor (see 46,51,52] for recent advances on this topic). The star height of a recognizable language is obtained by considering rational expressions instead of extended rational expressions 15]. sh(L) = minfstar height(e) j e is a rational expression for L g That is, one simply removes complement from the list of the basic operations. This time, the corresponding hierarchy was proved to be in nite by Dejean and Schutzenberger 14]. ( ) also called generalized star height 12 J.E. Pin Theorem 5.1. For each n 0, there exists a language of star height n. It is easy to see that the languages of star height 0 are the nite languages, but the e ective characterization of the other levels was left open for several years until Hashiguchi rst settled the problem for star height 1 18] and a few years later for the general case 19]. Theorem 5.2. There is an algorithm to determine the star height of a given recognizable language. Hashiguchi's rst paper is now well understood, although it is still a very di cult result, but volunteers are called to simplify the very long induction proof of the second paper. The second proposal to construct hierarchies was to ignore the star operation (which amounts to working with star-free languages) and to consider the concatenation product or, more precisely, a variation of it, called the marked concatenation product . Given languages L0 , L1 , : : : , Ln and letters a1 , a2 , : : : , an , the product of L0 , : : : Ln marked by a1 , : : : an is the language L0 a1 L1 a2 an Ln . As product is often denoted by a dot, Brzozowski de ned the \dot-depth" of languages of the free semigroup 5]. Later on, Therien (implicitly) and Straubing (explicitly) introduced a similar notion (often called the concatenation level in the literature) for the languages of the free monoid. The languages of dot-depth 0 are the nite or co nite languages, while the languages of concatenation level 0 are A and the empty language 0. Otherwise, the two hierarchies are constructed in the same way and count the number of alternations in the use of the two di erent types of operations: boolean operations and marked product. More precisely, the languages of dot-depth (resp. concatenation level) n + 1 are the nite boolean combinations of marked products of the form L0 a1 L1 a2 a k Lk where L0 , L1 , : : : , Lk are languages of dot-depth (resp. concatenation level) n and a1 , : : : , ak are letters. Note that a language of dot-depth (resp. concatenation level) m is also a language of dot-depth (resp. concatenation level) n for every n m. Brzozowski and Knast 8] have shown that the hierarchy is strict: if A contains at least two letters, then for every n, there exist some languages of dot-depth (resp. level) n + 1 that are not of level n. It is still an outstanding open problem to know whether there is an algorithm to compute the dot-depth (resp. concatenation level) of a given star-free language. The problem has been solved positively, however, for the dot-depth (resp. concatenation level) 1: there is an algorithm to decide whether a language is of dot-depth (resp. concatenation level) 1. These results are detailed in sections 7 and 11. FINITE SEMIGROUPS AND RECOGNIZABLE LANGUAGES 13 The other partial results concerning these hierarchies are brie y reviewed in section 11. Another remarkable fact about these hierarchies is their connections with some hierarchies of formal logic. See the article of W. Thomas in this volume or the survey article 41]. But it is time for us to hark back to Schutzenberger's theorem on star-free sets. 6. Star-free languages The set of star-free subsets of A is the smallest set of subsets of A containing the nite sets and closed under nite boolean operations and product. For instance, A is star-free, since A is the complement of the empty set. More generally, if B is a subset of the alphabet A, the set B is also star-free since B is the complement of the set of words that contain at least one letter of B 0 = A n B . This leads to the following star-free expression B = A n A (A n B )A = (0c (A n B )0c )c = (0c (Ac B )c 0c )c If A = fa; bg, the set (ab) is star-free, since (ab) is the set of words not beginning with b, not nishing by a and containing neither the factor aa, nor the factor bb. This gives the star-free expression (ab) = A n bA ? A a A aaA ? A bbA = b0c + 0c a + 0c aa0c + 0c bb0c c ? Readers may convince themselves that the sets fab; bag and a(ab) b also are star-free but may also wonder whether there exist any non star-free rational sets. In fact, there are some, for instance the sets (aa) and fb; abag , or similar examples that can be derived from the algebraic approach presented below. Let S be a nite semigroup and let s be an element of S . Then the subsemigroup of S generated by s contains a unique idempotent, denoted s! . Recall that a nite semigroup M is aperiodic if and only if, for every x 2 M , x! = x!+1 . This notion is in some sense \orthogonal" to the notion of group. Indeed, one can show that a semigroup is aperiodic if and only if it is H-trivial, or, equivalently, if it contains no non-trivial subgroup. The connection between aperiodic semigroups and star-free sets was established by Schutzenberger 53]. Theorem 6.1. A recognizable subset of A is star-free if and only if its syntactic monoid is aperiodic. There are essentially two techniques to prove this result. The original proof of Schutzenberger 53,37,22], slightly simpli ed in 32], is by induction on the J depth of the syntactic semigroup. The second proof 11,31] makes use of a weak form of the Krohn-Rhodes theorem: every aperiodic nite semigroup divides a wreath product of copies of the monoid U2 = f1; a; bg, given by the multiplication table aa = a, ab = b, ba = b and bb = b. 14 language is star-free. J.E. Pin ( ) Corollary 6.2. There is an algorithm to decide whether a given recognizable Given the minimal automaton A of the language, the algorithm consists to check whether the transition monoid of M is aperiodic. The complexity of this algorithm is analyzed in 10,58]. Example 6.1. Let A = fa; bg and consider the set L = (ab) . Its minimal automaton is represented below: a 1 b 2 The transitions and the relations de ning the syntactic monoid M of L are given in the following tables 1 2 a 2 ? b ? 1 1 Figure 6.1. The minimal automaton of (ab) . aa ? ? ab 1 ? ba ? 2 a2 = b2 = 0 aba = a bab = b Since a2 = a3 , b2 = b3 , (ab)2 = ab and (ba)2 = ba, M is aperiodic and thus L is star-free. Consider now the set L0 = (aa) . Its minimal automaton is represented below: a 1 a 2 Figure 6.2. The minimal automaton of (aa) . ( ) A recognizable set can be given either by a nite automaton, by a nite semigroup or by a rational expression since there are standard algorithms to pass from one representation to the other. FINITE SEMIGROUPS AND RECOGNIZABLE LANGUAGES 15 The transitions and the relations de ning the syntactic monoid M 0 of L0 are given in the following tables 1 1 2 a3 = a a 2 1 b=0 b ? ? aa 1 2 Thus M 0 is not aperiodic and hence L0 is not star-free. Recall that the languages of concatenation level 0 of A are A and 0. According to the general de nition, the languages of concatenation level 1 are the nite boolean combinations of the languages of the form A a1 A a2 A A ak A , where k 0 and ai 2 A. The languages of this form are called piecewise testable . Intuitively, such a language can be recognized by an automaton that one could call a Hydra automaton . a 1 a2 a 3 a 4 a 5 1 2 3 ... 4 an 7. Piecewise testable languages Finite Memory Figure 7.1. A Hydra automaton with four heads. Such an automaton has a nite number h of heads, each of which can read a letter of the input word. The heads are ordered, so that together they permit to read a subword (in the sense of a subsequence of non necessarily consecutive letters) of the input word. The automaton computes in this way the set of all subwords of length h of the input word. This set is then compared to the nite collection of sets of words contained in the memory. If it occurs in the memory, the word is accepted, otherwise it is rejected. For instance, for the language (A aA bA aA \ A bA bA aA ) n (A aA bA bA A bA bA bA ), the memory would contain the collection of all sets of words of length 3 containing aba and bba but containing neither abb nor bbb. Piecewise testable languages are characterized by a deep result of I. Simon 57]. 16 J.E. Pin Theorem 7.1. A language of A is piecewise testable if and only if its syntactic monoid is J -trivial, or, equivalently, if it satis es the equations x! = x!+1 and (xy)! = (yx)! . Corollary 7.2. There is an algorithm to decide whether a given star-free language is of concatenation level 1. Given the minimal automaton A of the language, the algorithm consists in checking whether the transition monoid of M is J -trivial. Actually, this condition can be directly checked on A in polynomial time 10,58]. There exist several proofs of Simon's theorem 2,57,69,58]. The central argument of Simon's original proof 57] is a careful study of the combinatorics of the subword relation. Stern's proof 58] borrows some ideas from model theory. The proof of Straubing and Therien 69] is the only one that avoids totally combinatorics on words. In the spirit of the proof of Schutzenberger, it works by induction on the cardinality of the syntactic monoid. The proof of Almeida 2] is based on implicit operations (see the papers of J. Almeida and P. Weil in this volume for more details). Example 7.1. Let A = fa; b; cg and let L = A abA . The minimal automaton of L is represented below b, c 1 c a a 2 b a, b, c 3 Figure 7.2. The minimal automaton of L. The transitions and the relations de ning the syntactic monoid M of L are given in the following tables a2 = a 1 1 2 3 ab = 0 a 2 2 3 ac = c b2 = b b 1 3 3 bc = b c 1 1 3 ca = a ab 3 3 3 cb = c ba 2 3 3 c2 = c The J -class structure of M is represented in the following diagram. FINITE SEMIGROUPS AND RECOGNIZABLE LANGUAGES 1 17 a ba 0 c b Figure 7.3. The J -classes of M . In particular, a J c and thus M is not J -trivial. Therefore L is not piecewise testable. Example 7.2. Consider now the language L0 = A abA on the alphabet A = fa; bg. Then the minimal automaton of L0 is obtained from that of L by erasing the transitions with label c. b 1 a a 2 b a, b 3 Figure 7.4. The minimal automaton of L0 . The transitions and the relations de ning the syntactic monoid M 0 of L0 are given in the following tables 1 1 a 2 b 1 ab 3 ba 2 2 2 3 3 3 3 3 3 3 3 a2 = a ab = 0 b2 = b The J -class structure of M 0 is represented in the following diagram. 18 J.E. Pin 1 a ba 0 b Thus M 0 is J -trivial and L0 is piecewise testable. In fact L0 = A aA bA . Simon's theorem also has some nice consequences of pure semigroup theory. An ordered monoid is a monoid equipped with a stable order relation. An ordered monoid (M; ) is called 1-ordered if, for every x 2 M , x 1. A nite 1-ordered monoid is always J -trivial. Indeed, if u J v, there exist x; y; z; t 2 M such that u = xvy and v = zyt. Now x 1, y 1 and thus u = xvy v and similarly, v u whence u = v. The converse is not true: there exist nite J -trivial monoids which cannot be 1-ordered. Example 7.3. Let M be the monoid with zero presented on fa; b; cg by the relations aa = ac = ba = bb = ca = cb = cc = 0. Thus M = f1; a; b; c; ab; bc; abc; 0g and M is J -trivial. However, M is not a 1-ordered monoid. Otherwise, one would have on the one hand, b 1, whence abc ac = 0 and on the other hand, 0 1, whence 0 = 0:abc 1:abc = abc, a contradiction since abc 6= 0. However, Straubing and Therien 69] proved that 1-ordered monoids generate all the nite J -trivial monoids in the following sense. monoid. Figure 7.5. The J -classes of M 0 . Theorem 7.3. A monoid is J -trivial if and only if it is a quotient of a 1-ordered Actually, it is not di cult to establish that this result is equivalent to Simon's theorem. But Straubing and Therien also gave an ingenious direct proof of their result by induction on the cardinality of the monoid. This gives in turn a proof of Simon's theorem. Straubing 63] also observed the following connection with semigroups of relations. relations on a nite set. Theorem 7.4. A monoid is J -trivial if and only if it divides a monoid of re exive FINITE SEMIGROUPS AND RECOGNIZABLE LANGUAGES 19 A language of A+ is locally testable if it is a boolean combination of languages of the form uA , A v or A wA where u; v; w 2 A+ . For instance, if A = fa; bg, the language (ab)+ is locally testable since (ab)+ = (aA \ A b) n (A aaA A bbA ). These languages occur naturally in the study of the languages of dot-depth one. Actually they form the rst level of a natural subhierarchy of the languages of dot-depth one (see 36] for more details). Locally testable languages also have a natural interpretation in terms of automata. They are recognized by scanners . A scanner is a machine equipped with a nite memory and a window of size n to scan the input word. a 1 a2 a 3 a 4 a 5 ... an 8. Locally testable languages Finite Memory The window can also be moved beyond the rst and last letter of the word, so that the pre xes and su xes of length < n can be read. For instance, if n = 3, and u = abbaaabab, the di erent positions of the window are represented on the following diagrams: Figure 8.1. A scanner. a bbaaabab ab baaabab abb aaabab a bba aabab abbaaaba b At the end of the scan, the scanner memorizes the pre xes and the su xes of length < n and the set of factors of length n of the input word, but does not count the multiplicities. That is, if a factor occurs several times, it is memorized just once. This information is then compared to a collection of permitted sets of pre xes, su xes and factors contained in the memory. The word is accepted or rejected, according to the result of this test. The algebraic characterization of locally testable languages is slightly more involved than for star-free or piecewise testable languages. Recall that a nite semigroup S is said to have a property locally , if, for every idempotent e of S , the subsemigroup eSe = fese j s 2 S g has the property. In particular, a semigroup is locally trivial if, for every idempotent e of S , eSe = e and is locally idempotent and commutative if, for every idempotent e of S , eSe is idempotent and commutative. Equivalently, S is locally idempotent and commutative if, for every e; s; t 2 S such that e = e2 , (ese)2 = (ese) and (ese)(ete) = (ete)(ese). The following result was proved independently by Brzozowski and Simon 9] and by McNaughton 29]. 20 J.E. Pin + its syntactic semigroup is locally idempotent and commutative. Theorem 8.1. A recognizable language of A is locally testable if and only if This result, or more precisely the proof of this result, had a strong in uence on pure semigroup theory. The reason is that Theorem 8.1 can be divided into two separate statements. Proposition 8.2. A recognizable language of A is locally testable if and only + if its syntactic semigroup divides a semidirect product of a semilattice by a locally trivial semigroup. Proposition 8.3. A semigroup divides a semidirect product of a semilattice by a locally trivial semigroup if and only if it is locally idempotent and commutative. The proof of Proposition 8.2 is relatively easy, but Proposition 8.3 is much more di cult and relies on an interesting property. Given a semigroup S , form a graph G(S ) as follows: the vertices are the idempotents of S and the edges from e to f are the elements of the form esf . Then one can show that a semigroup divides a semidirect product of a semilattice by a locally trivial semigroup if and only if its graph is locally idempotent and commutative in the following sense: if p and q are loops around the same vertex, then p = p2 and pq = qp. We shall encounter another condition on graphs in Theorem 11.1. This type of graph conditions is now well understood, although numerous problems are still pending. The graph of a semigroup is a special instance of a derived category and is deeply connected with the study of the semidirect product (see Straubing 68] and Tilson 71]). In 1974, the syntactic characterizations of the star-free, piecewise testable and locally testable languages had already established the power of the semigroup approach. However, these theorems were still isolated. In 1976, Eilenberg presented in his book a uni ed framework for these three results. The cornerstone of this approach is the concept of variety. Recall that a variety of nite semigroups (or pseudovariety ) is a class of semigroups V such that: (1) if S 2 V and if T is a subsemigroup of S , then T 2 V, (2) if S 2 V and if T is a quotient of S , then T 2 V, Q (3) if (Si )i2I is a nite family of semigroups of V, then i2I Si is also in V. Varieties of nite monoids are de ned in the same way. Condition (3) can be replaced by the conjunction of conditions (3.a) and (3.b): (3.a) the trivial semigroup 1 belongs to V, (3.b) if S1 and S2 are semigroups of V, then S1 S2 is also in V. Indeed, condition (3.a) is obtained by taking I = ; in (3). 9. Varieties, another approach to recognizable languages. FINITE SEMIGROUPS AND RECOGNIZABLE LANGUAGES 21 Recall that a semigroup T divides a semigroup S if T is a quotient of a subsemigroup of S . Division is a transitive relation on semigroups and thus conditions (1) and (2) can be replaced by condition (10 ) (10 ) if S 2 V and if T divides S , then T 2 V. Given a class C of semigroups, the intersection of all varieties containing C is still a variety, called the variety generated by C , and denoted by hCi. In a more constructive way, hCi is the class of all semigroups that divide a nite product of semigroups of C . (1) The class M of all nite monoids forms a variety of nite monoids. (2) The smallest variety of nite monoids is the trivial variety, denoted by I, consisting only of the monoid 1. (3) The class Com of all nite commutative monoids form a variety of nite monoids. (4) The class J1 of all nite idempotent and commutative monoids (or semilattices) forms a variety of nite monoids. (5) The class A of all nite aperiodic monoids forms a variety of nite monoids. (6) The class J of all nite J -trivial monoids forms a variety of nite monoids. (7) The class of LI of all nite locally trivial semigroups forms a variety of nite semigroups. (8) The class LJ1 of all nite locally idempotent and commutative semigroups forms a variety of nite semigroups. Equations are a convenient way to de ne varieties. For instance, the variety of nite commutative semigroups is de ned by the equation xy = yx, the variety of aperiodic semigroups is de ned by the equation x! = x!+1 . Of course, x! = x!+1 is not an equation in the usual sense, since ! is not a xed integer: : : However, one can give a rigorous meaning to this \pseudoequation". Since J. Almeida and P. Weil present this topic in great detail in this volume, we refer the reader to their article for more information. For our purpose, it su ces to remember that equations (or pseudoequations) give an elegant description of the varieties of nite semigroups, but are sometimes very di cult to determine. We shall now extend this purely algebraic approach to recognizable languages. If V is a variety of semigroups, we denote by V (A+ ) the set of recognizable languages of A+ whose syntactic semigroup belongs to V. This is also the set of languages of A+ recognized by a semigroup of V. A +-class of recognizable languages is a correspondence which associates with every nite alphabet A, a set C (A+ ) of recognizable languages of A+ . Similarly, a -class of recognizable languages is a correspondence which associates with every nite alphabet A, a set C (A ) of recognizable languages of A . In particular, the correspondence V ! V associates with every variety of semigroups a +-class of recognizable languages. Eilenberg gave a combinatorial description of the classes of languages that occur in this way. Example 9.1. 22 J.E. Pin If X is a language of A+ and if u 2 A , the left quotient (resp. right quotient ) of X by u is the language u?1 X = fv 2 A+ j uv 2 X g (resp. Xu?1 = fv 2 A+ j vu 2 X g) Left and right quotients are de ned similarly for languages of A by replacing A+ by A in the de nition. A +-variety is a class of recognizable languages such that (1) for every alphabet A, V (A+ ) is closed under nite boolean operations ( nite union and complement), (2) for every semigroup morphism ' : A+ ! B + , X 2 V (B + ) implies '?1 (X ) 2 V (A+ ), (3) If X 2 V (A+ ) and u 2 A+ , then u?1 X 2 V (A+ ) and Xu?1 2 V (A+ ). Similarly, a -variety is a class of recognizable languages such that (1) for every alphabet A, V (A ) is closed under nite boolean operations, (2) for every monoid morphism ' : A ! B , X 2 V (B ) implies '?1 (X ) 2 V (A ), (3) If X 2 V (A ) and u 2 A , then u?1 X 2 V (A ) and Xu?1 2 V (A ). We are ready to state Eilenberg's theorem. Theorem 9.1. The correspondence V ! V de nes a bijection between the varieties of semigroups and the +-varieties. The variety of nite semigroups corresponding to a given +-variety is the variety of semigroups generated by the syntactic semigroups of all the languages L 2 V (A+ ), for every nite alphabet A. There is, of course, a similar statement for the varieties. Theorem 9.2. The correspondence V ! V de nes a bijection between the varieties of monoids and the -varieties. Varieties of nite semigroups or monoids are usually denoted by boldface letters and the corresponding varieties of languages are denoted by the corresponding cursive letters. We already know four instances of Eilenberg's variety theorem. (1) By Kleene's theorem, the -variety corresponding to M is the -variety of rational languages. (2) By Schutzenberger's theorem, the -variety corresponding to A is the variety of star-free languages. (3) By Simon's theorem, the -variety corresponding to J is the -variety of piecewise testable languages. (4) By Theorem 8.1, the +-variety corresponding to LJ1 is the +-variety of locally testable languages. FINITE SEMIGROUPS AND RECOGNIZABLE LANGUAGES 23 To clear up any possible misunderstanding, note that the four theorems mentioned above (Kleene, Schutzenberger, etc.) are not corollaries of the variety theorem. For instance, the variety theorem indicates that the languages corresponding to the nite aperiodic monoids form a -variety; it doesn't say that this -variety is the variety of star-free languages: : : Actually, it is often a di cult problem to nd an explicit description of the -variety of languages corresponding to a given variety of nite monoids, or, conversely, to nd the variety of nite monoids corresponding to a given -variety. However, the variety theorem provided a new direction to classify recognizable languages. Systematic searches for the variety of monoids (resp. languages) corresponding to a given variety of languages (resp. monoids) were soon undertaken. A partial account of these results is given into the next section. 10. Bestiary We review in this section a few examples of correspondence between varieties of nite monoids (or semigroups) and varieties of languages. A boolean algebra is a set of languages containing the empty language and closed under nite union, nite intersection and complement. Let us start our visit of the zoo with the subvarieties of the variety Com of all nite commutative monoids: the variety Acom of commutative aperiodic monoids, the variety Gcom of commutative groups, the variety J1 of idempotent and commutative monoids (or semilattices) and the trivial variety I. Proposition 10.1. For every alphabet A, I (A ) = f0; A g. Proposition 10.2. For every alphabet A, J 1 (A ) is the boolean algebra generated by the languages of the form A aA where a is a letter. Equivalently, J 1 (A ) is the boolean algebra generated by the languages of the form B where B is a subset of A. Proposition 10.3. For every alphabet A, G com(A ) is the boolean algebra generated by the languages of the form L(a; k; n) = fu 2 A j juja k mod ng where a 2 A and 0 k < n. Proposition 10.4. For every alphabet A, Acom(A ) is the boolean algebra generated by the languages of the form where a 2 A and k 0. L(a; k) = fu 2 A+ j juja = kg 24 J.E. Pin Proposition 10.5. For every alphabet A, C om(A ) is the boolean algebra generated by the languages of the form L(a; k) = fu 2 A+ j juja = kg or L(a; k; n) = fu 2 A+ j juja k mod ng where a 2 A and 0 k < n. Consider now the variety LI of all locally trivial semigroups and its subvarieties Lr I, L I and Nil. A nite semigroup S belongs to LI if and only if, for every e 2 E (S ) and every s 2 S , ese = e. The asymmetrical versions of this condition de ne the varieties Lr I and L I. Thus Lr I (resp. L I) is the variety of all nite semigroups S such that se = e (resp. es = e). Equivalently, a semigroup belongs to LI (resp. Lr I, L I) if it is a nilpotent extension of a rectangular band (resp. a right rectangular band, a left rectangular band). Finally Nil is the variety of nilpotent semigroups, de ned by the condition es = se = e for every e 2 E (S ) and every s 2 S . Recall that a subset F of a set E is co nite if its complement in E is nite. languages of A . + Proposition 10.6. For every alphabet A, N il(A ) is the set of nite or co nite + of languages of the form A X Y (resp. XA subsets of A+ . Proposition 10.7. For every alphabet A, Lr I (A ) (resp. L I (A )) is the set + + + Y ), where X and Y are nite Proposition 10.8. For every alphabet A, LI (A ) is the set of languages of the form XA Y Z , where X , Y and Z are nite subsets of A+ . Note that the previous characterizations do not make use of the complement, although the sets N il(A+ ), Lr I (A+ ), L I (A+ ) and LI (A+ ) are closed under complement. Actually, the following characterizations hold. Proposition 10.9. For every alphabet A, (1) Lr I (A ) is the boolean algebra generated by the languages of the form A u, where u 2 A , (2) L` I (A ) is the boolean algebra generated by the languages of the form uA , where u 2 A , (3) LI (A ) is the boolean algebra generated by the languages of the form uA or A u, where u 2 A . + + + + + + It would be to long to state in full detail all known results on varieties of languages. Let us just mention that the languages corresponding to the following varieties of nite semigroups or monoids are known: all varieties of bands ( 45] for the FINITE SEMIGROUPS AND RECOGNIZABLE LANGUAGES 25 lower levels and 56] for the general case), the varieties of R-trivial (resp. Ltrivial) monoids 17,7,37], the varieties of p-groups (resp. nilpotent groups) 17], the varieties of solvable groups 60], the varieties of monoids whose groups are commutative 54,26], nilpotent 17], solvable 60], the variety of monoids with commuting idempotents 27], the variety of J -trivial monoids with commuting idempotents 3], the variety of monoids whose regular J -classes are rectangular bands 55], the variety of block groups (see the author's article \BG = PG, a success story" in this volume) and many others which follow in particular from the general results given in section 12. As the variety approach proved to be successful in many di erent situations, it was expected to shed some new light on the di cult problems mentioned in section 5. The reality is more contrasted. In brief, varieties do not seem to be helpful for the star height, it is so far the most successful approach for the dot-depth and the concatenation levels and, with regard to the extended star height, it seems to be a useful tool, but probably nothing more. Let us comment on this judgment in more details. Varieties do not seem to be helpful for the star height, simply because the languages of a given star height are not closed under inverse morphisms between free monoids and thus, do not form a variety of languages. However, the notion of syntactic semigroup arises in the proof of Hashiguchi's theorems. Schutzenberger's theorem shows that the languages of extended star height 0 form a variety. However, it seems unlikely that a similar result holds for the languages of extended star height 1. Indeed, one can show 33] that every nite monoid divides the syntactic monoid of a language of the form L , where L is nite. It follows that if the languages of extended star height 1 form a variety of languages, then this variety is the variety of all rational languages. In particular, this would imply that every recognizable language is of extended star height 0 or 1. Varieties are much more useful in the study of the concatenation product. We have already seen the syntactic characterization of the languages of concatenation level 1. There is a similar result for the languages of dot-depth one. It is easy to see from the general de nition that a language of A+ is of \dot-depth one" if it is a boolean combination of languages of the form 11. Back to the early attempts u0 A u1 A u2 A u k ? 1 A uk where k 0 and ui 2 A . The syntactic characterization of these languages was settled by Knast 24,25]. Theorem 11.1. A language of A is of dot-depth one if and only if the graph of + its syntactic semigroup satis es the following condition : if e and f are two vertices, p and r edges from e to f , and q and s edges from f to e, then (pq)! ps(rs)! = (pq)! (rs)! . 26 J.E. Pin p, r e q, s f More generally, one can show that the languages of dot-depth n form a +-variety of languages. The corresponding variety of nite semigroups is usually denoted by Bn . Similarly, the languages of concatenation level n form a -variety of languages and the corresponding variety of nite monoids is denoted Vn . The two hierarchies are strict 8]. 0, there exists a language of dot-depth n + 1 which is not of dot-depth n and a language of concatenation level n + 1 which is not of concatenation level n. An important connection between the two hierarchies was found by Straubing 67]. Given a variety of nite monoids V and a variety of nite semigroups W, denote by V W the variety of nite semigroups generated by the semidirect products S T with S 2 V and T 2 W such that the action of T on S is right unitary. Theorem 11.2. For every n Theorem 11.3. For every n > 0, one has Bn = Vn LI and Vn = Bn \ M. In particular B1 = J LI. It follows also, thanks to e deep result of Straubing 67] that Bn is decidable if and only if Vn is decidable. However, it is still an open problem to know whether the varieties Vn are decidable for n 2. The case n = 2 is especially frustrating, but although several partial results have been obtained 44,68,72,70,74,13], the general case remains open. FINITE SEMIGROUPS AND RECOGNIZABLE LANGUAGES 27 12. Recent developments We shall not discuss in detail the numerous developments of the theory since Eilenberg's variety theorem, but we shall indicate the main trends. A quick glance at the known examples shows that the combinatorial description of a variety of languages follow most often the following pattern: the variety is described as the smallest variety closed under a given class of operations, such as boolean operations, product, etc. Varieties of semigroups are also often de ned with the help of operators: join, semidirect products, Malcev products, etc. In view of Eilenberg's theorem, one may expect some relationship between the operators on languages (of combinatorial nature) and the operators on semigroups (of algebraic nature). V ??????????????????! W ? ? ? ? y V Operation on semigroups Operation on languages ? ? ? ? y ?????????????????! W In the late seventies, several results of this type were established, in particular by H. Straubing. We rst consider the marked product. One of the most useful tools for studying this product is the Schutzenberger product of n monoids, which was originally de ned by Schutzenberger for two monoids 53], and extended by Straubing 64] for any number of monoids. Given a monoid M , the set of subsets of M , denoted P (M ), is a semiring under union as addition and the product of subsets as multiplication, de ned, for all X; Y M by XY = fxy j x 2 X and y 2 Y g. Let M1 ; : : : ; Mn be monoids. We denote by M the product monoid M1 Mn , k the semiring P (M ) and by Mn (k) the semiring of square matrices of size n with entries in k. The Schutzenberger product of M1 ; : : : ; Mn , denoted }n (M1 ; : : : ; Mn ) is the submonoid of the multiplicative monoid Mn (k) composed of all the matrices P satisfying the three following conditions: (1) If i > j , Pi;j = 0 (2) If 1 i n, Pi;i = f(1; : : : ; 1; si ; 1; : : : ; 1)g for some si 2 Si (3) If 1 i j n, Pi;j 1 1 Mi Mj 1 1. Condition (1) indicates that the matrices of the Schutzenberger product are upper triangular, condition (2) enables to identify the diagonal coe cient Pi;i with an element si of Mi and condition (3) shows that if i < j , Pi;j can be identi ed with a subset of Mi Mj . With this convention, a matrix of }3 (M1 ; M2 ; M3 ) will 28 have the form 1 J.E. Pin 0s P P 1 @ 0 s ; P ;; A 12 2 13 with si 2 Mi , P1;2 M1 M2 , P1;3 M1 Notice that the Schutzenberger product is not associative, in the sense that in general the monoids }2 (M1 ; }2 (M2 ; M3 )), }3 (M1 ; M2 ; M3 ) and }2 (}2 (M1 ; M2 ); M3 ) are pairwise distinct. The following result shows that the Schutzenberger product is the algebraic operation on monoids that corresponds to the marked product. 0 0 s3 M2 M3 and P2;3 M2 M3 . 23 Proposition 12.1. Let L ; L ; : : : ; Ln be languages of A recognized by monoids 0 1 M0 ; M1 ; : : : ; Mn and let a1 ; : : : ; an be letters of A. Then the marked product L0 a1 L1 an Ln is recognized by the monoid }n+1 (M0 ; M1 ; : : : ; Mn ). This result was extended to varieties by Reutenauer 50] for n = 1 and by the author 36] in the general case (see also 73] for a simpler proof). Let V0 , : : : , Vn be varieties of nite monoids and let }n+1 (V0 ; V1 ; : : : ; Vn ) be the variety of nite monoids generated by the Schutzenberger products of the form }n+1 (M0 ; M1 ; : : : ; Mn ) with M0 2 V0 , M1 2 V1 , : : : , Mn 2 Vn . Theorem 12.2. Let V be the -variety corresponding to the variety of nite monoids }n+1 (V0 ; V1 ; : : : ; Vn ). Then, for all alphabet A, V (A ) is the boolean algebra generated by all the marked products of the form L0 a1 L1 an Ln where L0 2 V 0 (A ),: : : , Ln 2 V n (A ) and a1 ; : : : ; an 2 A. If V0 = V1S= : : : = Vn = V, the variety }n+1 (V; V; : : : ; V) is denoted }n+1 V and }V = n>0 }n V denotes the union of all }n V. Given a -variety of languages V , the extension of V under marked product is the -variety V 0 such that, for every alphabet A, V 0 (A ) is the boolean algebra generated by the marked products of the form L0 a1 L1 an Ln where L0 ; L1 ; : : : ; Ln 2 V (A ) and a1 ; : : : ; an 2 A. The closure of V under marked product is the smallest -variety V such that, for every alphabet A, V (A ) contains V (A ) and all the marked products of the form L0 a1 L1 an Ln where L0 ; L1 ; : : : ; Ln 2 V (A ) and a1 ; : : : ; an 2 A. The -variety corresponding to }V is described in the following theorem. marked product. Theorem 12.3. Let V be a monoid variety and let V be the corresponding -variety. Then the -variety corresponding to }V is the extension of V under Corollary 12.4. A -variety is closed under marked product if and only if the corresponding variety of monoids V satis es V = }V. FINITE SEMIGROUPS AND RECOGNIZABLE LANGUAGES 29 The Schutzenberger product has a remarkable algebraic property 64,39]. Let M1 , : : : , Mn be monoids and let be the monoid morphism from }n (M1 ; : : : ; Mn ) into M1 Mn that maps a matrix onto its diagonal. Theorem 12.5. For every idempotent e of M is in the variety B . 1 1 Mn , the semigroup ?1 (e) Given a variety of nite semigroups V, a nite monoid M is called a V-extension of a nite monoid N if there exists a surjective morphism ' : M ! N such that, for every idempotent e of N , '?1 (e) 2 V. Theorem 12.5 shows that the Schutzenberger product of n nite monoids is a B1 -extension of their product. Given a variety of nite monoids W, the Malcev product V M W is the variety of nite monoids generated by all the V-extensions of monoids of W. This gives the following relation between the Vn . Theorem 12.6. For every n 0, Vn is contained in B +1 1 M Vn . It is conjectured that Vn+1 = B1 M Vn for every n. If this conjecture were true, it would reduce the decidability of the dot-depth to a problem on the Malcev products of the form B1 M V. Malcev products actually play an important role in the study of the marked product. For instance, Straubing has established the important following result, which gives support to the previous conjecture. Theorem 12.7. Let V be a monoid variety and let V be the corresponding -variety. Then the -variety corresponding to A V is the closure of V under marked product. M Example 12.1. Let H be a variety of nite groups (for instance, the variety of all nite commutative groups, nilpotent groups, solvable groups, etc.). Denote by H the variety of all monoids whose subgroups (that is, H-classes containing an idempotent) belong to H. One can show that A M H = H. Therefore, the corresponding -variety is closed under marked product. The marked product L = L0 a1 L1 an Ln of n languages L0 , L1 , : : : , Ln is unambiguous if every word u of L admits a unique factorization of the form u0 a1 u1 an un with u0 2 L0 , u1 2 L1 , : : : , un 2 Ln . The following result was established in 35,46] as a generalization of a former result of Schutzenberger 55]. Theorem 12.8. Let V be a monoid variety and let V be the corresponding -variety. Then the -variety corresponding to LI V is the closure of V under unambiguous marked product. M 30 J.E. Pin The extension of a given -variety is also characterized in 46]. Other variations of the marked product have been considered 55,35,49]. They lead to some interesting algebraic constructions. Another operation on semigroups has a natural counterpart in terms of languages. Given a variety of nite monoids V, denote by PV the variety of nite monoids generated by all the monoids of the form P (M ), for M 2 V. A monoid morphism ' : B ! A is length preserving if it maps a letter of B onto a letter of A. Given a -variety of languages V , the extension of V under length preserving morphisms is the smallest -variety V 0 such that, for every alphabet A, V 0 (A ) contains the languages of the form '(L) where L 2 V (B ) and ' : B ! A is a length preserving morphism. The closure of V under length preserving morphisms is the smallest -variety V containing V such that, for every length preserving morphism ' : B ! A , L 2 V (A ) implies '?1 (L) 2 V (B ). We can now state the result found independently by Reutenauer 50] and Straubing 62]. Theorem 12.9. Let V be a monoid variety and let V be the corresponding -variety. Then the -variety corresponding to PV is the extension of V under length preserving morphisms. Corollary 12.10. A -variety is closed under length preserving morphisms if and only if the corresponding variety of monoids V satis es V = PV. These results motivated the systematic study of the varieties of the form PV, which is not yet achieved. See the survey article 38] for the known results prior to 1986 and the book of J. Almeida 1] for the more recent results. The Schutzenberger product and the power monoid are actually particular cases of a general construction which gives the monoid counterpart of a given operation on languages 42,43,40]. This general construction works for most operations on languages, with the notable exception of the star operation, but its presentation would take us to far a eld. We conclude this section by a few results on the semidirect product of two varieties. We have already de ned the semidirect product V W of a variety of nite monoids V and a variety of nite semigroups W. One can de ne similarly the semidirect product of two varieties of nite monoids or of two varieties of nite semigroups. For instance, if V and W are two varieties of nite monoids, V W is the variety of nite monoids generated by the semidirect products M N with M 2 V and N 2 W such that the action of N on M is unitary. This variety is also generated by the wreath products M N with M 2 V and N 2 W. Straubing has given a general construction to describe the languages recognized by the wreath product of two nite monoids. Let M 2 V and N 2 W be two nite monoids and let : A ! M N be a monoid morphism. We denote by FINITE SEMIGROUPS AND RECOGNIZABLE LANGUAGES 31 : M N ! N the monoid morphism de ned by (f; n) = n and we put ' = . Thus ' is a monoid morphism from A into N . Let B = N A and : A ! B be the map (which is not a morphism!) de ned by (a1 a2 an ) = (1; a1 )('(a1 ); a2 ) ('(a1 a2 an1 ); an ) Then Straubing's \wreath product principle" can be stated as follows. is recognized by M and where X Theorem 12.11. If a language L is recognized by : A ! M N , then L is a nite boolean combination of languages of the form X \ ? (Y ), where Y B A is recognized by N . 1 Conversely, the nite boolean combinations of languages of the form X \ ?1 (Y ) are not necessarily recognized by M N , but are certainly recognized by a monoid of the variety V W. Therefore, a careful study of the languages of the form ?1 (Y ) usually su ces to give a combinatorial description of the languages corresponding to V W. A similar wreath product principle holds when V or W are varieties of nite semigroups. Examples of application of this technique include Proposition 8.2 and the proof of Schutzenberger's theorem based on the fact that every nite aperiodic monoid divides a wreath product of copies of U2 . Straubing also has successfully used this principle to describe the variety of languages corresponding to solvable groups (solvable groups are wreath products of commutative groups) and in his proof of the equality Bn = Vn LI. We have centered our presentation around the notion of variety and voluntarily left out several aspects of the theory which are developed extensively in other articles of this volume: H. Straubing, D. Therien and W. Thomas survey the connections with formal logic and boolean circuits, J. Almeida and P. Weil present the implicit operations, D. Perrin and the author treat the theory of automata on in nite words, J. Rhodes states a general conjecture on Malcev products, the topological aspects are mentioned in the author's account of the success story BG = PG, S.W. Margolis and J. Meakin cover the extensions of automata theory to inverse monoids, M. Sapir demarcates the border between decidable and undecidable and H. Short shows that automata are also useful in group theory. Some other extensions are not covered at all in this volume, in particular the connections with the variable length codes, the rational and recognizable sets on arbitrary monoids and the extension of the theory to power series and algebras. We hope that the reading of the articles of this volume will convince the reader that the algebraic theory of automata is a recent but ourishing subject. It is intimately related to the theory of nite semigroups and certainly one of the most convincing applications of this theory. 13. Conclusion 32 J.E. Pin I would like to thank Pascal Weil, Marc Zeitoun and Monica Mangold for many useful suggestions. Acknowledgements References 1] J. Almeida, Semigrupos Finitos e Algebra Universal, Publicacoes do Instituto de Matematica e Estat stica da Universidade de Sa~ Paulo, (1992) o 2] J. Almeida, Implicit operations on nite J -trivial semigroups and a conjecture of I. Simon, J. Pure Appl. Algebra 69, (1990) 205{218. 3] C. J. Ash, T.E. Hall and J.E. Pin, On the varieties of languages associated to some varieties of nite monoids with commuting idempotents, Information and Computation 86, (1990) 32{42. 4] J. Berstel and Ch. Reutenauer, Rational Series and Their Langages, Springer, Berlin (1988). 5] J. A. Brzozowski, Hierarchies of aperiodic languages, RAIRO Inf. Theor. 10 (1976) 33{49. 6] J. A. Brzozowski, Open problems about regular languages, Formal language theory, perspectives and open problems (R.V. Book editor), Academic Press, New York, (1980) 23{47. 7] J. A. Brzozowski and F. E. Fich, Languages of R-trivial monoids, J. Comput. System Sci. 20 (1980) 32{49. 8] J. A. Brzozowski and R. Knast, The dot-depth hierarchy of star-free languages is in nite, J. Comput. System Sci. 16, (1978) 37{55. 9] J. A. Brzozowski and I. Simon, Characterizations of locally testable languages, Discrete Math. 4, (1973) 243{271. 10] S. Cho and D. T. Huynh, Finite automaton aperiodicity is PSPACE-complete, Theoret. Comput. Sci. 88, (1991) 99{116. 11] R. S. Cohen and J. A. Brzozowski, On star-free events, Proc. Hawaii Int. Conf. on System Science, Honolulu, (1968) 1{4. 12] R. S. Cohen and J. A. Brzozowski, Dot-depth of star-free events, J. Comput. System Sci. 5, (1971) 1{15. 13] D. Cowan, 1993, Inverse monoids of dot-depth 2, Int. Jour. Alg. and Comp., to appear. 14] F. Dejean and M. P. Schutzenberger, On a question of Eggan, Information and Control 9, (1966), 23{25. 15] L. C. Eggan, Transition graphs and the star height of regular events, Michigan Math. J. 10, (1963) 385{397. 16] S. Eilenberg, Automata, languages and machines, Vol. A, Academic Press, New York (1974). 17] S. Eilenberg, Automata, languages and machines, Vol. B, Academic Press, New York (1976). FINITE SEMIGROUPS AND RECOGNIZABLE LANGUAGES 33 18] K. Hashiguchi, Regular languages of star height one, Information and Control 53 (1982) 199{210. 19] K. Hashiguchi, Representation theorems on regular languages, J. Comput. System Sci. 27, (1983) 101{115. 20] K. Hashiguchi (1988), Algorithms for Determining Relative Star Height and Star Height, Information and Computation 78 124{169. 21] J. E. Hopcroft and J. D. Ullman, Introduction to Automata Theory, Languages and Computation, Addison Wesley, (1979). 22] J. Howie, Automata and Languages, Oxford Science Publications, Clarendon Press, Oxford, 1991. 23] S. C. Kleene, Representation of Events in nerve nets and nite automata, in "Automata Studies" C.E. Shannon and J. McCarthy eds.), Princeton University Press, Princeton, New Jersey, (1956) 3{42. 24] R. Knast, A semigroup characterization of dot-depth one languages, RAIRO Inform. Theor. 17 (1983) 321{330. 25] R. Knast, Some theorems on graph congruences, RAIRO Inform. Theor. 17 (1983) 331{342. 26] G. Lallement, Semigroups and combinatorial applications, Wiley, New York (1979). 27] S. W. Margolis and J.E. Pin, Languages and inverse semigroups, 11th ICALP, Lecture Notes in Computer Science 199, Springer, Berlin (1985) 285{299. 28] S. W. Margolis and J.E. Pin, Inverse semigroups and varieties of nite semigroups, Journal of Algebra 110 (1987) 306{323. 29] R. McNaughton, Algebraic decision procedures for local testability, Math. Syst. Theor. 8, (1974) 60{76. 30] R. McNaughton and S. Pappert, Counter-free Automata, MIT Press, (1971). 31] A. R. Meyer, A note on star-free events, J. Assoc. Comput. Mach. 16, (1969) 220{225. 32] D. Perrin, Automata, Chapter 1 in Handbook of Theoretical Computer Science (J. Van Leeuwen, ed.), Vol B: Formal Models and Semantics, Elsevier (1990). 33] J.-E. Pin, Sur le mono de de L lorsque L est un langage ni. Theor. Comput. Sci. 7 (1978) 211{215. 34] J.-E. Pin, Varietes de langages et mono de des parties, Semigroup Forum 20 (1980) 11{47. 35] J.-E. Pin, Proprietes syntactiques du produit non ambigu. 7th ICALP, Lecture Notes in Computer Science 85 (1980) 483{499. 36] J.-E. Pin, Hierarchies de concatenation, RAIRO Informatique Theorique 18, (1984) 23{46. 37] J.-E. Pin, 1984 Varietes de langages formels, Masson, Paris; English translation: 1986, Varieties of formal languages, Plenum, New-York. 38] J.-E. Pin, Power semigroups and related varieties of nite semigroups, Semigroups and Their Applications, ed. S. M. Goberstein and P. M. Higgins, D. Reidel (1986) 139{152. 34 J.E. Pin 39] J.-E. Pin, A property of the Schutzenberger product, Semigroup Forum 35, (1987) 53{62. 40] J.-E. Pin, Relational morphisms, transductions and operations on languages, in J.E. Pin (ed.), Formal properties of nite automata and applications, Lect. Notes in Comp. Sci. 386, Springer, (1989) 120{137. 41] J.-E. Pin, Logic, Semigroups and Automata on Words, Proceedings of the Spring School on Logic and Computer Science, ed. S. Grigorie , to appear. 42] J.-E. Pin and J. Sakarovitch, Operations and transductions that preserve rationality, 6th GI Conf., Lecture Notes in Computer Science 145, Springer, Berlin (1983) 277{288. 43] J.-E. Pin and J. Sakarovitch, Une application de la representation matricielle des transductions, Theor. Comput. Sci. 35, (1985) 271{293. 44] J.-E. Pin and H. Straubing, Monoids of upper triangular matrices, Colloquia Mathematica Societatis Janos Bolyai 39, Semigroups, Szeged, (1981) 259{272. 45] J.-E. Pin, H. Straubing and D. Therien, Small varieties of nite semigroups and extensions, J. Austral. Math. Soc. 37 (1984) 269{281. 46] J.-E. Pin, H. Straubing and D. Therien, Locally trivial categories and unambiguous concatenation, Journal of Pure and Applied Algebra 52 (1988) 297{311. 47] J.-E. Pin, H. Straubing and D. Therien, New results on the generalized star height problem, STACS 89, Lecture Notes in Computer Science 349, (1989), 458{467. 48] J.-E. Pin, H. Straubing and D. Therien, Some results on the generalized star height problem, Information and Computation, 101 (1992), 219{250. 49] J.-E. Pin and D. Therien, The bideterministic concatenation product, to appear in Int. Jour. Alg. and Comp.. 50] Ch. Reutenauer, Sur les varietes de langages et de mono des, Lecture Notes in Computer Science 67, Springer, Berlin, (1979) 260{265. 51] M. Robson, Some Languages of Generalised Star Height One, LITP Technical Report 89-62, 1989, 9 pages. 52] More Languages of Generalised Star Height 1, Theor. Comput. Sci. 106, (1992) 327{335. 53] M. P. Schutzenberger, On nite monoids having only trivial subgroups, Information and Control 8, (1965) 190{194. 54] M. P. Schutzenberger, Sur les mono des nis dont les groupes sont commutatifs, RAIRO Inf. Theor. 1 (1974) 55{61. 55] M. P. Schutzenberger, Sur le produit de concatenation non ambigu, Semigroup Forum 13 (1976) 47{75. 56] H. Sezinando, The varieties of languages corresponding to the varieties of nite band monoids, Semigroup Forum 44 (1992) 283{305. 57] I. Simon, Piecewise testable events, Proc. 2nd GI Conf., Lect. Notes in Comp. Sci. 33, Springer, Berlin, (1975) 214{222. 58] J. Stern, Characterization of some classes of regular events, Theoret. Comp. Sci. 35, (1985) 17{42. FINITE SEMIGROUPS AND RECOGNIZABLE LANGUAGES 35 59] J. Stern, Complexity of some problems from the theory of automata, Inform. and Control 66, (1985) 63{176. 60] H. Straubing, Families of recognizable sets corresponding to certain varieties of nite monoids, J. Pure Appl. Algebra, 15 (1979) 305{318. 61] H. Straubing, Aperiodic homomorphisms and the concatenation product of recognizable sets, J. Pure Appl. Algebra, 15 (1979) 319{327. 62] H. Straubing, Recognizable sets and power sets of nite semigroups, Semigroup Forum, 18 (1979) 331{340. 63] H. Straubing, On nite J -trivial monoids, Semigroup Forum 19, (1980) 107{110. 64] H. Straubing, A generalization of the Schutzenberger product of nite monoids, Theoret. Comp. Sci., 13 (1981) 137{150. 65] H. Straubing, Relational morphisms and operations on recognizable sets, RAIRO Inf. Theor., 15 (1981) 149{159. 66] H. Straubing, The variety generated by nite nilpotent monoids, Semigroup Forum 24, (1982) 25{38. 67] H. Straubing, Finite semigroups varieties of the form V D, J. Pure Appl. Algebra 36,(1985) 53{94. 68] H. Straubing, Semigroups and languages of dot-depth two, Theoret. Comp. Sci. 58, (1988) 361{378. 69] H. Straubing and D. Therien, Partially ordered nite monoids and a theorem of I. Simon, J. of Algebra 119, (1985) 393{399. 70] H. Straubing and P. Weil, On a conjecture concerning dot-depth two languages, Theoret. Comp. Sci. 104, (1992) 161{183. 71] B. Tilson, Categories as algebras, Journal of Pure and Applied Algebra 48, (1987) 83{198. 72] P. Weil, Inverse monoids of dot-depth two, Theoret. Comp. Sci. 66, (1989) 233{245. 73] P. Weil, Closure of varieties of languages under products with counter, Journal of Computer and System Sciences 45 (1992) 316{339. 74] P. Weil, Some results on the dot-depth hierarchy, Semigroup Forum 46 (1993) 352{370. ...
View Full Document

Ask a homework question - tutors are online