A Prolog-based Approach for
UML Model Transformation
Jesus Almendros  (1) 
Luis Iribarne  (2)
(1)  Information System Group
jalmen@ual.es
http://www.ual.es/~jalmen
(2)  Applied Computing Group
Luis.Iribarne@ual.es
http://www.ual.es/~liribarn
University of Almeria
04120 Almeria
SPAIN 
Abstract
In this paper we present a framework that uses logic programming (in
particular, Prolog) for the definition of 
model transformations in the context of UML. Our approach describes how
to define a Prolog library for the 
handling of the UML metamodel, and how model transformations can be
defined by means of Prolog rules. 
It uses rules for mapping the UML metamodel to source meta models,
rules for expressing how to build the 
target models from source models, and finally, rules for specifying how
to map target models to the UML 
metamodel. In addition, our approach shows how Prolog can be used for
verifying constraints on source and
target models. We have validated our proposal by means of a prototype
developed under SWI-Prolog.
Contents
1. Models
    1.1. Model A
    1.2. Model B
    1.3. Metamodel object A
    1.4. Metamodel objetc B
    1.5. Metamodel (UML)
2. Prolog material
3. Instructions
1. Models

[ home ] [ XMI ]

[ home ] [ XMI ]

[ home ]

[ home ]

[ home ]
2.
Prolog material
MM2SM [ download
]
SM2TM [ download ]
TM2MM [ download
]
METAMODEL HANDLING SOURCE [ download ]
METAMODEL HANDLING TARGET [ download ]
MM2XMI [ download ]
XMI2MM [ download ]
XMI WRITING [
download ]
ALL Material  [ download ]
[ home ]
3.
Intructions
In order to test
our prototype you should download and install
SWI-Prolog from www.swi-prolog.org.
After, you
should load the prototype by:
?- [main].
Now, you can
load the XMI file of the model A:
?- 
xmi_load('model-A.xmi').
And now, you can
transform the model A into a model B by using:
?-
xmi_write('model-B.xmi').
[ home ]
(c) Jesus Almendros and Luis Iribarne
University of Almeria, 2009
Almeria, Spain