Professional Documents
Culture Documents
Closure Properties of Regular Languages
Closure Properties of Regular Languages
Languages
• Union
• Concatenation
• Kleene Closure
• Intersection
• Difference
• Complement
• Reversal
• Homomorphism
• Inverse Homomorphism
Closure Properties
• A closure property ascertains that “an operation on
languages that belong to a class (e.g., Regular
languages), produces a result that is also in that same
class”
Proof
Let L be regular language represented by regular expressions R
Proof
Let L be regular language represented by regular expressions R
Proof
Let L be a regular language represented by regular expression R
Proof
Let A be DFA whose language is L
Let B be DFA whose languages is M
0, 1 1
1 1
0
0
1 [B,C] [B,D]
0
1
0
C D
1
Closure under DIFFERENCE
Statement: If L and M are regular languages, so will be L - M
Proof
Let A be DFA whose language is L
Let B be DFA whose languages is M
Final states of C will be the pairs be the pairs where A-state is final but B-
state is not.
Example: Product DFA for Difference
0
0
1 0
A B [A,C] [A,D]
0, 1 1
1 1
0
0
1 [B,C] [B,D]
0
1
0
C D
1
Closure under COMPLEMENT
Statement:If L is a regular language, so will be 𝐿ത .
Proof
Complement of a language w.r.t. alphabet Σ is Σ* - L.
Proof
Let E be the regular expression of L.
Or
h(a) = 0; h(b) = 11;
h(abbab) = 01111011.
Closure under HOMOMORPHISM
Statement: If L is a regular language, and h is a
homomorphism on its alphabet, then
h(L) = {h(w) | w ∊ L} is also a regular language.
Proof
Let A be an automata that accepts L.
Construct A’ such that:
- Every transition of A is replaced by h(a).
- Introduce intermediate states wherever
|h(a)| > 1.
- Start and final states of A and A’ are same
Example of homomorphism
Let h(0) = ab; h(1) = ε.
Let L be the language of regular expression 01* + 10*.
a 1 Since
B B h(1) = ε
1
a
A b A 0
b
b 0 Since
C C h(0) = ab
a
1, 0
h(0) = ab
h(1) = ε
Decision Properties
A language can be represented in two ways:
i. Formal – with a RE or DFA.
ii. Informal – with a prose statement
e.g. L = {w | w starts with ‘aba’} over Σ = {a,b}
Or L contains strings that have even no. of 0’s
and odd no. of 1’s.