a b [^ab] ^a [^ab] [^ab]

Size: px
Start display at page:

Download "a b [^ab] ^a [^ab] [^ab]"

Transcription

1 Genertion of Pttern-Mtcing Algoritm y Extended Regulr Expreion Ikuo NAKATA 3 Summry. It i dicult to expre te denition of te comment of C lnguge in regulr expreion. However, te denition cn e expreed y imple regulr expreion y introducing pecil ymol, clled te ny-ymol, tt repreent ny ingle crcter, or y introducing kind of negtion ymol into regulr expreion. In generl, te prolem of tring pttern mtcing cn e expreed uc n extended regulr expreion, nd te correponding nite tte utomton generted from te expreion i equivlent to te Knut-Morri- Prtt pttern-mtcing lgoritm [4]. In prticulr, if we ue te ny-ymol, te pttern i not retricted to tring of crcter. It cn e ny regulr expreion. Our metod cn lo e pplied to te prolem of repeted pttern mtcing. Te Ao-Corick lgoritm [3] cn e derived mecniclly from n extended regulr expreion tt contin ny-ymol. 1 Introduction Te denition of comment of C lnguge cn e given tring compoed of tree tring in te following order: /*, tring tt doe not contin */ (my e n empty tring), */. Expreing te ove denition y regulr expreion i complicted ecue it i dicult to expre \ tring tt doe not contin */." Here, */ men tring of lengt two compoed of * followed y /. Altoug we cn ue te negtion ymol in lex, well-known cnner genertor, te expreion for te comment i till complex{for exmple, in [6], or /*/*([^*/]j[^*]/j*[^/])****/ (1) /*([^*]j***[^*/])****/ (2) in [5]. Here, (,),j,*,[,],^ re met ymol, * denote te repetition of te immedite predeceor zero or more time, nd [^*/] expree one crcter tt i neiter * nor /. Ti prolem cn e imply expreed if we cn deignte \ tring tt doe not contin */" directly. If te expreion of te ove tring i ^(*/) 3 Intitute of Informtion Science nd Electronic, Univerity of Tuku. 1 Copyrigt c 1996y Acdemic Pre, Inc. nd Iwnmi Soten, Pulier. All rigt of reproduction in ny form reerved. ISBN {12{3713{

2 2 Advnce in Softwre Science nd Tecnology 5, 1993 * ^* {^/} Fig. 1 Te utomton to recognize ^ (*/) ^* * / {^ } / Fig. 2 DFA for (^ (*/))**/ ten te denition of te comment i /*(^(*/))**/. Ti i te direct expreion of te denition. Here, we dene te mening of ^(*/) to e \te ed crcter of tring tt doe not contin */." In Figure 1, ti denition i own n utomton tt recognize ^(*/). In Figure 1, ^* denote te trnition y ny crcter except *, nd f^/g indicte te look-ed trnition y ^/ (tt i, te trnition y looking t ny crcter except / witout reding te crcter). Te utomton for te extended regulr expreion (^(*/))**/ i own in Figure 2. It i otined y pplying te well-known lgoritm tt generte rt n NFA (Nondeterminitic Finite Automton) from regulr expreion nd ten trnform it into DFA (Determinitic Finite Automton) [1, 5]. Ti i te utomton tt recognize te tring tt follow te ed tring /* of comment. It i lo te pttern-mtcing utomton tt recognize \te rt tring */" in given text. Anoter regulr expreion for \te rt tring */" cn e *<*/> were i dened, in te context of eing followed y <*/>, ny crcter tt i not te rt crcter of */. Nmely, in ti ce i te indirect expreion for ^(*/). y itelf men ny ingle crcter. We cn contruct te DFA for *<*/> follow: contruct te DFA for *(*/) rt, nd ten eliminte ll te trnition from te tte tt red */. Te reultnt utomton correpond to te previou regulr expreion (2) (ee pge 59 of [5]). In ti pper, we generlize te ove metod nd decrie metod tt mecniclly generte te pttern-mtcing lgoritm for ny regulr expreion (in te following, we identify n utomton wit te correponding lgoritm). If repreent xed crcter tring, ten te generted lgoritm i equivlent to te ptternmtcing lgoritm of Knut-Morri-Prtt (KMP) [4]. We furter ow metod

3 Genertion of Pttern Mtcing Algoritm y Extended Regulr Expreion 3 for generting te lgoritm of Ao-Corick (A-C) [3], well known n ecient lgoritm tt erce everl pttern repetedly. 2 Te Knut-Morri-Prtt Pttern-Mtcing Algoritm 2.1 Uing ny-ymol Let 6 e n lpet, e regulr expreion over 6, nd [] e te lnguge tt denote. We dd to 6 te pecil ymol. Te mening of i dened []=6 wen we ignore it context, nd te context-dependent mening i dened in te following. We introduce form of regulr expreion, *< >, wit te purpoe of expreing te ed tring u of given text x uc tt te til of u i te rt tring tt mtce. Tt i, *< > mtce u = vw, were u i te ortet tring uc tt u i te ed of x, nd < > mtce w. Here we tke w te rt tring if mtce ot w nd wz. We exclude te ce " 2 [], ecue in ti ce it mtce every " t ny plce in given text. We dene te ove regulr expreion follow: Denition 1: Let " 62 []. [*< >] = f x 2 6* j Tere exit y nd z uc tt x=yz; z 2 [], nd tere exit no xi uc tt x=x 1 x 2 x 3 ; x 2 2 []; x g. For exmple, if =* nd x=c, ten *< > mtce c ecue * in mtce ". In te following, we conider te tring pttern-mtcing prolem. In given text, te prolem of ercing te rt tring tt i mtced y ecome te prolem of recognizing te regulr expreion *< >. We cn contruct te utomton for ti expreion wit te following tep. Firt contruct te NFA y ppending te utomton for to te one for *. Next trnform te NFA to te DFA y te well-known metod. Ten eliminte ll te trnition from te tte tt contin te nl tte of te NFA for. We will illutrte ti y uing te exmple expreion *. Te utomton for * ppended y te one for * i own in Figure 3. In trnforming ti NFA to DFA, we follow te well-known metod except for te -trnition. For te -trnition from te tte to te tte t in NFA, we dd t to ll te trget tte of oter trnition from in DFA, nd we cnge te -trnition to te trnition y ny crcter tt i not contined in oter trnition from, own in Figure 4. For exmple, te trget tte of te - trnition in DFA of Figure 4 contin NFA Stte 1 nd 2, ecue tee re te trget tte of te -trnition nd -trnition in te NFA. Ten, to mke te rt mtced tte into te nl tte, we eliminte ll te trnition from te mtced tte{tt i, te tte tt contin nl tte in NFA. By pplying tee metod to Figure 3, we otin Figure 5. Here, ll te trnition from te tte compoed of NFA Stte 1 nd 4 ve een eliminted. Figure 5 correpond to te pttern-mtcing lgoritm of Knut-Morri-Prtt (KMP). However, KMP del only wit pttern of te form of = n; i 2 6. Our metod cn del wit generl regulr expreion pttern. For exmple, te ove * i regulr expreion tt contin te repeting ymol *. Te

4 4 Advnce in Softwre Science nd Tecnology 5, Fig. 3 NFA for ** [^] Fig. 4 Trnltion from NFA tt contin into DFA correponding utomton, te pttern-mtcing lgoritm, cn e generted y te uul metod modied y te metod own in Figure Uing negtion ymol of *< > in te previou ection cn e interpreted \te rt crcter of tring tt i dierent from." To expre ti more directly, we introduce te nottion ^ nd dene it follow. Te mening of ^ i imilr to te negtion of, ut it depend on it context nd i dierent from negtion dened [^]=6*[] in [2]. Denition 2: [(^)] = fx 2 6* j Tere exit nd z uc tt x=z; 2 6, z 2[], nd tere exit no xi uc tt x=x 1 x 2 ; x 1 2[]g. By uing ti nottion, te pttern-mtcing prolem for cn e expreed te prolem of recognizing te regulr expreion (^)*. Here, y Denition 2, (^) i interpreted under it rigt-nd context. Terefore (^)(^) i interpreted (^)((^)). Furtermore, we exclude te ce " 2 [], in te previou ection. Now, n exmple, we preent te pttern-mtcing prolem for c; tt i, we will contruct DFA for (^(c))*c. ^ [^] [^] Fig. 5 DFA tt recognize te rt *

5 Genertion of Pttern Mtcing Algoritm y Extended Regulr Expreion 5 { ^ { ^ } ^ } ^ } ^c } Fig. 6 DFA for ^ (c) { c ^ {^ } ^ } ^ } ^c } Fig. 7 DFA for (^ (c))*c DFA for ^(c) i own in Figure 6. In Figure 6, te tring compoed of crcter etween f nd g denote looked tring; tt i, tte trnition occur y tee crcter in uul utomton, ut, fter recognizing ^(), tee crcter re treted if tey ve not een red yet. In term of n utomton, te input tpe i mrked t te eginning of f-trnition, nd te input tpe i plced t te mrk t te end of g-trnition. DFA for (^(c))*c cn e otined y rt pplying te uul metod for NFA contruction to Figure 6 nd c, ten y pplying te uul lgoritm for trnltion from NFA to DFA. In ti proce, te crcter ccompnied y f or g re treted ordinl crcter. Te reult own in Figure 7 i te nve pttern mtcing lgoritm. For exmple, if te text cd i red y te utomton of Figure 7, te equence of tte trnition i 123c1f1c1g2345d1f123d1gf1d1g, nd te recognition fil. Here, te encloing rce men \reding gin." In ti lgoritm, fter ^ (c in ti exmple) een red, ^ i red gin, own in f^g. Ti i equivlent to reding two ^ t te initil tte. Te reultnt tte i te initil tte own in 1f1c1g. Terefore, in ti ce, it i equivlent to returning to te initil tte witout eing red gin. In oter word, f nd g cn e eliminted from te utomton. By pplying imilr optimiztion to oter trnition, DFA in Figure 8 i otined. Wen ^c i red t Stte 5 of Figure 7, te trnition proceed trictly 1f123g, ten te ^c tt i lt red ould e red gin to ee weter it i or not. Ti trnition i own in te trnition from Stte 5 to Stte 3 in Figure 8. Te lgoritm of Figure 8 i equivlent to te pttern-mtcing lgoritm of KMP (tt i own in te rt prt of [4] nd i referred in mny text ook of lgoritm KMP' pttern-mtcing lgoritm).

