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

Similar documents
Regular expressions, Finite Automata, transition graphs are all the same!!

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

Deterministic Finite Automata

Minimal DFA. minimal DFA for L starting from any other

Fundamentals of Computer Science

CS103B Handout 18 Winter 2007 February 28, 2007 Finite Automata

AUTOMATA AND LANGUAGES. Definition 1.5: Finite Automaton

Lecture 08: Feb. 08, 2019

CSCI 340: Computational Models. Kleene s Theorem. Department of Computer Science

Let's start with an example:

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

CMPSCI 250: Introduction to Computation. Lecture #31: What DFA s Can and Can t Do David Mix Barrington 9 April 2014

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

Homework 4. 0 ε 0. (00) ε 0 ε 0 (00) (11) CS 341: Foundations of Computer Science II Prof. Marvin Nakayama

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

Homework 3 Solutions

CS 301. Lecture 04 Regular Expressions. Stephen Checkoway. January 29, 2018

Chapter 2 Finite Automata

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

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

State Minimization for DFAs

CISC 4090 Theory of Computation

CS311 Computational Structures Regular Languages and Regular Grammars. Lecture 6

CHAPTER 1 Regular Languages. Contents. definitions, examples, designing, regular operations. Non-deterministic Finite Automata (NFA)

CHAPTER 1 Regular Languages. Contents

CS 311 Homework 3 due 16:30, Thursday, 14 th October 2010

Finite Automata-cont d

ɛ-closure, Kleene s Theorem,

Nondeterminism and Nodeterministic Automata

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

CS375: Logic and Theory of Computing

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

Formal Languages and Automata

Thoery of Automata CS402

Lecture 6 Regular Grammars

Regular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Kleene-*

Harvard University Computer Science 121 Midterm October 23, 2012

Java II Finite Automata I

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

Lexical Analysis Finite Automate

CS375: Logic and Theory of Computing

Table of contents: Lecture N Summary... 3 What does automata mean?... 3 Introduction to languages... 3 Alphabets... 3 Strings...

input tape head moves current state

First Midterm Examination

In-depth introduction to main models, concepts of theory of computation:

Worked out examples Finite Automata

Convert the NFA into DFA

12.1 Nondeterminism Nondeterministic Finite Automata. a a b ε. CS125 Lecture 12 Fall 2014

Theory of Computation Regular Languages

Chapter Five: Nondeterministic Finite Automata. Formal Language, chapter 5, slide 1

Formal Language and Automata Theory (CS21004)

Non-deterministic Finite Automata

Anatomy of a Deterministic Finite Automaton. Deterministic Finite Automata. A machine so simple that you can understand it in less than one minute

Lecture 09: Myhill-Nerode Theorem

Non-deterministic Finite Automata

More on automata. Michael George. March 24 April 7, 2014

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

1 Nondeterministic Finite Automata

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

Designing finite automata II

Assignment 1 Automata, Languages, and Computability. 1 Finite State Automata and Regular Languages

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.

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

12.1 Nondeterminism Nondeterministic Finite Automata. a a b ε. CS125 Lecture 12 Fall 2016

Closure Properties of Regular Languages

Languages & Automata

CS 330 Formal Methods and Models

Formal languages, automata, and theory of computation

CMSC 330: Organization of Programming Languages

NFAs continued, Closure Properties of Regular Languages

Finite-State Automata: Recap

Tutorial Automata and formal Languages

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

Today s Topics Automata and Languages

Automata and Languages

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. NFA for (a b)*abb.

Name Ima Sample ASU ID

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. Comparing DFAs and NFAs (cont.) Finite Automata 2

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

CS 330 Formal Methods and Models Dana Richards, George Mason University, Spring 2016 Quiz Solutions

Free groups, Lecture 2, part 1

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

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

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

Converting Regular Expressions to Discrete Finite Automata: A Tutorial

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

Lexical Analysis Part III

NFAs and Regular Expressions. NFA-ε, continued. Recall. Last class: Today: Fun:

Finite Automata. Informatics 2A: Lecture 3. Mary Cryan. 21 September School of Informatics University of Edinburgh

CS 275 Automata and Formal Language Theory

Non-Deterministic Finite Automata. Fall 2018 Costas Busch - RPI 1

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.

Compiler Design. Fall Lexical Analysis. Sample Exercises and Solutions. Prof. Pedro C. Diniz

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

Closure Properties of Regular Languages

3 Regular expressions

2.4 Linear Inequalities and Interval Notation

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

