1 NFSA Simulation with Deque a 12 3 b 45 a 67 8 c 9 10 11 12 d 13 startaccept aabda Input...

Post on 19-Dec-2015

221 views 1 download

Tags:

transcript

1

NFSA Simulation with Deque

a1 2

3

b4 5

a6 7

8

c9

10

11

12d

13

start accept

a a b d a

Input Text

top bottom

state

label

Deque

aaaaaaaaaaa-1aaa

2

NFSA Simulation with Deque

a1 2

3

b4 5

a6 7

8

c9

10

11

12d

13

start accept

a a b d a

Input Text

top bottom

10state

label

Deque

aaaaaaaaaaa-1aaa 36

Push 3 and 6 since label =

3

NFSA Simulation with Deque

a1 2

3

b4 5

a6 7

8

c9

10

11

12d

13

start accept

a a b d a

Input Text

top bottom

6state

alabel

Deque

aaaaaaaaaaa-13aa 7

Enqueue 7 since label matches

4

NFSA Simulation with Deque

a1 2

3

b4 5

a6 7

8

c9

10

11

12d

13

start accept

a a b d a

Input Text

top bottom

3state

label

Deque

aaaaaaaaaa7-13aa 14

Push 1 and 4 since label =

5

NFSA Simulation with Deque

a1 2

3

b4 5

a6 7

8

c9

10

11

12d

13

start accept

a a b d a

Input Text

top bottom

4state

blabel

Deque

aaaaaaaaaa7-11aa

Do nothing since label mismatches

6

NFSA Simulation with Deque

a1 2

3

b4 5

a6 7

8

c9

10

11

12d

13

start accept

a a b d a

Input Text

top bottom

1state

alabel

Deque

aaaaaaaaaa7-11aa 2

Enqueue 2 since label matches

7

NFSA Simulation with Deque

a1 2

3

b4 5

a6 7

8

c9

10

11

12d

13

start accept

a a b d a

Input Text

top bottom

-1state

label

Deque

aaaaaaaaa27-11aa

Enqueue -1 and advance input

-1

8

NFSA Simulation with Deque

a1 2

3

b4 5

a6 7

8

c9

10

11

12d

13

start accept

a a b d a

Input Text

top bottom

-1state

label

Deque

aaaaaaaa-127-11aa

Enqueue -1 and advance input

9

NFSA Simulation with Deque

a1 2

3

b4 5

a6 7

8

c9

10

11

12d

13

start accept

a a b d a

Input Text

top bottom

7state

label

Deque

aaaaaaaa-127-11aa 8

Push 8 since label =

10

NFSA Simulation with Deque

a1 2

3

b4 5

a6 7

8

c9

10

11

12d

13

start accept

a a b d a

Input Text

top bottom

8state

clabel

Deque

aaaaaaaa-127-11aa

Do nothing since label mismatches

11

NFSA Simulation with Deque

a1 2

3

b4 5

a6 7

8

c9

10

11

12d

13

start accept

a a b d a

Input Text

top bottom

2state

label

Deque

aaaaaaaa-127-11aa 3

Push 3 since label =

12

NFSA Simulation with Deque

a1 2

3

b4 5

a6 7

8

c9

10

11

12d

13

start accept

a a b d a

Input Text

top bottom

3state

label

Deque

aaaaaaaa-127-11aa 14

Push 1 and 4 since label =

13

NFSA Simulation with Deque

a1 2

3

b4 5

a6 7

8

c9

10

11

12d

13

start accept

a a b d a

Input Text

top bottom

4state

blabel

Deque

aaaaaaaa-117-11aa

Do nothing since label mismatches

14

NFSA Simulation with Deque

a1 2

3

b4 5

a6 7

8

c9

10

11

12d

13

start accept

a a b d a

Input Text

top bottom

1state

alabel

Deque

aaaaaaaa-117-11aa 2

Enqueue 2 since label matches

15

NFSA Simulation with Deque

a1 2

3

b4 5

a6 7

8

c9

10

11

12d

13

start accept

a a b d a

Input Text

top bottom

-1state

label

Deque

aaaaaaa2-117-11aa -1

Enqueue -1 and advance input

16

NFSA Simulation with Deque

a1 2

3

b4 5

a6 7

8

c9

10

11

12d

13

start accept

a a b d a

Input Text

top bottom

2state

label

Deque

aaaaaa-12-117-11aa 3

Push 3 since label =

17

NFSA Simulation with Deque

a1 2

3

b4 5

a6 7

8

c9

10

11

12d

13

start accept

a a b d a

Input Text

top bottom

3state

label

Deque

aaaaaa-12-117-11aa 14

Push 1 and 4 since label =

18

NFSA Simulation with Deque

a1 2

3

b4 5

a6 7

8

c9

10

11

12d

13

start accept

a a b d a

Input Text

top bottom

4state

label

Deque

aaaaaa-11-117-11aa 5

Enqueue 5 since label matches

19

NFSA Simulation with Deque

a1 2

3

b4 5

a6 7

8

c9

10

11

12d

13

start accept

a a b d a

Input Text

top bottom

1state

alabel

Deque

aaaaa5-11-117-11aa

Do nothing since label mismatches

20

NFSA Simulation with Deque

a1 2

3

b4 5

a6 7

8

c9

10

11

12d

13

start accept

a a b d a

Input Text

top bottom

-1state

label

Deque

aaaaa5-11-117-11aa -1

Enqueue -1 and advance input

21

NFSA Simulation with Deque

a1 2

3

b4 5

a6 7

8

c9

10

11

12d

13

start accept

a a b d a

Input Text

top bottom

5state

label

Deque

aaaa-15-11-117-11aa 11

Push 11 since label =

22

NFSA Simulation with Deque

a1 2

3

b4 5

a6 7

8

c9

10

11

12d

13

start accept

a a b d a

Input Text

top bottom

11state

label

Deque

aaaa-15-11-117-11aa 12

Push 12 since label =

23

NFSA Simulation with Deque

a1 2

3

b4 5

a6 7

8

c9

10

11

12d

13

start accept

a a b d a

Input Text

top bottom

12state

dlabel

Deque

aaaa-15-11-117-11aa 13

Enqueue 13 since label matches

24

NFSA Simulation with Deque

a1 2

3

b4 5

a6 7

8

c9

10

11

12d

13

start accept

a a b d a

Input Text

top bottom

-1state

label

Deque

aaa13-15-11-117-11aa -1

Enqueue -1 and advance input

25

NFSA Simulation with Deque

a1 2

3

b4 5

a6 7

8

c9

10

11

12d

13

start accept

a a b d a

Input Text

top bottom

13state

label

Deque

aa-1-15-11-117-11aa

STOP: match found