6 6 Advnce in Softwre Science nd Tecnology 5, 1993 { ^c } ^ c {^ } ^ {^ } Fig. 8 DFA for (^ (c))*c(fter optimiztion) ^ c [^ ] ^ [^ ] [^c ] Fig. 9 DFA for *< c > Note tt ti optimiztion cnnot e pplied, in generl, to te utomton tt contin loop, ecue te tring tt ould e red gin cnnot e determined uniquely. * in te previou ection i uc n exmple. Figure 9 i otined y pplying te metod in te previou ection tt ue ny-ymol to te ove exmple c. Ti i te optimized verion of Figure 8, ecue ti doe not contin ny red-gin trnition. Ti i equivlent to te lgoritm written in te lt prt of [4]. 3 Te Ao-Corick Algoritm Te Ao-Corick lgoritm i well known n ecient lgoritm for ercing everl pttern imultneouly nd repetedly. Ti lgoritm cn e derived y metod imilr to te one in te previou ection. 3.1 Uing ny-ymol In given text x, in order to erc ll te tring tt re mtced y te pttern of, it i ucient to erc for ll te tring in te ed prt of x tt re mtced y rt, ten to erc for in te ed of x, nd ten to erc for in te ed of x, nd o on. Terefore ti prolem i equivlent to te prolem of pttern mtcing wit *. Te lgoritm cn e derived DFA for * in wic te tte tt contin te nl tte of record te fct tt it recognized. For exmple, let = (ejejijer). Ti i te exmple in [3]. NFA for * i own in Figure 1.

7 Genertion of Pttern Mtcing Algoritm y Extended Regulr Expreion 7 e r i e Fig. 1 NFA for *(ejejijer) oter e r r 7 6 i 3 7 i 2 5 r e Fig. 11 DFA for repeted recognition of (ejejijer) DFA own in Figure 11 cn e otined from ti NFA y te well-known metod modied y -trnition, own in Figure 4. In Figure 11, every tte contin one or more tte in te originl NFA, nd numer on te rigt ide of tte re te numer of te nl tte in NFA. Te numer 2, 5, 7, nd 9 indicte tt tey re te tte tt record te recognition of e, e, i, nd er, repectively. An rrow to te numer in tringle indicte te trnition to te Stte in te ce of \oter crcter." For exmple, tte trnition from Stte ( 1) to Stte occur in ce of crcter oter tn,, e, i. Altoug Figure 11 look complex, it i not dicult to undertnd. For exmple, te trnition from Stte ( 2 5) re te me te trnition from Stte ( 2) ecue tere i no trnition from Stte 5 in NFA. Similrly, te trnition from Stte ( 3 7) nd from Stte ( 3 9) re te me te one from Stte ( 3). Every tte of ti DFA contin Stte of NFA nd te correponding trnition. Te ret of DFA tt i own in old rrow in Figure 11 look imilr to Figure 1. Te lgoritm in Figure 11 i te me te nl optimized lgoritm in [3]. Here it i derived mecniclly y ligtly expnding te well-known metod. 3.2 Uing negtion ymol ^ w introduced to indicte te ed crcter of tring tt i not mtced y. Here, we introduce one more ymol to indicte te ed crcter of tring

