Theory of Computation Reduction-of-Grammar The above Jupyter Notebook file contains the python code to reduces a context free grammar. It has 3 parts: Eliminating Epsilon transitions (if any). Eliminating unused non-terminals and productions. Eliminating unit productions.