CSCI 490B/580A, Intro to AI, Fall 2006 HOMEWORK 1, due Thurs., Oct. 12 at midnight. Implement an improved version of the Bagger system used in class. Improve the system in at least the following three ways: 1. Use a more complex data representation 2. Use more complex rules, e.g., more complex preconditions. 3. Use some more realistic or more interesting rules. The purpose of these items is to show that you understand the basics of logic programming, and in particular, the unification algorithm. I would expect that you would need about 10 grocery items and 20-30 rules to do this assignment, but there are no specific requirements. Q. Bagger has no input. Do we need to use input in this HW? A. You don't have to, but you are invited to if you like. If you want to use input, you may prefer to use the NAPE sample code as a base instead. Q. Bagger has no loops, except for the main loop that picks new items. Do we need to write loops in this HW? A. Again, you don't have to, but you are welcome to if you like. Both loops and inputs will show up in HW2, so if you master them now, you will save time on the next HW. Q. A particularly stupid thing about Bagger is the way it uses flags to determine what size item it is bagging. Do we have to do it that way? A. No, the purpose of the flags was just to show you how traditional old-fashioned expert systems worked. Since APE is a more powerful language that permits multi-step recipes, it might be more intelligent to implement your code with a recipe that says: deal with the Pepsi and chips, bag large items, bag medium items, bag small items. Q. Bagger has particularly stupid rules. Does the content of our program have to relate to the original Bagger in any way? A. No, you are free to be as realistic or imaginative as you like, as long as you show a mastery of the basic concepts of logic programming and unification. Q. Can we write something completely different from Bagger? A. Sure, just see answer to previous question. Q. I need a function you haven't provided. A. There is a list of functions in ape\loader. If you need more, I would be happy to provide the code you need. In most cases, it will be just a couple of lines; in other cases, a call to an existing function in the base (Lisp) language. Similarly, I would be happy to provide an example of anything you can do in another programming language that you'd like to do in APE. Q. Why are you giving us so much time for this assignment? A. Because I won't be here for office hours on Oct. 5. Q. Will you give us this much time for all the assignments? A. No, you can expect HW2 to overlap this one. Q. Will you consider extending this one until Monday so we can have the extra weekend in case we leave it 'til the last minute? A. Heck no, then someone will ask for Tuesday so they can have more office hours :) Q. How will this assignment be graded? To get an A, you need to do something beyond the minimum required. That might be a more realistic set of rules, a more complex data representation or set of rules, an interesting application, etc. If you do everything required, write it up as requested, and turn it in on time, you should get a B. Note that these are guidelines, not absolute rules. Q. Will you curve the grades? A. No, if everyone does something really nice and gets an A, that's fine with me! Conversely, I expect everyone to learn the material, so I don't curve grades in the other direction either.