2-background.tex 8.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. \section{Background}
  2. \label{sec:background}
  3. In this section, we briefly introduce the required concepts for the remainder of the paper.
  4. As our contribution is focussed on moving away from the implementation layer, we present our previous work in doing so.
  5. First, we discuss our explicitly modelled, neutral action language.
  6. It is a simple procedural action language, but its constructs are explicitly stored as a model themself (\textit{i.e.}, an abstract syntax graph).
  7. Second, we use this action language to explicitly model the type/instance relations, showing the benefits we gain from doing so.
  8. This explicit type/instance relation offers us multiple possible typings for a single model, which sits at the core of our approach.
  9. Each part will already briefly encounter the problems mentioned earlier in this paper.
  10. Solutions to this were always rather ad-hoc, as our primary intention was on bootstrapping our tool: the Modelverse~\cite{MULTI_Modelverse}.
  11. After the implementation of the enabling technology, presented in this section, we have come to an elegant solution, presented in this paper, to a recurring problem.
  12. \subsection{Explicitly Modelled Action Language}
  13. A first step in breaking free from the implementation layer, is by removing all code snippets in the implementation language that are scattered throughout the model.
  14. Since we don't want to depend on a single implementation language, a neutral action language was defined.
  15. While our action language serves a similar purpose as other neutral languages, like the OCL, its major difference is that it is explicitly modelled.
  16. Whereas an OCL interpreter follows the OCL standard, a 262-page specification, issued by the OMG~\cite{OCL}, our action language is formalized at a much lower level.
  17. Only a handful of low-level operations are supported, which are very similar to the primitive operations in any procedural language.
  18. As we store models as graphs internally, action language models are also represented as a graph.
  19. Semantics are formally defined through the use of graph transformations, defining a translation from one graph pattern (before execution of the instruction) to another (after execution of the instruction).
  20. Our interpreter itself is therefore only a few hundred lines of code, to which a set of graph transformation rules are passed.
  21. Only these few hundred lines of code are dependent on the underlying platform, and should be ported when porting the complete application.
  22. Apart from explicitly modelling the semantics, this also makes sure that the execution state is explicitly modelled, as that too is modified by the graph transformation.
  23. The major disadvantage, however, is performance, which is very low at the moment.
  24. An example rule is shown in Figure~\ref{fig:rule}, where the graph transformation rule is shown for when a \texttt{while} element is to be executed with a condition that evaluates to \texttt{True}.
  25. Note that not only the action language constructs are explicitly modelled, but also the complete execution context (\textit{i.e.}, execution stack) is explicitly represented in the Modelverse and is transformed according to these rules.
  26. \begin{figure}
  27. \includegraphics[width=\columnwidth]{figures/rule.pdf}
  28. \caption{Rule to execute when a \texttt{while} is executed with a condition evaluating to \texttt{True}.}
  29. \label{fig:rule}
  30. \end{figure}
  31. It is our intention to create a library of operations, containing, for example, the operations defined by OCL, which is modeled using this minimal action language.
  32. But while this is a noble plan, we quickly encounter the same problems that were raised in the beginning of this paper: strict metamodelling does not allow for models that span multiple levels.
  33. An explicit model of, let's say, a conformance relation, needs access to both the type and instance level, as shown in Figure~\ref{fig:spanning_algorithm}.
  34. We temporarily solved this problem by ignoring strict metamodelling requirements, such that we can bootstrap the tool anyhow.
  35. The contribution of a new action language itself, is therefore not sufficient to address the problems raised at the start of this paper.
  36. While some code snippets in models can be replaced with implementation-independent action code, such as OCL or even our own action language, this action language is not sufficient to model low-level operations that need to work across multiple levels in the modelling hierarchy.
  37. Model management operations, in particular, frequently require cross-level access to the model.
  38. \subsection{Explicitly Modelled Type/Instance Relations}
  39. A next step in allowing for our contribution, is to explicitly model the type/instance relation between models.
  40. By explicitly modelling the type/instance relation, we have shown that users gain more insight in tool semantics and can alter the semantics if desired.
  41. This resulted in the possibility for multiple types of type/instance relations.
  42. For example, a single model can be typed by multiple metamodels, possibly simply because they are different, but similar, metamodels, but maybe also because a less restrictive conformance check is being used.
  43. As there is no common agreement on how restricted a conformance relation should be (\textit{e.g.}, should it take into account all of potency, cardinality, or multiplicity, and how should it behave if these are violated?)
  44. We achieved this explicit semantics through explicit modelling of the type/instance relation, which constisted of several steps.
  45. First, the metamodel was stripped to only contain structural restrictions.
  46. As such, there were no longer any additional attributes that were undefined at the level above, such as potency, multiplicity, cardinalities, and so on.
  47. Attributes with that name could be present though, if they were allowed by the metamodel, but they have no associated semantics, thus not restricting instances.
  48. Second, type information from the model was split of into a seperate model.
  49. A model was thus reduced to a mere graph, which structurally conformed to another graph (the metamodel).
  50. The type information contained links between both graphs, indicating the type of each element in the model.
  51. Due to this seperation, a model could possibly have multiple type mappings, together with multiple metamodels.
  52. To determine whether a model was typed by another model, both models were required, but additionaly a mapping also needed to be present.
  53. Third, all semantics was shifted to the instantiation and conformance checking algorithms, which make up the type/instance relation.
  54. The instantiation algorithm checks all necessary constraints during instantiation, and, for example, prevents further instantiation if the potency has already reached zero.
  55. Similarly, the conformance check checks both the structure, as defined by the graphs, the types, as defined by the type mapping, and the additional constraints imposed by giving semantics to special attributes like potency and cardinalities.
  56. It is thus now the conformance algorithm which gives the semantics to these attributes, and no longer the tool internals, which are hidden from the user and non-modifiable.
  57. To make the algorithms independent of the implementation, they are implemented using the previously defined neutral action language, which is explicitly modelled.
  58. The most important aspect, in the context of this paper, is that it allows a single model to conform to multiple metamodels simultaneously, possibly even through different conformance checking algorithms.
  59. This is shown in Figure~\ref{fig:multi_conformance}, where a single petri net model is shown (as a graph; in the middle) which conforms to two different metamodels: an ordinary place/transition net metamodel (top), and one extended with an inhibitor arc (bottom).
  60. Additionally, minor differences exist between the two metamodels, such as different naming for the \textit{weight} of the transition.
  61. When a users uses the model, it is thus required to pass the corresponding type mapping, of which there are now two.
  62. \begin{figure}
  63. \centering
  64. \includegraphics[width=0.8\columnwidth]{figures/pn_multi_conformance.pdf}
  65. \caption{A single petri net model with multiple conforming metamodels, each through a different type mapping (excerpt).}
  66. \label{fig:multi_conformance}
  67. \end{figure}
  68. Note again that we encounter the problem of strict metamodelling here.
  69. The conformance checking algorithm needs access to both the model and metamodel, thus crossing over multiple levels in the modelling hierarchy.
  70. This problem was again alleviated by not caring too much about strict metamodelling, thus again moving away from normal modelling, and into a realm between the tool implementation and the actual models in the tool.
  71. In this paper, we finally shift all parts from the implementation to the models in the tool.