Take the productions
and the word . There is only one parse tree: its root uses and each child uses . There are nevertheless exactly two derivations,
and
according as the left or right occurrence of is replaced first. This illustrates that derivations record replacement order while a context-free grammar parse tree does not.
The first displayed tree supplies the productions and , as well as an -parse tree producing . By assumption there is also an -parse tree producing . Substitute these trees as follows:
The resulting yield is
The displayed trees provide -parse trees producing , , and , together with the same root productions as above. Therefore
whose yield is
Assume that is context-free and let be its pumping length. Apply the pumping lemma for context-free languages to
Write , with and . The substring meets at most two of the three constant-letter blocks.
If and affect only the first block, only the middle block, or only the last block, pumping down immediately makes the final block length differ from the minimum of the first two lengths. If they meet the first and second blocks, pumping down decreases at least one of those block lengths while leaving the final length , again violating the defining minimum.
It remains that they meet the second and third blocks. Let pumping change their lengths by and , respectively. Pumping down fails unless . If , pumping up gives lengths
whose last entry is not . Thus some pumping exponent always leaves , contradicting the lemma. Hence

Articles by others on the same topic (0)

There are currently no matching articles.