CS 345H: Programming Languages (Honors) Fall 2022

Homework 2: IMP and Operational Semantics

Due date: October 13, 6pm
Grading: 15% (CS 345H) or 9% (CS 386L) of your course grade

In this homework, we'll continue studying operational semantics through the lens of the IMP language we saw in lecture.

The homework is in two parts, both in the Homework.v file.

Table of contents


Make sure you have Coq installed and working, following the instructions from Homework 0. There's no other setup for this homework.

Get the code

We'll be using GitHub Classroom to check out and submit this homework. Follow the GitHub Classroom URL on Ed to create your private copy of the homework repository, and then clone that repository to your machine. For example, the repository it created for me is called hw2-jamesbornholt, so I would do:

git clone git@github.com:utcs345h/hw2-jamesbornholt.git
cd hw2-jamesbornholt

Complete the homework

In your repository, there is just one file you need to edit: Homework.v is the Coq file for Parts 1 and 2 of the homework. The file uses comments to explain what's going on and list the problems you need to solve. A few of the problems in both files ask for English answers rather than code; for those questions, you should just add your answer in the file as a comment.

There is a total of 198 points on this homework, with no extra credit.

Resources for writing Coq

Coq has a slightly steep learning curve. Here are some resources you could reference if you need help understanding how to write Coq or Coq proofs:

What to submit

Submit your solutions by committing your changes in Git and pushing them to the private repository GitHub Classroom created for you in the Get the code step.

The only file you should need to modify is Homework.v.

GitHub Classroom will automatically select your most recent pushed commit before the deadline as your submission. There's no need to manually submit anything else via Canvas or GitHub.

GitHub Classroom also has a simple autograder for Coq proofs using GitHub Actions. It will pass as long as your Homework.v file compiles and has no remaining admit or Admitted statements. This is only a partial grader, and we're using it only to give you early feedback on your submissions—we will still be reading and grading your code by hand. Just because the autograder passes doesn't mean you'll get full points; just because the autograder fails doesn't mean you won't get full points.