CSE583 Assignment 3 (Winter 2000)
 CSE Home About Us Search Contact Info

See the basic page on assignments for program weights, rules for working in pairs, etc.

This assignment is due on Friday, February 25, 2000 at 5PM PST.  We will make an announcement later about the specific electronic form for turning in the assignment.   Here's the basic information on running CLP(R):

• Running CLP(R) at UW
• To clarify the notes a bit, we are using clpr 1.2, which is found in /cse/courses/misc_lang/linux/.
• CLP(R) Manual: postscript; html (the html version was produced by latex2html and has a few problems)
1. (20 points) Assume that in addition to stating facts in a logic programming language, one could also state what is known not to be true. Discuss the consequences on logic programming computations and on the closed-world assumption.
2. (20 points) Prolog provides primitives to add new facts and rules to the database. Explain how you can use this facility to create programs with state by simulating von Neumann variables. Briefly discuss whether this is an effective way to exploit the benefits logic programming.
3. (20 points) Write a program to solve the following logic puzzle. There are five houses, each of a different color and inhabited by different students, with a different favorite pet, drink, and brand of candy.

a. Jeremy lives in the red house.

b. Molly owns the dog.

c. Coffee is drunk in the green house.

d. Brian drinks tea.

e. The green house is immediately to the right (your right) of the ivory house.

f. The Snickers eater owns snails.

g. Junior Mints are eaten in the yellow house.

h. Milk is drunk in the middle house.

i. Craig lives in the first house to on the left.

j. The student who eats Skittles lives in the house next to the student with the fox.

k. Junior Mints are eaten in the house next to the house where the horse is kept.

l. The Sweet Tarts eater drinks orange juice.

m. Todd eats M&M's.

n. Craig lives next to the blue house

Who owns the zebra? Who drinks water?

4. (20 points) Consider computing grades for a student. There are five assignments, a project, and a final. The assignments are worth 10%, 20%, 5%, 15%, and 10% respectively; the project is worth 25% and the final is worth 15%. Each assignment, the project, and the final is graded on its own scale from 0 to N (that is, N may vary for each). Write a CLP(R) program that computes a weighted final grade for the course on a scale of 0 to 1. In addition, your program should support queries such as, "How much do I have to get on the final to get a 0.85 or better?"
5. (20 points) For problems #3 and #4, discuss whether or not it would matter if you used Prolog or CLP(R).

 Department of Computer Science & Engineering University of Washington Box 352350 Seattle, WA  98195-2350 (206) 543-1695 voice, (206) 543-2969 FAX [comments to notkin@cs.washington.edu]