8 8 Advnce in Softwre Science nd Tecnology 5, 1993 tt i mtced y :. By uing ti ymol, te lgoritm for ercing ll tring tt re mtced y in given text cn e derived from te following regulr expreion: (^j )*. We need to dd to te derived utomton te ction of recording te recognition of tt i found wen i recognized. By pplying imilr metod to te one in Section 2.2 to ti (^j )*, we cn otin n lgoritm tt i equivlent to te one in [3]. However, we do not explin te metod ere, ecue it i not imple te previou metod. 4 Concluion We introduced te ymol for repreenting ny ingle crcter in regulr expreion, nd y giving context dependent interprettion to * we owed tt te denition of te comment in C lnguge, wic i dicult to dene y regulr expreion, cn e expreed nturlly y imple expreion. By pplying ti metod to generl regulr expreion, te pttern-mtcing lgoritm of Knut-Morri-Prtt cn e derived mecniclly not only for te pttern of crcter tring ut for te pttern expreed y generl regulr expreion. We lo owed tt imilr proce i poile y introducing ymol tt indicte kind of negtion expreion. Furtermore, we owed tt te prolem of repeted pttern mtcing for everl pttern cn e expreed in imple regulr expreion y uing *, nd te Ao-Corick lgoritm cn e derived mecniclly from te expreion. Altoug we did not invent ny eentilly new pttern-mtcing lgoritm y tee metod, we ucceeded in generlizing te pttern expreion. Becue te prolem of pttern mtcing cn e expreed in regulr expreion, our metod cn e implemented in lexicl nlyzer genertor uc lex. Acknowledgment. We would like to expre our tnk to Prof. Mtk S, Tokyo Intitute of Tecnology, for i vlule comment. Reference [1] Ao, A.V., Seti, R. nd Ullmn, J.D.: Compiler: Principle, Tecnique, nd Tool, Addion-Weley, [2] Ao, A.V., Seti, R. nd Ullmn, J.D.: Deign nd Anlyi of Computer Algoritm, Addion-Weley, [3] Ao, A.V. nd Corick, M.J.: Ecient String Mtcing: An Aid to Biliogrpic Serc, Comm. ACM, Vol. 18, No. 6 (1975), pp [4] Knut, D.E., Morri, J.H. Jr. nd Prtt, V.R.: Ft Pttern Mtcing in String, SIAM J. Comput., Vol. 6, No. 2 (1977), pp [5] Nkt, I.: Compiler, Sngyo-Too, Tokyo, 1981 (in Jpnee). [6] Screiner, A.T. nd Friedmn, H.G. Jr.: Introduction to Compiler Contruction wit UNIX, Prentice-Hll, 1985.

9 Genertion of Pttern Mtcing Algoritm y Extended Regulr Expreion 9 Ikuo Nkt Intitute of Informtion Science nd Electronic Univerity of Tuku Tuku, Irki 35 Jpn

Solutions Problem Set 2. Problem (a) Let M denote the DFA constructed by swapping the accept and non-accepting state in M.

