Single Final State for NFA

Slides:



Advertisements
Similar presentations
CS2303-THEORY OF COMPUTATION Closure Properties of Regular Languages
Advertisements

Properties of Regular Languages
Lecture 8 From NFA to Regular Language. Induction on k= # of states other than initial and final states K=0 a a* b a c d c*a(d+bc*a)*
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.
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 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.
Fall 2006Costas Busch - RPI1 Properties of Regular Languages.
Courtesy Costas Busch - RPI1 Non-regular languages.
Fall 2006Costas Busch - RPI1 Non-Deterministic Finite Automata.
1 Non-Deterministic Automata Regular Expressions.
Fall 2004COMP 3351 Another NFA Example. Fall 2004COMP 3352 Language accepted (redundant state)
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.
1 A Non Context-Free Language (We will prove it at the next class)
Fall 2004COMP 3351 Regular Expressions. Fall 2004COMP 3352 Regular Expressions Regular expressions describe regular languages Example: describes the language.
1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 5 School of Innovation, Design and Engineering Mälardalen University 2012.
1 Regular Expressions. 2 Regular expressions describe regular languages Example: describes the language.
1 State SymbolRead- Q E(Q) a b a b a b Convert to a DFA: Start state: Final States:
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.
Regular Expressions Costas Busch - LSU.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
1 Language Recognition (11.4) Longin Jan Latecki Temple University Based on slides by Costas Busch from the courseCostas Busch
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:
Lecture 15: Theory of Automata:2014 Finite Automata with Output.
Languages.
Standard Representations of Regular Languages
CSE322 PUMPING LEMMA FOR REGULAR SETS AND ITS APPLICATIONS
Non Deterministic Automata
Properties of Regular Languages
PROPERTIES OF REGULAR LANGUAGES
Formal Language & Automata Theory
PDAs Accept Context-Free Languages
Language Recognition (12.4)
REGULAR LANGUAGES AND REGULAR GRAMMARS
Intro to Theory of Computation
Regular Expressions Prof. Busch - LSU.
Closure Properties for Regular Languages
Non-Deterministic Finite Automata
CSE322 PROPERTIES OF REGULAR LANGUAGES
Properties of Regular Languages
CS 154, Lecture 3: DFANFA, Regular Expressions.
4. Properties of Regular Languages
Non-Deterministic Finite Automata
Non Deterministic Automata
Deterministic PDAs - DPDAs
Closure Properties of Context-Free languages
Elementary Questions about Regular Languages
CSCI 2670 Introduction to Theory of Computing
Properties of Context-Free languages
Language Recognition (12.4)
Convert to a DFA: Start state: Final States: State Symbol Read- Q E(Q)
Convert to a DFA: Start state: Final States: P Symbol Q E(Q) a b.
Chapter 1 Regular Language
NFAs accept the Regular Languages
Intro to Theory of Computation
Presentation transcript:

Single Final State for NFA Fall 2004 COMP 335

Any NFA can be converted to an equivalent NFA with a single final state Fall 2004 COMP 335

Example NFA Equivalent NFA Fall 2004 COMP 335

In General NFA Equivalent NFA Single final state Fall 2004 COMP 335

Extreme Case NFA without final state Add a final state Without transitions Fall 2004 COMP 335

Properties of Regular Languages Fall 2004 COMP 335

For regular languages and we will prove that: Union: Are regular Languages Concatenation: Star: Reversal: Complement: Intersection: Fall 2004 COMP 335

We say: Regular languages are closed under Union: Concatenation: Star: Reversal: Complement: Intersection: Fall 2004 COMP 335

Regular language Single final state Regular language NFA Fall 2004 COMP 335

Example Fall 2004 COMP 335

Union NFA for Fall 2004 COMP 335

Example NFA for Fall 2004 COMP 335

Concatenation NFA for Fall 2004 COMP 335

Example NFA for Fall 2004 COMP 335

Star Operation NFA for Fall 2004 COMP 335

Example NFA for Fall 2004 COMP 335

Reverse NFA for 1. Reverse all transitions 2. Make initial state final state and vice versa Fall 2004 COMP 335

Example Fall 2004 COMP 335

Complement 1. Take the DFA that accepts 2. Make final states non-final, and vice-versa Fall 2004 COMP 335

Example Fall 2004 COMP 335

Intersection DeMorgan’s Law: regular Fall 2004 COMP 335

Example regular regular regular Fall 2004 COMP 335

Regular Expressions Fall 2004 COMP 335

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

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

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

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

Definition For primitive regular expressions : Fall 2004 COMP 335

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

Example Regular expression: Fall 2004 COMP 335

Example Regular expression Fall 2004 COMP 335

Example Regular expression Fall 2004 COMP 335

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

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

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

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

Regular Expressions and Regular Languages Fall 2004 COMP 335

Theorem Languages Generated by Regular Languages Regular Expressions Fall 2004 COMP 335

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

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

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

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

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

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

By definition of regular expressions: Fall 2004 COMP 335

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

Therefore: Are regular languages Fall 2004 COMP 335

And trivially: is a regular language Fall 2004 COMP 335

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

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

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

Another Example: Fall 2004 COMP 335

Reducing the states: Fall 2004 COMP 335

Resulting Regular Expression: Fall 2004 COMP 335

In General Removing states: Fall 2004 COMP 335

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