A grammar symbol X (terminal or nonterminal) is useless if there is no derivation of the form S wXy ^ wxy. That is, X can never appear in the derivation of any sentence.  a) Give an algorithm to...


A grammar symbol X (terminal or nonterminal) is useless if there is no derivation of the form S wXy ^ wxy. That is, X can never appear in the derivation of any sentence.

a) Give an algorithm to eliminate from a grammar all productions containing useless symbols.

b) Apply your algorithm to the grammar: S -+ 0 | A A -> AB B -> 1.



May 22, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here