- Related Questions & Answers
- 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?
- What are the closure properties of Regular languages?
- Give the examples of a context free language that are not regular?
- Generate a Context-free grammar for the language L = {anbm| m≠n}?
- Explain about CYK Algorithm for Context Free Grammar
- What is context free grammar? Explain with examples
- Generate a CNF for a given context free grammar
- What are free libraries for Canvas in HTML5?
- Convert the given Context free grammar to CNF
- Explain the simplification of context free grammar in TOC
- What is a context sensitive language in TOC?

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

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

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.

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.

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.

Advertisements