Maharishi University of Management
Computer Science Department
COMP 505 : Advanced Programming Languages
Spring 2006
Denotational Semantics Prototyping Labs
You are given a template of the implementation of
the denotational semantics for Imp.1 from the book, basicallya cleaned-up and more
complete version of what is in the book (Ex 4.7).
First fill in this template for the foundation routines.
The lab will be completed in stages:
1) You are to complete the example by filling in all the missing
sections, and running the file. You are given the skeleton to make it easy for you
to get started, but be sure that you know how it works! Read all of the code, and
make sure you could write it if you had to. There is enough code there that it would
take some time, but you should understand it all. 2) Then you should extend the basic definition to include some new
features. Add test "programs" for your features;
follow the style of the examples given to you.
Labs will be evaluated for clarity and correctness. A basic lab with required features
is required for everyone. To improve our grade, you should add one or more features.
3) We will then study continuation models, and continuation semantics,
as extracredit, you might convert the prototype to use these continuation semantics models. You can use this template for continuations 4) Then also convert your extended model to a continuation semantics
version. Use this file for testing.You can choose from the following list of semantic extensions:
Procedures (Ex. 4.12) [Easy] Parameters (Ex. 4.13) [Easy] (Eg. 3.8) Loops [Easy] (model after C)
Lab Suggestions
You can do the entire lab in the same SML environment that you used for our simpler
program exercise, but you may want to look into either the MLWorks environment, or
using the SML environment, which provides a debugger. You will find that programming
in ML is quite different than IP languages, as almost all errors are caught at compile
time by the strict type checking. In the presence of polymorphism, types for many
functions will be too liberal, and thus it is good (especially during development) to
use type constraints liberally.Lab Submission
You should zip up your lab and submit it as you did with the homeworks.