lecture 6 nondeterministic finite automata nfa l.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Lecture 6 Nondeterministic Finite Automata (NFA) PowerPoint Presentation
Download Presentation
Lecture 6 Nondeterministic Finite Automata (NFA)

Loading in 2 Seconds...

play fullscreen
1 / 23

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


  • 1632 Views
  • Uploaded on

Lecture 6 Nondeterministic Finite Automata (NFA) tape head Finite Control NFA e p h b t a l a The tape is divided into finitely many cells. Each cell contains a symbol in an alphabet Σ . a

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Lecture 6 Nondeterministic Finite Automata (NFA)' - Faraday


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
slide2

tape

head

Finite Control

NFA
slide3

e

p

h

b

t

a

l

a

The tape is divided into finitely many cells. Each cell contains a symbol in an alphabet Σ.

slide4

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 ε-move).
slide5
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

δ : Q x (Σ U {ε}) → 2 (the family of all

subsets of Q)

Q

Q

slide6

a

a

  • δ(q, a) = {p1, p2} for a in Σ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.

q

p

p=p1 or p2

slide7

a

a

  • δ(q, ε) = {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 ε-move.

q

p

p=p1 or p2

slide8

a

?

  • δ(q, a) = Φmeans that the NFA is stuck.

q

slide9
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.

s

slide10

x

  • 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.

h

slide11
The NTM can be represented by

M = (Q, Σ, δ, s, F)

where Σ 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.
slide12
The transition diagram of a NFA is an alternative way to represent the DFA.
  • For M = (Q, Σ, δ, 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 δ(q, a)}.

a

slide13

δ 0 1 ε

s p, s s

p q s q

q q

0,1

0

0

0

s

p

q

1

ε

theorem 1
Theorem 1
  • Every regular language can be accepted by an NFA.
slide15
G(r)
  • For each regular expression r, we can construct a digraph G(r) with edges labeled by symbols and ε as follows.
  • If r=Φ, then
  • If r≠Φ, then
slide17

Φ*

ε

ε

slide19
(01+111)*
  • (01)*(111)*
  • 10(0+1)*00
  • 10(0+1)*+(0+1)*00
  • ((01)*(10)*0*)*
slide20

10(0+1)*+(0+1)*00

10(0+1)*

(0+1)*00

1

0

(0+1)*

0

0

(0+1)*

0,1

1

0

ε

ε

ε

0

ε

0

0,1

0 1 0 0 1
(0+1)*0(0+1)

5

0,1

0

0

0

0

0

0

1

1

1

1

1

slide22

R

Given an NFA M, construct an NFA accepting L(M) .

0

ε

0

1

1

ε

0

0

ε

0

1

ε

1

0

slide23

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.