How do you write the CFG for the following language:
{ax by c ax+y}
Is there some formula or rules I need to follow? An explanation will be so appreciated.
What I tried is:
First I broke ax+y into axay which gives:
{ax by c axay}
Then
S ---> aSa | B
B ---> bB | c
The problem I am facing now is how to include ay.