Lecture 6 Nondeterministic Finite Automata (NFA) - PowerPoint PPT Presentation

About This Presentation
Title:

Lecture 6 Nondeterministic Finite Automata (NFA)

Description:

... each regular expression r, we can construct a digraph G(r) with edges labeled ... Given an NFA M, construct an NFA accepting L(M) . 0. 1. 0. 0. 1. First, ... – PowerPoint PPT presentation

Number of Views:596
Avg rating:3.0/5.0
Slides: 24
Provided by: ding8
Learn more at: https://www.utdallas.edu
Category:

less

Transcript and Presenter's Notes

Title: Lecture 6 Nondeterministic Finite Automata (NFA)


1
Lecture 6 Nondeterministic Finite Automata (NFA)
2
NFA
3
e
p
h
b
t
a
l
a
  • The tape is divided into finitely many cells.
    Each cell contains a symbol in an alphabet S.

4
a
  • The head scans at a cell on the tape and can read
    a symbol on the cell. In each move, the head move
    to the right cell or stop there (in a e-move).

5
  • The finite control has finitely many states which
    form a set Q. For each move, the state is changed
    according to the evaluation of a transition
    function
  • d Q x (S U e) ? 2 (the family of all
  • subsets
    of Q)

Q
Q
6

a
a
p
q
pp1 or p2
  • d(q, a) p1, p2 for a in S means that if the
    head reads symbol a and the finite control is in
    the state q, then the next state should be p1 or
    p2, and the head moves one cell to the right.

7

a
a
p
q
pp1 or p2
  • d(q, e) p1, p2 means that if the finite
    control is in the state q, then the next state
    can be be p1 or p2, and the head does not move.
    This move is called a e-move.

8

a
?
q
  • d(q, a) F means that the NFA is stuck.

9
s
  • There are some special states an initial state s
    and a final set F of final states.
  • Initially, the NTM is in the initial state s and
    the head scans the leftmost cell. The tape holds
    an input string.

10
x
h
  • When the head gets off the tape, the NFA stops.
    An input string x is accepted by the NFA if there
    is a computation path to make the NFA stop at a
    final state.
  • Otherwise, the input string is rejected.

11
  • The NTM can be represented by
  • M (Q, S, d, s, F)
  • where S is the alphabet of input symbols.
  • The set of all strings accepted by a NFA M is
    denoted by L(M). We also say that the language
    L(M) is accepted by M.

12
  • The transition diagram of a NFA is an
    alternative way to represent the DFA.
  • For M (Q, S, d, s, F), the transition diagram
    of M is a symbol-labeled digraph G(V, E)
    satisfying the following
  • V Q (s , f for f \in F)
  • E q p p \in d(q, a).

a
13
d 0 1 e
s p, s s
p q
s q q q
0,1
0
0
0
s
p
q
1
e

14
Theorem 1
  • Every regular language can be accepted by an NFA.

15
G(r)
  • For each regular expression r, we can construct a
    digraph G(r) with edges labeled by symbols and e
    as follows.
  • If rF, then
  • If r?F, then

16
(No Transcript)
17
F
e
e
18
(No Transcript)
19
  • (01111)
  • (01)(111)
  • 10(01)00
  • 10(01)(01)00
  • ((01)(10)0)

20
10(01)(01)00
10(01)
(01)00
1
0
(01)
0
0
(01)
0,1
1
0
e
e
e
0
0
e
0,1
21
(01)0(01)
5
0,1
0
0
0
0
0
0
1
1
1
1
1
22
R
Given an NFA M, construct an NFA accepting L(M) .
0
e
0
1
1
e
0
0
e
0
1
e
1
0
23
Given an NFA M, construct an NFA accepting L(M) .
Is it correct?
0
0
Answer No!
1
1
What is the correct way?
0
First, turn NFA to DFA and then do.
Write a Comment
User Comments (0)
About PowerShow.com