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.

Slides:



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

Regular expressions Regular languages Sipser 1.3 (pages 63-76)
Regular expressions Regular languages Sipser 1.3 (pages 63-76)
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.
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
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 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.
Costas Busch - RPI1 Mathematical Preliminaries. Costas Busch - RPI2 Mathematical Preliminaries Sets Functions Relations Graphs Proof Techniques.
Fall 2006Costas Busch - RPI1 Non-Deterministic Finite Automata.
Courtesy Costas Busch - RPI1 Mathematical Preliminaries.
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.
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.
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.
CSCI 2670 Introduction to Theory of Computing September 13.
Regular Expressions Costas Busch - LSU.
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:
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.
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:
Lecture 15: Theory of Automata:2014 Finite Automata with Output.
Languages.
Non Deterministic Automata
Properties of Regular Languages
PROPERTIES OF REGULAR LANGUAGES
NPDAs Accept Context-Free Languages
Formal Language & Automata Theory
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
CSE322 PROPERTIES OF REGULAR LANGUAGES
Properties of Regular Languages
Non-Deterministic Finite Automata
Deterministic PDAs - DPDAs
Elementary Questions about Regular Languages
Non-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: P Symbol Q E(Q) a b.
NFAs accept the Regular Languages
Presentation transcript:

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

Costas Busch - RPI3 NFA Equivalent NFA Example

Costas Busch - RPI4 NFA In General Equivalent NFA Single final state

Costas Busch - RPI5 Extreme Case NFA without final state Add a final state Without transitions

Costas Busch - RPI6 Properties of Regular Languages

Costas Busch - RPI7 Concatenation: Star: Union: Are regular Languages For regular languages and we will prove that: Complement: Intersection: Reversal:

Costas Busch - RPI8 We say: Regular languages are closed under Concatenation: Star: Union: Complement: Intersection: Reversal:

Costas Busch - RPI9 Regular language Single final state NFA Single final state Regular language NFA

Costas Busch - RPI10 Example

Costas Busch - RPI11 Union NFA for

Costas Busch - RPI12 Example NFA for

Costas Busch - RPI13 Concatenation NFA for

Costas Busch - RPI14 Example NFA for

Costas Busch - RPI15 Star Operation NFA for

Costas Busch - RPI16 Example NFA for

Costas Busch - RPI17 Reverse NFA for 1. Reverse all transitions 2. Make initial state final state and vice versa

Costas Busch - RPI18 Example

Costas Busch - RPI19 Complement 1. Take the DFA that accepts 2. Make final states non-final, and vice-versa

Costas Busch - RPI20 Example

Costas Busch - RPI21 Intersection DeMorgan’s Law: regular

Costas Busch - RPI22 Example regular

Costas Busch - RPI23 Regular Expressions

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

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

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

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

Costas Busch - RPI28 Definition For primitive regular expressions:

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

Costas Busch - RPI30 Example Regular expression:

Costas Busch - RPI31 Example Regular expression

Costas Busch - RPI32 Example Regular expression

Costas Busch - RPI33 Example Regular expression = { all strings with at least two consecutive 0 }

Costas Busch - RPI34 Example Regular expression = { all strings without two consecutive 0 }

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

Costas Busch - RPI36 Example = { all strings without two consecutive 0 } and are equivalent regular expr.

Costas Busch - RPI37 Regular Expressions and Regular Languages

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

Costas Busch - RPI39 Theorem - Part 1 1. For any regular expression the language is regular Languages Generated by Regular Expressions Regular Languages

Costas Busch - RPI40 Theorem - Part 2 Languages Generated by Regular Expressions Regular Languages 2. For any regular language there is a regular expression with

Costas Busch - RPI41 Proof - Part 1 1. For any regular expression the language is regular Proof by induction on the size of

Costas Busch - RPI42 Induction Basis Primitive Regular Expressions: NFAs regular languages

Costas Busch - RPI43 Inductive Hypothesis Assume for regular expressions and that and are regular languages

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

Costas Busch - RPI45 By definition of regular expressions:

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

Costas Busch - RPI47 Therefore: Are regular languages

Costas Busch - RPI48 And trivially: is a regular language

Costas Busch - RPI49 Proof – Part 2 2. For any regular language there is a regular expression with Proof by construction of regular expression

Costas Busch - RPI50 Since is regular take the NFA that accepts it Single final state

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

Costas Busch - RPI52 Another Example:

Costas Busch - RPI53 Reducing the states:

Costas Busch - RPI54 Resulting Regular Expression:

Costas Busch - RPI55 In General Removing states:

Costas Busch - RPI56 The final transition graph: The resulting regular expression: