CDM Automata on Infinite Words

Size: px
Start display at page:

Download "CDM Automata on Infinite Words"

Transcription

1 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, infinite words come in two flvors: i-infinite Σ = Z Σ A Chllenge: Does it mke ny sense to consider finite stte mchines on infinite words? or one-wy infinite Σ ω = N Σ If so, how would this generliztion work? Both kinds pper nturlly in the nlysis of symolic dynmicl systems (reversile nd irreversile). One-wy infinite ones cn e used to descrie the properties of progrms tht never hlt, such s operting systems nd user interfces. Protocols lso nturlly give rise to infinite descriptions. Adieu Conctention 5 No Pttern Mtching 6 Note tht neither Σ nor Σ ω form semigroup under conctention in ny conceivle sense of the word: there is no wy to comine two infinite words y plcing one fter the other nd get nother infinite word (t lest not of the kind tht we re interested). But not tht there is n ovious conctention opertion nd slightly less ovious one of type Σ Σ ω Σ ω Σ ω Σ ω Σ The stndrd cceptnce testing prolem mkes little sense in this setting. Prolem: Acceptnce Instnce: An ω-utomton A nd word x Σ ω. Question: Does A ccept input x? Presumly A will just e some finite dt structure. But there is no generl wy to specify the input x, the spce Σ ω is uncountle. We could consider periodic words or the like, ut s stted the decision prolem is siclly meningless. The second one is prticulrly interesting in conjunction with utomt on i-infinite words, ut we won t go there: the technicl detils re too messy. But: We might still e le to generlize the logic pproch nd use these, yet undefined, ω-utomt to solve decision prolems for pproprite logics.

2 Automt Recognizing Infinite Words 7 ω-lnguges 8 Key Question: How do we modify finite stte mchines to cope with infinite inputs? Trnsition system: sme s for ordinry finite stte mchines. Acceptnce condition: requires work. Wht kind of cceptnce condition might mke sense? For finite words there is nturl nswer sed on pth existence, ut for infinite words things ecome it more complicted. Whtever condition we choose, we should not worry out ctul cceptnce testing, this is conceptul prolem, not n lgorithmic one. So we re interested in one-wy infinite words: Σ ω = N Σ One-wy infinite words re often clled ω-words. Susets of Σ ω re clled ω-lnguges. Given n utomton for infinite words its cceptnce lnguge is denoted y L ω (A) nd so on. Note tht n ω-lnguge my well e uncountle; there cnnot e good nottion system for ω-words. We will usully drop the ω whenever it is ovious from context. Runs nd Trces 9 Acceptnce 10 Since we will not chnge the underlying trnsition systems, we cn lift the definitions of run nd trce to the infinite cse: run is n lternting infinite sequence π = p 0, 1, p 1, 2,..., p m 1, m, p m,... The corresponding infinite sequence of symols is the trce: l(π) = 1, 2..., m 1, m,... Σ ω In generl, the numer of runs on prticulr input is going to e uncountle, ut tht will not ffect us (it is pth existence tht mtters). Agin: Key Question: Wht could it possily men for finite stte mchine to ccept n infinite word? Oviously we need some notion of cceptnce tht does not just depend on finite initil segment of the input: this would ignore most of the input nd just reply our old theory. On the other hnd, we should keep things simple nd not use wildly infinitry conditions to determine cceptnce; we don t wnt to sink in morss of descriptive set theory. So here is firly nturl condition: let s insist tht n ccepting run must touch the set of finl sttes infinitely often. More precisely, define the set of recurrent sttes of run π to e rec(π) = { p Q i (p i = p) } Büchi Automt 11 Exmple I 12 A Büchi utomton B is trnsition system Q, Σ, τ together with n cceptnce condition I Q nd F Q. B ccepts n infinite word x Σ ω if there is run π of B on x tht strts t I nd such tht rec(π) F. The collection of ll such words is the cceptnce lnguge of B. A lnguge L Σ ω is recognizle or ω-regulr if there is some Büchi utomton tht ccepts it. Let Σ = {, } nd L = { x {, } ω 1 # x < } So L is the lnguge of ll words contining t lest one, ut only finitely mny s. This lnguge is recognizle. In fct, two sttes suffice. Here is Büchi utomton for L = {, } ω :, So fr, this is just definition. It seems resonle, ut it is solutely not cler t this point tht we will get ny milege out of this. 1 2

3 Exmple II 13 Correctness 14 Let Σ = {,, c} nd L = { x {,, c} ω # x = # x = # cx < } So L contins finitely mny c s, ut infinitely mny s nd s. This lnguge is lso recognizle. Note tht 0 1 or 0 1 would lso work; it s not so cler wht the cnonicl utomton looks like. Correctness proofs re hrder thn for ordinry utomt, they typiclly involve some (modest) mount of infinite comintorics. In this cse, one might use the following clims. Write K for the ω-lnguge over {, } of words contining infinitely mny s nd s.,, c, 2, 1 A word x is in L iff x = uv where u {,, c} nd v K. 2 Let s {, }. Then sv K iff v K., Any infinite pth in the SCC {1, 2, 3} touching stte 1 infinitely often must use the edges (2, 3) nd (3, 1) infinitely often. 3, Give complete proof tht the Büchi utomton ccepts L. Exmple III 15 Stremlining Büchi Automt 16 Consider lphet Σ = {,, c}. Let L e the lnguge Every is ultimtely followed y, though there my e ritrrily mn c s in etween, nd there my e only finitely mny s. Then L is recognizle. It is cler tht Büchi utomton my hve useless sttes. In prticulr, ny inccessile stte (in the sense of clssicl finite stte mchine) is clerly useless. But there is more: for exmple, if finl stte elongs to trivil strongly connected component it is useless: the computtion cn pss through the stte t most once, so we might s well remove it from the set of finl sttes., c, c c 3 1 2, c Agin, think out wht correctness proof would look like. Useless sttes cn e removed from Büchi utomton in liner time. Give creful definition of wht it mens for stte in Büchi utomton to e useless. Then produce liner time lgorithm to eliminte useless sttes. Acceptnce Testing 17 A Ctstrophe 18 While cceptnce testing in generl mkes no sense, we cn still hndle the sitution when the word is very simple. Let A e Büchi utomton nd U = v u ω n ultimtely periodic infinite word. Then it is decidle whether A ccepts U. In this cse, U hs n ovious finite description: the finite words v nd u. A more generl cse is computle word: the function U : N Σ is computle. Prove the lst lemm. It is undecidle if Büchi utomton ccepts computle word. For ny index e define computle infinite word U e y { if {e} U e(s) = s (e) converges (fter t most s steps), otherwise. Then {e}(e) converges iff U e ω, which property is esily checked y 2-stte Büchi utomton. If we could test cceptnce of computle word in Büchi utomton we could thus solve the Hlting Prolem.

4 Union nd Intersection 19 Proof, contd. 20 Recognizle lnguges of Σ ω re closed under union nd intersection. For union simply use the disjoint sum of the Büchi utomt. For intersection, we use slightly modified product mchine construction. The new stte set is Q 1 Q 2 {0, 1, 2} The trnsitions on Q 1 nd Q 2 re inherited from the two given mchines. On the lst component ct s follows: Move from 0 to 1 t the next input. From 1 move to 2 whenever stte in F 1 is encountered. Reset from 2 to 0 when stte in F 2 is encountered. The initil sttes re of the form nd the finl sttes re I 1 I 2 {0} F = Q 1 Q 2 {0} The infinitely mny visits to F imply infinitely mny visits to F 1 nd F 2, nd conversely. There is messge here: though the construction is similr to the finite cse it is it more complicted. You hve to sty lert. Also note tht we hve not delt with complements. Fill in the detils in the lst construction. Rtionl Lnguges 21 Rtionl Expressions 22 Another piece of evidence for the usefulness our our definition is tht recognizle lnguge on infinite words cn e written down s type of regulr expression. A lnguge L Σ ω is rtionl if it is of the form L = ω U iv i where U i, V i Σ re ll regulr. i n Since we lredy hve nottion system for regulr lnguges of finite words it is esy to otin nottion system for recognizle lnguges of ω-words: dd one opertion ω with the understnding tht this opertion cn only e used once nd on the right hnd side. A sic expression hs the form α β ω where α nd β re ordinry regulr expressions. As we will see shortly, sums of these expressions then produce exctly ll the recognizle ω-lnguges. For the exmples from ove we hve firly simple expressions ( + ) ω (( + c) (ε + c )) ω Equivlence Recognizle nd Rtionl 23 Proof, contd. 24 An ω-lnguge is recognizle if, nd only if, it is rtionl. First ssume A is Büchi utomton ccepting some lnguge L. For ech finl stte p define two new utomt nd let U p = L(A 0 p), V p = L(A 1 p). Then A 0 p = A(I, p) A 1 p = A(p, p) L = ω U pv p p Q since rec(π) F implies tht one prticulr stte p F must pper infinitely often. For the opposite direction it suffices to show tht L = UV ω is recognizle for ny regulr lnguges U nd V, {ε} since recognizle lnguges re closed under union. To this end consider two mchines A 0 nd A 1 for U nd V. Join the finl sttes of A 0 to the initil sttes of A 1 y ε-moves, nd the finl sttes of A 1 to the initil sttes of A 1. Perform ε-elimintion to otin plin nondeterministic utomton A. Set the initil sttes of A to the initil sttes of A 0 nd the finl sttes to the finl sttes of A 1. The resulting Büchi utomton A ccepts L.

5 Deterministic Büchi Automt 26 Infinite Words 2 Deterministic Lnguges A Büchi utomton is deterministic if it hs one initil stte nd its trnsition system is deterministic. We my sfely ssume tht deterministic Büchi utomton is lso complete: otherwise we cn simply dd one sink stte. In deterministic nd complete Büchi utomton there is exctly one run from the initil stte for ny input. Muller nd Rin Automt Note tht the undecidility result for computle words holds lredy for deterministic Büchi utomt. Still, deterministic utomt should e of interest if one tries to compute complements: to get mchine for the complement, mnipulte the cceptnce condition. Another Ctstrophe 27 Deterministic Recognizle Lnguges 28 Proposition Let L = { x {, } ω # x < }. Then L is recognizle ut cnnot e ccepted y ny deterministic Büchi utomton. To see this, suppose there is some deterministic Büchi utomton tht ccepts L. Hence, for some n 1, δ(q 0, n1 ) F. Moreover, for some n 2, δ(q 0, n1 n2 ) F. By induction we produce n infinite word n1 n2 n3... ccepted y the utomton. Contrdiction. This shows tht deterministic trnsition system together with Büchi type cceptnce condition rec(π) F is not going to work: not only do we hve to construct deterministic trnsition system, we lso hve to modify our cceptnce conditions. Als, it is fr from cler how one should do this. One might wonder whether the lnguges recognized y deterministic Büchi utomt hve some nturl chrcteriztion. Since you sked... Let L Σ e lnguge. Define the dherence of L to e L = { x Σ ω x hs infinitely mny prefixes in L } The est wy to visulize this to think of Σ s n infinite tree. Mrk the nodes in this tree tht elong to L. Then L is the set of ll rnches in the tree tht touch infinitely mny mrked nodes. Note tht there my e no such rnches even when L is infinite. L L () () ω ( ) ( ) ω Adherence nd Büchi 29 The Chrcteriztion 30 The reson the dherence opertion is interesting is tht it connects ordinry lnguges with ω-lnguges. Given Büchi utomton we cn think of it s n ordinry NFA nd otin on ordinry lnguge L (A). Wht is the reltionship, if ny, etween L (A) nd L ω (A)? Consider run of the Büchi utomton on some input x Σ : π : p 0 x 0 p 1 x 1 p 2... p k x k p k+1... If x is ccepted y A, then, for infinitely mny i, we hve p i F. But then x 0x 1... x i 1 is ccepted y the NFA A. In other words L ω (A) L (A) An ω-lnguge L is recognized y deterministic Büchi utomton if, nd only if, L is the dherence of some regulr lnguge. We lredy know tht L ω (A) L (A) for ny Büchi utomton A. Now suppose A is in ddition deterministic. Then equlity holds nd we re done. For the opposite direction ssume L = K where K Σ is regulr. Then K is ccepted y deterministic finite stte mchine, for exmple, the miniml utomton A for K. Thinking of A s Büchi utomton, we hve L ω (A) = L.

6 But ewre... Adherence Exmple 31 Closure Properties 32 Consider gin the utomton Deterministic recognizle lnguges re closed under union nd intersection., c 3, c, c c 1 2 Union follows directly from the lst lemm nd A B = A B. For intersections note tht the modified product mchine construction from ove preserves determinism. Note tht () L (A). But then () ω L (A) L ω (A) Check ll the detils in the lst proof. The prolem is tht our finite computtions do not hve infinite extensions. Other ω-automt 34 Infinite Words Deterministic Lnguges As we hve seen, there re recognizle ω-lnguges tht cnnot e ccepted y ny deterministic Büchi utomton. Als, without determiniztion it is uncler how we could del with complements, which we need to hndle negtion. So, we need to find lterntive mchine models tht llow for deterministic descriptions of recognizle lnguges. 3 Muller nd Rin Automt As efore, we will not chnge the trnsition system, just the cceptnce condition. One firly nturl possiility is to completely pin down rec(π). Muller Automt 35 Exmple: Muller 36 A Muller utomton consists of deterministic trnsition system Q, Σ, τ nd n cceptnce condition q 0 Q nd F P(Q). A ccepts n infinite word x Σ ω if there is run π of A on x tht strts t q 0 nd such tht rec(π) F. F is often referred to s the tle of the Muller utomton. Note tht the tle my hve size exponentil in the size of the trnsition system. But, complementtion is esy (just s it ws esy for DFAs): mke sure the mchine is complete, then replce the old tle F y P(Q) F. Note tht this simple opertion might produce n exponentil low-up if done in hm-fisted wy. The t-lest-one-ut-finitely-mny- s lnguge from ove is ccepted y the following Muller utomton. The tle hs the form F = ((2), (3)) Note tht this utomton distinguishes etween n even nd odd numer of s. This is it scry since the distinction is y no mens ovious from the originl Büchi utomton.

7 The Complement 37 Muller nd Closure 38 We cn complement the tle to get mchine for the complement of the lnguge The complement tle contins severl useless entries (other thn ): As we hve seen, the fmily of lnguges ccepted y Muller utomt is closed under complementtion. It is in fct Boolen lger. Given two Muller utomt A 1 nd A 2 one cn construct new Muller utomton A such tht L(A) = L(A 1) L(A 2). As usul, we use product mchine A = A 1 A 2. The tle of A hs the form 1 1, 2 1, 3 2, 3 1, 2, 3 ω ( ) ω However, the two non-empty entries duly produce no s or infinitely mny s, exctly the complement of the lnguge. { F 1 F 2 F 1 F 1, F 2 F 2 } Since the mchines re deterministic it is esy to see tht this works. Muller versus Deterministic Büchi 39 Proof, contd. 40 A lnguge L Σ is recognizle y Muller utomton if, nd only if, it is of the form L = U i V i i n where U i, V i Σ ω re recognizle y deterministic Büchi utomton. In other words, L must lie in the Boolen lger generted y deterministic Büchi lnguges. Suppose L is recognized y A with tle F. Since L = F F L(A(F )) we only need to del with tles of size 1. But L(A(F )) = L(A(p)) L(A(q)) p F q / F For the opposite direction ssume U is ccepted y deterministic Büchi utomton A. Define F = { P Q P F } Then the corresponding Muller utomton A(F) ccepts U. But we know tht Muller lnguges form Boolen lger, so we cn get Muller utomton for ny Boolen comintion i n Ui Vi. Note tht the tle will hve exponentil size. where the utomt on the right hnd side re deterministic Büchi. Done y the closure properties of deterministic Büchi lnguges. Rin Automt 41 Exmple: Rin 42 Another possiility to modify cceptnce conditions is to ugment the positive condition of Büchi utomt y negtive condition: successful run must ultimtely void certin set of sttes. A Rin utomton consists of deterministic trnsition system Q, Σ, τ nd n cceptnce condition q 0 Q nd R P(Q) P(Q). A ccepts n infinite word x Σ ω if there is run π of A on x tht strts t q 0 nd such tht for some (L, R) R: rec(π) L = nd rec(π) R. The pirs (L, R) re clled Rin pirs: L is the negtive condition nd R the positive condition. In the specil cse where R = {(, F )} we re deling with deterministic Büchi utomton. The Muller utomton from ove cn lso e turned into Rin utomton with Rin pirs R = ((1, 2; 3), (1, 3; 2)) The excluded sets force til end of the run to look like 2 ω or 3 ω.

8 Büchi, Muller, Rin 43 Equivlence Muller nd Rin 44 The cceptnce condition for ll three hs the form initil sttes I ( singleton for Muller nd Rin) fmily F P(Q) of permissile vlues for the recurrent stte set of run. Note tht we my sfely ssume tht F contins only strongly connected sets. For Büchi utomt the fmily is trivil: F = {F } nd thus dt structure of size O(n). For Muller utomt it is explicitly specified nd potentilly lrge. For Rin utomt the specifiction is implicit: ll X Q such tht (L, R) R (X L =, X R ). Ech Rin pir is O(n), ut there my e exponentilly mny. So now we hve four clsses of utomt: deterministic Büchi, Büchi, Muller nd Rin. We will see tht Büchi, Muller nd Rin re ll equivlent nd strictly stronger thn deterministic Büchi. This result is similr to equivlences etween vrious types of utomt on finite strings, ut the rguments re more complicted. We will not consider nondeterministic versions of Muller nd Rin utomt here. Determiniztion 45 Muller to/from Rin 46 The reson these equivlences re so importnt is the following theorem (which we re not going to prove here). Theorem (Sfr 1988) There is n lgorithm to convert Büchi utomton into n equivlent Rin (or Muller) utomton. For every Rin utomton there exists n equivlent Muller utomton, nd conversely. Consider Rin utomton Q, Σ, τ; R. We will use the sme trnsition system nd define tle The lgorithm hs running time O(n log n) 2 F = { X Q (L, R) R (X L =, X R ) } Unfortuntely, this is optiml: there re exmples where the deterministic utomt re tht lrge. It is esy to see tht Q, Σ, τ; F is n equivlent Muller utomton. Equivlence, contd. 47 Rin to Büchi 48 The opposite direction is hrder. Let Q, Σ, δ; F e Muller utomton, sy, F = {F 1,..., F k}. Consider new trnsition system on stte set nd trnsitions Q = P(F 1)... P(F k) Q (U 1,..., U k, p) (U 1,..., U k, δ(p, )) where U i = if U i = F i nd F i (U i {δ(p, )}) otherwise. The Rin pirs re defined y L i = { (U 1,..., U k, p) p / F i } R i = { (U 1,..., U k, p) U i = F i } One cn verify tht the new mchine is equivlent to the given Muller utomton. For every Rin utomton there exists n equivlent Büchi utomton. Suppose A is some Rin utomton with n sttes nd m pirs (L i, R i). Let Q = Q { (p, i) Q [m] p / L i } i The Büchi utomton B inherits the initil stte nd the trnsitions from A; furthermore, for ech p q in A there re dditionl trnsitions p (q, i) (p, i) (q, i) in B whenever the corresponding sttes exist. Lstly, set F = { (p, i) p R i } Done.

9 Muller to Büchi 49 Efficiency 50 Consider Muller utomton with singleton tle, F = {F }. Here is construction of Büchi utomton tht voids powersets. Let F = {q 1,..., q n 1}. We construct nondeterministic Büchi utomton on sttes Q = Q (F [n] 0 where [n] 0 = {0, 1,..., n 1}. Let q = δ(p, ) nd set τ(p, ) = { {q} if q / F, {q, (q, 0)}, otherwise. (q, k) if p = q k, k > 0, τ((p, k), ) = (q, k + 1 mod n) if p = q k, k > 0, (q, 1) if k = 0. In the conversion Muller to Rin the trnsition system is unchnged. However, we introduce exponentilly mny entries in the tle, for ech Rin pir. For the direction Rin to Muller the new trnsition system lredy hs potentilly exponentil size in the the size of the old trnsition system (k cn e exponentil in the numer of sttes). The numer of pirs is lso exponentil, nd ech pir hs perhps exponentil size. A Rin utomton with n sttes n m pirs cn e simulted y Büchi utomton of size O(nm). Overll, these conversions will only e fesile for rther smll mchines. F = Q {0}.

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

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

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

More information

Lecture 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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Finite-State Automata: Recap

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

More information

Lecture 9: LTL and Büchi Automata

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

More information

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

CS 330 Formal Methods and Models

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

More information

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

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

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 lgorithms & Models of omputtion S/EE 374, Spring 209 NFs continued, losure Properties of Regulr Lnguges Lecture 5 Tuesdy, Jnury 29, 209 Regulr Lnguges, DFs, NFs Lnguges ccepted y DFs, NFs, nd regulr expressions

More information

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

More information

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

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

More information

NFA DFA Example 3 CMSC 330: Organization of Programming Languages. Equivalence of DFAs and NFAs. Equivalence of DFAs and NFAs (cont.

NFA DFA Example 3 CMSC 330: Organization of Programming Languages. Equivalence of DFAs and NFAs. Equivalence of DFAs and NFAs (cont. NFA DFA Exmple 3 CMSC 330: Orgniztion of Progrmming Lnguges NFA {B,D,E {A,E {C,D {E Finite Automt, con't. R = { {A,E, {B,D,E, {C,D, {E 2 Equivlence of DFAs nd NFAs Any string from {A to either {D or {CD

More information

FLAC Closure Properties

FLAC Closure Properties FLAC Closure Properties 1 Nondeterministic Mchines Klus Sutner Crnegie Mellon Universlity 2 Determiniztion Fll 2017 3 Closure Properties Where Are We? 3 The Logic Link 4 We hve definition of regulr lnguges

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

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

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

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

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

On Determinisation of History-Deterministic Automata.

On Determinisation of History-Deterministic Automata. On Deterministion of History-Deterministic Automt. Denis Kupererg Mich l Skrzypczk University of Wrsw YR-ICALP 2014 Copenhgen Introduction Deterministic utomt re centrl tool in utomt theory: Polynomil

More information

2.4 Linear Inequalities and Interval Notation

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

More information

1.4 Nonregular Languages

1.4 Nonregular Languages 74 1.4 Nonregulr Lnguges The number of forml lnguges over ny lphbet (= decision/recognition problems) is uncountble On the other hnd, the number of regulr expressions (= strings) is countble Hence, ll

More information

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

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

More information

Nondeterminism. Nondeterministic Finite Automata. Example: Moves on a Chessboard. Nondeterminism (2) Example: Chessboard (2) Formal NFA

Nondeterminism. Nondeterministic Finite Automata. Example: Moves on a Chessboard. Nondeterminism (2) Example: Chessboard (2) Formal NFA Nondeterminism Nondeterministic Finite Automt Nondeterminism Subset Construction A nondeterministic finite utomton hs the bility to be in severl sttes t once. Trnsitions from stte on n input symbol cn

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

11.1 Finite Automata. CS125 Lecture 11 Fall Motivation: TMs without a tape: maybe we can at least fully understand such a simple model?

11.1 Finite Automata. CS125 Lecture 11 Fall Motivation: TMs without a tape: maybe we can at least fully understand such a simple model? CS125 Lecture 11 Fll 2016 11.1 Finite Automt Motivtion: TMs without tpe: mybe we cn t lest fully understnd such simple model? Algorithms (e.g. string mtching) Computing with very limited memory Forml verifiction

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

CS 267: Automated Verification. Lecture 8: Automata Theoretic Model Checking. Instructor: Tevfik Bultan

CS 267: Automated Verification. Lecture 8: Automata Theoretic Model Checking. Instructor: Tevfik Bultan CS 267: Automted Verifiction Lecture 8: Automt Theoretic Model Checking Instructor: Tevfik Bultn LTL Properties Büchi utomt [Vrdi nd Wolper LICS 86] Büchi utomt: Finite stte utomt tht ccept infinite strings

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

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

BACHELOR THESIS Star height

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

More information

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

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 Tble of Contents: Week 1: Preliminries (set lgebr, reltions, functions) (red Chpters 1-4) Weeks

More information

The Regulated and Riemann Integrals

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

More information

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

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

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

More information