Single Final State for NFAs and DFAs - PowerPoint PPT Presentation

About This Presentation
Title:

Single Final State for NFAs and DFAs

Description:

two consecutive 0 } 29. Equivalent Regular Expressions. Definition: Regular expressions and ... two consecutive 0 } and. are equivalent. regular expr. 31 ... – PowerPoint PPT presentation

Number of Views:58
Avg rating:3.0/5.0
Slides: 51
Provided by: costas
Learn more at: http://www.cs.rpi.edu
Category:

less

Transcript and Presenter's Notes

Title: Single Final State for NFAs and DFAs


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

3
Example
NFA
4
In General
NFA
5
Extreme Case

NFA without final state
6
Some Properties of Regular Languages

7
Properties
For regular languages and we will
prove that
8
We Say
Regular languages are closed under
9
(No Transcript)
10
Example
11
Union
  • NFA for

12
Example

NFA for
13
Concatenation
  • NFA for

14
Example
  • NFA for

15
Star Operation
  • NFA for

16
Example
  • NFA for

17
Regular Expressions

18
Regular Expressions
  • Regular expressions
  • describe regular languages
  • Example
  • describes the language

19
Recursive Definition
Primitive regular expressions
20
Examples
A regular expression
21
Languages of Regular Expressions
  • language of regular expression
  • Example

22
Definition
  • For primitive regular expressions

23
Definition (continued)
  • For regular expressions and

24
Example
  • Regular expression

25
Example
  • Regular expression

26
Example
  • Regular expression

27
Example
  • Regular expression

28
Example
  • Regular expression

29
Equivalent Regular Expressions
  • Definition
  • Regular expressions and
  • are equivalent if

30
Example

all strings with at least two
consecutive 0
31
Regular ExpressionsandRegular Languages

32
Theorem
Languages Generated by Regular Expressions
Regular Languages
33
Theorem - Part 1
Languages Generated by Regular Expressions
Regular Languages
34
Theorem - Part 2
Languages Generated by Regular Expressions
Regular Languages
35
Proof - Part 1
36
Induction Basis
  • Primitive Regular Expressions

37
Inductive Hypothesis
  • Assume
  • for regular expressions and
  • that
  • and are regular languages

38
Inductive Step
  • We will prove

Are regular Languages
39
  • By definition of regular expressions

40
By inductive hypothesis we know and
are regular languages
41
  • Therefore

Are regular languages
42
  • And trivially

is a regular language
43
Proof Part 2
2. For any regular language there is
a regular expression with
Proof by construction of regular expression
44
  • Since is regular take the
  • NFA that accepts it

Single final state
45
  • From construct the equivalent
  • Generalized Transition Graph
  • transition labels
  • are regular expressions

Example
46
  • Another Example

47
  • Reducing the states

48
  • Resulting Regular Expression

49
In General
  • Removing states

50
  • Obtaining the final regular expression
Write a Comment
User Comments (0)
About PowerShow.com