CSCI.4430/6969 Programming Languages Spring 2005
Programming Assignment #1

This assignment is to be done either individually or in pairs. Do not show your code to any other group and do not look at any other group's code. Do not put your code in a public directory or otherwise make it public. However, you may get all the help you need from the TAs or the instructor. You are encouraged to use the WebCT Discussions page to post questions so that other students can also see the answers.

A Lambda-Calculus Interpreter in Oz

The goal of this assignment is to create a call-by-value lambda-calculus interpreter in Oz.

You are to use the following grammar for the lambda-calculus:

<expression> ::= <atom>
::= lambda(<atom> <expression>)
::= [<expression> <expression>]

Once your interpreter is finished, you should be able to execute statements such as:

{Browse {Run [lambda(x x) y]} % should display y 
Hints: You may define auxiliary procedures for alpha-renaming, beta-reduction, and eta-reduction. For beta reduction, you may want to write an auxiliary procedure that substitutes all free occurrences of a variable in an expression for another expression. Be sure that the replacing expression does not include free variables that would become captured in the substitution. Remember that in call-by-value, the argument to a function is evaluated before the function is called.

Extra Credit (10% bonus if working individually, required for full credit if working in a pair):

Create a call-by-name lambda-calculus interpreter.

See the professor if you have ideas for other extensions to this assignment and would like extra credit for implementing them.

Due Date:
Received Time Grade Modification
before Monday, March 21, 11:59PM +10%
Tuesday, March 22, from 12:00AM to 11:59PM no modification (on time)
Wednesday, March 23, from 12:00AM to 11:59PM -10%
from Thursday, March 24, 12:00AM to
Friday, March 25, 11:59PM
after Saturday, March 26, 12:00AM not accepted

The assignment will be graded mostly on correctness, but code clarity / readability will also be a factor (comment, comment, comment!). Be sure your solutions are robust.

Submission Requirements: Your code should consist of an Oz file, plus a README file. Combine these files into a single ZIP file with your WebCT user name(s) as the filename, either or Only submit one assignment per pair (the other does not need to submit anything via WebCT). Please submit your file via WebCT.