Ogden's lemma


In the theory of formal languages, Ogden's lemma is a generalization of the pumping lemma for context-free languages.

Statement

Ogden's lemma states that if a language is context-free, then there exists some number such that for any string of length at least in and every way of "marking" or more of the positions in, can be written as
with strings and, such that
  1. has at least one marked position,
  2. has at most marked positions, and
  3. for all.
In the special case where every position is marked, Ogden's lemma is equivalent to the pumping lemma for context-free languages. Ogden's lemma can be used to show that certain languages are not context-free in cases where the pumping lemma is not sufficient. An example is the language.
Ogden's lemma can also be used to prove the inherent ambiguity of some languages.

Generalized condition

Bader and Moura have generalized the lemma to allow marking some positions that are not to be included in. Their dependence of the parameters was later improved by Dömösi and Kudlek. If we denote the number of such excluded positions by, then the number of distinguished positions of which we want to include some in must satisfy, where is some constant that depends only on the language. The statement becomes that every can be written as
with strings and, such that
  1. has at least one distinguished position and no excluded position,
  2. has at most distinguished positions, and
  3. for all.
Moreover, either each of has a distinguished position, or each of has a distinguished position.