1 / 56

Single Final State for NFAs

Single Final State for NFAs. 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.

ehewitt
Download Presentation

Single Final State for NFAs

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 NFAs Costas Busch - RPI

  2. Any NFA can be converted • to an equivalent NFA • with a single final state Costas Busch - RPI

  3. Example NFA Equivalent NFA Costas Busch - RPI

  4. In General NFA Equivalent NFA Single final state Costas Busch - RPI

  5. Add a final state Without transitions Extreme Case NFA without final state Costas Busch - RPI

  6. Properties of Regular Languages Costas Busch - RPI

  7. Union: Concatenation: Are regular Languages For regular languages and we will prove that: Star: Reversal: Complement: Intersection: Costas Busch - RPI

  8. Union: Concatenation: We say: Regular languages are closed under Star: Reversal: Complement: Intersection: Costas Busch - RPI

  9. Regular language Regular language NFA NFA Single final state Single final state Costas Busch - RPI

  10. Example Costas Busch - RPI

  11. Union • NFA for Costas Busch - RPI

  12. Example NFA for Costas Busch - RPI

  13. Concatenation • NFA for Costas Busch - RPI

  14. Example • NFA for Costas Busch - RPI

  15. Star Operation • NFA for Costas Busch - RPI

  16. Example • NFA for Costas Busch - RPI

  17. Reverse NFA for 1. Reverse all transitions 2. Make initial state final state and vice versa Costas Busch - RPI

  18. Example Costas Busch - RPI

  19. Complement 1. Take the DFA that accepts 2. Make final states non-final, and vice-versa Costas Busch - RPI

  20. Example Costas Busch - RPI

  21. regular regular regular regular regular Intersection DeMorgan’s Law: Costas Busch - RPI

  22. Example regular regular regular Costas Busch - RPI

  23. Regular Expressions Costas Busch - RPI

  24. Regular Expressions • Regular expressions • describe regular languages • Example: • describes the language Costas Busch - RPI

  25. Given regular expressions and Are regular expressions Recursive Definition Primitive regular expressions: Costas Busch - RPI

  26. Not a regular expression: Examples A regular expression: Costas Busch - RPI

  27. Languages of Regular Expressions • : language of regular expression • Example Costas Busch - RPI

  28. Definition • For primitive regular expressions: Costas Busch - RPI

  29. Definition (continued) • For regular expressions and Costas Busch - RPI

  30. Example • Regular expression: Costas Busch - RPI

  31. Example • Regular expression Costas Busch - RPI

  32. Example • Regular expression Costas Busch - RPI

  33. = { all strings with at least two consecutive 0 } Example • Regular expression Costas Busch - RPI

  34. = { all strings without two consecutive 0 } Example • Regular expression Costas Busch - RPI

  35. Equivalent Regular Expressions • Definition: • Regular expressions and • are equivalent if Costas Busch - RPI

  36. and are equivalent regular expr. Example = { all strings without two consecutive 0 } Costas Busch - RPI

  37. Regular ExpressionsandRegular Languages Costas Busch - RPI

  38. Theorem Languages Generated by Regular Expressions Regular Languages Costas Busch - RPI

  39. 1. For any regular expression the language is regular Theorem - Part 1 Languages Generated by Regular Expressions Regular Languages Costas Busch - RPI

  40. 2. For any regular language there is a regular expression with Theorem - Part 2 Languages Generated by Regular Expressions Regular Languages Costas Busch - RPI

  41. 1. For any regular expression the language is regular Proof by induction on the size of Proof - Part 1 Costas Busch - RPI

  42. NFAs regular languages Induction Basis • Primitive Regular Expressions: Costas Busch - RPI

  43. Inductive Hypothesis • Assume • for regular expressions and • that • and are regular languages Costas Busch - RPI

  44. Inductive Step • We will prove: Are regular Languages Costas Busch - RPI

  45. By definition of regular expressions: Costas Busch - RPI

  46. We also know: Regular languages are closed under: Union Concatenation Star By inductive hypothesis we know: and are regular languages Costas Busch - RPI

  47. Therefore: Are regular languages Costas Busch - RPI

  48. And trivially: is a regular language Costas Busch - RPI

  49. Proof – Part 2 2. For any regular language there is a regular expression with Proof by construction of regular expression Costas Busch - RPI

  50. Since is regular take the • NFA that accepts it Single final state Costas Busch - RPI

More Related