CS305
Assignment
- Write a parser to cover as much of the following
text as possible. The parser should be written in Prolog
using DCGs. You will find it difficult to parse the entire
text. Therefore, you should adopt the strategy of choosing
some phenomena that you wish your grammar to cover, dealing
with those, and then extending the grammar. You will get marks for
being systematic about this process.
- The grammar should create and display the syntax tree(s) (ascii
or graphics) associated with the sentence (if there is one). Credit
will be accorded for the clarity of the display.
- The program should be accompanied by a brief description of the
methodology adopted including the question of evaluating your own
results: how successful (or otherwise) has the attempt been and how do
you know? One possible approach is to divide the text into several
parts and attempt to progressively apply the results obtained from one
part to the next.
- The assignment should be handed in before 31.1.98. A penalty
of 10% of the marks awarded will be deducted per day, up to a maximum
of 3 days, for
manuscripts handed in after that date. Manuscripts later than three days will
not be accepted.
Once upon a time, a hundred and fifty years ago, in a town
called Mdina, on the island of Malta, there lived a family, a Mummy and
Daddy and two children, a boy called Peepo and a girl called Maria.
The town was surrounded by big fortress walls so nobody could get in
except through the one big main gate.
Outside of the town lived lots
of families who all worked on farms.
The farms belonged to a wicked
and cruel king who lived in a palace in Mdina.
He made all the farmers and their children work very hard from early
in the morning to late at night.
He only gave them a little money, and if any of them
became sick, he would not let them see a doctor, or go to bed, and
sometimes the sick people died.
So all the mummys, daddys and their children were very sad and very
hungry.
The king had plenty of money and food, and he was very greedy.
Peepo and Maria's daddy worked as a cook in the king's kitchen.
He was a very good cook and could make
lovely cakes and puddings and bright coloured jellies, but the king
was always cruel to Daddy.
The king would say "this jelly is too small,
I want a bigger one", and he would throw the jelly on the floor,
where his dogs would eat it all up.
So poor Daddy would go back to the kitchen and make a bigger jelly,
and then the king would eat it all up and say, "I'm still hungry. Make
a bigger one quickly, or I will chop your head off".
Spike Milligan, The Dreaded Monster Jelly
Mike Rosner (mros@cs.um.edu.mt)
Last modified: Wed Feb 25 09:55:22 MET