11. Context-Free Grammars
11.1. Chomsky Normal Form
Write the following grammars in CNF:
11.1.1
$ S \leftarrow ABC \\ A \leftarrow aAb \mid \epsilon \\ B \leftarrow bBc \mid bc \\ C \leftarrow cC \mid c $
11.1.2
$ S \leftarrow 0SA \mid ASB \\ A \leftarrow 0BA \mid 1S \mid 0A \\ B \leftarrow B1 \mid 0B \mid 1 \mid 0 $
11.2. Regular Grammars
11.2.1 Give an example of a regular grammar that generates $ L(1^*0^*) $.
11.3. DFA to Regular Grammar
11.3.1 For each of the following DFAs, algorithmically create a regular grammar that generates the same language.
11.4. Short Exercises
11.4.1 Can a regular Grammar be in Chomsky Normal Form?
11.4.2 Write an algorithm that verifies whether or not a Regular Grammar generates an infinite language.
11.4.3. Prove that any DFA can be converted to a regular grammar.
11.4.4. Is there a decidable algorithm to remove ambiguity from regular grammars?
11.4.5. Show the following grammar is ambiguous: $ S \leftarrow aSbS | bSaS | \epsilon $. Write a non-ambiguous equivalent.