Next: , Previous: , Up: Terms   [Contents][Index]


5.6 Useless rules

If any derivation from the start symbol uses a rule, that rule is called reachable or accessible. A rule that is not accessible is called unreachable or inaccessible. A symbol is reachable or accessible iff it appears in a accessible rule. If a symbol is not accessible, it is unreachable or inaccessible.

If any derivation which results in a sentence uses a rule, that rule is said to be productive. A rule that is not productive is called unproductive. A rule is productive iff every symbol on its RHS is productive. An empty rule is productive, vacuously.

A symbol is productive iff it is a terminal or it is the LHS of a productive rule. A symbol that is not productive is called unproductive.

These definitions imply that all nullable rules are productive. They also imply that every nullable symbol is productive, because every nullable symbol must be on the LHS of a nullable rule.

A rule which is inaccessible or unproductive is called a useless rule. A symbol which is inaccessible or unproductive is called a useless symbol. Marpa can handle grammars with useless rules and symbols.