Lecture 9 NFA Subset Construction & Epsilon Transitions - PowerPoint PPT Presentation

1 / 28
About This Presentation
Title:

Lecture 9 NFA Subset Construction & Epsilon Transitions

Description:

CSCE 355 Foundations of Computation Lecture 9 NFA Subset Construction & Epsilon Transitions Topics: Thompson Construction Examples Thompson Construction – PowerPoint PPT presentation

Number of Views:520
Avg rating:3.0/5.0
Slides: 29
Provided by: cseScEdu5
Category:

less

Transcript and Presenter's Notes

Title: Lecture 9 NFA Subset Construction & Epsilon Transitions


1
Lecture 9NFA Subset Construction Epsilon
Transitions
CSCE 355 Foundations of Computation
  • Topics
  • Thompson Construction
  • Examples Thompson Construction
  • Test 1

Sept 24, 2008
2
  • Last Time Readings 2.3
  • Mutual Induction Proof revisited
  • Languages denoted by regular expressions
  • Examples
  • Ruby Regular Expressions
  • TEST 1 September 29th
  • New Readings section 2.2.3-2.4
  • Sample Test 1new
  • Theorem 2.12 Proof
  • Authors Website Solutions Online
  • e-NFA ? NFA
  • e-NFA ? DFA subset construction
  • Regular Expressions
  • Relations Machines and Regular expressions
  • Ruby regular expressions
  • Ruby Pickaxe Book
  • Ruby showmatch.rb

3
Regular Expressions Ken Thompson
  • http//en.wikipedia.org/wiki/Regular_expression
  • http//en.wikipedia.org/wiki/Ken_Thompson

4
Grep
  • Unix utility
  • man grep
  • man k regexp

5
Thompson Construction
  • Based on recursive (inductive) definition of
    regular expressions
  • We describe NFAs (with epsilon moves) that
    recognize the base cases.
  • Then assuming we have NFAs for smaller
    expressions r and s we construct NFAs for
  • r s
  • rs
  • r

6
Recall Recursive Definition of Reg Expr
  • Definition of regular expressions over an
    alphabet S
  • Base cases
  • if a e S then A is a regular expression and
    denotes L(a) a
  • e is a regular expression and denotes L(e) e
  • Recursive definition
  • If r and s are regular expressions denoting the
    languages L(r) and L(s) then
  • rs is a regular expression denoting
    L(r)L(s)
  • rs is a regular expression denoting L(r)
    L(s)
  • r is a regular expression denoting
    L(r)

7
Thompson Construction Base cases
8
Thompson Construction Recursive cases
  • r s
  • rs

9
Thompson Construction Recursive cases
  • r

10
Thompson Construction Examples
11
(No Transcript)
12
(No Transcript)
13
Sample test 1 outline
  • Proof Techniques
  • Inductive proof
  • mutual induction proof
  • Given DFA
  • Transition diagram
  • Input abaa
  • L(M)
  • Give DFA for L
  • NFA
  • NFA for L
  • NFA ? DFA (Subset)
  • eNFA
  • eNFA for L
  • e-closure (ECLOSE in text)
  • eNFA ? DFA (Subset)
  • Ruby regular expressions

14
Design DFA that accepts Language L
  • Example
  • For a DFA D how do you prove L(D) L ?

15
Mutual Induction Proof
  • Define three statements for a mutual induction
    proof that could help in proving that L(M) L
    x e 0, 1 that x has a number of zeroes
    divisible by 3

16
(No Transcript)
17
(No Transcript)
18
HW solutions 2.5.1
19
2.5.3 a,b
  • The set of strings consisting of zero or more as
    followed by zero or more bs followed by zero or
    more cs
  • The set of strings consisting of either 01
    repeated one or more times or 010 repeated one of
    more times

20
2.3.2 Subset NFA without e
  • NFA
  • DFA

21
2.3.4 Done before
  • The set of strings over 0,1, 9 such that the
    final digit has appeared before
  • The set of strings over 0,1, 9 such that the
    final digit has not appeared before
  • The set of strings of 0s and 1s such that there
    are two 0s separated by a number of positions
    that is a multiple of 4. Note 0 is allowable
    multiple.

22
Tenth symbol from the right is a 1
23
Given L(M1) and L(M2) define DFA for intersection
24
(No Transcript)
25
Pop Quiz Induction proof
26
(No Transcript)
27
(No Transcript)
28
Homework
  • 2.5.1
  • 2.5.3 a,b
  • Extra Credit (20pts) Modify dfa1.rb to print all
    strings of lengthlt8 that would be accepted by
    that DFA.
Write a Comment
User Comments (0)
About PowerShow.com