1 / 59

More Properties of Regular Languages

More Properties of Regular Languages. We have proven. Regular languages are closed under:. Union Concatenation Star operation Reverse. Namely, for regular languages and :. Union Concatenation Star operation Reverse. Regular Languages. We will prove.

bonita
Download Presentation

More Properties of Regular Languages

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. More Properties of Regular Languages

  2. We have proven Regular languages are closed under: Union Concatenation Star operation Reverse

  3. Namely, for regular languages and : Union Concatenation Star operation Reverse Regular Languages

  4. We will prove Regular languages are closed under: Complement Intersection

  5. Namely, for regular languages and : Complement Intersection Regular Languages

  6. Proof: • Take DFA that accepts and make • nonfinal states final • final states nonfinal • Resulting DFA accepts Complement Theorem: For regular language the complement is regular

  7. Example:

  8. Proof: Apply DeMorgan’s Law: Intersection Theorem: For regular languages and the intersection is regular

  9. regular regular regular regular regular

  10. Standard Representations of Regular Languages

  11. Standard Representations of Regular Languages Regular Languages DFAs Regular Grammars NFAs Regular Expressions

  12. When we say: We are given a Regular Language We mean: Language is in a standard representation

  13. Elementary QuestionsaboutRegular Languages

  14. Answer: Take the DFA that accepts and check if is accepted Membership Question Question: Given regular language and string how can we check if ?

  15. DFA DFA

  16. Question: Given regular language how can we check if is empty: ? Answer: Take the DFA that accepts Check if there is a path from the initial state to a final state

  17. DFA DFA

  18. Question: Given regular language how can we check if is finite? Answer: Take the DFA that accepts Check if there is a walk with cycle from the initial state to a final state

  19. DFA is infinite DFA is finite

  20. Answer: Find if Question: Given regular languages and how can we check if ?

  21. and

  22. or

  23. Non-regular languages

  24. Non-regular languages Regular languages

  25. Prove that there is no DFA that accepts How can we prove that a language is not regular? Problem: this is not easy to prove Solution: the Pumping Lemma !!!

  26. The Pigeonhole Principle

  27. pigeons pigeonholes

  28. A pigeonhole must contain at least two pigeons

  29. pigeons ........... pigeonholes ...........

  30. The Pigeonhole Principle pigeons pigeonholes There is a pigeonhole with at least 2 pigeons ...........

  31. The Pigeonhole Principleand DFAs

  32. DFA with states

  33. In walks of strings: no state is repeated

  34. In walks of strings: a state is repeated

  35. If the walk of string has length then a state is repeated

  36. Pigeonhole principle for any DFA: If in a walk of a string transitionsstates of DFA then a state is repeated

  37. In other words for a string : transitions are pigeons states are pigeonholes

  38. In general: A string has length number of states A state must be repeated in the walk walk of ...... ......

  39. The Pumping Lemma

  40. Take an infinite regular language DFA that accepts states

  41. Take string with There is a walk with label : ......... walk

  42. If string has length number of states then, from the pigeonhole principle: a state is repeated in the walk ...... ...... walk

  43. Write ...... ......

  44. Observations: length number of states length ...... ......

  45. Observation: The string is accepted ...... ......

  46. Observation: The string is accepted ...... ......

  47. Observation: The string is accepted ...... ......

  48. In General: The string is accepted ...... ......

  49. In other words, we described: The Pumping Lemma !!!

  50. The Pumping Lemma: • Given a infinite regular language • there exists an integer • for any string with length • we can write • with and • such that:

More Related