Programming Languages (CS 328) Homework 3 Computer Science and Engineering Out: 2000-04-01 Indian Institute of Technology Bombay Due: 2000-04-25

Note: Some of the experimental work in this homework will require code written for the previous homework.

1. Write an FLC to FLCPS converter in Scheme using the conversion algorithm given in class. (You need a routine to generate new names for k_{ret} and suchlike.)

2. Write an FLCPS interpreter in Scheme. (This may sound daunting but it can be done quite easily by adapting code in the Friedman Wand and Haynes book.)

3. Let MULT(a, b) be the following program:

y ← 0;

while b > 0 do y ← y + a; b ← b − 1; end while

Show using axiomatic semantics that

\{b ≥ 0\} \underline{MULT(a, b)} \{y = ab\}.