CSA305: Exercise Sheet 1 - Simple DCG Grammars
- What is SWI-Prolog's translation of each of the following rules?
- s --> np, vp.
- n --> dog.
-
Write a DCG grammar without arguments to recognise the following sentences:
- John disappeared.
- Betrand wrote a book.
- Betrand wrote the book on the table.
- Every student that I teach gave Bertrand a book.
- Extend the above grammar to handle number agreement. It should reject
"Bertand wrote a books", "Bertrand write a book" etc.
- Get the grammar just written to construct parse trees.
- Extend the above grammar to handle subcategorisation.
It should reject "Bertand disappeared a book", "John gave Bertrand".
[Wed Nov 22 10:07:48 2000]