Assignment 2, csc431, Spring 2019
1 Goal
2 Plan
3 Test cases
4 Testing Plan
7.3.0.3

Assignment 2, csc431, Spring 2019

1 Goal

Extend Milestone 1 to support the R2 language, including booleans, conditionals, and type-checking, and add register allocation.

2 Plan

Here’s how I’d go about it:

First, I’d get a simple interpreter working. This is still a VERY SIMPLE language, with booleans and conditionals but no functions. Generate some examples, including some large ones. Consider using a random generation function to create some large examples.

Next, I’d write the type checker. Use the examples that you’ve generated in order to check the type checker. If you’re feeling ambitious, you might want to update your random generator to generate only well-typed terms.

Third, I’d implement the first part of the toolchain, including remove-complex-opera*. Make sure that the result is still a valid program, and produces the same result in your interpreter.

Next, I’d implement explicate-control. If you want to lock this down, implement a simple interpreter for the C1 language, and make sure that your programs are producing the right values.

Okay, so I’m not going to list every step in the compilation process, but I think I would advise you to get everything working, all the way to the bottom with running code, before you implement register allocation.

3 Test cases

Here’s a compressed bundle of test files.

4 Testing Plan

For the purposes of evaluation, we’re breaking down the functionality into six separate "tiers". Each one is worth a fraction of the overall points for correctness, as follows:

  1. (10 pts) Milestone 1 code

  2. (3 pts) Type checking

  3. (3 pts) Booleans & Boolean expressions

  4. (2 pts) Conditionals

  5. (2 pts) Register Allocation