909 views
2 votes
2 votes
How to find that wether the perticular given grammar is CSL or not... what is the basic method used for that... like any language given and it is asked wether its cfl, csl or dcfl... how to check for CSL?? please provide proper explaination and example for that.

1 Answer

3 votes
3 votes
For regular lang - if u r able to write a regular expression or DFA is possible

For DCFL-  No. Of push and pop should be clear

ex-a^4b^4

Here for a we will do push and for b will do pop . So push and pop are clear here

but when double comparison with or on different variable then it wont be dont by DPDA.

Ex. (a^n b^m c^p)and either n should be greater than m OR m should be less than p

Here Dpda will not work  but Npda will do it  so it is CFL BUT NOT DCFL.

CSL-

(a^n b^n c^n ) and n is greater then eqal to 0

now 3 comparison so pda has 1 stack and it has 2 comparision . For making all 3 equal   2 stack is needed.

Bcz for a do push,for b do pop and if we get stack empty that means eqal no of a and b  but for making c equal we have nothing in stack .

Related questions

3 votes
3 votes
1 answer
1
Meenakshi Sharma asked Aug 4, 2016
1,077 views
how to find an infinite language is regular or not is there any other method than drawing DFA as DFA made by us may or may not be correct how to ensure DFA is correct an...
0 votes
0 votes
1 answer
2
sumit kumar asked Jun 22, 2015
8,009 views
my question is whether we have a shortcut an idea which can help us in recognizing any language to be regular or not,in GATE .and also what is the best way to get it prop...
3 votes
3 votes
0 answers
3
VS asked Jan 20, 2018
568 views
L={ (an)m bn | n,m>=1 }