CS 6520 Homework 8

Exercise 8.1

Which of the following expressions are constant-space loops in the CEK machine?

Exercise 8.2

The extension of CEK with continuations that was presented in class (see the SECD handout) could be more efficient with simple changes. For example, the cc form of continuations needlessly keeps a sub-continiation that is never used.

Suggest revisions to the K grammar and the reduction rules to streamline the machine.

Exercise 8.3

Somewhat difficult. Collaboration is encouraged.

Given:What is the value of (Z mk-odd 1)?

Justify your answer, but don't try to write down a complete CEK reduction.

Exercise 8.4

Optional challenge (difficult).

Define callcc as What does ((callcc callcc) (callcc callcc)) do? Justify your answer.

Exercise 8.5

Optional challenge (especially difficult).

Does ((callcc callcc) (callcc callcc)) consume an arbitrarily large amount of "memory"? Justify your answer.

Does ((y . ((callcc callcc) y)) (callcc callcc)) consume an arbitrarily large amount of "memory"? Justify your answer.


Last update: Tuesday, February 8th, 2000
mflatt@cs.utah.edu