All mock tests are FREE till 31 December — register to save your progress
Unit 8 · Theory of Computation and Compilers Paper 2 CS · December 2022 Shift 2

What is the safest order for simplifying a context-free grammar?

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: A. Elimination of ε-productions, unit productions, and then useless symbols and productions

Explanation

Removing ε-productions can create unit productions, and removing both can leave useless symbols. So the order is ε → unit → useless.

More Theory of Computation and Compilers questions