All mock tests are FREE till 31 December — register to save your progress
Unit 8 · Theory of Computation and Compilers Paper 2 CS · September 2022

Consider the following statements about context-free languages (CFL):
Statement I: CFLs are closed under homomorphism.
Statement II: CFLs are closed under complement.
Which of the following is correct?

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: A. Statement I is true and Statement II is false

Explanation

CFLs are closed under homomorphism (substitute terminals in the grammar) but not under complement.

More Theory of Computation and Compilers questions