In the study of formal languages, Linear Bounded Automata (LBA) and context-sensitive grammars (CSGs) are closely related. An LBA is a computational model that has a space limitation, while a context-sensitive grammar is a formal grammar that generates context-sensitive languages. The relationship between these two concepts is central to understanding the class of context-sensitive languages (CSLs) and their computational properties.
A Linear Bounded Automaton (LBA) is a type of Turing machine with a space restriction: it can only use an amount of tape (memory) that is proportional to the size of the input. Specifically, an LBA is a Turing machine that operates within linear space—the number of tape cells it uses is limited by the size of the input, i.e., the space used is at most a linear function of the input length.
Space Bound: An LBA is restricted to using a tape that is linearly bounded by the input size, meaning the tape can only contain a number of symbols proportional to the length of the input string.
Recognition of Context-Sensitive Languages: The class of languages recognized by LBAs is the same as the class of context-sensitive languages (CSLs). Therefore, an LBA can accept exactly the set of context-sensitive languages.
Decidability: Context-sensitive languages are decidable because LBAs are guaranteed to halt (i.e., they always terminate after a finite number of steps). The halting problem is solvable for LBAs because the space is bounded, making the decision process tractable.
A context-sensitive grammar (CSG) is a formal grammar that generates context-sensitive languages. These grammars have production rules where the length of the right-hand side of a rule is greater than or equal to the length of the left-hand side (i.e., no rule can shorten a string). Context-sensitive grammars are capable of generating languages that cannot be generated by context-free grammars.
This equivalence between context-sensitive grammars and linear bounded automata is a fundamental result in formal language theory and shows that the class of context-sensitive languages is exactly the set of languages that can be recognized by linear bounded automata.
Consider the language , which consists of strings of the form "a's followed by b's followed by c's", where the number of a's, b's, and c's are all equal.
A context-sensitive grammar (CSG) that generates this language might look like this:
In this grammar:
This grammar is context-sensitive because the length of the right-hand side of each production is either equal to or longer than the left-hand side, which ensures that the string is not shortened in any production.
This language can be recognized by an LBA because the LBA would need to check that the number of "a's", "b's", and "c's" are equal and in the correct order, while using only a linear amount of space.
An LBA is a restricted form of a Turing machine. While a general Turing machine has no space restrictions and can use an unlimited amount of tape, an LBA is restricted to using only a linear amount of tape relative to the input size.
Decidability: Context-sensitive languages (CSLs), which are recognized by linear bounded automata (LBAs), are decidable. This means that there is an algorithm that will always determine whether a given string belongs to a context-sensitive language.
Time Complexity: Although context-sensitive languages are decidable, recognizing them (i.e., determining membership of a string in a CSL) can be computationally expensive. The time complexity of an LBA that recognizes a CSL is non-deterministic exponential time in the worst case.
Space Complexity: The space complexity of an LBA is linear in the size of the input, as the LBA can only use a number of tape cells that is proportional to the input length.
Open this section to load past papers