13 Learning with Queries

Size: px
Start display at page:

Download "13 Learning with Queries"

Transcription

1 13 Lerning with Queries Among the more interesting remining theoreticl questions re: inference in the presence of noise, generl strtegies for interctive presenttion nd the inference of systems with semntics. Jerome Feldmn, in [Fel72] L simplicité n ps esoin d être simple, mis du complexe resserré et synthétisé. Alfred Jrry We descrie lgorithm Lstr introduced y Dn Angluin, nd which hs inspired severl vrints nd dpttions to other clsses of lnguges The Minimlly Adequte Techer A minimlly dequte techer is n Orcle tht cn give nswers to memership queries nd strong equivlence queries. We will nlyse in Section 9.2 the cse where you wnt to lern with less. The min lgorithm tht works in this setting is clled Lstr. The generl ide of Lstr is: - find consistent oservtion tle (representing Df); - sumit it s n equivlence query; - use the counter-exmple to updte the tle; - sumit memership queries to mke the tle closed nd complete; - iterte until the Orcle, upon n equivlence query, tells us tht the correct lnguge hs een reched. 317

2 318 Lerning with Queries The oservtion tle we use is nlogous to tht descried in Section 12.3, so we will use the sme formlism here An oservtion tle An oservtion tle is specific tulr representtion of n utomton. An exmple is given in Tle 13.1(). λ λ () An oservtion tle., q λ q () The corresponding utomton. Fig The oservtion tle nd the corresponding utomton. The mening of the tle cn e mde resonly cler. By conctenting the nme of row r with the nme of column c we get string rc. The string is in the lnguge if the corresponding cell Ot[r][c] contins 1, does not if it is 0. If the tle complies with certin conditions of consistency n utomton cn esily e extrcted from the tle. The utomton corresponding to Tle 13.1() is depicted in Figure 13.1(). We formlly descrie procedure llowing to extrct Df from tle (when possile) in Section An oservtion tle is triple St,Exp,Ot with: - St = Red Blue is set of strings, denoting lels of sttes; - Red Σ is finite set of sttes. - Exp Σ is the experiment set; - Blue = Red Σ \ Red is the set of sttes successors of Red tht re not Red; - Ot : (St) Exp {0,1, } is function such tht: 1 if ue L - Ot[u][e] = 0 if ue L otherwise (not known). Agin, to simplify, Red nd Blue will e sets of strings lso used to lel the sttes. There re numer of key ides one wnts to understnd in order to grsp this lgorithm.

3 13.1 The Minimlly Adequte Techer 319 Definition (Holes) A hole in tle St,Exp,Ot is pir (u,e) such tht Ot[u][e] =. A tle is complete if def it hs no holes. λ λ () An incomplete tle. q q λ q q q q q () The corresponding utomton. Fig The utomton corresponding to n incomplete tle. The prolem with incomplete tles is tht we do not hve ll the informtion needed to extrct Df from tle. In Section 12.3 (pge 286) this ws the key prolem nd no stisfying solution ws given. Consider for instnce Tle 13.2(). There re severl holes tht could e filled in vrious mnners. For exmple, the hole corresponding to Ot[][] indictes tht there is no fixed or known vlue for δ(q,). In order to uild Df from this incomplete tle, we notice tht δ(q,) could e just s well q λ s q. The sitution is represented Figure 13.2() Building from complete nd closed tle Building n utomton from tle St,Exp,Ot cn e done very esily if certin conditions re met: - The set of strings mrking the sttes in St must e prefix-closed; - The set Exp is suffix-closed; - The tle must e complete nd therefore hve no holes; - The tle must e closed. If these conditions hold we cn use Algorithm Lstr-BuildAutomton (13.1, similr to Algorithm 12.5, pge 291). Exmple Consider Tle 13.3(). We cn pply the construction from Algorithm 13.1 nd otin Q = {q λ, q }, F A = {q }, F R = {q λ } nd δ

