Exercise 5, Grammar Engineering


The new grammar grammar5.lfg already contains two OT-Marks. They prefer local PP-attachment and choose an OBL analysis over an ADJUNCT analysis where there is a choice. This is fine for the most part, but causes problems elsewhere.

For example, in the first two examples below, the OBL-AG reading is being ruled out. Get it back in and see if you can constrain the PP readings in some other way.

For the examples with "waited for" only the OBL readings are ruled in, but this is not right for "wait for hours". Try to fix this. One way to fix things could be differentiate between animate and inanimate nouns. You could implement a generalization stating that, if the object of the preposition is animate ([ANIM +]), then the OBL reading is licensed and, if it is inanimate ([ANIM -]), then the ADJUNCT reading is preferred.

In the end, your goal should be that all the sentences below get only one reading and only the right reading. If you cannot manage to make your grammar do that, write up a short report on why things did not work (sometimes things are just impossible to rule out within the syntax --- XLE is powerful but not almighty).

  1. the dog was given a bone by the girl
  2. a bone was given to the dog by the girl
  3. the gorilla waited for hours
  4. the zookeeper waited for the gorilla
  5. the gorilla put the banana in the cage
  6. the gorilla in the cage devoured a banana
  7. the gorilla devoured a banana in the cage
  8. a banana was put in the cage by the gorilla
  9. the zookeeper waited by the bench
  10. the zookeeper waited by the bench in the garden


Go through your testsuite and try to regenerate each sentence. Note down what your results are. When there should be only one possibility but there are more, think about whether and how you can fix it. If you can fix it (easily), then do so.

Hand in: report on how your grammar is doing (which sentences overgenerate and why) and what parts of the overgeneration you were able to fix and how.

If you want to constrain some of the possibilities via OT, then you can make up OT-Marks and rank them on the hierarchy called GENOPTIMALITYORDER (already included in grammar5.lfg).

Please submit your exercises and your testsuite to Martin Forst by 8 pm.

Relevant Reading Material

XLE Documentation on Support for Optimality Theory for information on how to use OT-Marks.

XLE Documentation on the generator.

XLE Documentation on the FS-Chart Window and packed representations.