2,240 views
1 votes
1 votes
a) language accepted by a CFG(Context free grammar) is nonempty.

is it D or UD?

2 Answers

Best answer
5 votes
5 votes

First consider this problem

Given a CFG G, does L(G) is $\phi$???

This problem is decidable, i.e. we have an algorithm to find whether L(G) is empty or not.

How?

Just check whether $S$ (starting symbol of the grammar) is useless or not. If it is useless then it means that it never generates a string, or we can say that it never terminates to a string of terminals. If $S$ is useless, it signifies that L(G) is empty. And if it is useful, then it means $S$ is not empty.

So, we have an algorithm to check if L(G) is not empty. Hence given a CFG G, is L(G) not empty? -  is decidable.

https://cseweb.ucsd.edu/classes/fa01/cse105_B/lec15seq.pdf

https://drona.csa.iisc.ernet.in/~deepakd/atc-2011/tm-cfl-undecidable.pdf

selected by
0 votes
0 votes
its DECIDABLE

because if we perform operation like eliminating epsilon,UNIT productions ,UNREACHABLE productions,from the grammer

and finally after  doing this stuff  if we find that START SYMBOL was  UNREACHABLE  then we can say that its is DECIDABLE

Related questions

1 votes
1 votes
1 answer
1
learner_geek asked Aug 15, 2017
1,424 views
Is complement of language same type or not decidable by CFL and recursive language or not???Grammar is ambiguous or not?Grammar in regular/CFL/rel decidable or not?
3 votes
3 votes
2 answers
2
amrendra pal asked Aug 22, 2017
1,072 views
C = { <G,k | G is a CFG and L(G) contains exactly k strings where k>=0 or k=∞ } . Then C will be-a) decidableb) Turing unrecognizablec) Recursive enumerabled) undecidab...