[Next] [Up] [Previous]
Next: About this document Up: Rule-Based Knowledge Previous: Using a Production System

Exercises

  1. Think of some simple task or goal involving up to 6 steps, such as the `shopping trip' described on page [*], and draw and annotate an AND/OR tree for it. Here are some suggestions:

    stacking a pile of different size blocks
    eating a pizza
    acquiring a bicycle (by any means!)
    opening a bank account
  2. Using as a model the rules schematized in the chapter, write a set of POP-11 style production rules for holidaying on the beach in Florida (where it does, sometimes, rain!). Let your initial database have you, for example, sitting in your hotel room with the sun shining brightly outside.
  3. Explain what the following rule does:

     
    rule 1 [temperature in sun is ?val];
    

    add([apply suntan lotion screening factor

    ^(val/10)]);

    endrule;

    How would you stop this rule repeating? The calculation probably works plausibly for temperatures between about 80 and 100 degrees Fahrenheit; but is ludicrously wrong for temperatures lower than that. How would you modify the calculation?

  4. In a POP-11 production rule, the action part typically contains a remove list and an add list. Suppose we wished to streamline the rule by simply having a command changes, which made the appropriate changes to the database. Define a procedure for updating the database

    changes(Old_Fact, New_Fact)

    but without using, in the body of the procedure, the commands add and remove.



Cogsweb Project: luisgh@cogs.susx.ac.uk