I'm studying free of context grammar using the functional language Prolog. I'm trying to solve this exercise, but I'm in trouble designing a grammar to recognize the language.
We know that the language {aˆn bˆn cˆn | n e N} cannot be recognized by a free of context grammar. Even so, it is possible to recognize this language in Prolog, via attributes. Write a Prolog grammar that recognizes this language.
Could someone help me to write this grammar in Prolog?
The implementation can be found here.
Then the query: