GReAT: Graph Rewriting and Transformation


'Graph Rewriting and Transformation' is a tool for building model transformation tools using graph transformation techniques. GReAT uses metamodels to specify the abstract syntax of the input and the target models (i.e. the modeling languages), and sequenced graph rewriting rules for specifiying the transformation itself.

The approach used in GReAT is illustrated below.

For building a model transformation tool using GReAT, one first has to specify the metamodels of the input and the target models. This is done using the UML-style class diagrams, using GME and UDM.

Note: GReAT works with the 'pure UML' class diagram metamodels (like UDM), and GME metamodels must be converted into this format using UDM tools.

The GReAT transformation rules are graph rewriting rules that transform a part of the input model (a typed, attributed graph of model elements) into part of the target model (a typed, attributed graph of model elements). The rule has a pattern (to be matched against input model), a guard (an expression to be evaluated on the result of the match), and a set of actions (that create of delete model elements, or modify attributes). The match is always computed starting from specific nodes, called the pivot nodes in the graph to limit the search, and pivot nodes could be passed down to subsequent rules. The rule execution is explicitly sequenced, and various control structures (including conditional and looping structures are available).

The GreAT toolsuite can be downloaded from here, and it includes a number of tools, as illustrated on the picture below.


GReAT programs (transformation specs) are typically executed using a 'virtual machine', called the GR Engine. This is an interpreter that interprets the rewriting program, and allows the use of the debugger. Once the transformation is corrected, one can use the code generator the produce executable (C++) code from the transformation program, which is then linked with other libraries to form an executable that runs with much better performance. The GReAT transformation rules could include executable code written in C++, in the form of ' attribute mapping' code -- this is for computations that need to be performed upon each transformation step, best written as imperative code.

 Publications on GReAT can be found here.