On Syntactic Congruences for !?languages Oded Malery Verimag
Miniparc ZIRST 38330 Montbonnot France
[email protected] Ludwig Staigerz
Martin-Luther-Universitat Halle-Wittenberg Institut fur Informatik Kurt-Mothes-Strae 1 D-06120 Halle Germany
[email protected] A preliminary version of this paper appeared in: STACS 93 Proc. 10th Annual Symposium on Theoretical Computer Science (P. Enjalbert, A. Finkel and K.W. Wagner Eds.), Lecture Notes in Computer Science, Vol. 665, pp. 586{594, Springer-Verlag, Berlin 1993 y The results presented in this paper have been obtained while the author was with INRIA/IRISA, Rennes, France. z The results presented in this paper have been obtained while the author was with Universit at Siegen, Siegen, Germany.
Abstract
In this paper we investigate several questions related to syntactic congruences and to minimal automata associated with !-languages. In particular we investigate relationships between the so-called simple (because it is a simple translation from the usual de nition in the case of nitary languages) syntactic congruence and its in nitary re nement (the iteration congruence) investigated by Arnold [Ar85]. We show that in both cases not every !-language having a nite syntactic monoid is regular and we give a characterization of those !-languages having nite syntactic monoids. Among the main results we derive a condition which guarantees that the simple syntactic congruence and Arnold's iteration congruence coincide and show that all (including in nite-state) !-languages in the Borel class F \G satisfy this condition. We also show that all !-languages in this class are accepted by their minimal-state automaton | provided they are accepted by any Muller automaton. Finally we develop an alternative theory of recognizability of !-languages by families of right-congruence relations, and de ne a canonical object (much smaller than the iteration monoid) associated with every !-language. Using this notion of recognizability we give a necessary and sucient condition for a regular !-language to be accepted by its minimal-state automaton.
Contents
1 2 3 4 5 6 A B
Introduction Preliminaries, Congruences and Automata Some observations on the iteration congruence The case when ' and = coincide Acceptance by minimal-state automata Recognition by right-congruences Proof of Lemma 13 Independence examples
1 2 3 5 7 9 16 18
1 Introduction The well-known Kleene-Myhill-Nerode theorem for languages states that a language U is regular (rational), i its syntactic right-congruence U de ned by
x U y i 8v 2 : xv 2 U () yv 2 U has a nite index. In that case the right-congruence classes correspond to the states of the unique minimal automaton that accepts U . An equivalent condition is that the ner two-sided syntactic congruence 'U de ned by
x 'U y i 8u 2 : ux U uy has a nite index. Here the congruence classes correspond to the elements of the transformation monoid associated with the minimal automaton accepting U . As already observed by Trakhtenbrot [Tr62] these same observations are no longer true in the case of !-languages (cf. also [JT83], [LS77] or [St83]). Here the class of !-languages having a nite syntactic monoid (so-called nite-state !-languages) is much larger than the class of !-languages accepted by nite automata (regular or rational !-languages) [St83]. Arnold [Ar85] investigated a new concept of syntactic congruence (henceforth called the iteration congruence) for !-languages. As his results show, this concept yields a characterization of regular !-languages by nite monoids (the iteration monoid), but not in the same simple way as for nitary languages. As we shall see below, despite the fact that the iteration monoid is indeed more accurate (it is in nite for some !-languages which are nite-state but not regular), yet there are even non-Borel !-languages for which the iteration monoid is nite. To this end we shall derive a necessary and sucient condition for an !-language for having a nite iteration monoid. As one of the main results we give a condition on !-languages that guarantees that the iteration syntactic congruence coincides with the simple one. We show that this condition holds for all (including those which are not nite-state) !-languages in the Borel-class F \ G . Not only in this sense does the class F \ G constitute a \well-behaving" fragment of the !-languages: we show also that such !-languages once accepted at all by an automaton are accepted by their \minimal-state" automaton, that is, by the automaton isomorphic to their syntactic right-congruence thus extending the result in [St83]. Finally, we introduce an alternative notion of recognizability by a family of right-congruence relations, and give a necessary and sucient condition for a regular !-language to be acceptable by its minimal-state automaton. This theory complements the existing algebraic theory of recognition by monoids (two-sided congruences). The rest of the paper is organized as follows: In Section 2 we give the necessary de nitions and notations. In Section 3 we investigate the properties of Arnold's iteration congruence. Sections 4 and 5 are devoted to the proofs of two important properties of F \ G !-languages: the coincidence of the iteration congruence and the simple congruence, and the acceptability by the minimal-state automaton. In Section 6 (which can be read independently of Sections 3{5) we develop the theory of recognizability by right-congruences, and apply it to derive a necessary and sucient condition for regular !-languages to be acceptable by their minimal-state automaton. 1
2 Preliminaries, Congruences and Automata
By we denote the set (monoid) of nite words on a nite alphabet , including the empty word e, let + denote ? feg and ! the set of in nite words (!-words). For an !-word = (1)(2) , we will use (i::j ) to denote the sub-word (i)(i + 1) (j ). As usual we will refer to subsets of as languages and to subsets of ! as !-languages. For u 2 and 2 [ ! let u be their concatenation and let u! be the !-word formed by concatenating the word u in nitely often (provided u 6= e) . The concatenation product extends in an obvious way to subsets U and B [ ! . For a language U let U and U ! denote, respectively, the set of nite and in nite sequences formed by concatenating words in U . By juja we denote the number of occurrences of the letter a 2 in the word u 2 . Finally u v and u v denote the facts that u is a pre x and a proper pre x of v. An equivalence relation ' is a congruence on if u ' v implies xuy ' xvy for all u; v; x; y 2 . We say that ' is a right-congruence if u ' v implies uy ' vy for all u; v; y 2 . Clearly, every congruence is also a right-congruence. We will denote by [u] := fv : v 2 and v ' ug the equivalence class containing the word u, and use hvi instead of [v] if the corresponding relation is a right-congruence. We will say that ' is nite when it has a nite index (or alternatively, the factor-monoid = ' is nite), and that it is trivial when ' is . As in [Ar85] we say that a congruence ' covers an !-language E provided E = Sf[u][v]! : uv! 2 E g and we say that an !-language E is regular provided there is a nite congruence ' which covers E . This is in fact equivalent to the condition that E = Sni=1 Wi Vi! for some n 2 IN and regular languages Wi; Vi X . The natural (Cantor-) topology on the space ! is de ned as follows. A set E ! is open i it is of the form U ! , where U (in other words, 2 E i it has a pre x in U ). A set is closed if its complement is open or equivalently if its elements do not have any pre x in some U 0 . The class G consists of all countable intersections of open sets. A set is in F if its complement is in G . Thus an F -set can be written as a countable union of closed sets. The rest of the Borel hierarchy is constructed similarly. We note here in passing that every regular !-language is contained in the Boolean closure of the Borel class F . Additional material on !-languages appears in [Ei74, EH93, HR85, LS77, PP93, St87, Th90, Wa79].
De nition 1 (Syntactic Congruences) Let E ! be an !-language. We associate with E the following equivalence relations on : Syntactic right-congruence:
x E y i 8 2 ! (x 2 E () y 2 E )
(1)
Simple syntactic congruence: x 'E y i 8u 2 (ux E uy)
(2)
In nitary syntactic-congruence: x E y i 8u; v 2 (u(xv)! 2 E () u(yv)! 2 E )
(3)
(Here we tacitly assume that neither xv nor yv are empty.) 2
Arnold's iteration syntactic-congruence: x =E y i x 'E y ^ x E y
(4)
By de nition ' re nes and = re nes both ' and . In the general case ' and are incomparable, since they refer to two dierent kinds of interchangeability of x and y. The following examples give evidence of this fact.
Example 1 Let E1 := fa; bbg a! . Then a 'E bb but a 6E bb. Hence the iteration and 1
1
the simple syntactic congruence associated with E1 are distinct.
Example 2 For E2 := abc! we have a 6'E b but a E b. (Nevertheless, since E2 is a closed !?language as Theorem 10 below shows, 'E and =E coincide). 2
2
2
2
We shall see later that some conditions on E imply that ' re nes . An !-language E such that 'E (or equivalently, E ) is nite is called nite-state. A deterministic Muller automaton is a quintuple A = (; Q; ; q0 ; T ) where is the input alphabet, Q is the state space, : Q ! Q is the transition function, q0 the initial state and T 2Q is a family of accepting subsets (the table). By Inf (A; ) we denote the subset of Q which is visited in nitely many times while A is reading 2 ! . The !-language accepted/recognized by A is f 2 ! : Inf (A; ) 2 T g. According to the Buchi-McNaughton theorem an !-language is regular i it is recognized by some deterministic nite-state Muller automaton. With every right-congruence relation we can associate an automaton, and in particular with the relation E for a given !-language E :
De nition 2 (Minimal-state automaton) Let E be an !-language and let E be its
syntactic right-congruence (De nition 1). Its minimal-state automaton is
AE := (; Q; ; q0 ) where Q := fhui : u 2 g, q0 := hei, and (hui; a) := huai. Here, in contrast to the language case, not every (regular) !-language E can be accepted by its minimal-state automaton AE . For example, the minimal-state automaton of fa; bga! has only one state and does not accept fa; bg a! , whereas there are several non-isomorphic two-state Muller automata accepting fa; bg a! (cf. [Mu63], [St83], [St87]).
3 Some observations on the iteration congruence
In this section we show that despite the fact that =E provides additional information on E which is missing from 'E , still it fails to characterize the regular !-languages in contrast to ' for languages.
Fact 1 There are !-languages which are nite-state while their iteration monoid is in -
nite.
3
Proof: Let the language V fa; bg be de ned by the equation V = a [ bV 2 : Alternatively, V may be de ned as the language consisting of those words v 2 satisfying jvja = jvjb + 1 and juja jujb for every u v. Let E := V ! . Then one easily veri es E = V E = (a [ bV 2)E = fa; bgE . Thus u 'E v for every u; v 2 fa; bg and 'E is trivial. In order to show that =E is in nite we prove that (bi ai+1)! 2 E and (bj ai+1 )! 62 E , that is bi 6 =E bj for 0 < i < j . Since bi ai+1 2 V , we have (biai+1 )! 2 V ! = E . On the other hand every word in V contains more occurrences of a than of b. Consequently, j > i implies that the !-word (bj ai+1)! has no pre x in V, whence (bj ai+1 )! 62 V ! E . The second observation (as already noted in [Ar85]) is that, in general, the niteness of
=E does not guarantee regularity of E :
Fact 2 The !-language Ult = fuv! : u 2 ; v 2 + g of all ultimately periodic !-words has a trivial syntactic monoid, that is x =Ult y for every x; y 2 , but is not regular. Next we investigate the question which !-languages have a an iteration congruence of nite index. To this aim we show that with every !-language E we can associate in a canonical way an !-language FE which is covered by =E . De ne [ FE = f[u][v]! : uv! 2 E g where [] denotes a congruence class of =E . The following statement holds true.
Lemma 3 E \ Ult = FE \ Ult. Proof: By de nition E \ Ult FE \ Ult . Let xy! 2 FE . Then there are u; v such that uv! 2 E and xy! 2 [u][v]! . From this we can obtain words y1 and y2 such that y = y1y2, and natural numbers i; j; m and n such that xyiy1 2 [u][v]m and y2yj y1 2 [v]n. Since =E vn and, because =E uvm and y2yj y1 =E is a congruence, it follows that xyiy1 i j ! m n ! ! uv (v ) = uv 2 E by the de nition of =E , also xy y1(y2y y1) = xy! 2 E . Theorem 4 For every E ! , the iteration congruence =E is nite i E is nite-state and there is a regular !-language F such that E \ Ult = F \ Ult. Proof: Let E be nite-state and let the regular !-language F satisfy E \ Ult = F \ Ult . It can be easily veri ed that x 'E y and x =F \Ult y imply x =E y and thus 'E \ =F =E . But the congruences 'E and =F are both nite and so is =E . Conversely, let =E be nite. Then FE is a regular !-language satisfying E \ Ult = FE \ Ult . In [St83] it was shown that the cardinality of the set fE : 'E is niteg is 22@0 , in particular, there are already as many subsets of ! whose simple syntactic monoid is trivial. The following claim shows that the same is true in the case of =E :
Claim 5 There are 22@ !-languages having a trivial iteration congruence. 0
4
Proof: Since the set fE : 'E is trivialg is closed under the Boolean operations, any !-language F for which 'F is trivial splits in a unique way into a disjoint union (F \ Ult ) [ (F ? Ult ) where for both parts ' is trivial. As Ult is countable,@ there are at most 2@ distinct parts of the form F \ Ult . Consequently, there are 22 !-languages E ! ? Ult such that 'E is trivial. But for every such E E is trivial and hence the 0
0
iteration congruence of E is trivial; this proves our assertion.
Given that a Borel class in ! contains only 2@0 sets and that there are only countably many Borel classes [Ku66], it follows that there are !-languages E even beyond the Borel hierarchy for which =E is trivial. This is in sharp contrast with the Myhill-Nerode theorem where the niteness of the syntactic monoid implies the regularity of the language.
4 The case when ' and = coincide
In Theorem 21 of [St83] it was proved that every nite-state !-language E ! which is simultaneously in the Borel classes F and G is regular. Our aim is to show that this very condition also guarantees the iteration congruence of E coincides with the simple syntactic congruence of E . It is remarkable that this condition holds for all !-languages in F \ G not only for those which are nite-state. First let us mention the following simple properties of the congruences 'E and =E :
Fact 6 For every u 2 , x; y 2 + : 1. If x 'E y then ufx; ygx! \ E 6= ; implies ufx; ygx! E 6 ; implies ufx; ygy! E . 2. If x =E y then ufx; ygx! \ E = Now we obtain the following necessary and sucient condition under which the congruences 'E and =E coincide:
Lemma 7 Let E ! . Then 'E = =E if and only if the following condition holds 8u 2 8x; y 2 +(x 'E y ! (ufx; ygx! E ! ufx; ygy! \ E 6= ;)) : Proof: Clearly, the condition is necessary. In order to show its suciency we assume x 'E y, and we show that then 8u; v 2 (u(xv)! 2 E ! u(yv)! 2 E ) that is, the additional condition for =E is satis ed. ! If x 'E y and u(xv) 2 E then xv 'E yv, and by the above claim we also have ufxv; yvg(xv)! E . Now our condition implies ufxv; yvg(yv)! \ E = 6 ;. Again the ! above claim shows that u(yv) 2 E .
As an immediate consequence we obtain the following simple sucient condition. To express it we de ne:
De nition 3 An !-language E has the period exchange property (or is period exchanging) provided for all u 2 ; x; y 2 + the inclusion ufx; ygx! E implies that ufx; ygy! \ E= 6 ;. 5
Corollary 8 If E has the period exchange property then 'E = =E . In order to prove the announced statement for !-languages in the Borel-class F \ G we recall that for every !-language E 2 G there exists a language U 2 such that for every 2 ! , 2 E i has in nitely many pre xes in U . Using this we can show the following.
Lemma 9 Every !-language E in the Borel-class F \ G has the period exchanging property.
Proof: Since both E and its complement are in G , there exist two languages U and U 0
such that every !-word in E has in nitely many pre xes in U and every !-word not in E has in nitely many pre xes in U 0 . Suppose that for some u; x; y 2 , ufx; ygx! E and ufx; ygy! ! ? E . Since ux! 2 E there is a number k1 such that uxk1 has a pre x in U , and since uxk1 y! 62 E , the word uxk1 yl1 has a pre x in U 0 for some l1 . Next we consider uxk1 yl1 x! 2 E : there must be some k2 such that uxk1 yl1 xk2 has at least two pre xes in U , etc. Repeating this alternating argument, we construct an in nite sequence uxk1 yl1 : : : xki yli : : : having in nitely many pre xes in U and in nitely many pre xes in U 0 and thus belonging simultaneously to E and to its complement. This imlies:
Theorem 10 For every !-language E 2 F \ G , and every x; y 2 x 'E y i x=E y. Note that the converse of Lemma 9 is not true in general: the !-language Ult is period exchanging, but not in G . However, for regular !-languages the converse is also true, |a similar observation was made in Theorem 6.2 of [Wi93].
Lemma 11 Every regular period exchanging !-language E belongs to the Borel-class F \ G . Proof: From [SW74] (cf. also [Wa79]) it is known that a regular !-language E is in F \ G i it is accepted by a nite-state Muller automaton A using a family of accepting subsets T having the following property: if T 2 T , T = Inf (A; ) for some 2 ! , T 0 = Inf (A; ) for some 2 ! , and T \ T 0 = 6 ; then T 0 2 T . Let E be a regular period exchanging !-language accepted by a nite Muller automaton A = (; Q; ; q0 ; T ), and let T = Inf (A; ) 2 T be an accepting subset and let T 0 be another subset such that q 2 T \ T 0 for some q 2 Q and Inf (A; ) = T 0 for some 2 ! . Among the !-words whose Inf is T there is a word ux! satisfying (q0 ; u) = q, (q; x) = q and T = f(q; x0) : x0 xg. Similarly there is a word y such that (q; y) = q and T 0 = f(q; y0) : y0 yg. One can see that for every 2 ufx; ygx! , Inf (A; ) = T and thus ufx; ygx! E and, since E is period exchanging, we have some 2 ufx; ygy! \ E . But Inf (A; ) = T 0 and, hence, T 0 must also be in T .
Although it follows from Claim 5 that ' and = coincide for some non-Borel sets, in general even for regular !-languages in the Borel class F it happens that ' and = may not coincide (cf. Example 1). On the other hand the following example shows a regular !-language in F where ' and = coincide; yet the language is not period exchanging:1 1
A rst example of this kind was obtained by Th. Wilke (personal communication).
6
Example 3 Let E3 := fa; bg a! [ ca! . Then E has as congruence classes a and fa; b; cg ? a , and the inclusion 'E E is easily veri ed. On the other hand fa; bg a! E3 but fa; bg b! \ E3 = ;. 3
3
3
5 Acceptance by minimal-state automata
In this section we will show that !-languages in F \ G have another important property, namely they are accepted by their minimal-state automaton. Again, this property is true for arbitrary !-languages, not necessarily nite-state, provided that they can be accepted at all by a Muller automaton. The last reservation is in order because, as we show below, not every !-language, even those in F \ G , can be accepted by a Muller automaton. For a given automaton A we will denote f : Inf (A; ) = ;g by A; and f : Inf (AE ; ) = ;g by E ;, where AE is the minimal-state automaton of E . Claim 12 An !-language E can be accepted by the Muller automaton A = (; Q; ; q0 ; T ) only if E ; E or E ; \ E = ;. Proof: Clearly any Muller automaton can accept E only if A; E or E \A; = ;. Since any automaton A accepting E re nes AE we have E ; A; and the result follows. Claim 12 is irrelevant in the case of a nite-state automaton A, because then E ; = ;. But the following example shows that for an in nite-state automaton A the set E ; may indeed be non-empty. Example 4 Let := aba2 b2 a3 b3 : : : Clearly, E4 = f g is not nite-state, more exactly, we have u 6E4 v whenever u and u v, and u E4 v when both u and v are not pre xes of . Thus E4 = E4; . We continue with an example of a simple !-language not accepted by a Muller automaton. Example 5 Let := aba2 b2 a3 b3 : : :, let := bab2 a2 b3 a3 : : : and consider the !-language E5 = f g [ (b! ? fg). In the same way as above one obtains f g [ fg = E5; and Claim 12 shows that E5 cannot be accepted by any Muller automaton. Note that, in this case, E5 is the union of the closed set f g and the open set (b! ?fg), hence in F \ G . Moreover, since similar to Example 4, the !-languages (b! ? fg), (! ? fg), and f g [ b! are accepted by their corresponding minimal-state automata, Example 5 shows that the class of !-languages accepted by arbitrary Muller automata is not closed under union and intersection (though it is obviously closed under complementation). Having demonstrated this phenomenon we will show that !-languages in F \ G which are accepted by Muller automata are already accepted by their minimal-state automata. First we mention a property of the right congruence E for !-languages E 2 F \ G which follows from results of [St83]. For the sake of completeness we shall give the proof in Appendix A. Lemma 13 If E ! is in F \ G then [ E = (E \ E ;) [ E (u) u2Pref (E )
where Pref (E ) = fu : E \ u ! 6= ;g and E (u) = f : u ^8v(v ! 9x(vx E u))g. Observe that here vx need not be a pre x of .
7
This is a stronger property than the one given in [DL95] for saturating right congruences of regular !-languages E 2 F \ G . Compare also to the Landweber right congruences for regular !-languages E 2 G derived in [Le90]. In case E ; E we obtain that the condition u can be removed in the de nition of 2 E (u).
Lemma 14 If E ! is in F \ G and E ; E , then [ E = E; [ E 0 (u) u2Pref (E )
where E 0(u) = f : 8v(v ! 9x(vx E u))g.
Proof: Since E (u) E 0(u) for every u, we have E = E ; [ S E (u) E ; [ S E 0 (u). To show the other side of the inclusion assume 2 E 0 (u) for some u 2 Pref (E ). If 2 E ; then 2 E and we are done. Otherwise we have = y1y2 : : : such that for all i, y1 : : : yi E y1. Since there is a word x such that y1x E u, we also have y1 2 Pref (E ) and 2 E 0(y1) with y1 , in other words, 2 E (y1).
The condition E ; E is indeed essential for removing u in the de nition of E (u). Consider e.g. E := ! ? E4 . Here E 0(e) = ! 6 E .
Theorem 15 Let E 2 F \ G such that either E ; E or E \ E ; = ;. Then E is accepted by its minimal-state automaton AE . Proof: We observe that the class of all subsets of ! acceptable by Muller automata as well as the class F \ G are closed under complementation. So we may Sassume without loss of generality that E ; E . From Lemma 14 it follows that E = E ; [ u2Pref (E ) E 0 (u). So for every u we let Tu = fhvi : 9x(vx E u)g and let Tu be 2Tu ?f;g. Clearly, for every S ! 0 ; 2 , 2 E (u) ? E i Inf (AE ; ) 2 Tu, so by letting T = f;g [ u2Pref (E ) Tu we can make AE accept E .
Since for a nite-state !-language E the set E ; is always empty, our theorem yields as an immediate consequence the assertion of Theorems 21 and 24 of [St83].
Corollary 16 If E is a nite-state !-language in F \G then E is regular and is accepted by its ( nite) minimal-state automaton AE . Note that Example 1 shows that this condition (E being in F \ G ) is not a necessary one:
Example 1 (continued) Theorem 10 and Example 1 prove that E1 62 F \ G (In fact E1 is in F , since it is a countable set, hence E1 62 G .), but it is easily veri ed that AE 1
accepts E1 (cf. [St83, Example 1]).2
Next we will provide a necessary condition for an !-language E to be acceptable by its minimal-state automaton AE . This condition is based on a relation between E and 'E and is valid for arbitrary (not necessarily regular) !-languages. Let us de ne a congruence relation based on E which re nes 'E by considering two words to be equivalent only if they have the same set of right-factors (modulo E ). N. Gutleben (personal communication) showed that arbitrary high degrees of Wagner's [Wa79] hierarchy contain regular !-languages E accepted by AE . 2
8
De nition 4 (Factorized congruence) The factorization of E is a congruence E de ned as x E y i 8u 2 1. ux E uy and 2. 8v(v x ! 9v 0 (v 0 y ^ uv E uv0)) and 3. 8v 0 (v 0 y ! 9v(v x ^ uv E uv0)) It is more intuitive to see the meaning of this relation in terms of the minimal-state automaton AE . Here x E y i from every state q both x and y lead to the same state while visiting the same set of states. (Observe that x 'E y i from every state q of AE both x and y lead to the same state without necessarily visiting the same set of intermediate states). One can see that u E v and x E y imply that for every z, Inf (AE ; u(xz)! ) = Inf (AE ; v(yz)! ). A similar re nement of the right congruence related to a deterministic automaton was introduced in [DL95] as the cycle congruence of an automaton.
Claim 17 An !-language E can be accepted by its minimal-state automaton AE using Muller condition only if x E y implies x E y for all x; y 2 . Proof: Suppose that x E y and x 6E y, that is, for some x E y, there exist u; v such that u(xv)! 2 E and u(yv)! 62 E . But xv E yv, hence Inf (AE ; u(xv)! ) = Inf (AE ; u(yv)! ), and AE cannot accept E . The condition of the previous claim fails to be sucient. To this end consider again Example 3.
Example 3 (continued) One veri es that AE cannot accept E3 = fa; bga! [ ca! . But in virtue of E 'E and 'E E we have E E . Intuitively the reason is that E is too re ned: a 6E b because ca 6E cb and yet Inf (AE ; aa! ) = Inf (AE ; ab! ). In the next section we will introduce more suitable de nitions for that purpose. Recalling that 'E and =E coincide, we can conclude that the questions whether AE accepts E and whether 'E and =E coincide, being both related to 3
3
3
3
3
3
3
3
3
3
3
3
the study of syntactic congruences, are likewise independent (cf. also Appendix B).
6 Recognition by right-congruences In this section we will develop an alternative theory of recognition of !-languages by right-congruence relations, as a complement to the recognition by two-sided congruences (monoids) described in [Ar85, Ei74, PP93, Th90]. Using this theory we give a necessary and sucient condition for a regular !-language to be accepted by its minimal-state automaton.
De nition 5 (Family of right-congruences) A family of right-congruences (FORC) is a pair R = (; fu ghui2= ) such that: 1. is a right-congruence relation. 2. u is a right-congruence relation for every hui 2 = . 9
3. For all u; x; y 2 , x u y implies ux uy.
As we can see, a FORC consists of a \leading" relation and a relation associated with each of its classes. We will denote classes of by hui and classes of u by hviu. A FORC is nite if all the right-congruences are of nite index. As in the case of nite congruences, the following factorization property holds:
Lemma 18 Let R be a nite FORC. Then every !-word has a factorization = uv1v2; : : : such that vi u vi+1 and uvi u for all i > 0. Proof: (Along the same lines of the proof of Lemma 2.2 in [Th90] for congruences, cf. also Section 2.3 of [PP93]). Let = u such that hui is a class of that appears in nitely often in and let J = fj1; j2 ; : : :g be an increasing sequence of indices such that u (1::ji) u for every i. Next we de ne an equivalence relation on IN: n1 n2 if for some m > n1; n2 (n1::m) u (n2 ::m) (in other words, positions n1 and n2 \merge" after m). By the niteness of u , is nite too, so we can take an in nite sub-sequence of of indices K = fk1; k2; : : :g J such that ki < ki+1 and ki + 1 ki+1 + 1, that is, for every i there is some mi ki+1 + 1 such that (ki + 1::mi) u (ki+1 + 1::mi). Finally we take a sub-sequence of indices L = fl1; l2; : : :g K such that for some v, (l1 + 1::li ) 2 hviu for every i, and (li + 1::m) u (li+1 + 1::m) for some m li+2 . Let vi := (li + 1::li+1). Then v1 vi u v. By de nition of it also implies (li +1::li+2) u (li+1 +1::li+2),that is vi vi +1 u vi +1, so, by induction, for every i 1, (li +1::li+1 ) = vi 2 hviu and together with u (1::l1) u we have the desired factorization.
De nition 6 (Recognition by FORCs) An !-language E is covered by a FORC R = (; fughui2 =) if it can be written as a union of sets of the form hui(hviu)! such that uv u. An !-language E is saturated by R if for every u; v such that uv v, hui(hviu)! \ E =6 ; implies hui(hviu)! E . An !-language E is recognized by R if it is both covered and saturated by it.
As for congruences, in the special case of nite FORCs, covering and saturation coincide.
Lemma 19 A nite FORC R covers an !-language E if and only if it saturates E . Proof: (See also proof of Lemma 1.1 in [Ar85]). Saturation implies covering by virtue
of the Factorization Lemma 18. Now we show that covering implies saturation: Suppose hui(hviu)! \ E 6= ;. Since hui(hviu)! \ E is regular it contains an ultimately-periodic word xy! . Since y is nite we have xy! = z1 z2! , where z1 = xyn1 y1, z2 = y2yn2 y1, y = y1y2, z1 uvm1 u and z2 u vm2 . Since hui(hviu)! huvm1 i(hvm2 iu)! , by covering we have hui(hviu)! E .
Next we will show how every deterministic automaton A = (; Q; ; q0 ) de nes an associated FORC that bears important information about the transition structure of the automaton. For every q 2 Q and u 2 we will denote by Vis (q; u) the set of states visited by the automaton while reading u starting at q, and let MSCC (q) := fq0 : 9x((q; x) = q0) ^ 9y((q0; y) = q)g be the maximal strongly-connected component in the transition graph of A which contains q. 10
De nition 7 (The FORC of an automaton) Let A = (; Q; ; q0 ) be a deterministic automaton. The FORC associated with A is RA = (; fu ghui2= ) de ned as: 1. x y i (q0; x) = (q0 ; y) 2. x u y i Vis (q; x) \ MSCC (q 0 ) = Vis (q; y) \ MSCC (q 0) whenever (q0 ; u) = q and (q; x) = (q; y) = q 0.
In other words x and y are congruent from q = (q0; u) if they lead to the same state, and if they visit the same set of states which the automaton may still visit in the future. It is easily veri ed that RA is indeed a FORC.
Claim 20 Two !-words have the same Inf in A if and only if they have equivalent RA factorizations into hui(hviu)! with uv u. Proof: Let be any !-word such that Inf (A; ) = T = fq1; : : : ; qmg and let i1 be the rst occurrence of q1 in the run of the automaton over after all the states in Q ? T have
disappeared. For every k > 1 let ik be the rst occurrence of q1 such that all the states in T occurred between positions ik?1 and ik . By letting u = (1::i1 ) and vk = (ik + 1::ik+1) we obtain the desired factorization. Conversely it is immediate to see that such a factorization determines Inf (A; ).
Corollary 21 A Muller automaton A can accept E if and only if its FORC RA recognizes E.
Proof: If RA does not recognize E there must be some 2 E and 62 E having the same Inf and A cannot accept E . If RA recognizes E then for every T 2 2Q all the words 2 ! such that Inf (A; ) = T have an identical factorization, and thus the set T of accepting subsets can be determined consistently.
Theorem 22 (\Myhill-Nerode" theorem for !-languages) An !-language is regular if and only if it is recognized by a nite FORC.
Proof: The only-if part follows from Corollary 21. Suppose E is recognized by a FORC. Since every set hui and hviu is regular, every nite union of sets of the form hui(hviu)! is, by de nition, !-regular.
The next step is to de ne a partial-order among FORCs.
De nition 8 Let R = (; fughui2 =) and R0 = (0 ; f0ughui2 =0 ) be two FORCs. We say that R0 re nes R (R0 R) if 1. 8x; y 2 (x 0 y ! x y), and if 0 = then 2. 8u; x; y 2 (x 0u y ! x u y): De nition 9 (Syntactic FORC) Let E be a regular !-language. The syntactic FORC associated with E is RE = (E ; fughui2=E ) where E is the syntactic right-congruence of E and for every u, x u y i 11
1. ux E uy and
2. 8v(v 2 ^ uxv E u ! (u(xv)! 2 E () u(yv)! 2 E ))
One can see that u is coarser than the in nitary congruence in two respects: 1. It does not quantify over all u (just those in hui), and 2. it does not quantify over all v, only over those for which xv (and hence also yv) makes a cycle from hui.
Lemma 23 Any regular !-language E is recognized by its syntactic FORC RE . Proof: (We prove it similarly to Lemma 2.2 in [Ar85]). Suppose the contrary, i.e., hui(hviu)! \ E 6= ; but hui(hviu)! 6 E for some u; v satisfying uv E u. Then by regularity there exist uv! 2 E and xy! 2 hui(hviu)! ? E . Due to the niteness of y there exist some m; n such that xy! = zx1 : : : xm (y1 : : : yn)! with z E u and xi u yj u v for every i m; j n. This implies that zx1 : : : xm E u and y1 : : : yn u vn and thus by the de nition of u , zx1 : : : xm (y1 : : : yn)! 2 E if u(vn)! 2 E which means xy! 2 E , a
contradiction.
Theorem 24 For every regular !-language E , its syntactic FORC RE is the largest FORC recognizing it.
Proof: Let R = (; fu ghui2=) be a FORC recognizing E and let R > RE . Then E , or = E and u u for some u 2 . First, suppose that for some x; y we have x y but x 6E y, that is, for some 2 ! , x 2 E but y 62 E . But then x has a factorization x = uv1v2 ; : : : where x u and vi 2 hviu. Since x y, y has a similar factorization y = u0v1 v2 ; : : : with u0 u and thus we have shown hui(hviu)! contains both x and y contrary to the assumption that R recognizes E . Suppose now that =E and for some u; x; y we have x u y but x 6u y. This means that there is some z such that uxz uyz u and u(xz)! 2 E but u(yz)! 62 E . Since u is a right-congruence we also have xz u yz and thus hui(hxziu)! contains both members and non-members of E , again, contrary to the assumption that R recognizes E . Applying this result to the FORC associated with an automaton we get:
Corollary 25 A Muller automaton A can accept a regular !-language E if and only if its associated FORC RA re nes the syntactic FORC RE . In particular, considering the minimal-state automaton of E , AE , its corresponding FORC can be rephrased as follows:
De nition 10 (Automatic-Syntactic FORC) Let E be a regular !-language. The automatic-syntactic FORC associated with E is RAE = (E ; fughui2=E ) where E is the syntactic right-congruence of E and for every u, x u y i 1. ux E uy and 2. 8v(v x ^ 9z(uxz E uv) ! 9v 0 (v0 y ^ uv E uv0 )) and 12
3. 8v 0 (v 0 y ^ 9z(uyz E uv0 ) ! (9v(v x ^ uv E uv 0)):
This is just a reformulation of De nition 7 but in an automaton-free manner. As a direct application we can give an exact characterization of those regular !-languages that can be accepted by their minimal-state automaton.
Theorem 26 Let E be a regular !-language Let RE = (E ; fughui2=E ) be its syntactic FORC (De nition 9) and let RAE = (E ; fughui2 =E ) be its automatic-syntactic FORC (De nition 10). E can be accepted by the automaton AE if and only if for all u; x; y 2 , x u y implies x u y. Proof: It follows from Corollary 25 As an illustration consider once more E3 = fa; bga! [ ca! . Now we have a a b but a 6a b and for this reason AE3 cannot accept E3. On the other hand consider E = a bfb [ aag ab! . The methods developed in [Wa79] prove that E 2 F ? G , hence E 62 F \ G . Here the classes of E are hei = a , hbi = abfb [ ab ag and hbai = a bfb [ ab ag ab . The following table depicts the congruence classes of fug and fug for hui 2 = E and one can, indeed, see that the condition of Theorem 26 is satis ed, E = hbai(hbiba )! and AE accepts E .
hui hei
u
u
a a a bfb [ ab ag ab+ , ab(b ab a)+b a bfb [ ab agab abfb [ ab ag ab hbi fb [ ab ag b , (b ab a)+ fb [ ab ag ab fb [ ab agab hbai b b (b ab a)+b (b ab a)+b (b ab a)b a (b ab a) b a It can be easily veri ed that for !-languages having the period exchanging property the hypothesis of Theorem 26 is trivially satis ed. Hence in connection with the Lemmas 9 and 11 we obtain an alternative proof of Corollary 16. Unlike Theorem 10, our Theorem 26 and also Lemma 23 in general do not hold for arbitrary !-languages: Consider, e.g., the !-language Ult de ned above. Since Ult is trivial and Ult contains all ultimately periodic !-words, also the congruences u and u are trivial. Hence, x u y implies x u y, but AUlt does not accept Ult . The introduction of the FORC concept may have signi cance beyond the proof of the above theorem. Up to now the only syntactic characterization of !-languages was by means of a two-sided congruence and the lack of the other half of a Myhill-Nerode theorem was believed to be an inherent feature of the theory of !-languages | we have shown that this is not the case. From a practical point of view, although the iteration congruence =E (which is the intersection of E with fu ghui2=E ) has a simpler de nition, its size might be exponentially larger, and there are situations3 where the right-congruences are the right congruences. 3
For example, when we want to learn an !-language from examples as in [MP95].
13
Acknowledgement
We would like to thank A. Arnold for not believing a stronger version of Claim 17 and E. Badouel for pointing out that an earlier version of Theorem 26 was weaker than necessary. Finally, our debts are due to N. Klarlund for pointing out a aw in an earlier version of De nition 8, and to an anonymous referee for some useful suggestions.
References [Ar85] A. Arnold, A syntactic congruence for rational !-languages, Theoret. Comput. Sci. 39, 333{335, 1985. [DL95] Do Long Van, B. LeSaec and I. Litovsky, Characterizations of rational !languages by means of right congruences, Theoret. Comput. Sci. 143 (1995) 1, 1{21. Preliminary version: A syntactic approach to deterministic !-automata. in D. Krob (Ed.), Theorie des Automates et Applications, 133{146, Actes des Deuxiemes Journees Franco-Belges, Rouen, 1991. [Ei74] S. Eilenberg, Automata, Languages and Machines, Vol. A, Academic Press, New York, 1974. [EH93] J. Engelfriet and H.J. Hoogeboom, X-automata on !-words. Theoret. Comput. Sci. 110, 1{51, 1993. [HR85] H.J. Hoogeboom and G. Rozenberg, In nitary Languages { Basic Theory and Applications to Concurrent Systems, in J.W. de Bakker et al. (Eds.), Current Trends in Concurrency, 266{342, LNCS 224, Springer-Verlag, Berlin, 1985. [JT83] H. Jurgensen and G. Thierrin, On !-languages whose syntactic monoid is trivial, Intern. J. Comput. Inform. Sci. 12, 359{365, 1983. [Ku66] K. Kuratowski, Topology I, Academic Press, New York, 1966. [Le90] B. LeSaec, Saturating right congruences, RAIRO Infor. theor. et Appl. 24, 545{ 560, 1990. [LS77] R. Lindner and L. Staiger, Algebraische Codierungstheorie { Theorie der sequentiellen Codierungen, Akademie-Verlag, Berlin, 1977. [MP95] O. Maler and A. Pnueli, On the Learnability of In nitary Regular Sets, Information and Computation 118, 316-326, 1995. Preliminary version: in L.G. Valiant and M.K. Warmuth (Eds.), Proc. of the 4th annual workshop on Computational Learning Theory, Morgan Kaufmann, San Mateo, 1991. [Mu63] D.E. Muller, In nite sequences and nite machines, in Proc. of the 4th Ann. IEEE Symp. Switching Theory and Logical Design, Chicago 1963, 3{16. [PP93] D. Perrin and J.-E. Pin, Mots In nis, Report LITP 93.40, Institut Blaise Pascal, Paris, 1993. [St83] L. Staiger, Finite-state !-languages, J. Comput. System Sci. 27, 434{448, 1983. 14
[St87] L. Staiger, Research in the Theory of !-languages, J. Inf. Process. Cybern. EIK 23, 415{439, 1987. [SW74] L. Staiger and K. Wagner, Automatentheoretische und automatenfreie Charakterisierungen topologischer Klassen regularer Folgenmengen, Elektron. Informationsverarb. Kybernet. EIK 10, 379{392, 1974. [Th90] W. Thomas, Automata on In nite Objects, in J. Van Leeuwen (Ed.), Handbook of Theoretical Computer Science, Vol. B, 133{191, Elsevier, Amsterdam, 1990. [Tr62] B.A. Trakhtenbrot, Finite automata and monadic second order logic, Siberian Math. J. 3, 103{131, 1962. (Russian; English translation in: AMS Transl. 59, 23{55, 1966.) [Wa79] K. Wagner, On !-regular sets, Inform. Control 43, 123{177, 1979. [Wi93] Th. Wilke, An algebraic theory for regular languages of nite and in nite words, Intern. J. Algebra and Computation 3, 447{489, 1993. Preliminary version: An Eilenberg theorem for 1-languages, in J. Albert Leach, B. Monien and M. Rodrguez Artalejo (Eds.), Proc. of the 18th. Intern. Colloquium on Automata, Languages and Programming, 588{599, LNCS 510, SpringerVerlag, Berlin 1991.
15
A Proof of Lemma 13 As it was announced in Section 5 we give a proof of Lemma 13: If E ! is simultaneously an F - and a G -set then [ E = (E \ E ; ) [ f : w ^ 8u(u ! 9v(uv E w))g : w2Pref (E )
To this end we introduce some notation. We call an !-language D ! strongly connected i 8u(u 2 Pref (D ) ! 9v (v 2 ^ uv D e )) ; that is, for every u which is a nite pre x of some !-word 2 D there is a v 2 such that D \ uv! = uvD. This notion corresponds to the strong connectivity of the partial automaton A0D which is obtained from the minimal-state automaton AD by deleting the state (dead sink) hw~i = fw : w 62 Pref (D )g. With D we associate the following !-language D~ D~ := f : 8u(u ! 9v(uv D e))g ; (5) and its connected part cn(D) (cf. also [St83]). cn(D) := D \ D~ : (6) Remark : In (5) we can likewise replace the quanti er 8u by 91 u (there are in nitely many u) Since D~ = ! ? fw : 8v(wv 6D e)g ! , the !-language D~ is closed. Moreover, we have the following. Fact 27 Let for D ! the !-language D~ be de ned as above. Then w D w0 implies w D~ w0 and w cn(D) w0.
Proof. Let w D w0. In order to show w D~ w0, by symmetry it suces to verify that w 2 D~ implies w0 2 D~ . Now let (ui)i2IN be an in nite family of nite pre xes of such that 8i9vi (wuivi D e). Then in view of w D w0 we have also 8i9vi (w0uivi D e). Hence w0 2 D~ . Now w cn(D) w0 follows from (6). Furthermore the connected part cn(D) has the following properties (cf. [St83, Lemma 16 and Proposition 17]).
Lemma 28
1. cn(D) is a strongly connected !-language. 2. If cn(D) is nonempty and closed then cn(D) = D~ Proof. 1. Let w 2 Pref (cn(D )) = Pref (D \ D~ ). Then in view of the de nition of D~ (see (5) above) wv D e for some v. Now Fact 27 shows wv cn(D) e. 2. Assume ; 6= cn(D) D~ . Since D~ itself is closed, there is a w 2 such that D~ \ w! 6= ; and cn(D) D~ ? w! . Let 2 D~ such that w . Then there is a v satisfying wv D e. According to Fact 27 we have wv cn(D) e. Hence, cn(D) \ wv! = wv cn(D), and cn(D) \ w! = ; implies
16
cn(D) = ;, a contradiction. As a next result we need a topological property of strongly connected !-languages in F \ G (cf. [St83, Lemma 20]).
Lemma 29 Let D be a strongly connected !-language which is simultaneously in F and in G . Then D is already closed.
Proof. From [Ku66] it is known that for every nonempty D 2 F \ G there is a w 2 such that D \ w! is nonempty and closed. Utilizing the strong connectivity of D we obtain a v 2 satisfying D \ wv! = wvD. The left hand side of this identity equals (D \ w! ) \ wv! , thus it is closed. Consequently, wvD and also D are closed. The assertion of Lemma 13 can be restated now as follows. If E 2 F \ G and E \ w! 6= ; then
E w f : 8u(u ! 9v(wuv E w))g :
Proof. Set E=w := f : w 2 E g, that is w E=w = E \ w! . Hence E=w is also in F \ G . According to Lemma 28.1 and Lemma 29 the set cn(E=w) is closed. Hence g = f : 8u(u ! 9v(wuv E w))g, because of the equivalence cn(E=w) = E=w x E=w y i wx E wy. Now the assertion follows from cn(E=w) E=w.
17
B Independence examples Here we show that although the condition of Claim 17 fails to be a sucient one, it is neither trivially satis ed nor does it necessarily imply one of the conditions `'E = =E ' or `AE accepts E ' even in case if E is regular. First we give an example of an !-language E6 such that E6 E6 does not hold true.
Example 6 Let := fa; bg and E6 := fa; bg a! . Then 'E is trivial. Hence E is also trivial, but a 6E b. Consequently, neither 'E and =E coincide nor does AE accept E6 . In the second example an !-language E7 is given for which E E holds, but neither 'E and =E coincide nor does AE accept E7. Example 7 De ne E7 := (b a)! [ (a2 )ca! . The automaton AE has ve states hei, hai, hbi, hci, and hcci, and is given by the following equations: haai = hei habi = hbi = hbai = hbbi haci = hbci = hcbi = hcci hcai = hci One can see that AE does not accept E7 , and that (a2 ) , a(a2 ) , a bfa; bg , (a2 ) ca , a(a2 )ca , and fa; bgcfa; b; cg ? a ca are the congruence classes of 'E . Now consider the empty word e. Since c(ea)! = ca! 2 E7 but c(xa)! 62 E7 unless x 2 a , we have that x E e implies x 2 a. On the other hand we have b! 2 E7 and (ban)! 62 E7 for n > 0. Hence x E e implies that x 62 a ? feg. Thus aa 'E e but aa6 =E e. Utilizing similar arguments it is easy to verify that E has the following congruence classes: feg, a+ , a bfa; bg , and fa; bg cfa; b; cg . Since E re nes 'E , we obtain E E from the observation that w E e implies 6
6
6
6
6
6
7
7
7
7
7
7
7
7
7
7
7
7
7
w = e.
7
7
7
7
18
7