414 views
4 votes
4 votes
Which of the following is/are correct? (Mark all the appropriate choices)
  1. For any CFG $G$ there's a CFG $G_0$ such that $G_0$ is not ambiguous and $L(G) = L(G_0).$
  2. The CFLs are closed under symmetric difference
  3. Every regular language can be generated by a CFG $G = (V,\Sigma,R,S)$ in which all rules are of the form $A \to aB$ or $A \to \varepsilon$ (where $A,B \in V$ and $a \in \Sigma).$
  4. Regular languages having prefix property can be accepted by a Deterministic Pushdown Automata by empty stack

1 Answer

Best answer
5 votes
5 votes
A is false. For inherently ambiguous languages we cannot have an unambiguous grammar. (An inherently ambiguous CFL cannot be deterministic but a nondeterministic CFL may or may not be inherently ambiguous.)

B is false. For $L_1 - L_2,$ by taking $L_1 = \Sigma^*$ which is regular and hence context-free, we have reduced complement problem to symmetric difference. Now, if symmetric difference is closed for CFG, complement must also be closed which is not the case. So, CFLs are not closed under symmetric difference.

C is true. For every regular language there exists a right linear (and left linear) grammar.
D is true. DPDA accepting by empty stack accepts all DCFLs having prefix property. Regular languages having prefix property is a subset of DCFLs having prefix property. (If a regular language is not having prefix property, it won't be accepted by a DPDA by empty stack)
selected by
Answer:

Related questions

7 votes
7 votes
1 answer
2