You are on page 1of 6

Tahir Naseem/Handout 16

-1-

Theory of Automata and Formal Languages

Lecture 16
Objectives

Regular Languages
Closure Properties on Regular Languages
o Closure under union
o Closure under intersection
o Closure under complement
o Closure under reversal
o Closure under difference
o Closure under concatenation
o Closure under kleen closure
Regular Languages
Regular languages are all those languages for which
o Regular expression can be written
o FSA can be constructed
o TG can be constructed
According to Kleens theorem if any one of above can be devised then remaining two
also can be devised.
Closure Properties on Regular Languages
All regular languages are closed under union, intersection, complement, reversal,
difference, concatenation, and kleen closure.
We are going to prove all properties one by one.
Theorem 1: If L1 and L2 are two regular languages, then so is L1 + L2.
Proof: (Constructive Proof)
L1 and L2 are regular languages (given)
If L1 and L2 are regular so there must be a regular expression (Kleens Theorem)
Let R1 and R2 are regular expressions for L1 and L2 respectively.
Now
R1+R2 is the regular expression for L1+L2
So, L1+L2 is regular (every language have regular expression is regular).
Hence proved.
Theorem 2: If L1 and L2 are two regular languages, then so is L1.L2.
Proof: (Constructive Proof)
L1 and L2 are regular languages (given)
If L1 and L2 are regular so there must be a regular expression (Kleens Theorem)
Let R1 and R2 are regular expressions for L1 and L2 respectively.
Now

Tahir Naseem/Handout 16

-2-

Theory of Automata and Formal Languages

R1.R2 is the regular expression for L1.L2


So, L1.L2 is regular (every language have regular expression is regular).
Hence proved.
Theorem 3: If L1 is a regular language, then so is L1 (complement).
Proof: (Constructive Proof)
L1 is a regular languages (given)
If L1 is a regular language then an FSA ( F ) can be constructed which accepts words of L1.
Similarly, if we are able to construct an FSA (F) for L1 then L1 also be a regular.
F can be constructed simply by converting all accepted states to the rejection states and all
rejection states into acceptance states.
Because we have a way to construct F for L1; so L1 is regular language.
Hence proved.
Theorem4: If L1 and L2 are two regular languages, then so is L1L2.
Proof: (Constructive Proof)
L1 and L2 are regular languages (given)
L1 and L2 are also regular (using complement rule).
L1UL2 is also regular (union rule)
(L1UL2) is also regular (complement rule)
(L1L2) is also regular
Hence proved
Theorem5: If L1 and L2 are two regular languages, then so is L1-L2.
Proof: (Constructive Proof)
L1 and L2 are regular languages (given)
L1 and L2 are also regular (using complement rule).
(L1L2) is also regular (Intersection rule)
(L1-L2) is also regular (A-B = AB; rule from set theory)
Hence proved

Tahir Naseem/Handout 16

-3-

Theory of Automata and Formal Languages

Theorem6: If L is a regular language, then so is LR (complement).


Proof: (Constructive Proof)
L is a regular language (given)
Let R be a regular expression of L (every regular language have a regular expression)
If we are able to construct a regular expression RR for LR then LR will be regular.
RR can be obtained by applying following rules
xR = x if x or x=
(R1 + R2)R = R1R + R2R
(R1R2)R = R1RR2R
(R1)* = R1*

Complement of above FA is

Tahir Naseem/Handout 16

-4-

Theory of Automata and Formal Languages

Tahir Naseem/Handout 16

-5-

Theory of Automata and Formal Languages

Tahir Naseem/Handout 16

-6-

Theory of Automata and Formal Languages

You might also like