Things referring to themselves can be very useful and have produced some profound insights. I hold Gödel’s proof the #1 intellectual achievement of mankind. Gödel created a language which he used to reason about number theory. The grammar of that language was – number theory. He then went on to create an interesting (true) theorem that said about itself that it wasn’t a (true) theorem. I will not go into further implications of this. Suffices to say that it has far-reaching implications for mathematics.
When creating a modeling language, it is necessary to create a model (textual, graphical or some other kind) of the modeling language. This model is known as a “meta-model” or a model of the model. But what is the modeling language for describing the meta-model? What does the meta-meta-model look like? I come to think of a story from Stephen Hawking’s A Brief History of Time:
A well-known scientist (some say it was Bertrand Russell) once gave a public lecture on astronomy. He described how the earth orbits around the sun and how the sun, in turn, orbits around the center of a vast collection of stars called our galaxy. At the end of the lecture, a little old lady at the back of the room got up and said: “What you have told us is rubbish. The world is really a flat plate supported on the back of a giant tortoise.” The scientist gave a superior smile before replying, “What is the tortoise standing on?” “You’re very clever, young man, very clever”, said the old lady. “But it’s turtles all the way down!”
An infinite number of turtles seems awfully wasteful and so does an infinite number of meta-models. We need to stop the regression before it gets out of hand. The standard way of doing that is to create a meta-meta-model that is its own meta-model, i.e. it defines the language of itself. Kind of like a turtle that stands on himself. This idea always makes my head spin a bit so I tried to draw a picture of a really simple meta-meta-model and contemplate on it for a while. As you may see from the names of the “things”, or rather, “ideas”, in the model, it is inspired by the meta-meta-model used in Eclipse, Ecore.
There is quite a lot to say about this simple meta-meta-model:
- It defines by definition – it’s what meta-meta-models do for a living – an abstract syntax, a description of the ideas that we use to create meta-models and meta-meta-models, but it also assumes, or implicitly defines, a concrete syntax, i.e. how we draw representations of those ideas in our diagrams .
- Without any a priori knowledge, we need to bootstrap the process of understanding the picture with a hypothesis. One such hypothesis could be that the ideas in our meta-meta-model are represented by the yellow boxes and that the names of the ideas can be found in the upper part of the box; the yellow boxes are part of the concrete syntax used to describe the abstract syntax of the meta-meta-model (and the meta-model).
- The test of our hypothesis and the correctness of the model is if we can create a consistent understanding of how the model represents itself. Do we in the model find representations of all the ideas that the model consists of? Do we for instance find a representation of that line with an arrow between two yellow boxes? We could guess that it is represented by a meta-model element called EReference and see if that mapping can be made part of a consistent interpretation.
- We can also deduce that we have an idea called EClass and another idea called EAttribute in our meta-model. These are thus additional building blocks of our meta-model (and our meta-meta-model). The red arrows indicate as far as I can see a consistent hypothesis about the mapping of the ideas in the meta-meta-model onto the elements of the concrete syntax of the meta-meta-model and the meta-model.
- Just looking at the diagram we don’t get any clues as to the semantics (meaning) of the parts of the diagram. upperBound for instance could mean pretty much anything. To get something useful, we need to add semantics. To get closer to a semantics we could for instance create a framework in which the elements in our model (described in the meta-model) could correspond to classes in an object oriented language that could be stored and manipulated in a certain way. Without such a visit into the real world, the models would just be meaningless symbols.
I don’t think i will try to explain every single red arrow as I might still get lost in the self-referential maze and end up on the wrong level (meta when meta-meta would be correct and so on) all of a sudden. It seems to me that this picture ultimately still needs to be understood by contemplating on it and by getting an intuitive understanding of the mapping. And that may be better done under a lotus tree than at your desk.