Separating Regular Languages with First-Order Logic

Size: px
Start display at page:

Download "Separating Regular Languages with First-Order Logic"

Transcription

1 Seprting Regulr Lnguges with First-Order Logic Thoms Plce Mrc Zeitoun LBRI, Bordeux University, Frnce Astrct Given two lnguges, seprtor is third lnguge tht contins the first one nd is disjoint from the second one. We investigte the following decision prolem: given two regulr input lnguges of finite words, decide whether there exists first-order definle seprtor. We prove tht in order to nswer this question, sufficient informtion cn e extrcted from semigroups recognizing the input lnguges, using fixpoint computtion. This yields n EXPTIME lgorithm for checking first-order seprility. Moreover, the correctness proof of this lgorithm yields stronger result, nmely description of possile seprtor. Finlly, we prove tht this technique cn e generlized to nswer the sme question for regulr lnguges of infinite words. Ctegories nd Suject Descriptors Theory of computtion [Forml lnguges nd utomt theory]: Regulr lnguges; Theory of computtion [Logic]: Finite Model Theory Keywords Words, Infinite Words, Regulr Lnguges, Semigroups, First-Order Logic, Expressive Power, Ehrenfeucht-Frïssé gmes, Seprtion. 1. Introduction In this pper, we investigte decision prolem on word lnguges: the seprtion prolem. The prolem is prmetrized y clss Sep of seprtor lnguges nd is s follows: given s input two regulr word lnguges, decide whether there exists third lnguge in Sep contining the first lnguge while eing disjoint from the second one. More thn the decision procedure itself, the primry motivtion for investigting this prolem is the insight it gives on the clss Sep. Intuitively, in order to get such decision procedure, one hs to consider ll instnces of seprle pirs of lnguges simultneously, which requires strong understnding of the discriminting power of Sep. In prticulr, the seprtion prolem generlizes the Supported y ANR 2010 BLAN FREC Permission to mke digitl or hrd copies of ll or prt of this work for personl or clssroom use is grnted without fee provided tht copies re not mde or distriuted for profit or commercil dvntge nd tht copies er this notice nd the full cittion on the first pge. Copyrights for components of this work owned y others thn ACM must e honored. Astrcting with credit is permitted. To copy otherwise, or repulish, to post on servers or to redistriute to lists, requires prior specific permission nd/or fee. Request permissions from permissions@cm.org. CSL-LICS 2014, July 14 18, 2014, Vienn, Austri. Copyright c 2014 ACM $ memership prolem whose motivtion is lso to understnd the expressive power of the clss Sep. In this restricted prolem, one only needs to decide whether single input regulr lnguge lredy elongs to Sep. Since regulr lnguges re closed under complement, testing memership cn e chieved y testing whether the input is seprle from its complement. Therefore, memership cn e reduced to seprtion. Solving the memership prolem is lredy known to e difficult question. However the serch for seprtion lgorithms is intrinsiclly more difficult. In oth cses, the prolem mounts to finding lnguge in Sep. However, in the memership cse, there is only one cndidte which is lredy known: the input. Therefore, we strt with fixed recognizing device for this unique cndidte nd powerful tools re ville, viz. the syntctic monoid of the lnguge, which is now ccepted s the nturl tool for solving the memership prolem for word lnguges. In the seprtion cse, there cn e infinitely mny cndidtes s seprtors, which mens tht there is no fixed recognition device tht we cn use. An even hrder question then is to ctully construct seprtor lnguge in Sep. First-order logic. In this pper, we choose Sep s the clss of lnguges definle y first-order sentences (i.e., sets of words tht stisfy some first-order sentence). In this context, the seprtion prolem cn e rephrsed s follows: given two regulr lnguges s input, decide whether there exists first-order sentence tht is stisfied y ll words of the first lnguge, nd y no word of the second one. Thus, such formul witnesses tht the input lnguges re disjoint. Within the mondic second order logic, which defines on finite words ll regulr lnguges, first-order logic is often considered s the yrdstick. It is roust clss hving severl chrcteriztions [5]. It corresponds to str-free lnguges, nd hs the sme expressive power s liner temporl logic [9]. In prticulr, it ws the first nturl clss for which the memership prolem ws proved to e decidle. This result, known s Schützenerger s theorem [12, 18], served s templte nd strting point of line of reserch tht successfully solved the memership prolem for most of the nturl clsses of regulr lnguges. This mkes first-order logic the nturl cndidte to serve s the exmple for devising generl pproch to the seprtion prolem. Schützenerger s theorem sttes tht first-order definle lnguges re exctly those whose syntctic semigroup is periodic, i.e., hs only trivil sugroups. Since the syntctic semigroup of lnguge is computle nd periodicity is decidle property, this yields decision procedure for memership. Schützenerger s originl proof hs een refined over the yers. Our own proof for seprtion y first-order logic ctully generlizes more recent proof y Wilke [23]. Similr results [13, 20] mke it possile to decide first-order definility for lnguges of infinite words, or finite or infinite Mzurkiewicz trces. See [5] for survey.

2 Contriutions nd min ides. The core of the intuition is to compute the limit of wht cn e expressed y first-order sentences, with respect to fixed semigroup. From two regulr lnguges, it is esy to construct single morphism recognizing them oth. We present n lgorithm tht computes enough informtion out this morphism to nswer the seprtion question for ll pirs of lnguges tht it recognizes. Intuitively, given morphism from A + into finite semigroup S, we need to compute ll pirs (s, t) S S tht cnnot e distinguished with first-order logic. By this, we men tht the preimges of s nd t in A + re not seprle y first-order logic: ny first-order lnguge contining one preimge hs to intersect the other one. To compute ll these pirs, nturl ide is to strt with trivil pirs (s, s), nd to itertively compute the missing ones y fixpoint lgorithm. However, for this pproch to work, it turns out tht one needs to compute even more informtion thn just pirs: we compute FO-indistinguishle sets, i.e. susets of S tht cnnot e distinguished y first-order logic. Notice tht eing le to compute these FO-indistinguishle sets lso hs independent interest from the seprtion prolem. One cn view morphism from A + into finite semigroup s mchine tht computes informtion out input words. The ssocited FO-indistinguishle sets descrie wht cn nd cnnot e expressed in first-order logic out these computtions. The connection etween the seprtion prolem nd the computtion of these indistinguishle pirs or susets hs first een oserved y Almeid [1]. Rephrsed in purely lgeric terms, this mounts to computing the so-clled pointlike sets for the lgeric vriety corresponding to the clss of seprtors under investigtion. For the vriety corresponding to first-order definle lnguges, nmely tht of periodic semigroups, pointlike sets hve een shown computle y Henckell [6] (see lso [7], tht nswers the prolem for even lrger clsses). Thus, comining this work with Almeid s solves the seprtion prolem y first-order definle lnguges. However, this pproch does not meet our requirements of understnding how precisely first-order logic cn discriminte etween two regulr lnguges. Indeed, the motivtions nd the proofs of [6, 7] re purely lgeric nd provide no intuition on the underlying logic. In prticulr, the techniques only give yes/no nswer to the seprtion prolem, without ny insight on possile seprtor. Our contriutions differ from those of [6, 7] in severl wys. First, we give new nd self-contined proof tht the seprtion prolem y first-order lnguges is decidle. It is independent from those of [6, 7], nd relies on elementry ides nd notions from lnguge theory only, mking it ccessile to computer scientists. We do not use ny involved construction from semigroup theory: we work directly with the logic itself. As mentioned ove, the proof refines the lgorithm for memership of Wilke [23]. Second, not only we otin yes/no nswer, ut lso n insight of potentil seprtor, y ounding its expected quntifier rnk. Third, s consequence of our lgorithm, we otin n EXPTIME upper ound (while complexity is not investigted in [6], rough nlysis yields n EXPSPACE upper ound). Fourth, when the input lnguges re seprle, our pproch mkes it possile to compute first-order formul tht defines seprtor, y cktrcking the proof of our lgorithm. Finlly, the techniques of [6, 7] re tilored to work with finite words only. We lso solve the seprtion prolem for lnguges of infinite words y first-order definle lnguges, y smooth extension of our techniques. Since we do not follow the proofs of [6, 7], it is not surprising tht we otin different lgorithm. However, we re le to derive two vritions of it, which llows us to give n lternte nd elementry correctness proof of Henckell s originl lgorithm. Relted work. First-order logic hs numer of importnt frgments. The seprtion question mkes sense when choosing such nturl suclsses s clsses of seprtors. It hs lredy een solved for the cse of locl frgments [17], such s loclly testle (LT) nd loclly threshold testle lnguges (LTT), lthough the prolem is lredy NP-hrd strting from 2 DFAs s input, while memership is known to e polynomil [2]. It is lso decidle for the frgment of first-order logic mde of oolen comintions of Σ 1(<) sentences, s otined independently in [4, 16]. Finlly, the prolem hs lso een investigted for the frgment FO 2 (<) of first-order logic using 2 vriles only, nd gin hs een proven to e decidle [16]. Pper outline. We first give the necessry definitions nd terminology: lnguges nd semigroups for finite words re defined in Section 2 nd first-order logic is defined in Section 3. Section 4 is devoted to the presenttion of our lgorithm solving first-order seprtion through the computtion of sets tht cnnot e distinguished y first-order logic. Sections 5 nd 6 re then devoted to proving the correctness nd completeness of this lgorithm, respectively. In Section 7, we present lternte versions of our lgorithm. Finlly, in Section 8, we generlize the results to infinite words. Due to spce limittions, the proofs of Sections 7 nd 8 re omitted, nd will e mde ville in the journl version of the pper. 2. Preliminries In this section, we provide terminology for words, semigroups nd lnguges. All the definitions re for finite words. We dely the definitions for infinite words to Section 8. Semigroups. A semigroup is set S equipped with n ssocitive opertion s t (often written st). A monoid is semigroup S hving n identity element 1 S, i.e., such tht s 1 S = 1 S s = s for ll s S. Finlly, group is monoid such tht every element s hs n inverse s 1, i.e., such tht s s 1 = s 1 s = 1 S. Given finite semigroup S, it is folklore nd esy to see tht there is n integer ω(s) (denoted y ω when S is understood) such tht for ll s of S, s ω is idempotent: s ω = s ω s ω. Words, Lnguges, Morphisms. We fix finite lphet A. We denote y A + the set of ll nonempty finite words nd y A the set of ll finite words over A. If u, v re words, we denote y u v or y uv the word otined y the conctention of u nd v. Oserve tht A + (resp. A ) equipped with the conctention opertion is semigroup (resp. monoid). For convenience, we only consider lnguges tht do not contin the empty word. Tht is, lnguge is suset of A + (this does not ffect the generlity of the rgument). We work with regulr lnguges, i.e., lnguges definle y nondeterministic finite utomt (NFA). We shll exclusively work with the lgeric representtion of regulr lnguges in terms of semigroups. We sy tht lnguge L is recognized y semigroup S if there exists semigroup morphism α : A + S nd suset F S such tht L = α 1 (F ). It is well known tht lnguge is regulr if nd only if it cn e recognized y finite semigroup. When working on seprtion, we consider s input two regulr lnguges L 0, L 1. It will e convenient to hve single semigroup recognizing oth of them, rther thn hving to del with two ojects. Let S 0, S 1 e semigroups recognizing L 0, L 1 together with the ssocited morphisms α 0, α 1, respectively. Then, S 0 S 1 equipped with the componentwise multipliction (s 0, s 1) (t 0, t 1) =

3 (s 0t 0, s 1t 1) is semigroup tht recognizes oth L 0 nd L 1 with the morphism α : w (α 0(w), α 1(w)). From now on, we work with such single semigroup recognizing oth lnguges, nd we cll α the ssocited morphism. Semigroup of Susets. As explined in the introduction, our seprtion lgorithm works y computing specil susets of semigroup recognizing oth input lnguges. Intuitively, these susets re those tht cnnot e distinguished y first-order logic. More precisely, y specil suset, we men tht ny first-order definle lnguge hs n imge under α tht either contins ll elements of the suset, or none of them. For this reson, we work with the semigroup of susets. Let S e semigroup. Oserve tht the set 2 S of susets of S equipped with the opertion T T = {s s s T, s T } is semigroup, tht we cll the semigroup of susets of S. Note tht S cn e viewed s susemigroup of 2 S, since S is isomorphic to the semigroup { {s} s S } 2 S. We denote y S, T, R,... susemigroups of semigroup of susets. Downset S, nd Expnsion S. For S 2 S susemigroup of 2 S, let us define two sets contining S: The downset of S consists of ll susets of sets in S: S = {T 2 S T S, T T }. The expnsion of S consists of ll unions of sets in S: { } S = T T S. T T Clerly, we hve S S nd S S. It is lso esy to check tht since S is semigroup, so re S nd S. Union S. For S 2 S susemigroup of 2 S, we define S S, the union of S, s the set S = T S T S We cll index of S the size of its union, i.e., S. 3. First-Order Logic nd Seprtion This section is devoted to the definition of first-order logic on words. See [5, 21] for detils on these clssicl notions. First-Order Logic. We view words s logicl structures composed of sequence of positions leled over A. We denote y < the liner order over the positions. We work with first-order logic FO(<) using unry predictes P for ll A tht select positions leled with n, s well s inry predicte for the liner order <. A lnguge L is sid to e first-order definle if there exists n FO(<) formul ϕ such tht L = {w A + w = ϕ}. We write FO the clss of first-order definle lnguges. There re mny known chrcteriztions of the clss of firstorder definle lnguges. Kmp s Theorem [9] sttes tht it is exctly the clss of lnguges definle in liner temporl logic LTL. It ws then lso proved tht this is lso the clss of str-free lnguges [12] (i.e., lnguges definle y regulr expression tht my use complement, ut does not use the Kleene str). This result ridged the gp with Schützenerger s Theorem [18], which chrcterizes str-free lnguges s those tht re recognized y n periodic semigroup. These results were lter generlized to infinite words [10, 13, 20]. Let ϕ e n FO(<) formul. The quntifier rnk of ϕ is the length of the lrgest sequence of nested quntifiers in ϕ. We denote y FO[k] the clss of lnguges tht re definle y FO(<) formuls of quntifier rnk t most k. By definition, we hve FO = k N FO[k]. For w, w A + nd k N, write w k w if w, w stisfy the sme FO(<) formuls of quntifier rnk t most k. One cn verify tht k is n equivlence reltion of finite index. Therefore, there re finitely mny FO[k] lnguges. Ehrenfeucht-Frïssé gmes. It is well known tht the expressive power of logics cn e expressed in terms of gmes. These gmes re clled Ehrenfeucht-Frïssé gmes. We define elow the specific Ehrenfeucht-Frïssé gme for FO(<). The ord of the gme consists of two words w, w A + nd there re two plyers clled Spoiler nd Duplictor. The gme is set to lst predefined numer k of rounds. When the gme strts, oth plyers hve k peles. At the strt of ech round l, Spoiler chooses either w or w. If he chose w (resp. w ) he drops pele on some position x l in w (resp. x l in w ). Duplictor must nswer y dropping pele on some position x l in w (resp. x l in w). Moreover, Duplictor must ensure tht ll peles tht hve een plced up to this point verify the following condition: for ll i, j l, x i, x i hve the sme lel, nd x i < x j if nd only if x i < x j. Duplictor wins if she mnges to ply for ll k rounds, while Spoiler wins s soon s Duplictor is unle to ply. It is clssicl tht the equivlence k cn e redefined in terms of Ehrenfeucht- Frïssé gmes (see [8, 11, 19] for exmple). Lemm 1. For ll k N nd w, w A +, we hve w k w if nd only if Duplictor hs winning strtegy for plying k rounds in the Ehrenfeucht-Frïssé gme plyed on w, w. Lemm 1 hs two simple nd well-known consequences tht will e used to prove our lgorithm. First, using Ehrenfeucht-Frïssé gmes, it is esy to show tht k is congruence for ll k. Lemm 2. (1) If u 1 k v 1 nd u 2 k v 2, then u 1 u 2 k v 1 v 2. (2) For ll u A + nd ll k > 0, we hve u 2k k u 2k 1. Proof. For item 1, y Lemm 1, Duplictor hs winning strtegy in the k-round gme plyed on u i nd v i for i = 1, 2. These strtegies cn e esily comined into winning strtegy in the k-round gme plyed on u 1 u 2 nd v 1 v 2. By Lemm 1, it follows tht u 1 u 2 k v 1 v 2. Property 2 is shown similrly y induction on k, gin using Lemm 1. See [19] for detils. Seprtion. Given lnguges L, L 0, L 1, we sy tht L seprtes L 0 from L 1 if L 0 L nd L 1 L =. The pir (L 0, L 1) is sid to e FO-seprle if some lnguge L FO seprtes L 0 from L 1. Since FO is closed under complement, (L 0, L 1) is FO-seprle if nd only if (L 1, L 0) is. Therefore, we simply sy tht L 0 nd L 1 re FO-seprle in this cse. We use the sme terminology for the clss FO[k]. Note tht since there re finitely mny FO[k] lnguges for ny fixed k, FO[k]-seprility is esy: it suffices to test ll of these potentil seprtors. In prticulr, if L 0, L 1 re FO[k]-seprle, then there exists smllest seprtor: the sturtion of L 0 y k. Note tht this is not true for full first-order logic, since removing single word from n FO lnguge yields gin n FO lnguge (however, the formul defining this new lnguge might hve lrger quntifier rnk). Since lnguges in FO[k] re unions of k -clsses, we otin the following useful fct. Fct 3. Two lnguges L 0 nd L 1 re FO[k]-seprle if nd only if for ll w 0 L 0 nd w 1 L 1, we hve w 0 k w 1.

4 Exmple 1. Let K 0 = (), K 1 = () nd L 0 = (K 0K 1) +, L 1 = (K 0K 1) K 0. It is well known tht 2k nd 2k 1 cnnot e distinguished y ny FO-sentence of quntifier rnk k, see e.g. [19]. Therefore, K 0 nd K 1 re not FO-seprle. Reusing this rgument then shows tht L 0 nd L 1 re not FO-seprle either. We shll explin elow how this is detected y our lgorithm. 4. FO-indistinguishle Sets for Morphism In this section, we define our min tool for solving the seprtion prolem for first-order logic: FO-indistinguishle sets. The ide ehind this notion is the following. Let α : A + S e morphism into finite semigroup. Given nturl k, one ssocites to ech k - clss τ in A + the suset α(τ) of S, which consists of the imges under α of ll words in τ. This informtion is exctly wht we need to nswer the seprtion question y FO[k]-definle lnguges for ny pir of lnguges tht re oth recognized y α. Indeed, two lnguges L 0, L 1 recognized y α re not FO[k]-seprle if nd only if there exists such suset intersecting oth α(l 0) nd α(l 1). Oserve tht when k gets lrger, these susets cn only get smller, ecuse k -clsses re unions of k+1 -clsses. Since S is finite, the refinement stilizes t some index l: the susets generted s imges of l -clsses re the sme s those generted s imges of k -clsses, for ll k l. These stilized susets re wht we cll FO-indistinguishle sets. The ppliction of the notion of FO-indistinguishle sets to the seprtion prolem is twofold. First, eing le to compute ll FO-indistinguishle sets for α provides yes-no nswer to the seprtion question for ny pir of lnguges recognized y α. Moreover, the stiliztion index l is lso of prticulr interest: it is ound such tht if there exists seprtor, then it cn e chosen with quntifier rnk l. The section is orgnized s follows. First we give forml definition of FO-indistinguishle sets nd we stte reduction from the seprtion prolem to the computtion of these sets. In the second susection, we give fixpoint lgorithm for computing ll FO-indistinguishle sets ssocited to given morphism α. Finlly, in the lst susection, we run this fixpoint lgorithm on the lnguges of Exmple Definition nd reduction from the seprtion prolem FO-indistinguishle sets. Let α : A + S e semigroup morphism. We define the following susets of 2 S : I k [α], the set of FO[k]-indistinguishle sets for α. I[α], the set of FO-indistinguishle sets for α. Let T = {s 1,..., s n} S. We hve T I k [α] if there exist w 1,..., w n A + with w 1 k w 2 k k w n, nd α(w 1) = s 1,..., α(w n) = s n. T I[α] if for ll k N, we hve T I k [α]. From the definitions nd from the inclusion k+1 k, we otin the following fcts. Fct 4. () I k [α] I k+1 [α] I[α] for ll k 0. () I[α] = k I k[α]. Fct 5. Both I k [α] nd I[α] re closed under tking susets: I k [α] = I k [α] nd I[α] = I[α]. Conversely however, it my e the cse tht {r, s}, {s, t} nd {t, r} re ll FO-indistinguishle, while {r, s, t} is not. Lemm 2 entils the following fct. Fct 6. All I k [α] nd I[α] re susemigroups of 2 S. As stted in Fct 4 (), the sets in I k [α] cn only get refined s k gets lrger. Therefore, they stilize t some index l. However, it my e the cse tht I k [α] = I k+1 [α] even if stiliztion is not reched yet. This rules out the nive serch for this index. In the following proposition, we give ound on this stiliztion index depending on the size of A nd S. Proposition 7. For ll k A 2 S 2, we hve I k [α] = I[α]. Proposition 7 yields first lgorithm for computing I[α]. Indeed, when k is fixed, one cn esily compute I k [α] using rute-force lgorithm tht enumertes ll equivlence clsses of k. However, since the numer of such clsses is non-elementry in k, this lgorithm is very slow. We will present more efficient fixpoint lgorithm t the end of the section. In Section 6, we will otin the ound A 2 S 2 s corollry of the completeness proof of this more efficient lgorithm. From FO-seprtion to FO-indistinguishle sets. We now mke the link with the seprtion prolem. The following theorem shows tht computing I[α] nswers the FO-seprtion prolem for input lnguges recognized y α. Moreover, the second prt of the theorem yields ound on the expected quntifier rnk of seprtor. Theorem 8. Let L 0, L 1 e two regulr lnguges recognized y morphism α : A + S into finite semigroup. Then, L 0 nd L 1 re FO-seprle if nd only if for ll T I[α], α(l 0) T = or α(l 1) T =. Moreover, if L 0, L 1 re FO-seprle, then the ctul seprtor cn e chosen with quntifier rnk A 2 S 2. Proof. Suppose first tht L 0 nd L 1 re FO-seprle, tht is, FO[k]- seprle for some k. Let T I[α]. By contrdiction, ssume tht there exist s 0 α(l 0) T nd s 1 α(l 1) T. Then s 0, s 1 T I[α] I k [α]. By definition of I k [α], there exist w 0 α 1 (s 0) L 0 nd w 1 α 1 (s 1) L 1 such tht w 0 k w 1, which y Fct 3 contrdicts FO[k]-seprility. Conversely, ssume tht for ll T I[α], either α(l 0) T or α(l 1) T is empty. Then y Proposition 7, the sme property holds for ll T I l [α], for l = A 2 S 2. Hence y definition of I l [α], for ll w 0 L 0 nd w 1 L 1, we hve w 0 l w 1. So, gin y Fct 3, L 0 nd L 1 re FO[l]-seprle. This proves the equivlence nd the lst ssertion of the sttement. 4.2 An lgorithm to compute FO-indistinguishle sets Let α : A + S e morphism into finite semigroup. We descrie fixpoint lgorithm for computing I[α]. We strt from sets tht re trivilly in I[α] (i.e., singletons {α(w)}) nd then use sturtion procedure to generte more sets, until we rech fixpoint. Let us first descrie this sturtion procedure. Sturtion. Let S e susemigroup of 2 S. We define St(S), the sturtion of S, s the susemigroup of 2 S generted y S { T ω T ω+1 T S }. (1) The fixpoint lgorithm consists in itertively pplying sturtion until stiliztion, strting from S = α(a + ), viewed s susemigroup of 2 S consisting of singletons. We set St 0 (S) = S, nd St i+1 (S) = St(St i (S)) for ll i N. By definition, for ll i N, St i (S) St i+1 (S) 2 S. Therefore, there exists i

