Equivalence of Linear-bounded Automata and Context-sensitive Grammars
we now show that LBA's and CSG's are equivalent in the sense that the LBA's accept exactly the CSLs except for the fact that an LBA can accept
while a CSG cannot generate
, that is, L = L ( M ) for some CSG G. The result is shown by proving the following two theorems.
Theorem : If L is a context-sensitive language, then L is accpeted by one LBA M.
Proof : Since L is a CSL, L = L(G) for some CSG G =(N,
, P, S). We now construct an LBA M with a two-track tape to simulate the derivatives of G. The first track holds the input string (including the end markers) while the second track holds the sentential form generated by the simulated derivation. On input <w> on its tape a computation of the LBA M consists of the following sequence of steps.
- The LBA writes the (start) symbol S of G on the second track below the leftmost symbol of w.
- If w =
the LBA halts without accepting.
- The LBA nondeterministically selects a production
and a position in the sentential form written on the second track.