Yesterday i did my exam of formal languages and there was a question which asked you to recognize what type of language was this:
X={a,b,c}
L={w€X*|#(a,w) + #(c,w) = 3n, n>=0}
where #(x,w)
is the number of occurency of the symbol x€X
in the word w€X*
Now, I have demonstrate with the pumping lemma of CF languages (uvwxy theorem) that that isn't a CF language, so it should be a context sensitive language, but now I'm not as sure as I was yesterday because it could be a CF language because I can barely immagine a PDA that recognize this.
My question is, how do I recognize what type of language is when someone give me one?I know that I can create a grammar for it but if I can't create one doesn't implies that it doesn't exist one. I want to know if there is a method to understand the nature of the language so that I can demonstrate with the right tools that it is in fact that type. Hope someone can help me.