1 / 9

Finite Automaton: Example 1

Finite Automaton: Example 1. 0 0 1 0 1 1. accepted. Finite Automaton: Example 2. 0 0 1 0 1 0. not accepted. Reducing REs to NFAs. ab. a. b. b. ε. ✓. NFA for (ab|ba)*. ( ab|ba )*. ✓. a. b. b. a. a( ab|ba )*. b( ab|ba )*. NFA for (ab|aba)*. ( ab|aba )*. ✓. a. a. b.

dea
Télécharger la présentation

Finite Automaton: Example 1

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

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

  3. Reducing REs to NFAs ab a b b ε ✓ CMSC 330 - Spring 2011

  4. NFA for (ab|ba)* (ab|ba)* ✓ a b b a a(ab|ba)* b(ab|ba)* CMSC 330 - Spring 2011

  5. NFA for (ab|aba)* (ab|aba)* ✓ a a b ba(ab|aba)* b(ab|aba)* a b a(ab|aba)* CMSC 330 - Spring 2011

  6. NFA  DFA Example 1 • r0 = {S1} • R = {r0} = { {S1} } • r  R = {S1} • move({S1}, a} = {S2,S3} • R = R ∪ {{S2,S3}} = { {S1}, {S2,S3} } •  =  ∪ {<{S1}, a, {S2,S3}>} • move({S1},b} = Ø • R = R ∪ {Ø} = { Ø, {S1}, {S2,S3} } •  =  ∪ {<{S1}, b, Ø>} NFA a b S1 S2 S3 a DFA a {S1} {S2,S3} b ∅ CMSC 330 - Spring 2011

  7. 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} } •  =  ∪ {<{S2,S3},a, Ø >, <{S2,S3}, b, {S3}>} NFA a b S1 S2 S3 a DFA a b {S1} {S3} {S2,S3} b a ∅ CMSC 330 - Spring 2011

  8. NFA  DFA Example 1 (cont.) • R = { {S1}, {S2,S3}, Ø, {S3} } • r  R = Ø • move(Ø,a} = Ø • move(Ø,b} = Ø • R = { {S1}, {S2,S3} }, Ø, {S3} } •  =  ∪ {<Ø,a,Ø>, <Ø,b, Ø>} NFA a b S1 S2 S3 a DFA a b {S1} {S3} {S2,S3} b a ∅ a b CMSC 330 - Spring 2011

  9. NFA  DFA Example 1 (cont.) • R = { {S1}, {S2,S3}, Ø, {S3} } • r  R = {S3} • move({S3},a} = Ø • move({S3},b} = Ø • R = { {S1}, {S2,S3} }, Ø, {S3} } •  =  ∪ {<{S3},a, Ø >, <{S3}, b, Ø>} • Fd = {{S2,S3}, {S3}} • Since S3  Fn • Done! NFA a b S1 S2 S3 a DFA a b {S1} {S3} {S2,S3} b a a,b ∅ a b CMSC 330 - Spring 2011

More Related