Consider the language and the following statements.
- is deterministic context-free.
- is context-free but not deterministic context-free.
- is not for any .
Which of the above statements is/are TRUE?
GATE CSE 2020Theory of Computation › Language Classification, Closure Properties & ProofsVerified
(C) Ⅰ and Ⅲ only
Split L into a regular part a* and a DCFL part ${a^n b^n}$, use the closure of DCFL under union with a regular language to settle statements Ⅰ and Ⅱ, then argue about LL(k) lookahead limitations for statement Ⅲ.
L is the union of the regular language a* with the DCFL {aⁿbⁿ}. DCFLs are closed under union with regular languages, so L is deterministic context-free (Ⅰ true, Ⅱ false). No LL(k) parser can distinguish $a^(k+1)$ from $a^(k+1)b^(k+1)$ when n is unbounded, so L is not LL(k) for any k (Ⅲ true). Hence option C.
Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.