Refactoring via Synthesis

March 12, 2020

I finally have released my final project from last semester for my Programming Verification and Synthesis course. I made a frontend for it so it can be used as a web app. (Please be kind with any requests, as it can take a while per each one). The idea is to take a segment of code, and replace it with a shorter one, along with some method declarations.

How to use:

The first box is (restricted) java code. Keep to one statement per line, and don’t use the compound assignment operators (+=, etc). Avoid for loops and instead use while loops. All variables must be int types, and do not include declarations within the code segment.

The second box is the set of variables (comma seperated) to check for equality on. After refactoring, the new code will ensure these variables are the same as in the original. By contrast, not all variables may be important after the code body, and so their equality does not matter.

The third box is the set of java classes that may be used (comma seperated). Works best at calling static methods. There is no way to use a custom class as of now, so you are limited to the standard Java API.

The fourth box is any delcarations to make for variables. These are variables that should not have values prior to the code segment.

After clicked refactor, a new body of code will be generated that is equal (ideally) to the original code.

Check it out here: