What is Greibach normal form (GNF)?
19 views
- A normal form for context-free grammars that allows only left-recursive production rules
- A normal form for context-free grammars that allows only right-recursive production rules
- A normal form for context-free grammars that allows only production rules of the form A → aB or A → a
- A normal form for context-free grammars that allows only production rules of the form A → aα, where α is a string of symbols (Correct Answer)
Explanation
Answer: d) A normal form for context-free grammars that allows only production rules of the form A → aα, where α is a string of symbols.
Explanation: Greibach normal form (GNF) is a normal form for context-free grammars, where all production rules have the form A → aα, where A is a nonterminal symbol, a is a terminal symbol, and α is a string of symbols that can include both terminals and nonterminals. Additionally, the first symbol of α must be a nonterminal symbol. GNF has some advantages over CNF in terms of efficiency and simplicity of the parsing algorithm.