590 likes | 702 Views
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.
E N D
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 Regular languages are closed under: Complement Intersection
Namely, for regular languages and : Complement Intersection Regular Languages
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
Proof: Apply DeMorgan’s Law: Intersection Theorem: For regular languages and the intersection is regular
regular regular regular regular regular
Standard Representations of Regular Languages
Standard Representations of Regular Languages Regular Languages DFAs Regular Grammars NFAs Regular Expressions
When we say: We are given a Regular Language We mean: Language is in a standard representation
Answer: Take the DFA that accepts and check if is accepted Membership Question Question: Given regular language and string how can we check if ?
DFA DFA
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
DFA DFA
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
DFA is infinite DFA is finite
Answer: Find if Question: Given regular languages and how can we check if ?
Non-regular languages Regular languages
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 !!!
pigeons pigeonholes
A pigeonhole must contain at least two pigeons
pigeons ........... pigeonholes ...........
The Pigeonhole Principle pigeons pigeonholes There is a pigeonhole with at least 2 pigeons ...........
In walks of strings: no state is repeated
In walks of strings: a state is repeated
If the walk of string has length then a state is repeated
Pigeonhole principle for any DFA: If in a walk of a string transitionsstates of DFA then a state is repeated
In other words for a string : transitions are pigeons states are pigeonholes
In general: A string has length number of states A state must be repeated in the walk walk of ...... ......
Take an infinite regular language DFA that accepts states
Take string with There is a walk with label : ......... walk
If string has length number of states then, from the pigeonhole principle: a state is repeated in the walk ...... ...... walk
Write ...... ......
Observations: length number of states length ...... ......
Observation: The string is accepted ...... ......
Observation: The string is accepted ...... ......
Observation: The string is accepted ...... ......
In General: The string is accepted ...... ......
In other words, we described: The Pumping Lemma !!!
The Pumping Lemma: • Given a infinite regular language • there exists an integer • for any string with length • we can write • with and • such that: