Friday, September 13, 2013

Generator of Acumen models comprising multiple classes

In order to support the development of Acumen source code transformations, Adam has implemented a basic generator of Acumen models (instances of the Prog type) comprising multiple Acumen classes (ClassDefs). On a high level, the algorithm works as follows:
  1. Generate list of leaf classes (containing no constructor calls or object field references) and add these to an environment (list of ClassDefs).
  2. A small, random number of times, repeat the following: generate a list of classes based on the environment, and add these to the environment.
  3. Generate a main class based on the environment and wrap it in a Prog.
Certain limitations apply to models generated by the algorithm. Significantly, constructors are only called in the private section of classes, and the right-hand sides of continuous assignments are always linear combinations of state variables (effectively making an Acumen program correspond to a system of linear ODEs at each continuous step).