You are on page 1of 17

Properties of

Regular Languages

A. Senthil - Professor/CSE 1
For regular languages L1 and L2
we will prove that:

Union: L1 È L2
Concatenation: L1L2
Star: Are regular
L1 *
Languages
Reversal: R
L1
Complement: L1
Intersection: L1 Ç L2
A. Senthil - Professor/CSE 2
We say: Regular languages are closed under

Union: L1 È L2
Concatenation: L1L2
Star: L1 *
Reversal: R
L1
Complement: L1
Intersection: L1 Ç L2
A. Senthil - Professor/CSE 3
Regular language L1 Regular language L2

L(M1 ) = L1 L(M 2 ) = L2

NFA M1 NFA M2

Single final state Single final state


A. Senthil - Professor/CSE 4
Example
M1
n³0
a
n
L1 = {a b} b

M2
L2 = {ba} b a

A. Senthil - Professor/CSE 5
Union
NFA for L1 È L2
M1

l l

l M2 l

A. Senthil - Professor/CSE 6
Example
n
NFA for L1 È L2 = {a b} È {ba}
n
L1 = {a b}
a
b
l l

l L2 = {ba} l
b a
A. Senthil - Professor/CSE 7
Concatenation

NFA for L1L2

M1 M2
l l

A. Senthil - Professor/CSE 8
Example

n n
NFA for L1L2 = {a b}{ba} = {a bba}

n
L1 = {a b}
a L2 = {ba}
b l b a l

A. Senthil - Professor/CSE 9
Star Operation
NFA for L1 *
l
l Î L1 *
M1
l l

l
A. Senthil - Professor/CSE 10
Example

n w = w1w2 ! wk
NFA for L1* = {a b} * wi Î L1
l
n
L1 = {a b}
a
l b l

l
A. Senthil - Professor/CSE 11
Reverse R
NFA for L1

L1 M1 M1¢

1. Reverse all transitions

2. Make initial state final state


and vice versa
A. Senthil - Professor/CSE 12
Example
M1
a
n
L1 = {a b} b

M1¢
a
R n
L1 = {ba } b

A. Senthil - Professor/CSE 13
Complement

L1 M1 L1 M1¢

1. Take the DFA that accepts L1

2. Make final states non-final,


and vice-versa
A. Senthil - Professor/CSE 14
Example
M1
a a, b
n b a, b
L1 = {a b}

M1¢
n a a, b
L1 = {a, b} * -{a b}
b a, b

A. Senthil - Professor/CSE 15
Intersection
DeMorgan’s Law: L1 Ç L2 = L1 È L2
L1 , L2 regular

L1 , L2 regular

L1 È L2 regular

L1 È L2 regular
L1 Ç L2 regular
A. Senthil - Professor/CSE 16
Example

n
L1 = {a b} regular
L1 Ç L2 = {ab}
L2 = {ab, ba} regular regular

A. Senthil - Professor/CSE 17

You might also like