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.
Eliminating immediate left recursion preserves the language
Statement
Suppose the productions of a variable in a context-free grammar are exactly where none of the words begins with . Introduce a fresh variable and replace those productions by leaving every other production unchanged.
Then the resulting grammar generates the same language as the original grammar.
Facts & Assumptions
Given: The original grammar and the rewritten grammar related by the displayed immediate-left-recursion elimination step.
Leftmost derivations always rewrite the leftmost remaining variable, by Leftmost and rightmost derivations.
The language of a grammar is determined by the terminal words derivable from its start symbol, by The language generated by a CFG.
Proof
Consider a leftmost derivation segment in the original grammar beginning with . Because every left-recursive rule has the form , any maximal initial block of left-recursive steps must look like So the contribution of this segment is always one non-left-recursive word followed by a finite concatenation of the .
The new variable generates exactly the nonempty finite concatenations of the : use for a one-term concatenation and to prepend further 's. Therefore the segment in step 1.1 is reproduced in the rewritten grammar either by when or by followed by a derivation of the same tail from when .
Conversely, any derivation segment in the rewritten grammar beginning with either uses directly or uses followed by a derivation of a finite concatenation of the from . Reversing the regrouping in step 1.1 turns that segment back into a block of left-recursive uses of ending with in the original grammar.
Since all other productions are unchanged, steps 2.1 and 3.1 convert derivations of terminal words back and forth without changing the yield. Hence [L2] gives equality of the generated languages.
Depends on
Used by
Dependency tree · two levels
3 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
- CSC444 CFLs and PDAs (standard reference, not scraped)