Solutions Problem Set 2. Problem (a) Let M denote the DFA constructed by swapping the accept and non-accepting state in M. Solution Prolem Set 2 Prolem.4 () Let M denote the DFA contructed y wpping the ccept nd non-ccepting tte in M. For ny tring w B, w will e ccepted y M, tht i, fter conuming the tring w, M will e in n ccepting

More information

CSCI565 - Compiler Design

CSCI565 - Compiler Design CSCI565 - Compiler Deign Spring 6 Due Dte: Fe. 5, 6 t : PM in Cl Prolem [ point]: Regulr Expreion nd Finite Automt Develop regulr expreion (RE) tht detet the longet tring over the lphet {-} with the following

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

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

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

FABER Formal Languages, Automata and Models of Computation

FABER Formal Languages, Automata and Models of Computation DVA337 FABER Forml Lnguges, Automt nd Models of Computtion Lecture 5 chool of Innovtion, Design nd Engineering Mälrdlen University 2015 1 Recp of lecture 4 y definition suset construction DFA NFA stte

More information

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

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

More information

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

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

20.2. The Transform and its Inverse. Introduction. Prerequisites. Learning Outcomes

20.2. The Transform and its Inverse. Introduction. Prerequisites. Learning Outcomes The Trnform nd it Invere 2.2 Introduction In thi Section we formlly introduce the Lplce trnform. The trnform i only pplied to cul function which were introduced in Section 2.1. We find the Lplce trnform

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

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

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

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

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

Exercises Chapter 1. Exercise 1.1. Let Σ be an alphabet. Prove wv = w + v for all strings w and v.

Exercises Chapter 1. Exercise 1.1. Let Σ be an alphabet. Prove wv = w + v for all strings w and v. 1 Exercises Chpter 1 Exercise 1.1. Let Σ e n lphet. Prove wv = w + v for ll strings w nd v. Prove # (wv) = # (w)+# (v) for every symol Σ nd every string w,v Σ. Exercise 1.2. Let w 1,w 2,...,w k e k strings,

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

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

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

Math Week 5 concepts and homework, due Friday February 10

Math Week 5 concepts and homework, due Friday February 10 Mt 2280-00 Week 5 concepts nd omework, due Fridy Februry 0 Recll tt ll problems re good for seeing if you cn work wit te underlying concepts; tt te underlined problems re to be nded in; nd tt te Fridy

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

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

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

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

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

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

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

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

Automata and Languages

Automata and Languages Automt nd Lnguges Prof. Mohmed Hmd Softwre Engineering Lb. The University of Aizu Jpn Grmmr Regulr Grmmr Context-free Grmmr Context-sensitive Grmmr Regulr Lnguges Context Free Lnguges Context Sensitive

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

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

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

For convenience, we rewrite m2 s m2 = m m m ; where m is repeted m times. Since xyz = m m m nd jxyj»m, we hve tht the string y is substring of the fir

For convenience, we rewrite m2 s m2 = m m m ; where m is repeted m times. Since xyz = m m m nd jxyj»m, we hve tht the string y is substring of the fir CSCI 2400 Models of Computtion, Section 3 Solutions to Homework 4 Problem 1. ll the solutions below refer to the Pumping Lemm of Theorem 4.8, pge 119. () L = f n b l k : k n + lg Let's ssume for contrdiction

More information

Chapter 4 Regular Grammar and Regular Sets. (Solutions / Hints)

Chapter 4 Regular Grammar and Regular Sets. (Solutions / Hints) C K Ngpl Forml Lnguges nd utomt Theory Chpter 4 Regulr Grmmr nd Regulr ets (olutions / Hints) ol. (),,,,,,,,,,,,,,,,,,,,,,,,,, (),, (c) c c, c c, c, c, c c, c, c, c, c, c, c, c c,c, c, c, c, c, c, c, c,

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

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

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

Inference for Two Stage Cluster Sampling: Equal SSU per PSU. Projections of SSU Random Variables on Each SSU selection.

Inference for Two Stage Cluster Sampling: Equal SSU per PSU. Projections of SSU Random Variables on Each SSU selection. Inference for Two Stage Cluter Sampling: Equal SSU per PSU Projection of SSU andom Variable on Eac SSU election By Ed Stanek Introduction We review etimating equation for PSU mean in a two tage cluter

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

