15-814: Big-step Untyped Lambda Calculus interpreter.

Frequently Asked Questions

0. Is there anything special I need to do?

Yes, please implement your big-step evaluator such that it matches the signature in lambda.sig.

That means your should place your code inside a structure and ascribe it the signature I provide:

   structure Lambda : LAMBDA = struct
      
      (* your code goes here *)

   end

While testing, make sure to have both the file with the definition of LAMBDA and the file with your own structure available for the SML interpreter. One of the better ways to do that is to use the CM package for SML/NJ.

1. I have a few more functions for testing purposes in my structure, is that okay?

As long as your structure implements the signature, you may implement additional functions if you wish.

2. Before I tried to ascribe the signature to my structure everything worked, but now I get errors. What gives?

The signature actually fully specifies the datatype for terms, and so your definition of the term datatype should match it exactly. In fact, just copy and paste it from the signature into your structure.

3. How do I submit my solution?

Updated!In /afs/cs/user/aleksey/814submit/ you will find several directories. One of them will match your userid. Inside there will be an asst2 subdireectory. Copy your solution there.

This time around you should have full access within your own subdirectory, so you should have only the latest version of your work in there.

4. A followup to question 1: I have several testing functions in my structure, but I can't seem to be able to call them from outside.

That is because of the signature ascription : LAMBDA in the structure definition. It tells SML/NJ to hide any functions in the structure not explicitly named by the signature.

The solution is to do something like:

  structure MyLambda = struct
    (* your code here *)
  end

  structure Lambda : LAMBDA = MyLambda

Now you can use MyLambda.someFunction from the outside.

Alternatively, you may wish to declare your testing functions in a separate structure. In that case, you can save yourself some typing by doing something like:

  structure LambdaTests = struct
    local
      open Lambda
    in
      (*your testing code; since Lambda is opened, you may directly
        refer to eval, subst, Var, App, Abs, etc, without the 
        Lambda. prefix *)
    end
  end

5. Can you tell me briefly how to use CM?

In the same directory as your code (assuming the name is mylambda.sml), create a file called sources.cm which contains:

  Group is
    mylambda.sml
    lambda.sig
    (* any other testing files you may have *)

Now whenever you wish to recompile your files and load them into the currently running SML/NJ, just type:

CM.make();

CM will recompile the changed files and update the toplevel with the new bindings.


$Id: bigstep-faq.html,v 1.3 2002/10/03 09:56:44 aleksey Exp $
    $Log:	bigstep-faq.html,v $
# Revision 1.3  2002/10/03  09:56:44  aleksey
# updated submission instructions, some structure problems, brief CM intro.
# 
# Revision 1.2  2002/10/02  09:24:34  aleksey
# added signature, some SML discussion, submission blurb