First Midterm Examination

GNFA GNFA GNFA GNFA GNFA

Transcription:

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 y n FA cn lso e defined y TG ny lnguge defined y n TG cn lso e defined y RE ny lnguge defined y n RE cn lso e defined y FA We prove this y showing tht ny lnguge defined y n FA cn lso e defined y TG DONE! ny lnguge defined y n TG cn lso e defined y RE ny lnguge defined y n RE cn lso e defined y FA We prove this y showing tht ny lnguge defined y n FA cn lso e defined y TG DONE! ny lnguge defined y n TG cn lso e defined y RE DONE! ny lnguge defined y n RE cn lso e defined y FA We prove this y showing tht ny lnguge defined y n FA cn lso e defined y TG DONE! ny lnguge defined y n TG cn lso e defined y RE DONE! ny lnguge defined y n RE cn lso e defined y FA TODAY! 1

Prt 3: Any lnguge defined y n RE cn lso e defined y FA Rememer tht FA model is more restrined thn TG. There is one edge from every stte for every possile lphet symol. There is no such thing s crsh There is no such thing s non- determinism Prt 3: RE FA Construc:ve proof with rules for severl cses. Rule 1. Bse cses. There is n FA tht ccepts ny pr:culr le_er of ny lphet. There is n FA tht ccepts only Λ Bse cse: RE FA Proof of Rule 1. If x is then this FA ccepts ny pr:culr single le_er of the lphet nd nothing else. Bse cse: RE FA Proof of Rule 1. This FA ccepts Λ only. ny letter except x x + ny letter ± ny letter ny letter ny letter Union: RE FA Rule 2. If FA 1 is n FA tht ccepts the lnguges defined y regulr expression r 1 nd FA 2 is n FA tht ccepts the lnguge defined y regulr expression r 2, then there is n FA 3 which is n FA tht ccepts the lnguge defined y r 1 +r 2 Union: RE FA How to hndle choice? Construc:ve lgorithm. Imgine trcing through the input on oth mchines nd then construc:ng new mchine tht emodied the or choices. Esiest to understnd y exmple. Text exmple: Doule- or EVEN- EVEN 2

Exmple: Doule- Exmple: Doule-, EVEN- EVEN,, Doule- + EVEN- EVEN Let s uild the or mchine., Doule- + EVEN- EVEN Crete new sttes tht emody the or New strt stte, clled z 1, tht mens x 1 or y 1 Note tht y 1 ws finl stte, so z 1 is lso finl, Doule- + EVEN- EVEN Doule- + EVEN- EVEN Crete new sttes tht emody the or New strt stte, z 1, mens x 1 or y 1 Since y 1 ws finl stte, so is z 1 Follow z 1 on input x 1 would go to y 1 would go to New stte mens or New sttes ±z 1 : x 1 or +y 1, New sttes red red ±z 1 : x 1 or +y 1, 3

Doule- + EVEN- EVEN Doule- + EVEN- EVEN Follow z 1 on input x 1 would go to y 1 would go to New stte mens or Follow z 1 on input x 1 would sty t x 1 y 1 would go to y 3 New stte mens x 1 or y 3 New sttes red red ±z 1 : x 1 or +y 1 : or, New sttes red red ±z 1 : x 1 or +y 1 : or, Doule- + EVEN- EVEN Follow z 1 on input x 1 would sty t x 1 y 1 would go to y 3 New stte mens x 1 or y 3 Follow on input would go to x 3 finl stte would go to y 1 finl stte New stte +z 4 mens x 3 or y 1 New sttes red red : or, New sttes red red : or, Follow on input would go to x 3 finl stte would go to y 1 finl stte New stte +z 4 mens x 3 or y 1 Follow on input would go to x 1 would go to y 4 New stte z 5 mens x 1 or y 4 New sttes red red : or +z 4, New sttes red red : or +z 4, 4

Follow on input would go to x 1 would go to y 4 New stte z 5 mens x 1 or y 4 z 5 New sttes red red : or +z 4 z 5, Wht is the mximum numer of sttes? nswer: sttes in FA 1 x sttes in FA 2 Not ll of which will lwys e used In this cse they re Let s work out the rest together New sttes red red : or +z 4 z 5, If :me llows New sttes red red : or +z 4 z 5 Crete the union of these two FAs,, y 1 + If :me llows Crete the union of these two FAs No:ce tht or is not possile So only five sttes in union, not 3 Complete s non- collected homework for next clss., y 1 + 5