CSE 105 Theory of Computation Alexander Tsiatas Spring 2012 Theory of Computation Lecture Slides by Alexander Tsiatas is licensed under a Creative Commons.

Slides:



Advertisements
Similar presentations
CS 44 – Aug. 29 Regular operations –Union construction Section Nondeterminism –2 kinds of FAs –How to trace input –NFA design makes “union” operation.
Advertisements

CSE 311 Foundations of Computing I
Introducing DFA Formal Description Using Peer Instruction Cynthia Bailey Lee UCSD 2011 Theory of Computation Peer Instruction Lecture Slides by Dr. Cynthia.
Nondeterministic Finite Automata CS 130: Theory of Computation HMU textbook, Chapter 2 (Sec 2.3 & 2.5)
CSE 105 Theory of Computation Alexander Tsiatas Spring 2012 Theory of Computation Lecture Slides by Alexander Tsiatas is licensed under a Creative Commons.
Regular Expressions and DFAs COP 3402 (Summer 2014)
Finite Automata CPSC 388 Ellen Walker Hiram College.
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 3 School of Innovation, Design and Engineering Mälardalen University 2012.
1 Introduction to Computability Theory Lecture3: Regular Expressions Prof. Amos Israeli.
NFAs Sipser 1.2 (pages 47–54). CS 311 Fall Recall… Last time we showed that the class of regular languages is closed under: –Complement –Union.
Finite Automata Great Theoretical Ideas In Computer Science Anupam Gupta Danny Sleator CS Fall 2010 Lecture 20Oct 28, 2010Carnegie Mellon University.
1 Introduction to Computability Theory Lecture2: Non Deterministic Finite Automata Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture4: Regular Expressions Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture3: Regular Expressions Prof. Amos Israeli.
1 Introduction to Computability Theory Discussion1: Non-Deterministic Finite Automatons Prof. Amos Israeli.
Lecture 3UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 3.
Lexical Analysis III Recognizing Tokens Lecture 4 CS 4318/5331 Apan Qasem Texas State University Spring 2015.
CS 310 – Fall 2006 Pacific University CS310 Converting NFA to DFA Sections:1.2 Page 54 September 15, 2006.
1 Introduction to Computability Theory Lecture2: Non Deterministic Finite Automata (cont.) Prof. Amos Israeli.
Lecture 3 Goals: Formal definition of NFA, acceptance of a string by an NFA, computation tree associated with a string. Algorithm to convert an NFA to.
CS5371 Theory of Computation Lecture 6: Automata Theory IV (Regular Expression = NFA = DFA)
Lecture 3 Goals: Formal definition of NFA, acceptance of a string by an NFA, computation tree associated with a string. Algorithm to convert an NFA to.
Fall 2006Costas Busch - RPI1 Non-Deterministic Finite Automata.
CS5371 Theory of Computation Lecture 4: Automata Theory II (DFA = NFA, Regular Language)
1.Defs. a)Finite Automaton: A Finite Automaton ( FA ) has finite set of ‘states’ ( Q={q 0, q 1, q 2, ….. ) and its ‘control’ moves from state to state.
Lecture 5UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 5.
Fall 2004COMP 3351 Another NFA Example. Fall 2004COMP 3352 Language accepted (redundant state)
Costas Busch - LSU1 Non-Deterministic Finite Automata.
Foundations of (Theoretical) Computer Science Chapter 1 Lecture Notes (Section 1.2: NFA’s) David Martin With some modifications.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
Formal Language Finite set of alphabets Σ: e.g., {0, 1}, {a, b, c}, { ‘{‘, ‘}’ } Language L is a subset of strings on Σ, e.g., {00, 110, 01} a finite language,
Nondeterministic Finite Automata CS 130: Theory of Computation HMU textbook, Chapter 2 (Sec 2.3 & 2.5)
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
Theory of Computation 1 Theory of Computation Peer Instruction Lecture Slides by Dr. Cynthia Lee, UCSD are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike.
Theory of Languages and Automata
Theory of Computation, Feodor F. Dragan, Kent State University 1 Regular expressions: definition An algebraic equivalent to finite automata. We can build.
Introduction to CS Theory Lecture 3 – Regular Languages Piotr Faliszewski
CSE 105 Theory of Computation Alexander Tsiatas Spring 2012 Theory of Computation Lecture Slides by Alexander Tsiatas is licensed under a Creative Commons.
CSE 105 Theory of Computation Alexander Tsiatas Spring 2012 Theory of Computation Lecture Slides by Alexander Tsiatas is licensed under a Creative Commons.
Lexical Analysis Constructing a Scanner from Regular Expressions.
4b 4b Lexical analysis Finite Automata. Finite Automata (FA) FA also called Finite State Machine (FSM) –Abstract model of a computing entity. –Decides.
Prof. Busch - LSU1 NFAs accept the Regular Languages.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 3 Mälardalen University 2010.
CHAPTER 1 Regular Languages
CSE 105 Theory of Computation Alexander Tsiatas Spring 2012 Theory of Computation Lecture Slides by Alexander Tsiatas is licensed under a Creative Commons.
CSE 311 Foundations of Computing I Lecture 27 FSM Limits, Pattern Matching Autumn 2012 CSE
INHERENT LIMITATIONS OF COMPUTER PROGAMS CSci 4011.
CSCI 2670 Introduction to Theory of Computing September 13.
Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1 Chapter 1 Regular Languages Some slides are in courtesy.
1 Chapter Constructing Efficient Finite Automata.
using Deterministic Finite Automata & Nondeterministic Finite Automata
CSE 311 Foundations of Computing I Lecture 24 FSM Limits, Pattern Matching Autumn 2011 CSE 3111.
Nondeterministic Finite Automata (NFAs). Reminder: Deterministic Finite Automata (DFA) q For every state q in Q and every character  in , one and only.
CS 154 Formal Languages and Computability February 11 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
CSE 105 Theory of Computation Alexander Tsiatas Spring 2012 Theory of Computation Lecture Slides by Alexander Tsiatas is licensed under a Creative Commons.
 2004 SDU Lecture4 Regular Expressions.  2004 SDU 2 Regular expressions A third way to view regular languages. Say that R is a regular expression if.
CSCI 2670 Introduction to Theory of Computing September 7, 2004.
CSCI 2670 Introduction to Theory of Computing September 11, 2007.
Complexity and Computability Theory I Lecture #5 Rina Zviel-Girshin Leah Epstein Winter
1 Section 11.3 Constructing Efficient Finite Automata First we’ll see how to transform an NFA into a DFA. Then we’ll see how to transform a DFA into a.
Theory of Computation Automata Theory Dr. Ayman Srour.
1/29/02CSE460 - MSU1 Nondeterminism-NFA Section 4.1 of Martin Textbook CSE460 – Computability & Formal Language Theory Comp. Science & Engineering Michigan.
CSE 105 theory of computation
CSE 105 theory of computation
COSC 3340: Introduction to Theory of Computation
CSE 105 theory of computation
Chapter 1 Regular Language
COSC 3340: Introduction to Theory of Computation
CSE 105 theory of computation
Presentation transcript:

CSE 105 Theory of Computation Alexander Tsiatas Spring 2012 Theory of Computation Lecture Slides by Alexander Tsiatas is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. Based on a work at Permissions beyond the scope of this license may be available at

EQUIVALENCE OF FINITE AUTOMATA NFA & DFA Another construction proof

Tracing in NFA Fill in the missing row of states: a)q2, q3, q4, q4, q4 b)q1, q2, q4, q4, q4 c)q1, q2, q3, q4, q4 d)None of the above e)I don’t understand this at all (Fig in your book) Run this NFA on input

Tracing in NFA Each row is a set of states that we are in at the “same time” – {q1} – {q1,q2,q3} – {q1,q3} – {q1,q2,q3,q4} – {q1,q3,q4} Recall that when we did the union closure proof with DFAs, we were always in a pair of states at the “same time”—same concept What are all the possible unique sets of states? (a) QxQ (b) |Q| 2 (c) P (Q) (d) |Q|! (Fig in your book) Run this NFA on input (e) I don’t understand this at all

Thm. 1.39: Every NFA has an equivalent DFA. Given: NFA M = (Q,Σ,δ,q 0,F) Want: DFA M’ = (Q’,Σ,δ’,q 0 ’,F’) s.t. L(M) = L(M’). Construction: //need to make a DFA that simulates nondeterminism within the constraints of determinism (!!) – Q’ = – Σ – δ’ – q 0 ’ = – F’ = A DFA recognizes L(M), then every NFA has an equivalent DFA. Q.E.D.

Thm. 1.39: Every NFA has an equivalent DFA. We also know every DFA is an NFA. Corollary of these two facts: The class of languages recognized by DFAs and the class of languages recognized by NFAs are the same class – The Class of Regular Languages Nondeterminism does not make automata more powerful!

REGULAR EXPRESSIONS PATTERN MATCHING Extremely useful

