Take the productionsand the word . There is only one parse tree: its root uses and each child uses . There are nevertheless exactly two derivations,andaccording 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. Thereforewhose yield is
Assume that is context-free and let be its pumping length. Apply the pumping lemma for context-free languages toWrite , 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.
Articles by others on the same topic
There are currently no matching articles.