This exercise concerns grammars for very simple languages.
-
Write a context-free grammar for the language
$a^n b^n$ . -
Write a context-free grammar for the palindrome language: the set of all strings whose second half is the reverse of the first half.
-
Write a context-sensitive grammar for the duplicate language: the set of all strings whose second half is the same as the first half.