- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

# What are the closure properties for context free language?

The closure properties for context free language (CFG) are as follows −

## Closed under Union Operation

n order to show that context-free language is closed under union operation, consider two starting variables S1 and S2 for the two different languages L1 and L2.

Grammar for union operation is as shown below −

S ->S1|S2

If both the languages belong to the context free language then union of both the languages should belong to context free language.

By the above definition if a user generates S1 and S2 string or both then in that case union of both the language is generated.

Hence, L1 U L2 ∈ CFL

So, context free language is closed under union operation.

## Closed under Concatenation

In order to show that context free language is closed under concatenation, the operation considers two starting variables S1 and for the two different languages L1 and L2.

Grammar for union operation is as shown below −

S->S1S2−

If both the language belongs to the context free language then concatenate one of both the language should belong to context free language.

∀L_{1}L_{2}∈CFL

{W_{1}W_{2}:W_{1}∈L_{1}∈ΛW_{2}∈L_{2}}∈CFL

By the above definition if a user generates S1 string for language L1 followed by S2 string of language. Then, its concatenation of both languages is generated.

Hence, the result is as follows −

{W_{1}W_{2}:W_{1}∈L_{1}∈ΛW_{2}∈L_{2}}∈CFL

So, context free language is closed under concatenation operation.

## Closed under Star operation

In order to show that context free language is closed under star operation. Consider one start variable S1 for the languages L1

Grammar for union operation is as shown below −

S->S1S| ∈

If the language belongs to the context free language then the star of the language should belong to the context free language.

∀L_{1}∈CFL

By the above definition, if the user generates zero or many strings which is the definition of the star. So, context free language is closed under star operation.

- Related Articles
- Explain the context free language closure under concatenation?
- Explain the context free language closure under union operation?
- Explain Pumping lemma for context free language
- How to generate the language for context free grammar?
- Explain about pumping lemma for context free language?
- Generate a Context-free grammar for the language L = {anbm| m≠n}?
- Give the examples of a context free language that are not regular?
- What are the closure properties of Regular languages?
- What is Context-Free Grammar?
- Explain about CYK Algorithm for Context Free Grammar
- Generate a CNF for a given context free grammar
- What is context free grammar? Explain with examples
- Convert the given Context free grammar to CNF
- What is a context sensitive language in TOC?
- Explain the simplification of context free grammar in TOC