1 / 53

A Single Final State for Finite Accepters

A Single Final State for Finite Accepters. Observation. Any Finite Accepter (NFA or DFA) can be converted to an equivalent NFA with a single final state. Example. NFA. Equivalent NFA. In General. NFA. Equivalent NFA. Single final state. Extreme Case. NFA without final state.

rebekaht
Download Presentation

A Single Final State for Finite Accepters

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. A Single Final Statefor Finite Accepters

  2. Observation • Any Finite Accepter (NFA or DFA) • can be converted to an equivalent NFA • with a single final state

  3. Example NFA Equivalent NFA

  4. In General NFA Equivalent NFA Single final state

  5. Extreme Case NFA without final state Add a final state

  6. Properties of Regular Languages

  7. Properties • Take any regular languages and • We will prove: Union: Concatenation: Are regular Languages Star: Complement: Intersection:

  8. We Say • Regular Languages are closed: • Under union: • Under concatenation: • Under the star operation: • Under complement: • Under intersection:

  9. For regular languages and • take NFAs and with Single final state

  10. Example

  11. Union • NFA for

  12. Example NFA for

  13. Concatenation • NFA for

  14. Example • NFA for

  15. Star Operation • NFA for

  16. Example • NFA for

  17. Complement • For the complement of regular language : • Take the DFA that accepts • Construct such that: • Each final state of is nonfinal in • nonfinalfinal • We have:

  18. Example

  19. Intersection • For regular languages and : regular regular regular regular regular

  20. Example • Regular languages: The language is regular

  21. Regular Expressions

  22. Regular Expressions • Regular expressions • are another way of expressing • regular languages • Example: • Stands for the language

  23. Recursive Definition • Regular Expressions: • Primitive regular expressions: • Given regular expressions and Are regular expressions

  24. Examples • A regular expression • Not a regular expression

  25. Languages of Regular Expressions • : language of regular expression • Example

  26. Definition • For primitive regular expressions:

  27. Definition (continued) • For regular expressions and

  28. Example • Regular expression:

  29. Example • Regular expression

  30. Example • Regular expression

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

  32. Example • Regular expression = { all strings without two consecutive 0 }

  33. Equivalent Regular Expressions • Definition: • Regular expressions and • are equivalent if

  34. Example = { all strings with at least two consecutive 0 } and are equivalent regular expr.

  35. Regular ExpressionsandRegular Languages

  36. Theorem • The class of languages • described by Regular expressions • is identical • to the Regular languages

  37. In Other Words • For any regular expression • the language is regular • For any regular language there is • a regular expression with

  38. Proof • First we prove: • For any regular expression • the language is regular

  39. Induction Basis • Primitive Regular Expressions: NFAs regular languages

  40. Inductive Hypothesis • Assume • for regular expressions and • that • and are regular languages

  41. Inductive Step • We will prove that: Are regular Languages

  42. By definition of regular expressions:

  43. By inductive hypothesis • and are regular languages • We know: Regular languages are closed under union concatenation star operation

  44. Therefore: Are regular languages

  45. And trivially: is a regular language

  46. Proof - Second Part • Now we want to prove: • For any regular language there is • a regular expression with

  47. Since is regular take the • NFA that accepts it Single final state

  48. From Construct the equivalent • Generalized Transition Graph • labels of transitions • are regular expressions Example:

  49. Another Example:

  50. Reducing the states:

More Related