Bx Examples Repository

Title: Megamodel

Version: 0.1

Type: Sketch


This example was developed to illustrate consistency maintenance in a network of models, which may be regarded as an instance of a megamodel. Two (or more) models in the network may be connected by a bx: but how do we maintain consistency in the network as a whole, using the consistency restoration functions of the individual bx?


A megamodel instance comprises one model from each of the model sets shown as circles in the diagram below. There is: a metamodel; a design model; some code; some tests; and a safety model (which is assumed to specify, among other things perhaps, whether the system is to be considered safety-critical).



The network is consistent iff all the individual consistency relations hold. That is: the design model conforms to the metamodel; the design model and the code are in some standard round-tripping consistency relation; and an appropriate ternary relation holds between the code, the tests and the safety model. For example, it could be that: the code must pass the tests, and if the safety model records that the system is safety-critical, then in addition, the tests must meet some coverage criterion over the code.

See Stevens17 for discussion of the implications of taking this approach, especially for expressivity.

Consistency Restoration

It is natural to want to restore consistency in the whole network via a sequence of applications of the consistency restoration functions of the individual bx. As Stevens17 discussed, this may not be possible, and even if it is, the result will normally depend on the particular sequence chosen. Stevens18 discussed how to use an orientation model to record key decisions, and the MegamodelBuild system to (a) encapsulate extra intelligence needed such as how to reconcile the actions of bx that have a common target, (b) restore consistency in a provably sound and efficient way.


see below…


The example was introduced in

author = {Perdita Stevens},
title = {Bidirectional Transformations in the Large},
doi = {10.1109/MODELS.2017.8},
booktitle = {MoDELS},
pages = {1—11},
publisher = {{IEEE} Computer Society},
year = {2017}

and further discussed in

author = {Perdita Stevens},
title = {Towards sound, optimal, and flexible building from megamodels},
doi = {10.1145/3239372.3239378},
booktitle = {MoDELS},
pages = {301—311},
publisher = ACM,
year = {2018}

Bibliographic data for the paper or papers from which the example is taken, or where it is discussed, if applicable.


Perdita Stevens


none yet


This is where any member of the wiki can comment.

Artefacts [optional section]

Implemented (as a toy example, with everything mocked) in the MegamodelBuild tool.
Formal descriptions, perhaps downloadable code, example inputs and outputs, virtual machine instances, diagrams…

Unless otherwise stated, the content of this page is licensed under GNU Free Documentation License.