closure under the regular operations
play

Closure under the Regular Operations Closure under the Regular - PowerPoint PPT Presentation

Closure under the Regular Operations Closure under the Regular Operations p.1/26 Application of NFA Now we use the NFA to show that the collection of regular languages is closed under regular operations union, concatenation, and star


  1. Closure under the Regular Operations Closure under the Regular Operations – p.1/26

  2. � Application of NFA Now we use the NFA to show that the collection of regular languages is closed under regular operations union, concatenation, and star Closure under the Regular Operations – p.2/26

  3. � � Application of NFA Now we use the NFA to show that the collection of regular languages is closed under regular operations union, concatenation, and star Earlier we have shown this closure for union using a Cartesian product of DFA Closure under the Regular Operations – p.2/26

  4. � � � Application of NFA Now we use the NFA to show that the collection of regular languages is closed under regular operations union, concatenation, and star Earlier we have shown this closure for union using a Cartesian product of DFA For uniformity reason we reconstruct that proof using NFA Closure under the Regular Operations – p.2/26

  5. Theorem 1.45 The class of regular languages is closed under the union operation Closure under the Regular Operations – p.3/26

  6. Theorem 1.45 The class of regular languages is closed under the union operation Proof idea: Closure under the Regular Operations – p.3/26

  7. ✄ � ☎ ✁ ☎ Theorem 1.45 The class of regular languages is closed under the union operation Proof idea: Let regular languages and be recognized by NFA and �✂✁ �✂✄ , respectively Closure under the Regular Operations – p.3/26

  8. � ✄ ✁ ✄ ☎ � ✁ ☎ ☎ � � ✁ ✁ � � ✄ ✁ Theorem 1.45 The class of regular languages is closed under the union operation Proof idea: Let regular languages and be recognized by NFA and �✂✁ �✂✄ , respectively To show that is regular we will construct an NFA that recognizes Closure under the Regular Operations – p.3/26

  9. ☎ ✄ ✄ ☎ ✄ � ✁ ✁ � � ☎ ☎ ☎ ☎ ✁ ✁ ☎ ✄ � ✁ ✁ ✄ � ☎ � ☎ ✁ � Theorem 1.45 The class of regular languages is closed under the union operation Proof idea: Let regular languages and be recognized by NFA and �✂✁ �✂✄ , respectively To show that is regular we will construct an NFA that recognizes must accept its input if either or accepts its input. Hence, must have a new state that will allow it to guess nondeterministically which of or accepts it Closure under the Regular Operations – p.3/26

  10. ✄ � � ✁ � ✁ ✁ � ☎ ✄ ☎ ☎ ✄ � ✁ ✁ ☎ ☎ � ✄ ☎ � ✁ ☎ � ✄ � ☎ ✁ ☎ ☎ ✄ ✁ ☎ Theorem 1.45 The class of regular languages is closed under the union operation Proof idea: Let regular languages and be recognized by NFA and �✂✁ �✂✄ , respectively To show that is regular we will construct an NFA that recognizes must accept its input if either or accepts its input. Hence, must have a new state that will allow it to guess nondeterministically which of or accepts it Guessing is implemented by transitions from the new state to the start states of and , as seen in Figure 1 Closure under the Regular Operations – p.3/26

  11. ✟ ✆ ☎ ✁ ✝ ✝ ✝ ✝ ✝ ✝ ✟ � ✆ ✆ � ✂ ✝ ✝ ✝ ✆ � ✝ ✝ ✝ ✆ ✄ ✁ ✁ An NFA recognizing ✂☎✄ ✂☎✞ Figure 1: Construction of to recognize Closure under the Regular Operations – p.4/26

  12. ✡ ✌ ✠ ✍ ✝ ✌ ✍ ☛ ✝ ☞ ✍ ☞ ✟ � ✄ ☎ ✆ ✝ ✟ ✝ ✠ ✝ ✡ ✝ ✎ ✝ ✝ ✍ ✄ ☎ ✆ ✎ ✟ ✝ ✠ ✁ ✡ ✆ ✁ ☛ ✝ ☞ ✁ ✌ ✏ ✁ ✄ ☎ ☛ Proof Let , and �✂✁ �✂✍ ✁✞✝ ✍✞✝ Construct to recognize using the following procedure: Closure under the Regular Operations – p.5/26

  13. ✄ ✁ ☎ ☎ ✄ ✄ � ✁ � ✁ ✁ ✝ ✆ ✆ ✁ � ☎ Construction procedure ✂☎✄ 1. : That is, the states of are all states on and with the addition of a new state Closure under the Regular Operations – p.6/26

  14. ✆ ☎ ✄ ✄ ✄ ☎ ✆ ✁ ☎ ☎ ✄ � ✁ ✁ � ✁ ✝ ✆ ✁ � Construction procedure ✂☎✄ 1. : That is, the states of are all states on and with the addition of a new state 2. The start state of is Closure under the Regular Operations – p.6/26

  15. ☎ ☎ ✆ ☎ ✄ ✄ ✆ ☎ ✁ ☎ � ✁ � ✁ ✁ � ✄ ✄ ✄ ☎ ✁ � ✁ ✆ ✝ ✁ � ✁ � ✄ ☎ ☎ ✁ Construction procedure ✂☎✄ 1. : That is, the states of are all states on and with the addition of a new state 2. The start state of is 3. The accept states of are : That is, the accept states of are all the accept states of and Closure under the Regular Operations – p.6/26

  16. ✂ ✄ ✁ � ✄ ✆ ✠ ✁ ✟ ✝ ✞ ✝ ✄ � ✞ ✄ ✁ ✂ ✁ � ✁ ✄ ✝ ✞ � ✄ ✄ � ✁ ✄ ✞ ✞ ✟ ✂ ✞ ✝ ✂ ✄ � ✁ � ✁ ✄ ✄ ✞ ✟ ✄ ✆ ✁ ✄ ✆ ✄ ☎ ✂ ✁ ☎ ✑ ☎ ✁ � ✆ ✁ ✁ � ✁ ✝ ✆ � ✁ � ✄ ✄ ✄ � ☎ ✂ ✁ ☎ ✁ ☎ � ✏ ✄ ✁ ☎ ✁ � ✁ � ✞ ☎ ✄ ✆ ✄ ✁ ✆ Construction procedure ✂☎✄ 1. : That is, the states of are all states on and with the addition of a new state 2. The start state of is 3. The accept states of are : That is, the accept states of are all the accept states of and 4. Define so that for any and any : ✄✆☎ if ✡☛✡☞✡✌✡☛✡☞✍ if ✂☎✄ if and ✡☛✡✌✡☞✡☛✡✌✎ if and . Closure under the Regular Operations – p.6/26

  17. ✁ ✏ ✁ ✜ ✝ ✛ ✄ ✁ ✚ ✞ ✙ ✞ ✚ ✒ ☎ ✏ ✒ ✙ ✁ ☎ ✆ ☎ ✂ ✏ ✘ ✝ ✏ ✂ ✆ ✞ ☛ ✏ ✏ ✠ ✎ ✗ ✍ ✌ ✝ ✌✢ ✞ ✎ ✍ ✡ ☎ ✂ ✍ ☛ ✕ ✔ ✍ ✕ ☛ ✌ ✞ ✕ ✑ ✞ ✣ ✝ ☎ ✑ ☛ ✂ ✏ ✎ ✍ ✡ ☎ ✌ ✤ ✠ ✏ ✆ ☛ ☎ ✂ ✁ � ✥ ✄ ✂ ✝ ✁ � ✄ ✟ ✞ ✑ ✍ ☛ ✍ ✌ ✂ ✞ ✖ ✍ ✂ ✌ ☛ ✡ ✂ ✍ ✕ ✌ ☎✔ ✆ ☎ ✂ ✁ ✓ ✝ ✒ ✎ ✍ ✡ ☎ ✒ Application Consider the alphabet and the languages: ✝✟✞ ✡☞☛ ✎✟✗ ✡☞☛ Use the construction given in the proof of theorem 1.45 to give the state diagrams recognizing the languages and . Closure under the Regular Operations – p.7/26

  18. � ✎ ✁ ✎ ✍ � ✁ Theorem 1.47 The class of regular languages is closed under concatenation operation Proof idea: Assume two regular languages, and rec- ognized by NFAs and , respectively. Construct as �✂✍ suggested in Figure 2 Closure under the Regular Operations – p.8/26

  19. � ✂ � � ✁ ✟ ✆ ✟ ✂ ✂ � ✂ ✄ ✟ ✂ ✄ ☎ � � ✂ ✝ ☎ ✝ ✄ ✆ ✝ ✝ ✝ ✂ ✞ ✆ ✝ ✝ ✝ ✝ ✆ ✝ ✝ ✝ ✝ ✝ ✁ Construction of NFA Figure 2: Construction of to recognize Closure under the Regular Operations – p.9/26

  20. � � � ✁ Construction procedure Combine and into a new automaton that �✂✁ �✂✍ starts in the start state of Closure under the Regular Operations – p.10/26

  21. ✁ � ✍ � ✁ � � � � � Construction procedure Combine and into a new automaton that �✂✁ �✂✍ starts in the start state of Add transitions from the accept states of to the start state of Closure under the Regular Operations – p.10/26

  22. � � ✍ � � � ✍ � � ✁ � ✁ � � Construction procedure Combine and into a new automaton that �✂✁ �✂✍ starts in the start state of Add transitions from the accept states of to the start state of Set accept states of to be the accept states on Closure under the Regular Operations – p.10/26

  23. ✠ ✍ ✟ ✝ ☛ ✍ ✝ ✡ ✍ ☛ ✝ ☞ ✌ ✍ ✁ ✎ ✍ ✡ ✝ � ✄ ☎ ✆ ✝ ✟ ✝ ✆ ✠ ✁ ✌ ✄ ☎ ✆ ✍ ✟ ✝ ✠ ✁ ✝ ✡ ☛ ☎ ✝ ☞ ✁ ✌ ☞ ✎ ✁ ✝ � ✍ ✄ ✝ Proof Let recognize and �✂✁ ✁✞✝ recognize . Construct by the following procedure: Closure under the Regular Operations – p.11/26

  24. ☎ � ✁ � ✁ ✁ � ✄ ☎ ✄ ☎ ✁ Construction procedure 1. . The states of are all states of and Closure under the Regular Operations – p.12/26

  25. ☎ ✁ ☎ ✁ ✁ ✆ ☎ ☎ ✄ ✄ � ✁ ✁ � ✁ � ✄ Construction procedure 1. . The states of are all states of and 2. The start state is the state of Closure under the Regular Operations – p.12/26

  26. ☎ ☎ ✁ ✄ ✁ ✄ � ✄ ✁ ☎ ☎ ☎ ✄ ✄ � ✁ ✁ � ✁ � ✆ Construction procedure 1. . The states of are all states of and 2. The start state is the state of 3. The accept states is the set of the accept states of Closure under the Regular Operations – p.12/26

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend