Various Properties of context free languages (CFL)

Context-Free Language (CFL) is a language which is generated by a context-free grammar or Type 2 grammar(according to Chomsky classification) and gets accepted by a Pushdown Automata.

Some very much important properties of a context-free language is:

Regularity- context-free languages are Non-Regular PDA language.

Closure properties :
The context-free languages are closed under some specific operation, closed means after doing that operation on a context-free language the resultant language will also be a context-free language.Some such operation are:

  1. Union Operation
  2. Concatination
  3. Kleene closure
  4. Reversal operation
  5. Homomorphism
  6. Inverse Homomorphism
  7. Substitution
  8. init or prefix operation
  9. Quotient with regular language
  10. Cycle operation
  11. Union with regular language
  12. Intersection with regular language
  13. Difference with regular language

Context free language is not closed under some specific operation, not-closed means after doing that operation on a context-free language the resultant language not remains be a context-free language anymore.



Some such operation are:

  1. Intersection
  2. Complement
  3. Subset
  4. Superset
  5. Infinite Union
  6. Difference, Symmetric difference (xor, Nand, nor or any other operation which get reduced to intersection and complement

Decision Properties:

  1. Test for Membership: Decidable.
  2. Test for Emptiness: Decidable
  3. Test for finiteness: Decidable

Rest the decision properties are undecidable in context-free language.

Deterministic property :
The context-free language can be:

  1. DCFL-Deterministic (which can be recognized by deterministic pushdown automata) context-free language
  2. NDCFL-Non-deterministic (can’t be rcognized by DPDA but NPDA) context free language.

Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.