MC 306 Theory of Computation Tuesday, 10703 - PowerPoint PPT Presentation

1 / 6
About This Presentation
Title:

MC 306 Theory of Computation Tuesday, 10703

Description:

... only outgoing arrows, and only one final state f with only incoming arrows. All other states have both incoming and outgoing arrows (or else we can delete them! ... – PowerPoint PPT presentation

Number of Views:41
Avg rating:3.0/5.0
Slides: 7
Provided by: skid
Category:

less

Transcript and Presenter's Notes

Title: MC 306 Theory of Computation Tuesday, 10703


1
MC 306 Theory of ComputationTuesday, 10/7/03
  • Todays Class
  • Review Regular expressions and the languages
    they determine (9/23/03 slides)
  • Equivalence of regular expressions and DFAs/NFAs
  • From regular expression to NFA (9/25/03 slides)
  • From NFA to regular expression todays slides
  • Assignments
  • Exercise p. 62 2.22c
  • Hand-in p. 62 2.22d

2
Equivalence of NFAs/DFAs to Regular Expressions
  • Theorem. Given an NFA or DFA M, there is a
    regular expression R such that L(R) L(M).
  • By previous theorem, this means that NFAs/DFAs
    and regular expressions describe exactly the same
    class of languages.
  • Thats why its reasonable to call DFA/NFA
    languages regular languages.

3
Converting from NFA/DFA to Regular Expression
  • Basic Idea Given an NFA M, how to get equivalent
    regular expression R
  • 1. Initialization Modify M to have only one
    start state s with only outgoing arrows, and only
    one final state f with only incoming arrows. All
    other states have both incoming and outgoing
    arrows (or else we can delete them!).
  • 2. State reduction Modify M to remove one state
    (not s or f), and get equivalent machine, but
  • This machine will be permitted to use regular
    expressions on the arrows called a
    generalized NFA, or GNFA.
  • 3. Repeat to delete all states except s and f.
  • 4. Final GNFA has a single arrow, labeled with
    regular expression R L(R) L(M).

4
Outline of conversion procedure
5
Eliminating a state
  • Each non-start, non-final state has
  • In-arrows,
  • Out-arrows
  • May have loops
  • Replace every combination of in-loop-out (or
    in-out, if no loops), with a single arrow (see
    top picture)
  • In bottom picture, how many replacements do we
    have to make to eliminate state 2?

6
Examples
  • For each of the following DFA/NFAs M, find a
    regular expression R such that L(R) L(M).

Ex. 2
Ex. 1
Write a Comment
User Comments (0)
About PowerShow.com