The Degree of Irreversibility in Deterministic Finite Automata

Size: px
Start display at page:

Download "The Degree of Irreversibility in Deterministic Finite Automata"

Transcription

1 The Degree of Irreversiility in Deterministic Finite Automt Holger Bock Axelsen 1, Mrkus Holzer 2(B), nd Mrtin Kutri 2 1 Deprtment of Computer Science, University of Copenhgen, Universitetsprken 5, Copenhgen, Denmrk funkstr@di.ku.dk 2 Institut für Informtik, Universität Giessen, Arndtstr. 2, Giessen, Germny {holzer,kutri}@informtik.uni-giessen.de Astrct. Recently, Holzer et l. gve method to decide whether the lnguge ccepted y given deterministic finite utomton (DFA) cn lso e ccepted y some reversile deterministic finite utomton (REV-DFA), nd eventully proved NL-completeness. Here, we show tht the corresponding prolem for nondeterministic finite stte utomt (NFA) is PSPACE-complete. The recent DFA method essentilly works y minimizing the DFA nd inspecting it for foridden pttern. Weherestudythedegree of irreversiility for regulr lnguge, the miniml numer of such foridden ptterns necessry in ny DFA ccepting the lnguge, nd show tht the degree induces strict infinite hierrchy of lnguges. We exmine how the degree of irreversiility ehves under the usul lnguge opertions union, intersection, complement, conctention, nd Kleene str, showing tight ounds (some symptoticlly) on the degree. 1 Introduction In computtion theory, reversiility is the property tht computtions re oth forwrd nd ckwrd deterministic. In the context of finite stte models, reversiility cn usully e verified y simple inspection of the trnsition function, ensuring tht the induced computtion step reltion is n injective function on configurtions. Despite the pprent simplicity of reversile computtions, reversiility is n interesting property tht hs een studied in wide rry of contexts, including the thermodynmics of computtion [7], cross wide rry of utomt models [9], nd even in rootics [10]. It is well-known tht the reversily regulr lnguges, i.e., the lnguges ccepted y reversile deterministic finite utomt (REV-DFA), form strict suclss of the regulr lnguges, see, e.g., [6]. However, the exct cost of reversiility is still not well-understood: for exmple, chnging from one-wy The uthors cknowledge prtil support from COST Action IC1405 Reversile Computtion. H.B. Axelsen ws supported y the Dnish Council for Independent Reserch Nturl Sciences under the Foundtions of Reversile Computing project, nd y COST IC1405 STSM (short-term scientific mission) grnt. c Springer Interntionl Pulishing Switzerlnd 2016 Y.-S. Hn nd K. Slom (Eds.): CIAA 2016, LNCS 9705, pp , DOI: /

2 16 H.B. Axelsen et l. to two-wy tpes is sufficient to collpse the clsses [5]. Likewise, dding reversile trnsducer in front of the REV-DFA lso collpses to the regulr lnguges [1]. This motivtes further study into the reltionship etween the regulr nd reversily regulr lnguges, nd in prticulr towrds developing methods to understnd nd ridge the gp in terms of the internl structure of deterministic finite utomt (DFA). In this pper, we tke steps in this direction. Recently, Holzer et l. showed method for deciding if the lnguge ccepted y given DFA cn lso e recognized y some REV-DFA [4]. It ws lso shown tht this is n NL-complete prolem, nd decision method ws given, which essentilly works y minimizing the DFA nd inspecting it for the presence of foridden pttern. If this pttern is present in the miniml DFA, then there is no REV-DFA tht cn ccept the sme lnguge, nd if not, then there is. Wht mkes this prticulrly interesting is tht the pttern is structurlly more complex thn the simplest violtion of reversiility (see Sect. 2 for detils). This suggests tht the foridden pttern cptures n essentil spect of irreversiility, nd offers n pproch to studying the gp etween the reversily regulr nd regulr lnguges sed on the sence, presence, nd count of occurrences, of this pttern. Our contriutions re s follows. We show tht the generliztion of the prolem studied in [4] to nondeterministic finite utomt (NFA), i.e., the regulr reversiility prolem of whether the lnguge ccepted y given NFA is reversily regulr, is PSPACE-complete. Turning to DFAs, we introduce the notion of degree of irreversiility for DFAs, essentilly the numer of occurrences of the foridden pttern in given DFA, nd extend this to (regulr) lnguges y minimizing over ll DFAs ccepting the lnguge. Finlly, we show tht the degree of irreversiility induces strict, infinite hierrchy of lnguges. We then proceed to show exct ounds on the degree of irreversiility under the common lnguge opertions union, intersection, nd complement, nd symptoticlly tight ounds for conctention nd Kleene str. The pper is orgnized s follows. Section 2 covers the necessry preliminries. In Sect. 3 we show tht the regulr reversiility prolem is PSPACE-complete. Section 4 defines the degree of irreversiility, nd shows the relted hierrchy. We present the degree complexity results for common lnguge opertions in Sect. 5. Most proofs re omitted due to spce constrints, nd will e given in the full version of the pper. 2 Preliminries An lphet Σ is non-empty finite set, its elements re clled letters or symols. We write Σ for the set of ll words over the finite lphet Σ. We recll some definitions on finite utomt s contined, for exmple, in [3]. A deterministic finite utomton (DFA) is 5-tuple A =(Q, Σ, δ, q 0,F), where Q is the finite set of internl sttes, Σ is the lphet of input symols, q 0 S is the initil stte, F Q is the set of ccepting sttes, ndδ : Q Σ Q is the

