Single Final State for NFAs - PowerPoint PPT Presentation

1 / 62
About This Presentation
Title:

Single Final State for NFAs

Description:

in which transition labels are regular expressions. Example: ... An arc from i to j. Depending of the DFA A may be f, a or ... Inductive Definition. Induction: ... – PowerPoint PPT presentation

Number of Views:33
Avg rating:3.0/5.0
Slides: 63
Provided by: costas4
Category:
Tags: an | final | in | inductive | nfas | single | state

less

Transcript and Presenter's Notes

Title: Single Final State for NFAs


1
Single Final State for NFAs
2
  • Any NFA can be converted
  • to an equivalent NFA
  • with a single final state

3
Example
NFA
Equivalent NFA
4
In General
NFA
Equivalent NFA
Single final state
5
Extreme Case

NFA without final state
6
Properties of Regular Languages

7
For regular languages and we will
prove that
Star
Reversal
Complement
Intersection
8
We say Regular languages are closed under
Star
Reversal
Complement
Intersection
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
Reverse
NFA for
1. Reverse all transitions
2. Make initial state final state and vice
versa
18
Example
19
Complement
1. Take the DFA that accepts
2. Make final states non-final, and
vice-versa
20
Example
21
Intersection
DeMorgans Law
22
Example
regular
regular
regular
23
Regular Expressions

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

25
Recursive Definition
Primitive regular expressions
26
Examples
A regular expression
27
Languages of Regular Expressions
  • language of regular expression
  • Example

28
Definition
  • For primitive regular expressions

29
Definition (continued)
  • For regular expressions and

30
Example
  • Regular expression

31
Example
  • Regular expression

32
Example
  • Regular expression

33
Example
  • Regular expression

34
Example
  • Regular expression

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

36
Example

all strings without two consecutive 0
37
Regular ExpressionsandRegular Languages

38
Theorem
Languages Generated by Regular Expressions
Regular Languages
39
Theorem - Part 1
Languages Generated by Regular Expressions
Regular Languages
40
Theorem - Part 2
Languages Generated by Regular Expressions
Regular Languages
41
Proof - Part 1
42
Induction Basis
  • Primitive Regular Expressions

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

44
Inductive Step
  • We will prove

Are regular Languages
45
  • By definition of regular expressions

46
By inductive hypothesis we know and
are regular languages
47
  • Therefore

Are regular languages
48
  • And trivially

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

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

Example
52
  • Another Example

53
  • Reducing the states

54
  • Resulting Regular Expression

55
In General
  • Removing states

56
  • The final transition graph

The resulting regular expression
57
Theorem
  • If for some DFA A
  • Then there is a regular expression R such that

Proof (by induction on the size of R) Let As
states be 1, 2, , n for some integer
n Construct a collection of regular expressions
that describe progressively broader sets of paths
in DFA A
58
  • Let be the regex that represent the set of
    strings w such that w is the label of a path from
    state i to j in A, and that path has no
    intermediate state whos label is greater than k.
  • Note beginning end points, i.e. i j are not
    intermediate so they can be greater than k

59
Inductive Definition
  • Basis k 0
  • Since all states are gt 1, restriction on the
    paths is that the path must have no intermediate
    states at all.
  • If i ? j An arc from i to j
  • Depending of the DFA A may be f, a or
  • (If there are m symbols that label arcs from i to
    j)

60
Inductive Definition
  • If i j all loops from i to itself
  • legal paths of length 0
  • (If there are m symbols that label arcs from i to
    i)

61
Inductive Definition
  • Induction
  • Suppose that there is a path from i to j that
    goes through no state with label higher than k.
    Consider two cases
  • path does not go thru state k at all.

62
  • path goes thru state k at least once

- More than once
- once
Write a Comment
User Comments (0)
About PowerShow.com