Home  |   Notes  |   Languages  |   Programs  |   Homework
Program Assignment 3

75 Points
Due: 4/4/00 at the start of class

 Problem
This is your first assignment in Prolog, and is intended to demonstrate a capability in the language that is difficult to implement in any other language.

Design, implement and fully test, a Prolog program that will solve the following logic problem:

Five people, David, Gertrude, Ingrid, Paul and Vanessa own five suitcases, which are stacked in their closet as below:

Position Size
1 (on the top) Medium
2Small
3Medium
4Medium
5 (on the bottom) Big

We know four things about these suitcases and their owners:

  1. Paul's suitcase is bigger than Ingrid's.
  2. Gertrude's suitcase is bigger than David's.
  3. Ingrid's suitcase is smaller than Vanessa's.
  4. David's suitcase touches Gertrude's but not Vanessa's.

Who owns which suitcase?

For this program, there is no interactive input data. The output will consist of the names of each owner along with the size and position of their suitcase.

Since this program does not have varying input data then the testing is much simpler--you do not have to test for varying, invalid, or obtuse data input. Instead, you should do unit testing on the predicates in your program. Also, remember that the design of your program is an important element of the report.

 Submitting Your Program
In your solution, be sure to place comments at the beginning of each file that identify the assignment and give your name. Every Prolog predicate (i.e., series of facts or rules with the same predicate name and same number of parameters) should be preceded by comments explaining its purpose, its intended meaning, and the intended direction of its parameters.

Be sure to follow the Program Submission Guidelines in preparing your report to turn in. In accordance with these guidelines, you will need to develop a set of test cases for the predicates in your program that tests both positive and negative cases. For test cases that you are unable to run, be sure to indicate "Unable to perform test" in the corresponding test result within your report.

In gathering information for your report, you may find it useful to write all of these test cases in a separate Prolog file that consults your program source. You can then capture the results of your tests while executing this file under a command prompt (Windows or UNIX) for inclusion in your program report.


Home  |   Notes  |   Languages  |   Programs  |   Homework
copyright © 2000 Virginia Tech, ALL RIGHTS RESERVED
Last modified: August 11, 2000, 15:51:24 EDT, by Stephen Edwards <edwards@cs.vt.edu>