CS 333: Assignment #4

Language Semantics

In this assignment you'll develop semantic definitions of several types of statements in your selected languages and write some simple programs that demonstrate those semantics.


Tasks

  1. Develop a semantic description of your initial state function (the Program token). Include a description of what State constitutes and give an example. Develop your description in two ways.
    • Explain it as a transformation on the program's state, using mathematical notation, as appropriate. Follow the methods of denotational semantics chapters 7 and 8 in Noonan and Tucker.
    • Write it as a function in a programming language other than the one you are trying to explain, preferably one with a simple hashmap or dictionary data structure (e.g. Python or Java).
  2. Develop a semantic description of the meaning of the assignment statement in your selected languages. For Prolog, use basic fact notation and basic rule statement (although any Term statement is basically an assignment). Create your description using the two methods listed above.
  3. Pick two other types of statements and describe their semantics using the same methodology.
  4. Try to write a program whose semantics changes depending upon the particular machine you use. You are free to use one of your chosen languages or C.

Extensions


Writeup

The writeup for this week is the assignment itself, plus the code, which should be integrated with your writeup. Once you have written up your assignment, give your main page for this week the label:

cs333f10language2