1 / 56

Single Final State for NFA

Single Final State for NFA. Any NFA can be converted to an equivalent NFA with a single final state. Example. NFA. Equivalent NFA. In General. NFA. Equivalent NFA. Single final state. Add a final state Without transitions. Extreme Case. NFA without final state.

stormy
Download Presentation

Single Final State for NFA

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. Single Final State for NFA COMP 335

  2. Any NFA can be converted • to an equivalent NFA • with a single final state COMP 335

  3. Example NFA Equivalent NFA COMP 335

  4. In General NFA Equivalent NFA Single final state COMP 335

  5. Add a final state Without transitions Extreme Case NFA without final state COMP 335

  6. Properties of Regular Languages COMP 335

  7. Union: Concatenation: Are regular Languages For regular languages and we will prove that: Star: Reversal: Complement: Intersection: COMP 335

  8. Union: Concatenation: We say: Regular languages are closed under Star: Reversal: Complement: Intersection: COMP 335

  9. Regular language Regular language NFA NFA Single final state Single final state COMP 335

  10. Example COMP 335

  11. Union • NFA for COMP 335

  12. Example NFA for COMP 335

  13. Concatenation • NFA for COMP 335

  14. Example • NFA for COMP 335

  15. Star Operation • NFA for COMP 335

  16. Example • NFA for COMP 335

  17. Reverse NFA for 1. Reverse all transitions 2. Make initial state final state and vice versa COMP 335

  18. Example COMP 335

  19. Complement 1. Take the DFA that accepts 2. Make final states non-final, and vice-versa COMP 335

  20. Example COMP 335

  21. regular regular regular regular regular Intersection DeMorgan’s Law: COMP 335

  22. Example regular regular regular COMP 335

  23. Regular Expressions COMP 335

  24. Regular Expressions • Regular expressions • describe regular languages • Example: • describes the language COMP 335

  25. Given regular expressions and Are regular expressions Recursive Definition Primitive regular expressions: COMP 335

  26. Not a regular expression: Examples A regular expression: COMP 335

  27. Languages of Regular Expressions • : language of regular expression • Example: COMP 335

  28. Definition • For primitive regular expressions : COMP 335

  29. Definition (continued) • For regular expressions and COMP 335

  30. Example • Regular expression: COMP 335

  31. Example • Regular expression COMP 335

  32. Example • Regular expression COMP 335

  33. = {all strings with at least two consecutive 0} Example • Regular expression COMP 335

  34. = { all strings without two consecutive 0 } Example • Regular expression COMP 335

  35. Equivalent Regular Expressions • Definition: • Regular expressions and • are equivalent if COMP 335

  36. and are equivalent Reg. expressions Example = { all strings without two consecutive 0 } COMP 335

  37. Regular ExpressionsandRegular Languages COMP 335

  38. Theorem Languages Generated by Regular Expressions Regular Languages COMP 335

  39. 1. For any regular expression the language is regular Theorem - Part 1 Languages Generated by Regular Expressions Regular Languages COMP 335

  40. 2. For any regular language , there is a regular expression with Theorem - Part 2 Languages Generated by Regular Expressions Regular Languages COMP 335

  41. 1. For any regular expression the language is regular Proof by induction on the size of Proof - Part 1 COMP 335

  42. NFAs regular languages Induction Basis • Primitive Regular Expressions: COMP 335

  43. Inductive Hypothesis • Assume for regular expressions and • that and are regular languages COMP 335

  44. Inductive Step • We will prove: are regular Languages. COMP 335

  45. By definition of regular expressions: COMP 335

  46. We also know: Regular languages are closed under: Union Concatenation Star By inductive hypothesis we know: and are regular languages COMP 335

  47. Therefore: Are regular languages COMP 335

  48. And trivially: is a regular language COMP 335

  49. Proof – Part 2 2. For any regular language there is a regular expression with Proof by construction of regular expression COMP 335

  50. Since is regular, take an • NFA that accepts it Single final state COMP 335

More Related