P1: Writing Model-to-Text Transformations with VM2T

Due: Friday, September 6th, 10pm

 

Find a partner to form a group of two.  As a group you will make one submission.  Download the MDELite2 zip file, unzip it and place the MDELite.jar file on your classpath.  Doing so, you should be able to run vm2t:

> java vm2t.Main
Usage: [-cg ContextGeneratorClass] prolog-file template-file

Next, you should read the vm2t manual, which does not define the current "MDELite table declarations". You will find this in the Docs download of the MDELite2 zip file.  


Part 1

Given the following state machine and its vm2t prolog representation (click here) which was discussed in class:

write a vm2t program that produces the Java code represented by the figure below, where each Java class definition has its own file:

 

You are to run your generated code using app.java.


Part 2

One of the important ideas to learn from this assignment is that the essence of a design can be captured in a very abstract way -- namely the by tuples of a prolog database.  The next part of this assignment is to generate a completely  different implementation of the FSM from the same prolog database.  The code for this implementation is sketched in this file.  Both of your implementations should compile and when run with app.java, produce the same result.


Part 3

Your .vm files (that is, model-to-text mappings) should be general -- not specific to the finite state machine given above.  Hand-create another FSM and its prolog database definition, and show that your .vm file produces the correct code for your example.


Submission

Your group should submit:

  1. your .vm files

  2. your .pl file that contains your hand-written FSM prolog-database

  3. a .pdf document that explains your design, program, and anything I need to know to evaluate what you have done.

  4. a bash-script called run.script that will run your examples (so that it is easy for me to see what you have done).

Remember: anything that causes me difficulties to understand or run your code will results in deducted points!