0% found this document useful (0 votes)
2 views

Regular Languages

The document discusses the closure properties of regular languages, including closure under union, concatenation, intersection, difference, and complementation. It provides proofs and examples demonstrating that operations on regular languages yield regular languages. The document emphasizes that regular languages maintain their properties through these operations.

Uploaded by

ggayatri.1313
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Regular Languages

The document discusses the closure properties of regular languages, including closure under union, concatenation, intersection, difference, and complementation. It provides proofs and examples demonstrating that operations on regular languages yield regular languages. The document emphasizes that regular languages maintain their properties through these operations.

Uploaded by

ggayatri.1313
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 11

Closure Properties of

Regular Languages
Union, Concatenation, Closure,
Intersection

1
Review Closure Properties
A closure property is a statement that
a certain operation on languages, when
applied to languages in a class (e.g.,
the regular languages), produces a
result that is also in that class.

2
Closure Under Union
If L and M are regular languages, so is L
 M.
Proof: Let R and S be the REs that define
L and M.
Then R+S is a regular expression whose
regular language is L  M.
Therefore, regular languages are closed
under union
3
Closure Under
Concatenation and
Closure
Same idea:
RS is a regular expression whose
language is LM; therefore LM is regular.
R* is a regular expression whose
language is L*; therefore L* is regular

4
Closure Under Intersection
If L and M are regular languages, then
LM is regular.
Proof: Let L and M be DFA’s whose
languages are L and M, respectively.
Construct C = p-DFA of L and M
Make the accepting states of C be the
pairs consisting of accepting states of both
L and M.
String w accepted by p-DFA iff it is
accepted by both DFA(L) and DFA(M) 5
Product DFA for
Intersection
0 P-DFA(L  M ) 0
L 1 0
A B [A,C] [A,D]
0, 1 1
1 1 0
0
1 0 [B,C] [B,D]
1
M 0
C D
Which state of p-DFA do we
1 choose for the accepting state?

6
Product DFA for
Intersection
0 P-DFA(L  M ) 0
L 1 0
A B [A,C] [A,D]
0, 1 1
1 1 0
0
1 0 [B,C] [B,D]
1
M 0
C D
String 11 accepted by p-
1 DFA. P-DFA not empty
and defines
(LM ), which is regular.
7
Closure Under Difference
L– M = strings in L but not M. If L and M
are regular languages, then so is L-M
Proof: Let L and M be DFA’s whose
languages are L and M, respectively.
Construct C = p-DFA of L and M.
Make the accepting states of C be the
pairs where L-state is accepting but M-
state is not.
p-DFA defines the RL of L-M.
8
Product DFA for Difference
L-M
0 p-DFA(L-M)
1 0
L A B 0
[A,C] [A,D]
0, 1
1 1 1
0
0
1 0 [B,C] [B,D]
1
M 0
C D
Which state do we choose as
1 the accepting state?

9
Product DFA for Difference
0 p-DFA(L-M)
1 0
L A B 0
[A,C] [A,D]
0, 1
1 1 1
0
0
1 0 [B,C] [B,D]
1
M 0
C D
p-DFA(L-M) is the empty language
1 in this case. Proof still valid.
We used the same p-DFA to show
that L=M. L-M is RL with no strings
10
Closure Under Complementation: Recall Σ* denotes
all string that can be formed from alphabet Σ.

The complement of a language L (with


respect to an alphabet Σ such that Σ*
contains L) is Σ* – L.
Since Σ* is regular, the complement of a
regular language is regular because it is the
difference of regular languages.

11

You might also like