Fall 2004COMP 3351 Regular Expressions. Fall 2004COMP 3352 Regular Expressions Regular expressions describe regular languages Example: describes the language.

Slides:



Advertisements
Similar presentations
Lecture 24 MAS 714 Hartmut Klauck
Advertisements

1 Languages. 2 A language is a set of strings String: A sequence of letters Examples: “cat”, “dog”, “house”, … Defined over an alphabet: Languages.
Regular expressions Regular languages Sipser 1.3 (pages 63-76)
1 Introduction to Computability Theory Lecture3: Regular Expressions Prof. Amos Israeli.
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.
Courtesy Costas Busch - RPI1 Non Deterministic Automata.
Fall 2006Costas Busch - RPI1 Regular Expressions.
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.
1 More Properties of Regular Languages. 2 We have proven Regular languages are closed under: Union Concatenation Star operation Reverse.
1 Regular Expressions. 2 Regular expressions describe regular languages Example: describes the language.
1 Lecture 20 Regular languages are a subset of LFSA –algorithm for converting any regular expression into an equivalent NFA –Builds on existing algorithms.
Lecture 3: Closure Properties & Regular Expressions Jim Hook Tim Sheard Portland State University.
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.
Fall 2004COMP 3351 NPDA’s Accept Context-Free Languages.
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 Regular Grammars Generate Regular Languages. 2 Theorem Regular grammars generate exactly the class of regular languages: If is a regular grammar then.
1 NFAs accept the Regular Languages. 2 Equivalence of Machines Definition: Machine is equivalent to machine if.
Fall 2006Costas Busch - RPI1 Properties of Regular Languages.
Regular expressions Sipser 1.3 (pages 63-76). CS 311 Fall Looks familiar…
Courtesy Costas Busch - RPI1 Non-regular languages.
Fall 2006Costas Busch - RPI1 Non-Deterministic Finite Automata.
Fall 2004COMP 3351 Standard Representations of Regular Languages Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
1 Non-Deterministic Automata Regular Expressions.
Introduction to Finite Automata Adapted from the slides of Stanford CS154.
Fall 2004COMP 3351 Another NFA Example. Fall 2004COMP 3352 Language accepted (redundant state)
Fall 2006Costas Busch - RPI1 PDAs Accept Context-Free Languages.
Costas Busch - LSU1 Non-Deterministic Finite Automata.
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.
Theory of Computation, Feodor F. Dragan, Kent State University 1 Regular expressions: definition An algebraic equivalent to finite automata. We can build.
1 Regular Expressions. 2 Regular expressions describe regular languages Example: describes the language.
Prof. Busch - LSU1 NFAs accept the Regular Languages.
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
CSCI 2670 Introduction to Theory of Computing September 13.
Regular Expressions Costas Busch - LSU.
1 Language Recognition (11.4) Longin Jan Latecki Temple University Based on slides by Costas Busch from the courseCostas Busch
CS 154 Formal Languages and Computability February 11 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron.
1 Some Properties of Regular Languages. 2 Properties Concatenation:Star: Union: Are regular Languages For regular languages and.
CSCI 2670 Introduction to Theory of Computing September 11, 2007.
P Symbol Q E(Q) a b a b a b Convert to a DFA: Start state: Final States:
1/29/02CSE460 - MSU1 Nondeterminism-NFA Section 4.1 of Martin Textbook CSE460 – Computability & Formal Language Theory Comp. Science & Engineering Michigan.
Languages.
Standard Representations of Regular Languages
CSE322 PUMPING LEMMA FOR REGULAR SETS AND ITS APPLICATIONS
Non Deterministic Automata
Properties of Regular Languages
Formal Language & Automata Theory
Formal Language & Automata Theory
Single Final State for NFA
Language Recognition (12.4)
REGULAR LANGUAGES AND REGULAR GRAMMARS
Regular Expressions Prof. Busch - LSU.
DPDA Deterministic PDA
Non-Deterministic Finite Automata
CSE322 PROPERTIES OF REGULAR LANGUAGES
Non-Deterministic Finite Automata
Deterministic PDAs - DPDAs
Definitions Equivalence to Finite Automata
Closure Properties of Context-Free languages
Elementary Questions about Regular Languages
Language Recognition (12.4)
Convert to a DFA: Start state: Final States: P Symbol Q E(Q) a b.
Chapter 1 Regular Language
CSCI 2670 Introduction to Theory of Computing
NFAs accept the Regular Languages
Presentation transcript:

Fall 2004COMP 3351 Regular Expressions

Fall 2004COMP 3352 Regular Expressions Regular expressions describe regular languages Example: describes the language

Fall 2004COMP 3353 Recursive Definition Are regular expressions Primitive regular expressions: Given regular expressions and

Fall 2004COMP 3354 Examples A regular expression: Not a regular expression:

Fall 2004COMP 3355 Languages of Regular Expressions : language of regular expression Example:

Fall 2004COMP 3356 Definition For primitive regular expressions :

Fall 2004COMP 3357 Definition (continued) For regular expressions and

Fall 2004COMP 3358 Example Regular expression:

Fall 2004COMP 3359 Example Regular expression

Fall 2004COMP Example Regular expression

Fall 2004COMP Example Regular expression = {all strings with at least two consecutive 0}

Fall 2004COMP Example Regular expression = { all strings without two consecutive 0 }

Fall 2004COMP Equivalent Regular Expressions Definition: Regular expressions and are equivalent if

Fall 2004COMP Example = { all strings without two consecutive 0 } and are equivalent Reg. expressions

Fall 2004COMP Regular Expressions and Regular Languages

Fall 2004COMP Theorem Languages Generated by Regular Expressions Regular Languages

Fall 2004COMP Theorem - Part 1 1. For any regular expression the language is regular Languages Generated by Regular Expressions Regular Languages

Fall 2004COMP Theorem - Part 2 Languages Generated by Regular Expressions Regular Languages 2. For any regular language, there is a regular expression with

Fall 2004COMP Proof - Part 1 1. For any regular expression the language is regular Proof by induction on the size of

Fall 2004COMP Induction Basis Primitive Regular Expressions: NFAs regular languages

Fall 2004COMP Inductive Hypothesis Assume for regular expressions and that and are regular languages

Fall 2004COMP Inductive Step We will prove: are regular Languages.

Fall 2004COMP By definition of regular expressions:

Fall 2004COMP By inductive hypothesis we know: and are regular languages Regular languages are closed under: Union Concatenation Star We also know:

Fall 2004COMP Therefore: Are regular languages

Fall 2004COMP And trivially: is a regular language

Fall 2004COMP Proof – Part 2 2. For any regular language there is a regular expression with Proof by construction of regular expression

Fall 2004COMP Since is regular, take an NFA that accepts it Single final state

Fall 2004COMP From, construct an equivalent Generalized Transition Graph in which transition labels are regular expressions Example:

Fall 2004COMP Another Example:

Fall 2004COMP Reducing the states:

Fall 2004COMP Resulting Regular Expression:

Fall 2004COMP In General Removing states:

Fall 2004COMP The final transition graph: The resulting regular expression: