Menu

© 2025 369 Tesla Private Limited

All Rights Reserved

Linear Bounded Automata

Explore context-sensitive languages with space-bounded Turing machines

Linear Bounded Automata Simulator

Simulate linear bounded automata for context-sensitive languages

Linear Bounded Automata Simulator 🔒

Explore context-sensitive languages with space-bounded Turing machines

LBA Configuration

Examples:

Bounded Tape

LBA can only use space between endmarkers ⊢ and ⊣ (linear in input size)

Transition Function

δ(q0, a) = (q1, X, R)
δ(q1, a) = (q1, a, R)
δ(q1, b) = (q2, Y, R)
δ(q2, b) = (q2, b, R)
δ(q2, c) = (q3, Z, L)
δ(q3, b) = (q3, b, L)
δ(q3, Y) = (q3, Y, L)
δ(q3, a) = (q3, a, L)
δ(q3, X) = (q0, X, R)
δ(q0, Y) = (q4, Y, R)
δ(q4, Y) = (q4, Y, R)
δ(q4, Z) = (q5, Z, R)
δ(q5, Z) = (q5, Z, R)
δ(q5, ) = (qaccept, , S)
δ(q0, b) = (qreject, b, S)
δ(q0, c) = (qreject, c, S)
δ(q1, c) = (qreject, c, S)
δ(q2, a) = (qreject, a, S)

Context-Sensitive Properties

Language: Recognizes {aⁿbⁿcⁿ | n ≥ 1} - equal numbers of a's, b's, and c's

Complexity: O(n) space, O(n²) time

Space Bound: Uses only O(n) tape cells (linear in input size)

Context-Sensitive: More powerful than context-free languages

Endmarkers: Cannot move beyond ⊢ (left) and ⊣ (right) boundaries

Decidable: All context-sensitive languages are decidable

Position in Computational Hierarchy

REG

Regular

DFA/NFA

CFL

Context-Free

PDA

CSL

Context-Sensitive

LBA

RE

Recursively Enum.

Turing Machine

LBAs recognize exactly the context-sensitive languages - more powerful than PDAs but less than unrestricted Turing machines

Context-Sensitive Language Examples

aⁿbⁿcⁿ

Equal numbers of three different symbols

Classic CSL example

w#w

String duplication with separator

Copy language

Type Checking

Variable declaration and usage

Programming languages

Palindromes

Strings that read same forwards/backwards

Linear space solution

Natural Language

Some aspects of human language syntax

Computational linguistics

Indexed Languages

Languages with stack + finite control

Between CFL and CSL