tic mapping is usually applied to the abstract rather
than to the concrete syntax of a model. Note that the
semantic domain is a modelling language in its own
right which needs to be properly modelled (and so on,
recursively). In practice (in tools), the semantic map-
ping function maps abstract syntax onto abstract syn-
tax.
To continue this introduction of meta-modelling
and model transformation concepts, languages will
explictly be represented as (possibly infinite) as
shown in Figure 1. In the figure, insideness denotes
the sub-set relationship. The dots represent models
which are elements of the encompassing set(s). As
one can always, at some level of abstraction, represent
a model as a graph structure, all models are shown as
elements of the set of all graphs
Graph. Though this
restriction is not necessary, it is commonly used as
it allows for the elegant design, implementation and
bootstrapping of (meta-)modelling environments. As
such, any modelling language becomes a (possibly
infinite) set of graphs. In the bottom centre of Fig-
ure 1 is the abstract syntax set
A. It is a set of models
stripped of their concrete syntax.
Meta-modelling is a heavily over-used term. Here,
we will use it to denote the explicit description (in
the form of a finite model in an appropriate meta-
modelling language) of the abstract syntax set
A of
a modelling language. Often, meta-modelling also
covers a model of the concrete syntax. Semantics
is however not covered. In the figure, the set
A is
described by means of the model
meta-model of A.
On the one hand, a meta-model can be used to check
whether a general model (a graph) belongs to the set
A. On the other hand, one could, at least in principle,
use a meta-model to generate all elements of
A. This
explains why the term meta-model and grammar are
often used inter-changeably.
Several languages are suitable to describe meta-
models. Two approaches are in common use:
1. A meta-model is a type-graph. Elements of the
language described by the meta-model are in-
stance graphs. There must be a morphism be-
tween an instance-graph (model) and a type-graph
(meta-model) for the model to be in the language.
Commonly used meta-modelling languages are
Entity Relationship Diagrams (ERDs) and Class
Diagrams (adding inheritance to ERDs). The ex-
pressive power of this approach is often not suffi-
cient and an extra constraint language (such as the
Object Constraint Language (OCL) in the UML)
specifying constraints over instances is used to
further specify the set of models in a language
(adding the expressive power of first or higher or-
der logic). This is the approach used by the OMG
to specify the abstract syntax of the UML.
2. An alternative general approach specifies a meta-
model as a transformation (in an appropriate for-
malism such as Graph Grammars (Rozenberg,
1997)) which, when applied to a model, veri-
fies its membership of a formalism by reduc-
tion. This is similar to the syntax checking based
on (context-free) grammars used in programming
language compiler compilers. Note how this ap-
proach can be used to model type inferencing and
other more sophisticated checks.
Both types of meta-models (type-graph or gram-
mar) can be interpreted (for flexibility and dynamic
modification) or compiled (for performance). Note
that when meta-modelling is used to synthesize in-
teractive, possibly visual modelling environments, we
need to model when to check whether a model be-
longs to a language. In free-hand modelling, checking
is only done when explicitly requested. This means
that it is possible to create, during modelling, syn-
tactically incorrect models. In syntax-directed mod-
elling, syntactic constraints are enforced at all times
during editing to prevent a user from creating syn-
tactically incorrect models. Note how the latter ap-
proach, though possibly more efficient, due to its in-
cremental nature –of construction and consequently
of checking– may render certain valid models in the
modelling language unreachable through incremen-
tal construction. Typically, syntax-directed modelling
environments will be able to give suggestions to mod-
ellers whenever choices with a finite number of op-
tions present themselves.
The advantages of meta-modelling are numerous.
First, an explicit model of a modelling language can
serve as documentation and as specification. Such
a specification can be the basis for the analysis of
properties of models in the language. From the
meta-model, a modelling environment may be auto-
matically generated. The flexibility of the approach
is tremendous: new, possibly domain-specific, lan-
guages can be designed by simply modifying parts of a
meta-model. As this modification is explicitly applied
to models, the relationship between different vari-
ants of a modelling language is apparent. Above all,
with an appropriate meta-modelling tool, modifying
a meta-model and subsequently generating a possibly
visual modelling tool is orders of magnitude faster
than developing such a tool by hand. The tool syn-
thesis is repeatable and less error-prone than hand-
crafting. As a meta-model is a model in an appropri-
ate modelling language in its own right, one should
be able to meta-model that language’s abstract syn-
tax too. Such a model of a meta-modelling language
is called a meta-meta-model. This is depicted in Fig-
ICSOFT 2007 - International Conference on Software and Data Technologies
306