From the Reading Quiz Let L be the language of this regular expression: 1*0 Which of the following is NOT in L? a)0 b)10 c)100 d) e)They’re all in L

Regular Expressions in CSE 105 They look like this: – 1*0 – (1 U 0*)* – (110 U 011)(10 U 01)*(110 U 011) Not like this: – ~/*.pdf – \]\000-\031]+(?:(?:(?:\r\n)?[\t])+|\Z|(?=[\ (?:\r\n)?[ \t]))*"(?:(?:\r\n)?[\t])*)(?:\.( (etc..., over 6000 characters!)

Regular Expressions Let L be the language of this regular expression: ((a U Ø) + b*)* Which of the following is NOT true of L? a)Some strings in L have equal numbers of a’s and b’s b)All strings in L have more b’s than a’s c)L contains “aaaaaa” d)a‘s never follow b’s in any string in L e)None or more than one of the above

Regular Expressions Let L be the language of this regular expression: aØb* Which of the following is NOT true of L? a)L is the empty set b)L contains “a” c)aaab is not in L d)None or more than one of the above

EQUIVALENCE OF MODELS REGULAR EXPRESSIONS AND NFA’S So that’s why they’re regular expressions

NFA’s and Regular Expressions Which of the following NFA’s is equivalent to this regular expression? 1*0 b) a) c) d)

NFA’s and Regular Expressions Which of the following NFA’s is equivalent to this regular expression? ((aa U Ø) + b*)* b) a) c) d)

NFA’s and Regular Expressions In textbook: Every regular expression has an equivalent NFA – Algorithm to construct NFA – Previous 2 examples generalize Regular Expression => NFA => DFA – Every regular expression describes a regular language

EQUIVALENCE OF MODELS REGULAR EXPRESSIONS AND DFA’S Last equivalence construction

Generalized NFA’s (GNFA’s) NFA’s, except state transitions have regular expressions instead of single symbols

State Elimination Eliminate state q1. To make an equivalent GNFA, what should go on the edge? – (A, B, C, D are arbitrary regular expressions; this is just a section of a GNFA.) a) AC b) AC U D c) ABC d) AB*C e) AB*C U D

To turn a DFA into a Regular Expression Add a new start state and accept state with epsilon-transitions This creates an NFA

To turn a DFA into a Regular Expression Eliminate states one-by-one, using the technique shown previously – More details: textbook At the end: a GNFA with 1 start state and 1 accept state. R is the equivalent regular expression.

What we have shown Regular languages can be characterized by all three structures: Next class: languages that are not regular NFA Regular Expression DFA