3. Finite automata and regular languages: theory

Size: px
Start display at page:

Download "3. Finite automata and regular languages: theory"

Transcription

1 series-prllel-loop construction (3.5, 3.6) -free DFA RE -hull (3.3) power set (3.4) dynmic progrmming (3.6) 3. Finite utomt nd regulr lnguges: theory jn Among the vrious forml lnguges tht rise nturlly in the theory of utomt nd phrse structure grmmrs, regulr lnguges re the simplest nd rguly the most useful. They re universlly used in text serching pplictions, nd they pper s importnt components of prcticlly ll the forml nottions developed y computer science, such s those prts of progrmming lnguges tht cn e processed y lexicl nlysis. Regulr lnguges cn e defined in three distinct wys: s the lnguges ccepted y deterministic finite utomt (DFA), y non-deterministic finite utomt (), nd y regulr expressions (RE). Ech of these formlisms sheds light on different properties of regulr lnguges. The min gol of this chpter is to show the equivlence of DFAs, s, nd regulr expressions, using the cyclic reduction shown elow, where X Y mens whtever cn e expressed y X, cn lso e expressed y Y. Since s re generliztion of DFAs, denoted y s et inclusion, it is cler tht they re t lest s powerful s DFAs - the interesting comprisons re those indicted y. From the equivlence of these different models of computtion, ll the mjor properties of regulr lnguges follow redily. series-prllel-loop construction (3.5, 3.6) -free DFA RE -hull (3.3) power set (3.4) dynmic progrmming (3.6) 3. Vrieties of utomt: concepts, definitions, terminology Nottion: Alphet A, e.g. A = {,,..}. Kleene str A* = { w w =... m, m, i A}. A + = AA*. Nullstring. Empty set {} or Ø. Lnguge L A*. Set S = {s, s,.., s, s,..}. Crdinlity S. Power set S. not or complement. Deterministic Finite Automton (FA, DFA) M = (S, A, f, s, F) Set of sttes S, lphet A, trnsition function f: S x A -> S, initil stte s, ccepting or finl sttes F S Extend f from S x A -> S to f: S x A* -> S s follows: f(s, ) = s, f(s, w) = f( f(s, w), ) for w Α Df: M ccepts w A* iff f(s, w) F. Set L A* ccepted y M: L(M) = { w f(s, w) F}. Non-deterministic Finite Automton () with -trnsitions: f: S x (A {}) -> S. Specil cse: without -trnsitions: f: S x A -> S. Extend f: S x A* -> S : f(s, ) = -hull of s = ll sttes rechle from s vi -trnsitions (including s); f(s, w) = f(s, ) for s f(s, w). Extend f further f: S x A* -> S s follows: f(s,.., sk, ) = f(si, ) for i =,.., k. Df: M ccepts w A* iff f(s, w) F {}. Notice: w is ccepted iff some w-pth from s fo F. Set L A* ccepted y M: L(M) = { w f(s, w) F {}}. The opertion of non-deterministic mchine cn e interpreted in equivlent wys: - Orcle: For ny given word w, if there is ny sequence of trnsitions tht leds to n ccepting stte, the mchine will mgiclly find it, like sleep wlker, voiding ll the pths tht led to rejecting stte. - Concurrent computtion: The mchine spwns multiple copies of itself, ech one trcing its own root-to-lef

2 pth of the tree of ll possile choices. If ny copy reches n ccepting stte, it rodcsts success. Non-determinism yields n exponentil increse in computing power! Df: Two FAs (of ny type) re equivlent iff they ccept the sme lnguge. HW 3.: Design ) n nd ) DFA tht ccepts the lnguge L = ( )* of ll strings tht terminte in. Given n ritrry string w over {, }, descrie generl rule for constructing ) n N(w) nd ) DFA M(w) tht ccepts the lnguge L(w) = ( )*w. 3. Exmples: the cse for non-determinism Ex : FAs cn t count, or more precisely, DFA M cn count up to constnt which is t most equl to the numer M of its sttes. The fixed, finite memory cpcity is the most importnt property of FAs, nd it severely limits their computing power. As n exmple, we show tht no FA cn recognize L = { k k k > }. By wy of contrdiction, ssume FA M tht ccepts L, nd denote M s numer of sttes y M = n. In the course of ccepting w = n n, s M reds the prefix n, it goes thru n+ sttes s, s,.., sn. By the pigeon hole principle, some sttes si, sj in this sequence must e equl, si = sj, i < j. Thus, M cnnot distinguish the prefixes i nd j, nd hence lso ccepts, incorrectly, w = n -(j-i) n, nd mny other ill-formed strings. Contrdiction, QED. Ex : Creful out cn t count! Let L = {w { }* () = () }. In ny w, ups = nd downs = lternte, so () = () ±. Solution: L = {w first chrcter = lst chrcter } "" Exercise: We sw -stte fsm seril dder. Show tht there is no fsm multiplier for numers of ritrry size. DFAs re conceptully strightforwrd: when in stte s you red input, go to stte s (nd perhps produce some output. s cn e considerly trickier, s the numer of ction sequences they might produce explodes. Three min resons rgue for introducing non-determinism despite the dded complictions. The most generl reson is tht non-deterministic lgorithms re interesting nd importnt, nd the theory should e le to model them. A second reson ecomes pprent when developing the complexity theory towrds the end of this course, where the P vs. NP question reltes the two most importnt complexity clsses. The third reson ecomes pprent in the course of this chpter: s re very convenient technique to desing FAs nd prove their properties. Ex 3: s clirvoynce yields n exponentil reduction of the size of the stte spce s compred to DFAs. Consider L k = ( )* ( ) k- i.e. ll strings whose k-th lst it is. A ccepts L k using only k+ sttes (s shown for k = nd k = 3) y guessing where the til-end k its strt., L s s,, L3 s s,, A DFA tht ccepts L k must contin shift register k its long, hence hs t lest k sttes. This shows tht, in generl, simulting y DFA requires n exponentil increse in the size of the stte spce. The following DFA M(L ) hs stte for ech of the -it suffixes,,,. Ech stte s corresponds to lnguge, i.e. set of words tht led M from its initil stte to s. The short strings,, cn e ssocited with some set of long strings with the following semntics:,, *: no hs een seen tht might e useful s the next-to-lst it, *: the current it is, if this turns out to e the next-to-lst it, we must ccept *: ccept if this is the end of the input; if not, go to stte * or * depending on the next it red *: ccept if this is the end of the input; if not, go to stte * or * depending on the next it red

3 *, * * * This DFA M(L ) is suset of of DFA M(L ) with 8 sttes tht is otined from the generl construction of section 3.4 to simulte N y some DFA M. 3.3 Spontneous trnsitions: convenient, ut not essentil Lemm (-trnsitions): Any N with -trnsitions cn e converted to n equivlent M without -trnsitions. The sic ide is simple, s illustrted elow. An -trnsitions from r to s implies tht nything tht N cn do strting in s, such s n -trnsition from s to t, N cn lredy do strting in r. After dding pproprite new trnsitions, such s the -trnsition from r to t, the -trnsition from r to s cn e deleted. r s t r s t Df: the -closure E(s) of stte s is the set of sttes tht cn e reched from s following -trnsitions. In the exmple ove: E(r) = {r, s}, E(s) = {s}, E(t) = {t}. The significnce of this concept is due to the fct tht whenever N reches s, it might lso rech ny stte in E(s) without reding ny input. The following exmple Ex4 illustrtes the generl construction tht trnsforms N with -trnsitions (t left) into n equivlent M without -trnsitions (t right). Ex 4: L = { i j k i, j, k } = ***. This lnguge is typicl of the structure of communiction protocols. A messge consists of prefix, ody, nd suffix, in this order. If ny prt my e of ritrry length, including zero length, the lnguge of legl messges hs the structure of L. N s s M E(s) E(s) E() Replce ech stte s of N y stte E(s) of M: E(s) = {s, s, }, E(s) = {s, }, E() = {}. This reflects the fct tht whenever N got to s, it might spontneously hve proceeded to s or to. E(s) is the strting stte of M. Any stte E(s) of M tht contins n ccepting stte of N must e mde n ccepting stte of M - in our exmple, ll the sttes of M re ccepting! Finlly, we djust the trnsitions: since E(s) = {s, s, }, M s trnsition function f ssigns to f( E(s), ) the union of ll of N s trnsitions outgoing from s, s, : f( s, ), f( s, ), f(, ). Despite the fct tht ll of M s sttes re ccepting, M only ccepts the strings in L. The first symol of the string, for exmple, leds M from E(s) to E(), ut E() cnnot process the secons symol, hence is not ccepted. Ex 5: N converted to n -free M. E(s) = {s, }. L = ( * ( ) )* N s, M E(s),

4 3.4 DFA simulting : the power set construction. Thm (equivlence -DFA): Any N cn e converted into n equivlent DFA M. Pf: Thnks to Lemm on -trnsitions, ssume without loss of generlity tht N = (S, A, f, s, F) hs no - trnsitions. Define M = ( S, A, f, {s}, F ) s follows. S is the power set of S, {s}the initil stte. F consists of ll those susets R S tht contin some finl stte of N i.e. R F {}. f : S x A -> S is defined s: for R S nd A, f (R, ) = { s S s f(r, ) for some r R}. N nd M re equivlent due the following invrint: for ll x A*, f ({s}, x) = f(s, x). QED Ex (modified from Sipser p57-58). Convert the of Ex 5 (t right) in section 3.3 to n equivlent DFA., { }, 3, 3, 3,, 3 The power set construction tends to introduce unrechle sttes. These cn e eliminted using trnsitive closure lgorithm. Alterntively, we generte sttes of M only s the corresponding susets of S re eing reched, thus comining trnsitive closure with the construction of the stte spce. For ese of comprison, let s redrw the DFA ove without unrechle sttes, with lyout similr to Ex5. The non-determinism in exmple Ex5: f(, ) = {, } is resolved y introducing sttes {, } nd { s,, }: M 3,3,,3 { } 3.5 Regulr expressions Df: Given n lphet A, the clss R(A) of regulr expressions over A is otined s follows: Primitive expressions: for ever A, (nullstring), Ø (empty set). Compound expressions: if R, R re regulr expressions, (R R ), (R R ), (R*) re regulr expressions. Convention on opertor priority: * > >. Use prentheses s needed to define structure. A regulr expression denotes regulr set y ssociting the expression opertors *,, with the set opertions Kleene str, ctention, nd union, respectively. Thm: A set L is regulr iff L is descried y some regulr expression. Pf <=: Convert given regulr expression R into n N. Use trivil s for the primitive expressions, the constructions used in the Closure Thm for the compound expressions. QED

5 Pf =>( McNughton, Ymd 96. Compre: Wrshll s trnsitive closure lgorithm, 96): Let DFA M = (S, A, f, s, F) ccept L. S = { s,.., sn}. Define R k ij = the set of ll strings w tht led M from stte si to stte sj without pssing thru ny stte with lel > k. Initilize: R ij = { f(si, ) = sj } for i j. R i i = { f(si, ) = si { }. Induction step: R k ij = R k- ij R k- ik (R k- kk )* R k- kj Termintion: R n ij = the set of ll strings w tht led M from stte si to stte sj without ny restriction. L(M) = R n j for ll sj F. The right hnd side is regulr expression tht denotes L(M). QED Intuitive verifiction. Rememer Wrshll s trnsitive closure nd Floyd s ll distnces lgorithms. Wrshll Floyd B i j = Ai j djcency mtrix, B i i = true B i j = Ai j edge length mtrix, B i i = B k i j = B k- i j or ( B k- ik nd B k- kj ) B k i j = min ( B k- i j, B k- ik + B k- kj ) B n i j = Ci j connectivity mtrix B n i j = Di j distnce mtrix In Wrshll s nd Floyd s lgorithms, cycles re irrelevnt for the issue of connectedness nd hrmful for computing distnces. Regulr expressions, on the other hnd, descrie ll pths in grph (stte spce), in prticulr the infinitely mny cyclic pths. Thus, we dd loop R k- kk in the Fig. t right, nd insert the regulr expression (R k- kk )* etween R k- ik nd R k- kj. B k- ij { },,.., k- R k- ij { } R k- kk i B k- ik k B k- kj j i R k- ik k R k- kj j 3.6 Closure of the clss of regulr sets under union, ctention, nd Kleene str Df: A lnguge (or set) L A* is clled regulr iff L is ccepted y some FA. It turns out tht ll FAs (DFA or, with or without -trnsitions) re equivlent w.r.t. ccepting power. Given L, L A*, define union L L, ctention L L = { v = ww w L, w L }. Define L = { }, L k = L L k- for k >. Kleene str: L* = (k = to ) L k. Thm (closure under the regulr opertions): If L, L A* re regulr sets, L L, L L nd L* re regulr sets. Pf: Given FAs tht ccept L, L respectively, construct s to ccept L L, L L nd L* s shown. The given FAs re represented s oxes with strting stte t left (smll) nd one ccepting stte (representtive of ll others) t right (lrge). In ech cse we dd new strting stte nd some -trnsitions s shown. In ddition to closure under the regulr opertions union, ctention, nd Kleene str, we hve: Thm: if L is regulr, the complement L is lso regulr. Pf: Tke DFA M = (S, A, f, s, F) tht ccepts L. M = (S, A, f, s, S-F) ccepts L. QED

6 Thm: If L, L A* re regulr, the intersection L L is lso regulr. Pf: L L = ( L L ). QED Thus, the clss of regulr lnguges over n lphet A forms Boolen lger. 3.7 DFAs nd right invrint equivlence reltions. Stte minimiztion. Ex rel constnts : A = {,,, }. L = ( ( ( ) + ( )* ( )* ( ) + ) )* Interpret word in L s sequence of rel constnts with mndtory inry point, e.g,,. A constnt must hve t lest one it or, the inry point lone is excluded. Constnts re seprted y. To get DFA, imgine tht the trnsitions not shown in the figure ll led to non-ccepting trp stte s5.,,, s4 s s,, Stte identifiction, equivlent sttes: Given the stte digrm of DFA M, devise n experiment to ) determine the current stte of M, or ) to distinguish two given sttes r, s. Ex: In order to identify s, feed into M - no other stte is ccepting. uniquely identifies s. distinguishes etween nd s4. No experiment distinguishes from s4: nd s4 re equivlent. Equivlent sttes cn e merged to otin smller FA M equivlent to M. Df: Sttes r nd s of M re equivlent (indistinguishle) iff for ll w A*, f(r, w) F f(s, w) F. It turns out tht in order to prove sttes equivlent, it suffices to test ll words w of length w n = S. Before proving this result, consider dynmic progrmming lgorithm to identify non-equivlent stte pirs. We strt with the oservtion tht ll sttes might e equivlent. As pirs of non-equivlent sttes re grdully eing identified, we record for ech such pir s, r shortest witness tht distinguishes s nd r. We illustrte this lgorithm using the exmple of the FA rel constnts ove. At left in the figure elow, ll stte pirs si sj re mrked tht cn e distinguished y some word of length. This distinguishes ccepting sttes from non-ccepting sttes, nd is shortest witness. Unmrked slots identify pirs tht hve not yet een proven distinguishle. For ech of these unmrked pirs r, s, nd ll A, check whether the pir f(r, ), f(s, ) hs een mrked distinguishle. If so, mrk r, s distinguishle with shortest witness w = w, where w is inherited from f(r, ), f(s, ). When computing the entry for s, t right, for exmple, notice tht f(s, B) = s, f(, B) = s4. Since s, s4 hve lredy een proven distinguishle y w =, s, re distinguishle y w = B. Checking the lst unmrked pir, s4 t right yields no new distinguishle pir: f(, ) = f(s4, ) = s; f(, ) = f(s4, ) = trp stte s5; f(,b) =, f(s4,b) = s4, ut, s4 hve not yet een proven distinguishle. This termintes the process with the informtion tht, s4 re equivlent nd cn e merged. Distinguishle sttes oviously cnnot e merged -> this is stte minimiztion lgorithm. s s s s4 w = o s s s s4 w = s s s s4 w = Hw 3..: Invent nother interesting exmple of DFA M with equivlent sttes nd pply this dynmic progrmming lgorithm to otin n equivlent M with the minimum numer of sttes. Hw 3.3: Anlyze the complexity of this dynmic progrmming lgorithm in terms of S = n nd A. Hw 3.4: Prove the following Thm: If sttes r, s re indistinguishle y words w of length w n = S, r nd s re equivlent. Hint: use the concepts nd nottions elow, nd prove the lemms.

7 Df r, s re indistinguishle y words of length k : r ~ k s for k iff for ll w A*, w k: f(r, w) F f(s, w) F Importnt properties of of the equivlence reltions ~ k : Lemm (inductive contruction): r ~ k s iff r ~ k- s nd for ll : f( r, ) ~ k- f( s, ) Lemm (termintion): If ~ k = ~ k-, ~ k = ~ m for ll m > k. Thm: If r, s re indistinguishle y words w of length w n = S, r nd s re equivlent. An lgeric pproch to stte minimiztion Given ny L A*, define the equivlence reltion (reflexive, symmetric, trnsitive) R L over A*: x R L y iff All z A*, xz L yz L. I.e., either xz nd yz oth in L, or xz nd yz oth in L Notice: R L is right invrint : x R L y All z A*, xz R L yz. Intuition: x R L y iff the prefixes x nd y cuse ll pirs xz, yz to shre [non-]memership sttus w.r.t. L. Given DFA M, define equivlence reltion R M over A*: x R M y iff f(s, x) = f(s, y). R M is right invrint. Df: index of equivlence reltion R = of equivlence clsses of R. Thm (regulr sets nd equivlence reltions of finite index). The following 3 sttements re equivlent: ) L A* is ccepted y some DFA M ) L is the union of some of the equivlence clsses of right invrint equivlence reltion of finite index 3) R(L) is of finite index. Thm: The minimum stte DFA ccepting L is unique up to isomorphism (renming sttes). In contrst, minimum stte s re not necessrily unique. Ex A ={, }, L = + : non-deterministic deterministic, 3.8 Odds nd ends out regulr lnguges nd FAs The pumping lemm (itertion lemm): For ny regulr L A* there is n integer n > (the pumping length ) with the following property: ny w L of length w n cn e sliced into 3 prts w = xyz stisfying the following conditions: ) xy n, ) y >, 3) for ll i, x y i z L. Pf: Consider ny DFA M tht ccepts L, e.g. the minimum stte DFA M(L). Choose n = S s the pumping length. Feed ny w L of length w n into M. On its wy from s to some ccepting stte, M goes through w + n + sttes. Among the first n+ of these sttes, s, s,.., sn,.., there must e duplicte stte si = sj for some i < j, with loop leled y leding from si ck to si. Thus, xz, xyz, xyyz,... re ll in L. QED The pumping lemm is used to prove, y contrdiction, tht some lnguge is not regulr. Ex: L = { i j i < j} is not regulr. Assume L is regulr. Let n e L s pumping length. Consider w = n n+, w L. Even if we don t know how to slice w, we know xy n nd hence y = k for some k >. But then n n+, n+k n+, n+k n+,.. re ll L, contrdicting the definition L = { i j i < j}. L is not regulr, QED. End of Ch3

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

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

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

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

Lecture 08: Feb. 08, 2019

Lecture 08: Feb. 08, 2019 4CS4-6:Theory of Computtion(Closure on Reg. Lngs., regex to NDFA, DFA to regex) Prof. K.R. Chowdhry Lecture 08: Fe. 08, 2019 : Professor of CS Disclimer: These notes hve not een sujected to the usul scrutiny

More information

Theory of Computation Regular Languages. (NTU EE) Regular Languages Fall / 38

Theory of Computation Regular Languages. (NTU EE) Regular Languages Fall / 38 Theory of Computtion Regulr Lnguges (NTU EE) Regulr Lnguges Fll 2017 1 / 38 Schemtic of Finite Automt control 0 0 1 0 1 1 1 0 Figure: Schemtic of Finite Automt A finite utomton hs finite set of control

More information

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Automata Theory 101. Introduction. Outline. Introduction Finite Automata Regular Expressions ω-automata. Ralf Huuck. Outline Automt Theory 101 Rlf Huuck Introduction Finite Automt Regulr Expressions ω-automt Session 1 2006 Rlf Huuck 1 Session 1 2006 Rlf Huuck 2 Acknowledgement Some slides re sed on Wolfgng Thoms excellent

More information

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

CSE : Exam 3-ANSWERS, Spring 2011 Time: 50 minutes

