When you submit your completed assignment, please indicate how long it took to complete. This will not factor into your grade. For anything that you submit in this class, place your name and UW ID on the top of the first page.
Divide-by-zero errors often catch developers off guard, with numerous documented issues. These errors can happen due to division by zero (e.g., 1/0) or mod by zero (e.g., 1%0).
The goal of this assignment is to design and implement a static analysis that prevents divide-by-zero errors.
This homework has two parts – each with a dedicated submission deadline.
Give an abstract interpretation that catches possible divide-by-zero errors statically. You do not need to give transfer functions for every integer operation; addition, multiplication, and division will suffice.
Think carefully about your choices; the design space is quite large! You may assume that (1) we only care about integers (not floating-point values) and (2) overflow does not happen.
Briefly contrast your design to an alternative you chose. Name one way in which your design is better than the alternative, and one way in which it is worse.
Submit your design writeup to Canvas.
Implement your design (or a simplified version of it, as stated above) for integer division in Java:
Clone the following repository: cf-homework.
Familiarize yourself with the skeleton code and detailed instructions.
Make local edits for development and testing, and commit your changes. (Atomic commits are valuable to document your attempts and thought process.)
Tag the commit that passes the tests for grading as “hw2-final”. (You may explore additional ideas and make further commits, even if they break (additional) tests.)
Submit an archive of your local repository to Canvas.