3 The Degree of Irreversiility in Deterministic Finite Automt 17 prtil trnsition function. Note tht here the trnsition function is not required to e totl. Thelnguge ccepted y A is L(A) ={ w Σ δ(q 0,w) F }, where the trnsition function is recursively extended to δ : Q Σ Q. By δ R : Q Σ 2 Q, with δ R (q, ) ={ p S δ(p, ) =q }, we denote the reverse trnsition function of δ. Similrly, lso δ R cn e extended to words insted of symols. Two devices A nd A re sid to e equivlent if they ccept the sme lnguge, tht is, L(A) =L(A ). Let A = (Q, Σ, δ, q 0,F) e DFA ccepting the lnguge L. Thesetof words R A,q = { w Σ δ(q, w) F } refers to the right lnguge of the stte q in A. IncseR A,p = R A,q, for some sttes p, q Q, we sy tht p nd q re equivlent nd write p A q. The equivlence reltion A prtitions the stte set Q of A into equivlence clsses, nd we denote the equivlence clss of q S y [q] ={ p S p A q }. Equivlence cn lso e defined etween sttes of different utomt: stte p of DFA A nd stte q of DFA A re equivlent, denoted y p q, ifr A,p = R A,q. A stte p Q is ccessile in A if there is word w Σ such tht δ(q 0,w)= p, nd it is productive if there is word w Σ such tht δ(p, w) F.Ifp is oth ccessile nd productive then we sy tht p is useful. In this pper we only consider utomt with ll sttes useful. Let A nd A e two equivlent DFAs. Oserve tht if p is useful stte in A, then there exists useful stte p in A, with p p.adfaisminiml (mong ll DFAs) if there does not exist n equivlent DFA with fewer sttes. It is well known tht DFA is miniml if nd only if ll its sttes re useful nd inequivlent. Next we define reversile DFAs. Let A = (Q, Σ, δ, q 0,F) e DFA. A stte r Q is sid to e irreversile if there re two distinct sttes p nd q in Q nd letter Σ such tht δ(p, ) =r = δ(q, ). Then DFA is reversile if it does not contin ny irreversile stte. In this cse the utomton is sid to e reversile DFA (REV-DFA). Equivlently the DFA A is reversile, if every letter Σ induces n injective prtil mpping from Q to itself vi the mpping δ : Q Q with p δ(p, ). In this cse, the reverse trnsition function δ R cn e seen s (prtil) injective function δ R : Q Σ Q. Notice tht if p nd q re two distinct sttes in REV-DFA, then δ(p, w) δ(q, w), for ll words w Σ. Finlly, REV-DFA is miniml (mong ll REV-DFAs) if there is no equivlent REV-DFA with smller numer of sttes. In [4] the following structurl chrcteriztion of regulr lnguges tht cn e ccepted y REV-DFAs in terms of their miniml DFAs is given. The conditions of the chrcteriztion re illustrted in Fig. 1. Theorem 1. Let A =(Q, Σ, δ, q 0,F) e miniml deterministic finite utomton. The lnguge L(A) cn e ccepted y reversile deterministic finite utomton if nd only if there do not exist useful sttes p, q Q, letter Σ, nd word w Σ such tht p q, δ(p, ) =δ(q, ), ndδ(q, w) =q. Finlly we need some nottions on computtionl complexity theory. We clssify prolems on DFAs with respect to their computtionl complexity. Consider the complexity clss NL (PSPACE, respectively) which refers to the set

4 18 H.B. Axelsen et l. p q r p r=q q r=p w w w Fig. 1. The foridden pttern of Theorem 1: the lnguge ccepted y miniml DFA A cn e ccepted y REV-DFA if nd only if A does not contin the structure depicted on the left. Here the sttes p nd q must e distinct, ut stte r could e equl to stte p or stte q. The situtions where r = q or r = p re shown in the middle nd on the right, respectively here the word w nd its corresponding pth re gryed out ecuse they re not relevnt: in the middle, the word w tht leds from r to q is not relevnt since it cn e identified with the -loop on stte r = q. Also on the right hnd side, word w is not importnt ecuse we cn simply interchnge the roles of the sttes q nd r = p. of prolems ccepted y nondeterministic logspce ounded (polynomil spce, respectively) Turing mchines. Further, hrdness nd completeness is lwys ment with respect to deterministic logspce ounded reduciility, unless otherwise stted. 3 Complexity of the Regulr Reversiility Prolem In [4] it ws shown tht the regulr lnguge reversiility prolem given DFA A, decide whether L(A) is ccepted y ny REV-DFA is NL-complete. If the regulr lnguge is given y n NFA or regulr expression, the prolem ecomes intrctle. Theorem 2. The regulr lnguge reversiility prolem is PSPACE-complete, if the lnguge is given s nondeterministic finite utomton or regulr expression. Before we cn prove this result we need technicl lemm, which will e used in the PSPACE-hrdness rgument lter. Lemm 3. Let A =(Q, Σ, δ, q 0,F) e miniml DFA. If there is stte q Q, other thn the initil stte, such tht R A,q = Σ, then L(A) is irreversile. Let L Σ. Then the left derivtive of L with respect to the letter in Σ is the set 1 L = { w w L }. This nottion generlizes to words. By this definition, there is n ovious reltion etween these left derivtive set nd the sttes of the miniml finite utomton A ccepting L. To e more precise, the set u 1 L, foru Σ, is description of the stte q u = δ(q 0,u), where A =(Q, Σ, δ, q 0,F), nd vice vers. Now we re redy to proof Theorem 2 in convenient wy.

