07 Properties of Regular Languages
07 Properties of Regular Languages
◦ Union
◦ Concatenation
◦ Power
◦ Complementation
◦ Intersection
2
Theory of Automata
A language that can be defined by a regular
expression is called a regular language.
3
Theory of Automata
If L1 and L2 are regular languages, then L1 + L2, L1L2, and
L*1 are also regular languages.
Notes:
L + L is the language of all words in either L or L .
1 2 1 2
4
Theory of Automata
Because L1 and L2 are regular languages, there must be
TGs that accept them (by Kleene’s theorem).
Let TG1 accepts L1 and TG2 accepts L2.
Assume that TG1 and TG2 each have a unique start state
and a unique separate final state. If this is not the case
originally, then we can modify the TGs so that this
becomes true as in Kleene’s theorem,Part 2 of the proof
(page 93).
5
Theory of Automata
Then the TG described below accepts the language L 1 +
L2.
6
Theory of Automata
The TG described below accepts the language L1L2
where state 1 is the former + of TG1 and state 2 is the
former - of TG2.
7
Theory of Automata
The TG described below accepts the language L1*.
8
Theory of Automata
Definition:
If L is a language over the alphabet , we define
its complement L` to be the language of all
strings of letters from that are not words in L.
Example:
– Let L be the language over the alphabet ∑ = {a;
b} of all words that have a double a in them.
– Then, L` is the language of all words that do
not have a double a in them.
Note that the complement of L` is L. That is
(L`)` = L
9
Theory of Automata
If L is a regular language, then L` is also a
regular language. In other words, the set of
regular languages is closed under
complementation.
10
Theory of Automata
If L is a regular language, then by Kleene’s theorem,
there is some FA that accepts the language L.
Some states of this FA are final states and some are not.
Let us reverse the status of each state: If it was a final
state, make it a non-final state. If it was a non-final
state, make it a final state. The start state gets reversed
as follows: - ↔ ±
If an input string formerly ended in a non-final state, it
now ends in a final state, and vice versa.
The new machine we have just built accepts all input
strings that were not accepted by the original FA, and it
rejects all the input strings that used to be accepted by
FA.
Therefore, this machine accepts exactly the language
L`. So, by Kleene’s theorem, L` is regular.
11
Theory of Automata
If L1 and L2 are regular languages, then L1 ∩ L2
is also a regular language. In other words, the
set of regular languages is closed under
intersection.
12
Theory of Automata
By DeMorgan’s law (for sets of any kind):
L1 ∩ L2 = (L`1 + L`2)`
This means that the language L1 ∩ L2 consists of all
words that are not in either L`1 or L`2.
Because L1 and L2 are regular, then so are L`1 and L`2 by
Theorem 11.
Since L`1 and L`2 are regular, so is L`1 + L`2 by
Theorem 10.
Now, since L`1 + L`2 is regular, so is (L`1 + L`2)` by
Theorem 11.
This means L1 ∩ L2 is regular, because
L1 ∩ L2 = (L`1 + L`2)` by DeMorgan’s law.
13
Theory of Automata