Project 2 -- Knowledge and Reasoning

Due Thursday, March 25, 2004, 12:00 noon (electronic submission)

(Note that this due date is later than that listed in the original schedule.)

NOTE: This assignment, like others in this class, is due at a particular time. This means that if you are even a minute late, you lose 20%. If you are worried about potentially being late, turn in your assignment ahead of time.

As discussed in class, it should be possible to construct systems that can reason about the world using predicate logic. One simple domain to consider is a simple, well-structured environment, such as an academic building. To ensure that this environment is simple enough for this project, we'll make some limitations on the floorplans that are possible and the kinds of things we want to reason about.

Buildings

The Assignment

As discussed in class, we are combining the third homework with the second programming project for this assignment. Consequently, you will be doing this work first by hand then writing software to do it for you. However, you are probably well-advised to think about your manual answers with the programming task in mind, so that you are sure to make your system general enough to handle test cases beyond the one given here.

Homework 3.

  1. You are to write up a set of predicates and functions that will be useful to you in this domain. Be sure to give the meaning of each of these.

  2. You are to write up a set of sentences that encode the general knowledge about this domain. These should be written in English and FOPC.

  3. You are to write up a set of sentences that encode the information shown pictorally in the following figure:

    Example Building

    You should write up additional sentences to encode the fact that there are two additional floors above the one shown. For the second and third floors there are no outside doors and the rooms have 8 and 16 added to their numbers, respectively (except for the elevators and stairs, which have the same numbers, since they are the same objects, just extended through all three floors).

    These sentences should be sufficient to reason about all the rooms in the building (in terms of relative location, relative size, and movement between them) but need not be exhaustive. That is, if some particular fact can be derived from other facts and the general knowledge you have encoded, you do not need to include the redundant fact.

  4. You are to write up a set of queries to test your sentences, to be sure that your sentences encode the information that you want them to. You should write up at least two but no more than three queries for each of the types of reasoning (relative location, relative size, and movement) your system should handle.

  5. You are to prove these queries.

Project 2.

  1. You are to write software that can do the proofs above for you. You will, of course, need to encode all of the sentences and queries so that your software can make use of them. You will also need to ensure that your software has appropriate inference mechanisms to carry out the proofs.

    You should ensure that your software can load the general knowledge of the domain separate from the particular facts about the building given. This is because I will also test your system on other buildings, to see if it can reason about them as well.

  2. You are to carry out these proofs using your software and capture the input and output of this activity in such a way as to include it in your write-up. Your write-up should annotate this testing in such a way that it is clear how the sentences and queries are encoded and what each result means.

What to turn in

You will turn in both a hard copy and an electronic copy of your assignment. Please follow the instructions on how to send electronic copies. Do not send them to my email address.

Both the hard copy and the electronic copy will contain a write-up answering the questions above for each part, plus all source code you used in collecting your results. The electronic copy will also contain an executable version of your code, if applicable. (Even if you are using a language that is often considered an interpretted language, you should compile an executable unless the language resources available on the lab machines do not provide for this.) The electronic copy of your write-up should not be in a proprietary format (such as MS Word); it should be either in plain ASCII text or in a portable format (such as Postscript or PDF). Your source code for each version should be in a single file called buildings.<something> (where <something> is the appropriate suffix for the language you have chosen) and your executable code (if applicable) should be called buildings.

Your source code should be well structured and well commented. It should conform to good coding standards (e.g., no memory leaks).

Besides the answers and explanations mentioned above, your write-up will include 1/2 to 1 page (roughly 80 characters per line, 50 lines per page) explaining the data structures and algorithms used in your code. This page limitation does not include figures used in your explanation, which are encouraged and may take up any amount of space. (This explanation does not remove the requirement that your code be well commented.)

Other

You may write your program from scratch or may start from programs for which the source code is freely available on the web or through other sources (such as friends or student organizations). If you do not start from scratch, you must give a complete and accurate accounting of where all of your code came from and indicate which parts are original or changed, and which you got from which other source. Failure to give credit where credit is due is academic fraud and will be dealt with accordingly.

As noted in the syllabus, you are required to work on this programming assignment in a group of at least two people. It is your responsibility to find other group members and work with them. The group should turn in only one (1) hard copy and one (1) electronic copy of the assignment. Both the electronic and hard copies should contain the names and student ID numbers of all group members. If your group composition changes during the course of working on this assignment (for example, a group of five splits into a group of two and a separate group of three), this must be clearly indicated in your write-up, including the names and student ID numbers of everyone involved.

Each group member is required to contribute equally to each project, as far as is possible. You must thoroughly document which group members were involved in each part of the project. For example, if you have three functions in your program and one function was written by group member one, the second was written by group member two, and the third was written jointly and equally by group members three and four, both your write-up and the comments in your code must clearly indicate this division of labor.