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 Grammars and Normal Forms: 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
- Ramsey Theory
- Relations, Functions, and Quotients
- The ZFC Axioms and the Basic Set Constructions
2 · Summary
These examples delete both nongenerating and unreachable symbols from a small grammar, realize the four basic CFL closure constructions on explicit languages, and show that an ambiguous grammar can still generate a language with an unambiguous presentation.
3 · Logical flowchart
4 · Definitions, theorems and proofs
None yet.
5 · Examples, counterexamples and false statements
Removing one nongenerating variable and one unreachable variable
Example
Consider the grammar
The variable is nongenerating, and is generating but unreachable from . Deleting both yields the smaller grammar
which generates the same language .
Facts & Assumptions
Given: The grammar displayed above.
Eliminating useless symbols preserves the generated language, by Eliminating useless symbols preserves the generated language.
Verification
The variable is nongenerating because its only production is , which never removes the variable . The variable is reachable from no sentential form derived from , because no production from , , or mentions .
Every terminal derivation from therefore uses only the variables , , and , and those derivations yield either or . So deleting and leaves the language unchanged.
This is exactly the useless-symbol elimination guaranteed by [L1].
One family of grammars realizing union, concatenation, star, and homomorphism
Example
Let Standard grammars for them are
Then:
- is generated by ,
- is generated by ,
- is generated by ,
- if and , then .
Facts & Assumptions
Given: The two grammars for and , and the alphabet map with and .
Context-free languages are closed under union, concatenation, Kleene star, and homomorphism, by Context-free languages are closed under union, concatenation, Kleene star, and homomorphism.
Verification
The bridge rules and give the listed grammars for the union and concatenation constructions, and the rule lists any finite concatenation of words from .
Replacing each terminal by and each terminal by turns the grammar for into one for , which is exactly .
These concrete constructions realize all four closure operations asserted in [L1].
An ambiguous expression grammar with an unambiguous grammar for the same language
Statement refuted
The statement "an ambiguous CFG always generates an inherently ambiguous language" is false.
Facts & Assumptions
Given: The ambiguous expression grammar and the precedence grammar
The statement refuted is: every ambiguous CFG generates an inherently ambiguous language.
A context-free language is inherently ambiguous exactly when every context-free grammar generating it is ambiguous, by Ambiguous grammars, unambiguous grammars, and inherently ambiguous languages.
Counterexample
The first grammar is ambiguous because the word has both the parse and the parse .
The second grammar generates the same terminal strings as the first. One inclusion follows by simultaneous induction on its -, -, and -derivations, since every displayed production can be simulated by the first grammar. For the reverse inclusion, scan a generated word at parenthesis depth zero: split at its rightmost top-level + if one exists, otherwise at its rightmost top-level * if one exists, and otherwise recognize the forced factor , , or . Induction on word length gives a derivation in the second grammar. The same decomposition is unique: the -rule forces the rightmost top-level +, the -rule forces the rightmost top-level *, and the outer symbols force the -rule. Hence the second grammar is unambiguous and, in particular, has only the parse .
By [L1], a language with an unambiguous grammar is not inherently ambiguous. Therefore the first grammar is a counterexample to [A1].