Extend Milestone 1 to support the R2 language, including booleans, conditionals, and type-checking.
Here’s how I’d go about it:
Before you begin, please please make sure you have a single-command way to run all of your tests, and automatically check the results of those tests. You don’t want to get any ugly last-minute surprises.
First, I’d 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.
For register allocation, you’ll need to generalize to operate on multiple blocks of code. We don’t have loops, so you don’t need to iteratively revisit blocks; one pass should do.
Um... and then the rest!
Here’s a compressed bundle of test files.
For the purposes of evaluation, we’re breaking down the functionality into five separate "tiers". Each one is worth a fraction of the overall points for correctness, as follows:
(10 pts) Milestone 2 code
(4 pts) Register Allocation
(2 pts) Type checking
(2 pts) Booleans & Boolean expressions
(2 pts) Conditionals