0% found this document useful (0 votes)
22 views29 pages

8 Regular Properties

The document discusses the properties of regular languages, demonstrating that they are closed under operations such as union, concatenation, star, reversal, complement, and intersection. It provides examples of constructing NFAs for these operations and explains transformations like using a single accept state. Additionally, it illustrates how to prove the intersection closure of regular languages using DFAs that simulate both languages in parallel.

Uploaded by

angel.pari.mudit
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views29 pages

8 Regular Properties

The document discusses the properties of regular languages, demonstrating that they are closed under operations such as union, concatenation, star, reversal, complement, and intersection. It provides examples of constructing NFAs for these operations and explains transformations like using a single accept state. Additionally, it illustrates how to prove the intersection closure of regular languages using DFAs that simulate both languages in parallel.

Uploaded by

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

Properties of

Regular Languages
For regular languages L1 and L2
we will prove that:

Union: L1  L2

Concatenation: L1L2

Star: L1 * Are regular


Languages
Reversal: L R
1

Complement: L1
Intersection: L1  L2
We say: Regular languages are closed under

Union: L1  L2

Concatenation: L1L2

Star: L1 *

Reversal: L R
1

Complement: L1
Intersection: L1  L2
A useful transformation: use one accept state

NFA
a
b 2 accept states
a
b

Equivalent
NFA
a
1 accept state
a b

b 

In General
NFA

Equivalent NFA
 Single
 accepting

state
Extreme case

NFA without accepting state

Add an accepting state


without transitions
Take two languages

Regular language L1 Regular language L2

L  M 1   L1 L  M 2   L2

NFA M1 NFA M 2

Single accepting state Single accepting state


Example

M1
n0
a
n
L1  {a b} b

M2

L2  ba b a
Union
NFA for L1  L2
M1

 M2
Example
n
NFA for L1  L2  {a b}  {ba}
n
L1  {a b}
a
b

 L2  {ba}
b a
Concatenation

NFA for L1L2

M1 M2

Example

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

n
L1  {a b}
a
L2  {ba}
b  b a
Star Operation
NFA for L1 * w  w1w2  wk
 wi  L1
M1
  L1 *
 


Example

n
NFA for L1*  {a b} *


n
L1  {a b}
a
 b 


Reverse
R
NFA for L1

L1 M1 M1

1. Reverse all transitions

2. Make initial state accepting state


and vice versa
Example

M1
a
n
L1  {a b} b

M1
a
R n
L1  {ba } b
Complement

L1 M1 L1 M1

1. Take the DFA that accepts L1

2. Make accepting states non-final,


and vice-versa
Example

M1
a a, b
n
L1  {a b} b a, b

M1
n a a, b
L1  {a , b} * {a b}
b a, b
Intersection

L1 regular
We show L1  L2
L2 regular regular
DeMorgan’s Law: L1  L2  L1  L2

L1 , L2 regular

L1 , L2 regular

L1  L2 regular

L1  L2 regular
L1  L2 regular
Example

n
L1  {a b} regular
L1  L2  {ab}
L2  {ab , ba} regular regular
Another Proof for Intersection Closure

Machine M 1 Machine M 2
DFA for L1 DFA for L2

Construct a new DFA M that accepts L1  L2

M simulates in parallel M 1 and M 2


States in M

qi , p j

State in M 1 State in M 2
DFA M 1 DFA M 2

q1 a q2 p1 a p2
transition transition

DFA M

q1 , p1 a q2 , p2
New transition
DFA M 1 DFA M 2

q0 p0
initial state initial state

DFA M

q0 , p0
New initial state
DFA M 1 DFA M 2

qi pj pk

accept state accept states

DFA M
qi , p j qi , pk

New accept states

Both constituents must be accepting states


Example:

n0 m0
n m
L1  {a b} L2  {ab }
M1 M2
a b
q0 b q1 p0 a p1

a, b b a
q2 p2
a, b a, b
Automaton for intersection
L  {a nb}  {ab n }  {ab}
a, b

q0 , p0 a q0 , p1 b q1, p1 a q2 , p2

b a b a
q1, p2 b q0 , p 2 q2 , p1

a b
a, b
M simulates in parallel M 1 and M 2

M accepts string w if and only if:


M 1 accepts string w
and M 2 accepts string w

L(M )  L(M1)  L(M 2 )

You might also like