Assignment 4: Closure Conversion

Due date: 10th April, 2014

(graded, group assignment)

Your task in this assignment is to complete the CPS data representation phase by implementing closure conversion (CPSDataRepresenter.scala). Additionally, you are also required to implement the CPSHoister phase that brings all function bodies to the top level (CPSHoister.scala). We expect you to implement the basic closure conversion procedure. Optionally, you can also implement the optimized procedure. Those who correctly implement the optimized procedure will be awarded 10 bonus points. However, submitting an incorrect version of the optimized procedure will not get you any bonus points. Instead, you may loose points depending on the mistakes. Therefore, we recommend that you start by implementing the basic closure conversion procedure. If you are successful, you can extend it to the optimized procedure.

In the new assignment4 branch you will find the  necessary templates for this assignment. You can use the helper methods in the  l3/package.scala file. Like in the previous assignments, you will have to merge the skeleton for assignment 4 with the changes you made for assignment 3. To do so, use: 

 git commit -a git fetch  git merge origin/assignment4 cd l3/compiler sbt clean update compile test

You should be able to do this without merge conflicts or compilation errors. If you get into trouble with git, ask the TAs. We do not provide any additional testcases for this assignment.