CSE : Exam 3-ANSWERS, Spring 2011 Time: 50 minutes CSE 260-002: Exm 3-ANSWERS, Spring 20 ime: 50 minutes Nme: his exm hs 4 pges nd 0 prolems totling 00 points. his exm is closed ook nd closed notes.. Wrshll s lgorithm for trnsitive closure computtion is

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

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

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

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

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

Parse trees, ambiguity, and Chomsky normal form

Parse trees, ambiguity, and Chomsky normal form Prse trees, miguity, nd Chomsky norml form In this lecture we will discuss few importnt notions connected with contextfree grmmrs, including prse trees, miguity, nd specil form for context-free grmmrs

More information

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Myhill-Nerode Theorem

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

More information

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

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

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

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

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

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

2. Lexical Analysis. Oscar Nierstrasz

2. Lexical Analysis. Oscar Nierstrasz 2. Lexicl Anlysis Oscr Nierstrsz Thnks to Jens Plserg nd Tony Hosking for their kind permission to reuse nd dpt the CS132 nd CS502 lecture notes. http://www.cs.ucl.edu/~plserg/ http://www.cs.purdue.edu/homes/hosking/

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

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

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

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

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

378 Relations Solutions for Chapter 16. Section 16.1 Exercises. 3. Let A = {0,1,2,3,4,5}. Write out the relation R that expresses on A.

378 Relations Solutions for Chapter 16. Section 16.1 Exercises. 3. Let A = {0,1,2,3,4,5}. Write out the relation R that expresses on A. 378 Reltions 16.7 Solutions for Chpter 16 Section 16.1 Exercises 1. Let A = {0,1,2,3,4,5}. Write out the reltion R tht expresses > on A. Then illustrte it with digrm. 2 1 R = { (5,4),(5,3),(5,2),(5,1),(5,0),(4,3),(4,2),(4,1),

More information

1 From NFA to regular expression

1 From NFA to regular expression Note 1: How to convert DFA/NFA to regulr expression Version: 1.0 S/EE 374, Fll 2017 Septemer 11, 2017 In this note, we show tht ny DFA cn e converted into regulr expression. Our construction would work

More information

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

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

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

DFA minimisation using the Myhill-Nerode theorem

DFA minimisation using the Myhill-Nerode theorem DFA minimistion using the Myhill-Nerode theorem Johnn Högerg Lrs Lrsson Astrct The Myhill-Nerode theorem is n importnt chrcteristion of regulr lnguges, nd it lso hs mny prcticl implictions. In this chpter,

More information

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

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

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

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

Non-deterministic Finite Automata

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

More information

Some Theory of Computation Exercises Week 1

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

More information

Model Reduction of Finite State Machines by Contraction

Model Reduction of Finite State Machines by Contraction Model Reduction of Finite Stte Mchines y Contrction Alessndro Giu Dip. di Ingegneri Elettric ed Elettronic, Università di Cgliri, Pizz d Armi, 09123 Cgliri, Itly Phone: +39-070-675-5892 Fx: +39-070-675-5900

More information

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

NON-DETERMINISTIC FSA

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

More information

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

Strong Bisimulation. Overview. References. Actions Labeled transition system Transition semantics Simulation Bisimulation

Strong Bisimulation. Overview. References. Actions Labeled transition system Transition semantics Simulation Bisimulation Strong Bisimultion Overview Actions Lbeled trnsition system Trnsition semntics Simultion Bisimultion References Robin Milner, Communiction nd Concurrency Robin Milner, Communicting nd Mobil Systems 32

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

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

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

The University of Nottingham SCHOOL OF COMPUTER SCIENCE A LEVEL 2 MODULE, SPRING SEMESTER LANGUAGES AND COMPUTATION ANSWERS The University of Nottinghm SCHOOL OF COMPUTER SCIENCE LEVEL 2 MODULE, SPRING SEMESTER 2016 2017 LNGUGES ND COMPUTTION NSWERS Time llowed TWO hours Cndidtes my complete the front cover of their nswer ook

More information

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

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

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

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

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

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

Vectors , (0,0). 5. A vector is commonly denoted by putting an arrow above its symbol, as in the picture above. Here are some 3-dimensional vectors:

Vectors , (0,0). 5. A vector is commonly denoted by putting an arrow above its symbol, as in the picture above. Here are some 3-dimensional vectors: Vectors 1-23-2018 I ll look t vectors from n lgeric point of view nd geometric point of view. Algericlly, vector is n ordered list of (usully) rel numers. Here re some 2-dimensionl vectors: (2, 3), ( )

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