CS415 Compilers. Lexical Analysis and. These slides are based on slides copyrighted by Keith Cooper, Ken Kennedy & Linda Torczon at Rice University

Save this PDF as:
 WORD  PNG  TXT  JPG

Size: px
Start display at page:

Download "CS415 Compilers. Lexical Analysis and. These slides are based on slides copyrighted by Keith Cooper, Ken Kennedy & Linda Torczon at Rice University"

Transcription

1 CS415 Compilers Lexicl Anlysis nd These slides re sed on slides copyrighted y Keith Cooper, Ken Kennedy & Lind Torczon t Rice University

2 First Progrmming Project Instruction Scheduling Project hs een posted Due dtes: code Ferury 25, report Mrch 4 - strt erly - prolem is not totlly defined; you my run into situtions where you will need time to redesign your solution - the report is 40% of the grde, code is 60% - need to follow clling conventions since we will use utomtic testing frmework - we minly provide help for C/C++ implementtions - not group project! 2

3 Constructing Scnner Review source code specifictions Scnner Scnner Genertor prts of speech & words Tles nd code The scnner is the first stge in the front end Specifictions cn e expressed using regulr expressions Build tles nd code from DFA 3

4 Review: Gol We show how to construct finite stte utomton to recognize ny RE Overview: Direct construction of nondeterministic finite utomton (NFA) to recognize given RE Requires -trnsitions to comine regulr suexpressions Construct deterministic finite utomton (DFA) to simulte the NFA Use set-of-sttes construction Minimize the numer of sttes Hopcroft stte minimiztion lgorithm Generte the scnner code Additionl specifictions needed for detils 4

5 Non-deterministic Finite Automt Ech RE corresponds to deterministic finite utomton (DFA) My e hrd to directly construct the right DFA Wht out n RE such s ( ) *? S 0 S 1 S 2 S 3 S 4 This is little different S 0 hs trnsition on S 1 hs two trnsitions on This is non-deterministic finite utomton (NFA) 5

6 Non-deterministic Finite Automt An NFA ccepts string x iff pth though the trnsition grph from s 0 to finl stte such tht the edge lels spell x Trnsitions on consume no input To run the NFA, strt in s 0 nd guess the right trnsition t ech step Alwys guess correctly If some sequence of correct guesses ccepts x then ccept Why study NFAs? They re the key to utomte the RE DFA construction We cn pste together NFAs with -trnsitions NFA NFA ecomes n NFA 6

7 Reltionship etween NFAs nd DFAs DFA is specil cse of n NFA DFA hs no trnsitions DFA s trnsition function is single-vlued Sme rules will work DFA cn e simulted with n NFA Oviously NFA cn e simulted with DFA Simulte sets of possile sttes Possile exponentil lowup in the stte spce Still, one stte per chrcter in the input strem (less ovious) 7

8 Automting Scnner Construction To convert specifiction into code: 1 Write down the RE for the input lnguge 2 Build ig NFA 3 Build the DFA tht simultes the NFA 4 Systemticlly shrink the DFA 5 Turn it into code Scnner genertors Lex nd Flex work long these lines Algorithms re well-known nd well-understood Key issue is interfce to prser You could uild one in weekend! (define ll prts of speech) 8

9 Review: Automting Scnner Construction RE NFA (Thompson s construction) Build n NFA for ech term Comine them with -moves NFA DFA (suset construction) Build the simultion DFA Miniml DFA Hopcroft s lgorithm The Cycle of Constructions RE NFA DFA miniml DFA DFA RE (Not prt of the scnner construction) All pirs, ll pths prolem Tke the union of ll pths from s 0 to n ccepting stte 9

10 RE NFA using Thompson s Construction Key ide NFA pttern for ech symol nd ech opertor Ech NFA hs single strt nd ccept stte Join them with moves in precedence order S 3 S 4 NFA for NFA for 10

11 RE NFA using Thompson s Construction Key ide NFA pttern for ech symol nd ech opertor Ech NFA hs single strt nd ccept stte Join them with moves in precedence order S 3 S 4 NFA for NFA for 11

12 RE NFA using Thompson s Construction Key ide NFA pttern for ech symol nd ech opertor Ech NFA hs single strt nd ccept stte Join them with moves in precedence order S 3 S 4 NFA for NFA for S 1 S 2 S 3 S 4 NFA for 12

13 RE NFA using Thompson s Construction Key ide NFA pttern for ech symol nd ech opertor Ech NFA hs single strt nd ccept stte Join them with moves in precedence order S 3 S 4 NFA for NFA for S 1 S 2 S 0 S 3 S 4 S 5 NFA for 13

14 RE NFA using Thompson s Construction Key ide NFA pttern for ech symol nd ech opertor Ech NFA hs single strt nd ccept stte Join them with moves in precedence order S 3 S 4 NFA for NFA for S 1 S 2 S 0 S 5 S 3 S 4 NFA for 14

15 RE NFA using Thompson s Construction Key ide NFA pttern for ech symol nd ech opertor Ech NFA hs single strt nd ccept stte Join them with moves in precedence order S 3 S 4 NFA for NFA for S 0 S 1 S 2 S 3 S 4 NFA for S 5 S 1 S 3 NFA for * 15

