Concept

Ogden's lemma

In the theory of formal languages, Ogden's lemma (named after William F. Ogden) is a generalization of the pumping lemma for context-free languages. We will use underlines to indicate "marked" positions. Ogden's lemma is often stated in the following form, which can be obtained by "forgetting about" the grammar, and concentrating on the language itself: If a language L is context-free, then there exists some number (where p may or may not be a pumping length) such that for any string s of length at least p in L and every way of "marking" p or more of the positions in s, s can be written as with strings u, v, w, x, and y, such that vx has at least one marked position, vwx has at most p marked positions, and 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 . The special case of Ogden's lemma is often sufficient to prove some languages are not context-free. For example, is a standard example of non-context-free language (, p. 128). Similarly, one can prove the "copy twice" language is not context-free, by using Ogden's lemma on . And the given example last section is not context-free by using Ogden's lemma on . Ogden's lemma can be used to prove the inherent ambiguity of some languages, which is implied by the title of Ogden's paper. Example: Let . The language is inherently ambiguous. (Example from page 3 of Ogden's paper.) Similarly, is inherently ambiguous, and for any CFG of the language, letting be the constant for Ogden's lemma, we find that has at least different parses. Thus has an unbounded degree of inherent ambiguity. The proof can be extended to show that deciding whether a CFG is inherently ambiguous is undecidable, by reduction to the Post correspondence problem. It can also show that deciding whether a CFG has an unbounded degree of inherent ambiguity is undecidable.

About this result
This page is automatically generated and may contain information that is not correct, complete, up-to-date, or relevant to your search query. The same applies to every other page on this website. Please make sure to verify the information with EPFL's official sources.

Graph Chatbot

Chat with Graph Search

Ask any question about EPFL courses, lectures, exercises, research, news, etc. or try the example questions below.

DISCLAIMER: The Graph Chatbot is not programmed to provide explicit or categorical answers to your questions. Rather, it transforms your questions into API requests that are distributed across the various IT services officially administered by EPFL. Its purpose is solely to collect and recommend relevant references to content that you can explore to help you answer your questions.