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

Size: px
Start display at page:

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

Transcription

1 Outline Automt Theory 101 Rlf Huuck Introduction Finite Automt Regulr Expressions ω-automt Session Rlf Huuck 1 Session Rlf Huuck 2 Acknowledgement Some slides re sed on Wolfgng Thoms excellent lecture on Automtentheorie nd Formle Sprchen. Introduction Session Rlf Huuck 4 Session Rlf Huuck 3 1

2 Bsics Why words? Bsic ojects in mthemtics numer (numer theory, nlysis) shpes (geometry) sets nd trnsformtion on such ojects Bsic ojects in computer science words stet of words (lnguge) nd their trnsformtions defining nd descriing words Every IT system is out dt nd trnsformtion of dt word from lphet {0,1} progrm is lso just finite word every terminting execution is finite word progrmming lnguge is the set of ll permissile words (i.e., ccepted progrms) Automt nd Grmmrs re ll out ccepting/generting words nd defining lnguge. Session Rlf Huuck 5 Session Rlf Huuck 6 Automton s o s 1 finl/ccepting stte Finite Automt defines lnguge of ll words over lphet {,} with n odd numer of s. Session Rlf Huuck 8 Session Rlf Huuck 7 2

3 Words & Lnguges Opertions on Words An lphet is non-empty set of symols/letters. Σ = {0,1} Σ lt = {, z,a,,z} A word is sequence of symols from n lphet Σ * hello Σ * lt A lnguge is the set of ll possile words Σ * (ll finite Boolen words) Σ * lt (ll finite words of ltin chrcters) A grmmr/utomton restricts to meningful lnguges Conctention of words: u= 1 m nd v= 1 n (m,n 0) u v = 1 m 1 n Note: empty word, word of length 0, ut not u = u= u We often write uv insted of u v. ll 8-it words ll English words Session Rlf Huuck 9 Session Rlf Huuck 10 Opertions on Lnguges Kleene Str Conctention of lnguges K nd L: K L = {uv Σ * u K, v L} Exmple: K={follow, me} L={follow, you} K L= {followfollow, meyou, followyou} Iterting lnguge L L 0 ={} L 1 =L L 2 =L L L n+1 =L n L Kleene str: L * =U n 0 L n Exmple: {,} * = {,,,,,,,, } ll finite sequences over {,}. Session Rlf Huuck 11 Session Rlf Huuck 12 3

4 Deterministic vs Non-Deterministic Definition DFA, A DFA is of the form Deterministic Finite Automton (DFA) from every stte every symol leds to unique stte To model lgorithms. Non-deterministic Finite Automton (NFA) from stte the sme symol might led t o different sttes or no stte To model systems or environment. A=(S,Σ,s 0,δ,F) where S finite set of sttes Σ lphet s 0 initil stte δ : S Σ S trnsition function F S set of finl sttes Session Rlf Huuck 13 Session Rlf Huuck 14 Accepting Run of DFA Lnguge of DFA A run over word w= 0,, n (n 0) of n DFA is sequence of sttes q 0,, q n+1 such tht q 0 = s 0 nd δ (q i, i )=q i+1 (0 i n) The lnguge ccepted y DAF A is L(A) = {w Σ * δ (s 0,w) F } A lnguge K is clled DFA ccepting if there is DFA such tht L(A)=K. We lso write δ (q 0,w)=q n+1. Two DFAs A nd B re equivlent of L(A)=L(B). A run is ccepting iff q n+1 F. Session Rlf Huuck 15 Session Rlf Huuck 16 4

5 Definition NFA Accepting Run of NFA A NFA is of the form A=(S,Σ,s 0,Δ,F) where S finite set of sttes Σ lphet s 0 initil stte Δ :S Σ S trnsition reltion F S set of finl sttes no longer function, A run over word w= 0,, n (n 0) of n NFA is sequence of sttes, q 0,, q n+1 such tht s q 0 = s 0 nd 0 s 1 (q i, i,q i+1 ) Δ (0 i n) We lso write q 0 w q n+1. A run is ccepting iff q n+1 F. Session Rlf Huuck 17 Session Rlf Huuck 18 Lnguge of NFA Question The lnguge ccepted y NFA A is L(A) = {w Σ * s 0 w s nd s F } A lnguge K is clled NFA ccepting if there is NFA such tht L(A)=K. Is there lnguge tht is either DFA or n NFA ccepting, ut not oth? Two NFAs A nd B re equivlent of L(A)=L(B). Session Rlf Huuck 19 Session Rlf Huuck 20 5

6 Answer: No Ide: NFA to DFA Clim: L DFA ccepting L NFA ccepting, NFA DFA Proof: L DFA ccepting L NFA ccepting esy: every DFA is in prticulr n NFA, just relx δ to e reltion L NFA ccepting L DFA ccepting slightly hrder, ide see next slide Power set construction {s 0 } {s 0, s 1 } stte spce power set keep initil stte for every symol nd stte hve trnsition to the exct rechle suset ll sttes which contin finl stte re finl sttes {s 1 } {}, Session Rlf Huuck 21 Session Rlf Huuck 22 Definition Power Set Automton Proof NFA DFA Given NFA A=(S,Σ,s 0,Δ,F). Define power set DFA A =(S,Σ,s 0,δ,F ) s follows: S := 2 S s 0 := {s o } δ (P,) ={q S there is p P : (p,,q) Δ} F := {P S P F } Lemm: We show A nd A re equivlent y showing A: s 0 w s iff s δ({s 0 },w) Proof: A: s 0 w s iff s Rech A (w) iff s δ({s 0 },w). rechle sttes for w This implies: A: s 0 w s with s F iff s δ({s 0 },w) F Hence: A is w ccepting iff A is w ccepting. Session Rlf Huuck 23 Session Rlf Huuck 24 6

7 Another Wy of Defining Lnguge Regulr Expression Exmple ll words strting with 1 or 3 s followed y possile sequence of s followed y t lest 1 Regulr Expression ( + ) ( ) * * Brckets nd conctention symols re sometimes omitted when cler from the context. Session Rlf Huuck 25 Session Rlf Huuck 26 RE Syntx RE Semntics Definition: The set of regulr expressions RE Σ over Σ = { 1,, n } is defined inductively y: Bse elements:,, 1,, n Constructors: if r nd s re regulr expression so re (r+s), (r s), nd r * Alterntively this cn e defined in terms of BNF grmmr. We define lnguge L(r) Σ * (set of words) for every regulr expression r RE Σ s follows: L : RE Σ 2Σ is defined inductively: 1. L( )=, L()={}, L( i )={ i } 2. L(r+s) = L(r) + L(s) L(r s) = L(r) L(s) L(r * ) =(L(r)) * A lnguge is regulr if it is definle y regulr expression. Session Rlf Huuck 27 Session Rlf Huuck 28 7

8 Regulr Expressions in UNIX Question [ 1, 2,, n ] insted of n. insted of Σ (ny letter) insted of + r? insted of + r r+ insted of r * r r{4} insted of rrrr Is there lnguge tht cn e expressed either y n NFA/DFA or n RE ut not oth? Session Rlf Huuck 29 Session Rlf Huuck 30 Answer RE to NFA: Thompson Construction Kleene s Theorem who lso rught us the Kleene lger, the Kleene str, Kleene's recursion theorem nd the Kleene fixpoint theorem For every RE there is n equivlent NFA nd for every NFA there is n equivlent RE. Induction Bse cse r= : define A r s cse r=: define A r s We give the proof (sketch) y ) presenting n inductive construction from RE to NFA nd ) the ide of trnsformtion lgorithm from NFA to RE cse r= ( Σ): define A r s Session Rlf Huuck 31 Session Rlf Huuck 32 8

9 RE to NFA: Thompson Construction Ide: NFA to RE Induction Step cse r+s: define A r + A s s cse r s: define A r A s s A r A r A s A s Clim: For every NFA we cn construct n equivlent RE. Proof (ide): Crete RE from trnsition lels of NFA. There is grph trnsformtion lgorithm tht does exctly this. It is know s the elimintion lgorithm. cse r * : define A r* s A r Session Rlf Huuck 33 Session Rlf Huuck 34 Exmple Closure Properties, Product Automton Strt trnsform to + + (+) * If K,L Σ * regulr then K L, K L nd K comp := Σ * \Kregulr. E.g.:K L cn e otined y synchronous product utomton A : For NFA A k =(S k,σ,s 0k,Δ k,f k ) for K nd A L =(S L,Σ,s 0L,Δ L,F L ) for L we define: A := (S k S L,Σ,(s 0k,s 0L ),Δ,F) where ((s k,s l ),,(s k,s l )) Δ iff (s k,,s k ) Δ k nd (s L,,s L ) Δ L F := F k F L Ide: Run A k, A L in prllel nd only ccept if oth ccept. Session Rlf Huuck 35 Session Rlf Huuck 36 9

10 Exmple Synchronized Product A synchronized product on NFAs A 1 =(S 1,Σ 0 Σ 1,s 01,Δ 1,F 1 ), A 2 =(S 2,Σ 0 Σ 2,s 02,Δ,F 2 2 ) with disjoint Σ 0, Σ 1, Σ 2 is defined y: A sync := (S 1 S 2,Σ,(s 01,s 02 ),Δ,F) where ((s 1,s 2 ),,(s 1,s 2 )) Δ iff Σ 1, (s 1,,s 1 ) Δ 1, s 2 =s 2 or Σ 2, (s 2,,s 2 ) Δ 2, s 1 =s 1 or Σ 0, (s 1,,s 1 ) Δ 1 nd (s 2,,s 2 ) Δ 2 F := F 1 F 2 Mens: A 1, A 2 cn move independently on Σ 1, Σ 2, ut must synchronize on Σ 0 Session Rlf Huuck 37 Session Rlf Huuck 38 Exmple Good To Knows For ny NFAs A,B: emptiness prolem: L(A)=? infinity prolem: Is L(A) infinite? inclusion prolem: L(A) L(B)? equivlence prolem: L(A)=L(B)? re ll decidle. Session Rlf Huuck 39 Session Rlf Huuck 40 10

11 Model Checking s Inclusion Prolem Model Checking s Inclusion Prolem Model Checking Prolem: M ² φ? System stisfies property? Specil cse: NFA A stisfies RE B Solving y: Trnsform RE B in NFA nd check if L(A) L(B) which is checking: L(A) (Σ * \ L(B))= Session Rlf Huuck 41 Model Checking Prolem: M ² φ? System stisfies property? Typicl: Model checking is not only concerned out finite runs ut lso infinite, e.g., for non-terminting processes. This requires more powerful frmeworks: ω Automt insted of NFAs, temporl logic insted of RE. Session Rlf Huuck 42 Something to Rememer Progrmmer Regulr expressions powerful for pttern mtching Implement regulr expressions with finite stte mchines. exmple: lexer ω Automt Theoreticin Regulr expression is compct description of set DFA is n strct mchine tht solves pttern mtch equivlence DFA/NFA nd regulr expressions model checking s inclusion prolem Session Rlf Huuck 44 Session Rlf Huuck 43 11

12 From Finite to Infinite Systems Buchi Automt So fr: DFA/NFA nd regulr expressions define finite systems terminting progrms, lgorithms etc. Now: infinite systems, i.e., systems with infinite runs non-terminting progrms, operting systems, etc. Infinite words re clled ω words nd the utomt generting them ω utomt. A (non-deterministic) Buchi utomton Σ, S, s 0, Δ,F Σ is finite lphet S is finite set of sttes s 0 Q is suset of initil sttes Δ: Q Σ Q is trnsition reltion F S is suset of ccepting sttes For n infinite run r let Inf(r) = { s s=s i for infinitely mny i }. A run r of Buchi utomton is ccepting iff Inf(r) F, i.e., some finl stte occurs infinitely often. Session Rlf Huuck 45 Session Rlf Huuck 46 Exmple ω regulr Lnguges c s 2 An ω word hs finite prefix from s 0 to s nd then revisits s infinitely often. r 1 = s 2 s 2 s 2 s 2 r 2 = s 2 s 1 s 2 s 1 r 3 = s 2 s 1 s 1 s 1 ACCEPTED ACCEPTED REJECTED For utomton A, if U s is the regulr set of ll finite words s 0 to s nd V s the regulr set of ll finite revisits. An ω word is α=uv 0 v 1 where u U s, v i V s, i 0 We write α U s V ω s. The ω regulr lnguge of A is L ω (A)=U s F U s V ω s. A lnguge is ω regulr iff Buchi recognizle. Session Rlf Huuck 47 Session Rlf Huuck 48 12