16 RE NFA using Thompson s Construction Key ide NFA pttern for ech symol nd ech opertor Ech NFA hs single strt nd ccept stte Join them with moves in precedence order S 3 S 4 NFA for NFA for S 0 S 1 S 2 S 3 S 4 NFA for S 5 S 1 S 3 NFA for * 16

17 RE NFA using Thompson s Construction Key ide NFA pttern for ech symol nd ech opertor Ech NFA hs single strt nd ccept stte Join them with moves in precedence order S 3 S 4 NFA for NFA for S 0 S 1 S 2 S 3 S 4 NFA for S 5 S 3 S 4 NFA for * 17

18 RE NFA using Thompson s Construction Key ide NFA pttern for ech symol nd ech opertor Ech NFA hs single strt nd ccept stte Join them with moves in precedence order S 3 S 4 NFA for NFA for S 0 S 1 S 2 S 3 S 4 NFA for S 5 NFA for * S 3 S 4 18

19 RE NFA using Thompson s Construction Key ide NFA pttern for ech symol nd ech opertor Ech NFA hs single strt nd ccept stte Join them with moves in precedence order S 3 S 4 NFA for NFA for S 0 S 1 S 2 S 3 S 4 NFA for S 5 NFA for * S 3 S 4 Ken Thompson, CACM,

20 Exmple of Thompson s Construction Let s try ( c ) * 1.,, & c c 2. c S 1 S 2 S 0 S 5 c S 3 S 4 3. ( c ) * S 2 S 3 S 6 S 7 c S 4 S 5 20

21 Exmple of Thompson s Construction Let s try ( c ) * 1.,, & c c 2. c S 1 S 2 S 0 S 5 c S 3 S 4 3. ( c ) * S 2 S 3 S 6 S 7 S 4 c S 5 21

22 Exmple of Thompson s Construction (con t) 4. ( c ) * S 4 S 5 S 2 S 3 S 8 S 9 S 6 c S 7 Of course, humn would design something simpler... c But, we cn utomte production of the more complex one... 22

23 Review: Automting Scnner Construction RE NFA (Thompson s construction) Build n NFA for ech term Comine them with -moves NFA DFA (suset construction) Build the simultion DFA Miniml DFA Hopcroft s lgorithm The Cycle of Constructions RE NFA DFA miniml DFA DFA RE (Not prt of the scnner construction) All pirs, ll pths prolem Tke the union of ll pths from s 0 to n ccepting stte 23

24 NFA DFA with Suset Construction Need to uild simultion of the NFA Two key functions Move(s i, ) is set of sttes rechle from s i y -closure(s i ) is set of sttes rechle from s i y The lgorithm: Strt stte derived from s 0 of the NFA Tke its -closure S 0 = -closure(s 0 ) Tke the imge of S 0, move(s 0, ) for ech Σ, nd tke its -closure, dd it to the stte set S For ech stte S, compute move(s, ) for ech Σ, nd tke its -closure Iterte until no more sttes re dded Sounds more complex thn it is 24

25 NFA DFA with Suset Construction The lgorithm: s 0 -closure(q 0 ) dd s 0 to S while ( S is still chnging ) for ech s i S for ech Σ s? -closure(move(s i,)) if ( s? S ) then dd s? to S s s j T[ s i,] s j else T[ s i,] s? Let s think out why this works 25

26 NFA DFA with Suset Construction The lgorithm: s 0 -closure(q 0 ) dd s 0 to S while ( S is still chnging ) for ech s i S for ech Σ s? -closure(move(s i,)) if ( s? S ) then dd s? to S s s j T[ s i,] s j else T[ s i,] s? The lgorithm hlts: 1. S contins no duplictes (test efore dding) 2. 2 Q is finite 3. while loop dds to S, ut does not remove from S (monotone) the loop hlts S contins ll the rechle NFA sttes It tries ech symol in ech s i. It uilds every possile NFA configurtion. S nd T form the DFA Let s think out why this works 26

27 NFA DFA with Suset Construction Exmple of fixed-point computtion Monotone construction of some finite set Hlts when it stops dding to the set Proofs of hlting & correctness re similr These computtions rise in mny contexts Other fixed-point computtions Cnonicl construction of sets of LR(1) items Quite similr to the suset construction Clssic dt-flow nlysis Solving sets of simultneous set equtions DFA minimiztion lgorithm (coming up!) We will see mny more fixed-point computtions 27

28 NFA DFA with Suset Construction ( c )* : q 0 q 1 q 4 q 5 q q 3 q 2 8 q 9 q 6 c q 7 Applying the suset construction: -closure(move(s,*)) NFA sttes c s 0 q 0 q 1 28

29 NFA DFA with Suset Construction ( c )* : q 0 q 1 q 4 q 5 q q 3 q 2 8 q 9 q 6 c q 7 Applying the suset construction: -closure(move(s,*)) NFA sttes c s 0 q 0 q 1, q 2, q 3, q 4, q 6, q 9 none none 29

30 NFA DFA with Suset Construction ( c )* : q 0 q 1 q 4 q 5 q q 3 q 2 8 q 9 q 6 c q 7 Applying the suset construction: -closure(move(s,*)) NFA sttes c s 0 q 0 q 1, q 2, q 3, q 4, q 6, q 9 s 1 q 1, q 2, q 3, q 4, q 6, q 9 none none 30

31 NFA DFA with Suset Construction ( c )* : q 0 q 1 q 4 q 5 q q 3 q 2 8 q 9 q 6 c q 7 Applying the suset construction: -closure(move(s,*)) NFA sttes c s 0 q 0 q 1, q 2, q 3, q 4, q 6, q 9 s 1 q 1, q 2, q 3, none q 4, q 6, q 9 none none 31

32 NFA DFA with Suset Construction ( c )* : q 0 q 1 q 4 q 5 q q 3 q 2 8 q 9 q 6 c q 7 Applying the suset construction: -closure(move(s,*)) NFA sttes c s 0 q 0 q 1, q 2, q 3, q 4, q 6, q 9 none none s 1 q 1, q 2, q 3, q 4, q 6, q 9 none q 5 q 7 32

33 NFA DFA with Suset Construction ( c )* : q 0 q 1 q 4 q 5 q q 3 q 2 8 q 9 q 6 c q 7 Applying the suset construction: -closure(move(s,*)) NFA sttes c s 0 q 0 q 1, q 2, q 3, q 4, q 6, q 9 none s 1 q 1, q 2, q 3, none q 5, q 8, q 9, q 4, q 6, q 9 q 3, q 4, q 6 none q 7, q 8, q 9, q 3, q 4, q 6 33

34 NFA DFA with Suset Construction ( c )* : q 0 q 1 q 4 q 5 q q 3 q 2 8 q 9 q 6 c q 7 Applying the suset construction: -closure(move(s,*)) NFA sttes c s 0 q 0 q 1, q 2, q 3, q 4, q 6, q 9 none s 1 q 1, q 2, q 3, none q 5, q 8, q 9, q 4, q 6, q 9 q 3, q 4, q 6 s 2 q 5, q 8, q 9, q 3, q 4, q 6 none q 7, q 8, q 9, q 3, q 4, q 6 34

35 NFA DFA with Suset Construction ( c )* : q 0 q 1 q 4 q 5 q q 3 q 2 8 q 9 q 6 c q 7 Applying the suset construction: -closure(move(s,*)) NFA sttes c s 0 q 0 q 1, q 2, q 3, none none q 4, q 6, q 9 s 1 q 1, q 2, q 3, q 4, q 6, q 9 none q 5, q 8, q 9, q 3, q 4, q 6 q 7, q 8, q 9, q 3, q 4, q 6 s 2 q 5, q 8, q 9, q 3, q 4, q 6 none s 2 s 3 35

36 NFA DFA with Suset Construction ( c )* : q 0 q 1 q 4 q 5 q q 3 q 2 8 q 9 q 6 c q 7 Applying the suset construction: -closure(move(s,*)) NFA sttes c s 0 q 0 q 1, q 2, q 3, none none q 4, q 6, q 9 s 1 q 1, q 2, q 3, q 4, q 6, q 9 none q 5, q 8, q 9, q 3, q 4, q 6 q 7, q 8, q 9, q 3, q 4, q 6 s 2 q 5, q 8, q 9, none s 2 s 3 q 3, q 4, q 6 s 3 q 7, q 8, q 9, q 3, q 4, q 6 36

37 NFA DFA with Suset Construction ( c )* : q 0 q 1 q 4 q 5 q q 3 q 2 8 q 9 q 6 c q 7 Applying the suset construction: -closure(move(s,*)) NFA sttes c s 0 q 0 q 1, q 2, q 3, none none q 4, q 6, q 9 s 1 q 1, q 2, q 3, none q 5, q 8, q 9, q 7, q 8, q 9, q 4, q 6, q 9 q 3, q 4, q 6 q 3, q 4, q 6 s 2 q 5, q 8, q 9, none s 2 s 3 q 3, q 4, q 6 s 3 q 7, q 8, q 9, none s 2 s 3 q 3, q 4, q 6 37

38 NFA DFA with Suset Construction ( c )* : q 0 q 1 q 4 q 5 q q 3 q 2 8 q 9 q 6 c q 7 Applying the suset construction: -closure(move(s,*)) NFA sttes c s 0 q 0 q 1, q 2, q 3, none none q 4, q 6, q 9 s 1 q 1, q 2, q 3, none q 5, q 8, q 9, q 7, q 8, q 9, q 4, q 6, q 9 q 3, q 4, q 6 q 3, q 4, q 6 s 2 q 5, q 8, q 9, none s 2 s 3 q 3, q 4, q 6 s 3 q 7, q 8, q 9, none s 2 s 3 q 3, q 4, q 6 Finl sttes 38

39 NFA DFA with Suset Construction The DFA for ( c ) * s 0 s 1 c s 2 s 3 c c δ c s 0 s s 1 - s 2 s 3 s 2 - s 2 s 3 s 3 - s 2 s 3 Ends up smller thn the NFA All trnsitions re deterministic 39

40 Automting Scnner Construction RE NFA (Thompson s construction) Build n NFA for ech term The Cycle of Constructions Comine them with -moves NFA DFA (suset construction) Build the simultion DFA Miniml DFA Hopcroft s lgorithm RE NFA DFA miniml DFA DFA RE (not relly prt of scnner construction) All pirs, ll pths prolem Union together pths from s 0 to finl stte 40

41 DFA Minimiztion The Big Picture Discover sets of equivlent sttes Represent ech such set with just one stte 41

42 DFA Minimiztion The Big Picture Discover sets of equivlent sttes Represent ech such set with just one stte Two sttes re equivlent if nd only if: Σ, trnsitions on led to equivlent sttes (DFA) -trnsitions to distinct sets sttes must e in distinct sets 42

