CSA305: Exercise Sheet 1 - Simple DCG Grammars


  1. What is SWI-Prolog's translation of each of the following rules?
    1. s --> np, vp.
    2. n --> dog.

  2. Write a DCG grammar without arguments to recognise the following sentences:
    1. John disappeared.
    2. Betrand wrote a book.
    3. Betrand wrote the book on the table.
    4. Every student that I teach gave Bertrand a book.

  3. Extend the above grammar to handle number agreement. It should reject "Bertand wrote a books", "Bertrand write a book" etc.

  4. Get the grammar just written to construct parse trees.

  5. Extend the above grammar to handle subcategorisation. It should reject "Bertand disappeared a book", "John gave Bertrand".

[Wed Nov 22 10:07:48 2000]