Properties of Regular Languages: Prof. Busch - LSU 1
Properties of Regular Languages: Prof. Busch - LSU 1
Busch - LSU 1
Properties of
Regular Languages
Prof. Busch - LSU 2
1
L
2
L
2 1
L L
Concatenation:
*
1
L
Star:
2 1
L L Union:
Are regular
Languages
For regular languages and
we will prove that:
1
L
2 1
L L
Complement:
Intersection:
R
L
1
Reversal:
Prof. Busch - LSU 3
We say: Regular languages are closed under
2 1
L L
Concatenation:
*
1
L
Star:
2 1
L L Union:
1
L
2 1
L L
Complement:
Intersection:
R
L
1
Reversal:
Prof. Busch - LSU 4
a
b
b
a
NFA
Equivalent
NFA
a
b
b
a
A useful transformation: use one accept state
2 accept states
1 accept state
Prof. Busch - LSU 5
NFA
Equivalent NFA
Single
accepting
state
In General
Prof. Busch - LSU 6
NFA without accepting state
Add an accepting state
without transitions
Extreme case
Prof. Busch - LSU 7
1
L Regular language
( )
1 1
L M L =
1
M
Single accepting state
NFA
2
M
2
L
Single accepting state
( )
2 2
L M L =
Regular language
NFA
Take two languages
Prof. Busch - LSU 8
} {
1
b a L
n
=
a
b
1
M
{ } ba L =
2
a
b
2
M
0 > n
Example
Prof. Busch - LSU 9
Union
NFA for
1
M
2
M
2 1
L L
} {
1
b a L
n
=
} {
2
ba L =
} { } {
2 1
ba b a L L
n
=
NFA for
Example
Prof. Busch - LSU 11
Concatenation
NFA for
2 1
L L
1
M
2
M
Example
Prof. Busch - LSU 13
Star Operation
NFA for
*
1
L
1
M
*
1
L e
1
2 1
L w
w w w w
i
k
e
=
Prof. Busch - LSU 14
NFA for * } { *
1
b a L
n
=
a
b
} {
1
b a L
n
=
Example
Prof. Busch - LSU 15
Reverse
R
L
1
1
M
NFA for
'
1
M
1. Reverse all transitions
2. Make initial state accepting state
and vice versa
1
L
Prof. Busch - LSU 16
} {
1
b a L
n
=
a
b
1
M
} {
1
n R
ba L =
a
b
'
1
M
Example
Prof. Busch - LSU 17
Complement
1. Take the DFA that accepts
1
L
1
M
1
L
'
1
M
1
L
2. Make accepting states non-final,
and vice-versa
Prof. Busch - LSU 18
} {
1
b a L
n
=
a
b
1
M
b a,
b a,
} { * } , {
1
b a b a L
n
=
a
b
'
1
M
b a,
b a,
Example
Prof. Busch - LSU 19
Intersection
1
L
regular
2
L
regular
We show
2 1
L L
regular
Prof. Busch - LSU 20
DeMorgans Law:
2 1 2 1
L L L L =
2 1
, L L
regular
2 1
, L L
regular
2 1
L L
regular
2 1
L L
regular
2 1
L L
regular
Prof. Busch - LSU 21
Example
} {
1
b a L
n
=
} , {
2
ba ab L =
regular
regular
} {
2 1
ab L L =
regular
Prof. Busch - LSU 22
1
L for
for
2
L
DFA
1
M
DFA
2
M
Construct a new DFA that accepts
Machine
Machine
M
2 1
L L
M
simulates in parallel and
1
M
2
M
Another Proof for Intersection Closure
Prof. Busch - LSU 23
States in
M
j i
p q ,
1
M
2
M State in
State in
Prof. Busch - LSU 24
1
M
2
M
1
q
2
q
a
transition
1
p
2
p
a
transition
DFA DFA
1 1
, p q
a
New transition
M DFA
2 2
, p q
Prof. Busch - LSU 25
0
q
initial state
0
p
initial state
New initial state
0 0
, p q
1
M
2
M DFA DFA
M DFA
Prof. Busch - LSU 26
i
q
accept state
j
p
accept states
New accept states
j i
p q ,
k
p
k i
p q ,
1
M
2
M DFA DFA
M DFA
Both constituents must be accepting states
Prof. Busch - LSU 27
Example:
} {
1
b a L
n
=
a
b
1
M
0 > n
} {
2
m
ab L =
b
b
2
M
0
q
1
q
0
p
1
p
0 > m
2
q
2
p
a
a
b a,
b a,
b a,
Prof. Busch - LSU 28
0 0
, p q
Automaton for intersection
} { } { } { ab ab b a L
m n
= =
1 0
, p q
a
2 1
, p q
b
a
b
1 1
, p q
2 0
, p q
a
1 2
, p q
2 2
, p q
b
b a,
a
b
b a,
b
a
Prof. Busch - LSU 29
M simulates in parallel and
1
M
2
M
M
accepts string
w
if and only if:
accepts string
w
1
M
and accepts string
w
2
M
) ( ) ( ) (
2 1
M L M L M L =