13 Other ω Automt Equivlence There re different types of ω-utomt. They typiclly only differ in their cceptnce conditions. Buchi: Inf(r) F, Muller: F F Inf(r)=F for F 2 S (must mtch one set) Rin: n i=1 (Inf(r) E i = nd Inf(r) F i ) for E i,f i S nd cceptnce set {(E 1,F 1 ),,(E n,f n )}, i.e., ll sttes of E i only visited finitely often, ut some sttes of F i infinitely Street: n i=1 (Inf(r) E i nd Inf(r) F i = ) for E i,f i S nd cceptnce set {(E 1,F 1 ),,(E n,f n )} (dul to Rin) For non-deterministic ω-utomt the following re equivlent (recognize the sme lnguge): Buchi Muller Rin Street Session Rlf Huuck 49 Session Rlf Huuck 50 McNughton s Theorem Conclusion McNughton s Theorem: Buchi cn e trnsformed into equivlent deterministic Muller. From its proof (Sfr s construction) follows: non-deterministic Buchi Muller (deterministic/non-deterministic) Street (deterministic/non-deterministic) Rin (deterministic/non-deterministic) deterministic Muller, deterministic Rin, deterministic Street nd non-deterministic Buchi Session Rlf Huuck 51 Session Rlf Huuck 52 13

14 Product of Buchi Automt Product of Buchi Automt A 1 A 2 A 1 A 2 r 1 r 2 s 1 s 2 r 1 r 2 s 1 s 2 L(A 1 )={ ω } L(A 2 )={ ω } L(A 1 )={ ω } L(A 2 )={ ω } The product using the sme construction s for NFAs: The product A 1 A 2 A 1 A 2 Copy 0 Copy 1 Copy 2 (r 1,s 1 ) (r 2,s 1 ) (r 1,s 2 ) (r 2,s 2 ) Does not work! As oviously L(A 1 A 2 )= L(A 1 )=L(A 1 )= { ω } (r 1,s 1 ) (r 2,s 1 ) (r 1,s 2 ) (r 2,s 2 ) (r 1,s 1 ) (r 2,s 1 ) (r 1,s 2 ) (r 2,s 2 ) (r 1,s 1 ) (r 2,s 1 ) (r 1,s 2 ) (r 2,s 2 ) Session Rlf Huuck 53 Session Rlf Huuck 54 Product of Buchi Automt Product of Buchi Automt A 1 A 2 A 1 A 2 r 1 r 2 s 1 s 2 r 1 r 2 s 1 s 2 L(A 1 )={ ω } L(A 2 )={ ω } L(A 1 )={ ω } L(A 2 )={ ω } The product A 1 A 2 The product A 1 A 2 Copy 0 Copy 1 Copy 2 (r 1,s 1 ) (r 2,s 1 ) (r 1,s 1 ) (r 2,s 1 ) (r 1,s 1 ) (r 2,s 1 ) (r 1,s 1 ) (r 1,s 1 ) (r 1,s 2 ) (r 2,s 2 ) (r 1,s 2 ) (r 2,s 2 ) (r 1,s 2 ) (r 2,s 2 ) (r 2,s 2 ) (r 2,s 2 ) Session Rlf Huuck 55 Session Rlf Huuck 56 14

15 Product of Buchi Automt Lessons Lerned Strtegy multiply the product utomton y 3 (S = S 1 S 2 {0,1,2} ) 0 copy initil sttes, 2 copy finl sttes trnsition reltion like norml product utomton, ut redirect rcs such tht trnsition to the 1 copy if in 0 copy nd visiting finl stte from A 1 trnsition to the 2 copy if in 1 copy nd visiting finl stte from A 2, ll trnsitions from 2 copy led to 0 copy DFA vsnfa regulr vs DFA/NFA product of NFAs (intersection of lnguges) ω utomt product of ω utomt The product of A 1, A 2 gives us the intersection of their two lnguges. Session Rlf Huuck 57 Session Rlf Huuck 58 Next Lecture Model Checking Prolem: M ² φ? System stisfies property? Hve nice lnguge to specify φ: use temporl logic. Session Rlf Huuck 59 15

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

a,b a 1 a 2 a 3 a,b 1 a,b a,b 2 3 a,b a,b a 2 a,b CS Determinisitic Finite Automata 1

a,b a 1 a 2 a 3 a,b 1 a,b a,b 2 3 a,b a,b a 2 a,b CS Determinisitic Finite Automata 1 CS4 45- Determinisitic Finite Automt -: Genertors vs. Checkers Regulr expressions re one wy to specify forml lnguge String Genertor Genertes strings in the lnguge Deterministic Finite Automt (DFA) re nother

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

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

Formal Methods in Software Engineering

Formal Methods in Software Engineering Forml Methods in Softwre Engineering Lecture 09 orgniztionl issues Prof. Dr. Joel Greenyer Decemer 9, 2014 Written Exm The written exm will tke plce on Mrch 4 th, 2015 The exm will tke 60 minutes nd strt

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

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

ɛ-closure, Kleene s Theorem,

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

More information

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

Introduction to ω-autamata

Introduction to ω-autamata Fridy 25 th Jnury, 2013 Outline From finite word utomt ω-regulr lnguge ω-utomt Nondeterministic Models Deterministic Models Two Lower Bounds Conclusion Discussion Synthesis Preliminry From finite word

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

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

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

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

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

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

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

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

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

Software Engineering using Formal Methods

Software Engineering using Formal Methods Softwre Engineering using Forml Methods Propositionl nd (Liner) Temporl Logic Wolfgng Ahrendt 13th Septemer 2016 SEFM: Liner Temporl Logic /GU 160913 1 / 60 Recpitultion: FormlistionFormlistion: Syntx,

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

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

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

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY. FLAC (15-453) - Spring L. Blum

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY. FLAC (15-453) - Spring L. Blum 15-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY THE PUMPING LEMMA FOR REGULAR LANGUAGES nd REGULAR EXPRESSIONS TUESDAY Jn 21 WHICH OF THESE ARE REGULAR? B = {0 n 1 n n 0} C = { w w hs equl numer of

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

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

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

CSCI 340: Computational Models. Transition Graphs. Department of Computer Science

CSCI 340: Computational Models. Transition Graphs. Department of Computer Science CSCI 340: Computtionl Models Trnsition Grphs Chpter 6 Deprtment of Computer Science Relxing Restrints on Inputs We cn uild n FA tht ccepts only the word! 5 sttes ecuse n FA cn only process one letter t

More information

CS375: Logic and Theory of Computing

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

More information

Closure Properties of Regular Languages

Closure Properties of Regular Languages of Regulr Lnguges Dr. Neil T. Dntm CSCI-561, Colordo School of Mines Fll 2018 Dntm (Mines CSCI-561) Closure Properties of Regulr Lnguges Fll 2018 1 / 50 Outline Introduction Closure Properties Stte Minimiztion

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

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

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

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

1.3 Regular Expressions

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

More information

CMSC 330: Organization of Programming Languages. DFAs, and NFAs, and Regexps (Oh my!)

CMSC 330: Organization of Programming Languages. DFAs, and NFAs, and Regexps (Oh my!) CMSC 330: Orgniztion of Progrmming Lnguges DFAs, nd NFAs, nd Regexps (Oh my!) CMSC330 Spring 2018 Types of Finite Automt Deterministic Finite Automt (DFA) Exctly one sequence of steps for ech string All

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

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

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

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

More general families of infinite graphs

More general families of infinite graphs More generl fmilies of infinite grphs Antoine Meyer Forml Methods Updte 2006 IIT Guwhti Prefix-recognizle grphs Theorem Let G e grph, the following sttements re equivlent: G is defined y reltions of the

More information

Lexical Analysis Part III

Lexical Analysis Part III Lexicl Anlysis Prt III Chpter 3: Finite Automt Slides dpted from : Roert vn Engelen, Florid Stte University Alex Aiken, Stnford University Design of Lexicl Anlyzer Genertor Trnslte regulr expressions to

More information

CSC 311 Theory of Computation

CSC 311 Theory of Computation CSC 11 Theory of Computtion Tutoril on DFAs, NFAs, regulr expressions, regulr grmmr, closure of regulr lnguges, context-free grmmrs, non-deterministic push-down utomt, Turing mchines,etc. Tutoril 2 Second

More information

Context-Free Grammars and Languages

Context-Free Grammars and Languages Context-Free Grmmrs nd Lnguges (Bsed on Hopcroft, Motwni nd Ullmn (2007) & Cohen (1997)) Introduction Consider n exmple sentence: A smll ct ets the fish English grmmr hs rules for constructing sentences;

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.6.: Push Down Automt Remrk: This mteril is no longer tught nd not directly exm relevnt Anton Setzer (Bsed

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

Nondeterministic Biautomata and Their Descriptional Complexity

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

More information

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

GNFA GNFA GNFA GNFA GNFA

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

More information

Languages & Automata

Languages & Automata Lnguges & Automt Dr. Lim Nughton Lnguges A lnguge is sed on n lphet which is finite set of smols such s {, } or {, } or {,..., z}. If Σ is n lphet, string over Σ is finite sequence of letters from Σ, (strings

More information

Deterministic Finite-State Automata

Deterministic Finite-State Automata Deterministic Finite-Stte Automt Deepk D Souz Deprtment of Computer Science nd Automtion Indin Institute of Science, Bnglore. 12 August 2013 Outline 1 Introduction 2 Exmple DFA 1 DFA for Odd number of

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

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

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