5 such tht St i (S) = St i+1 (S). We denote this susemigroup y St (S). Note tht computing St (S) from S is strightforwrd, y repetedly pplying sturtion. In the following proposition, we stte correctness nd completeness of our lgorithm: sets in I[α] re exctly the susets of elements of St (α(a + )). Proposition 9. Let l = A 2 S 2. Then we hve I[α] = I l [α] = St (α(a + )). Since St (S) is computle, Proposition 9 immeditely implies tht so is I[α]. Using Theorem 8, this yields the decidility of the seprtion prolem for first-order logic. Moreover, simple nlysis of the sturtion procedure shows n EXPTIME upper ound on the complexity of the prolem. Corollry 10. Let L 0, L 1 e two regulr lnguges recognized y morphism α : A + S into finite semigroup. Then one cn decide in EXPTIME with respect to S whether L 0, L 1 re FO-seprle. Proof. By Theorem 8, it suffices to prove tht one cn compute I[α] in EXPTIME in the size of S. Indeed, it then suffices to test whether there exists T I[α] such tht α(l 1) T nd α(l 2) T. This cn lso e chieved in EXPTIME y testing ll possile cndidtes T. By Proposition 9, we know tht computing I[α] cn e done y computing St (α(a + )). By definition, St (α(a + )) 2 S, therefore St (α(a + )) = St 2S (α(a + )). This mens tht the numer of steps the lgorithm needs to rech the fixpoint is t most exponentil in S. Therefore, it suffices to prove tht ech step cn e done in EXPTIME to conclude tht the whole computtion cn lso e done in EXPTIME. Ech step requires computing T ω T ω+1 for t most 2 S susets T. Ech computtion cn e done in EXPTIME, since T ω is equl to some T m for m 2 S such tht T m = T 2m. Finlly, computing the susemigroup of 2 S generted y suset of 2 S cn lso e done in EXPTIME. Proposition 7 is simple consequence of Proposition 9. Indeed, for k l, we hve I[α] I k [α] I l [α] y Fct 4 (). Since for l = A 2 S 2, Proposition 9 yields I l [α] = I[α], we otin I[α] = I k [α], which is exctly Proposition 7. An interesting oservtion out our sturtion lgorithm is tht it cn e viewed s generliztion of Schützenerger s Theorem [12, 18]. Indeed, lnguge is first-order definle if nd only if it cn e recognized y n periodic semigroup. One definition of periodicity is tht semigroup is periodic if nd only if it stisfies the identity s ω = s ω+1. The counterprt to this definition cn e found in the min opertion of our sturtion procedure, Opertion (1). This rises nother question: could Opertion (1) e replced to reflect lternte definitions of periodicity while retining Proposition 9? We shll see in Section 7 tht this is indeed possile. It now remins to prove Proposition 9. We show tht I[α] I l [α] St (α(a + )) I[α]. The first inclusion is ovious y Fct 4. In Section 5, we prove tht St (α(a + )) I[α]. This corresponds to correctness of the lgorithm: ll computed sets indeed elong to I[α]. Finlly, in Section 6, we focus on the proof of the most difficult direction, which is the second one: I l [α] St (α(a + )). It implies completeness of the lgorithm, tht is, tht ny FO-indistinguishle set for α i.e., elonging to I[α] is ctully contined in some element of the set St (α(a + )) computed y the lgorithm. We finish this section y running the lgorithm, to show tht it detects tht the lnguges of Exmple 1 re not FO-seprle. 4.3 Exmple 1, contd. To strt our lgorithm, we first need semigroup morphism recognizing oth L 0 nd L 1. Oserve tht oth lnguges re recognized y the utomton elow, with 4 s finl stte for L 0, nd 2 s finl stte for L 1. Therefore, its trnsition semigroup S recognizes oth lnguges 1. The recognizing morphism α : A + S thus mps Figure 1. Automton recognizing oth L 0 nd L 1 word to the prtil function from sttes to sttes tht it defines. We still denote the imges of letters, y, S, respectively. It is then esy to see tht L 0 = α 1 ( 2 ) nd L 1 = α 1 ({, 2 }). We use Theorem 8 to show tht L 0 nd L 1 re not FO-seprle: we hve to find n FO-indistinguishle set T I[α] intersecting oth α(l 0) nd α(l 1). We clim tht { 2, 2 } α(l 0) α(l 1) is indeed detected s FO-indistinguishle. We ctully show tht it is computed s n element of St (α(a + )), which y Proposition 9 implies tht it is FO-indistinguishle. The lgorithm strts with St 0 (S) consisting of singletons. Then, note tht {} ω = { 2 } nd {} ω+1 = {}. Therefore, y definition of Opertion (1), we hve {, 2 } St(S). Since St(S) is susemigroup, the lgorithm lso computes X = {, } {} = {, } s n element of St(S). Now y (1), Y = X ω X ω+1 St 2 (S). Computing Y shows tht {, 2 } Y. Finlly, since St 2 (S) is semigroup, it contins T = {} Y {, 2 }, which itself contins { 2, 2 }, s climed. 5. Correctness of the Algorithm In this section we prove correctness of our lgorithm computing FO-indistinguishle sets, tht is the inclusion St (α(a + )) I[α] in Proposition 9. Recll tht we work with morphism α : A + S into finite semigroup S. We prove the following proposition. Proposition 11. For every k N, St (α(a + )) I k [α]. By Fct 4, we hve I[α] = k I k[α]. Therefore, it is immedite from Proposition 11 tht St (α(a + )) I[α]. Since I[α] = I[α] y Fct 5, it follows tht St (α(a + )) I[α]. It remins to prove Proposition 11, which we do in the rest of the section. We show y structurl induction tht St (α(a + )) consists of FO-indistinguishle sets only. We strt from singletons, which re oviously FO-indistinguishle. Then, we pply: Opertion (1), which cn e seen, using Ehrenfeucht-Frïssé gmes, to preserve FO-indistinguishility. Closure under susemigroup, which preserves it y Fct 6. Finlly, closure under, which lso preserves it y Fct 5. Formlly, let k N nd T St (α(a + )), nd let us prove tht T I k [α]. By definition T St i (α(a + )) for some i N. We proceed y induction on i. For i = 0, this is ovious since 1 Recll tht the trnsition semigroup consists of prtil mppings induced y words from the stte set to itself. It is esy to see tht it recognizes the lnguge ccepted y the utomton, see [15, Sec. 3.1].

6 St 0 (α(a + )) = { {α(w)} w A +}, nd y definition, ny singleton {α(w)} is in I k [α]. Assume now tht i 1. Recll tht St i (α(a + )) is the semigroup generted y R = St i 1 (α(a + )) {T ω T ω+1 T St i 1 (α)}. Assume first tht the result is proved for every set in R nd set T St i (α(a + )). Then T = T 1 T n with T 1,..., T n R. By ssumption T 1,..., T n I k [α]. By Fct 6, I k [α] is semigroup. Therefore, T = T 1 T n I k [α]. It remins to prove tht ll sets in R elong to I k [α]. Let R R. If R St i 1 (α(a + )), this is y induction hypothesis. Therefore, ssume tht R = T ω T ω+1 for set T St i 1 (α(a + )). By induction hypothesis, T I k [α]. By definition, this mens tht there exists set of words W A + such tht α(w ) = T nd for ll w, w W, we hve w k w. Consider the set of words W = W 2kω W 2k ω+1. By definition, α(w ) = R. Therefore, it suffices to prove tht for ny two words w, w W, we hve w k w to conclude tht R I k [α]. Let w W e some ritrry chosen word. By Lemm 2 (1), it is immedite tht ny word of W is k -equivlent to either u 0 = w 2kω W 2kω or to u 1 = w 2k ω+1 W 2k ω+1. To conclude tht ll words of W re k -equivlent, it remins to prove tht u 0 k u 1, which follows directly from Lemm 2 (2). 6. Completeness of the Algorithm In this section, we prove the most interesting inclusion from Proposition 9: I l [α] St (α(a + )) for l = A 2 S 2. For the rest of the section, we fix morphism α : A + S into finite semigroup. Recll tht we identify α(a + ) with the susemigroup { {α(w)} w A +}, so we view α s morphism into this susemigroup of 2 S. We prove our result in proposition tht is itself proved y induction. In order to stte this proposition, we need dditionl terminology. Set generted y n k -clss. Let B e n lphet, S e susemigroup of 2 S, nd β : B + S e morphism. For k N nd τ n k -clss of words in B +, the β-generted set y τ is β(τ) = w τ β(w). The min ide ehind the proof is tht for k lrge enough, the α-generted sets y k -clsses re ll computed y St. Let us formlize this result s n inductive property. Proposition 12. Let S e susemigroup of 2 S nd β : B + S e surjective morphism. Set k B 2 S 2. Then for every k -clss τ, we hve β(τ) St (S). Before proving Proposition 12, we explin how to use it to prove the inclusion I l [α] St (α(a + )) of Proposition 9. Proof of Completeness in Proposition 9. Put S = α(a + ), viewed s susemigroup of 2 S. We define surjective morphism β : A + S y β(w) = {α(w)}. Recll tht l = A 2 S 2 nd let T I l [α]. By definition of I l [α], there exists n l -clss τ such tht T β(τ). By definition, S S, hence S S. Therefore, l A 2 S 2 nd we cn pply Proposition 12, so tht β(τ) St (S). Since T β(τ) nd St (S) is closed under tking susets, we get T St (S). We conclude tht I l [α] St (S). It remins to prove Proposition 12. We set β, k B 2 S 2 nd τ k -clss s in the sttement of the proposition. We need to prove tht β(τ) St (S). The proof is generliztion of Wilke s rgument [23] for deciding first-order definility. We proceed y induction on the following prmeters listed y order of importnce: 1. the index S of S, 2. the size of B. The proof is divided in three min prts: first, we consider the cse when B = 1. otherwise, we distinguish two sucses, depending on property of β clled tmeness. 6.1 Specil Cse: B = 1. In tht cse, B is singleton {}. With this hypothesis, we ctully prove slightly stronger result thn Proposition 12, which will e useful lter in the induction. Recll tht τ is k -clss over B. Lemm 13. β(τ) St (S). Note tht y definition, St (S) St (S). Therefore, Proposition 12 is indeed consequence of Lemm 13 when B = 1. Proof of Lemm 13. Using Lemm 2, it is esy to see tht ny k - clss over the singleton lphet {} is either singleton { n }, or of the form { k k K} for some K N. Let w τ e word of miniml length. By hypothesis, w = n for some n 1. A stndrd semigroup theory rgument shows tht there exists m S 2 S such tht β( m ) = β( ω ). If n m, it is simple to see tht k > n, whence we deduce tht τ = {w}. Hence β(τ) = β(w) St (S) nd we re done. Otherwise, n > m. If β(τ) β(w), then y choice of k nd y the preliminry remrk, we hve β(τ) = i 0 β(ω+i ). To conclude, we prove tht i 0 β(ω+i ) St (S). Note tht β( ω+i ) = (β() ω β() ω+1 ) (β() ω β() 2ω 1 ). i 0 Therefore, it suffices to prove tht for ll i, we hve β() ω β() ω+i St (S). By definition, for ny i 0, β() ω+i = β( ω+i ) S St (S). Moreover, oserve tht β() ω β() ω+i = (β() ω+i ) ω (β() ω+i ) ω+1. Therefore the result is immedite y Opertion (1). This termintes the cse B = 1. For the reminder of the proof, we now ssume tht B 2. As explined ove, we distinguish two cses depending on property of β. Tmeness. We sy tht β is tme if for ll B, ll t S, there exist R l, R r S such tht t β() R r nd t R l β(). 6.2 Cse 1: β is tme This is the se cse: we don t use induction. We use tmeness to prove tht S St (S) nd hence tht ll susets of S re computed s elements of St (S). Since y definition, β(τ) S for ny FO-clss τ, this termintes the proof of this cse. The fct tht S St (S) is consequence of the following lemm: Lemm 14. There exists group G S such tht G = S. We first use Lemm 14 to finish the proof of this cse. Let G = {T 1,..., T n} e group s given y the lemm. To otin S St (S), it suffices to prove tht G St (S). Since G is group, we get Ti ω = 1 G, so T i = T1 ω Ti 1T ω ω+1 i Ti+1 ω Tn ω for ll i. Comining these equlities gives us the inclusion G (T ω 1 T ω+1 1 ) (T ω n T ω+1 n ).

7 By definition (1) of St, it follows tht G St(S) St (S), nd we re done with the proof in Cse 1. It remins to prove Lemm 14. We first prove tht while S might not e group itself, it is wht we cll pseudo-group. Pseudo-groups. Let T e susemigroup of 2 S. We sy tht T is pseudo-group if for ll T T nd t T, there exist R l, R r T such tht T R r t nd R l T t. Lemm 15. S is pseudo-group. Proof. We only do the existence proof for R l. The proof for R r is symmetricl. Since β is surjective, there exists w B + such tht T = β(w). We proceed y induction on the length of w. If w is of length 1, it is immedite y tmeness tht there exists R l S such tht R l T t nd we re finished. Assume now tht the result holds for words of length m nd tht w is of length m + 1. This mens tht w = u with u word of length m. By induction hypothesis, there exists R l S such tht such tht R l β(u) t. This mens tht there exists t lest one r R l such tht {r } β(u) t. Using tmeness gin, we get R l S such tht R l β() r. It follows tht R l β(w) t, which concludes the proof. We now finish the proof of Lemm 14. We prove tht ny pseudo-group T S tht is not lredy group contins strict susemigroup R tht remins pseudo-group, nd such tht R = T. Applying this result itertively to S yields the desired group G. Let T S e pseudo-group tht is not lredy group. An esy nd stndrd rgument implies tht there must exist R T such tht R T T or T R T. By symmetry ssume tht it is the former nd set R = R T. By definition, R is closed under product nd is therefore semigroup. It remins to prove tht R is pseudo-group nd tht R = T. R is pseudo-group. Set RT R nd r R. We wnt to construct R r, R l R such tht r RT R r nd r R l RT. We egin with R r. Since T is pseudo-group, there exists T r T such tht r RT R T r, therefore it suffices to set R r = RT r R. It remins to construct R l. Using gin the fct tht T is pseudogroup, we get T l T such tht r T l RT. In prticulr, this mens tht there exists t l T l such tht r {t l } RT. Using our pseudo-group hypothesis once gin, we otin T T such tht t l R T. It follows tht r RT RT, nd it suffices to set R l = RT R. R = T. By definition, we hve R T. We prove the reverse inclusion. Set t T. Since T is pseudo-group, there exists T T such tht t RT. By definition, RT R, hence t R, which ends the proof. 6.3 Cse 2: β is not tme. This is the cse where we use induction. By hypothesis on β, there exist B nd t S such tht there exists no R r S verifying t β() R r or no R l S verifying t R l β(). By symmetry, we ssume the former, i.e., there exists no R r S verifying t β() R r. We set t nd s these ojects for the rest of this proof. Recll tht we hve k B 2 S 2 s in the sttement of Proposition 12. Set τ k -clss. Our gol is to construct R τ St (S) such tht β(τ) R τ. To use induction, we set B = B \ {}, k = B 2 S 2, B = {} k = B 2 S 2 = 2 S 2 We define s the set of k -clsses of words over the lphet B nd Λ s the set of k -clsses of words over the lphet {}. The morphism β cn e restricted to the lphet B. It follows y choice of k tht we cn pply the induction hypothesis on the second prmeter (the size of the lphet). This yields the following result. Fct 16. For ll δ, there exists R δ St (S) such tht β(δ) R δ. Similrly, β cn e restricted to the lphet {}. Moreover, since {} is of size one, y choice of k we cn pply Lemm 13 to every λ Λ nd get the following stronger result. Fct 17. For ll λ Λ, we hve β(λ) St (S). We now give n overview of the proof. Set C = {λ δ λ Λ nd δ } s new lphet. Modulo some prefix in B nd suffix in (oth possily empty), ny word w in τ cn e viewed s sequence of fctors in + B +. Therefore, y looking t ll pirs of clsses in Λ, induced y these fctors, w cn e seen s word w C +. For this sketch, ssume tht the prefix nd suffix re oth empty. Moreover, β cn e dpted over C s new morphism γ y setting γ : λ δ β(λ) R δ nd we get β(w) γ(w). We then prove three results. 1. y choice of k, one cn construct k -clss τ over C for well-chosen k such tht β(τ) γ(τ). 2. y choice of nd t, the index of T = γ(c + ) is strictly smller thn the index of S. Therefore, we cn pply induction to γ nd get R St (T) such tht γ(τ) R. 3. y definition of γ, we get St (T) St (S) nd therefore R St (S). By comining the three items, it suffices to tke R τ = R γ( τ) β(τ) to end the proof. Intuitively, this is wht we do. However, there is slight difference: oserve tht with the definitions of this sketch, C is set of pirs of k nd k -clsses, nd is non-elementry lrge. Therefore, this definition would yield much lrger ound on k thn wht climed. To overcome this prolem, we shll use γ(c + ) 2 S s lphet insted of C. We now turn to the ctul proof. Set R s the semigroup β() S. Oserve tht y definition, for ll λ Λ, ll words in λ hve lphet {}. Therefore, β(λ) β() R. It follows tht for ll λ Λ nd δ, β(λ) R δ R. We set T s the susemigroup of R generted y { β(λ) R δ λ Λ nd δ } Note tht y definition T St (S) nd T S. We set C = T nd γ : C + T s the semigroup morphism defined y simply evluting in T the product of the letters of word in C. Finlly, set k = T 2 T 2. Lemm 18. The index of T is strictly smller thn the index of S. Proof. This is where we use our hypothesis on nd t. We prove tht R hs strictly smller index thn S. Since T is susemigroup of R, the desired result will follow. By definition of R, we hve R S. Therefore, it suffices to prove tht this inclusion is strict. We prove tht t R, which concludes the proof. We proceed y contrdiction: ssume tht t R. This mens tht there exists T R such t T. By definition of R, we otin sets S 1,..., S n S such tht T = β()s 1 β()s n. Since t T, t lest one of these sets, sy β()s j, contins t. Since S j S, we get R 1,..., R m S such tht t β()r 1 β()r m. In prticulr, t β()r i for some i, which contrdicts the choice of t nd. Lemm 18 mens tht we cn pply induction on k -clsses for the morphism γ. This ws exctly point 2 in our sketch. Moreover, since T St (S) we get point 3.

8 Lemm 19. St (T) St (S). It remins to define the k -clss τ over C. Let w B + e n ritrry word in τ. There exist n 0 nd m 1,..., m n 1 such tht w cn e uniquely decomposed s: w = w m1 w 1 m2 w 2 mn w n w where w 1,..., w n re non-empty words contining no, i.e., words of B +, w is possily empty prefix contining no, i.e., word of B nd w possile empty suffix in. This divides w in three prts: the prefix w, the infix m1 w 1 m2 w 2 mn w n nd the suffix w. We ssume in this proof tht we re in the most complicted cse, i.e., none of these prts re empty (the other cses re hndled similrly). We set w s the word c 1 c n C + defined s follows. For ll i 1, set λ i s the k -clss of m i nd δ i s the k -clss of w i. For ll i, let us set c i = β(λ i) R δi C. By construction, nd definition of the sets β(λ), R δ, we hve the following result: Fct 20. β( m1 w 1 m2 w 2 mn w n) γ(w). Finlly, let τ e the k -clss of w. In the sketch, we ssumed tht the prefix w nd the suffix w were empty. Here, we hve to tke them into ccount. Therefore, we lso set δ s the k -clss of w nd λ Λ s the k -clss of w. Using Ehrenfeucht-Frïssé gmes, we prove tht τ, λ nd δ re well-defined, i.e., tht the definition depends only on the k -clss τ nd not on the choice of w. This is where the choices for the vlues of k, k nd k mtter. Lemm 21. Let u, v e words in τ, nd define u, u, ũ, v, v, ṽ s ove. Then u k v, u k v nd ũ k ṽ. Proof. This is n Ehrenfeucht-Frïssé rgument. By Lemm 18, T < S. Using twice this inequlity, we oserve tht k + k = ( B 1) 2 S 2 + T 2 T 2 ( B 1) 2 S S 1 2 ( S 1)2 < B 2 S 2, whence k + k + 1 k. Moreover, y hypothesis u k v. Hence, y Lemm 1, Duplictor hs winning strtegy in the k-round gme plyed on u nd v. It is strightforwrd to see tht if Spoiler plces his first pele on the first of u, Duplictor hs to nswer y plcing her pele on the first of v. Then, every move of Spoiler tht is mde to the left of these peles (i.e., in u, v ) must e nswered y Duplictor to the left of these peles (i.e., in u, v ). It follows tht u k 1 v nd hence tht u k v. Similrly, we get tht ũ k 1 ṽ nd hence tht ũ k ṽ For u, v, this is slightly more complicted. We descrie winning strtegy for Duplictor in the k-round gme plyed on u nd v. To otin this strtegy, Duplictor plys t the sme time shdow gme on u nd v. In this gme ll peles re plced on positions leled with nd such tht the next position is leled y letter tht is not. We explin how to ply one round. Assume tht Spoiler puts his pele in u (the dul cse is nswered in the sme wy) on some position leled with c C. By definition, this position corresponds to n infix i u in u with u B +, nd such tht β(λ i) R δu = c (with λ i, δ u the k nd k -clsses of i, u, respectively). Duplictor simultes move of Spoiler in her shdow gme, putting pele in u on the lst of this infix i u. One cn verify tht this gives her n nswer in v on the lst of n infix j v with v B +. Moreover, recll tht k + k + 1 k. Hence, since the gme on u, v lsts only k rounds nd u k v, t lest k + 1 rounds cn still e plyed in the shdow gme. It is then strightforwrd to see tht this mens tht u k v nd i k j. In prticulr, since k k we get tht i k j. Therefore, the k -clss of v is δ u, the k -clss of j is λ i, hence the position corresponding to j v in ṽ is leled with c. This is Duplictor s nswer. It remins to prove point 1 in our sketch. In order to tke δ, λ into ccount, we prove here slightly generlized version. Lemm 22. We hve β(τ) β(δ ) γ(τ) β( λ). Proof. Let s β(τ). By definition there exists u τ such tht s β(u). Reclling the construction of u, there exists n N such tht u cn e uniquely decomposed s: u = u m1 u 1 m2 u 2 mn u n ũ. Set S = β(u ), T = β( m1 u 1 m2 u 2 mn u n) nd S = β(ũ). By definition, s S T S. We prove S β(δ ), T γ(τ) nd S β( λ), which will finish the proof. By Lemm 21, it is immedite tht u δ nd ũ λ. Therefore, S β(δ ) nd S β( λ). For T, y Fct 20, T γ(u) nd y Lemm 21, u τ. Therefore T γ(τ). We cn now finish the proof y comining the results. Oserve tht words in δ re y definition words of B + nd words in λ re in +. Therefore, y Fct 16, there exists R δ St (S) such tht β(δ ) R δ nd y Fct 17, β( λ) St (S). Moreover, y Lemm 18 the index of T is strictly smller thn the index of S. Therefore, y choice of k, we cn pply the induction hypothesis on τ. This yields set P St (T) such tht γ(τ) P. By Lemm 19, P St (S). Finlly, set R τ = R δ P β( λ). By definition, St (S) is semigroup, therefore, R τ St (S). Furthermore, β(δ ) γ(τ) β( λ) R δ P β( λ) = R τ. It then follows from Lemm 22 tht β(τ) R τ. 7. Alternte Algorithms In the well-known decidle chrcteriztion of first-order logic y Schützenerger [12, 18], it is stted tht lnguge is first-order definle if nd only if its syntctic semigroup is periodic. In the literture, there re mny equivlent definitions of periodicity. In this pper, we consider three of them: one is equtionl, the second considers sugroups nd the third considers the H -clsses. The reltion H is one of Green s reltions which re well known in semigroup theory. Two elements s, s of semigroup S re H - equivlent if s = s or there exist t l, t l, t r, t r S such tht st r = s, s t r = s, t l s = s nd t ls = s. We stte the three equivlent definitions. Lemm 23 (Folklore, see [15]). A finite semigroup S is periodic if nd only if it stisfies one of the following equivlent sttements: 1. for ll s S, s ω = s ω ll sugroups in S re trivil. 3. ll H -clsses in S re trivil. Our sturtion procedure St cn e viewed s generliztion of the first definition of periodicity. Indeed, Opertion (1) reflects the eqution s ω = s ω+1. In this section, we present two lternte nd equivlent sturtion procedures tht reflect the two other definitions. Let α : A + S e morphism into finite semigroup. Let S e susemigroup of 2 S. We set St G(S) s the susemigroup of 2 S generted y S { G G S nd G is group in S}. (2) Similrly, St H(S) is the susemigroup of 2 S generted y S { H H S nd H is n H -clss in S}. (3) The opertor St G reflects the second definition of periodicity nd St H the third. In the following proposition (whose proof is omitted), we stte tht the three sturtion procedures re equivlent nd cn therefore ll e used to compute I[α] y Proposition 9.

9 Proposition 24. Let S e susemigroup of 2 S. Then St (S) = St G(S) = St H(S). Note tht the sturtion procedure St H cn e viewed s simplifiction of Henckell s originl lgorithm [6]. 8. Seprtion for Infinite Words In this section we generlize FO-indistinguishle sets to ω-words nd explin how our fixpoint lgorithm cn e generlized in order to compute them. In this cse s well, we re le to pply the notion to seprtion nd otin oth ound on the size of potentil seprtor nd n EXPTIME upper ound on the complexity of the prolem. It turns out tht once the right tools re defined, our proof generlizes smoothly to the cse of ω-words. In prticulr severl rguments in this proof re replced y using the finite word cse s suresult. The section is orgnized s follows. We first generlize our terminology to the setting of ω-words. In the second prt, we generlize FO-indistinguishle sets, nd we stte the link with seprtion. Finlly, we explin how to generlize our fixpoint lgorithm to compute these new FO-indistinguishle sets. 8.1 Preliminry Definitions ω-words nd ω-lnguges. Recll tht A is finite lphet. We denote y A the set of ω-words over A. Note tht we still use the term word to men n element of A +. If u is word nd v n ω-word, we denote y u v the ω-word otined y conctenting u to the left of v, nd y u the ω-word otined y infinite conctention of u with itself 2. An ω-lnguge is suset of A. Regulr ω-lnguges re those tht re ccepted y nondeterministic Büchi utomt (NBA). Agin, we will only work with the lgeric representtion of ω-lnguges tht we recll elow. ω-semigroups. We riefly recll the definition of ω-semigroups, which ply the role of semigroups in the setting of ω-words. For more detils, we refer the reder to [14]. An ω-semigroup is pir S = (S +, S ) where S + is semigroup nd S is set. Moreover, S is equipped with two dditionl products: mixed product S + S S tht mps s, t S +, S to n element denoted st, nd n infinite product (S +) S tht mps n infinite sequence s 1, s 2, (S +) to n element of S denoted y s 1s 2. We require these products s well s the semigroup product of S + to stisfy ll possile forms of ssocitivity, cf. [14] for detils. Finlly, we denote y s the element sss. Oserve tht A = (A +, A ) is n ω-semigroup. The notions of susemigroups nd morphisms cn e dpted to ω-semigroups. In prticulr, if T + is susemigroup of S + nd T is the set otined y pplying the infinite product to ll sequences of T +, then T = (T +, T ) is su-ω-semigroup of S clled the su-ω-semigroup generted y T +. An ω-semigroup is sid to e finite if oth S + nd S re finite. Note tht even if n ω-semigroup is finite, it is not ovious tht finite representtion of the infinite product exists. However, it ws proven y Wilke [22] tht the infinite product is fully determined y the mpping s s, yielding finite representtion for finite ω-semigroups. An ω-lnguge L is sid to e recognized y n ω-semigroup S = (S +, S ) if there exists F S s well s morphism α : A S such tht L = α 1 (F ). It is well known tht n ω-lnguge is regulr if nd only if it is recognized y finite ω-semigroup. Moreover [22], from ny NBA recognizing L, 2 In the literture, the ω-word u is usully denoted y u ω. Here, we use this non stndrd nottion in order to void confusion with the idempotent power ω in semigroups. one cn compute cnonicl smllest ω-semigroup recognizing L, clled the syntctic ω-semigroup. As for finite words, when working on seprtion, it is convenient to consider single recognizing oject for oth input lnguges rther thn two seprte ojects. Agin, this is not restrictive, given two ω-lnguges nd two ssocited recognizing ω-semigroups, one cn define (nd compute) single ω-semigroup tht recognizes oth lnguges y tking the crtesin product of the two originl ω-semigroups. Semigroup of Susets. For n ω-semigroup S, note tht 2 S = (2 S +, 2 S ) is n ω-semigroup with the products defined in the nturl wy. Moreover, S cn e viewed s su-ω-semigroup of 2 S. Indeed, S is isomorphic to the ω-semigroup ({{s} s S +}, {{s} s S }), which is su-ω-semigroup of 2 S. First-order logic for ω-words. First-order logic is defined in the sme wy on ω-words s on words. Therefore, for the ske of simplifying the nottions, we keep the sme terminology. One remrk is of importnce, however: in the proof, we will mnipulte t the sme time k -clsses of words nd k -clsses of ω-words. To void confusion, we cll the ltter k -ω-clsses, nd devote the terminology k -clsses to words. 8.2 FO-indistinguishle sets for ω-lnguges. FO-indistinguishle sets. Let α : A S e n ω-semigroup morphism nd set (S +, S ) = S. Oserve tht α cn e restricted s clssicl semigroup morphism α + : A + S +. Therefore, FO-indistinguishle susets of S + re lredy defined, nd it suffices to generlize the notion to S. We give the full definition (reclling the definition for S +) elow. We define the two following pirs of sets: I k [α] = (I + k [α], I k [α]) with I + k [α] 2S + nd I k [α] 2 S, the pir of sets of FO[k]-indistinguishle sets for α. I[α] = (I + [α], I [α]) with I + [α] 2 S + nd I [α] 2 S, the pir of sets of FO-indistinguishle sets for α. Let T = {s 1,..., s m} S + (resp. S ). We hve T I + k [α] (resp. I k [α]) if there exist w 1,..., w n A + (resp. A ) with w 1 k w 2 k k w n, nd α(w 1) = s 1,..., α(w n) = s n. T I + [α] (resp. I [α]) if for ll k N, we hve T I k [α] (resp. Ik [α]). As for finite words the two following fcts re y definition. Fct 25. () I + k [α] I+ k+1 [α] I+ [α] nd Ik [α] Ik+1[α] I [α] for ll k 0. () I + [α] = k I+ k [α] nd I [α] = k I k [α]. Fct 26. I k [α] nd I[α] re su-ω-semigroups of 2 S. We finish the definition y generlizing Proposition 7, i.e., our ound on the stiliztion index, to the setting of ω-words. Proposition 27. For ll k > A 2 S 2, we hve I[α] = I k [α]. As for finite words, Proposition 27 yields rute-force lgorithm for computing I[α]. Agin, this lgorithm is non-elementry in k. We generlize elow our fixpoint lgorithm for the setting of ω- lnguges, nd get n EXPTIME procedure. As efore, the ound is proven s corollry of the completeness proof of the lgorithm. From FO-seprtion to FO-indistinguishle sets. By definition, the generliztion of Theorem 8 to ω-words is immedite. This yields the following theorem.

Coalgebra, Lecture 15: Equations for Deterministic Automata

Coalgebra, Lecture 15: Equations for Deterministic Automata Colger, Lecture 15: Equtions for Deterministic Automt Julin Slmnc (nd Jurrin Rot) Decemer 19, 2016 In this lecture, we will study the concept of equtions for deterministic utomt. The notes re self contined

More information

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true.

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true. York University CSE 2 Unit 3. DFA Clsses Converting etween DFA, NFA, Regulr Expressions, nd Extended Regulr Expressions Instructor: Jeff Edmonds Don t chet y looking t these nswers premturely.. For ech

More information

p-adic Egyptian Fractions

p-adic Egyptian Fractions p-adic Egyptin Frctions Contents 1 Introduction 1 2 Trditionl Egyptin Frctions nd Greedy Algorithm 2 3 Set-up 3 4 p-greedy Algorithm 5 5 p-egyptin Trditionl 10 6 Conclusion 1 Introduction An Egyptin frction

More information

Compiler Design. Fall Lexical Analysis. Sample Exercises and Solutions. Prof. Pedro C. Diniz

Compiler Design. Fall Lexical Analysis. Sample Exercises and Solutions. Prof. Pedro C. Diniz University of Southern Cliforni Computer Science Deprtment Compiler Design Fll Lexicl Anlysis Smple Exercises nd Solutions Prof. Pedro C. Diniz USC / Informtion Sciences Institute 4676 Admirlty Wy, Suite

More information

Minimal DFA. minimal DFA for L starting from any other

Minimal DFA. minimal DFA for L starting from any other Miniml DFA Among the mny DFAs ccepting the sme regulr lnguge L, there is exctly one (up to renming of sttes) which hs the smllest possile numer of sttes. Moreover, it is possile to otin tht miniml DFA

More information

CMPSCI 250: Introduction to Computation. Lecture #31: What DFA s Can and Can t Do David Mix Barrington 9 April 2014

CMPSCI 250: Introduction to Computation. Lecture #31: What DFA s Can and Can t Do David Mix Barrington 9 April 2014 CMPSCI 250: Introduction to Computtion Lecture #31: Wht DFA s Cn nd Cn t Do Dvid Mix Brrington 9 April 2014 Wht DFA s Cn nd Cn t Do Deterministic Finite Automt Forml Definition of DFA s Exmples of DFA

More information

Formal Languages and Automata

