CPSC 370: Functional and Logic Programming (2006)
Homework Questions now due
Pending homework questions
20060915

Write winning and losing functions
for Doubling Nim.
Follow the link to get detailed rules for the game.
For assignment credit use some kind of straightforward logic.
For your own amusement see if you can make the running time
more reasonable. For this game, there is an algorithm that allows
you to calculate winning positions in your head; although it takes
a bit of practise.
If you wish to check your
logic, here is a
binary that runs
on galaxy.unbc.ca .
20060920

Write a function
uncurry2 that has the property
that f = uncurry2 (curry2
(f)).

Write a function
curry3 .
20060915

Determine the behaviour of the function defined by
fun f n = if n>100 then n10 else f(f(n+11))
Attempt to prove that your answer is correct by some form of induction.

Write a tailrecursive power function that
computes x^{n} efficiently.

Write a Prolog differentiatiation relation.

Write a Prolog simplification function.

Write a Scheme function to reverse a list.

Write a Scheme function to fold a list à
la SML.



Semester Map

CPSC 141

CPSC 200

CPSC 370

Course Outline

Handing in Homework

Pending Homework Questions

Solutions

Policies

References

David’s Schedule
