In formal language theory, the Ogden lemma provides an extension of the flexibility of the sprawl lemma for context-free languages .
Ogden's lemma states that if the language L is context-free, then there exists a number p > 0 (where p may or may not be the pump length), such that for any string w of length at least p from L and for any markups » p or more positions in w , w can be represented as
- w = uvxyz
where u , v , x , y , and z are strings such that
- x contains at least one marked position,
- either u and v contain the marked position, or both y and z contain it,
- vxy contains at most p marked positions, and
- uv i xy i z belongs to L for any i ≥ 0.
The Ogden lemma can be used to prove that a given language is not context-free, in cases where the expansion lemma is not enough for context-free languages . An example would be the language { a i b j c k d l : i = 0 or j = k = l }. It is also useful for proving the substantial ambiguity of some languages.
Note that if all positions are marked, this lemma is equivalent to the pumping lemma for context-free languages.
See also
- Overgrowing lemma for context-free languages
- Sprawl lemma