CSE 505, Autumn 1996
D. Notkin
Homework #4
Assigned: 10/23/96
Due: 11/1/96
This assignment focuses on logic programming and
constraint logic programming. The programming will be in CLPR;
we'll send information to the mailing list about where to find
the compiler, etc. You may work in pairs, turning in a single
assignment with both names, receiving a single, shared grade.
Assignments are due (non-electronically, watching for instructions
from Kurt) by the beginning of class on the due date. This assignment
is worth 10% of the quarter's assignments (which in turn are worth
50% of the total grade).
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. (10 points) /cse/courses/cse505/F96/clpr/examples2/points
contains some basic CLPR code for manipulating cartesian points.
Extend the definitions to include:
5. (10 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 CLPR 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?"
6. (10 points) For problems #3 and #4, discuss whether or not it would matter if you used Prolog or CLPR.