Formal Languages and Automata Moile Computing nd Softwre Engineering p. 1/5 Forml Lnguges nd Automt Chpter 2 Finite Automt Chun-Ming Liu cmliu@csie.ntut.edu.tw Deprtment of Computer Science nd Informtion Engineering Ntionl Tipei University

More information

AUTOMATA AND LANGUAGES. Definition 1.5: Finite Automaton

AUTOMATA AND LANGUAGES. Definition 1.5: Finite Automaton 25. Finite Automt AUTOMATA AND LANGUAGES A system of computtion tht only hs finite numer of possile sttes cn e modeled using finite utomton A finite utomton is often illustrted s stte digrm d d d. d q

More information

Parse trees, ambiguity, and Chomsky normal form

Parse trees, ambiguity, and Chomsky normal form Prse trees, miguity, nd Chomsky norml form In this lecture we will discuss few importnt notions connected with contextfree grmmrs, including prse trees, miguity, nd specil form for context-free grmmrs

More information

Convert the NFA into DFA

Convert the NFA into DFA Convert the NF into F For ech NF we cn find F ccepting the sme lnguge. The numer of sttes of the F could e exponentil in the numer of sttes of the NF, ut in prctice this worst cse occurs rrely. lgorithm:

More information

Theory of Computation Regular Languages. (NTU EE) Regular Languages Fall / 38

Theory of Computation Regular Languages. (NTU EE) Regular Languages Fall / 38 Theory of Computtion Regulr Lnguges (NTU EE) Regulr Lnguges Fll 2017 1 / 38 Schemtic of Finite Automt control 0 0 1 0 1 1 1 0 Figure: Schemtic of Finite Automt A finite utomton hs finite set of control

More information

Designing finite automata II

Designing finite automata II Designing finite utomt II Prolem: Design DFA A such tht L(A) consists of ll strings of nd which re of length 3n, for n = 0, 1, 2, (1) Determine wht to rememer out the input string Assign stte to ech of

More information

Lecture 3: Equivalence Relations

Lecture 3: Equivalence Relations Mthcmp Crsh Course Instructor: Pdric Brtlett Lecture 3: Equivlence Reltions Week 1 Mthcmp 2014 In our lst three tlks of this clss, we shift the focus of our tlks from proof techniques to proof concepts

More information

1 Nondeterministic Finite Automata

1 Nondeterministic Finite Automata 1 Nondeterministic Finite Automt Suppose in life, whenever you hd choice, you could try oth possiilities nd live your life. At the end, you would go ck nd choose the one tht worked out the est. Then you

More information

Chapter Five: Nondeterministic Finite Automata. Formal Language, chapter 5, slide 1

Chapter Five: Nondeterministic Finite Automata. Formal Language, chapter 5, slide 1 Chpter Five: Nondeterministic Finite Automt Forml Lnguge, chpter 5, slide 1 1 A DFA hs exctly one trnsition from every stte on every symol in the lphet. By relxing this requirement we get relted ut more

More information

Theory of Computation Regular Languages

Theory of Computation Regular Languages Theory of Computtion Regulr Lnguges Bow-Yw Wng Acdemi Sinic Spring 2012 Bow-Yw Wng (Acdemi Sinic) Regulr Lnguges Spring 2012 1 / 38 Schemtic of Finite Automt control 0 0 1 0 1 1 1 0 Figure: Schemtic of

More information

12.1 Nondeterminism Nondeterministic Finite Automata. a a b ε. CS125 Lecture 12 Fall 2016

12.1 Nondeterminism Nondeterministic Finite Automata. a a b ε. CS125 Lecture 12 Fall 2016 CS125 Lecture 12 Fll 2016 12.1 Nondeterminism The ide of nondeterministic computtions is to llow our lgorithms to mke guesses, nd only require tht they ccept when the guesses re correct. For exmple, simple

More information

Bases for Vector Spaces

Bases for Vector Spaces Bses for Vector Spces 2-26-25 A set is independent if, roughly speking, there is no redundncy in the set: You cn t uild ny vector in the set s liner comintion of the others A set spns if you cn uild everything

More information

Speech Recognition Lecture 2: Finite Automata and Finite-State Transducers. Mehryar Mohri Courant Institute and Google Research

Speech Recognition Lecture 2: Finite Automata and Finite-State Transducers. Mehryar Mohri Courant Institute and Google Research Speech Recognition Lecture 2: Finite Automt nd Finite-Stte Trnsducers Mehryr Mohri Cournt Institute nd Google Reserch mohri@cims.nyu.com Preliminries Finite lphet Σ, empty string. Set of ll strings over

More information

CS 301. Lecture 04 Regular Expressions. Stephen Checkoway. January 29, 2018

CS 301. Lecture 04 Regular Expressions. Stephen Checkoway. January 29, 2018 CS 301 Lecture 04 Regulr Expressions Stephen Checkowy Jnury 29, 2018 1 / 35 Review from lst time NFA N = (Q, Σ, δ, q 0, F ) where δ Q Σ P (Q) mps stte nd n lphet symol (or ) to set of sttes We run n NFA

More information

A negative answer to a question of Wilke on varieties of!-languages

A negative answer to a question of Wilke on varieties of!-languages A negtive nswer to question of Wilke on vrieties of!-lnguges Jen-Eric Pin () Astrct. In recent pper, Wilke sked whether the oolen comintions of!-lnguges of the form! L, for L in given +-vriety of lnguges,

More information

Formal languages, automata, and theory of computation

Formal languages, automata, and theory of computation Mälrdlen University TEN1 DVA337 2015 School of Innovtion, Design nd Engineering Forml lnguges, utomt, nd theory of computtion Thursdy, Novemer 5, 14:10-18:30 Techer: Dniel Hedin, phone 021-107052 The exm

More information

Harvard University Computer Science 121 Midterm October 23, 2012

Harvard University Computer Science 121 Midterm October 23, 2012 Hrvrd University Computer Science 121 Midterm Octoer 23, 2012 This is closed-ook exmintion. You my use ny result from lecture, Sipser, prolem sets, or section, s long s you quote it clerly. The lphet is

More information

Homework 3 Solutions

Homework 3 Solutions CS 341: Foundtions of Computer Science II Prof. Mrvin Nkym Homework 3 Solutions 1. Give NFAs with the specified numer of sttes recognizing ech of the following lnguges. In ll cses, the lphet is Σ = {,1}.

More information

Nondeterminism and Nodeterministic Automata

Nondeterminism and Nodeterministic Automata Nondeterminism nd Nodeterministic Automt 61 Nondeterminism nd Nondeterministic Automt The computtionl mchine models tht we lerned in the clss re deterministic in the sense tht the next move is uniquely

More information

Lecture 08: Feb. 08, 2019

Lecture 08: Feb. 08, 2019 4CS4-6:Theory of Computtion(Closure on Reg. Lngs., regex to NDFA, DFA to regex) Prof. K.R. Chowdhry Lecture 08: Fe. 08, 2019 : Professor of CS Disclimer: These notes hve not een sujected to the usul scrutiny

More information

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true.

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true. York University CSE 2 Unit 3. DFA Clsses Converting etween DFA, NFA, Regulr Expressions, nd Extended Regulr Expressions Instructor: Jeff Edmonds Don t chet y looking t these nswers premturely.. For ech

More information

Intermediate Math Circles Wednesday, November 14, 2018 Finite Automata II. Nickolas Rollick a b b. a b 4

Intermediate Math Circles Wednesday, November 14, 2018 Finite Automata II. Nickolas Rollick a b b. a b 4 Intermedite Mth Circles Wednesdy, Novemer 14, 2018 Finite Automt II Nickols Rollick nrollick@uwterloo.c Regulr Lnguges Lst time, we were introduced to the ide of DFA (deterministic finite utomton), one

More information

3 Regular expressions

3 Regular expressions 3 Regulr expressions Given n lphet Σ lnguge is set of words L Σ. So fr we were le to descrie lnguges either y using set theory (i.e. enumertion or comprehension) or y n utomton. In this section we shll

More information

Ehrenfeucht-Fraïssé Games: Applications and Complexity. Department of Mathematics and Computer Science University of Udine, Italy ESSLLI 2010 CPH

Ehrenfeucht-Fraïssé Games: Applications and Complexity. Department of Mathematics and Computer Science University of Udine, Italy ESSLLI 2010 CPH Ehrenfeucht-Frïssé Gmes: Applictions nd Complexity Angelo Montnri Nicol Vitcolonn Deprtment of Mthemtics nd Computer Science University of Udine, Itly ESSLLI 2010 CPH Outline Introduction to EF-gmes Inexpressivity

More information

Assignment 1 Automata, Languages, and Computability. 1 Finite State Automata and Regular Languages

Assignment 1 Automata, Languages, and Computability. 1 Finite State Automata and Regular Languages Deprtment of Computer Science, Austrlin Ntionl University COMP2600 Forml Methods for Softwre Engineering Semester 2, 206 Assignment Automt, Lnguges, nd Computility Smple Solutions Finite Stte Automt nd

More information

CS 373, Spring Solutions to Mock midterm 1 (Based on first midterm in CS 273, Fall 2008.)

CS 373, Spring Solutions to Mock midterm 1 (Based on first midterm in CS 273, Fall 2008.) CS 373, Spring 29. Solutions to Mock midterm (sed on first midterm in CS 273, Fll 28.) Prolem : Short nswer (8 points) The nswers to these prolems should e short nd not complicted. () If n NF M ccepts

More information

Anatomy of a Deterministic Finite Automaton. Deterministic Finite Automata. A machine so simple that you can understand it in less than one minute

Anatomy of a Deterministic Finite Automaton. Deterministic Finite Automata. A machine so simple that you can understand it in less than one minute Victor Admchik Dnny Sletor Gret Theoreticl Ides In Computer Science CS 5-25 Spring 2 Lecture 2 Mr 3, 2 Crnegie Mellon University Deterministic Finite Automt Finite Automt A mchine so simple tht you cn

More information

Lecture 09: Myhill-Nerode Theorem

Lecture 09: Myhill-Nerode Theorem CS 373: Theory of Computtion Mdhusudn Prthsrthy Lecture 09: Myhill-Nerode Theorem 16 Ferury 2010 In this lecture, we will see tht every lnguge hs unique miniml DFA We will see this fct from two perspectives

More information

Lecture 3. In this lecture, we will discuss algorithms for solving systems of linear equations.

Lecture 3. In this lecture, we will discuss algorithms for solving systems of linear equations. Lecture 3 3 Solving liner equtions In this lecture we will discuss lgorithms for solving systems of liner equtions Multiplictive identity Let us restrict ourselves to considering squre mtrices since one

More information

NFAs continued, Closure Properties of Regular Languages

NFAs continued, Closure Properties of Regular Languages Algorithms & Models of Computtion CS/ECE 374, Fll 2017 NFAs continued, Closure Properties of Regulr Lnguges Lecture 5 Tuesdy, Septemer 12, 2017 Sriel Hr-Peled (UIUC) CS374 1 Fll 2017 1 / 31 Regulr Lnguges,

More information

Finite Automata-cont d

Finite Automata-cont d Automt Theory nd Forml Lnguges Professor Leslie Lnder Lecture # 6 Finite Automt-cont d The Pumping Lemm WEB SITE: http://ingwe.inghmton.edu/ ~lnder/cs573.html Septemer 18, 2000 Exmple 1 Consider L = {ww

More information

Automata Theory 101. Introduction. Outline. Introduction Finite Automata Regular Expressions ω-automata. Ralf Huuck.

Automata Theory 101. Introduction. Outline. Introduction Finite Automata Regular Expressions ω-automata. Ralf Huuck. Outline Automt Theory 101 Rlf Huuck Introduction Finite Automt Regulr Expressions ω-automt Session 1 2006 Rlf Huuck 1 Session 1 2006 Rlf Huuck 2 Acknowledgement Some slides re sed on Wolfgng Thoms excellent

