5,301 views
13 votes
13 votes

1. LL(k) grammars have one to one correspondance with DCFL's

2. LR(k) grammars have one to one correspondance with CFL's

Which of them is True and explain it bit clearly? 

2 Answers

Best answer
13 votes
13 votes

1st one is false.....for every LL(1) we can have DCFL but not converse...and hence one to one correspondance is not satisfied(thankyou saurabh)
also we have one to one correspondence of DCFL with LR(k) ..so for every DCFL we can have a LR(k) grammar and vice versa..

Ex : Take a DCFL L = $a^mb^{m+n} | m\geq n$ . Now this language is DCFL, but there is no LL(K) for it .

Ex : Take another DCFL L = $a^n \bigcup a^n b^n$ . Now this language is again DCFL, but there is even no LL(K) for it (thankyou kapil fr the examples)



n second statement is saying CFL not DCFL...so chance is there that ur CFL might be inherently ambiguous(means nt having nt even a single unambiguous grammar)..for CFL we have one to one correspondance with CFG not LR(k)..so second is false..


Hence, both are false..

selected by

Related questions

4 votes
4 votes
1 answer
1
0 votes
0 votes
0 answers
2
rahul sharma 5 asked Nov 12, 2017
1,122 views
Can LL(k) and LR(k) gammer has null and unit productions?
2 votes
2 votes
1 answer
4
sripo asked Nov 10, 2018
3,252 views
Can you give an example which is not LL(1) but is CLR(1)