1
Operations on Languages
Operations on Languages
•
Recall: A language is a set of strings
•
We can consider new languages derived from operations on given languages
–
e.g.,
L
1
∪
L
2
,
L
1
∩
L
2
,
1
2
L
, . . .
•
A simple but powerful collection of operations:
–
Union, Concatenation and Kleene Closure
Union is a familiar operation on sets. We define and explain the other two operations below.
Concatenation of Languages
Definition 1.
Given languages
L
1
and
L
2
, we define their
concatenation
to be the language
L
1
◦
L
2
=
{
xy
|
x
∈
L
1
, y
∈
L
2
}
Example
2
.
•
L
1
=
{
hello
}
and
L
2
=
{
world
}
then
L
1
◦
L
2
=
{
helloworld
}
•
L
1
=
{
00
,
10
}
;
L
2
=
{
0
,
1
}
.
L
1
◦
L
2
=
{
000
,
001
,
100
,
101
}
•
L
1
= set of strings ending in 0;
L
2
= set of strings beginning with 01.
L
1
◦
L
2
= set of strings
containing 001 as a substring
•
L
◦ { }
=
L
.
L
◦ ∅
=
∅
.
Kleene Closure
Definition 3.
L
n
=
(
{ }
if
n
= 0
L
n
-
1
◦
L
otherwise
L
*
=
[
i
≥
0
L
i
i.e.,
L
i
is
L
◦
L
◦ · · · ◦
L
(concatenation of
i
copies of
L
), for
i >
0.
L
*
, the Kleene Closure of
L
: set of strings formed by taking any number of strings (possibly
none) from
L
, possibly with repetitions and concatenating all of them.
•
If
L
=
{
0
,
1
}
, then
L
0
=
{ }
,
L
2
=
{
00
,
01
,
10
,
11
}
.
L
*
= set of
all
binary strings (including
).
• ∅
0
=
{ }
. For
i >
0,
∅
i
=
∅
.
∅
*
=
{ }
• ∅
is one of only two languages whose Kleene closure is finite. Which is the other?
{ }
*
=
{ }
.
2
