Computer Science 60
Principles of Computer Science
Fall 2003


Assignment 8 Ultralite: A First Look at Prolog!
Due Monday, October 27 before midnight.

This assignment has two very short parts.

Part 1: The Simpsons and Prolog (15 Points)

In the directory /cs/cs60/assignments/assignment8 you will find a file called part1.pl. This file contains an expanded database of the Simpsons family. You should make a copy of this file and add the following rules to this file. You may also add any additional helper rules that you wish, including anything that we looked at in class. However, please don't change the facts about parenthood in the Simpsons family! Recall that "," is the symbol for AND, ";" is the SYMBOL for OR, and "\+" is the symbol for NOT. Please look at the class notes for other Prolog syntax. Your file should be called part1.pl and submit it using cs60submit.

Part 2: Lists in Prolog (20 Points)


Now, you will write two Prolog rules for lists. Please submit these rules rules in one file called part2.pl using cs60submit. Again, you may use any helper rules that you like. In particular, some of the rules that we saw in class may be useful to you here. You may implement and use any of them.

Last modified October 2003 by Ran Libeskind-Hadas