COT 4210 Lecture Notes - 3 - PowerPoint PPT Presentation

1 / 17
About This Presentation
Title:

COT 4210 Lecture Notes - 3

Description:

COT 4210. Lecture Notes - 3. By Njegos and Monika. R is a regular expression if R is ... R1 U R2, where R1 and R2 are regular expression. R1o R2, where R1 and ... – PowerPoint PPT presentation

Number of Views:39
Avg rating:3.0/5.0
Slides: 18
Provided by: monika5
Learn more at: http://www.cs.ucf.edu
Category:
Tags: cot | lecture | monika | notes

less

Transcript and Presenter's Notes

Title: COT 4210 Lecture Notes - 3


1
COT 4210 Lecture Notes - 3
  • By Njegos and Monika

2
R is a regular expression if R is
  1. a?S, a for some a in the alphabet S.
  2. e
  3. Ø
  4. R1 U R2, where R1 and R2 are regular expression
  5. R1o R2, where R1 and R2 are regular expressions
  6. R1, where R1 is a regular expression

3
  • If A1 and A2 are regular then
  • A1 U A2
  • A1 o A2
  • A1
  • All are regular too.

4
Regular Expression
  • 010- zero or more 0s followed by one 1 and
    followed by any number of 0s or no 0
  • (0 U e) 1- 0 followed by any number of 1s or
    any number of 1s
  • 1 Ø - Take zero or more 1s and concatenated
    by empty set. 1 Ø Ø
  • Ø- e Empty string

5
N1 U N2
N
N1
e
e
N2
6
A1
e
e
e
7
0 U 1
0
e
e
1
8
(0 U 1)
0
e
e
e
e
1
e
9
0 (0 U 1) 0
0
e
e
e
0
0
e
e
e
e
1
e
10
0 U 0 (0 U 1) 0
0
e
0
e
e
e
e
0
0
e
e
e
e
1
e
11
Qj
R4
Qi
R3
R1
Qrip
R1 R2 R3 U R4
Qj
Qi
12
GNFA
  • GNFA stands for Generalized Nondeterministic
    Finite Automaton.
  • GNFA are simply nondeterministic finite automaton
    wherein the transition arrows may have any
    regular expressions as labels, instead of only
    members of the alphabet.

13
Restricted GNFA
  • The start state has transition arrows going to
    every other state but no arrows coming in from
    any other state.
  • There is only a single accept state, and it has
    arrows coming in from every other state but no
    arrows going to any other state. Accept state is
    not the same as the start state.
  • Except for the start and accept states, one arrow
    goes from every state to every other state and
    also from each state to itself.

14
EXAMPLE
0
1
0
1
e
Q2
Q3
0
Q1
S
1
e
F
15
After Ripping Q3
0
1
e
Q2
Q1
S
1
010
e
F
16
101 U 010
R2
01
S
Q2
0
10
R3
R4
F
01(101 U 010)10 U 0
17
  • If we have n states in DFA then restricted GNFA
    is going to have (n2) states.
Write a Comment
User Comments (0)
About PowerShow.com