CSE 355 Homework Two Solutions

CSE 355 Homework Two Solutions CSE 355 Homework Two Solution Due 2 Octoer 23, tart o cla Pleae note that there i more than one way to anwer mot o thee quetion. The ollowing only repreent a ample olution. () Let M e the DFA with tranition

More information

Lecture Note 4: Numerical differentiation and integration. Xiaoqun Zhang Shanghai Jiao Tong University

Lecture Note 4: Numerical differentiation and integration. Xiaoqun Zhang Shanghai Jiao Tong University Lecture Note 4: Numericl differentition nd integrtion Xioqun Zng Sngi Jio Tong University Lst updted: November, 0 Numericl Anlysis. Numericl differentition.. Introduction Find n pproximtion of f (x 0 ),

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

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

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

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

1 Review: Volumes of Solids (Stewart )

1 Review: Volumes of Solids (Stewart ) Lecture : Some Bic Appliction of Te Integrl (Stewrt 6.,6.,.,.) ul Krin eview: Volume of Solid (Stewrt 6.-6.) ecll: we d provided two metod for determining te volume of olid of revolution. Te rt w by dic

More information

Non Deterministic Automata. Linz: Nondeterministic Finite Accepters, page 51

Non Deterministic Automata. Linz: Nondeterministic Finite Accepters, page 51 Non Deterministic Automt Linz: Nondeterministic Finite Accepters, pge 51 1 Nondeterministic Finite Accepter (NFA) Alphbet ={} q 1 q2 q 0 q 3 2 Nondeterministic Finite Accepter (NFA) Alphbet ={} Two choices

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

Math 2142 Homework 2 Solutions. Problem 1. Prove the following formulas for Laplace transforms for s > 0. a s 2 + a 2 L{cos at} = e st.

Math 2142 Homework 2 Solutions. Problem 1. Prove the following formulas for Laplace transforms for s > 0. a s 2 + a 2 L{cos at} = e st. Mth 2142 Homework 2 Solution Problem 1. Prove the following formul for Lplce trnform for >. L{1} = 1 L{t} = 1 2 L{in t} = 2 + 2 L{co t} = 2 + 2 Solution. For the firt Lplce trnform, we need to clculte:

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

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

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

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

CS:4330 Theory of Computation Spring Regular Languages. Equivalences between Finite automata and REs. Haniel Barbosa

CS:4330 Theory of Computation Spring Regular Languages. Equivalences between Finite automata and REs. Haniel Barbosa CS:4330 Theory of Computtion Spring 208 Regulr Lnguges Equivlences between Finite utomt nd REs Hniel Brbos Redings for this lecture Chpter of [Sipser 996], 3rd edition. Section.3. Finite utomt nd regulr

More information

A High Throughput String Matching Architecture for Intrusion Detection and Prevention

A High Throughput String Matching Architecture for Intrusion Detection and Prevention A Hig Trougput tring Matcing Arcitecture for Intruion Detection and Prevention Lin Tan, Timoty erwood Appeared in ICA 25 Preented by: aile Kumar Dicuion Leader: Max Podleny Overview Overview of ID/IP ytem»

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

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

Formal Languages Simplifications of CFGs

Formal Languages Simplifications of CFGs Forml Lnguges implifictions of CFGs ubstitution Rule Equivlent grmmr b bc ubstitute b bc bbc b 2 ubstitution Rule b bc bbc ubstitute b bc bbc bc Equivlent grmmr 3 In generl: xz y 1 ubstitute y 1 xz xy1z

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

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

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

Lexical Analysis Finite Automate

Lexical Analysis Finite Automate Lexicl Anlysis Finite Automte CMPSC 470 Lecture 04 Topics: Deterministic Finite Automt (DFA) Nondeterministic Finite Automt (NFA) Regulr Expression NFA DFA A. Finite Automt (FA) FA re grph, like trnsition

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

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

Combining functions: algebraic methods

Combining functions: algebraic methods Combining functions: algebraic metods Functions can be added, subtracted, multiplied, divided, and raised to a power, just like numbers or algebra expressions. If f(x) = x 2 and g(x) = x + 2, clearly f(x)

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

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

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

a b b a pop push read unread

