Additional exercises are stated later on this page.
| Due Date | Text | Chapter | Collaboration | Problems |
|---|---|---|---|---|
| January 29 | Gries | 1 | No | 1.3 |
| Gries | 2 | No | 2.5, 2.6cegk | |
| January 31 | Gries | 1 | Yes | 1.4 |
| Gries | 2 | Yes | 2.6fhjl | |
| Mitchell | 1 | Yes | Problem 1 (below) | |
| February 2 | Gries | 4 | No | 4.1.3, 4.2.6a-bjkm, 4.4.2, 4.5.2ac |
| February 9 | Gries | 5 | No | 5.1.1ace, 5.1.2bfg, 5.2.2, 5.2.3 |
| February 23 | Gries | 6 | No | 6.2.1deg |
| March 2 | Gries | 7 | No | 7.1acef, 7.2(1,3,5), 7.4, 7.5 |
| Gries | 8 | No | 8.1, 8.3, 8.6 | |
| March 9 | Gries | 9 | No | 9.1.1ace, 9.2.2, 9.2.3bdf, 9.2.4ace, 9.3.1ace |
| March 12 | Gries | 10 | No | 10.1, 10.3, 10.5, 10.6, 10.8 |
| March 16 | Gries | 11 | No | 11.1, 11.8, 11.9, 11.10, 11.12 |
| April 6 | Gries | 14 | No | 14.1abd |
| April 13 | Gries | 16 | No | 16.2.2, 16.2.3 |
| April 27 | Gries | 16 | No | 16.3.1, 16.3.5, 16.3.7 |
| April 30 | [Prolog] | Yes | Problem 2, Problem 3 (below) | |
| May 7 | Gries | 16 | No | 16.5.2, 16.5.5, 16.5.9 |
| [Prolog] | No | Problem 4, Problem 5 (below) | ||
| Due Date | Text | Chapter | Collaboration | Problems |
Problem 1: Find a partial function that has the following three properties:
Problem 2: Define Prolog relations to determine if a list has an even number of elements.
Problem 3: Define Prolog relations to determine if a list:
Problem 4: Write a Prolog program that succeeds if the intersection of two given list parameters is empty.
Problem 5: Draw Prolog search trees for the query:
?- reverseList([a, b, c, d], W).where reverseList is defined by the rules:
a. reverseList([ ], [ ]). reverseList([A|X], Z) :- reverseList(X, Y),append(Y, [A], Z).
b. reverseList(X, Z) :- rev(X, [ ], Z). rev([ ], Y, Y). rev([A|X], Y, Z) :- rev(X, [A|Y], Z).
This document is available on the World Wide Web as
http://www.math.grin.edu/~walker/courses/302.sp01/assignments.html