Presentation is loading. Please wait.

Presentation is loading. Please wait.

CMSC 330 - Spring 20111 Finite Automaton: Example 1 0 0 1 0 1 1 accepted.

Similar presentations


Presentation on theme: "CMSC 330 - Spring 20111 Finite Automaton: Example 1 0 0 1 0 1 1 accepted."— Presentation transcript:

1 CMSC Spring Finite Automaton: Example accepted

2 CMSC Spring Finite Automaton: Example not accepted

3 Reducing REs to NFAs CMSC Spring ab b ε a b ✓

4 NFA for (ab|ba)* CMSC Spring (ab|ba)* b(ab|ba)* a(ab|ba)* ab ✓ b a

5 NFA for (ab|aba)* CMSC Spring (ab|aba)* b(ab|aba)* ba(ab|aba)* aa ✓ b a a(ab|aba)* b

6 CMSC Spring NFA  DFA Example 1 r 0 = {S1} R = {r 0 } = { {S1} } r  R = {S1} move({S1}, a} = {S2,S3}  R = R ∪ {{S2,S3}} = { {S1}, {S2,S3} }   =  ∪ { } move({S1},b} = Ø  R = R ∪ {Ø} = { Ø, {S1}, {S2,S3} }   =  ∪ { } b S1S2S3 a a a {S2,S3} {S1} NFA DFA ∅ b

7 CMSC Spring NFA  DFA Example 1 (cont.) R = { {S1}, {S2,S3}, Ø } r  R = {S2,S3} move({S2,S3},a} = Ø move({S2,S3},b} = {S3}  R = R ∪ {{S3} = { {S1}, {S2,S3} }, Ø, {S3} }   =  ∪ {, } b S1S2S3 a a ab {S3} {S1} NFA DFA ∅ b {S2,S3} a

8 CMSC Spring NFA  DFA Example 1 (cont.) R = { {S1}, {S2,S3}, Ø, {S3} } r  R = Ø move(Ø,a} = Ø move(Ø,b} = Ø  R = { {S1}, {S2,S3} }, Ø, {S3} }   =  ∪ {, } b S1S2S3 a a ab {S1} NFA DFA ∅ b {S2,S3} a ab {S3}

9 CMSC Spring NFA  DFA Example 1 (cont.) R = { {S1}, {S2,S3}, Ø, {S3} } r  R = {S3} move({S3},a} = Ø move({S3},b} = Ø  R = { {S1}, {S2,S3} }, Ø, {S3} }   =  ∪ {, } F d = {{S2,S3}, {S3}}  Since S3  F n Done! b S1S2S3 a a NFA DFA ab {S1} ∅ b {S2,S3} a ab {S3} a,b


Download ppt "CMSC 330 - Spring 20111 Finite Automaton: Example 1 0 0 1 0 1 1 accepted."

Similar presentations


Ads by Google