Regular Expressions Costas Busch - LSU.

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)
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.
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 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.
Costas Busch - RPI1 Standard Representations of Regular Languages Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
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 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 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:
Prof. Busch - LSU1 Non-regular languages (Pumping Lemma)
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:
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
Decidable languages Section 4.1 CSC 4170 Theory of Computation.
INHERENT LIMITATIONS OF COMPUTER PROGAMS CSci 4011.
CSCI 2670 Introduction to Theory of Computing September 13.
Costas Busch - LSU1 Properties of Context-Free languages.
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:
 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.
CSCI 2670 Introduction to Theory of Computing September 11, 2007.
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-regular languages
Non Deterministic Automata
Properties of Regular Languages
Busch Complexity Lectures: Reductions
Reductions Costas Busch - LSU.
Single Final State for NFA
Language Recognition (12.4)
Regular Expressions Prof. Busch - LSU.
Non-Deterministic Finite Automata
Properties of Regular Languages
Non-Deterministic Finite Automata
Non Deterministic Automata
Elementary Questions about Regular Languages
CSCI 2670 Introduction to Theory of Computing
Undecidable problems:
Properties of Context-Free languages
Language Recognition (12.4)
DPDA Deterministic PDA
Chapter 1 Regular Language
NFAs accept the Regular Languages
Presentation transcript:

Regular Expressions Costas Busch - LSU

Regular Expressions Regular expressions describe regular languages Example: describes the language Costas Busch - LSU

Recursive Definition Primitive regular expressions: Given regular expressions and Are regular expressions Costas Busch - LSU

Examples A regular expression: Not a regular expression: Costas Busch - LSU

Languages of Regular Expressions : language of regular expression Example Costas Busch - LSU

Definition For primitive regular expressions: Costas Busch - LSU

Definition (continued) For regular expressions and Costas Busch - LSU

Example Regular expression: Costas Busch - LSU

Example Regular expression Costas Busch - LSU

Example Regular expression Costas Busch - LSU

Example Regular expression = { all strings containing substring 00 } Costas Busch - LSU

Example Regular expression = { all strings without substring 00 } Costas Busch - LSU

Equivalent Regular Expressions Definition: Regular expressions and are equivalent if Costas Busch - LSU

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

Regular Expressions and Regular Languages Costas Busch - LSU

Theorem Languages Generated by Regular Languages Regular Expressions Costas Busch - LSU

Proof: Languages Generated by Regular Languages Regular Expressions Costas Busch - LSU

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

Induction Basis Primitive Regular Expressions: Corresponding NFAs languages Costas Busch - LSU

Inductive Hypothesis Suppose that for regular expressions and , and are regular languages Costas Busch - LSU

Inductive Step We will prove: Are regular Languages Costas Busch - LSU

By definition of regular expressions: Costas Busch - LSU

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

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

Using the regular closure of operations, we can construct recursively the NFA that accepts Example: Costas Busch - LSU

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

Since is regular, there is a NFA that accepts it Take it with a single accept state Costas Busch - LSU

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

Another Example: Transition labels are regular expressions Costas Busch - LSU

Reducing the states: Transition labels are regular expressions Costas Busch - LSU

Resulting Regular Expression: Costas Busch - LSU

In General Removing a state: 2-neighbors Costas Busch - LSU

3-neighbors This can be generalized to arbitrary number of neighbors to q 3-neighbors Costas Busch - LSU

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

Standard Representations of Regular Languages DFAs Regular Expressions NFAs Costas Busch - LSU

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