1 / 97

CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 4 Mälardalen University

CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 4 Mälardalen University 2005. Content - More Properties of Regular Languages (RL) - Standard Representations of RL - Elementary Questions about RL - Non-Regular Languages - The Pigeonhole Principle

opa
Télécharger la présentation

CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 4 Mälardalen University

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. CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 4 Mälardalen University 2005

  2. Content - More Properties of Regular Languages (RL)- Standard Representations of RL - Elementary Questions about RL - Non-Regular Languages - The Pigeonhole Principle - The Pumping Lemma - Applications of the Pumping Lemma

  3. More Properties of Regular Languages

  4. We have shown Regular languages are closed under Union Concatenation Star operation Reverse

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

  6. We will show Regular languages are also closed under Complement Intersection

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

  8. Theorem For regular language the complement is regular Complement Proof Take DFA that accepts and change: • non-final states  final states • non-acceptingstates  accepting states • Resulting DFA accepts

  9. Example

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

  11. regular regular regular regular regular

  12. Standard Representations of Regular Languages

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

  14. Elementary QuestionsaboutRegular Languages

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

  16. DFA DFA

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

  18. DFA DFA

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

  20. DFA is infinite DFA is finite

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

  22. and

  23. or

  24. Non-Regular Languages

  25. Non-regular languages Regular languages Chomsky’s Language Hierarchy

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

  27. The Pigeonhole Principle

  28. The Pigeonhole Principle

  29. pigeons pigeonholes

  30. A pigeonhole must contain at least two pigeons

  31. pigeonholes pigeons ........... ...........

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

  33. The Pigeonhole Principleand DFAs

  34. DFA with states

  35. In walks of strings: no state is repeated

  36. In walks of strings: a state is repeated

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

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

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

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

  41. The Pumping Lemmafor Regular Languages

  42. Take an infinite regular language DFA that accepts states

  43. Take string with There is a walk with label ......... walk

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

  45. Write ...... ......

  46. ...... ...... Lengths: (from pigeon principle, as q is the first repetition in sequence) (there is a walk in the graph)

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

  48. Observation The string is accepted ...... ......

  49. Observation The string is accepted ...... ......

  50. Generally The string is accepted ...... ......

More Related