Lecture 10 Closure Properties of Regular Languages Topics: Extended RegExpr Thompson Construction Test 1 Post Mortem October 1, 2008 CSCE 355 Foundations.

Slides:



Advertisements
Similar presentations
Nondeterministic Finite Automata CS 130: Theory of Computation HMU textbook, Chapter 2 (Sec 2.3 & 2.5)
Advertisements

COMP-421 Compiler Design Presented by Dr Ioanna Dionysiou.
1 Introduction to Computability Theory Lecture3: Regular Expressions Prof. Amos Israeli.
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 Lecture4: Regular Expressions Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture3: Regular Expressions Prof. Amos Israeli.
1 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY (For next time: Read Chapter 1.3 of the book)
Costas Busch - RPI1 Single Final State for NFAs. Costas Busch - RPI2 Any NFA can be converted to an equivalent NFA with a single final state.
Fall 2006Costas Busch - RPI1 Regular Expressions.
1 The scanning process Main goal: recognize words/tokens Snapshot: At any point in time, the scanner has read some input and is on the way to identifying.
1 Regular Expressions. 2 Regular expressions describe regular languages Example: describes the language.
Fall 2004COMP 3351 Single Final State for NFA. Fall 2004COMP 3352 Any NFA can be converted to an equivalent NFA with a single final state.
1 Single Final State for NFAs and DFAs. 2 Observation Any Finite Automaton (NFA or DFA) can be converted to an equivalent NFA with a single final state.
Lecture 7 Sept 22, 2011 Goals: closure properties regular expressions.
1 NFAs accept the Regular Languages. 2 Equivalence of Machines Definition: Machine is equivalent to machine if.
Lecture 4 RegExpr  NFA  DFA Topics Thompson Construction Subset construction Readings: 3.7, 3.6 January 23, 2006 CSCE 531 Compiler Construction.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
1 A Single Final State for Finite Accepters. 2 Observation Any Finite Accepter (NFA or DFA) can be converted to an equivalent NFA with a single final.
1 Regular Expressions Definitions Equivalence to Finite Automata.
Fall 2004COMP 3351 Regular Expressions. Fall 2004COMP 3352 Regular Expressions Regular expressions describe regular languages Example: describes the language.
The Golden Chain εNFA  NFA  DFA  REGEX. Regular Expressions.
Regular Expressions. Notation to specify a language –Declarative –Sort of like a programming language. Fundamental in some languages like perl and applications.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong DFA to regular.
Introduction to CS Theory Lecture 3 – Regular Languages Piotr Faliszewski
1 Regular Expressions. 2 Regular expressions describe regular languages Example: describes the language.
Lecture # 3 Chapter #3: Lexical Analysis. Role of Lexical Analyzer It is the first phase of compiler Its main task is to read the input characters and.
CSCI 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Text search.
CSE 311 Foundations of Computing I Lecture 17 Structural Induction Spring
CSCI 2670 Introduction to Theory of Computing September 1, 2005.
Lecture 5 Sept 06, 2012 Regular expressions – examples Converting DFA to regular expression. (same works for NFA to r.e. conversion.) Converting R.E. to.
Lesson No.6 Naveen Z Quazilbash. Overview Attendance and lesson plan sharing Assignments Quiz (10 mins.). Some basic ideas about this course Regular Expressions.
CHAPTER 1 Regular Languages
1 Regular Expressions Reading: Chapter 3. 2 Regular Expressions vs. Finite Automata Offers a declarative way to express the pattern of any string we want.
1 Regular Expressions Definitions Equivalence to Finite Automata.
Regular Languages ภาษาปกติ. Jaruloj Chongstitvatana Outline Regular expressions Regular languages Equivalence between languages accepted by.
Lecture 2 Overview Topics What I forgot from last lecture Proof techniques continued Alphabets, strings, languages Automata June 2, 2015 CSCE 355 Foundations.
Lecture 8 NFA Subset Construction & Epsilon Transitions
CS 404Ahmed Ezzat 1 CS 404 Introduction to Compiler Design Lecture 1 Ahmed Ezzat.
1 Introduction to the Theory of Computation Regular Expressions.
1 Some Properties of Regular Languages. 2 Properties Concatenation:Star: Union: Are regular Languages For regular languages and.
Lecture 15 Ambiguous Grammars Topics: Context Free Grammars Language generated by a grammar Proofs with L(G) Ambiguous grammars October 20, 2008 CSCE 355.
CSCI 2670 Introduction to Theory of Computing September 7, 2004.
CSCI 2670 Introduction to Theory of Computing September 11, 2007.
Deterministic Finite Automata Nondeterministic Finite Automata.
P Symbol Q E(Q) a b a b a b Convert to a DFA: Start state: Final States:
CS412/413 Introduction to Compilers Radu Rugina Lecture 3: Finite Automata 25 Jan 02.
Lecture 11 Minimization Topics: Strings distinguishing states Equivalence relation October 6, 2008 CSCE 355 Foundations of Computation.
Lecture 5 NFAs Topics: Induction review/PopQuiz NFAs Delta, delta hat Strings accepted, languages accepted Subset Construction June 5, 2015 CSCE 355 Foundations.
Cpt S 317: Spring 2009 Reading: Chapter 3
3. Regular Expressions and Languages
CSE 105 theory of computation
CSCE 355 Foundations of Computation
CSE 105 theory of computation
Lecture 10 Closure Properties of Regular Languages
Single Final State for NFA
CSE322 PROPERTIES OF REGULAR LANGUAGES
CS 154, Lecture 3: DFANFA, Regular Expressions.
Definitions Equivalence to Finite Automata
Definitions Equivalence to Finite Automata
Closure Properties of Regular Languages
Subject Name: FORMAL LANGUAGES AND AUTOMATA THEORY
Lecture 6 NFA Subset Construction & Epsilon Transitions
Definitions Equivalence to Finite Automata
Lecture 12 Non-Regular Languages
Convert to a DFA: Start state: Final States: P Symbol Q E(Q) a b.
CSE 105 theory of computation
NFAs accept the Regular Languages
CSCE 355 Foundations of Computation
CSE 105 theory of computation
Presentation transcript:

Lecture 10 Closure Properties of Regular Languages Topics: Extended RegExpr Thompson Construction Test 1 Post Mortem October 1, 2008 CSCE 355 Foundations of Computation

– 2 – CSCE 355 Fall 2008 Last Time: Readings 2.3 Mutual Induction Proof revisited Languages denoted by regular expressions Examples Ruby Regular Expressions TEST 1 – September 29 thNew: Readings section 3.1,3.2(skip DFA  RE), 3.3 Ruby Pickaxe Book Ruby: Matching in files

– 3 – CSCE 355 Fall 2008 Homework  English descriptions  Regular expressions 3.1.1b – The set of strings of 0’s and 1’s such that the tenth symbol from the right is a c - The set of strings of 0’s and 1’s with at most one pair of consecutive 1’s b The set of strings of 0’s and 1’s such that the number of zeroes is divisible by 5.  Regular expressions  English descriptions 3.14b (0*1*)*000(0+1)* 3.14c (0+10)*1*  Regular expressions  εNFA (Thompson construction) 3.2.4b (0+1) c 00(0+1)* 3.14b, 3.14c convert to εNFA  Text matching re for matching phone numbers (international etc)

– 4 – CSCE 355 Fall 2008

– 5 – CSCE 355 Fall 2008 Grep  Unix utility  man grep  man –k regexp

– 6 – CSCE 355 Fall 2008 Thompson Construction  Based on recursive (inductive) definition of regular expressions  We describe NFAs (with epsilon moves) that recognize the base cases.  Then assuming we have NFAs for smaller expressions r and s we construct NFAs for r + s rs r*

– 7 – CSCE 355 Fall 2008 Thompson Construction Examples  rs, r | s, r*

– 8 – CSCE 355 Fall 2008 Thompson Construction Examples  Extended regular expressions

– 9 – CSCE 355 Fall 2008 Lex and Flex  Regular definitions  Pattern match  “.” Last pattern  Examples digit = [0-9] alpha= [a-zA-Z_] id = {alpha} ({alpha} | {letter} | ‘_’)* % id {install_InSymbolTable(yytext); return(ID);} while { return (KEYWHILE);}

– 10 – CSCE 355 Fall 2008 Compilation

– 11 – CSCE 355 Fall 2008 DFA  RegExpr  NFA  DFA  Regular Languages

– 12 – CSCE 355 Fall 2008 Algebraic Laws for Regular Expressions  What does it mean re,=re2 ?  E?

– 13 – CSCE 355 Fall 2008 Languages are Sets So Properties are Inherited  AUB = BUA so r l s = s l r r l s = s l r

– 14 – CSCE 355 Fall 2008 Associativity

– 15 – CSCE 355 Fall 2008 Commutivity

– 16 – CSCE 355 Fall 2008 Annihilator for concatenation  Identity  annihilator

– 17 – CSCE 355 Fall 2008 Checking for Equality of Two Regular Expressions  s = r ?  (r+s)* = r* s*

– 18 – CSCE 355 Fall 2008 Is L intersection R regular?

– 19 – CSCE 355 Fall 2008 Is the Complement of a Regular Lang. regular?

– 20 – CSCE 355 Fall 2008 Not all Languages are regular

– 21 – CSCE 355 Fall 2008 Pumping Lemma

– 22 – CSCE 355 Fall 2008 Every finite language is Regular

– 23 – CSCE 355 Fall 2008 Test Post Mortem

– 24 – CSCE 355 Fall 2008

– 25 – CSCE 355 Fall 2008

– 26 – CSCE 355 Fall 2008

– 27 – CSCE 355 Fall 2008