More information

More on automata. Michael George. March 24 April 7, 2014

More on automata. Michael George. March 24 April 7, 2014 More on utomt Michel George Mrch 24 April 7, 2014 1 Automt constructions Now tht we hve forml model of mchine, it is useful to mke some generl constructions. 1.1 DFA Union / Product construction Suppose

More information

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018 Finite Automt Theory nd Forml Lnguges TMV027/DIT321 LP4 2018 Lecture 10 An Bove April 23rd 2018 Recp: Regulr Lnguges We cn convert between FA nd RE; Hence both FA nd RE ccept/generte regulr lnguges; More

More information

The University of Nottingham SCHOOL OF COMPUTER SCIENCE A LEVEL 2 MODULE, SPRING SEMESTER LANGUAGES AND COMPUTATION ANSWERS

The University of Nottingham SCHOOL OF COMPUTER SCIENCE A LEVEL 2 MODULE, SPRING SEMESTER LANGUAGES AND COMPUTATION ANSWERS The University of Nottinghm SCHOOL OF COMPUTER SCIENCE LEVEL 2 MODULE, SPRING SEMESTER 2016 2017 LNGUGES ND COMPUTTION NSWERS Time llowed TWO hours Cndidtes my complete the front cover of their nswer ook

More information

Scanner. Specifying patterns. Specifying patterns. Operations on languages. A scanner must recognize the units of syntax Some parts are easy:

Scanner. Specifying patterns. Specifying patterns. Operations on languages. A scanner must recognize the units of syntax Some parts are easy: Scnner Specifying ptterns source code tokens scnner prser IR A scnner must recognize the units of syntx Some prts re esy: errors mps chrcters into tokens the sic unit of syntx x = x + y; ecomes

More information

