CS 6520 Homework 6

Exercise 6.1

Complete a Scheme implementation of the CC machine, staring with the given incomplete implementation.

For the purposes of this exercise, the only primitive operations are +, -, and = (which are all binary operators). The = operator returns x . y . x 0 when its arguments are equal, and x . y . y 0 otherwise.

For your convenience, the DrScheme programming envionrment is installed on the cs filesystem at
  /home/mflatt/packages/plt/bin/drscheme
(That's a script that will select a Solaris or Irix binary, as appropriate.) You may prefer the non-GUI version at
  /home/mflatt/packages/plt/bin/mzscheme
which prints faster, but provides even less debugging help.

For other platforms, you can download and install DrScheme/MzScheme from
  http://www.cs.rice.edu/CS/PLT/packages/drscheme/
Installation is easy, and requires about 25 MB of disk space.

Important!
When using DrScheme for the first time, set the language to Full Scheme via the "Choose Language" menu item. The provided code will not run in Beginner Student, which is the default language.

Exercise 6.2

Optional, for now.

Convert your Scheme implementation of the CC machine to an SCC machine.

Exercise 6.3

Optional, for now.

Compare the number of steps taken by the CC and SCC machines to evaluate the example expressions. Which one is faster, and why?


Hand-in procedure for the first two exercises: Send a mail message containing your code to mflatt@cs.utah.edu. Your message should encapsulate two files, cc.scm and scc.scm (or just the first one, if you skip the optional exercises for now).

Mime-encoded enclosures are preferred, but any reasonable encoding/enclosing mechanism is fine, including plain text with a clear separator between the files.

Starting with the given incomplete implementation, you should only complete/modify the next-state procedure. Please leave the rest of the file intact, but you may add extra test examples if you want.


Last update: Thursday, January 27th, 2000
mflatt@cs.utah.edu