Consider the grammar we discussed in class:
E -> T | E + T | E - T
T-> F | T * F | T / F
F-> x | y | z | ( E )
(I will be able to provide derivations in the solutions handout: Please see me if you have questions about the parse trees (I need a html drawing tool!).
Another useful grammar (that we have seen before) is:S -> NP VP
NP -> DET N
N -> ADJ N | boy | dog | ball
ADJ -> big | small | red
VP -> V NP
V -> chased | bit
DET the | this | a
Create derivations and parse trees for THE BIG DOG CHASED THE SMALL BOY
S -> NP VP -> DET N VP -> the N VP -> the ADJ N VP -> the big N VP -> the big dog VP -> the big dog V NP -> the big dog chased NP -> the big dog chased DET N -> the big dog chased the N -> the big dog chased the ADJ N -> the big dog chased the small N -> the big dog chased the small boy
Finally, an exercise from Wilfrid Hodges Logic (Cox & Wyman Ltd, 1982) page 84:
A one-year-old child is overheard making the following remarks:
boy. sock. mommy. allgone boy. allgone mommy. byebye sock.
byebye mommy. boy off. sock off. sock on. mommy on. mommy fall.
Create a grammar that will support the utterances of the child.