1 / 82

Standard Representations of Regular Languages

Explore the concept of regular languages through DFAs, NFAs, and regular expressions. Learn how to check if a language is in a standard representation using elementary questions and the Pigeonhole Principle. Dive into proving the non-regularity of languages with the Pumping Lemma.

colinwoods
Download Presentation

Standard Representations 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. Standard Representations of Regular Languages Regular Languages DFAs Regular Grammars NFAs Regular Expressions COMP 335

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

  3. Elementary QuestionsaboutRegular Languages COMP 335

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

  5. DFA DFA COMP 335

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

  7. DFA DFA COMP 335

  8. 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 COMP 335

  9. DFA is infinite DFA is finite COMP 335

  10. Answer: Find if Question: Given regular languages and how can we check if ? COMP 335

  11. and COMP 335

  12. or COMP 335

  13. Non-regular languages COMP 335

  14. Non-regular languages Regular languages COMP 335

  15. 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 !!! COMP 335

  16. The Pigeonhole Principle COMP 335

  17. pigeons pigeonholes COMP 335

  18. A pigeonhole must contain at least two pigeons COMP 335

  19. pigeons ........... pigeonholes ........... COMP 335

  20. The Pigeonhole Principle pigeons pigeonholes There is a pigeonhole with at least 2 pigeons ........... COMP 335

  21. The Pigeonhole Principleand DFAs COMP 335

  22. DFA with states COMP 335

  23. In walks of strings: no state is repeated COMP 335

  24. In walks of strings: a state is repeated COMP 335

  25. If string has length : Then the transitions of string are more than the states of the DFA Thus, a state must be repeated COMP 335

  26. In general, for any DFA: String has length number of states A state must be repeated in the walk of walk of ...... ...... Repeated state COMP 335

  27. In other words for a string : transitions are pigeons states are pigeonholes walk of ...... ...... Repeated state COMP 335

  28. The Pumping Lemma COMP 335

  29. Take an infinite regular language There exists a DFA that accepts states COMP 335

  30. Take string with There is a walk with label : ......... walk COMP 335

  31. If string has length (number of states of DFA) then, from the pigeonhole principle: a state is repeated in the walk ...... ...... walk COMP 335

  32. Let be the first state repeated in the walk of ...... ...... walk COMP 335

  33. Write ...... ...... COMP 335

  34. Observations: length number of states of DFA length ...... ...... COMP 335

  35. Observation: The string is accepted ...... ...... COMP 335

  36. Observation: The string is accepted ...... ...... COMP 335

  37. Observation: The string is accepted ...... ...... COMP 335

  38. In General: The string is accepted ...... ...... COMP 335

  39. In General: Language accepted by the DFA ...... ...... COMP 335

  40. In other words, we described: The Pumping Lemma !!! COMP 335

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

  42. Applications ofthe Pumping Lemma COMP 335

  43. Theorem: The language is not regular. Proof: Use the Pumping Lemma COMP 335

  44. Assumethat is a regular language Since is an infinite language, we can apply the Pumping Lemma COMP 335

  45. Let be the integer in the Pumping Lemma Pick a string such that: (1) and (2) length We pick: COMP 335

  46. Write: From the Pumping Lemma it must be that length Thus: COMP 335

  47. From the Pumping Lemma: Thus: COMP 335

  48. From the Pumping Lemma: Thus: COMP 335

  49. But: CONTRADICTION!!! COMP 335

  50. Therefore: Our assumption that is a regular language is not true Conclusion: is not a regular language COMP 335

More Related