# Closure properties Table in TOC

The Below Table shows the Closure Properties of Formal Languages :

**REG** = Regular Language**DCFL** = deterministic context-free languages, **CFL** = context-free languages,**CSL** = context-sensitive languages,**RC** = Recursive.**RE **= Recursive Enumerable

**Consider L and M are regular languages :**

**The Kleene star –**

∑*, is a unary operator on a set of symbols or strings, ∑, that gives the infinite set of all possible strings of all possible lengths over ∑ including λ.**Kleen Plus –**

The set ∑+ is the infinite set of all possible strings of all possible lengths over ∑ excluding λ.**Complement –**

The complement of a language L (with respect to an alphabet E such that E^{*}contains L) is E*–L. Since E* is surely regular, the complement of a regular language is always regular.**Reverse Operator –**

Given language L, L^{R}is the set of strings whose reversal is in L.**Complement –**

The complement of a language L (with respect to an alphabet E such that E^{*}contains L) is E*–L. Since E* is surely regular, the complement of a regular language is always regular.**Union –**

Let L and M be the languages of regular expressions R and S, respectively. Then R+S is a regular expression whose language is(L U M).**Intersection –**

Let L and M be the languages of regular expressions R and S, respectively, then it is a regular expression whose language is L intersection M.**Set Difference operator –**

If L and M are regular languages, then so is L – M = strings in L but not M.**Homomorphism –**

A homomorphism on an alphabet is a function that gives a string for each symbol in that alphabet.**Inverse Homomorphism –**

Let h be a homomorphism and L a language whose alphabet is the output language of h. h^{-1}(L) = {w | h(w) is in L}.**Substitution –**

substitution is a letter-to-language mapping, which is likewise extended to a string-to-language mapping. By identifying a singleton language {x} to the tx, morphisms are seen as special cases of substitutions.**Left quotient –**Left quotient

The right quotient of L1 with L2 is the set of all strings x where you can pick some y from L2 and append it to x to get something from L1. That is, x is in the quotient if there is y in L2 for which xy is in L1.)

Operations | REG | DCFL | CFL | CSL | RC | RE |

Union | Y | N | Y | Y | Y | Y |

Intersection | Y | N | N | Y | Y | Y |

Set Difference | Y | N | N | Y | Y | N |

Complement | Y | Y | N | Y | Y | N |

Intersection with a Regular Language | Y | Y | Y | Y | Y | Y |

Union with a Regular Language | Y | Y | Y | Y | Y | Y |

Concatenation | Y | N | Y | Y | Y | Y |

Kleene Star | Y | N | Y | Y | Y | Y |

Kleene Plus | Y | N | Y | Y | Y | Y |

Reversal | Y | N | Y | Y | Y | Y |

Epsilon-free Homomorphism | Y | N | Y | Y | Y | Y |

Homomorphism | Y | N | Y | N | N | Y |

Inverse Homomorphism | Y | Y | Y | Y | Y | Y |

Epsilon-free Substitution | Y | N | Y | Y | Y | Y |

Substitution | Y | N | Y | N | N | Y |

Subset | N | N | N | N | N | N |

Left Difference with a Regular Language (L-Regular) | Y | Y | Y | Y | Y | Y |

Right Difference with a Regular Language (Regular-R) | Y | Y | N | Y | Y | N |

Left Quotient with a Regular Language | Y | Y | Y | N | Y | Y |

Right Quotient with a Regular Language | Y | Y | Y | N | Y | Y |

**NOTE :** If we do union, intersection or set difference of any language with regular language, language doesn’t change .

Example

- CFL ∩ Regular is CFL.
- CFL ∪ Regular is CFL.

It’s always a good idea to convert the secondary operations into primary operations.

Let L_{1} and L_{2} be two languages.

**NOTE : For ⊆ , ⊇ , infinite union, infinite intersection, infinite set difference, No language is closed. **

Under these operations, language may or may not be regular.

**Let us consider some cases with concatenation operation :**

- Regular
**.**Regular ⇒ Regular - Regular
**.**Non-Regular ⇒ May or may not be regular - Non-Regular
**.**Non-Regular ⇒ May or may not be regular - If L1 . L2 is regular ⇒ L1 may or may not be regular
- If L1 . L2 is regular ⇒ L2 may or may not be regular
- If L1 . L2 is Non-Regular ⇒ Atleast one of them should be Non-regular.