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.
Every context-free language has an equivalent grammar in Greibach normal form
Statement
Every context-free grammar has an equivalent context-free grammar in Greibach normal form.
Facts & Assumptions
Given: A context-free grammar .
By Every context-free language has an equivalent grammar in Chomsky normal form, we may first replace by an equivalent grammar in Chomsky normal form.
If a production is replaced by the family formed from all productions of , then the generated language is preserved, by Substituting a variable's productions into a leading variable occurrence preserves the language.
Eliminating immediate left recursion preserves the generated language, by Eliminating immediate left recursion preserves the language.
Greibach normal form means that every nonexceptional production has the form with leading terminal , by Greibach normal form.
Proof
Replace by an equivalent CNF grammar as in [L1], and order its original variables as . In a forward pass through this list, fix and repeatedly use [L2] to remove every production of the form with . When that is done, use [L3] to eliminate the remaining immediate left-recursive productions , introducing an auxiliary variable if needed. After stage , every production of begins either with a terminal or with an original variable satisfying , and every new production of begins either with a terminal or with an original variable.
In particular, after the forward pass the productions of already begin with terminals, because there is no index . Now argue downward on . Assume the productions of already begin with terminals. Every production of begins either with a terminal or with some having by step 1.1, so repeated use of [L2] substitutes the full terminal-leading production family of each such into the leading occurrence. Thus every production of can also be made terminal-leading without changing the language.
The same downward substitutions clean every auxiliary variable introduced during the left-recursion eliminations. By step 1.1, each production of such a already begins either with a terminal or with an original variable . Once the productions of each are terminal-leading by step 2.1, repeated use of [L2] removes that leading variable from the productions of as well. Therefore, after finitely many substitutions, every production in the whole grammar begins with a terminal, except possibly the start-symbol rule .
Because the construction started from CNF, the symbols after the first terminal in any rewritten production are variables, and the optional start-symbol rule is preserved only in the exceptional case allowed by [L4]. Hence the final grammar is in Greibach normal form, and [L2] and [L3] preserved equivalence throughout.
Depends on
Used by
Nothing in the library uses this result yet.
Dependency tree · two levels
12 results within two dependency steps of this one, each drawn at its shortest distance from it. An arrow runs from a result to what uses it, so the chart reads left to right and ends at this result, which carries a heavier outline. Every node is a link to that result. Click elsewhere on the chart to enlarge it.
Sources
- Jean Gallier and Jocelyn Quaintance, Introduction to the Theory of Computation: Some Notes for CIS511 (standard reference, not scraped)
- CSC444 CFLs and PDAs (standard reference, not scraped)