How statement and proof provenance work
The first chip identifies the source of the statement or construction; the second identifies the source of its local proof or verification.
- Literature-sourced: the exact statement appears in a cited source; only wording and notation differ.
- AI-adapted: a semantically identical restatement of literature-sourced material, modulo indexing, notation, and boundary cases adopted by the library.
- AI-generated: a genuinely novel statement formulated by AI, with no source for the claim itself.
These labels describe origin, not correctness: citations and verification chips remain separate evidence.
Context-Free Pumping, Ogden's Lemma, and Parsing: Examples and Counterexamples
1 · Prerequisites
- Construction of the Natural Numbers
- Construction of the Real Numbers via Cauchy Sequences
- Construction of the Real Numbers via Dedekind Cuts
- Context-Free Grammars and Normal Forms
- Context-Free Pumping, Ogden's Lemma, and Parsing
- Countability and Uncountability
- Finite Counting, Factorials and Binomial Coefficients
- Formal Languages, Encodings, and Decision Problems
- Foundations of the Real Numbers for Analysis
- Linear Recurrences and Rational Generating Functions
- Pushdown Automata and Context-Free Languages
- Ramsey Theory
- Relations, Functions, and Quotients
- Roots, Rational Powers, and Classical Inequalities
- The ZFC Axioms and the Basic Set Constructions
2 · Summary
These examples show the CFL pumping lemma failing on , run the emptiness and finiteness tests on small grammars, and isolate a non-context-free language that still satisfies the weaker Bar-Hillel pumping condition.
3 · Logical flowchart
4 · Definitions, theorems and proofs
None yet.
5 · Examples, counterexamples and false statements
Using the CFL pumping lemma to rule out
Example
Consider the language
Facts & Assumptions
Given: The language .
By The pumping lemma for context-free languages, every context-free language has a pumping length with the usual decomposition property.
Verification
Assume for contradiction that is context-free, and let be the pumping length from [L1]. Apply the lemma to the word to obtain a decomposition with and .
Because , the substring lies inside one block or crosses only one of the two block boundaries. Pumping and therefore changes at most two of the three symbol counts, so for or the pumped word cannot still have equal numbers of 's, 's, and 's. This contradicts [L1].
Therefore is not context-free.
Running the emptiness and finiteness tests on small grammars
Example
Use the three grammars
Facts & Assumptions
Given: The three displayed grammars.
By CFG emptiness and finiteness are decidable, the emptiness and finiteness questions for CFG's are decidable by generating-variable and dependency-graph tests.
Verification
In , the variable never derives a terminal word, so the start symbol is not generating. The emptiness test from [L1] therefore reports .
In , the dependency graph is acyclic and the grammar generates exactly the three words , , and . So the finiteness test from [L1] reports "finite" on this grammar.
In , the variable lies on a productive cycle through the rule , so the dependency-graph test from [L1] reports infinitude. Indeed is infinite.
These three tiny inputs realize the empty, infinite, and finite outcomes of the theorem.
A non-context-free language can still satisfy the Bar-Hillel pumping condition
Statement refuted
The false statement claims that the ordinary CFL pumping condition characterizes the context-free languages. Put where is a new symbol. The language is a counterexample.
Facts & Assumptions
Given: The language displayed above.
By FALSE: the context-free pumping lemma characterizes the context-free languages, the refuted claim is that satisfying the ordinary pumping condition is equivalent to being context-free.
The proof of Context-free languages are not closed under intersection establishes that is not context free.
PDA's recognize exactly the context-free languages (PDAs recognize exactly the context-free languages), and context-free languages are closed under homomorphic image (Context-free languages are closed under union, concatenation, Kleene star, and homomorphism).
Counterexample
Take pumping length and write a word of as . If , pump the first letter of ; if , pump the initial ; if and is nonempty, pump its first letter. Taking gives , and every pump remains in .
Suppose were context free and let . A product of a PDA for from [L3] with a DFA for the regular language is a PDA for . The homomorphism deleting would then make context free by [L3], contradicting [L2].
If the word is with , pump when and pump when . Pumping never leaves exactly one initial , so every pumped word again lies in . Thus satisfies the ordinary CFL pumping condition.
Hence satisfies ordinary pumping but is not context free, so it refutes the claim in [L1].
Sources
- Alfred V. Aho, COMS W3261 CS Theory, Lecture 10
- H. Conrad Cunningham, CSci 311, Models of Computation, Chapter 8
- David S. Wise, A Strong Pumping Lemma for Context-Free Languages
- Computer Science Stack Exchange, Example of a non-context-free language that nonetheless can be pumped
- ROIFE BLOG, [形式语言] 06 Context-free Language