5. (±±) Λ = fw j w is string of even lengthg [ 00 = f11,00g 7. (11 [ 00)± Λ = fw j w egins with either 11 or 00g 8. (0 [ ffl)1 Λ = 01 Λ [ 1 Λ 9.

5. (±±) Λ = fw j w is string of even lengthg [ 00 = f11,00g 7. (11 [ 00)± Λ = fw j w egins with either 11 or 00g 8. (0 [ ffl)1 Λ = 01 Λ [ 1 Λ 9. Regulr Expressions, Pumping Lemm, Right Liner Grmmrs Ling 106 Mrch 25, 2002 1 Regulr Expressions A regulr expression descries or genertes lnguge: it is kind of shorthnd for listing the memers of lnguge.

More information

2.4 Linear Inequalities and Interval Notation

2.4 Linear Inequalities and Interval Notation .4 Liner Inequlities nd Intervl Nottion We wnt to solve equtions tht hve n inequlity symol insted of n equl sign. There re four inequlity symols tht we will look t: Less thn , Less thn or

More information

Homework Solution - Set 5 Due: Friday 10/03/08

Homework Solution - Set 5 Due: Friday 10/03/08 CE 96 Introduction to the Theory of Computtion ll 2008 Homework olution - et 5 Due: ridy 10/0/08 1. Textook, Pge 86, Exercise 1.21. () 1 2 Add new strt stte nd finl stte. Mke originl finl stte non-finl.

More information

I1 = I2 I1 = I2 + I3 I1 + I2 = I3 + I4 I 3

I1 = I2 I1 = I2 + I3 I1 + I2 = I3 + I4 I 3 2 The Prllel Circuit Electric Circuits: Figure 2- elow show ttery nd multiple resistors rrnged in prllel. Ech resistor receives portion of the current from the ttery sed on its resistnce. The split is

More information

Farey Fractions. Rickard Fernström. U.U.D.M. Project Report 2017:24. Department of Mathematics Uppsala University

Farey Fractions. Rickard Fernström. U.U.D.M. Project Report 2017:24. Department of Mathematics Uppsala University U.U.D.M. Project Report 07:4 Frey Frctions Rickrd Fernström Exmensrete i mtemtik, 5 hp Hledre: Andres Strömergsson Exmintor: Jörgen Östensson Juni 07 Deprtment of Mthemtics Uppsl University Frey Frctions

More information

1 From NFA to regular expression

1 From NFA to regular expression Note 1: How to convert DFA/NFA to regulr expression Version: 1.0 S/EE 374, Fll 2017 Septemer 11, 2017 In this note, we show tht ny DFA cn e converted into regulr expression. Our construction would work

More information

CS103B Handout 18 Winter 2007 February 28, 2007 Finite Automata

CS103B Handout 18 Winter 2007 February 28, 2007 Finite Automata CS103B ndout 18 Winter 2007 Ferury 28, 2007 Finite Automt Initil text y Mggie Johnson. Introduction Severl childrens gmes fit the following description: Pieces re set up on plying ord; dice re thrown or

More information

First Midterm Examination

First Midterm Examination Çnky University Deprtment of Computer Engineering 203-204 Fll Semester First Midterm Exmintion ) Design DFA for ll strings over the lphet Σ = {,, c} in which there is no, no nd no cc. 2) Wht lnguge does

More information

CSCI 340: Computational Models. Kleene s Theorem. Department of Computer Science

CSCI 340: Computational Models. Kleene s Theorem. Department of Computer Science CSCI 340: Computtionl Models Kleene s Theorem Chpter 7 Deprtment of Computer Science Unifiction In 1954, Kleene presented (nd proved) theorem which (in our version) sttes tht if lnguge cn e defined y ny

More information

Review of Gaussian Quadrature method

Review of Gaussian Quadrature method Review of Gussin Qudrture method Nsser M. Asi Spring 006 compiled on Sundy Decemer 1, 017 t 09:1 PM 1 The prolem To find numericl vlue for the integrl of rel vlued function of rel vrile over specific rnge

More information

Closure Properties of Regular Languages

Closure Properties of Regular Languages Closure Properties of Regulr Lnguges Regulr lnguges re closed under mny set opertions. Let L 1 nd L 2 e regulr lnguges. (1) L 1 L 2 (the union) is regulr. (2) L 1 L 2 (the conctention) is regulr. (3) L

More information

NFAs and Regular Expressions. NFA-ε, continued. Recall. Last class: Today: Fun:

NFAs and Regular Expressions. NFA-ε, continued. Recall. Last class: Today: Fun: CMPU 240 Lnguge Theory nd Computtion Spring 2019 NFAs nd Regulr Expressions Lst clss: Introduced nondeterministic finite utomt with -trnsitions Tody: Prove n NFA- is no more powerful thn n NFA Introduce

More information

Name Ima Sample ASU ID

Name Ima Sample ASU ID Nme Im Smple ASU ID 2468024680 CSE 355 Test 1, Fll 2016 30 Septemer 2016, 8:35-9:25.m., LSA 191 Regrding of Midterms If you elieve tht your grde hs not een dded up correctly, return the entire pper to

More information

12.1 Nondeterminism Nondeterministic Finite Automata. a a b ε. CS125 Lecture 12 Fall 2014

12.1 Nondeterminism Nondeterministic Finite Automata. a a b ε. CS125 Lecture 12 Fall 2014 CS125 Lecture 12 Fll 2014 12.1 Nondeterminism The ide of nondeterministic computtions is to llow our lgorithms to mke guesses, nd only require tht they ccept when the guesses re correct. For exmple, simple

More information

CM10196 Topic 4: Functions and Relations

CM10196 Topic 4: Functions and Relations CM096 Topic 4: Functions nd Reltions Guy McCusker W. Functions nd reltions Perhps the most widely used notion in ll of mthemtics is tht of function. Informlly, function is n opertion which tkes n input

More information

Exercises with (Some) Solutions

Exercises with (Some) Solutions Exercises with (Some) Solutions Techer: Luc Tesei Mster of Science in Computer Science - University of Cmerino Contents 1 Strong Bisimultion nd HML 2 2 Wek Bisimultion 31 3 Complete Lttices nd Fix Points

More information

Grammar. Languages. Content 5/10/16. Automata and Languages. Regular Languages. Regular Languages

Grammar. Languages. Content 5/10/16. Automata and Languages. Regular Languages. Regular Languages 5//6 Grmmr Automt nd Lnguges Regulr Grmmr Context-free Grmmr Context-sensitive Grmmr Prof. Mohmed Hmd Softwre Engineering L. The University of Aizu Jpn Regulr Lnguges Context Free Lnguges Context Sensitive

More information

CS103 Handout 32 Fall 2016 November 11, 2016 Problem Set 7

CS103 Handout 32 Fall 2016 November 11, 2016 Problem Set 7 CS103 Hndout 32 Fll 2016 Novemer 11, 2016 Prolem Set 7 Wht cn you do with regulr expressions? Wht re the limits of regulr lnguges? On this prolem set, you'll find out! As lwys, plese feel free to drop

More information

CHAPTER 1 Regular Languages. Contents

CHAPTER 1 Regular Languages. Contents Finite Automt (FA or DFA) CHAPTE 1 egulr Lnguges Contents definitions, exmples, designing, regulr opertions Non-deterministic Finite Automt (NFA) definitions, euivlence of NFAs nd DFAs, closure under regulr

More information

Thoery of Automata CS402

Thoery of Automata CS402 Thoery of Automt C402 Theory of Automt Tle of contents: Lecture N0. 1... 4 ummry... 4 Wht does utomt men?... 4 Introduction to lnguges... 4 Alphets... 4 trings... 4 Defining Lnguges... 5 Lecture N0. 2...

More information

MATH 573 FINAL EXAM. May 30, 2007

MATH 573 FINAL EXAM. May 30, 2007 MATH 573 FINAL EXAM My 30, 007 NAME: Solutions 1. This exm is due Wednesdy, June 6 efore the 1:30 pm. After 1:30 pm I will NOT ccept the exm.. This exm hs 1 pges including this cover. There re 10 prolems.

More information

Model Reduction of Finite State Machines by Contraction

Model Reduction of Finite State Machines by Contraction Model Reduction of Finite Stte Mchines y Contrction Alessndro Giu Dip. di Ingegneri Elettric ed Elettronic, Università di Cgliri, Pizz d Armi, 09123 Cgliri, Itly Phone: +39-070-675-5892 Fx: +39-070-675-5900

More information

Speech Recognition Lecture 2: Finite Automata and Finite-State Transducers

Speech Recognition Lecture 2: Finite Automata and Finite-State Transducers Speech Recognition Lecture 2: Finite Automt nd Finite-Stte Trnsducers Eugene Weinstein Google, NYU Cournt Institute eugenew@cs.nyu.edu Slide Credit: Mehryr Mohri Preliminries Finite lphet, empty string.

More information

Regular expressions, Finite Automata, transition graphs are all the same!!

Regular expressions, Finite Automata, transition graphs are all the same!! CSI 3104 /Winter 2011: Introduction to Forml Lnguges Chpter 7: Kleene s Theorem Chpter 7: Kleene s Theorem Regulr expressions, Finite Automt, trnsition grphs re ll the sme!! Dr. Neji Zgui CSI3104-W11 1

More information

Finite-State Automata: Recap

Finite-State Automata: Recap Finite-Stte Automt: Recp Deepk D Souz Deprtment of Computer Science nd Automtion Indin Institute of Science, Bnglore. 09 August 2016 Outline 1 Introduction 2 Forml Definitions nd Nottion 3 Closure under

More information

Lecture 9: LTL and Büchi Automata

Lecture 9: LTL and Büchi Automata Lecture 9: LTL nd Büchi Automt 1 LTL Property Ptterns Quite often the requirements of system follow some simple ptterns. Sometimes we wnt to specify tht property should only hold in certin context, clled

More information

DFA minimisation using the Myhill-Nerode theorem

DFA minimisation using the Myhill-Nerode theorem DFA minimistion using the Myhill-Nerode theorem Johnn Högerg Lrs Lrsson Astrct The Myhill-Nerode theorem is n importnt chrcteristion of regulr lnguges, nd it lso hs mny prcticl implictions. In this chpter,

More information

Deterministic Finite Automata

Deterministic Finite Automata Finite Automt Deterministic Finite Automt H. Geuvers nd J. Rot Institute for Computing nd Informtion Sciences Version: fll 2016 J. Rot Version: fll 2016 Tlen en Automten 1 / 21 Outline Finite Automt Finite

More information

Table of contents: Lecture N Summary... 3 What does automata mean?... 3 Introduction to languages... 3 Alphabets... 3 Strings...

Table of contents: Lecture N Summary... 3 What does automata mean?... 3 Introduction to languages... 3 Alphabets... 3 Strings... Tle of contents: Lecture N0.... 3 ummry... 3 Wht does utomt men?... 3 Introduction to lnguges... 3 Alphets... 3 trings... 3 Defining Lnguges... 4 Lecture N0. 2... 7 ummry... 7 Kleene tr Closure... 7 Recursive

More information

Converting Regular Expressions to Discrete Finite Automata: A Tutorial

Converting Regular Expressions to Discrete Finite Automata: A Tutorial Converting Regulr Expressions to Discrete Finite Automt: A Tutoril Dvid Christinsen 2013-01-03 This is tutoril on how to convert regulr expressions to nondeterministic finite utomt (NFA) nd how to convert

More information

The Regulated and Riemann Integrals

The Regulated and Riemann Integrals Chpter 1 The Regulted nd Riemnn Integrls 1.1 Introduction We will consider severl different pproches to defining the definite integrl f(x) dx of function f(x). These definitions will ll ssign the sme vlue

More information

Finite Automata. Informatics 2A: Lecture 3. John Longley. 22 September School of Informatics University of Edinburgh

Finite Automata. Informatics 2A: Lecture 3. John Longley. 22 September School of Informatics University of Edinburgh Lnguges nd Automt Finite Automt Informtics 2A: Lecture 3 John Longley School of Informtics University of Edinburgh jrl@inf.ed.c.uk 22 September 2017 1 / 30 Lnguges nd Automt 1 Lnguges nd Automt Wht is

More information

Revision Sheet. (a) Give a regular expression for each of the following languages:

Revision Sheet. (a) Give a regular expression for each of the following languages: Theoreticl Computer Science (Bridging Course) Dr. G. D. Tipldi F. Bonirdi Winter Semester 2014/2015 Revision Sheet University of Freiurg Deprtment of Computer Science Question 1 (Finite Automt, 8 + 6 points)

More information

ɛ-closure, Kleene s Theorem,

ɛ-closure, Kleene s Theorem, DEGefW5wiGH2XgYMEzUKjEmtCDUsRQ4d 1 A nice pper relevnt to this course is titled The Glory of the Pst 2 NICTA Resercher, Adjunct t the Austrlin Ntionl University nd Griffith University ɛ-closure, Kleene

More information

State Minimization for DFAs

State Minimization for DFAs Stte Minimiztion for DFAs Red K & S 2.7 Do Homework 10. Consider: Stte Minimiztion 4 5 Is this miniml mchine? Step (1): Get rid of unrechle sttes. Stte Minimiztion 6, Stte is unrechle. Step (2): Get rid

More information

NFAs continued, Closure Properties of Regular Languages

NFAs continued, Closure Properties of Regular Languages lgorithms & Models of omputtion S/EE 374, Spring 209 NFs continued, losure Properties of Regulr Lnguges Lecture 5 Tuesdy, Jnury 29, 209 Regulr Lnguges, DFs, NFs Lnguges ccepted y DFs, NFs, nd regulr expressions

More information

Torsion in Groups of Integral Triangles

Torsion in Groups of Integral Triangles Advnces in Pure Mthemtics, 01,, 116-10 http://dxdoiorg/1046/pm011015 Pulished Online Jnury 01 (http://wwwscirporg/journl/pm) Torsion in Groups of Integrl Tringles Will Murry Deprtment of Mthemtics nd Sttistics,

More information

CS415 Compilers. Lexical Analysis and. These slides are based on slides copyrighted by Keith Cooper, Ken Kennedy & Linda Torczon at Rice University

CS415 Compilers. Lexical Analysis and. These slides are based on slides copyrighted by Keith Cooper, Ken Kennedy & Linda Torczon at Rice University CS415 Compilers Lexicl Anlysis nd These slides re sed on slides copyrighted y Keith Cooper, Ken Kennedy & Lind Torczon t Rice University First Progrmming Project Instruction Scheduling Project hs een posted

More information

Talen en Automaten Test 1, Mon 7 th Dec, h45 17h30

Talen en Automaten Test 1, Mon 7 th Dec, h45 17h30 Tlen en Automten Test 1, Mon 7 th Dec, 2015 15h45 17h30 This test consists of four exercises over 5 pges. Explin your pproch, nd write your nswer to ech exercise on seprte pge. You cn score mximum of 100

More information

1.3 Regular Expressions

1.3 Regular Expressions 56 1.3 Regulr xpressions These hve n importnt role in describing ptterns in serching for strings in mny pplictions (e.g. wk, grep, Perl,...) All regulr expressions of lphbet re 1.Ønd re regulr expressions,

More information

Homework 4. 0 ε 0. (00) ε 0 ε 0 (00) (11) CS 341: Foundations of Computer Science II Prof. Marvin Nakayama

Homework 4. 0 ε 0. (00) ε 0 ε 0 (00) (11) CS 341: Foundations of Computer Science II Prof. Marvin Nakayama CS 341: Foundtions of Computer Science II Prof. Mrvin Nkym Homework 4 1. UsetheproceduredescriedinLemm1.55toconverttheregulrexpression(((00) (11)) 01) into n NFA. Answer: 0 0 1 1 00 0 0 11 1 1 01 0 1 (00)

More information

Tutorial Automata and formal Languages

Tutorial Automata and formal Languages Tutoril Automt nd forml Lnguges Notes for to the tutoril in the summer term 2017 Sestin Küpper, Christine Mik 8. August 2017 1 Introduction: Nottions nd sic Definitions At the eginning of the tutoril we

More information

Linear Inequalities. Work Sheet 1

Linear Inequalities. Work Sheet 1 Work Sheet 1 Liner Inequlities Rent--Hep, cr rentl compny,chrges $ 15 per week plus $ 0.0 per mile to rent one of their crs. Suppose you re limited y how much money you cn spend for the week : You cn spend

More information

Quadratic Forms. Quadratic Forms

Quadratic Forms. Quadratic Forms Qudrtic Forms Recll the Simon & Blume excerpt from n erlier lecture which sid tht the min tsk of clculus is to pproximte nonliner functions with liner functions. It s ctully more ccurte to sy tht we pproximte

More information

Chapter 2 Finite Automata

Chapter 2 Finite Automata Chpter 2 Finite Automt 28 2.1 Introduction Finite utomt: first model of the notion of effective procedure. (They lso hve mny other pplictions). The concept of finite utomton cn e derived y exmining wht

More information

Surface maps into free groups

Surface maps into free groups Surfce mps into free groups lden Wlker Novemer 10, 2014 Free groups wedge X of two circles: Set F = π 1 (X ) =,. We write cpitl letters for inverse, so = 1. e.g. () 1 = Commuttors Let x nd y e loops. The

More information

Generating finite transformation semigroups: SgpWin

Generating finite transformation semigroups: SgpWin Generting finite trnsformtion semigroups: SgpWin Donld B. McAlister ( don@mth.niu.edu ) Deprtment of Mthemticl Sciences Northern Illinois University nd C.A.U.L. Septemer 5, 2006 Donld B. McAlister ( don@mth.niu.edu

More information

CDM Automata on Infinite Words

CDM Automata on Infinite Words CDM Automt on Infinite Words 1 Infinite Words Klus Sutner Crnegie Mellon Universlity 60-omeg 2017/12/15 23:19 Deterministic Lnguges Muller nd Rin Automt Towrds Infinity 3 Infinite Words 4 As mtter of principle,

More information

CS 330 Formal Methods and Models

CS 330 Formal Methods and Models CS 330 Forml Methods nd Models Dn Richrds, George Mson University, Spring 2017 Quiz Solutions Quiz 1, Propositionl Logic Dte: Ferury 2 1. Prove ((( p q) q) p) is tutology () (3pts) y truth tle. p q p q

More information

BACHELOR THESIS Star height

BACHELOR THESIS Star height BACHELOR THESIS Tomáš Svood Str height Deprtment of Alger Supervisor of the chelor thesis: Study progrmme: Study rnch: doc. Štěpán Holu, Ph.D. Mthemtics Mthemticl Methods of Informtion Security Prgue 217

More information

Vectors , (0,0). 5. A vector is commonly denoted by putting an arrow above its symbol, as in the picture above. Here are some 3-dimensional vectors:

Vectors , (0,0). 5. A vector is commonly denoted by putting an arrow above its symbol, as in the picture above. Here are some 3-dimensional vectors: Vectors 1-23-2018 I ll look t vectors from n lgeric point of view nd geometric point of view. Algericlly, vector is n ordered list of (usully) rel numers. Here re some 2-dimensionl vectors: (2, 3), ( )

More information

First Midterm Examination

First Midterm Examination 24-25 Fll Semester First Midterm Exmintion ) Give the stte digrm of DFA tht recognizes the lnguge A over lphet Σ = {, } where A = {w w contins or } 2) The following DFA recognizes the lnguge B over lphet

More information

CISC 4090 Theory of Computation

CISC 4090 Theory of Computation 9/6/28 Stereotypicl computer CISC 49 Theory of Computtion Finite stte mchines & Regulr lnguges Professor Dniel Leeds dleeds@fordhm.edu JMH 332 Centrl processing unit (CPU) performs ll the instructions

More information

Improper Integrals. The First Fundamental Theorem of Calculus, as we ve discussed in class, goes as follows:

Improper Integrals. The First Fundamental Theorem of Calculus, as we ve discussed in class, goes as follows: Improper Integrls The First Fundmentl Theorem of Clculus, s we ve discussed in clss, goes s follows: If f is continuous on the intervl [, ] nd F is function for which F t = ft, then ftdt = F F. An integrl

More information

W. We shall do so one by one, starting with I 1, and we shall do it greedily, trying

W. We shall do so one by one, starting with I 1, and we shall do it greedily, trying Vitli covers 1 Definition. A Vitli cover of set E R is set V of closed intervls with positive length so tht, for every δ > 0 nd every x E, there is some I V with λ(i ) < δ nd x I. 2 Lemm (Vitli covering)

More information

CMSC 330: Organization of Programming Languages

CMSC 330: Organization of Programming Languages CMSC 330: Orgniztion of Progrmming Lnguges Finite Automt 2 CMSC 330 1 Types of Finite Automt Deterministic Finite Automt (DFA) Exctly one sequence of steps for ech string All exmples so fr Nondeterministic

More information

1 Structural induction

1 Structural induction Discrete Structures Prelim 2 smple questions Solutions CS2800 Questions selected for Spring 2018 1 Structurl induction 1. We define set S of functions from Z to Z inductively s follows: Rule 1. For ny

More information

set is not closed under matrix [ multiplication, ] and does not form a group.

set is not closed under matrix [ multiplication, ] and does not form a group. Prolem 2.3: Which of the following collections of 2 2 mtrices with rel entries form groups under [ mtrix ] multipliction? i) Those of the form for which c d 2 Answer: The set of such mtrices is not closed

More information