I want to find the CFG for this a^n b^3m c d^m e f^2n with m, n > 0
What I have so far
S -> A B C
A -> a A ff
B -> bbb B d
C -> c e
Does this make any sense?
I want to find the CFG for this a^n b^3m c d^m e f^2n with m, n > 0
What I have so far
S -> A B C
A -> a A ff
B -> bbb B d
C -> c e
Does this make any sense?
On
Your grammar so far allows the c to come after the d which violates the rules.
The following should work
S = a S ff | a bbb B d e ff
B = bbb B d | c
The first rule guarantees, that for every a in the beginning there are two f in the end. It enforces at least one a. The second half enforces the sequence d e ff....
The second rule enforces the correct number of b and d and also that the single c is between the bs and the cs
I think that this is the grammar: