V is
a distinguished element of V called the start symbol.
Y
where
(V
T)
:
X is a member of the set of strings composed of
any mixture of variables and terminal symbols,
but X is not the empty string.
(V
T)
:
Y is a member of the set of strings composed of
any mixture of variables and terminal symbols;
Y is allowed to be the empty string.
Suppose w is a string that can be written as uxv, where
T)
T)
y
uyvNotation:
T :
S derives T (or T is derived from S) in exactly one step.
T :
S derives T in zero or more steps.
T
with S
w.
x
where
A
V, and
x
(V
T)*.
Theorem: A language is context-free if and only if it is recognized by a (nondeterministic) pushdown automaton.
Deterministic pushdown automata are somewhat less expressive.
A context-sensitive grammar is one whose productions
are all of the form
xAy
xvy
where A
V and
x, v, y
(V
T)*.
A context-sensitive language is a language generated by a
context-sensitive grammar.
The name "context-sensitive" comes from the fact that the actual
string modification is given by A
v,
while the x and y provide the context in which the rule may be applied.
A Turing machine has an infinite supply of blank tape. A linear-bounded automaton (LBA) is a Turing machine whose tape is only kn squares long, where n is the length of the input string and k is a constant associated with the particular linear-bounded automaton.
Some textbooks define an LBA to use only the portion of the tape that is occupied by the input; that is, k=1 in all cases. That definition leads to an equivalent class of machines, because we can compensate for the shorter tape by having a larger tape alphabet.
Theorem: A language is context-sensitive if and only if it is recognized by a nondeterministic linear bounded automaton.
Deterministic linear bounded automata are somewhat less expressive.