|
|
|
|
25 Points Due: 11/05/01 at the start of class
Complete each of the following problems:
- Write an implementation for the Prolog predicate
nth(Index,List,Element) that finds the
Nth element of the given List , where the
first element is counted as number 1. (This predicate is
actually called nth1 in SWI-Prolog; there is
also an nth0 predicate; you may use neither
in your solution for this question).
- Chapter 7, Problem 10 (pp. 306-307 of 5E text, in 4E: Chapter 6,
Problem 10 on p. 285. In
some older 4E texts, the "10" is missing. The problem
starts with the paragraph "Assume the following rules of
associativity ..." in the paragraph following problem 9.)
- Chapter 7, Problem 21 (p. 308 of 5E text, in 4E: Chapter 6,
Problem 21 on p. 286)
|