Question: CFG/PDA Question - (Context Free Grammar) - I need to create a grammar for the Language L = {a n b n +m c m
CFG/PDA Question - (Context Free Grammar) - I need to create a grammar for the Language L = {anbn +mcm, n
0, m
1 }
I tried something like
S -> aC | bD
C -> aC|bD
D -> bD | cE
E -> cE | c
This works for the correct number of variables i.e. abbbcc, but also works for the incorrect number of variables. i.e. aabbbcc when it should not. How do I design the grammar to only produce the correct strings?
Also, I need to construct a PDA for this same scenario. (we use JFLAP, but any diagram explaining would help me)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
