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.
Pushdown Automata and Context-Free Languages: Examples and Counterexamples
1 · Prerequisites
- Construction of the Natural Numbers
- Context-Free Grammars and Normal Forms
- Countability and Uncountability
- Finite Counting, Factorials and Binomial Coefficients
- Formal Languages, Encodings, and Decision Problems
- Linear Recurrences and Rational Generating Functions
- Pushdown Automata and Context-Free Languages
- Ramsey Theory
- Relations, Functions, and Quotients
- The ZFC Axioms and the Basic Set Constructions
2 · Summary
These examples build the standard PDA for from a grammar, show that the same language is deterministic context-free and unambiguous, and exhibit the looping DPDA that defeats naive state-swapping complementation.
3 · Logical flowchart
4 · Definitions, theorems and proofs
None yet.
5 · Examples, counterexamples and false statements
Building a PDA for from the standard grammar
Example
Start with the grammar
The standard grammar-to-PDA construction produces a one-state PDA whose initial stack symbol is , with -moves replacing by or , and with input-reading moves that match or against the top terminal on the stack.
Facts & Assumptions
Given: The grammar for .
By Every context-free grammar has an equivalent PDA, the standard pop/expand construction turns a CFG into an equivalent PDA that accepts by empty stack.
Verification
On input , the unread-input/stack pairs may evolve as The four input-consuming moves pop the displayed top terminal, while the three other moves expand by , expand it once more, and finally replace it by .
The same pattern works for every word : repeat and immediately read and pop the new top , exactly times; then use and read and pop the remaining symbols . Therefore the constructed PDA recognizes .
This is the standard grammar-to-PDA construction from [L1] on a concrete language.
The language is deterministic context-free and unambiguous
Example
The language is recognized by the DPDA that pushes one stack symbol for each , then pops one for each , rejects any attempt to read an after a , and accepts exactly when the endmarker arrives with only the bottom marker left.
It is also generated by the grammar which is unambiguous.
Facts & Assumptions
Given: The usual stack-matching DPDA and the grammar .
By Deterministic pushdown automata and deterministic context-free languages, a language recognized by such a marked-input DPDA is deterministic context-free.
By Deterministic context-free languages are unambiguous, every deterministic context-free language has an unambiguous grammar.
Verification
The displayed machine is deterministic because before the first it has only the unique push move on , after the first it has only the unique pop move on , and the endmarker is accepted only when the stack has returned to the bottom marker. Therefore it recognizes exactly .
The grammar generates the same language and has exactly one derivation for each word , because the number of leading 's uniquely determines how many times the recursive rule must be used before the final step.
So this language is deterministic context-free, and [L2] is realized concretely by an unambiguous grammar.
A looping DPDA shows naive final-state complementation can fail
Statement refuted
The statement "swapping the accepting states of a DPDA automatically complements its language" is false.
Facts & Assumptions
Given: The one-state -loop DPDA from FALSE: swapping the accepting states of a DPDA automatically complements its language.
The statement refuted is: swapping the accepting states of a DPDA automatically complements its language.
The cited false statement already shows that the original looping DPDA and its state-swapped variant both recognize the empty language, by FALSE: swapping the accepting states of a DPDA automatically complements its language.
Counterexample
The original machine recognizes , because it loops forever on every marked input. After swapping the accepting status of its only state, the machine still has exactly the same infinite computation on every marked input and still recognizes .
But the complement of is the full language , so the swapped machine does not recognize the complement of the original language.
Therefore this looping DPDA is a counterexample to [A1].