GATE Computer ScienceVery hardGATE CS (PYQ pattern)

Which of the following statements about deterministic context-free languages (DCFLs) are correct? I. The complement of a DCFL is a DCFL. II. The union of two DCFLs is always a DCFL. III. The intersection of a DCFL with a regular language is a DCFL. IV. The reversal of a DCFL is always a DCFL.

  1. A. I, II and III only
  2. B. II and IV only
  3. C. I, III and IV only
  4. D. I and III only

Correct answer: D. I and III only

DCFLs are closed under complement and under intersection with regular languages; they are not closed under union (their union can be the non-deterministic {aⁱbʲcᵏ : i = j or j = k}) nor under reversal.

More Theory of Computation questions

Exams that ask this topic