Context: Grammars are Turing-complete. Therefore complexity classes like NL have equivalences in grammars.
Given a directed graph, deciding if a->b
is a directed path is NL-complete.
We will reduce the directed graph to a grammar rules with one symbol on each side:
For each directed edge in the graph, add a grammar rule. The directed edge a->b
becomes the grammar rule a|b
.
The NL-complete query becomes, "If I set a
to the start symbol, can I derive symbol b
using the grammar rules?"
Each grammar rule has one symbol on each side (i.e. a|b
).
Therefore grammar rules with one symbol on each side is NL-complete.
Are grammars consisting only of rules with one symbol on each side NL-complete?
Related questions:
What complexity class does is this set of grammars? L-complete?