43 DFA Minimiztion The Big Picture Discover sets of equivlent sttes Represent ech such set with just one stte Two sttes re equivlent if nd only if: Σ, trnsitions on led to equivlent sttes (DFA) -trnsitions to distinct sets sttes must e in distinct sets A prtition P of S Ech stte s S is in exctly one set p i P The lgorithm itertively prtitions the DFA s sttes 43

44 DFA Minimiztion Detils of the lgorithm Group sttes into mximl size sets, optimisticlly Itertively sudivide those sets, s needed Sttes tht remin grouped together re equivlent Initil prtition, P 0, hs two sets: {F} & {Q-F} (D =(Q,Σ,δ,q 0,F)) Splitting set ( prtitioning set y ) Assume q, & q s, nd δ(q,) = q x, & δ(q,) = q y If q x & q y re not in the sme set, then s must e split q hs trnsition on, q does not splits s 44

45 DFA Minimiztion The lgorithm P { F, {Q-F}} while ( P is still chnging) T { } for ech set S P T T split(s) P T split(s): for ech Σ if splits S into S 1, S 2, then return {S 1, S 2, } else return S Why does this work? Prtition P 2 Q Strt off with 2 susets of Q {F} nd {Q-F} While loop tkes P i P i+1 y splitting 1 or more sets P i+1 is t lest one step closer to the prtition with Q sets Mximum of Q splits Note tht Prtitions re never comined 45

46 DFA Minimiztion The lgorithm P { F, {Q-F}} while ( P is still chnging) T { } for ech set S P T T split(s) P T split(s): for ech Σ if splits S into S 1, S 2, then return {S 1, S 2, } else return S Why does this work? Prtition P 2 Q Strt off with 2 susets of Q {F} nd {Q-F} While loop tkes P i P i+1 y splitting 1 or more sets P i+1 is t lest one step closer to the prtition with Q sets Mximum of Q splits Note tht Prtitions re never comined This is fixed-point lgorithm! 46

47 Bck to our DFA Minimiztion exmple Then, pply the minimiztion lgorithm Split on Current Prtition c P 0 { s 1, s 2, s 3 } {s 0 } none none none s 0 s 1 c s 2 c finl sttes s 3 c To produce the miniml DFA s 0 s 1 c We oserved tht humn would design simpler utomton thn Thompson s construction & the suset construction did. Minimizing tht DFA produces the one tht humn would design! 47

48 Arevited Register Specifiction Strt with regulr expression r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 The Cycle of Constructions RE NFA DFA miniml DFA 48

49 Arevited Register Specifiction Thompson s construction produces r 0 r 1 s 0 r 2 r 8 s f r 9 The Cycle of Constructions RE NFA DFA miniml DFA 49

50 Arevited Register Specifiction The suset construction uilds s 0 r 0 s f s f 1 s f8 s f2 s f9 This is DFA, ut it hs lot of sttes The Cycle of Constructions RE NFA DFA miniml DFA 50

51 Arevited Register Specifiction The DFA minimiztion lgorithm uilds s 0 r 0,1,2,3,4, 5,6,7,8,9 s f This looks like wht skilled compiler writer would do! The Cycle of Constructions RE NFA DFA miniml DFA 51

52 Homework nd Next clss Syntx Anlysis Red EC:

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

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

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

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

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

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

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

Homework 3 Solutions

Homework 3 Solutions CS 341: Foundtions of Computer Science II Prof. Mrvin Nkym Homework 3 Solutions 1. Give NFAs with the specified numer of sttes recognizing ech of the following lnguges. In ll cses, the lphet is Σ = {,1}.

More information

CS 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

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

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

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

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

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

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

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

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

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

More information

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018 Finite Automt Theory nd Forml Lnguges TMV027/DIT321 LP4 2018 Lecture 10 An Bove April 23rd 2018 Recp: Regulr Lnguges We cn convert between FA nd RE; Hence both FA nd RE ccept/generte regulr lnguges; More

More information

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

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

More information

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

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

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

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

CS375: Logic and Theory of Computing

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

More information

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

On Determinisation of History-Deterministic Automata.

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

More information

Lecture 9: LTL and Büchi Automata

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

More information

Chapter 1, Part 1. Regular Languages. CSC527, Chapter 1, Part 1 c 2012 Mitsunori Ogihara 1

Chapter 1, Part 1. Regular Languages. CSC527, Chapter 1, Part 1 c 2012 Mitsunori Ogihara 1 Chpter 1, Prt 1 Regulr Lnguges CSC527, Chpter 1, Prt 1 c 2012 Mitsunori Ogihr 1 Finite Automt A finite utomton is system for processing ny finite sequence of symols, where the symols re chosen from finite

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

input tape head moves current state

input tape head moves current state CPS 140 - Mthemticl Foundtions of CS Dr. Susn Rodger Section: Finite Automt (Ch. 2) (lecture notes) Things to do in clss tody (Jn. 13, 2004): ffl questions on homework 1 ffl finish chpter 1 ffl Red Chpter

More information

CS S-12 Turing Machine Modifications 1. When we added a stack to NFA to get a PDA, we increased computational power

CS S-12 Turing Machine Modifications 1. When we added a stack to NFA to get a PDA, we increased computational power CS411-2015S-12 Turing Mchine Modifictions 1 12-0: Extending Turing Mchines When we dded stck to NFA to get PDA, we incresed computtionl power Cn we do the sme thing for Turing Mchines? Tht is, cn we dd

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

5.1 Definitions and Examples 5.2 Deterministic Pushdown Automata

5.1 Definitions and Examples 5.2 Deterministic Pushdown Automata CSC4510 AUTOMATA 5.1 Definitions nd Exmples 5.2 Deterministic Pushdown Automt Definitions nd Exmples A lnguge cn be generted by CFG if nd only if it cn be ccepted by pushdown utomton. A pushdown utomton

More information

Agenda. Agenda. Regular Expressions. Examples of Regular Expressions. Regular Expressions (crash course) Computational Linguistics 1

Agenda. Agenda. Regular Expressions. Examples of Regular Expressions. Regular Expressions (crash course) Computational Linguistics 1 Agend CMSC/LING 723, LBSC 744 Kristy Hollingshed Seitz Institute for Advnced Computer Studies University of Mrylnd HW0 questions? Due Thursdy before clss! When in doubt, keep it simple... Lecture 2: 6

More information

Overview HC9. Parsing: Top-Down & LL(1) Context-Free Grammars (1) Introduction. CFGs (3) Context-Free Grammars (2) Vertalerbouw HC 9: Ch.

Overview HC9. Parsing: Top-Down & LL(1) Context-Free Grammars (1) Introduction. CFGs (3) Context-Free Grammars (2) Vertalerbouw HC 9: Ch. Overview H9 Vertlerouw H 9: Prsing: op-down & LL(1) do 3 mei 2001 56 heo Ruys h. 8 - Prsing 8.1 ontext-free Grmmrs 8.2 op-down Prsing 8.3 LL(1) Grmmrs See lso [ho, Sethi & Ullmn 1986] for more thorough

More information

Probabilistic Model Checking Michaelmas Term Dr. Dave Parker. Department of Computer Science University of Oxford

Probabilistic Model Checking Michaelmas Term Dr. Dave Parker. Department of Computer Science University of Oxford Probbilistic Model Checking Michelms Term 2011 Dr. Dve Prker Deprtment of Computer Science University of Oxford Long-run properties Lst lecture: regulr sfety properties e.g. messge filure never occurs

More information

Section: Other Models of Turing Machines. Definition: Two automata are equivalent if they accept the same language.

Section: Other Models of Turing Machines. Definition: Two automata are equivalent if they accept the same language. Section: Other Models of Turing Mchines Definition: Two utomt re equivlent if they ccept the sme lnguge. Turing Mchines with Sty Option Modify δ, Theorem Clss of stndrd TM s is equivlent to clss of TM

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

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

Formal Methods in Software Engineering

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

More information

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

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

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

More information

CS 330 Formal Methods and Models

CS 330 Formal Methods and Models CS 0 Forml Methods nd Models Dn Richrds, George Mson University, Fll 2016 Quiz Solutions Quiz 1, Propositionl Logic Dte: Septemer 8 1. Prove q (q p) p q p () (4pts) with truth tle. p q p q p (q p) p q

More information

Normal Forms for Context-free Grammars

Normal Forms for Context-free Grammars Norml Forms for Context-free Grmmrs 1 Linz 6th, Section 6.2 wo Importnt Norml Forms, pges 171--178 2 Chomsky Norml Form All productions hve form: A BC nd A vrile vrile terminl 3 Exmples: S AS S AS S S

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

Prefix-Free Regular-Expression Matching

Prefix-Free Regular-Expression Matching Prefix-Free Regulr-Expression Mthing Yo-Su Hn, Yjun Wng nd Derik Wood Deprtment of Computer Siene HKUST Prefix-Free Regulr-Expression Mthing p.1/15 Pttern Mthing Given pttern P nd text T, find ll sustrings

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

Good-for-Games Automata versus Deterministic Automata.

Good-for-Games Automata versus Deterministic Automata. Good-for-Gmes Automt versus Deterministic Automt. Denis Kuperberg 1,2 Mich l Skrzypczk 1 1 University of Wrsw 2 IRIT/ONERA (Toulouse) Séminire MoVe 12/02/2015 LIF, Luminy Introduction Deterministic utomt

More information

Software Engineering using Formal Methods

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

More information

Automata and Languages

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

More information

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

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

More information

Chapter 7. Kleene s Theorem. 7.1 Kleene s Theorem. The following theorem is the most important and fundamental result in the theory of FA s:

Chapter 7. Kleene s Theorem. 7.1 Kleene s Theorem. The following theorem is the most important and fundamental result in the theory of FA s: Chpte 7 Kleene s Theoem 7.1 Kleene s Theoem The following theoem is the most impotnt nd fundmentl esult in the theoy of FA s: Theoem 6 Any lnguge tht cn e defined y eithe egul expession, o finite utomt,

More information

The University of Nottingham

The University of Nottingham The University of Nottinghm SCHOOL OF COMPUTR SCINC AND INFORMATION TCHNOLOGY A LVL 1 MODUL, SPRING SMSTR 2004-2005 MACHINS AND THIR LANGUAGS Time llowed TWO hours Cndidtes must NOT strt writing their

More information

Design and Analysis of Distributed Interacting Systems

Design and Analysis of Distributed Interacting Systems Design nd Anlysis of Distriuted Intercting Systems Lecture 6 LTL Model Checking Prof. Dr. Joel Greenyer My 16, 2013 Some Book References (1) C. Bier, J.-P. Ktoen: Principles of Model Checking. The MIT

More information

Nondeterministic Biautomata and Their Descriptional Complexity

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

More information

The Minimization Problem. The Minimization Problem. The Minimization Problem. The Minimization Problem. The Minimization Problem

The Minimization Problem. The Minimization Problem. The Minimization Problem. The Minimization Problem. The Minimization Problem Simpler & More Generl Minimiztion for Weighted Finite-Stte Automt Json Eisner Johns Hopkins University My 28, 2003 HLT-NAACL First hlf of tlk is setup - revies pst ork. Second hlf gives outline of the

More information

On the Relative Succinctness of Nondeterministic Büchi and co-büchi Word Automata

On the Relative Succinctness of Nondeterministic Büchi and co-büchi Word Automata On the Reltive Succinctness of Nondeterministic Büchi nd co-büchi Word Automt Benjmin Aminof, Orn Kupfermn, nd Omer Lev Herew University, School of Engineering nd Computer Science, Jeruslem 91904, Isrel

More information

Section 6.1 Definite Integral

Section 6.1 Definite Integral Section 6.1 Definite Integrl Suppose we wnt to find the re of region tht is not so nicely shped. For exmple, consider the function shown elow. The re elow the curve nd ove the x xis cnnot e determined

More information

Recursively Enumerable and Recursive. Languages

Recursively Enumerable and Recursive. Languages Recursively Enumerble nd Recursive nguges 1 Recll Definition (clss 19.pdf) Definition 10.4, inz, 6 th, pge 279 et S be set of strings. An enumertion procedure for Turing Mchine tht genertes ll strings

More information

How do we solve these things, especially when they get complicated? How do we know when a system has a solution, and when is it unique?

How do we solve these things, especially when they get complicated? How do we know when a system has a solution, and when is it unique? XII. LINEAR ALGEBRA: SOLVING SYSTEMS OF EQUATIONS Tody we re going to tlk out solving systems of liner equtions. These re prolems tht give couple of equtions with couple of unknowns, like: 6= x + x 7=

More information

Chapter 4 State-Space Planning

Chapter 4 State-Space Planning Leture slides for Automted Plnning: Theory nd Prtie Chpter 4 Stte-Spe Plnning Dn S. Nu CMSC 722, AI Plnning University of Mrylnd, Spring 2008 1 Motivtion Nerly ll plnning proedures re serh proedures Different

More information

The Caucal Hierarchy of Infinite Graphs in Terms of Logic and Higher-order Pushdown Automata

The Caucal Hierarchy of Infinite Graphs in Terms of Logic and Higher-order Pushdown Automata The Cucl Hierrchy of Infinite Grphs in Terms of Logic nd Higher-order Pushdown Automt Arnud Cryol 1 nd Stefn Wöhrle 2 1 IRISA Rennes, Frnce rnud.cryol@iris.fr 2 Lehrstuhl für Informtik 7 RWTH Achen, Germny

More information

Designing Information Devices and Systems I Fall 2016 Babak Ayazifar, Vladimir Stojanovic Homework 6. This homework is due October 11, 2016, at Noon.

Designing Information Devices and Systems I Fall 2016 Babak Ayazifar, Vladimir Stojanovic Homework 6. This homework is due October 11, 2016, at Noon. EECS 16A Designing Informtion Devices nd Systems I Fll 2016 Bk Ayzifr, Vldimir Stojnovic Homework 6 This homework is due Octoer 11, 2016, t Noon. 1. Homework process nd study group Who else did you work

More information

