How to create grammar that generates language $L = \{ w \in \{a, b, c\}^* | \#_a(w) = \#_b(w) \cdot \#_c(w) \}$

36 Views Asked by At

I want to know how to create CSG (context sensitive grammar) that generates this language $L$. My idea is that every time when adding another b, add as many a's as the word contains c's and vice versa when adding new c. The main problem for me is to figure out how to know how many c's and/or b's are in the word.