-*- mode:Text -*- Copyright 1992 Patrick H. Winston. All rights reserved. Version 1.1.1, transferred from master disk on 23 Apr 93 This file may reference other files containing copyrighted software. Any restrictions on the use of such software are described in the files containing that software. This file may be freely copied as long as this notice is kept intact. PURPOSE Provides program support for Chapter 7, Rules and Rule Chaining. Illustrates forward chaining via grocery bagging. WARNING To produce more interesting behavior, the bag-changing thresholds in the program are different from those in the book. In particular, a new bag is started after 3 large items, 6 medium items, or 12 small items, not 6, 12, and 18. PERFORMANCE EXPERIMENT 1 Examine the file bagger.exp. Run the experiment by typing the following command to your lisp system: (load "bagger.exp") Alternatively, evaluate each Lisp expression in the file one at a time, noting what each does. PERFORMANCE EXPERIMENT 2 Change the grocery list by editing the grocery list in the bagger.lsp file. Run Bagger again with your altered list. KNOWLEDGE ENGINEERING EXPERIMENT 1 Improve the bagger program by editing the rules in the bagger.lsp file so as to allow up to five small items to be placed in any bag that already contains large or medium items. KNOWLEDGE ENGINEERING EXPERIMENT 2 Rewrite the bagger rules so as to have Bagger bag groceries by using the accumulated volume of the groceries bagged, rather than by counting. SMALL-SCALE LISP PROJECT Add a feature to the forward-chaining apparatus so that you can specify what cannot be true, as well as what must be true, among the rules's antecedents. MEDIUM-SCALE LISP PROJECT As it stands, variables are denoted, awkwardly, by lists like this: (? bag). Write Lisp reader macros so that variables are denoted by question mark prefixes like this: ?bag. LARGE-SCALE LISP PROJECT Incorporate the rete procedure into the forward chaining procedure.