4 320 Lerning with Queries Algorithm 13.1: Lstr-BuildAutomton. Input: closed nd complete oservtion tle (St,Exp,Ot) Output: Df Σ,Q,q λ, F A, F R,δ Q {q u : u Red v < u Ot[v] Ot[u]}; F A {q u Q : Ot[u][λ] = 1}; F R {q u Q : Ot[u][λ] = 0}; for q u Q do for Σ do δ(q u,) q w Q : Ot[u] = Ot[w] end return Σ,Q,q λ, F A, F R,δ is given y the trnsition Tle 13.3(), then the Automton 13.3(c) cn e uilt: λ λ () The oservtion tle. q λ q λ q q q λ q () The trnsition tle. q λ (c) Automton. q Fig An utomton nd tle Consistency Definition (Consistent tle) Given n utomton A nd n oservtion tle St,Exp,Ot, A is consistent with St,Exp,Ot when the following holds: - Ot[u][e] = 1 = ue L FA (A); - Ot[u][e] = 0 = ue L FR (A). Rememer tht L FA (A) is the lnguge recognised y A y ccepting sttes, wheres L FR (A) is the lnguge recognised y A y rejecting sttes.

5 13.1 The Minimlly Adequte Techer 321 Theorem (Consistency Theorem) Let St, Exp, Ot e n oservtion tle closed nd complete. If St is prefix-closed nd Exp is suffix-closed then Lstr-BuildAutomton( St,Exp,Ot ) is consistent with the dt in St,Exp,Ot. Proof Lstr-BuildAutomton( St, Exp, Ot ) is uilt from the dt from St, Exp, Ot. Completing the tle y sumitting memership queries should llow to solve some of the miguity issues, even if not ll Tles with no holes We consider here the cse where there re no holes in the tle. To rech this sitution, we will hve filled the holes y using memership queries. Definition (Equivlent prefixes nd rows) Two prefixes u nd v re equivlent if def Ot[u] = Ot[v]. We will denote this y u Exp v. The next definition is similr to Definition , pge 290. Definition (Closed tle) A tle St,Exp,Ot ) is closed if def given ny row u of Blue there is some row v in Red such tht u Exp v. Checking if the tle is closed is strightforwrd. But wht cn the lgorithm do once it hs found tht the tle is not closed? Let s e the row (of Blue) tht does not pper in Red, dd s to Red, nd Σ, dd s to Blue. This corresponds to the promotion introduced in Section , pge 285. By repeting this until the tle is closed, we re done. Notice tht the numer of itertions is ounded y the size of the utomton. Exmple In Gold s lgorithm (Section 12.3) ll the Red sttes were oviously different one from the other. Moreover, stte ws moved to the upper prt of the tle only when this condition ws met. Becuse of the lck of control the lerner hs over the Orcle, this is not the cse here. An inconsistent tle is one from which n utomton cnnot e extrcted. This is different from Section 12.3: In this cse it is possile to hve Red prefixes/sttes tht seem equivlent nd need seprting.

6 322 Lerning with Queries λ λ () A tle tht is not closed, ecuse of row. Fig Closing tle. λ λ () Closing the tle. Definition A tle is consistent if def every equivlent pir of rows in Red remins equivlent in St fter ppending ny symol. Ot[s 1 ] = Ot[s 2 ] = Σ, Ot[s 1 ] = Ot[s 2 ]. Wht do we do when we hve n inconsistent tle? If it is inconsistent, then let Σ e the symol for which Ot[s 1 ] = Ot[s 2 ] ut Ot[s 1 ] Ot[s 2 ]. Let e e the experiment for which the inconsistency hs een found (Ot[s 1 ][e] Ot[s 2 ][e]). Then y dding experiment e to the tle, rows Ot[s 1 ] nd Ot[s 2 ] re different. Indeed, Ot[s 1 ][e] Ot[s 2 ][e]. Exmple Tle 13.5() is inconsistent: rows nd look the sme, ut, upon experiment they fil to e equivlent, since rows nd re different. Therefore column (nd experiment) is dded, resulting in Tle 13.5(). On the other hnd, Tle 13.5(c) is consistent, since not only Ot[] = Ot[], ut lso Ot[] = Ot[] nd Ot[] = Ot[]. λ λ () An inconsistent tle (ecuse of nd ). λ λ () The tle hs ecome consistent. Fig Consistency. λ λ (c) A consistent tle.

7 13.2 The lgorithm 323 Once the lerner hs uilt complete, closed nd consistent tle, it cn construct the Df using Algorithm Lstr-BuildAutomton nd mke n equivlence query! Oviously, if the Orcle returns positive nswer to the lgorithm s equivlence query, it cn hlt. If she returns counter-exmple (u), then the lerner should dd s Red sttes ll the prefixes of u, nd complete the Blue section ccordingly (with ll strings p ( Σ) such tht p is prefix of u ut p is not. In this wy t lest one new Red line oviously different from ll the others will hve een dded The lgorithm Algorithm Lstr (13.2) cn now e descried. First the oservtion tle is initilised y Algorithm Lstr-Initilise (13.3). This consists in uilding one Red row (λ) nd s mny Blue rows s there re symols in the lphet. Then the itertive construction egins. When the tle is not closed n extr row is dded (Algorithm Lstr-Close (13.4)), when it is inconsistent n extr column is dded (Algorithm Lstr-Consistent (13.5)). At every moment, memership queries re mde to fill in the holes. When redy nd the tle is closed nd consistent, n equivlence query is mde nd if unsuccessful, new rows re dded (Algorithm Lstr-UseEQ (13.6)). Algorithm 13.2: Lstr Lerning Algorithm. Input: Output: Df A Lstr-Initilise; repet while St,Exp,Ot is not closed or not consistent do if St, Exp, Ot is not closed then St, Exp, Ot Lstr-Close( St, Exp, Ot ); if St, Exp, Ot is not consistent then St, Exp, Ot Lstr-consistent( St, Exp, Ot ) end Answer Eq( St, Exp, Ot ); if Answer Yes then St, Exp, Ot Lstr-UseEQ( St, Exp, Ot, Answer) until Answer= Yes ; return Lstr-BuildAutomton( St, Exp, Ot )

8 324 Lerning with Queries Algorithm 13.3: Lstr-Initilise. Input: Output: tle St, Exp, Ot Red {q λ }; Blue {q : Σ}; Exp {λ}; Ot[λ][λ] Mq(λ); for Σ do Ot[][λ] Mq(); return St, Exp, Ot Algorithm 13.4: Lstr-Close. Input: tle St,Exp,Ot Output: tle St, Exp, Ot updted for s Blue such tht u Red Ot[s] Ot[u] do Red Red {s}; Blue Blue \ {s}; for Σ do Blue Blue {s }; for u,e Σ such tht Ot[u][e] is hole do Ot[u][e] Mq(ue) end return St, Exp, Ot Algorithm 13.5: Lstr-Consistent. Input: tle St, Exp, Ot Output: tle St, Exp, Ot updted find s 1, s 2 Red, Σ nd e Exp such tht Ot[s 1 ] = Ot[s 2 ] nd Ot[s 1 ][e] Ot[s 2 ][e]; Exp Exp { e}; for u,e Σ such tht Ot[u][e] is hole do Ot[u][e] Mq(ue); return St, Exp, Ot

9 13.2 The lgorithm 325 Algorithm 13.6: Lstr-UseEQ. Input: tle St,Exp,Ot, string Answer Output: tle St, Exp, Ot updted for p Pref(Answer) do Red Red {p}; for Σ : p Pref(Answer) do Blue Blue {p} end for u,e Σ such tht Ot[u][e] is hole do Ot[u][e] Mq(ue); return St, Exp, Ot A run of Ä Ø Ö We run Lstr over n exmple. We strt with the empty tle, in which Red = {λ} nd Exp = {λ}. A first memership query is mde with string λ. The nswer is Yes. nd re then dded to Blue nd the memership queries nd re mde. Suppose gin the nswers re Yes. The corresponding Tle 13.6() is closed nd complete, so n equivlence query is mde for the utomton depicted in Figure 13.6(). Let e the negtive counter-exmple returned y the Orcle. The tle is updted to Tle 13.7(). The tle is closed so the holes re filled through memership queries re mde, yielding Tle 13.7(). λ λ () A consistent tle., () The utomton corresponding to the Tle 13.6(). 0 Fig Consistency. But the Tle 13.6() is not closed s rows Ot[] nd Ot[] coincide wheres rows Ot[ ] nd Ot[ ] do not. Experiment is the reson for this so it is dded s n experiment nd the new Tle 13.7(c) hs to e completed. Tle 13.7(d) is therefore otined which is now closed nd complete nd cn e trnsformed into n utomton tht will e proposed s n equivlence query (Figure 13.8). We suppose this time the equivlence query is met with positive nswer so we hlt.

10 326 Lerning with Queries λ λ () Tle fter equivlence query returned (s not in L). λ λ () Memership queries re mde: Tle is not closed. λ λ (c) Adding column to mke the tle closed. λ λ (d) The tle fter filling the holes is closed nd consistent. Fig Running Lstr., q λ q q Fig Automton fter running Lstr Proof of the lgorithm On the first hnd the lgorithm Lstr clerly termintes: Since every regulr lnguge dmits unique miniml Df, let us suppose, without loss of generlity, tht the trget is this minimum Df with n sttes. But since ny Df consistent with tle hs t lest s mny sttes s different rows in Red, nd if tle is closed nd consistent then the construction of consistent Df is unique, therefore the tle cn only grow verticlly until it hs n different rows. Now, ech closure filure dds one different row to Red, ech inconsistency filure dds one experiment, which lso cretes new row in Red. Ech counter-exmple dds lso one different row to Red (notice tht mny rows cn pper ecuse of the prefixes, ut wht mtters is tht t lest one different from the others ppers). If to this you dd tht every time the tle is not consistent or n equivlence query is met y counterexmple, t lest one new row is introduced. Furthermore, the numer of steps etween two of such events is lso finite. So the totl numer of these opertions is ounded. Now, for correction, if the lgorithm hs uilt tle with n oviously

11 13.3 Exercises 327 different rows in Red, nd n is the size of the miniml Df for the trget, then it is the trget. The lgorithm therefore is correct nd termintes. Let us now study the complexity of Lstr: - At most n experiments will e mde (including λ), since n experiment introduces necessrily new different row. So Exp n. - For the sme resons t most n equivlence queries re mde. - The numer of memership queries is ounded y the totl size of the tle which is t most n (the numer of experiments/columns) multiplied y the numer of lines ( nm where m is the length of the longest counterexmple returned y the Orcle). Therefore the totl numer of queries mde is t most n 2 m. A computtion of this numer t ech step of the lgorithm is possile nd gives similr results: The tle only grows with the size of the counter-exmples returned y the Orcle Aout implementtion issues One difficulty with the implementtion of Lstr comes from mintining the redundncy. Actully it is not necessry to implement the ctul tle. A etter ide is to mnge three ssocition tles: A first tle Mq contins the result of the memership queries. It cn e consulted in constnt time to know if prticulr string hs een queried or not nd if it hs if it elongs or not to the lnguge. A second tle Pref contins the different nmes of rows, nd for ech row, the sttus: is it Red or Blue? A third tle just contins the different experiments. The ctul oservtion tle is only simulted y function Ot(u, v) which will return the vlue Mq[uv] Exercises 13.1 Run lgorithm Lstr on the utomton from Figure You will need to simulte the Orcle too! 13.2 Replce the equivlence queries with the use of smpling query Ex() in the ove. Wht vlues of m i should you consider?

12 328 Lerning with Queries 1 0 Fig A trget utomton It ws suggested in Section 9.4 (pge 224) tht equivlence queries cn e replced y smpling. Write the lgorithm llowing to ctully simulte the equivlence query If one chooses to smple insted of mking equivlence query, one prolem is: Wht do we do with ll the exmples tht did fit the hypothesis until counter-exmple ws found? One lterntive is to enter ll this informtion into the oservtion tle. Another is to ignore it. Which is etter? Why? 13.4 Conclusion of the section nd further reding In Chpter 9 we discussed numer of implictions of ctive lerning. In prticulr, negtive results were given Biliogrphicl ckground Algorithm Lstr ws is due to Dn Angluin [Ang90] nd ws lter dpted for rootics scenrio y Ron Rivest nd Roert Schpire [RS93], nd hs led to numer of vrints (oth in description nd in the comintion etween the memership nd the equivlence queries [KV94, BDGW94]). We hve concentrted in this chpter on Df. In the cse of context-free grmmrs the negtive proofs y Dn Angluin nd Michel Khritonov [AK91] with Mts re relted to cryptogrphic ssumptions. On the other hnd, if structurl informtion is ville, Ysuumi Skkir proves the lernility of the clss of context-free grmmrs in this model [Sk90]. Lerning lls of strings from different types of queries hs lso een studied [dlhjt08]. Returning to the Df cse, it should e noticed tht the Orcle hs no reson to return the counter-exmple the lerner relly needs. A more helpful setting ws studied in [BBS00]. Other studies contemplte the fct tht the Orcle is somehow ounded:

13 13.4 Conclusion of the section nd further reding 329 In prctice, it my e difficult to imgine tht the Orcle hs the resources to return n exponentilly long exmple; furthermore, if the Lerner cn find hypothesis correct over the strings of resonle length only, this my e sufficient. These questions re discussed in [Wt94, Cs01] Some lterntive lines of reserch The model hs received considerle ttention nd there re mny ppers on lerning with different sorts of queries. Ysuumi Skkir [Sk87] lerns context-free grmmrs from queries; Tkshi Yokomori [Yok96] lerns 2-tpe utomt from oth queries nd counter-exmples, nd in [Yok94] non-deterministic finite utomt from queries lso in polynomil time, ut depending on the size of the ssocited Df; Jun-Mnuel Vilr extends queries to trnsltion tsks in [Vil96], Oded Mler nd Amir Pnueli [MP91] lern Büchi utomt from queries over infinite strings. A recent ide is tht of comining memership queries nd equivlence queries in some wy. Correction queries [BBBD05, BBDT06] correspond to strings tht the lerner hypotheses s eing in the lnguge. The Orcle then presents some correction of the string if the string does not elong to the lnguge. There re mny wys of defining such corrections, some eing more theoreticl nd other (using the edit distnce) closer to possile pplictions [Tir08, Kin08, BBdlHJT08]. Agin, s in other questions, the prolem of correctly defining topology over the lnguges is here of crucil importnce, s the sort of correction one would expect is one of string close to the queried string. In prctice, getting hold of equivlence queries is considered to e the hrdest of prolems. One wy round this is to smple. An evolutionry lgorithm following this line is proposed in [BL05]. One cn lso consider the cse where the Orcle cn nswer proilistic queries. We visit this question in the corresponding chpters (Chpter 10 for some negtive results, nd Chpter 16 for some positive ones). A typicl ide is to introduce specific smpling queries in order to lern proilistic mchines [dlho04] Open prolems nd possile new lines of reserch We proposed in Section some prolems relting to lerning with queries. More generlly, there re numer of resons for which inventing new query lerning lgorithms re mking the existing ones more efficient (not just in

14 330 Lerning with Queries time, in numer of queries lso) re importnt issues, nd our feeling is tht more reserch in this re should e encourged.

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

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

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

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

More information

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

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

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

Intermediate Math Circles Wednesday, November 14, 2018 Finite Automata II. Nickolas Rollick a b b. a b 4

Intermediate Math Circles Wednesday, November 14, 2018 Finite Automata II. Nickolas Rollick a b b. a b 4 Intermedite Mth Circles Wednesdy, Novemer 14, 2018 Finite Automt II Nickols Rollick nrollick@uwterloo.c Regulr Lnguges Lst time, we were introduced to the ide of DFA (deterministic finite utomton), one

More information

Formal Languages and Automata

Formal Languages and Automata Moile Computing nd Softwre Engineering p. 1/5 Forml Lnguges nd Automt Chpter 2 Finite Automt Chun-Ming Liu cmliu@csie.ntut.edu.tw Deprtment of Computer Science nd Informtion Engineering Ntionl Tipei University

More information

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

1 Nondeterministic Finite Automata

1 Nondeterministic Finite Automata 1 Nondeterministic Finite Automt Suppose in life, whenever you hd choice, you could try oth possiilities nd live your life. At the end, you would go ck nd choose the one tht worked out the est. Then you

More information

Lecture 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

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

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

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

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

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

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

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

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

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

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 373, Spring Solutions to Mock midterm 1 (Based on first midterm in CS 273, Fall 2008.)

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

More information

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true.

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true. York University CSE 2 Unit 3. DFA Clsses Converting etween DFA, NFA, Regulr Expressions, nd Extended Regulr Expressions Instructor: Jeff Edmonds Don t chet y looking t these nswers premturely.. For ech

More information

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Lecture 3. In this lecture, we will discuss algorithms for solving systems of linear equations.

Lecture 3. In this lecture, we will discuss algorithms for solving systems of linear equations. Lecture 3 3 Solving liner equtions In this lecture we will discuss lgorithms for solving systems of liner equtions Multiplictive identity Let us restrict ourselves to considering squre mtrices since one

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

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

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

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

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

More information

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

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

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

More information

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

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

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

2.4 Linear Inequalities and Interval Notation

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

More information

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

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

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

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

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

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

More information

First Midterm Examination

First Midterm Examination 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

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

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

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

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

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

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

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

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

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

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

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

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

More information

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

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

p-adic Egyptian Fractions

p-adic Egyptian Fractions p-adic Egyptin Frctions Contents 1 Introduction 1 2 Trditionl Egyptin Frctions nd Greedy Algorithm 2 3 Set-up 3 4 p-greedy Algorithm 5 5 p-egyptin Trditionl 10 6 Conclusion 1 Introduction An Egyptin frction

More information

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

Learning Moore Machines from Input-Output Traces

Learning Moore Machines from Input-Output Traces Lerning Moore Mchines from Input-Output Trces Georgios Gintmidis 1 nd Stvros Tripkis 1,2 1 Alto University, Finlnd 2 UC Berkeley, USA Motivtion: lerning models from blck boxes Inputs? Lerner Forml Model

More information

Informed learners DRAFT. Understanding is compression, comprehension is compression! Greg Chaitin (Chaitin, 2007)

Informed learners DRAFT. Understanding is compression, comprehension is compression! Greg Chaitin (Chaitin, 2007) 12 Informed lerners Understnding is compression, comprehension is compression! Greg Chitin (Chitin, 2007) Compro. Hl de un juego donde ls regls no sen l líne de slid, sino el punto de llegd No? Arturo

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

Bases for Vector Spaces

Bases for Vector Spaces Bses for Vector Spces 2-26-25 A set is independent if, roughly speking, there is no redundncy in the set: You cn t uild ny vector in the set s liner comintion of the others A set spns if you cn uild everything

More information

Lecture 3: Equivalence Relations

Lecture 3: Equivalence Relations Mthcmp Crsh Course Instructor: Pdric Brtlett Lecture 3: Equivlence Reltions Week 1 Mthcmp 2014 In our lst three tlks of this clss, we shift the focus of our tlks from proof techniques to proof concepts

More information

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

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

The practical version

The practical version Roerto s Notes on Integrl Clculus Chpter 4: Definite integrls nd the FTC Section 7 The Fundmentl Theorem of Clculus: The prcticl version Wht you need to know lredy: The theoreticl version of the FTC. Wht

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

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

This lecture covers Chapter 8 of HMU: Properties of CFLs

This lecture covers Chapter 8 of HMU: Properties of CFLs This lecture covers Chpter 8 of HMU: Properties of CFLs Turing Mchine Extensions of Turing Mchines Restrictions of Turing Mchines Additionl Reding: Chpter 8 of HMU. Turing Mchine: Informl Definition B

More information

Kleene s Theorem. Kleene s Theorem. Kleene s Theorem. Kleene s Theorem. Kleene s Theorem. Kleene s Theorem 2/16/15

Kleene s Theorem. Kleene s Theorem. Kleene s Theorem. Kleene s Theorem. Kleene s Theorem. Kleene s Theorem 2/16/15 Models of Comput:on Lecture #8 Chpter 7 con:nued Any lnguge tht e defined y regulr expression, finite utomton, or trnsi:on grph cn e defined y ll three methods We prove this y showing tht ny lnguge defined

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

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

CS 310 (sec 20) - Winter Final Exam (solutions) SOLUTIONS

CS 310 (sec 20) - Winter Final Exam (solutions) SOLUTIONS CS 310 (sec 20) - Winter 2003 - Finl Exm (solutions) SOLUTIONS 1. (Logic) Use truth tles to prove the following logicl equivlences: () p q (p p) (q q) () p q (p q) (p q) () p q p q p p q q (q q) (p p)

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

Linear Inequalities. Work Sheet 1

Linear Inequalities. Work Sheet 1 Work Sheet 1 Liner Inequlities Rent--Hep, cr rentl compny,chrges $ 15 per week plus $ 0.0 per mile to rent one of their crs. Suppose you re limited y how much money you cn spend for the week : You cn spend

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

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

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

1B40 Practical Skills

1B40 Practical Skills B40 Prcticl Skills Comining uncertinties from severl quntities error propgtion We usully encounter situtions where the result of n experiment is given in terms of two (or more) quntities. We then need

More information

Part 5 out of 5. Automata & languages. A primer on the Theory of Computation. Last week was all about. a superset of Regular Languages

Part 5 out of 5. Automata & languages. A primer on the Theory of Computation. Last week was all about. a superset of Regular Languages Automt & lnguges A primer on the Theory of Computtion Lurent Vnbever www.vnbever.eu Prt 5 out of 5 ETH Zürich (D-ITET) October, 19 2017 Lst week ws ll bout Context-Free Lnguges Context-Free Lnguges superset

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

PART 2. REGULAR LANGUAGES, GRAMMARS AND AUTOMATA

PART 2. REGULAR LANGUAGES, GRAMMARS AND AUTOMATA PART 2. REGULAR LANGUAGES, GRAMMARS AND AUTOMATA RIGHT LINEAR LANGUAGES. Right Liner Grmmr: Rules of the form: A α B, A α A,B V N, α V T + Left Liner Grmmr: Rules of the form: A Bα, A α A,B V N, α V T

More information

Designing Information Devices and Systems I Spring 2018 Homework 7

Designing Information Devices and Systems I Spring 2018 Homework 7 EECS 16A Designing Informtion Devices nd Systems I Spring 2018 omework 7 This homework is due Mrch 12, 2018, t 23:59. Self-grdes re due Mrch 15, 2018, t 23:59. Sumission Formt Your homework sumission should

More information

1 Structural induction

1 Structural induction Discrete Structures Prelim 2 smple questions Solutions CS2800 Questions selected for Spring 2018 1 Structurl induction 1. We define set S of functions from Z to Z inductively s follows: Rule 1. For ny

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

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

Regular Language. Nonregular Languages The Pumping Lemma. The pumping lemma. Regular Language. The pumping lemma. Infinitely long words 3/17/15

Regular Language. Nonregular Languages The Pumping Lemma. The pumping lemma. Regular Language. The pumping lemma. Infinitely long words 3/17/15 Regulr Lnguge Nonregulr Lnguges The Pumping Lemm Models of Comput=on Chpter 10 Recll, tht ny lnguge tht cn e descried y regulr expression is clled regulr lnguge In this lecture we will prove tht not ll

More information