









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
This note talks about the definiton of regular languages and also its use
Typology: Lecture notes
1 / 15
This page cannot be seen from the preview
Don't miss anything!










The Regular Operations There are 3 operations on languages, called the regular operations, and they are used to study properties of the regular languages. Definition: Let L 1 and L 2 be languages. We define the regular operations union , concatenation and K leene star as follows:
To prove that L 1 L 2 is regular, take two FAs say M 1 and M 2 for L 1 and L 2 respectively and combine them into one new machine say M that accepts strings in L 1 concatenated with strings in L2. This can also be proved by taking two REs, say r 1 and r 2 for L 1 and L 2 respectively and combine them into one new RE r
z3 = x2 or x4 - final state z4 = x2 or x5 - final state z5 = x3 or x4 - non-final state z6 = x3 or x5 - final state. The machine for M1 + M2 is as follows: The compliment of the above machine L 1 ∩ L 2 is given below
The clever work saving method The machine that accepts the intersection of two languages can be constructed by using the union algorithm but changing the designation of the final states. A state is final in the resulting machine if and only if both the corresponding states of the first machine and the corresponding states of the second machine are final states. For example Find the intersection of L 1 and L 2 given that: L 1 = all words that begin with an a- the RE is a(a+b)* L 2 = all words that end with an a - the RE is (a+b)a L 1 ∩ L 2 = all words that begin and end with letter a – the RE is a(a+b)a + a
Let language L be {ߣ, ܾܽ , ܾܾܽܽ , ܾܾܾܽܽܽ , ܾܾܾܽܽܽܽ ܾ , ܾܾܾܾܾܽܽܽܽܽ , …} This language can be defined as {anbn} = {w = {a,b}*^ | each w is of the form n a’s followed by n b’s} Note the {a n b n } is not a regular expression because it includes symbols {} and n that are not in the alphabet of RE’s. Is {a n b n } regular? We have already indicated that regular languages are accepted by finite automata, so lets draw the FA that accept L. Proof that L is not regular Assume that L is a regular language, then there would be a finite automaton that will accept L. By definition this finite state automaton must have a finite number of states, say 90 states. By definition this finite state automaton must accept all words in L and reject all words not in L Now the string a^100 b^100 is in L The first 100 letters of the string are a’s Our finite state automaton cannot visit a new state for each of these letters because it has 9 0 states. Therefore at some point it must return to a state that it has visited previously.
y is the substring starting at the letter after substring x. So y is substring of w that travels around the circuit coming back to the same state the circuit began with. Since there must be a circuit, y cannot be the null string. The substring y contains the symbols of w for exactly one loop around the circuit. z is the rest of w starting with one symbol after the substring y to the end of the substring w. This z could be null. The path for z could also loop around the y (or any other) circuit. Intuitively what this says is that we can always a nonempty string y not far from the beginning of the string w ∈ L that can be “pumped": by repeating y any number of times (including zero times, i.e. deleting it) you obtain a string which is still in the language. The pumping lemma tells us that all regular languages must possess the pumping property. Thus we can show that a language is not regular by showing that it violates the pumping lemma. However, just because a language satisfies the pumping lemma, this does not mean the language is regular. In other words there are non-regular languages which obey the pumping lemma. Thus we should be careful and not use the pumping lemma to prove that a language is regular! We should only use it to prove that some language is not regular. Later we will give a condition which is both necessary and sufficient for a language to be regular. Suppose you want to prove that an infinite language L is not regular:
Example 1 Prove using the pumping lemma that the language L = {anbn^ where n = 0, 1,2,3..} is not regular. Solution:
Solution
None of these words is in L Thus our assumption that some finite state automaton could recognise L must be false Therefore there is no such finite state automaton Therefore L is not regular Example 4 Prove that the language EQUAL is not regular. EQUAL is the language of all words with the total number of a’s and b’s. Solution Note that: L(a
b
) ∩ EQUAL = {a n b n }. Now if EQAUL were a regular language, then {a n b n } would be the intersection of two regular languages and it would have to be regular itself. Since {anbn} is not regular, EQUAL cannot be. Decidability Decidability refers to a problem with a decision procedure. A decision procedure is an effective solution to a problem that has a yes or no answer. Decidability issues
1. How can we tell if two regular expressions define the same language 2. How can we tell if two finite automata are equivalent 3. How can we tell if the language defined by a finite automaton has finitely many or infinitely many words in it. 1. Deciding whether two regular expressions determine the exact/same language Given two languages L and M defined either by a finite automaton or regular expressions we can produce finite automata for languages ܮ, ܯ, M ∩ ܮ, L ∩ ܯ, Therefore we produce a finite automaton that accepts the language (M ∩ ܮ) + (L ∩ ܯ) This machine accepts the language of all words that are in L but not in M or else in M but not in L If L and M are the same language, this machine cannot accept any words If this machine accepts even one word the L is not equal to M, even the one word is the null word.