8,807 views
13 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 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
Position:
Show:

Related questions

4 4 votes
1 1 answer
8.2k
8.2k views
ankitgupta.1729 asked Dec 31, 2017
8,226 views
Consider the grammar with the following productions.S→aaB/aaCB→bC→cWhich of the following option is true ?(A) The grammar is LL(3)(B) The grammar is LL(1)(C) The grammar ...
0 0 votes
0 0 answers
1.6k
1.6k views
rahul sharma 5 asked Nov 12, 2017
1,574 views
Can LL(k) and LR(k) gammer has null and unit productions?
0 0 votes
1 1 answer
5.8k
5.8k views
rahuldb asked Jan 31, 2017
5,780 views
4.a. Construct the $\mathrm{LL}(1)$ parsing table for the following grammar:[05]\[\begin{array}{l}\mathrm{S} \rightarrow \mathrm{aAC} \mid \mathrm{Bb} \\\mathrm{~A} \righ...
2 2 votes
2 answers 2 answers
4.2k
4.2k views
sripo asked Nov 10, 2018
4,193 views
Can you give an example which is not LL(1) but is CLR(1)