Home | Notes | Languages | Programs | Homework |
Program Assignment 3 |
Problem |
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 2 Small 3 Medium 4 Medium 5 (on the bottom) Big We know four things about these suitcases and their owners:
- Paul's suitcase is bigger than Ingrid's.
- Gertrude's suitcase is bigger than David's.
- Ingrid's suitcase is smaller than Vanessa's.
- 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 |
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 |