Recent questions tagged context-free-grammar

456
views
1 answers
4 votes
Consider the following context-free grammar, with start symbol $S$ and terminals $a, ; , \lt , \gt .$ ... many different parse trees are there for the string $\lt \lt a \gt ;a\gt ?$
750
views
2 answers
5 votes
Which one of the following context-free grammars is unambiguous? (Note that $a, b, c,(,),+$ are terminals, $S, X, Y$ are nonterminals, and the start symbol in each case ... $S \rightarrow \epsilon|(S)| S$
427
views
2 answers
3 votes
Can anyone explain $\overline{ww}$ is $CFL$ or $CSL$ And if $CFL$ can you write the equivalent $CFG$ for this ?
415
views
2 answers
1 votes
Consider the following statements:(A) LL (k) grammars have one to one correspondence with DCFLs.(B) LR (k) grammars have one to one correspondence with CFLs. A is true but B is falseA is false but B is trueBoth are FalseBoth are True
600
views
1 answers
0 votes
Is the following language CFL :{ ww | w in (a+b)* and |w| <1000 }
550
views
1 answers
0 votes
Is the following language context free:The set of all strings with number of a’s equal to number of b’s and the sum of a’s and b’s to be divisible by 3.
296
views
0 answers
0 votes
{M ∈ {a,b}∗ | M contains at least three bs} {N ∈ {a,b}∗ | N has an odd length and a is in the middle always}
294
views
1 answers
0 votes
S→ aS | bS | epsilonwhat is the language generated by this grammar ?
302
views
2 answers
0 votes
what is the langauge generated by this grammar ?S-->aS | aSbS | ε what is the language
530
views
1 answers
0 votes
Consider a situation, where the input buffer is still having elements, and our PDA has reached final state. Given that for next input element the final ... if empty stack acceptance is allowed in the given PDASomething else, I can explain
299
views
0 answers
1 votes
A context-free grammar is in Chomsky Normal Form if every rule is of the form\[\begin{array}{l}A \longrightarrow B C \\A \longrightarrow a\end{array}\]where ... A \longrightarrow B \mid S \\B \longrightarrow b \mid \varepsilon\end{array}\]
236
views
0 answers
0 votes
Find context-free grammars for the following languageL = { w : na(w) = 2nb(w); where w belongs {a, b}*}
376
views
1 answers
0 votes
Find context-free grammars for the following languageThe complement of the language L = belongs {a^n, b^n}
358
views
1 answers
0 votes
Are these two grammars equal?1->-------------------S->X|epsilonX->BBX|epsilonB->a|b2->------------S->AAS|epsilonA->a|b