CSci532 Programming Languages and Paradigms: Homework 3

Due date: Friday, November 07, 2008 in class
Each homework may have a different weight, which depends on its level of difficulty.
Absolutely no copying others' work


  1. Evaluate the semantics of these combinations of keystrokes
         10 – 5 +/- M+ 6 × MR M+ =
    using the denotational definition of the calculator language.     (25%)








  2. Add unary minuses to the integer arithmetic expressions and add its semantics to (a) the denotational semantics and (b) the operational semantics.     (30%)







  3. The operational semantics of identifiers was skipped in the discussion. Add the semantics of identifiers to the operational semantics of the sample language.     (15%)





  4. Use the operational semantics of the sample language to reduce the following program to its environment:     (30%)
       x := 0 – 4;
       if  x  then  x := x  else  x := 0 – x  fi
       while  x  do  x := x – 2  od