Professional Documents
Culture Documents
Regular Languages
For regular languages L1 and L2
we will prove that:
Union: L1 L2
Concatenation: L1L2
Star: L1 * Are regular
Languages
R
Reversal: L1
Complement: L1
Intersection: L1 L2
Courtesy Costas Busch - RPI 2
A useful transformation: use one accept state
to an equivalent NFA
a Equivalent NFA
a b
b
Courtesy Costas Busch - RPI 4
In General
NFA
Equivalent NFA
Single
final state
Courtesy Costas Busch - RPI 5
Extreme Case
Union: L1 L2
Concatenation: L1L2
Star: L1 *
R
Reversal: L1
Complement: L1
Intersection: L1 L2
Courtesy Costas Busch - RPI 7
Let us take two languages
LM1 L1 LM 2 L2
NFA M1 NFA M2
M2
b a
L2 ba
Union: L1 L2
Concatenation: L1L2
Star: L1 *
HOW?
R
Reversal: L1
Complement: L1
Intersection: L1 L2
Courtesy Costas Busch - RPI 10
Union
NFA for L1 L2
M1
M2
L2 {ba}
b a
Courtesy Costas Busch - RPI 12
Show Regular languages are closed under
Union: L1 L2
Concatenation: L1L2
Star: L1 *
HOW?
R
Reversal: L1
Complement: L1
Intersection: L1 L2
Courtesy Costas Busch - RPI 13
Concatenation
M1 M2
n n
NFA for L1L2 {a b}{ba} {a bba}
n
L1 {a b}
a L2 {ba}
b b a
Union: L1 L2
Concatenation: L1L2
Star: L1 *
HOW?
R
Reversal: L1
Complement: L1
Intersection: L1 L2
Courtesy Costas Busch - RPI 16
Star Operation
NFA for L1 *
L1 *
M1
Courtesy Costas Busch - RPI 17
Example
n w w1w2 wk
NFA for L1* {a b} * wi L1
n
L1 {a b}
a
b
Courtesy Costas Busch - RPI 18
Show Regular languages are closed under
Union: L1 L2
Concatenation: L1L2
Star: L1 *
HOW?
R
Reversal: L1
Complement: L1
Intersection: L1 L2
Courtesy Costas Busch - RPI 19
Reverse
R
NFA for L1
L1 M1 M1
M1
a
n
L1 {a b} b
M1
a
R n
L1 {ba } b
Union: L1 L2
Concatenation: L1L2
Star: L1 *
HOW?
R
Reversal: L1
Complement: L1
Intersection: L1 L2
Courtesy Costas Busch - RPI 23
Complement
L1 M1 L1 M1
M1
n a a, b
L1 {a, b} * {a b}
b a, b
Union: L1 L2
Concatenation: L1L2
Star: L1 *
HOW?
R
Reversal: L1
Complement: L1
Intersection: L1 L2
Courtesy Costas Busch - RPI 26
Intersection
L1 regular
We L1 L2
show
L2 regular regular
Machine M1 Machine M2
DFA for L1 DFA for L2
L ( M ) L ( M1 ) L ( M 2 )
Courtesy Costas Busch - RPI 29
Another Proof for Intersection Closure
DeMorgan’s Law: L1 L2 L1 L2
L1 , L2 regular
L1 , L2 regular
L1 L2 regular
L1 L2 regular
L1 L2 regular
Courtesy Costas Busch - RPI 30
Example
n
L1 {a b} regular
L1 L2 {ab}
L2 {ab, ba} regular regular