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

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

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

CMSC 330 - Spring 20112 Finite Automaton: Example 2 0 0 1 0 1 0 not accepted

Reducing REs to NFAs CMSC 330 - Spring 20113 ab b ε a b ✓

NFA for (ab|ba)* CMSC 330 - Spring 20114 (ab|ba)* b(ab|ba)* a(ab|ba)* ab ✓ b a

NFA for (ab|aba)* CMSC 330 - Spring 20115 (ab|aba)* b(ab|aba)* ba(ab|aba)* aa ✓ b a a(ab|aba)* b

CMSC 330 - Spring 20116 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

CMSC 330 - Spring 20117 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

CMSC 330 - Spring 20118 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}

CMSC 330 - Spring 20119 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