5 The Degree of Irreversiility in Deterministic Finite Automt 19 Proof (of Theorem 2). The continment within PSPACE is esily seen. For the hrdness we reduce the PSPACE-complete universlity prolem for regulr expressions [8] to the reversiility prolem for NFAs or regulr expressions. Let the regulr expression r e n instnce of the universlity prolem. We my ssume tht r is n expression over the lphet Σ = {, }. Then we construct the expression s = r + Σ + λ or equivlently the NFA depicted in Fig. 2 in deterministic logspce. Now ssume tht L(r) =Σ. Then it is esy to see tht L(s) =Σ, too, nd therefore reversile lnguge. On the other hnd, if L(r) Σ, then there is word u L(r). From this it follows tht u L(s) ut u L(s). Thus we conclude tht the sttes 1 L(s) nd 1 L(s) re not equivlent in the DFA ccepting L(s). Moreover, in tht DFA sttes L(s) nd 1 L(s) re not equivlent, too. Note tht the former stte is the initil stte of the DFA tht ccepts L(s). Since the right lnguge of the stte 1 L(s) is equl to Σ nd it is not equl to the initil stte, Lemm 3 pplies, nd the lnguge L(s) isnot reversile. This proves PSPACE-hrdness. q 1 A r q 0 q 2, Fig. 2. Finite utomton tht ccepts the lnguge L(s). It is uilt from the regulr expression r, wherea r is n NFA with initil stte q 1 tht ccepts the lnguge L(r). 4 On the Degree of Irreversiility For n utomton A we define its degree of irreversiility d(a) s the numer of irreversile sttes tht re prt of one of the foridden ptterns shown in Fig. 1. Oserve, tht since our DFAs need not to e complete nd only contin useful sttes, the non-ccepting sink stte does not count for the degree of irreversiility. This nottion is generlized to lnguges in the usul wy. This mens, for regulr lnguge L Σ we define its degree of irreversiility d(l) sthe minimum degree of irreversiility mong ll equivlent DFAs A, tht is, d(l) = min{ d(a) A is DFA with L(A) =L }. The next exmple explins our nottion.

6 20 H.B. Axelsen et l Fig. 3. DFA which ccepts + tht hs irreversiility degree one. Exmple 4. Consider the following DFA depicted in Fig. 3, which ccepts the union of nd. This utomton hs irreversiility degree one y stte 3. Note tht lthough stte 4 hs two ingoing -trnsitions, this stte does not yield foridden pttern s shown in Fig. 1. There is no word tht leds from stte 4 to either stte 1 or 3. Moreover, the lnguge ccepted y this utomton, which is + is lso of irreversiility degree one, since it is not reversile y Theorem 1. Next we consider the hierrchy on regulr lnguges tht is induced y the irreversiility degree. To this end let IREV k -DFA = { A A is DFA nd d(a) k }. We hve IREV 0 -DFA = { A A is reversile DFA } nd thus the equlity L (IREV 0 -DFA) = L (REV-DFA) holds, where the fmily of ll lnguges ccepted y n utomton of some type X is denoted y L (X). Moreover, y definition the inclusion IREV k -DFA IREV k+1 -DFA follows nd therefore the corresponding lnguge clsses stisfy L (IREV k -DFA) L (IREV k+1 -DFA), for k 0. By the exmple ove we hve L (REV-DFA) = L (IREV 0 -DFA) L (IREV 1 -DFA). Before we show tht the degree of irreversiility induces n infinite strict hierrchy we need some tool tht llows us to determine the irreversiility degree for n ritrry regulr lnguge. Since for the degree of irreversiility of lnguge L we quntify over ll equivlent DFAs we hve to show tht we cnnot trde more sttes for less irreversiility. The following exmple shows tht this is in fct not the cse in generl. Exmple 5. Consider the sustructure of DFA s depicted in Fig. 4. Itisnot hrd to see tht this pttern my pper in miniml DFA. Both sttes r 1 nd r 2 in the sustructure re irreversile. By splitting oth of these sttes, we otin connecting structure s shown in Fig. 5. The structure hs one irreversile stte only. Thus, the irreversiility degree of miniml DFA is not necessrily the irreversiility degree of the lnguge under considertion.

