So, I have an excersiceexercise in which I have to write thea context free grammar for this language:
L = {x ∈ L(a∗b∗c∗) : |x|a > |x|c; |x|b > 0; |x|c ≥ 0},$$L = \{x \in L(a^∗b^∗c^∗) : |x|_a > |x|_c; |x|_b > 0; |x|_c ≥ 0\}$$
meaning every string with any number of a's$a$'s, b's$b$'s and c's$c$'s in that order, with the amount of a's$a$'s greater thatthan the amount of c's$c$'s and the amount of b's$b$'s greater than zero.
I am having trouble figuring out the rule that makes sure that the a'sthere are more $a$s than the c's$c$s.
I have:
S -> aABC | ab
A -> aA | a
B -> bB | b
C -> cC | c
I $$\begin{align}S&\to aABC | ab\\ A&\to aA | a\\ B&\to bB | b\\ C&\to cC | c\\ \end{align}$$ I know this is wrong because I sholudshould be adding an a everytime$a$ every time I add a c$c$, but I don't know how to write that.