arxiv: v1 [cs.fl] 13 Oct 2010

Size: px
Start display at page:

Download "arxiv: v1 [cs.fl] 13 Oct 2010"

Transcription

1 Regulr Expressions, u point Andre Asperti Deprtment of Computer Siene, University of Bologn Mur Anteo Zmoni 7, 40127, Bologn, ITALY sperti@s.unio.it Cludio Serdoti Coen Deprtment of Computer Siene, University of Bologn Mur Anteo Zmoni 7, 40127, Bologn, ITALY serdot@s.unio.it Enrio Tssi Mirosoft Reserh-INRIA Joint Center enrio.tssi@inri.fr rxiv: v1 [s.fl] 13 Ot 2010 Astrt We introdue new tehnique for onstruting finite stte deterministi utomton from regulr expression, sed on the ide of mrking suitle set of positions inside the expression, intuitively representing the possile points rehed fter the proessing of n initil prefix of the input string. Pointed regulr expressions join the elegne nd the symoli ppelingness of Brzozowski s derivtives, with the effetiveness of MNughton nd Ymd s lelling tehnique, essentilly omining the est of the two pprohes. F.1.1 [Models of Comput- Ctegories nd Sujet Desriptors tion] Generl Terms Regulr expressions, Finite Sttes Automt, Deriv- Keywords tives Theory 1. Introdution There is hrdly sujet in Theoretil Computer Siene tht, in view of its relevne nd elegne, hs een so thoroughly investigted s the notion of regulr expression nd its reltion with finite stte utomt (see e.g. [1, 2] for some reent surveys). All the studies in this re hve een trditionlly inspired y two preursory, silr works: Brzozowski s theory of derivtives [3], nd MNughton nd Ymd s lgorithm [4]. The min dvntges of derivtives re tht they re synttilly ppeling, esy to grsp nd to prove orret (see [5] for reent revisittion). On the other side, MNughton nd Ymd s pproh results in prtiulrly effiient lgorithm, still used y most pttern mthers like the populr grep nd egrep utilities. The reltion etween the two pprohes hs een deeply investigted too, strting from the seminl work y Berry nd Sethi [6] where it is shown how to refine Brzozowski s method to get to the effiient lgorithm (Berry nd Sethi lgorithm hs een further improved y lter uthors [7, 8]). Regulr expressions re suh smll world tht it is muh t no one s surprise tht ll different pprohes, t the end, turn out to e equivlent; still, their philosophy, their underlying intuition, nd the tehniques to e deployed n e sensily different. Without hving the pretension to sy nything relly originl on the sujet, we introdue in this pper notion of pointed regulr expression, tht provides hep pllitive for derivtives nd llows simple, diret nd effiient onstrution of the deterministi finite utomton. Remrkly, the forml orrespondene etween pointed expressions nd Brzozowski s derivtives is unexpetedly entngled (see Setion 4.1) testifying the novelty nd the not-so-trivil nture of the notion. The ide of pointed expressions ws suggested y n ttempt of formlizing the theory of regulr lnguges y mens of n intertive prover 1. At first, we strted onsidering derivtives, sine they looked more suitle to the kind of symoli mnipultions tht n e esily delt with y mens of these tools. However, the need to onsider sets of derivtives nd, espeilly, to reson modulo ssoitivity, ommuttivity nd idempotene of sum, prompted us to look for n lterntive notion. Now, it is ler tht, in some sense, the derivtive of regulr expression e is set of suexpressions of e 2 : the only, ruil, differene is tht we nnot forget their ontext. So, the nturl solution is to point t suexpressions inside the originl term. This immeditely leds to the notion of pointed regulr expression (pre), tht is just norml regulr expression where some positions (it is enough to onsider individul hrters) hve een pointed out. Intuitively, the points mrk the positions inside the regulr expression whih hve een rehed fter reding some prefix of the input string, or etter the positions where the proessing of the remining string hs to e strted. Eh pointed expression for e represents stte of the deterministi utomton ssoited with e; sine we oviously hve only finite numer of possile lellings, the numer of sttes of the utomton is finite. Pointed regulr expressions llow the diret onstrution of the DFA [9] ssoited with regulr expression, in wy tht is simple, intuitive, nd effiient (the tsk is trditionlly onsidered s very involved in the literture: see e.g [1], pg.71). In the imposing iliogrphy on regulr expressions - s fr s we ould disover - the only uthor mentioning notion lose to ours is Wtson [10, 11]. However, he only dels with single points, while the most interesting properties of pre derive y their impliit dditive nture (suh s the possiility to ompute the move opertion y single pss on the mrked expression: see definition 21). [Copyright notie will pper here one preprint option is removed.] 1 The rule of the gme ws to void overkilling, i.e. not mke it more omplex thn deserved. 2 This is lso the reson why, t the end, we only hve finite numer of derivtives. short desription of pper /3/18

2 2. Regulr expressions DEFINITION 1. A regulr expression over the lphet Σ is n expression e generted y the following grmmr: with Σ E ::= ɛ E + E EE E DEFINITION 2. The lnguge L(e) ssoited with the regulr expression e is defined y the following rules: L( ) = L(ɛ) = {ɛ} L() = {} L(e 1 + e 2) = L(e 1) L(e 2) L(e 1e 2) = L(e 1) L(e 2) L(e ) = L(e) where ɛ is the empty string, L 1 L 2 = { l 1l 2 l 1 L 1, l 2 L 2} is the ontention of L 1 nd L 2 nd L is the so lled Kleene s losure of L: L = i=0 Li, with L 0 = ɛ nd L i+1 = L L i. DEFINITION 3 (nullle). A regulr expression e is sid to e nullle if ɛ L(e). The ft of eing nullle is deidle; it is esy to prove tht the hrteristi funtion ν(e) n e omputed y the following rules: ν( ) = flse ν(ɛ) = true ν() = flse ν(e 1 + e 2) = ν(e 1) ν(e 2) ν(e 1e 2) = ν(e 1) ν(e 2) ν(e ) = true DEFINITION 4. A deterministi finite utomton (DFA) is quintuple (Q, Σ, q 0, t, F ) where Q is finite set of sttes; Σ is the input lphet; q 0 Q is the initil stte; t : Q Σ Q is the stte trnsition funtion; F Q is the set of finl sttes. The trnsition funtion t is extended to strings in the following wy: DEFINITION 5. Given funtion t : Q Σ Q, the funtion t : Q Σ Q is defined s follows: { t t(q, ɛ) = q (q, w) = t(q, w ) = t (t(q, ), w ) DEFINITION 6. Let A = (Q, Σ, q 0, t, F ) e DFA; the lnguge reognized A is defined s follows: L(A) = {w t (q 0, w) F } 3. Pointed regulr expressions DEFINITION A pointed item over the lphet Σ is n expression e generted y following grmmr: E ::= ɛ E + E EE E with Σ; 2. A pointed regulr expression (pre) is pir e, where is oolen nd e is pointed item. The term is used to point to position inside the regulr expression, preeding the given ourrene of. In pointed regulr expression, the oolen must e intuitively understood s the possiility to hve triling point t the end of the expression. DEFINITION 8. The rrier e of n item e is the regulr expression otined from e y removing ll the points. Similrly, the rrier of pointed regulr expression is the rrier of its item. In the sequel, we shll often use the sme nottion for funtions defined over items or pres, leving to the reder the simple dismigution tsk. Moreover, we use the nottion ɛ(), where is oolen, with the following mening: DEFINITION 9. ɛ(true) = {ɛ} ɛ(flse) = 1. The lnguge L p(e) ssoited with the item e is defined y the following rules: L p( ) = L p(ɛ) = L p() = L p( ) = {} L p(e 1 + e 2) = L p(e 1) L p(e 2) L p(e 1e 2) = L p(e 1) L( e 2 ) L p(e 2) L p(e ) = L p(e) L( e ) 2. For pointed regulr expression e, we define EXAMPLE 10. Indeed, L p( e, ) = L p(e) ɛ() L p(( + ) ) = L(( + ) ) L p(( + ) ) = = L p( + ) L( + ) = (L p() L p( )) L(( + ) ) = {} L(( + ) ) = L(( + ) ) Let us inidentlly oserve tht, s shown y the previous exmple, pointed regulr expressions n provide more ompt syntx for denoting lnguges thn trditionl regulr expressions. This my hve importnt pplitions to the investigtion of the desriptionl omplexity (suintness) of regulr lnguges (see e.g. [12, 13, 14]). EXAMPLE 11. If e ontins no point (i.e. e = e ) then L p(e) = LEMMA 12. If e is pointed item then ɛ L p(e). Hene, ɛ L p( e, ) if nd only if = true. Proof. A trivil struturl indution on e. 3.1 Brodsting points Intuitively, regulr expression e must e understood s pointed expression with single point in front of it. Sine however we only llow points over symols, we must rodst this initil point inside the expression, tht essentilly orresponds to the ɛ-losure opertion on utomt. We use the nottion ( ) to denote suh n opertion. The rodsting opertor is lso required to lift the item onstrutors (hoie, ontention nd Kleene s str) from items to pres: for exmple, to ontente pre e 1, true with nother pre e 2, 2, we must first rodst the triling point of the first expression inside e 2 nd then pre-pend e 1; similrly for the str opertion. We ould define first the rodsting funtion ( ) nd then the lifted onstrutors; however, oth the definition nd the theory of the rodsting funtion re simplified y mking it o-reursive with the lifted onstrutors. short desription of pper /3/18

3 DEFINITION The funtion ( ) from pointed item to pres is defined s follows: ( ) =, flse (ɛ) = ɛ, true () =, flse ( ) =, flse (e 1 + e 2) = (e 1) (e 2) (e 1e 2) = (e 1) e 2, flse (e ) = e, true where (e) = e, 2. The lifted onstrutors re defined s follows e 1, 1 e 2, 2 = e 1 + e 2, 1 2 e 1e 2, 2 when 1 = flse e 1, 1 e 2, 2 = e 1e 2, 2 2 when 1 = true nd (e 2) = e 2, e, flse when = flse e, = e, true when = true nd (e ) = e, The pprent omplexity of the previous definition should not hide the extreme simpliity of the rodsting opertion: on sum we proeed in prllel; on ontention e 1e 2, we first work on e 1 nd in se we reh its end we pursue rodsting inside e 2; in se of e we rodst the point inside e relling tht we shll eventully hve triling point. EXAMPLE 14. Suppose to rodst point inside ( + ɛ)( + ) We strt working in prllel on the first ourrene of (where the point stops), nd on ɛ tht gets trversed. We hve hene rehed the end of +ɛ nd we must pursue rodsting inside ( +). Agin, we work in prllel on the two dditive suterms nd ; the first point is llowed to oth enter the str, nd to trverse it, stopping in front of ; the seond point just stops in front of. No point rehed tht end of + hene no further propgtion is possile. In onlusion: (( + ɛ)( + )) = ( + ɛ)(( ) + ) DEFINITION 15. The rodsting funtion is extended to pres in the ovious wy: ( e, ) = e, where (e) = e, As we shll prove in Corollry 18, rodsting n initil point my reh the end of n expression e if nd only if e is nullle. The following theorem hrterizes the rodsting funtion nd lso shows tht the semntis of the lifted onstrutors on pres is oherent with the orresponding onstrutors on items. THEOREM L p( e) = L p(e) L( e ). 2. L p(e 1 e 2) = L p(e 1) L p(e 2) 3. L p(e 1 e 2) = L p(e 1) L( e 2 ) L p(e 2) 4. L p(e ) = L p(e) L( e ) We do first the proof of 2., followed y the simultneous proof of 1. nd 3., nd we onlude with the proof of 4. 2 Proof.[of 2.] We need to prove L p(e 1 e 2) = L p(e 1) L p(e 2). L p( e 1, 1 e 2, 2 ) = = L p( e 1 + e 2, 1 2 ) = L p(e 1 + e 2) ɛ( 1) ɛ( 2) = L p(e 1) ɛ( 1) L p(e 2) ɛ( 2) = L p(e 1) L p(e 2) Proof.[of 1. nd 3.] We prove 1. (L p( e) = L p(e) L( e )) y indution on the struture of e, ssuming tht 3. holds on terms struturlly smller thn e. L p( ( )) = L p(, flse ) = = L p( ) L( ). L p( (ɛ)) = L p( ɛ, true ) = {ɛ} = L p(ɛ) L p( ɛ ). L p( ()) = L p(, flse ) = {} = L p() L( ). L p( ( )) = L p(, flse ) = {} = L p( ) L( ). Let e = e 1 + e 2. By indution hypothesis we know tht Thus, y 2., we hve L p( (e i)) = L p(e i) L( e i ) L p( (e 1 + e 2)) = = L p( (e 1) (e 2)) = L p( (e 1)) L p( (e 2)) = L p(e 1) L( e 1 ) L p(e 2) L( e 2 ) = L p(e 1 + e 2) L( e 1 + e 2 ) Let e = e 1e 2. By indution hypothesis we know tht L p( (e i)) = L p(e i) L( e i ) Thus, y 3. over the struturlly smller terms e 1 nd e 2 L p( (e 1e 2)) = = L p( (e 1) e 2, flse ) = L p( (e 1)) L( e 2 ) L p(e 2) = (L p(e 1) L( e 1 )) L( e 2 ) L p(e 2) = L p(e 1) L( e 2 ) L( e 1 ) L( e 2 ) L p(e 2) = L p(e 1e 2) L( e 1e 2 ) Let e = e 1. By indution hypothesis we know tht L p( (e 1)) = L p(e 1) ɛ( 1) = L p(e 1) L( e 1 ) nd in prtiulr, sine y Lemm 12 ɛ L p(e 1), Then, L p(e 1) = L p(e 1) (L( e 1 ) \ ɛ( 1)) L p( (e 1)) = = L p( e 1, true ) = L p(e 1 ) ɛ = L p(e 1)L( e 1 ) ɛ = (L p(e 1) (L( e 1 ) \ ɛ( 1)))L( e 1 ) ɛ = L p(e 1)L( e 1 ) (L( e 1 ) \ ɛ( 1))L( e 1 ) ɛ = L p(e 1)L( e 1 ) L( e 1 ) = L p(e 1) L( e 1 ) Hving proved 1. for e ssuming tht 3. holds on terms struturlly smller thn e, we now ssume tht 1. holds for e 1 nd e 2 in order to prove 3.: L p(e 1 e 2) = L p(e 1) L( e 2 ) L p(e 2) We distinguish the two ses of the definition of : short desription of pper /3/18

4 L p( e 1, flse e 2, 2 ) = = L p( e 1e 2, 2 ) = L p(e 1e 2) ɛ( 2) = L p(e 1) L( e 2 ) L p(e 2) ɛ( 2) = L p(e 1) L( e 2 ) L p(e 2) L p( e 1, true e 2, 2 ) = = L p( e 1e 2, 2 2 ) = L p(e 1e 2 ) ɛ( 2) ɛ( 2 ) = L p(e 1) L( e 2 ) L p(e 2 ) ɛ( 2) ɛ( 2 ) = L p(e 1) L( e 2 ) L p(e 2) L( e 2 ) ɛ( 2) = (L p(e 1) ɛ(true)) L( e 2 ) L p(e 2) ɛ( 2) = L p(e 1) L( e 2 ) L p(e 2) Proof.[of 4.] We need to prove L p(e ) = L p(e) L( e ). We distinguish the two ses of the definition of : L p( e, flse ) = = L p( e, flse ) = L p(e ) = L p(e ) L( e ) = (L p(e ) ɛ(flse)) L( e ) = L p(e) L( e ) L p( e, true ) = = L p( e, true ) ɛ = L p(e ) ɛ = L p(e ) L( e ) ɛ = (L p(e ) L( e )) L( e ) ɛ = L p(e ) L( e ) L( e ) L( e ) ɛ = L p(e ) L( e ) L( e ) = (L p(e ) ɛ(true)) L( e ) = L p(e) L( e ) COROLLARY 17. For ny regulr expression e, L(e) = L p( e). Another importnt orollry is tht n initil point rehes the end of (pointed) expression e if nd only if e is le to generte the empty string. COROLLARY 18. e = e, true if nd only if ɛ L( e ). Proof. By theorem 16 we know tht L p( e) = L p(e) L( e ). So, if ɛ L p( e), sine y Lemm 12 ɛ L p(e), it must e ɛ L( e ). Conversely, if ɛ L( e ) then ɛ L p( e); if e = e,, this is possile only provided = true. To onlude this setion, let us prove the idempotene of the ( ) funtion (it will only e used in Setion 5, nd n e skipped t first reding). To this im we need tehnil lemm whose strightforwrd proof y se nlysis is omitted. LEMMA (e 1 e 2) = (e 1) (e 2) 2. (e 1 e 2) = (e 1) e 2 THEOREM 20. ( (e)) = (e) Proof. The proof is y indution on e. ( ( )) = (, flse ) =, flse flse = ( ) ( (ɛ)) = ( ɛ, true ) = ɛ, true true = (ɛ) ( ()) = (, flse ) =, flse flse = () ( ( )) = (, flse ) =, flse flse = ( ) If e is e 1 + e 2 then ( (e 1 + e 2)) = ( (e 1) (e 2)) = ( (e 1)) ( (e 2)) = = (e 1) (e 2) = (e 1 + e 2) If e is e 1e 2 then ( (e 1e 2)) = ( (e 1) e 2, flse ) ( (e 1)) e 2, flse = = (e 1) e 2, flse = (e 1e 2) If e is e 1, let (e 1) = e, nd let (e ) = e,. By indution hypothesis, e, = (e 1) = ( (e 1)) = ( e, ) = e, nd thus e = e. Finlly ( (e 1)) = ( e, true ) = e, true = e, true = = (e 1) 3.2 The move opertion We now define the move opertion, tht orresponds to the dvnement of the stte in response to the proessing of n input hrter. The intuition is ler: we hve to look t points inside e preeding the given hrter, let the point trverse the hrter, nd rodst it. All other points must e removed. DEFINITION The funtion move(e, ) tking in input pointed item e, hrter Σ nd giving k pointer regulr expression is defined s follow, y indution on the struture of e: move(, ) =, flse move(ɛ, ) = ɛ, flse move(, ) =, flse move(, ) =, true move(, ) =, flse if move(e 1 + e 2, ) = move(e 1, ) move(e 2, ) move(e 1e 2, ) = move(e 1, ) move(e 2, ) move(e, ) = move(e, ) 2. The move funtion is extended to pres y just ignoring the triling point: move( e,, ) = move(e, ) EXAMPLE 22. Let us onsider the pre ( + ɛ)(( ) + ) nd the two moves w.r.t. the hrters nd. For, we hve two possile positions (ll other points gets ersed); the innermost point stops in front of the finl, the other one rodst inside ( + ), so move(( +ɛ)(( ) + ), ) = (+ɛ)(( ) + ), flse For, we hve two positions too. The innermost point still stops in front of the finl, while the other point rehes the end of nd must go k through : move(( +ɛ)(( ) + ), ) = (+ɛ)(( ) +), flse THEOREM 23. For ny pointed regulr expression e nd string w, w L p(move(e, )) w L p(e) Proof. The proof is y indution on the struture of e. if e is tomi, nd e is not pointed symol, then oth L p(move(e, )) nd L p(e) re empty, nd hene oth sides re flse for ny w; if e = then L p(move(, )) = L p(, true ) = {ɛ} nd L p( ) = {}; if e = with then L p(move(, )) = L p(, flse ) = nd L p( ) = {}; hene for ny string w, oth sides re flse; if e = e 1+e 2 y indution hypothesis w L p(move(e i, )) w L p(e i), hene, short desription of pper /3/18

5 w L p(move(e 1 + e 2, )) w L p(move(e 1, ) move(e 2, )) w L p(move(e 1, )) L p(move(e 2, )) (w L p(move(e 1, ))) (w L p(move(e 2, ))) (w L p(e 1)) (w L p(e 2)) w L p(e 1) L p(e 2) w L p(e 1 + e 2) suppose e = e 1e 2, y indution hypothesis w L p(move(e i, )) w L p(e i), hene, w L p(move(e 1e 2, )) w L p(move(e 1, ) move(e 2, )) w L p(move(e 1, )) L e 2 L p(move(e 2, )) w L p(move(e 1, )) L e 2 w L p(move(e 2, )) ( w 1, w 2, w = w 1w 2 w 1 L p(move(e 1, )) w 2 L( e 2 )) w L p(move(e 2, )) ( w 1, w 2, w = w 1w 2 w 1 L p(e) w 2 L( e 2 )) w L p(e 2) (w L p(e 1) L e 2 ) (w L p(e 2)) w L p(e 1) L e 2 L p(e 2) w L p(e 1e 2) suppose e = e 1, y indution hypothesis w L p(move(e 1, )) w L p(e 1), hene, w L p(move(e 1, )) w L p(move(e 1, )) w L p(move(e 1, )) L( move(e 1, ) ) w 1, w 2, w = w 1w 2 w 1 L p(move(e 1, )) w 2 L( e 1 ) w 1, w 2, w = w 1w 2 w 1 L p(e 1) w 2 L( e 1 ) w L p(e 1) L( e 1 ) w L p(e 1) We extend the move opertions to strings s usul. DEFINITION 24. move (e, ɛ) = e move (e, w) = move (move(e, ), w) THEOREM 25. For ny pointed regulr expression e nd ll strings α, β, β L p(move (e, α)) αβ L p(e) Proof. A trivil indution on the length of α, using theorem 23. COROLLARY 26. For ny pointed regulr expression e nd ny string α, α L p(e) e, L p(move (e, α)) = e, true Proof. By Theorems 25 nd Lemm From regulr expressions to DFAs DEFINITION 27. To ny regulr expression e we my ssoite DFA D e = (Q, Σ, q 0, t, F ) defined in the following wy: Q is the set of ll possile pointed expressions hving e s rrier; Σ is the lphet of the regulr expression q 0 is e; t is the move opertion of definition 21; F is the suset of pointed expressions e, with = true. THEOREM 28. Proof. By definition, L(D e) = L(e) w L(D e) move ( (e), w) = e, true for some e. By the previous theorem, this is possile if n only if w L p( (e)), nd y orollry 17, L p( (e)) = L(e). REMARK 29. The ft tht the set Q of sttes of D e is finite is ovious: its rdinlity is t most 2 n+1 where n is the numer of symols in e. This is one of the dvntges of pointed regulr expressions w.r.t. derivtives, whose finite nture only holds fter suitle quotient, nd is reltively omplex property to prove (see [3]). The utomton D e just defined my hve mny inessile sttes. We n provide nother lgorithmi nd diret onstrution tht yields the sme utomton restrited to the essile sttes only. DEFINITION 30. Let e e regulr expression nd let q 0 e e. Let lso Q 0 := {q 0} Q n+1 := Q n {e e Q n. e Q n.move(e, ) = e } Sine every Q n is suset of the finite set of pointed regulr expressions, there is n m suh tht Q m+1 = Q m. We ssoite to e the DFA D e = (Q m, Σ, q 0, F, t) where F nd t re defined s for the previous onstrution. 4 ( + ε)( * + ) 7 2 ( + ε)( * + ) 1 ( + ε)( * + ) ( ε * + )( + ) ( + ε)( * + ) ( + ε)( * + ) 9 ( + ε)( * + ) Figure 1. DFA for ( + ɛ)( + ) ( + ε)( * + ) 8 ( + ε)( * + ) In Figure 1 we desrie the DFA ssoited with the regulr expression ( + ɛ)( + ). The grphil desription of the utomton is the trditionl one, with nodes for sttes nd lelled rs for trnsitions. Unrehle sttes re not shown. Finl sttes re emphsized y doule irle: sine stte e, is finl if nd only if is true, we my just lel nodes with the item (for instne, the pir of sttes 6 8 nd 7 9 only differ for the ft tht 6 nd 7 re finl, while 8 nd 9 re not). 3.4 Admissile reltions nd minimiztion The utomton in Figure 1 is miniml. This is not lwys the se. For instne, for the expression (+) we otin the utomton of Figure 2, nd it is esy to see tht the two sttes orresponding to the pres ( + ) nd ( + ) re equivlent ( wy to prove it is to oserve tht they define the sme lnguge). The ltter remrk, motivtes the following definition. short desription of pper /3/18

6 ( ) * ( 11 + ) 00 ( ) * * Figure 2. DFA for ( + ) ( + ) * The set of dmissile equivlene reltions over e is ounded lttie, ordered y refinement, whose ottom element is syntti identity nd whose top element is e 1 e 2 iff L(e 1) = L(e 2). Moreover, if 1< 2 (the first reltion is strit refinement of the seond one), the numer of sttes of D e/ 1 is stritly lrger thn the numer of sttes of D e/ 2. THEOREM 36. If is the top element of the lttie, thn D e/ is the miniml utomton tht reognizes L(e). DEFINITION 31. An equivlene reltion over pres hving the sme rrier is dmissile when for ll e 1 nd e 2 if e 1 e 2 then L p(e 1) = L p(e 2) if e 1 e 2 then for ll move(e 1, ) move(e 2, ) DEFINITION 32. To ny regulr expression e nd dmissile equivlene reltion over pres over e, we n diretly ssoite the DFA D e/ = (Q/, Σ, [q 0], move /, F/ ) where move / is the move opertion lifted to equivlene lsses thnks to the seond dmissiility ondition. In ple of working with equivlene lsses, for formliztion nd implementtion purposes it is simpler to work on representtive of equivlene lsses. Insted of hoosing priori representtive of eh equivlene lss, we n slightly modify the lgorithmi onstrution of definition 30 so tht it dynmilly identifies the representtive of the equivlene lsses. It is suffiient to red eh element of Q n s representtive of its equivlene lss nd to hnge the test e Q n so tht the new stte e is ompred to the representtives in Q n up to : DEFINITION 33. In definition 30 hnge the definition of Q n+1 s follows: Q n+1 := Q n {e. e Q n.move(e, ) = e e Q n.e e } The trnsition funtion t is defined s t(e, ) = e where move(e, ) = e nd e is the unique stte of Q m suh tht e e. In n tul implementtion, the trnsition funtion t is omputed together with the sets Q n t no dditionl ost. THEOREM 34. Repling eh stte e of the utomton of definition 33 with [e]/, we otin the restrition of the utomton of definition 32 to the essile sttes. We still need to prove tht quotienting over does not hnge the lnguge reognized y the utomton. THEOREM 35. L(D e/ ) = L(e) Proof. By theorem 28, it is suffiient to prove L(D e) = L(D e/ ) or, equivlently, tht for ll w, move / ([q 0]/, w) F/ move (q 0, w) F. We show this to hold y proving y indution over w tht for ll q [move (q, w)]/ = move / ([q]/, w) Bse se: move / ([q]/, ɛ) = [q]/ = [move (q, ɛ)]/ Indutive step: y ondition (2) of dmissiility, for ll q 1 [q 0]/, we hve move(q 1, ) move(q 0, ) nd thus move/ ([q 0]/, ) = [move(q 0, )]/ Hene move / ([q 0]/, w) = = move / (move/ ([q 0]/, ), w) = move / ([move(q 0, )]/, w) = [move (move(q 0, ), w)]/ = [move (q 0, w)]/ Proof. By the previous theorem, D e/ reognizes L(e) nd hs no unrehle sttes. By surd, let D = (Q, Σ, q 0, t, F ) e nother smller utomton tht reognizes L(e). Sine the two utomt re different, reognize the sme lnguges nd hve no unrehle sttes, there exists two words w 1, w 2 suh t (q 0, w 1) = t (q 0, w 2) ut [e 1]/ = move / ([q 0]/, w 1) move / ([q 0]/, w 2) = [e 2]/ where e 1 nd e 2 re ny two representtives of their equivlene lsses nd thus e 1 e 2. By definition of, L p(e 1) L p(e 2). Without loss of generlity, let w 3 L p(e 1) \ L p(e 2). We hve w 1w 3 L(e) nd w 2w 3 L(e) euse D e/ reognizes L(e), whih is surd sine t (q 0, w 1w 3) = t (q 0, w 2w 3) nd D lso reognizes L(e). The previous theorem tells us tht it is possile to ssoite to eh stte of n utomton for e (nd in prtiulr to the miniml utomton) pre e over e so tht the lnguge reognized y the utomton in the stte e is L p(e ), tht provides very suggestive lelling of sttes. The hrteriztion of the miniml utomton we just gve does not seem to entil n originl lgorithmi onstrution, sine does not suggest ny new effetive wy for omputing. However, similrly to wht hs een done for derivtives (where we hve similr prolems), it is interesting to investigte dmissile reltions tht re esier to ompute nd tend to produe smll utomt in most prtil ses. In prtiulr, in the next setion, we shll investigte one importnt reltion providing ommon quotient etween the utomt uilt with pres nd with Brzozowski s derivtives. 4. Red k Intuitively, pointed regulr expression orresponds to set of regulr expressions. In this setion we shll formlly investigte this red k funtion; this will llow us to estlish more syntti reltion etween trditionl regulr expressions nd their pointed version, nd to ompre our tehnique for uilding DFA with tht sed on derivtives. In the following setions we shll frequently del with sets of regulr expressions (to e understood dditively), tht we prefer to the tretment of regulr expressions up to ssoitivity, ommuttivity nd idempotene of the sum (ACI) tht is for instne typil of the trditionl theory of derivtives (this lso lrifies tht ACIrewriting is only used t the top level). It is hene useful to extend some syntti opertions, nd espeilly ontention, to sets of regulr expressions, with the usul distriutive mening: if e is regulr expression nd S is set of regulr expressions, then Se = {e e e S} We define es nd S 1S 2 in similr wy. Moreover, every funtion on regulr expressions is impliitly lifted to sets of regulr expressions y tking its imge. For exmple, L(S) = e S L(e) short desription of pper /3/18

7 DEFINITION 37. We ssoite to eh item e set of regulr expressions R(e) defined y the following rules: R( ) = R(ɛ) = R() = R( ) = {} R(e 1 + e 2) = R(e 1) R(e 2) R(e 1e 2) = R(e 1) e 2 R(e 2) R(e ) = R(e) e R is extended to pointed regulr expression e, s follows R( e, ) = R(e) ɛ() Note tht, for ny item e, no regulr expression in R(e) is nullle. EXAMPLE 38. Sine (( + ɛ) ) = ( + ɛ)( ), true we hve R( (( + ɛ) )) = {,, ɛ} The prllel etween the syntti red-k funtion R nd the semntis L p of definition 9 is ler y inspetion of the rules. Hene the following lemm n e proved y trivil indution over e. LEMMA 39. L(R(e)) = L p(e) COROLLARY 40. For ny regulr expression e, L(R( (e))) = L(e) The previous orollry sttes tht R nd ( ) re semntilly inverse funtions. Synttilly, they ssoite to eh expression e n interesting look-hed norml form, onstituted (up to ssoitivity of ontention) y set of expressions of the kind e (plus ɛ if e is nullle), where e is derivtive of e w.r.t. (lthough synttilly different from Brzozowski s derivtives, defined in the next setion). This look-hed norml form (nf ) hs n interest in its own, nd n e simply defined y struturl indution over e. DEFINITION 41. nf ( ) = nf (ɛ) = nf () = {} nf (e 1 + e 2) = nf (e 1) nf (e 2) nf (e 1e 2) = nf (e 1)e 2 if ν(e 1) = flse nf (e 1e 2) = nf (e 1)e 2 nf (e 2) if ν(e 1) = true nf (e ) = nf (e)e REMARK 42. It is esy to prove tht, for eh e, the set nf (e) is mde, up to ssoitivity of ontention, only of expressions of the form or e. In prtiulr no expression in nf (e) is nullle! The previous remrk motivtes the following definition. DEFINITION 43. nf ɛ (e) = nf (e) ɛ(ν( e )) The min properties of nf ɛ re expressed y the following two lemms, whose simple proof is left to the reder. LEMMA 44. nf ɛ ( ) = nf ɛ (ɛ) = {ɛ} nf ɛ () = {} nf ɛ (e 1 + e 2) = nf ɛ (e 1) nf ɛ (e 2) nf ɛ (e 1e 2) = nf ɛ (e 1)e 2 if ν(e 1) = flse nf ɛ (e 1e 2) = nf (e 1)e 2 nf ɛ (e 2) if ν(e 1) = true nf ɛ (e ) = nf (e)e ɛ(ν(e)) THEOREM 45. L(e) = L(nf ɛ (e)) THEOREM 46. For ny pointed regulr expression e, R( (e)) = nf ɛ ( e ) R(e) Proof. Let (e) = e, ; then ɛ R( (e)) iff = true, iff ν( e ) = true. Hene the gol redues to prove tht R(e ) = nf e R(e). We proeed y indution on the struture of e. e =, ( ) =, flse nd R( ) = = nf ( ) e = ɛ, (ɛ) = ɛ, true nd R(ɛ) = = nf (ɛ) e = : ( ()) =, flse nd R( ) = {} = nf () e = : ( ( )) =, flse nd R( ) = {} = nf () = nf ( ) = nf ( ) R( ) e = e 1 + e 2: let (e 1 + e 2) = e 1 + e 2, ; then R(e 1 + e 2) = = R(e 1) R(e 2) = nf ( e 1 ) R(e 1) nf ( e 2 ) R(e 2) = nf e 1 + e 2 R(e 1 + e 2) e = e 1e 2. Let (e i) = e i, i. If 1 = flse then (e 1e 2) = e ie 2, flse ; moreover we know tht e 1 is not nullle. We hve then: R(e 1e 2) = = R(e 1) e 2 R(e 2) = (nf ( e 1 ) R(e 1)) e 2 R(e 2) = (nf ( e 1 ) e 2 R(e 1) e 2 R(e 2) = nf ( e 1e 2 ) R(e 1e 2) If 1 = true then (e 1e 2) = e ie 2, 2 ; moreover we know tht e 1 is nullle. R(e 1e 2) = = R(e 1) e 2 R(e 2) = (nf ( e 1 R(e 1)) e 2 nf ( e 2 )) R(e 2) = nf ( e 1 ) e 2 nf (e 2) R(e 1) e 2 R(e 2) = (nf ( e 1e 2 )) R(e 1e 2) e = e 1. Let (e 1) = e i, i ; then (e 1) = e i, true ; R(e 1 ) = = R(e 1) e 1 = (nf (e 1) R(e 1)) e 1 = nf (e 1) e 1 R(e 1)) e 1 = nf (e 1) R(e 1) COROLLARY 47. For ll regulr expression e, R( (e)) = nf ɛ (e) To onlude this setion, in nlogy with wht we did for the semnti funtion in Theorem 16, we express the ehviour of R in terms of the lifted lgeri onstrutors. This will e useful in Theorem 51. LEMMA R(e 1 e 2) = R(e 1) R(e 2) 2. R( e 1, flse e 2) = R(e 1) e 2 R(e 2) 3. R( e 1, true e 2) = R(e 1) e 2 nf ɛ ( e 2 ) R(e 2) 4. R( e 1, flse ) = R(e 1) e 1 5. R( e 1, true ) = R(e 1) e 1 nf ɛ ( e 1 ) Proof. Let e i = e i, i : 1. R(e 1 e 2) = = R( e 1, 1 lnglee 2, 2 ) = = R( e 1 + e 2, 1 2 ) = R(e 1 + e 2) ɛ( 1 2) = R(e 1) R(e 2) ɛ( 1) ɛ( 2) = R(e 1) ɛ( 1) R(e 2) ɛ( 2) = R(e 1) R(e 2) short desription of pper /3/18

8 2. R( e 1, flse e 2, 2 ) = = R( e 1e 2, 2 ) = R(e 1) e 2 R(e 2) ɛ( 2) = R(e 1) e 2 R(e 2) 3. let (e 2) = e 2, 2 R( e 1, true e 2, 2 ) = = R( e 1e 2, 2 2 ) = R(e 1) e 2 R(e 2 ) ɛ( 2 ) ɛ( 2) = R(e 1) e 2 R( (e 2)) ɛ( 2) = (R(e 1) e 2 nf( e 2 ) R(e 2) ɛ( 2) = R(e 1) e 2 nf( e 2 ) R(e 2) 4. R( e 1, flse ) = R( e 1, flse ) = R(e 1 ) = R(e 1) e 1 5. let (e 1) = e 1, 1 ; then R( (e 1)) = R(e 1 ) ɛ( 1 ) = nf ɛ ( e 1 ) R(e 1), nd R(e 1 ) = nf ( e 1 ) R(e 1). R( e 1, true ) = = R( e 1, true ) = R(e 1 ) e 1 ɛ(true) = (R(e 1) dnf( e 1 )) e 1 ɛ(true) = R(e 1) e 1 dnf( e 1 ) e 1 ɛ(true) = R(e 1) e 1 nf( e 1 ) 4.1 Reltion with Brzozowski s Derivtives We re now redy to formlly investigte the reltion etween pointed expressions nd Brzozowski s derivtives. As we shll see, they give rise to quite different onstrutions nd the reltion is less ovious thn expeted. Let s strt with relling the forml definition. DEFINITION 49. DEFINITION 50. ( ) = (ɛ) = () = ɛ () = (e 1 + e 2) = (e 1) + (e 2) (e 1e 2) = (e 1)e 2 if not ν(e 1) (e 1e 2) = (e 1)e 2 + (e 2) if ν(e 1) (e ) = (e)e ɛ(e) = e w(e) = w( (e)) In generl, given regulr expression e over the lphet Σ, the set { w(e) w Σ } of ll its derivtives is not finite. In order to get finite set we must suitly quotient derivtives ording to lgeri equlities etween regulr expressions. The hoie of different set of equtions gives rise to different quotients, nd hene to different utomt. Sine for finiteness it is enough to onsider ssoitivity, ommuttivity nd idempotene of the sum (ACI), the trditionl theory of Brzozowski s derivtives is defined ording to these lws (lthough this is proly not the est hoie from prtil point of view). As prtil exmple, in Figure 3 we desrie the utomt otined using derivtives reltive to the expression ( + ) (ompre it with the utomt of Figure 2). Also, note tht the vertilly ligned sttes re equivlent. Let us remrk, first of ll, the hevy use of ACI. For instne while (( + ) ) = (ɛ + )( + ) (( + ) ) = ( + ɛ)( + ) ( + )* ( + ε )( + )* ( + )( + )* + ( + ε )( + )* ( ε + )( + )* ( + )* ( + )( + )* + ( + )( + )* + ( ε + )( + )* ( + )* Figure 3. Automton with Brzozowski s derivtives nd they n e ssimilted only up to ommuttivity of the sum. As nother exmple, (( + )( + ) + ( + ɛ)( + ) ) = = ( + )( + ) + (( + )( + ) + (ɛ + )( + ) ) nd the ltter expression n e redue to ( + )( + ) + (ɛ + )( + ) ) only using ssoitivity nd idempotene of the sum. The seond importnt remrk is tht, in generl, it is not true tht we my otin the pre-utomt y quotienting the derivtive one (nor the other wy round). For instne, from the initil stte, the two rs lelled nd led to single stte in the utomt of Figure 3, ut in different sttes in the utomt of Figure 2. A nturl question is hene to understnd if there exists ommon lgeri quotient etween the two onstrutions (not exploiting minimiztion). As we shll see, this n e hieved y identifying sttes with sme redk in the se of pres, nd sttes with similr lookhed norml form in the se of derivtives. For instne, in the se of the two utomt of Figures 2 nd 3, we would otin the ommon quotient of Figure 4. { ( + )*, ( + )*, ε} { ( + )*} { } Figure 4. A quotient of the two utomtons The generl piture is desried y the ommuting digrm of Figure 5, whose proof will e the ojet of the next setion (in Figure 5, w oviously stnds for the string 1... n). 4.2 Forml proof of the ommuting digrm in Figure 5 Prt of the digrm hs een lredy proved: the leftmost tringle, used to relte the initil stte of the two utomt, is Corollry 47; the two tringles t the right, used to relte the finl sttes, just sttes the trivil properties tht ɛ R( e, ) iff nd only if = true (sine no expression in R(e) is nullle), nd ɛ nf ɛ (e) if nd only if e is nullle (see Remrk 42). We strt proving the upper prt. We prove it for pointed item e nd leve the ovious generliztion to pointed expression to the reder (the move opertion does not depend from the presene of triling point, nd similrly the derivtive of ɛ is empty). THEOREM 51. For ny pointed item e, R(move(e, )) = nf ɛ ( (R(e))) Proof. By indution on the struture of e: short desription of pper /3/18

9 (_) move(_, 1) δ 1 nf ε nf ε nf ε nf ε nf ε δ 1 * move (_,w) δw move(_, n) R R R R snd δ δ nf ε Figure 5. Pointed regulr expressions nd Brzozowski s derivtives the ses, ɛ, nd re trivil if e = then move(, ) =, true nd R, true = {ɛ}. On the other side, nf ɛ ( (R( )) = nf ɛ ( ({})) = nf ɛ ({ɛ}) = ɛ. if e = e 1 + e 2, then R(move(e 1 + e 2, )) = = R(move(e 1, ) move(e 2, )) = R(move(e 1, )) R(move(e 2, )) = nf ɛ ( (R(e 1))) nf ɛ ( (R(e 2))) = nf ɛ ( (R(e 1 + e 2))) let e = e 1e 2, nd let us suppose tht move(e 1, ) = e 1, flse nd thus R(move(e 1, ) = R(e 1) nd ν( (R(e 1))) = flse. Then R(move(e 1e 2, )) = = R(move(e 1, ) move(e 2, )) = R(move(e 1, )) move(e2, ) R(move(e 2, )) = nf ɛ ( (R(e 1))) e 2 nf ɛ ( (R(e 2))) = nf ɛ ( (R(e 1)) e 2 (R(e 2))) = nf ɛ ( (R(e 1) e 2 ) (R(e 2))) = nf ɛ ( (R(e 1) e 2 R(e 2))) = nf ɛ ( (R(e 1e 2))) If move(e 1, ) = e 1, true then R(move(e 1, )) = R(e 1) ɛ = nf ɛ ( (R(e 1)). In prtiulr R(e 1) = nf ( (R(e 1)) nd ν( (R(e 1))) = true. We hve then: n n ε _ ν(_) R(move(e 1e 2, )) = = R(move(e 1, ) move(e 2, )) = R(e 1) move(e 2, ) nf ɛ ( move(e 2, ) ) R(move(e 2, )) = R(e 1) e 2 nf ɛ ( e 2 ) R(move(e 2, )) = nf ( (R(e 1))) e 2 nf ɛ ( e 2 ) nf ɛ ( (R(e 2))) = nf ɛ ( (R(e 1)) e 2 ) nf ɛ ( (R(e 2))) = nf ɛ ( (R(e 1)) e 2 (R(e 2))) = nf ɛ ( (R(e 1) e 2 ) (R(e 2))) = nf ɛ ( (R(e 1) e 2 R(e 2))) = nf ɛ ( (R(e 1e 2))) let e = e 1, nd let us suppose tht move(e 1, ) = e 1, flse. Thus ɛ nf ɛ ( (R(e 1))). Then R(move(e 1, )) = = R(move(e 1, ) ) = R(e 1) e 1 = nf ɛ ( (R(e 1))) e 1 = nf ɛ ( (R(e 1)) e 1 ) = nf ɛ ( (R(e 1) e 1 ))) = nf ɛ ( (R(e 1))) If move(e 1, ) = e 1, true then R(move(e 1, )) = R(e 1) ɛ = nf ɛ ( (R(e 1)). In prtiulr R(e 1) = nf ( (R(e 1)) nd ν( (()R(e 1))) = true sine ɛ nf ɛ ( (R(e 1)). We hve then: R(move(e 1, )) = = R(move(e 1, ) ) = R(e 1) e 1 nf ɛ ( e 1 ) = nf ( (R(e 1))) e 1 nf ɛ ( e 1 ) = nf ɛ ( (R(e 1)) e 1 ) = nf ɛ ( (R(e 1) e 1 )) = nf ɛ ( (R(e 1))) We pss now to prove the lower prt of the digrm in Figure 5, nmely tht for ny regulr expression e, nf ɛ ( (e)) = nf ɛ ( (nf ɛ (e))) Sine however, nf ɛ ( (nf ɛ (e))) = nf ɛ ( (nf (e))) (the derivtive of ɛ is empty), this is equivlent to prove the following result. THEOREM 52. nf ɛ ( (e)) = nf ɛ ( (nf (e))) Proof. The proof is y indution on e. Any indution hypothesis over regulr expression e 1 n e strengthened to nf ɛ ( (e 1)e 2) = nf ɛ ( (nf (e 1))e 2) for ll e 2 sine nf ɛ ( (e 1)e 2) = nf ɛ ( (e 1))e 2 (nf ɛ (e 2) if ν( (e 1)) = nf ɛ ( (nf (e 1)))e 2 (nf ɛ (e 2) if ν( (nf (e 1))) = nf ɛ ( (nf (e 1))e 2) (oserve tht ν( (e 1)) = ν( (nf (e 1))) sine the lnguges denoted y (e 1) nd (nf (e 1)) re equl). We must onsider the following ses. If e is ɛ, or symol different from then oth sides of the eqution re empty If e is, nf ɛ ( ()) = nf ɛ (ɛ) = {ɛ} = nf ɛ ( ({})) = nf ɛ ( (nf ())) If e is e 1 + e 2, nf ɛ ( (e 1 + e 2)) = = nf ɛ ( (e 1) + (e 2)) = nf ɛ ( (e 1)) nf ɛ ( (e 2)) = nf ɛ ( (nf (e 1))) nf ɛ ( (nf (e 2))) = nf ɛ ( (nf (e 1) nf (e 2))) = nf ɛ ( (nf (e 1 + e 2))) If e is e 1e 2 nd ν(e 1) = flse, nf ɛ ( (e 1e 2)) = nf ɛ ( (e 1)e 2) = nf ɛ ( (nf (e 1))e 2) = = nf ɛ ( (nf (e 1)e 2)) = nf ɛ ( (nf (e 1e 2))) If e is e 1e 2 nd ν(e 1) = true, nf ɛ ( (e 1e 2)) = = nf ɛ ( (e 1)e 2) nf ɛ ( (e 2)) = nf ɛ ( (nf (e 1))e 2) nf ɛ ( (nf (e 2))) = nf ɛ ( (nf (e 1)e 2 nf (e 2))) = nf ɛ ( (nf (e 1e 2))) short desription of pper /3/18

10 If e is e 1, nf ɛ ( (e 1)) = nf ɛ ( (e 1)e 1) = nf ɛ ( (nf (e 1))e 1) = = nf ɛ ( (nf (e 1)e 1)) = nf ɛ ( (nf (e 1))) LEMMA 53. R(e) = nf ɛ (R(e)) Proof. We proeed y indution over e: R( ) = = nf ɛ ( ) = nf ɛ (R( )) R(ɛ) = = nf ɛ ( ) = nf ɛ (R(ɛ)) R() = = nf ɛ ( ) = nf ɛ (R()) R( ) = {} = nf ɛ ({}) = nf ɛ (R()) R(e 1 + e 2) = R(e 1) R(e 2) = nf ɛ (R(e 1)) nf ɛ (R(e 2)) = nf ɛ (R(e 1) R(e 2)) = nf ɛ (R(e 1 + e 2)) R(e 1e 2) = R(e 1) e 2 R(e 2) = nf ɛ (R(e 1)) e 2 nf ɛ (R(e 2)) = nf ɛ (R(e 1) e 2 ) nf ɛ (R(e 2)) = nf ɛ (R(e 1) e 2 R(e 2)) = nf ɛ (R(e 1e 2)) R(e ) = R(e) e = nf ɛ (R(e)) e = nf ɛ (R(e) e ) = nf ɛ (R(e )) We re now redy to prove the ommuttion of the outermost digrm. THEOREM 54. For ny pointed item e, R(move (e, w)) = nf ɛ ( w(r(e))) Proof. The proof is y indution on the struture of w. In the se se, R(move (e, ɛ)) = R(e) = nf ɛ (R(e)) = nf ɛ ( ɛ(r(e))). In the indutive step, y Theorem 52, R(move (e, w)) = = R(move (move(e, ), w) = nf ɛ ( w(r(move(e, ))) = nf ɛ ( w(nf ɛ ( (R(e))))) = nf ɛ ( w( (R(e)))) = nf ɛ ( w(r(e))) COROLLARY 55. For ny regulr expression e, Proof. R(move ( e, w)) = nf ɛ ( w(e)) R(move ( e, w))=nf ɛ ( w(r( e))=nf ɛ ( w(nf ɛ (e))=nf ɛ ( w(e)) Another importnt onsequene of Lemms 51 nd 52 is tht R nd nf ɛ re dmissile reltions (respetively, over pres nd over derivtives). THEOREM 56. kn(r( )) (the kernel of R( )) is n dmissile equivlene reltion over pres. Proof. By Lemm 39 we derive tht for ll pres e 1, e 2, if R(e 1) = R(e 2) then L p(e 1) = L p(e 2). We lso need to prove tht for ll pres e 1, e 2 nd ll symol, if R(e 1) = R(e 2) then R(move(e 1, )) = R(move(e 2, )). By Theorem 51 R(move(e 1, )) = nf ɛ ( (R(e 1)) = nf ɛ ( (R(e 2)) = = R(move(e 2, )) THEOREM 57. kn(nf ɛ (e)) is n dmissile equivlene reltion over regulr expressions Proof. By Lemm 45 we derive tht for ll regulr expressions e 1, e 2, if nf ɛ (e 1) = nf ɛ (e 2) then L(e 1) = L(e 2). We lso need to prove tht for ll regulr expressions e 1, e 2 nd ll symol, if nf ɛ (e 1) = nf ɛ (e 2) then nf ɛ ( (e 1)) = nf ɛ ( (e 2)). By Theorem 52 nf ɛ ( (e 1)) = nf ɛ ( (nf ɛ (e 1)) = nf ɛ ( (nf ɛ (e 2)) = = nf ɛ ( (e 2)) THEOREM 58. For eh regulr expression e, let D e = (Q, Σ, e, t, F ) e the utomton for e uilt ording to Definition 30 nd let De δ = (Q δ, Σ, e, t δ, F δ ) the utomton for e otined with derivtives. Let kn(r) nd kn(nf ɛ ) e the kernels of R nd nf ɛ respetively. Then D e/ kn(r) = De/ δ kn(nfɛ ). Proof. The results holds y ommuttion of Figure 5, tht is grnted y the previous results, in prtiulr y Corollry 55, Theorem 56, Theorem 57, nd the ommuttion of the tringles reltive to the initil nd finl sttes. Theorem 58 reltes our finite utomt with the infinite sttes ones otined vi Brzozowski s derivtives efore quotienting the utomt sttes y mens of ACI to mke them finite. The following esy lemm shows tht kn(nf ɛ ) is n equivlene reltion finer thn ACI nd thus Theorem 58 lso holds for the stndrd finite Brzozowski s utomt sine we n quotient with ACI first. LEMMA 59. Let e 1 nd e 2 e regulr expressions. If e 1 = ACI e 2 then nf ɛ (e 1) = nf ɛ (e 2). 5. Merging By Theorem 16, L p( e) = L p(e) L( e ). A more syntti wy to look t this result is to oserve tht (e) n e otined y merging together the points in e nd ( e ), nd tht the lnguge defined y merging two pointed expressions e 1 nd e 2 is just the union of the two lnguges L p(e 1) nd L p(e 2). The merging opertion, tht we shll denote with, does lso provide the reltion etween deterministi nd nondeterministi utomt where, s in Wtson [10, 11], we my lel sttes with expressions with single point (for lk of spe, we shll not expliitly ddress the ltter issue in this pper, tht is however simple onsequene of Theorem 67). Finlly, the merging opertion will llow us to explin why the tehnique of pointed expressions nnot e (nively) generlized to intersetion nd omplement (see Setion 5.1). DEFINITION 60. Let e 1 nd e 2 e two items on the sme rrier e. The merge of e 1 nd e 2 is defined y the following rules y reursion over the struture of e: = ɛ ɛ = ɛ = = = = (e e 1 2) (e e 2 2) = (e 1 1 e 2 1) + (e 1 2 e 2 2) (e 1 1e 1 2) (e 2 1e 2 2) = e 1 e 2 = (e 1 1 e 2 1)(e 1 2 e 2 2) (e 1 e 2) The definition is extended to pres s follows: e 1, 1 e 2, 2 = e 1 e 2, 1 2 THEOREM 61. is ommuttive, ssoitive nd idempotent Proof. Trivil y indution over the struture of the rrier of the rguments. THEOREM 62. L p(e 1 e 2) = L p(e 1) L p(e 2) Proof. Trivil y indution on the ommon rrier of the items of e 1 nd e 2. All the onstrutions we presented so fr ommute with the merge opertion. Sine merging essentilly orresponds to the suset onstrution over utomt, the following theorems onstitute the proof of orretness of the suset onstrution. short desription of pper /3/18

11 THEOREM 63. (e 1 1 e 2 1) (e 1 2 e 2 2) = (e 1 1 e 1 2) (e 2 1 e 2 2) Proof. Trivil y expnsion of definitions. THEOREM for e 1 nd e 2 items on the sme rrier, (e 1 e 2) = (e 1) e 2, flse 2. for e 1 nd e 2 pres on the sme rrier, (e 1 e 2) = (e 1) e 2 3. (e 1 1 e 2 1) (e 1 2 e 2 2) = (e 1 1 e 1 2) (e 2 1 e 2 2) COROLLARY 65. (e 1 e 2) = e 1 (e 2) = (e 1) (e 2) Proof.[of the orollry] The orollry is simple onsequene of ommuttivity of nd idempotene of ( ): (e 1 e 2) = (e 2 e 1) = (e 2) e 1 = e 1 (e 2) (e 1 e 2) = ( (e 1 e 2)) = ( (e 1) e 2) = (e 1) (e 2) Proof.[of 1.] We first prove (e 1 e 2) = (e 1) e 2, flse y indution over the struture of the ommon rrier of e 1 nd e 2, ssuming tht 3. holds on terms whose rrier is struturlly smller thn e. If e 1 is, ɛ,, then trivil If e 1 is e e 2 1 nd e 2 is e e 2 2: ((e e 2 1) (e e 2 2)) = = ((e 1 1 e 1 2) + (e 2 1 e 2 2)) = (e 1 1 e 1 2) (e 2 1 e 2 2) = ( (e 1 1) e 1 2, flse ) ( (e 2 1) e 2 2, flse ) = ( (e 1 1) (e 2 1)) ( e 1 2, flse e 2 2, flse ) = (e e 2 1) e e 2 2, flse If e 1 is e 1 1e 2 1 nd e 2 is e 1 2e 2 2 then, using 3. on items whose rrier is struturlly smller thn e 1, ((e 1 1e 2 1) (e 1 2e 2 2)) = = ((e 1 1 e 1 2)(e 2 1 e 2 2)) = (e 1 1 e 1 2) e 2 1 e 2 2, flse = ( (e 1 1) e 1 2, flse ) ( e 2 1, flse e 2 2, flse ) = ( (e 1 1) e 2 1, flse ) ( e 1 2, flse e 2 2, flse )) = (e 1 1e 2 1) e 1 2e 2 2, flse If e 1 is e 1 1 nd e 2 is e 1 2, let (e 1 1 e 1 2) = e, nd (e 1 1) = e,. By indution hypothesis, e, = (e 1 1 e 1 2) = (e 1 1) e 1 2, flse = e, e 1 2, flse Then (e 1 1 e 1 2 ) = ((e 1 1 e 1 2) ) = e, true = = e, true e 1 2, flse = (e 1 1 ) e 1 2, flse Proof.[Of 2.] Let e i j, i j = e i j. By definition of, we hve e 1 1 e 2 1 = e 1 1 e 2 1, { e if = flse For ll nd e, let (e) := (e) otherwise Thus for ll e 1, e 2, 1, 2, letting e 2, 2 := 1 ( e 2, 2 ), the following holds: e 1, 1 e 2, 2 = e 1e 2, 2 2 Let e i 2, i 2 := i 1 (e i 2). By property 1. we hve: e 1 2 e 2 2, = 1 1 (e 1 2) 2 1 (e 2 2) = (e1 2 e 2 2) Thus (e 1 1 e 2 1) (e 1 2 e 2 2) = = e 1 1 e 2 1, (e 1 2 e 2 2) = (e 1 1 e 2 1 )(e 1 2 e 2 2 ), = (e 1 1 e 1 2 ) (e 2 1 e 2 2 ), ( ) ( = e 1 1 e 1 2, e 2 1 e 2 2, = (e 1 1 e 1 2) (e 2 1 e 2 2) THEOREM 66. (e 1 e 2) = e 1 e 2 Proof. Let e 1 = e 1 1, 1 nd e 2 = e 1 2, 2. Thus 2 ( e 1 1, 1 e 1 2, 2 ) = e 1 1 e 1 2, ) Let define e, e 1 nd e 2 y ses on 1 nd 2 with the property tht e = e 1 e 2: If 1 = 2 = flse then let e i = e 1 i nd e = e 1 1 e 1 2. Oviously e = e 1 e 2. If 1 = true nd 2 = flse then let (e 1 1) = e 1, 1, let e 2 = e 1 2 nd let (e 1 1 e 1 2) = (e 1 1) e 1 2, flse = e,. Hene e 1 e 1 2 = e 1 e 2 = e. The se 1 = flse nd 2 = true is hndled dully to the previous one. If 1 = true nd 2 = true then let (e 1 i ) = e i, i nd let (e 1 1 e 1 2) = (e 1 1) (e 1 2) = e,. Hene e 1 e 2 = e. In ll ses, e 1 1 e 1 2, 1 2 = e, 1 2 = (e 1 e 2), 1 2 = = e 1 e 2, 1 2 = e 1, 1 e 2, 2 = e 1 1, 1 e 1 2, 2 THEOREM 67. move(e 1 e 2, ) = move(e 1, ) move(e 2, ) Proof. The proof is y indution on the struture of e. the ses, ɛ nd re trivil y omputtion the se hs four su-ses: if e 1 nd e 2 re oth, then move(, ) =, flse = move(, ) move(, ); otherwise t lest one in e 1 or e 2 is nd move(e 1 e 2, ) = move(, ) =, true = move(e 1, ) move(e 2, ) if e is e 1 + e 2 then move((e e 2 1) (e e 2 2), ) = = move((e 1 1 e 1 2) + (e 2 1 e 2 2), ) = move(e 1 1 e 1 2, ) move(e 2 1 e 2 2, ) = (move(e 1 1, ) move(e 1 2, )) (move(e 2 1, ) move(e 2 2, )) = (move(e 1 1, ) move(e 2 1, )) (move(e 1 2, ) move(e 2 2, )) = move(e e 2 1, ) move(e e 2 2, ) if e is e 1 e 2 then move((e 1 1e 2 1) (e 1 2e 2 2), ) = = move((e 1 1 e 1 2)(e 2 1 e 2 2), ) = move(e 1 1 e 1 2, ) move(e 2 1 e 2 2, ) = (move(e 1 1, ) move(e 1 2, )) (move(e 2 1, ) move(e 2 2, )) = (move(e 1 1, ) move(e 2 1, )) (move(e 1 2, ) move(e 2 2, )) = move(e 1 1e 2 1, ) move(e 1 2e 2 2, ) if e is e 1 then move(e 1 1 e 1 2 ) = move((e 1 1 e 1 2) ) = = move(e 1 1 e 1 2) = (move(e 1 1) move(e 1 2)) = move(e 1 1) move(e 1 2) = move(e 1 1 ) move(e 1 2 ) 5.1 Intersetion nd omplement Pointed expressions nnot e generlized in trivil wy to the opertions of intersetion nd omplement. Suppose to extend the definition of the lnguge in the ovious wy, letting L p(e 1 e 2) = short desription of pper /3/18

12 L p(e 1) L p(e 2) nd L p( e) = L p(e). The prolem is tht merging is no longer dditive, nd Theorem 16 does not hold ny more. For instne, onsider the two expressions e 1 = nd e 2 =. Clerly L p(e 1) = L p(e 2) =, ut L p(e 1 e 2) = L p( ) = {}. To etter understnd the prolem, let e = ( ), nd let us onsider the result of move(e, ). Sine move(e, ) = ( ) ), true, we should rodst new point inside ( ) ), hene move(e, ) = ( ) ), tht is oviously wrong. The prolems in extending the tehnique to intersetion nd omplement re not due to some esily voidle defiieny of the pproh ut hve deep theoretil reson: indeed, even if these opertors do not inrese the expressive power of regulr expressions they n hve drsti impt on suintness, mking them muh hrder to hndle. For instne it is well known tht expressions with omplements n provide desriptions of ertin lnguges whih re non-elementry more ompt thn stndrd regulr expression [15]. Gelde [12] hs reently proved tht for ny nturl numer n there exists regulr expression with intersetion of size O(n) suh tht ny DFA epting its lnguge hs doule-exponentil size, i.e. it ontins t lest 2 2n sttes (see lso [13]). Hene, mrking positions with points is not enough, just euse we would not hve enough sttes. Sine the prolem is due to loss of informtion during merging, we re urrently investigting the possiility to exploit olored points. An importnt gol of this pproh would e to provide simple, ompletely syntti explntions for spe ounds of different lsses of lnguges. 6. Conlusions We introdued in this pper the notion of pointed regulr expression, investigted its min properties, nd its reltion with Brzozowski s derivtives. Points re used to mrk the positions inside the regulr expression whih hve een rehed fter reding some prefix of the input string, nd where the proessing of the remining string should strt. In prtiulr, eh pointed expression hs ler semntis. Sine eh pointed expression for e represents stte of the deterministi utomton ssoited with e, this mens we my ssoite semntis to eh stte in terms of the speifition e nd not of the ehviour of the utomton. This llows diret, intuitive nd esily verifile onstrution of the deterministi utomton for e. A mjor dvntge of pointed expressions is from the didtil point of view. Relying on n eletroni devie, it is rel plesure to see points moving inside the regulr expression in response to n input symol. Students immeditely grsp the ide, nd re le to mnully uild the utomt, nd to understnd the mening of its sttes, fter single lesson. Moreover, if you hve relly short time, you n ltogether skip the notion of nondeterministi utomt. Regulr expression reeived renewed interest in reent yers, mostly due to their use in XML-lnguges. Pointed expressions seem to open huge rnge of novel perspetives nd originl pprohes in the field, strting from the hllenging generliztion of the pproh to different opertors suh s ounting, intersetion, nd interleving (e.g. exploiting olors for points, see Setion 5.1). A lrge mount of reserh hs een reently devoted to the so lled suinteness prolem, nmely the investigtion of the desriptionl omplexity of regulr lnguges (see e.g. [12, 13, 14]). Sine, s oserved in Exmple10, pointed expression n provide more ompt desription for regulr lnguges thn trditionl regulr expression, it looks interesting to etter investigted this issue (tht seems to e relted to the so lled str-height [16] of the lnguge). It ould lso e worth to investigte vrints of the notion of pointed expression, llowing different positioning of points inside the expressions. Merging must e etter investigted, nd the whole equtionl theory of pointed expressions, oth with different nd (espeilly) fixed rriers must e entirely developed. As explined in the introdution, the notion of pointed expression ws suggested y n ttempt of formlizing the theory of regulr lnguges y mens of n intertive prover. This testify the relevne of the hoie of good dt strutures not just for the design of lgorithms ut lso for the forml investigtion of given field, nd is nie exmple of the kind of interesting feedk one my expet y the interply with utomted devies for proof development. Referenes [1] G. Rozenerg nd A. Slom, eds., Hndook of forml lnguges, vol. 1: word, lnguge, grmmr. New York, NY, USA: Springer- Verlg New York, In., [2] K. Ellul, B. Krwetz, J. Shllit, nd M. wei Wng, Regulr expressions: New results nd open prolems, Journl of Automt, Lnguges nd Comintoris, vol. 10, no. 4, pp , [3] J. A. Brzozowski, Derivtives of regulr expressions, J. ACM, vol. 11, no. 4, pp , [4] R. MNughton nd H. Ymd, Regulr expressions nd stte grphs for utomt, Ieee Trnstions On Eletroni Computers, vol. 9, no. 1, pp , [5] S. Owens, J. H. Reppy, nd A. Turon, Regulr-expression derivtives re-exmined, J. Funt. Progrm., vol. 19, no. 2, pp , [6] G. Berry nd R. Sethi, From regulr expressions to deterministi utomt, Theor. Comput. Si., vol. 48, no. 3, pp , [7] A. Brüggemnn-Klein, Regulr expressions into finite utomt, Theor. Comput. Si., vol. 120, no. 2, pp , [8] C.-H. Chng nd R. Pige, From regulr expressions to df s using ompressed nf s, in Comintoril Pttern Mthing, Third Annul Symposium, CPM 92, Tuson, Arizon, USA, April 29 - My 1, 1992, Proeedings, vol. 644 of Leture Notes in Computer Siene, pp , Springer, [9] S. C. Kleene, Representtion of events in nerve nets nd finite utomt, in Automt Studies (C. E. Shnnon nd J. MCrthy, eds.), pp. 3 42, Prineton University Press, [10] B. W. Wtson, A txonomy of lgorithms for onstruting miniml yli deterministi finite utomt, South Afrin Computer Journl, vol. 27, pp , [11] B. W. Wtson, Diretly onstruting miniml dfs : omining two lgorithms y rzozowski, South Afrin Computer Journl, vol. 29, pp , [12] W. Gelde, Suintness of regulr expressions with interleving, intersetion nd ounting, Theor. Comput. Si., vol. 411, no , pp , [13] H. Gruer nd M. Holzer, Finite utomt, digrph onnetivity, nd regulr expression size, in ICALP, vol of Leture Notes in Computer Siene, pp , Springer, [14] M. Holzer nd M. Kutri, Nondeterministi finite utomt - reent results on the desriptionl nd omputtionl omplexity, Int. J. Found. Comput. Si., vol. 20, no. 4, pp , [15] A. R. Meyer nd L. J. Stokmeyer, The equivlene prolem for regulr expressions with squring requires exponentil spe, in 13th Annul Symposium on Swithing nd Automt Theory (FOCS), pp , IEEE, [16] L. C. Eggn, Trnsition grphs nd the str-height of regulr events, Mihign Mthemtil Journl, vol. 10, no. 4, pp , short desription of pper /3/18

Nondeterministic Automata vs Deterministic Automata

Nondeterministic Automata vs Deterministic Automata Nondeterministi Automt vs Deterministi Automt We lerned tht NFA is onvenient model for showing the reltionships mong regulr grmmrs, FA, nd regulr expressions, nd designing them. However, we know tht n

More information

Technische Universität München Winter term 2009/10 I7 Prof. J. Esparza / J. Křetínský / M. Luttenberger 11. Februar Solution

Technische Universität München Winter term 2009/10 I7 Prof. J. Esparza / J. Křetínský / M. Luttenberger 11. Februar Solution Tehnishe Universität Münhen Winter term 29/ I7 Prof. J. Esprz / J. Křetínský / M. Luttenerger. Ferur 2 Solution Automt nd Forml Lnguges Homework 2 Due 5..29. Exerise 2. Let A e the following finite utomton:

More information

CS 573 Automata Theory and Formal Languages

CS 573 Automata Theory and Formal Languages Non-determinism Automt Theory nd Forml Lnguges Professor Leslie Lnder Leture # 3 Septemer 6, 2 To hieve our gol, we need the onept of Non-deterministi Finite Automton with -moves (NFA) An NFA is tuple

More information

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

The University of Nottingham SCHOOL OF COMPUTER SCIENCE A LEVEL 2 MODULE, SPRING SEMESTER MACHINES AND THEIR LANGUAGES ANSWERS The University of ottinghm SCHOOL OF COMPUTR SCIC A LVL 2 MODUL, SPRIG SMSTR 2015 2016 MACHIS AD THIR LAGUAGS ASWRS Time llowed TWO hours Cndidtes my omplete the front over of their nswer ook nd sign their

More information

1 PYTHAGORAS THEOREM 1. Given a right angled triangle, the square of the hypotenuse is equal to the sum of the squares of the other two sides.

1 PYTHAGORAS THEOREM 1. Given a right angled triangle, the square of the hypotenuse is equal to the sum of the squares of the other two sides. 1 PYTHAGORAS THEOREM 1 1 Pythgors Theorem In this setion we will present geometri proof of the fmous theorem of Pythgors. Given right ngled tringle, the squre of the hypotenuse is equl to the sum of the

More information

NON-DETERMINISTIC FSA

NON-DETERMINISTIC FSA Tw o types of non-determinism: NON-DETERMINISTIC FS () Multiple strt-sttes; strt-sttes S Q. The lnguge L(M) ={x:x tkes M from some strt-stte to some finl-stte nd ll of x is proessed}. The string x = is

More information

Nondeterministic Finite Automata

Nondeterministic Finite Automata Nondeterministi Finite utomt The Power of Guessing Tuesdy, Otoer 4, 2 Reding: Sipser.2 (first prt); Stoughton 3.3 3.5 S235 Lnguges nd utomt eprtment of omputer Siene Wellesley ollege Finite utomton (F)

More information

Finite State Automata and Determinisation

Finite State Automata and Determinisation Finite Stte Automt nd Deterministion Tim Dworn Jnury, 2016 Lnguges fs nf re df Deterministion 2 Outline 1 Lnguges 2 Finite Stte Automt (fs) 3 Non-deterministi Finite Stte Automt (nf) 4 Regulr Expressions

More information

CS311 Computational Structures Regular Languages and Regular Grammars. Lecture 6

CS311 Computational Structures Regular Languages and Regular Grammars. Lecture 6 CS311 Computtionl Strutures Regulr Lnguges nd Regulr Grmmrs Leture 6 1 Wht we know so fr: RLs re losed under produt, union nd * Every RL n e written s RE, nd every RE represents RL Every RL n e reognized

More information

= state, a = reading and q j

= state, a = reading and q j 4 Finite Automt CHAPTER 2 Finite Automt (FA) (i) Derterministi Finite Automt (DFA) A DFA, M Q, q,, F, Where, Q = set of sttes (finite) q Q = the strt/initil stte = input lphet (finite) (use only those

More information

Project 6: Minigoals Towards Simplifying and Rewriting Expressions

Project 6: Minigoals Towards Simplifying and Rewriting Expressions MAT 51 Wldis Projet 6: Minigols Towrds Simplifying nd Rewriting Expressions The distriutive property nd like terms You hve proly lerned in previous lsses out dding like terms ut one prolem with the wy

More information

Bisimulation, Games & Hennessy Milner logic

Bisimulation, Games & Hennessy Milner logic Bisimultion, Gmes & Hennessy Milner logi Leture 1 of Modelli Mtemtii dei Proessi Conorrenti Pweł Soboiński Univeristy of Southmpton, UK Bisimultion, Gmes & Hennessy Milner logi p.1/32 Clssil lnguge theory

More information

Petri Nets. Rebecca Albrecht. Seminar: Automata Theory Chair of Software Engeneering

Petri Nets. Rebecca Albrecht. Seminar: Automata Theory Chair of Software Engeneering Petri Nets Ree Alreht Seminr: Automt Theory Chir of Softwre Engeneering Overview 1. Motivtion: Why not just using finite utomt for everything? Wht re Petri Nets nd when do we use them? 2. Introdution:

More information

A Lower Bound for the Length of a Partial Transversal in a Latin Square, Revised Version

A Lower Bound for the Length of a Partial Transversal in a Latin Square, Revised Version A Lower Bound for the Length of Prtil Trnsversl in Ltin Squre, Revised Version Pooy Htmi nd Peter W. Shor Deprtment of Mthemtil Sienes, Shrif University of Tehnology, P.O.Bo 11365-9415, Tehrn, Irn Deprtment

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

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

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

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

6.5 Improper integrals

6.5 Improper integrals Eerpt from "Clulus" 3 AoPS In. www.rtofprolemsolving.om 6.5. IMPROPER INTEGRALS 6.5 Improper integrls As we ve seen, we use the definite integrl R f to ompute the re of the region under the grph of y =

More information

System Validation (IN4387) November 2, 2012, 14:00-17:00

System Validation (IN4387) November 2, 2012, 14:00-17:00 System Vlidtion (IN4387) Novemer 2, 2012, 14:00-17:00 Importnt Notes. The exmintion omprises 5 question in 4 pges. Give omplete explntion nd do not onfine yourself to giving the finl nswer. Good luk! Exerise

More information

Chapter 4 State-Space Planning

Chapter 4 State-Space Planning Leture slides for Automted Plnning: Theory nd Prtie Chpter 4 Stte-Spe Plnning Dn S. Nu CMSC 722, AI Plnning University of Mrylnd, Spring 2008 1 Motivtion Nerly ll plnning proedures re serh proedures Different

More information

2.4 Theoretical Foundations

2.4 Theoretical Foundations 2 Progrmming Lnguge Syntx 2.4 Theoretil Fountions As note in the min text, snners n prsers re se on the finite utomt n pushown utomt tht form the ottom two levels of the Chomsky lnguge hierrhy. At eh level

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

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

Introduction to Olympiad Inequalities

Introduction to Olympiad Inequalities Introdution to Olympid Inequlities Edutionl Studies Progrm HSSP Msshusetts Institute of Tehnology Snj Simonovikj Spring 207 Contents Wrm up nd Am-Gm inequlity 2. Elementry inequlities......................

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

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

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

Prefix-Free Regular-Expression Matching

Prefix-Free Regular-Expression Matching Prefix-Free Regulr-Expression Mthing Yo-Su Hn, Yjun Wng nd Derik Wood Deprtment of Computer Siene HKUST Prefix-Free Regulr-Expression Mthing p.1/15 Pttern Mthing Given pttern P nd text T, find ll sustrings

More information

Descriptional Complexity of Non-Unary Self-Verifying Symmetric Difference Automata

Descriptional Complexity of Non-Unary Self-Verifying Symmetric Difference Automata Desriptionl Complexity of Non-Unry Self-Verifying Symmetri Differene Automt Lurette Mris 1,2 nd Lynette vn Zijl 1 1 Deprtment of Computer Siene, Stellenosh University, South Afri 2 Merk Institute, CSIR,

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

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

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

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

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

Chapter 3. Vector Spaces. 3.1 Images and Image Arithmetic

Chapter 3. Vector Spaces. 3.1 Images and Image Arithmetic Chpter 3 Vetor Spes In Chpter 2, we sw tht the set of imges possessed numer of onvenient properties. It turns out tht ny set tht possesses similr onvenient properties n e nlyzed in similr wy. In liner

More information

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

Compiler Design. Spring Lexical Analysis. Sample Exercises and Solutions. Prof. Pedro C. Diniz University of Southern Cliforni Computer Siene Deprtment Compiler Design Spring 7 Lexil Anlysis Smple Exerises nd Solutions Prof. Pedro C. Diniz USC / Informtion Sienes Institute 47 Admirlty Wy, Suite

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

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

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

Abstraction of Nondeterministic Automata Rong Su

Abstraction of Nondeterministic Automata Rong Su Astrtion of Nondeterministi Automt Rong Su My 6, 2010 TU/e Mehnil Engineering, Systems Engineering Group 1 Outline Motivtion Automton Astrtion Relevnt Properties Conlusions My 6, 2010 TU/e Mehnil Engineering,

More information

Compression of Palindromes and Regularity.

Compression of Palindromes and Regularity. Compression of Plinromes n Regulrity. Kyoko Shikishim-Tsuji Center for Lierl Arts Eution n Reserh Tenri University 1 Introution In [1], property of likstrem t t view of tse is isusse n it is shown tht

More information

Discrete Structures Lecture 11

Discrete Structures Lecture 11 Introdution Good morning. In this setion we study funtions. A funtion is mpping from one set to nother set or, perhps, from one set to itself. We study the properties of funtions. A mpping my not e funtion.

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

where the box contains a finite number of gates from the given collection. Examples of gates that are commonly used are the following: a b

where the box contains a finite number of gates from the given collection. Examples of gates that are commonly used are the following: a b CS 294-2 9/11/04 Quntum Ciruit Model, Solovy-Kitev Theorem, BQP Fll 2004 Leture 4 1 Quntum Ciruit Model 1.1 Clssil Ciruits - Universl Gte Sets A lssil iruit implements multi-output oolen funtion f : {0,1}

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

Lecture 6: Coding theory

Lecture 6: Coding theory Leture 6: Coing theory Biology 429 Crl Bergstrom Ferury 4, 2008 Soures: This leture loosely follows Cover n Thoms Chpter 5 n Yeung Chpter 3. As usul, some of the text n equtions re tken iretly from those

More information

@#? Text Search ] { "!" Nondeterministic Finite Automata. Transformation NFA to DFA and Simulation of NFA. Text Search Using Automata

@#? Text Search ] { ! Nondeterministic Finite Automata. Transformation NFA to DFA and Simulation of NFA. Text Search Using Automata g Text Serh @#? ~ Mrko Berezovský Rdek Mřík PAL 0 Nondeterministi Finite Automt n Trnsformtion NFA to DFA nd Simultion of NFA f Text Serh Using Automt A B R Power of Nondeterministi Approh u j Regulr Expression

More information

Regular languages refresher

Regular languages refresher Regulr lnguges refresher 1 Regulr lnguges refresher Forml lnguges Alphet = finite set of letters Word = sequene of letter Lnguge = set of words Regulr lnguges defined equivlently y Regulr expressions Finite-stte

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

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

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

Behavior Composition in the Presence of Failure

Behavior Composition in the Presence of Failure Behvior Composition in the Presene of Filure Sestin Srdin RMIT University, Melourne, Austrli Fio Ptrizi & Giuseppe De Giomo Spienz Univ. Rom, Itly KR 08, Sept. 2008, Sydney Austrli Introdution There re

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) A partition P of [a, b] is a finite subset of [a, b] containing a and b. If Q is another partition and P Q, then Q is a refinement of P.

(a) A partition P of [a, b] is a finite subset of [a, b] containing a and b. If Q is another partition and P Q, then Q is a refinement of P. Chpter 7: The Riemnn Integrl When the derivtive is introdued, it is not hrd to see tht the it of the differene quotient should be equl to the slope of the tngent line, or when the horizontl xis is time

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

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

CONTROLLABILITY and observability are the central

CONTROLLABILITY and observability are the central 1 Complexity of Infiml Oservle Superlnguges Tomáš Msopust Astrt The infiml prefix-losed, ontrollle nd oservle superlnguge plys n essentil role in the reltionship etween ontrollility, oservility nd o-oservility

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

THE PYTHAGOREAN THEOREM

THE PYTHAGOREAN THEOREM THE PYTHAGOREAN THEOREM The Pythgoren Theorem is one of the most well-known nd widely used theorems in mthemtis. We will first look t n informl investigtion of the Pythgoren Theorem, nd then pply this

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

Lesson 2: The Pythagorean Theorem and Similar Triangles. A Brief Review of the Pythagorean Theorem.

Lesson 2: The Pythagorean Theorem and Similar Triangles. A Brief Review of the Pythagorean Theorem. 27 Lesson 2: The Pythgoren Theorem nd Similr Tringles A Brief Review of the Pythgoren Theorem. Rell tht n ngle whih mesures 90º is lled right ngle. If one of the ngles of tringle is right ngle, then we

More information

Lecture Notes No. 10

Lecture Notes No. 10 2.6 System Identifition, Estimtion, nd Lerning Leture otes o. Mrh 3, 26 6 Model Struture of Liner ime Invrint Systems 6. Model Struture In representing dynmil system, the first step is to find n pproprite

More information

Hybrid Systems Modeling, Analysis and Control

Hybrid Systems Modeling, Analysis and Control Hyrid Systems Modeling, Anlysis nd Control Rdu Grosu Vienn University of Tehnology Leture 5 Finite Automt s Liner Systems Oservility, Rehility nd More Miniml DFA re Not Miniml NFA (Arnold, Diky nd Nivt

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

Algorithm Design and Analysis

Algorithm Design and Analysis Algorithm Design nd Anlysis LECTURE 5 Supplement Greedy Algorithms Cont d Minimizing lteness Ching (NOT overed in leture) Adm Smith 9/8/10 A. Smith; sed on slides y E. Demine, C. Leiserson, S. Rskhodnikov,

More information

Hyers-Ulam stability of Pielou logistic difference equation

Hyers-Ulam stability of Pielou logistic difference equation vilble online t wwwisr-publitionsom/jns J Nonliner Si ppl, 0 (207, 35 322 Reserh rtile Journl Homepge: wwwtjnsom - wwwisr-publitionsom/jns Hyers-Ulm stbility of Pielou logisti differene eqution Soon-Mo

More information

The Word Problem in Quandles

The Word Problem in Quandles The Word Prolem in Qundles Benjmin Fish Advisor: Ren Levitt April 5, 2013 1 1 Introdution A word over n lger A is finite sequene of elements of A, prentheses, nd opertions of A defined reursively: Given

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

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

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

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

Unit 4. Combinational Circuits

Unit 4. Combinational Circuits Unit 4. Comintionl Ciruits Digitl Eletroni Ciruits (Ciruitos Eletrónios Digitles) E.T.S.I. Informáti Universidd de Sevill 5/10/2012 Jorge Jun 2010, 2011, 2012 You re free to opy, distriute

More information

s the set of onsequenes. Skeptil onsequenes re more roust in the sense tht they hold in ll possile relities desried y defult theory. All its desirle p

s the set of onsequenes. Skeptil onsequenes re more roust in the sense tht they hold in ll possile relities desried y defult theory. All its desirle p Skeptil Rtionl Extensions Artur Mikitiuk nd Miros lw Truszzynski University of Kentuky, Deprtment of Computer Siene, Lexington, KY 40506{0046, frtur mirekg@s.engr.uky.edu Astrt. In this pper we propose

More information

A Study on the Properties of Rational Triangles

A Study on the Properties of Rational Triangles Interntionl Journl of Mthemtis Reserh. ISSN 0976-5840 Volume 6, Numer (04), pp. 8-9 Interntionl Reserh Pulition House http://www.irphouse.om Study on the Properties of Rtionl Tringles M. Q. lm, M.R. Hssn

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

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

Arrow s Impossibility Theorem

Arrow s Impossibility Theorem Rep Voting Prdoxes Properties Arrow s Theorem Arrow s Impossiility Theorem Leture 12 Arrow s Impossiility Theorem Leture 12, Slide 1 Rep Voting Prdoxes Properties Arrow s Theorem Leture Overview 1 Rep

More information

Algorithms & Data Structures Homework 8 HS 18 Exercise Class (Room & TA): Submitted by: Peer Feedback by: Points:

Algorithms & Data Structures Homework 8 HS 18 Exercise Class (Room & TA): Submitted by: Peer Feedback by: Points: Eidgenössishe Tehnishe Hohshule Zürih Eole polytehnique fédérle de Zurih Politenio federle di Zurigo Federl Institute of Tehnology t Zurih Deprtement of Computer Siene. Novemer 0 Mrkus Püshel, Dvid Steurer

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

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

THEORY OF FORMAL LANGUAGES EXERCISE BOOK. A Suite of Exercises with Solutions DRAFT COPY

THEORY OF FORMAL LANGUAGES EXERCISE BOOK. A Suite of Exercises with Solutions DRAFT COPY THEORY OF FORMAL LANGUAGES EXERCISE BOOK A Suite of Exerises with Solutions DRAFT COPY Lu Breveglieri ollortors Gimpolo Agost Alessndro Brenghi Ann Beletsk Stefno Crespi Reghizzi Bernrdo Dl Seno Vinenzo

More information

General Suffix Automaton Construction Algorithm and Space Bounds

General Suffix Automaton Construction Algorithm and Space Bounds Generl Suffix Automton Constrution Algorithm nd Spe Bounds Mehryr Mohri,, Pedro Moreno, Eugene Weinstein, Cournt Institute of Mthemtil Sienes 251 Merer Street, New York, NY 10012. Google Reserh 76 Ninth

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

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

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

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

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

Bottom-Up Parsing. Canonical Collection of LR(0) items. Part II

Bottom-Up Parsing. Canonical Collection of LR(0) items. Part II 2 ottom-up Prsing Prt II 1 Cnonil Colletion of LR(0) items CC_LR(0)_I items(g :ugmented_grmmr){ C = {CLOURE({ })} ; repet{ foreh(i C) foreh(grmmr symol X) if(goto(i,x) && GOTO(I,X) C) C = C {GOTO(I,X)};

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

CS241 Week 6 Tutorial Solutions

CS241 Week 6 Tutorial Solutions 241 Week 6 Tutoril olutions Lnguges: nning & ontext-free Grmmrs Winter 2018 1 nning Exerises 1. 0x0x0xd HEXINT 0x0 I x0xd 2. 0xend--- HEXINT 0xe I nd ER -- MINU - 3. 1234-120x INT 1234 INT -120 I x 4.

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

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

#A42 INTEGERS 11 (2011) ON THE CONDITIONED BINOMIAL COEFFICIENTS

#A42 INTEGERS 11 (2011) ON THE CONDITIONED BINOMIAL COEFFICIENTS #A42 INTEGERS 11 (2011 ON THE CONDITIONED BINOMIAL COEFFICIENTS Liqun To Shool of Mthemtil Sienes, Luoyng Norml University, Luoyng, Chin lqto@lynuedun Reeived: 12/24/10, Revised: 5/11/11, Aepted: 5/16/11,

More information

PAIR OF LINEAR EQUATIONS IN TWO VARIABLES

PAIR OF LINEAR EQUATIONS IN TWO VARIABLES PAIR OF LINEAR EQUATIONS IN TWO VARIABLES. Two liner equtions in the sme two vriles re lled pir of liner equtions in two vriles. The most generl form of pir of liner equtions is x + y + 0 x + y + 0 where,,,,,,

More information

Transition systems (motivation)

Transition systems (motivation) Trnsition systems (motivtion) Course Modelling of Conurrent Systems ( Modellierung neenläufiger Systeme ) Winter Semester 2009/0 University of Duisurg-Essen Brr König Tehing ssistnt: Christoph Blume In

More information

22: Union Find. CS 473u - Algorithms - Spring April 14, We want to maintain a collection of sets, under the operations of:

22: Union Find. CS 473u - Algorithms - Spring April 14, We want to maintain a collection of sets, under the operations of: 22: Union Fin CS 473u - Algorithms - Spring 2005 April 14, 2005 1 Union-Fin We wnt to mintin olletion of sets, uner the opertions of: 1. MkeSet(x) - rete set tht ontins the single element x. 2. Fin(x)

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

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

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