Compilers. Lexical analysis. Yannis Smaragdakis, U. Athens (original slides by Sam

Compilers. Lexical analysis. Yannis Smaragdakis, U. Athens (original slides by Sam Compilers Lecture 3 Lexical analysis Yannis Smaragdakis, U. Athens (original slides by Sam Guyer@Tufts) Big picture Source code Front End IR Back End Machine code Errors Front end responsibilities Check

More information

expression simply by forming an OR of the ANDs of all input variables for which the output is

expression simply by forming an OR of the ANDs of all input variables for which the output is 2.4 Logic Minimiztion nd Krnugh Mps As we found ove, given truth tle, it is lwys possile to write down correct logic expression simply y forming n OR of the ANDs of ll input vriles for which the output

More information

How Deterministic are Good-For-Games Automata?

How Deterministic are Good-For-Games Automata? How Deterministic re Good-For-Gmes Automt? Udi Boker 1, Orn Kupfermn 2, nd Mich l Skrzypczk 3 1 Interdisciplinry Center, Herzliy, Isrel 2 The Herew University, Isrel 3 University of Wrsw, Polnd Astrct

More information

Resources. Introduction: Binding. Resource Types. Resource Sharing. The type of a resource denotes its ability to perform different operations

Resources. Introduction: Binding. Resource Types. Resource Sharing. The type of a resource denotes its ability to perform different operations Introduction: Binding Prt of 4-lecture introduction Scheduling Resource inding Are nd performnce estimtion Control unit synthesis This lecture covers Resources nd resource types Resource shring nd inding

More information

Prefix-Free Subsets of Regular Languages and Descriptional Complexity

Prefix-Free Subsets of Regular Languages and Descriptional Complexity Prefix-Free Susets of Regulr Lnguges nd Descriptionl Complexity Jozef Jirásek Jurj Šeej DCFS 2015 Prefix-Free Susets of Regulr Lnguges nd Descriptionl Complexity Jozef Jirásek, Jurj Šeej 1/22 Outline Mximl

More information

Previously on GLT. Basic technologies. Lexical analysis. Basic technologies ASF+SDF. Concepts of programming languages

Previously on GLT. Basic technologies. Lexical analysis. Basic technologies ASF+SDF. Concepts of programming languages Prevously on GLT Generc Lnguge Technology: Bsc technologes Pro.dr. Mrk vn den Brnd ASF+SDF syntx descrptons semntc descrptons: type checkng nlyss trnsormtons t so to s Concepts o progrmmng lnguges syntctc

More information

Where did dynamic programming come from?

Where did dynamic programming come from? Where did dynmic progrmming come from? String lgorithms Dvid Kuchk cs302 Spring 2012 Richrd ellmn On the irth of Dynmic Progrmming Sturt Dreyfus http://www.eng.tu.c.il/~mi/cd/ or50/1526-5463-2002-50-01-0048.pdf

More information

On NFA reductions. N6A 5B7, London, Ontario, CANADA ilie 2 Department of Computer Science, University of Chile

On NFA reductions. N6A 5B7, London, Ontario, CANADA ilie 2 Department of Computer Science, University of Chile On NFA reductions Lucin Ilie 1,, Gonzlo Nvrro 2, nd Sheng Yu 1, 1 Deprtment of Computer Science, University of Western Ontrio N6A 5B7, London, Ontrio, CANADA ilie syu@csd.uwo.c 2 Deprtment of Computer

More information

Project 6: Minigoals Towards Simplifying and Rewriting Expressions

Project 6: Minigoals Towards Simplifying and Rewriting Expressions MAT 51 Wldis Projet 6: Minigols Towrds Simplifying nd Rewriting Expressions The distriutive property nd like terms You hve proly lerned in previous lsses out dding like terms ut one prolem with the wy

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

Cover Automata for Finite Languages

Cover Automata for Finite Languages Cover Automt for Finite Lnguges Michël Cdilhc Technicl Report n o 0504, June 2005 revision 681 Astrct. Although regulr lnguges comined with finite utomt re widely used nd studied, mny pplictions only use

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

Nondeterministic Finite Automata

Nondeterministic Finite Automata Nondeterministi Finite utomt The Power of Guessing Tuesdy, Otoer 4, 2 Reding: Sipser.2 (first prt); Stoughton 3.3 3.5 S235 Lnguges nd utomt eprtment of omputer Siene Wellesley ollege Finite utomton (F)

More information

Complementing Büchi Automata with a Subset-tuple Construction

Complementing Büchi Automata with a Subset-tuple Construction DEPARTEMENT D INFORMATIQUE DEPARTEMENT FÜR INFORMATIK Bd de Pérolles 90 CH-1700 Friourg www.unifr.ch/informtics WORKING PAPER Complementing Büchi Automt with Suset-tuple Construction J. Allred & U. Ultes-Nitsche

More information

MATH 573 FINAL EXAM. May 30, 2007

MATH 573 FINAL EXAM. May 30, 2007 MATH 573 FINAL EXAM My 30, 007 NAME: Solutions 1. This exm is due Wednesdy, June 6 efore the 1:30 pm. After 1:30 pm I will NOT ccept the exm.. This exm hs 1 pges including this cover. There re 10 prolems.

More information

State Complexity of Union and Intersection of Binary Suffix-Free Languages

State Complexity of Union and Intersection of Binary Suffix-Free Languages Stte Complexity of Union nd Intersetion of Binry Suffix-Free Lnguges Glin Jirásková nd Pvol Olejár Slovk Ademy of Sienes nd Šfárik University, Košie 0000 1111 0000 1111 Glin Jirásková nd Pvol Olejár Binry

More information

i 1 i 2 i 3... i p o 1 o 2 AUTOMATON q 1, q 2,,q n ... o q Model of a automaton Characteristics of automaton:

i 1 i 2 i 3... i p o 1 o 2 AUTOMATON q 1, q 2,,q n ... o q Model of a automaton Characteristics of automaton: Definition of n Automton:-An Automton is defined s system tht preforms certin functions without humn intervention. it ccepts rw mteril nd energy s input nd converts them into the finl product under the

More information

CDM Memoryless Machines

CDM Memoryless Machines CDM Memoryless Mchines Zero Spce Klus Sutner Crnegie Mellon Universlity 2 Finite Stte Mchines Fll 27 3 DFA Decision Problems Where Are We? 3 Turing Mchines 4 We hve description of bstrct computbility in

More information

Models of Computation: Automata and Processes. J.C.M. Baeten

Models of Computation: Automata and Processes. J.C.M. Baeten Models of Computtion: Automt nd Processes J.C.M. Beten Jnury 4, 2010 ii Prefce Computer science is the study of discrete ehviour of intercting informtion processing gents. Here, ehviour is the centrl notion.

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

References. Theory of Computation. Theory of Computation. Introduction. Alexandre Duret-Lutz

References. Theory of Computation. Theory of Computation. Introduction. Alexandre Duret-Lutz References Theory of Computtion Alexndre Duret-Lutz dl@lrde.epit.fr Septemer 10, 2010 Introduction to the Theory of Computtion (Michel Sipser, 2005). Lecture notes from Pierre Wolper's course t http://www.montefiore.ulg.c.e/~pw/cours/clc.html

More information

How to simulate Turing machines by invertible one-dimensional cellular automata

How to simulate Turing machines by invertible one-dimensional cellular automata How to simulte Turing mchines by invertible one-dimensionl cellulr utomt Jen-Christophe Dubcq Déprtement de Mthémtiques et d Informtique, École Normle Supérieure de Lyon, 46, llée d Itlie, 69364 Lyon Cedex

More information

Hyper-minimisation of weighted finite automata

Hyper-minimisation of weighted finite automata Hyper-minimistion of weighted finite utomt Dniel Quernheim nd ndres Mletti Institute for Nturl Lnguge Processing, University of Stuttgrt @ims.uni-stuttgrt.de ugust 18, 2011. Mletti nd D. Quernheim

More information

u( t) + K 2 ( ) = 1 t > 0 Analyzing Damped Oscillations Problem (Meador, example 2-18, pp 44-48): Determine the equation of the following graph.

u( t) + K 2 ( ) = 1 t > 0 Analyzing Damped Oscillations Problem (Meador, example 2-18, pp 44-48): Determine the equation of the following graph. nlyzing Dmped Oscilltions Prolem (Medor, exmple 2-18, pp 44-48): Determine the eqution of the following grph. The eqution is ssumed to e of the following form f ( t) = K 1 u( t) + K 2 e!"t sin (#t + $

More information

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

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

More information

CSCI FOUNDATIONS OF COMPUTER SCIENCE

CSCI FOUNDATIONS OF COMPUTER SCIENCE 1 CSCI- 2200 FOUNDATIONS OF COMPUTER SCIENCE Spring 2015 My 7, 2015 2 Announcements Homework 9 is due now. Some finl exm review problems will be posted on the web site tody. These re prcqce problems not

More information

General Algorithms for Testing the Ambiguity of Finite Automata

General Algorithms for Testing the Ambiguity of Finite Automata Generl Algorithms for Testing the Amiguity of Finite Automt Cyril Alluzen 1,, Mehryr Mohri 2,1, nd Ashish Rstogi 1, 1 Google Reserch, 76 Ninth Avenue, New York, NY 10011. 2 Cournt Institute of Mthemticl

More information

Lecture 7 notes Nodal Analysis

Lecture 7 notes Nodal Analysis Lecture 7 notes Nodl Anlysis Generl Network Anlysis In mny cses you hve multiple unknowns in circuit, sy the voltges cross multiple resistors. Network nlysis is systemtic wy to generte multiple equtions

More information

Improper Integrals. The First Fundamental Theorem of Calculus, as we ve discussed in class, goes as follows:

Improper Integrals. The First Fundamental Theorem of Calculus, as we ve discussed in class, goes as follows: Improper Integrls The First Fundmentl Theorem of Clculus, s we ve discussed in clss, goes s follows: If f is continuous on the intervl [, ] nd F is function for which F t = ft, then ftdt = F F. An integrl

More information

Linear Systems with Constant Coefficients

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

More information

Global Types for Dynamic Checking of Protocol Conformance of Multi-Agent Systems

Global Types for Dynamic Checking of Protocol Conformance of Multi-Agent Systems Globl Types for Dynmic Checking of Protocol Conformnce of Multi-Agent Systems (Extended Abstrct) Dvide Ancon, Mtteo Brbieri, nd Vivin Mscrdi DIBRIS, University of Genov, Itly emil: dvide@disi.unige.it,

More information

Learning Goals. Relational Query Languages. Formal Relational Query Languages. Formal Query Languages: Relational Algebra and Relational Calculus

Learning Goals. Relational Query Languages. Formal Relational Query Languages. Formal Query Languages: Relational Algebra and Relational Calculus Forml Query Lnguges: Reltionl Alger nd Reltionl Clculus Chpter 4 Lerning Gols Given dtse ( set of tles ) you will e le to express dtse query in Reltionl Alger (RA), involving the sic opertors (selection,

More information

Last time: introduced our first computational model the DFA.

Last time: introduced our first computational model the DFA. Lctur 7 Homwork #7: 2.2.1, 2.2.2, 2.2.3 (hnd in c nd d), Misc: Givn: M, NFA Prov: (q,xy) * (p,y) iff (q,x) * (p,) (follow proof don in clss tody) Lst tim: introducd our first computtionl modl th DFA. Tody

More information

A Bounded Incremental Test Generation Algorithm for Finite State Machines

A Bounded Incremental Test Generation Algorithm for Finite State Machines A Bounded Incrementl Test Genertion Algorithm for Finite Stte Mchines Zoltán Pp 1, Mhdevn Surmnim 2, Gáor Kovács 3, Gáor Árpád Németh3 1 Ericsson Telecomm. Hungry, H-1117 Budpest, Irinyi J. u. 4-20, Hungry

More information

10. AREAS BETWEEN CURVES

10. AREAS BETWEEN CURVES . AREAS BETWEEN CURVES.. Ares etween curves So res ove the x-xis re positive nd res elow re negtive, right? Wrong! We lied! Well, when you first lern out integrtion it s convenient fiction tht s true in

More information