7 The Degree of Irreversiility in Deterministic Finite Automt 21 The Degree of Irreversiility in Deterministic Finite Automt d r 1 s r 2 c Fig. 4. Sustructure of DFA contining two irreversile sttes r 1 nd r 2. d d r 1 r 1 s r 2 r 2 c c Fig. 5. Sustructure of DFA with just one irreversile stte s otined fter splitting oth irreversile sttes. For specil clss of finite utomt, we cn show tht the miniml DFA lredy gives the degree of irreversiility. A DFA is simply-irreversile if ll irreversile sttes re of the form depicted in the middle nd right drwing shown in Fig. 1. Tht is, the irreversiility stte is entered y n -trnsition nd hs n -self-loop, which is the simplest form of irreversiility. For the lnguges ccepted y these utomt we cn prove the next result. Theorem 6. Let L e regulr lnguge nd A e its miniml deterministic finite utomton. If A is simply-irreversile, then the degree of irreversiility of A is equl to the irreversiility degree for L. Tht is d(l) =d(a). Now we re redy to show tht the strict hierrchy on regulr lnguges induced y the irreversiility degree is tight nd infinite. Theorem 7. For ll k 0, L (IREV k -DFA) L (IREV k+1 -DFA). Proof. Consider the lnguges L k over the lphet {, } defined s follows: for k 0set L 2k =( ) k nd L 2k+1 =( ) k. The lnguge L k,fork 0, is ccepted y the DFA A k =(Q k, {, },δ k,q 0,F k ) with Q k = {1, 2,...,k+1}, q 0 =1,F k = {k +1}, nd { i +1 ifi is odd nd 1 i<k+1 δ(i, ) = i if i is even nd 1 <i k +1 nd δ(i, ) = { i +1 ifi is even nd 1 i<k+1 i if i is odd nd 1 <i k +1.

8 22 H.B. Axelsen et l. By construction the DFA A k is miniml nd simply-irreversile. Thus, y the previous theorem the degree of irreversiility of A k is equl to the irreversiility degree of the lnguge L k. Since A k contins exctly k irreversile sttes, we hve d(l k )=k. This shows tht L k L (IREV k -DFA) \ L (IREV k 1 -DFA), for k 1. Finlly, we consider unry regulr lnguges nd their irreversiility degree. It is not difficult to see tht unry complete DFA consists of pth, which strts from the initil stte, followed y cycle of one or more sttes. Thus the irreversiility degree of ny unry DFA is t most one. Thus, the hierrchy on the irreversiility degree collpses to its second level nd L (IREV 1 -DFA) 2 {} is lredy equl to the clss of ll unry regulr lnguges. Moreover, we conclude tht L (IREV 0 -DFA) 2 {} is the clss of lnguges tht contins only finite or cyclic unry regulr lnguges. Here unry regulr lnguge is cyclic if it is ccepted y unry DFA which is cycle of one or more sttes. 5 Opertions on Lnguges nd Degree of Irreversiility In this section we study the descriptionl complexity of the opertion prolem for reversile lnguges. We strt with the Boolen opertions nd continue with the conctention nd Kleene str opertion. First we consider the union opertion. For the union of two reversile lnguge, the increse of the degree of irreversiility is liner in the sum of the numer of sttes of the involved utomt. This cn e seen in the next theorem. Theorem 8. Let m, n 1 e two integers, A e n m-stte nd B e n n-stte reversile deterministic finite utomton. Then the degree m+n of irreversiility for the lnguge L(A) L(B) is sufficient nd necessry in the worst cse. Proof. Let A =(Q A,Σ,δ A,q 0,A,F A )ndb =(Q B,Σ,δ B,q 0,B,F B ). In order to ccept the union of L(A) nd L(B) we pply the stndrd cross-product construction. To this end define C =(Q C,Σ,δ C,q 0,C,F C ), where Q C =(Q A Q B ) (Q A { }) ({ } Q B ), q 0,C =(q 0,A,Q 0,B ), nd F C =(Q A F B ) (F A Q B ) (F A { }) ({ } F B ). The trnsition function δ C is set to δ C ((p, q),)= (δ A (p, ),δ B (q, )) if oth δ A (p, ) ndδ B (q, ) re defined (δ A (p, ), ) if δ A (p, ) is defined nd δ B (q, ) is undefined (,δ B (q, )) if δ A (p, ) is undefined nd δ B (q, ) is defined nd furthermore δ C ((p, ),)=(δ A (p, ), ), if δ A (p, ) is defined, s well s δ C ((,q),) = (,δ B (q, )), if δ B (q, ) is defined, for Σ. So we hve

9 The Degree of Irreversiility in Deterministic Finite Automt 23 L(C) = L(A) L(B). From the m n + m + n sttes of C t most m + n re irreversile. To e more precise, none of the sttes from Q A Q B re irreversile. This is seen s follows: consider stte (r, r ) Q A Q B. Assume to the contrry tht (r, r ) is irreversile. Then there re different sttes (p, p )nd (q, q ) with δ C ((p, p ),)=(r, r )=δ C ((q, q ),), for some Σ. Since (p, p )is not equl to (q, q )wehvep q or p q. We only consider the cse p q y symmetric resons. But then we find tht r is n irreversile stte, ecuse δ A (p, ) =r = δ A (q, ), for the letter from ove. This is contrdiction, ecuse utomton A is reversile DFA. It is worth mentioning tht similr rgumenttion does not pply to sttes of the form (r, ) or(,r). This is seen y the counterexmple δ C ((r, p),)=(r, ) =δ C ((r, ),), for some Σ, which induces only δ A (r, ) =r nd δ B (p, ) is undefined n nlogous exmple cn e given for stte of the form (,r). Hence, this does not contrdict the irreversiility of either A or B. It remins to e shown tht the ound m + n is tight. Define the reversile DFA A =(Q A, {, },δ A,q 0,F) with Q A = {1, 2,...,m}, q 0 =1,F = {m}, nd the trnsition function is given y δ(i, ) =i +1,for1 i<m,ndδ(i, ) =i, for 1 i m. The utomton B is the sme s A, ut with n sttes, nd where the letters nd re interchnged. The utomton C constructed ove is esily seen to e miniml. Finlly we show tht ll sttes of the form (i, ) nd (,j), for 1 i m nd 1 j n, re irreversile nd yield foridden pttern s shown in Fig. 1. The elow given rgument shows even more, nmely tht the utomton C is simply-irreversile. We hve lredy rgued tht the stte (i, n) is ccessile. Then it is esy to see tht from stte (i, n) reding the utomton C enters stte (i, ), which hs loop. Therefore stte (i, ) is simply-irreversile. A similr rgument shows tht stte (,j) is simply-irreversile s well. By Theorem 6 the stted clim follows. A creful inspection of the previous proof revels tht we cn use prts of it for the intersection of two reversile lnguges. For two reversile utomt A nd B we construct n utomton C y the cross-product construction descried in the proof of Theorem 8 ut only using sttes of the form Q A Q B nd y ltering the set of ccepting sttes to e F = F A F B. Then L(C) =L(A) L(B). It ws shown tht none of the sttes from Q A Q B re irreversile. Hence C does not contin ny irreversile stte. Thus, we hve shown the following result. Theorem 9. Let m, n 1 e two integers, A e n m-stte nd B e n n-stte reversile deterministic finite utomton. Then the lnguge L(A) L(B) is ccepted y reversile deterministic finite utomton. Next we del with the complementtion opertion, nd show tht the degree of irreversiility cn e incresed y one. Theorem 10. Let n 1 e n integers nd A e n n-stte reversile deterministic finite utomton. Then the degree 1 of irreversiility for the complement of L(A) is sufficient nd necessry in the worst cse.

10 24 H.B. Axelsen et l. In the reminder of this section we investigte the effect of the conctention nd the Kleene str opertion on the degree of irreversiility. First we recll the construction of DFAs for the conctention [11]. Let A =(Q A,Σ,δ A,q 0,A,F A ) nd B =(Q B,Σ,δ B,q 0,B,F B ) e two DFAs. As in [11] we construct the DFA C =(Q C,Σ,δ C,q 0,C,F C ), where Q C =(Q A 2 QB ) \ (F A 2 QB\{q0,B} ), the initil stte is q 0,C = { (q 0,A, ) if q 0,A F A (q 0,A, {q 0,B }) otherwise, the finl sttes re F C = { (p, P ) (p, P ) Q C nd P F B }, nd the trnsition function is defined y δ C ((p, P ),)=(q, Q), for Σ, where q = δ A (p, ) nd { δ B (P, ) {q 0,B } if q F A Q = δ B (P, ) otherwise. Clerly, utomton C ccepts L(A) L(B) nd hs t most m 2 n 2 n 1 sttes. Thus, the construction gives rise to n exponentil upper ound on the numer of irreversile sttes. Theorem 11. Let m, n 2 e two integers, A e n m-stte nd B e n n-stte reversile deterministic finite utomton. Then the degree m 2 n 2 n 1 of irreversiility is sufficient for deterministic finite utomton to ccept the lnguge L(A) L(B). The next theorem gives n exponentil lower ound on the degree of irreversiility for the conctention opertion. Theorem 12. Let m, n 2 e two integers. There re reversile m-stte deterministic finite utomton A nd reversile n-stte deterministic finite utomton B such tht ny deterministic finite utomton ccepting L(A) L(B) hs t lest the degree (3m 2) 2 n 2 of irreversiility. Proof. Define the left utomton to e A =(Q A, {,, c, d},δ A,q 0,A,F A ) with Q A = {0, 1,...,m 1}, initil stte q 0,A = 0, finl sttes F A = {m 1}, nd the trnsition function { i +1 if0 i<m 1 δ A (i, ) = nd δ A (i, ) =δ A (i, c) =δ A (i, d) =i 0 otherwise for 0 i m 1. The right utomton is B =(Q B, {,, c, d},δ B,q 0,B,F B ) with Q B = {0, 1,...,n 1}, initil stte q 0,B = 0, finl sttes F A = {0}, nd the trnsition function

11 The Degree of Irreversiility in Deterministic Finite Automt 25 δ B (i, ) =i, for 0 i n 1, nd δ B (i, ) = { i +1 if0 i<n 1 0 otherwise, nd δ B (i, c) =i, for 0 <i n 1, nd δ B (i, d) =i, for i =0or2 i n 1. Both reversile utomt re depicted in Fig. 6. m 1 n 1, c, d, c, d 0, c, d 0, d 1, c, d 1, c, c, d 2 Fig. 6. The reversile utomt A (left) nd B (right) with m nd n sttes, respectively, tht witness the irreversiility degree lower ound for the conctention opertion. We construct the DFA C for the conctention L(A) L(B) s descried ove. In order to pply Theorem 6 we need to show tht C is miniml. Thus, one hs to verify tht every stte in C is useful nd defines distinct equivlence clss. Finlly, it remins to determine the lower ound on the irreversiility degree of C. We show tht ll sttes of C whose second component does not contin 0 nd 1 t the sme time re simply-irreversile. We hve lredy seen tht ll sttes of the form (p, P {0}) nd (p, P {1}) re rechle in C. We distinguish two cses: 1. Assume p = m 1. Then 0 P, ut then y ssumption 1 P.Wehve δ C ((p, P {1}),d)=(p, P )ndδ C ((p, P ),d)=(p, P ). Thus (p, P ) is simplyirreversile. 2. Let p = i with 0 i<m 1. If 0 P, then δ C ((p, P {0}),c)=(p, P )nd δ C ((p, P ),c)=(p, P ). Also in the cse 1 P, the two trnsitions δ C ((p, P {1}),d)=(p, P )ndδ C ((p, P ),d)=(p, P ) follow. In oth cses the stte (p, P ) is simply-irreversile. Next we count the numer of simply-irreversile sttes. The first item ove induces 2 n 2 possiilities, nd the second item 3(m 1) 2 n 2. There re (m 1) choices for p nd the numer of different sets P tht do not contin 0 or 1 is 3 2 n 2. For ech of the cses (i) oth 0 nd 1 re not in P, (ii) element 0 is

12 26 H.B. Axelsen et l. in P ut 1 is not, nd (iii) element 0 is not in P ut 1 is memer of P, there re 2 n 2 possiilities. This results in 3(m 1) 2 n 2 sets for the second item ove. Putting things together results in in t lest (3m 2) 2 n 2 simply-irreversile sttes in C. By Theorem 6 the stted clim follows. Finlly, we consider the Kleene str opertion. From [11] the tight worst cse ound for DFA to ccept the Kleene closure of n n-stte DFA lnguge is 2 n 1 +2 n 2. Thus, the upper ound for the irreversiility degree for the Kleene closure is exponentil. Theorem 13. Let n 2 e n integers nd A e n n-stte reversile deterministic finite utomton. Then the degree 2 n 1 +2 n 2 of irreversiility is sufficient for deterministic finite utomton to ccept the lnguge L(A). As in the cse of the conctention opertion we cn provide n exponentil lower ound. Theorem 14. Let n 3 e n integer. There is reversile n-stte deterministic finite utomton A such tht ny deterministic finite utomton ccepting L(A) hs t lest the degree 3 2 n 3 1 of irreversiility. References 1. Axelsen, H.B., Kutri, M., Mlcher, A., Wendlndt, M.: Boosting reversile pushdown mchines y preprocessing. In: RC 2016, LNCS. Springer (2016) 2. Glushkov, V.M.: The strct theory of utomt. Russ. Mth. Surv. 16, 1 53 (1961) 3. Hrrison, M.A.: Introduction to Forml Lnguge Theory. Addison-Wesley, Boston (1978) 4. Holzer, M., Jkoi, S., Kutri, M.: Miniml reversile deterministic finite utomt. In: Potpov, I. (ed.) DLT LNCS, vol. 9168, pp Springer, Heidelerg (2015) 5. Kondcs, A., Wtrous, J.: On the power of quntum finite stte utomt. In: FOCS 1997, pp IEEE (1997) 6. Kutri, M.: Aspects of reversiility for clssicl utomt. In: Clude, C.S., Freivlds, R., Kzuo, I. (eds.) Grusk Festschrift. LNCS, vol. 8808, pp Springer, Heidelerg (2014) 7. Lnduer, R.: Irreversiility nd het genertion in the computing process. IBM J. Res. Dev. 3, (1961) 8. Meyer, A.R., Stockmeyer, L.J.: The equivlence prolem for regulr expressions with squring requires exponentil time. In: SWAT 1972, pp IEEE (1972) 9. Morit, K.: Reversile computing nd cellulr utomt survey. Theoret. Comput. Sci. 395(1), (2008) 10. Schultz, U.P., Lursen, J.S., Ellekilde, L., Axelsen, H.B.: Towrds domin-specific lnguge for reversile ssemly sequences. In: Krivine, J., Stefni, J.-B. (eds.) RC LNCS, vol. 9138, pp Springer, Switzerlnd (2015) 11. Yu, S., Zhung, Q., Slom, K.: The stte complexity of some sic opertions on regulr lnguges. Theoret. Comput. Sci. 125, (1994)

13

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

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

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

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

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

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

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

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

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

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

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

Fundamentals of Computer Science

Fundamentals of Computer Science Fundmentls of Computer Science Chpter 3: NFA nd DFA equivlence Regulr expressions Henrik Björklund Umeå University Jnury 23, 2014 NFA nd DFA equivlence As we shll see, it turns out tht NFA nd DFA re equivlent,

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

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

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

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

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

I F I G R e s e a r c h R e p o r t. Minimization, Characterizations, and Nondeterminism for Biautomata. IFIG Research Report 1301 April 2013

I F I G R e s e a r c h R e p o r t. Minimization, Characterizations, and Nondeterminism for Biautomata. IFIG Research Report 1301 April 2013 I F I G R e s e r c h R e p o r t Institut für Informtik Minimiztion, Chrcteriztions, nd Nondeterminism for Biutomt Mrkus Holzer Sestin Jkoi IFIG Reserch Report 1301 April 2013 Institut für Informtik JLU

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

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

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

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

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

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

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

CHAPTER 1 Regular Languages. Contents. definitions, examples, designing, regular operations. Non-deterministic Finite Automata (NFA)

CHAPTER 1 Regular Languages. Contents. definitions, examples, designing, regular operations. Non-deterministic Finite Automata (NFA) Finite Automt (FA or DFA) CHAPTER Regulr Lnguges Contents definitions, exmples, designing, regulr opertions Non-deterministic Finite Automt (NFA) definitions, equivlence of NFAs DFAs, closure under regulr

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

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

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

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

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

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

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

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

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

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

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

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

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

Nondeterministic Biautomata and Their Descriptional Complexity

Nondeterministic Biautomata and Their Descriptional Complexity Nondeterministic Biutomt nd Their Descriptionl Complexity Mrkus Holzer nd Sestin Jkoi Institut für Informtik Justus-Lieig-Universität Arndtstr. 2, 35392 Gießen, Germny 23. Theorietg Automten und Formle

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

80 CHAPTER 2. DFA S, NFA S, REGULAR LANGUAGES. 2.6 Finite State Automata With Output: Transducers

80 CHAPTER 2. DFA S, NFA S, REGULAR LANGUAGES. 2.6 Finite State Automata With Output: Transducers 80 CHAPTER 2. DFA S, NFA S, REGULAR LANGUAGES 2.6 Finite Stte Automt With Output: Trnsducers So fr, we hve only considered utomt tht recognize lnguges, i.e., utomt tht do not produce ny output on ny input

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

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

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

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

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

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 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

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

Regular Languages and Applications

Regular Languages and Applications Regulr Lnguges nd Applictions Yo-Su Hn Deprtment of Computer Science Yonsei University 1-1 SNU 4/14 Regulr Lnguges An old nd well-known topic in CS Kleene Theorem in 1959 FA (finite-stte utomton) constructions:

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

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

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

Regular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Kleene-*

Regular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Kleene-* Regulr Expressions (RE) Regulr Expressions (RE) Empty set F A RE denotes the empty set Opertion Nottion Lnguge UNIX Empty string A RE denotes the set {} Alterntion R +r L(r ) L(r ) r r Symol Alterntion

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

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

Myhill-Nerode Theorem

Myhill-Nerode Theorem Overview Myhill-Nerode Theorem Correspondence etween DA s nd MN reltions Cnonicl DA for L Computing cnonicl DFA Myhill-Nerode Theorem Deepk D Souz Deprtment of Computer Science nd Automtion Indin Institute

More information

Java II Finite Automata I

Java II Finite Automata I Jv II Finite Automt I Bernd Kiefer Bernd.Kiefer@dfki.de Deutsches Forschungszentrum für künstliche Intelligenz Finite Automt I p.1/13 Processing Regulr Expressions We lredy lerned out Jv s regulr expression

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

Non-deterministic Finite Automata

Non-deterministic Finite Automata Non-deterministic Finite Automt Eliminting non-determinism Rdoud University Nijmegen Non-deterministic Finite Automt H. Geuvers nd T. vn Lrhoven Institute for Computing nd Informtion Sciences Intelligent

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

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

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

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. Comparing DFAs and NFAs (cont.) Finite Automata 2

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. Comparing DFAs and NFAs (cont.) Finite Automata 2 CMSC 330: Orgniztion of Progrmming Lnguges Finite Automt 2 Types of Finite Automt Deterministic Finite Automt () Exctly one sequence of steps for ech string All exmples so fr Nondeterministic Finite Automt

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

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. NFA for (a b)*abb.

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. NFA for (a b)*abb. CMSC 330: Orgniztion of Progrmming Lnguges Finite Automt 2 Types of Finite Automt Deterministic Finite Automt () Exctly one sequence of steps for ech string All exmples so fr Nondeterministic Finite Automt

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

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

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

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

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

Non-deterministic Finite Automata

Non-deterministic Finite Automata Non-deterministic Finite Automt From Regulr Expressions to NFA- Eliminting non-determinism Rdoud University Nijmegen Non-deterministic Finite Automt H. Geuvers nd J. Rot Institute for Computing nd Informtion

More information

Some Theory of Computation Exercises Week 1

Some Theory of Computation Exercises Week 1 Some Theory of Computtion Exercises Week 1 Section 1 Deterministic Finite Automt Question 1.3 d d d d u q 1 q 2 q 3 q 4 q 5 d u u u u Question 1.4 Prt c - {w w hs even s nd one or two s} First we sk whether

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

CS375: Logic and Theory of Computing

CS375: Logic and Theory of Computing CS375: Logic nd Theory of Computing Fuhu (Frnk) Cheng Deprtment of Computer Science University of Kentucky 1 Tle of Contents: Week 1: Preliminries (set lger, reltions, functions) (red Chpters 1-4) Weeks

More information

CS 311 Homework 3 due 16:30, Thursday, 14 th October 2010

CS 311 Homework 3 due 16:30, Thursday, 14 th October 2010 CS 311 Homework 3 due 16:30, Thursdy, 14 th Octoer 2010 Homework must e sumitted on pper, in clss. Question 1. [15 pts.; 5 pts. ech] Drw stte digrms for NFAs recognizing the following lnguges:. L = {w

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

Non-Deterministic Finite Automata. Fall 2018 Costas Busch - RPI 1

Non-Deterministic Finite Automata. Fall 2018 Costas Busch - RPI 1 Non-Deterministic Finite Automt Fll 2018 Costs Busch - RPI 1 Nondeterministic Finite Automton (NFA) Alphbet ={} q q2 1 q 0 q 3 Fll 2018 Costs Busch - RPI 2 Nondeterministic Finite Automton (NFA) Alphbet

More information

GNFA GNFA GNFA GNFA GNFA

GNFA GNFA GNFA GNFA GNFA DFA RE NFA DFA -NFA REX GNFA Definition GNFA A generlize noneterministic finite utomton (GNFA) is grph whose eges re lele y regulr expressions, with unique strt stte with in-egree, n unique finl stte with

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

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

CS 275 Automata and Formal Language Theory

CS 275 Automata and Formal Language Theory CS 275 utomt nd Forml Lnguge Theory Course Notes Prt II: The Recognition Prolem (II) Chpter II.5.: Properties of Context Free Grmmrs (14) nton Setzer (Bsed on ook drft y J. V. Tucker nd K. Stephenson)

More information

Finite Automata. Informatics 2A: Lecture 3. Mary Cryan. 21 September School of Informatics University of Edinburgh

Finite Automata. Informatics 2A: Lecture 3. Mary Cryan. 21 September School of Informatics University of Edinburgh Finite Automt Informtics 2A: Lecture 3 Mry Cryn School of Informtics University of Edinburgh mcryn@inf.ed.c.uk 21 September 2018 1 / 30 Lnguges nd Automt Wht is lnguge? Finite utomt: recp Some forml definitions

More information

The size of subsequence automaton

The size of subsequence automaton Theoreticl Computer Science 4 (005) 79 84 www.elsevier.com/locte/tcs Note The size of susequence utomton Zdeněk Troníček,, Ayumi Shinohr,c Deprtment of Computer Science nd Engineering, FEE CTU in Prgue,

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

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

Centrum voor Wiskunde en Informatica REPORTRAPPORT. Supervisory control for nondeterministic systems

Centrum voor Wiskunde en Informatica REPORTRAPPORT. Supervisory control for nondeterministic systems Centrum voor Wiskunde en Informtic REPORTRAPPORT Supervisory control for nondeterministic systems A. Overkmp Deprtment of Opertions Reserch, Sttistics, nd System Theory BS-R9411 1994 Supervisory Control

More information

Worked out examples Finite Automata

Worked out examples Finite Automata Worked out exmples Finite Automt Exmple Design Finite Stte Automton which reds inry string nd ccepts only those tht end with. Since we re in the topic of Non Deterministic Finite Automt (NFA), we will

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

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

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

ɛ-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

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

Let's start with an example:

Let's start with an example: Finite Automt Let's strt with n exmple: Here you see leled circles tht re sttes, nd leled rrows tht re trnsitions. One of the sttes is mrked "strt". One of the sttes hs doule circle; this is terminl stte

More information

PART 2. REGULAR LANGUAGES, GRAMMARS AND AUTOMATA

PART 2. REGULAR LANGUAGES, GRAMMARS AND AUTOMATA PART 2. REGULAR LANGUAGES, GRAMMARS AND AUTOMATA RIGHT LINEAR LANGUAGES. Right Liner Grmmr: Rules of the form: A α B, A α A,B V N, α V T + Left Liner Grmmr: Rules of the form: A Bα, A α A,B V N, α V T

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

SWEN 224 Formal Foundations of Programming WITH ANSWERS

SWEN 224 Formal Foundations of Programming WITH ANSWERS T E W H A R E W Ā N A N G A O T E Ū P O K O O T E I K A A M Ā U I VUW V I C T O R I A UNIVERSITY OF WELLINGTON Time Allowed: 3 Hours EXAMINATIONS 2011 END-OF-YEAR SWEN 224 Forml Foundtions of Progrmming

More information

Formal Language and Automata Theory (CS21004)

Formal Language and Automata Theory (CS21004) Forml Lnguge nd Automt Forml Lnguge nd Automt Theory (CS21004) Khrgpur Khrgpur Khrgpur Forml Lnguge nd Automt Tle of Contents Forml Lnguge nd Automt Khrgpur 1 2 3 Khrgpur Forml Lnguge nd Automt Forml Lnguge

More information