You are given the following grammar:

S  -> NP VP
NP -> Det N
VP -> V
VP -> V NP

Det -> 'every' | 'a' | 'the' | 'some'
N   -> 'student' | 'professor' | 'dog'
V   -> 'walks' | 'saw' | 'talks'
  1. Extend your grammar so that you can parse sentences like Every student saw a dog with a telescope, with its two readings (i.e., the one in which the dog has a telescope, and the one in which the student has a telescope).
  2. Your grammar generates ungrammatical sentences like *Every student saw (English requires an explicit object in this case). Modify your grammar so that it does not generate such sentences. But, be careful, both Every student walks and Every student walks a dog are grammatical, you should do justice to this fact as well.
  3. Extend your grammar so that your grammar accepts sentences like Every student talks to a professor and rejects *Every student talks a professor.

Feel free to introduce new non-terminal symbols to your grammar.

Updated: