Fall 2006Costas Busch - RPI1 Regular Expressions.

Slides:



Advertisements
Similar presentations
CSC 361NFA vs. DFA1. CSC 361NFA vs. DFA2 NFAs vs. DFAs NFAs can be constructed from DFAs using transitions: Called NFA- Suppose M 1 accepts L 1, M 2 accepts.
Advertisements

Fall 2006Costas Busch - RPI1 Non-regular languages (Pumping Lemma)
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)
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.
CS 310 – Fall 2006 Pacific University CS310 Converting NFA to DFA Sections:1.2 Page 54 September 15, 2006.
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.
Fall 2006Costas Busch - RPI1 Deterministic Finite Automata And Regular Languages.
Costas Busch - RPI1 Standard Representations of Regular Languages Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
Costas Busch - RPI1 Grammars. Costas Busch - RPI2 Grammars Grammars express languages Example: the English language.
Courtesy Costas Busch - RPI
Homework #2 Solutions.
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 Languages and Finite Automata or how to talk to machines...
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.
Costas Busch - RPI1 Standard Representations of Regular Languages Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
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.
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.
Finite Automata Costas Busch - RPI.
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.
Prof. Busch - LSU1 Linear Grammars Grammars with at most one variable at the right side of a production Examples:
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.
Fall 2004COMP 3351 Regular Expressions. Fall 2004COMP 3352 Regular Expressions Regular expressions describe regular languages Example: describes the language.
Fall 2003Costas Busch - RPI1 Linear Grammars Grammars with at most one variable at the right side of a production Examples:
1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 5 School of Innovation, Design and Engineering Mälardalen University 2012.
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.
CHAPTER 1 Regular Languages
INHERENT LIMITATIONS OF COMPUTER PROGAMS CSci 4011.
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
Costas Busch - LSU1 Linear Grammars Grammars with at most one variable at the right side of a production Examples:
Equivalence with FA * Any Regex can be converted to FA and vice versa, because: * Regex and FA are equivalent in their descriptive power ** Regular language.
 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.
1 Some Properties of Regular Languages. 2 Properties Concatenation:Star: Union: Are regular Languages For regular languages and.
Costas Busch - LSU1 PDAs Accept Context-Free Languages.
P Symbol Q E(Q) a b a b a b Convert to a DFA: Start state: Final States:
Languages.
Non Deterministic Automata
Properties of Regular Languages
Reductions Costas Busch - LSU.
NPDAs Accept Context-Free Languages
Single Final State for NFA
Language Recognition (12.4)
Regular Expressions Prof. Busch - LSU.
DPDA Deterministic PDA
Non-Deterministic Finite Automata
Properties of Regular Languages
Non-Deterministic Finite Automata
Non Deterministic Automata
Elementary Questions about Regular Languages
Non-regular languages
CSCI 2670 Introduction to Theory of Computing
Properties of Context-Free languages
Language Recognition (12.4)
Chapter 1 Regular Language
NFAs accept the Regular Languages
Presentation transcript:

Fall 2006Costas Busch - RPI1 Regular Expressions

Fall 2006Costas Busch - RPI2 Regular Expressions Regular expressions describe regular languages Example: describes the language

Fall 2006Costas Busch - RPI3 Recursive Definition Are regular expressions Primitive regular expressions: Given regular expressions and

Fall 2006Costas Busch - RPI4 Examples A regular expression: Not a regular expression:

Fall 2006Costas Busch - RPI5 Languages of Regular Expressions : language of regular expression Example

Fall 2006Costas Busch - RPI6 Definition For primitive regular expressions:

Fall 2006Costas Busch - RPI7 Definition (continued) For regular expressions and

Fall 2006Costas Busch - RPI8 Example Regular expression:

Fall 2006Costas Busch - RPI9 Example Regular expression

Fall 2006Costas Busch - RPI10 Example Regular expression

Fall 2006Costas Busch - RPI11 Example Regular expression = { all strings containing substring 00 }

Fall 2006Costas Busch - RPI12 Example Regular expression = { all strings without substring 00 }

Fall 2006Costas Busch - RPI13 Equivalent Regular Expressions Definition: Regular expressions and are equivalent if

Fall 2006Costas Busch - RPI14 Example = { all strings without substring 00 } and are equivalent regular expressions

Fall 2006Costas Busch - RPI15 Regular Expressions and Regular Languages

Fall 2006Costas Busch - RPI16 Theorem Languages Generated by Regular Expressions Regular Languages

Fall 2006Costas Busch - RPI17 Languages Generated by Regular Expressions Regular Languages Generated by Regular Expressions Regular Languages Proof:

Fall 2006Costas Busch - RPI18 Proof - Part 1 For any regular expression the language is regular Languages Generated by Regular Expressions Regular Languages Proof by induction on the size of

Fall 2006Costas Busch - RPI19 Induction Basis Primitive Regular Expressions: Corresponding NFAs regular languages

Fall 2006Costas Busch - RPI20 Inductive Hypothesis Suppose that for regular expressions and, and are regular languages

Fall 2006Costas Busch - RPI21 Inductive Step We will prove: Are regular Languages

Fall 2006Costas Busch - RPI22 By definition of regular expressions:

Fall 2006Costas Busch - RPI23 By inductive hypothesis we know: and are regular languages Regular languages are closed under: Union Concatenation Star We also know:

Fall 2006Costas Busch - RPI24 Therefore: Are regular languages is trivially a regular language (by induction hypothesis) End of Proof-Part 1

Fall 2006Costas Busch - RPI25 Using the regular closure of these operations, we can construct recursively the NFA that accepts Example:

Fall 2006Costas Busch - RPI26 For any regular language there is a regular expression with Proof - Part 2 Languages Generated by Regular Expressions Regular Languages We will convert an NFA that accepts to a regular expression

Fall 2006Costas Busch - RPI27 Since is regular, there is a NFA that accepts it Take it with a single final state

Fall 2006Costas Busch - RPI28 From construct the equivalent Generalized Transition Graph in which transition labels are regular expressions Example: Corresponding Generalized transition graph

Fall 2006Costas Busch - RPI29 Another Example: Transition labels are regular expressions

Fall 2006Costas Busch - RPI30 Reducing the states: Transition labels are regular expressions

Fall 2006Costas Busch - RPI31 Resulting Regular Expression:

Fall 2006Costas Busch - RPI32 In General Removing a state:

Fall 2006Costas Busch - RPI33 The resulting regular expression: By repeating the process until two states are left, the resulting graph is Initial graphResulting graph End of Proof-Part 2

Fall 2006Costas Busch - RPI34 Standard Representations of Regular Languages Regular Languages DFAs NFAs Regular Expressions

Fall 2006Costas Busch - RPI35 When we say: We are given a Regular Language We mean:Language is in a standard representation (DFA, NFA, or Regular Expression)