a b b a pop push read unread A Finite Automton A Pushdown Automton 0000 000 red unred b b pop red unred push 2 An Exmple A Pushdown Automton Recll tht 0 n n not regulr. cn push symbols onto the stck cn pop them (red them bck) lter

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

Linear Systems with Constant Coefficients

Linear Systems with Constant Coefficients Liner Systems with Constnt Coefficients 4-3-05 Here is system of n differentil equtions in n unknowns: x x + + n x n, x x + + n x n, x n n x + + nn x n This is constnt coefficient liner homogeneous system

More information

Today s Topics Automata and Languages

Today s Topics Automata and Languages Tody s Topics Automt nd Lnguges Prof. Mohmed Hmd Softwre Engineering L. The University of Aizu Jpn DFA to Regulr Expression GFNA DFAèGNFA GNFA è RE DFA è RE Exmples 2 DFA è RE NFA DFA -NFA REX GNFA 3 Definition

More information

Automata and Languages

Automata and Languages Automt nd Lnguges Prof. Mohmed Hmd Softwre Engineering L. The University of Aizu Jpn Tody s Topics DFA to Regulr Expression GFNA DFAèGNFA GNFA è RE DFA è RE Exmples 2 DFA è RE NFA DFA -NFA REX GNFA 3 Definition

More information

Hilbert-Space Integration

Hilbert-Space Integration Hilbert-Space Integration. Introduction. We often tink of a PDE, like te eat equation u t u xx =, a an evolution equation a itorically wa done for ODE. In te eat equation example two pace derivative are

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

Free groups, Lecture 2, part 1

Free groups, Lecture 2, part 1 Free groups, Lecture 2, prt 1 Olg Khrlmpovich NYC, Sep. 2 1 / 22 Theorem Every sugroup H F of free group F is free. Given finite numer of genertors of H we cn compute its sis. 2 / 22 Schreir s grph The

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

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

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

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

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

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

More information

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

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

Gold s algorithm. Acknowledgements. Why would this be true? Gold's Algorithm. 1 Key ideas. Strings as states

Gold s algorithm. Acknowledgements. Why would this be true? Gold's Algorithm. 1 Key ideas. Strings as states Acknowledgements Gold s lgorithm Lurent Miclet, Jose Oncin nd Tim Otes for previous versions of these slides. Rfel Crrsco, Pco Cscuert, Rémi Eyrud, Philippe Ezequel, Henning Fernu, Thierry Murgue, Frnck

More information

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

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

More information

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 Univerity of Southern Cliforni Computer Siene Deprtment Compiler Deign Fll 6 Lexil Anlyi Smple Exerie nd Solution Prof. Pedro C. Dini USC / Informtion Siene Intitute 4676 Admirlty Wy, Suite Mrin del Rey,

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

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

CS 275 Automata and Formal Language Theory

CS 275 Automata and Formal Language Theory CS 275 Automt nd Forml Lnguge Theory Course Notes Prt II: The Recognition Problem (II) Chpter II.5.: Properties of Context Free Grmmrs (14) Anton Setzer (Bsed on book drft by J. V. Tucker nd K. Stephenson)

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

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

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

Lecture 6 Regular Grammars

Lecture 6 Regular Grammars Lecture 6 Regulr Grmmrs COT 4420 Theory of Computtion Section 3.3 Grmmr A grmmr G is defined s qudruple G = (V, T, S, P) V is finite set of vribles T is finite set of terminl symbols S V is specil vrible

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

CS 330 Formal Methods and Models

CS 330 Formal Methods and Models CS 330 Forml Methods nd Models Dn Richrds, section 003, George Mson University, Fll 2017 Quiz Solutions Quiz 1, Propositionl Logic Dte: Septemer 7 1. Prove (p q) (p q), () (5pts) using truth tles. p q

More information

SWEN 224 Formal Foundations of Programming WITH ANSWERS

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

More information

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

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

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

This appendix derives Equations (16) and (17) from Equations (12) and (13).

This appendix derives Equations (16) and (17) from Equations (12) and (13). Capital growt pat of te neoclaical growt model Online Supporting Information Ti appendix derive Equation (6) and (7) from Equation () and (3). Equation () and (3) owed te evolution of pyical and uman capital

More information