next up previous contents
Next: First steps in computing Up: An append-rule (ID/LP) grammar Previous: Error Messages

 

Tasks

Practical tasks on developing the grammar and the lexicon:

  1. How many queries are defined by the ID/LP Grammar?
  2. Write the context-free grammar corresponding to the Prolog programme.
  3. Extend this to include adjectives.
  4. Extend it to include auxiliary verbs.
  5. Copy the programme to a file idlpeng1.pl, and test it with the fo llowing call to sicstus:
    sicstus -l idlpeng1.pl
  6. If you find mistakes in the programme, check the error messages carefully and correct your programme file. You will need to type `halt.' (no quotes) to ex it Prolog.
  7. When there are no more errors, you can try out the following:
    1. Separate the system messages from the programme output. For this purpose , UNIX provides two output channels. One of these (called `standard out' or `std io' for short) is for programme data, and is addressed by > filename. The other (called `standard error' or `stderr' for short) is for system messages , and is addressed by 2> filename.
    2. The revised call is:
      sicstus -l idlpeng1.pl 2> idlpeng1.log > idlpeng1.txt
      This call directs system messages to the file idlpeng1.log and programme data output to the file idlpeng1.txt.
      The output of the programme in the file idlpeng1.txt can then be inspected using an editor, or printed out, etc.
  8. NOTE: Do not use the longer call until you have thoroughly debugged the programme, as the error information is not written to the screen, but to the file idlpeng1.log, and is therefore not as easy to read.

Points for discussion:

  1. Do you consider the grammar to be potentially useful? If so, in what contexts? If not, why not?
  2. What are the main weaknesses of the grammar from a linguistic point of view?
  3. The lexicon is very meagre; what other properties of lexical items are relevant for their use in a grammar?
  4. Does the behaviour of the query generator correspond to any kind of human speech production activity?
  5. What other kinds of query would you consider possible and perhaps useful?


next up previous contents
Next: First steps in computing Up: An append-rule (ID/LP) grammar Previous: Error Messages

Dafydd Gibbon
Fri Nov 28 02:24:58 MET 1997