retagged by
2,097 views
3 votes
3 votes
The following grammar

S$\rightarrow$SS|a|∈

can generate a*... which itself is a regular language but the grammar is neither right linear nor left linear... And we have studied that regular languages are always left or right linear.. Why is there such contradiction....?
retagged by

1 Answer

Best answer
2 votes
2 votes
The above mentioned grammar is context free grammar which is a superset of regular grammar i.e. All regular languages are context free but all context free languages are not regular.  Thus regular grammar can be expressed as cfg.

Hope this help.

Please drop a comment in case of a query.

Thanks
selected by

Related questions

0 votes
0 votes
1 answer
1
Deepak9000 asked Nov 27, 2023
219 views
Why is C is regular as it non regular as?Please help me with this confusion
0 votes
0 votes
1 answer
2
M_Umair_Khan42900 asked Dec 29, 2022
796 views
Show that the following pairs of regular expressions define the same language over the alphabet I = [a, b].s(a) p(pp)*( A + p)q + q and p*q(b) A +0(0+1)* + (0+1)* 00(0+1)...
0 votes
0 votes
2 answers
4
iarnav asked Dec 22, 2018
657 views
WXW^R where W,X belongs to (0,1)*W^R is reverse of a string!