3-conformance.tex 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. \section{Types of Conformance}
  2. \label{sec:conformance}
  3. It was found out that there is not a single kind of type/instance relation, but actually multiple, to cope with the different kinds of relations~\cite{OCA}.
  4. A distinction was made between conformance to the physical implementation, and to the linguistic metamodel.
  5. This classification architecture was termed the Orthogonal Classification Architecture (OCA).
  6. Other work~\cite{Bruno,Ken} has shown the presence of yet another type/instance relation, which links back to the semantics of the model.
  7. Depending on which dimension is used, different type/instance hierarchies emerge, changing the implications of strict metamodelling.
  8. Sadly, terminology is rather inconsistent in the literature, making it difficult to clearly communicate about the different dimensions.
  9. This section serves to clear up the terminology we will use throughout this paper.
  10. A concise example is shown of a simple petri net model, which conforms to three different metamodels with respect to these different conformance relations.
  11. \subsection{Physical Conformance}
  12. The low-level view on conformance is what we call \textit{physical conformance}.
  13. This is the kind of conformance used by tool-developers and model management operations, as it does not impose many constraints.
  14. It sits at the physical level, where it is responsible for how data is represented physically in memory.
  15. Physical representation is unrelated to language engineering, and is completely managed by the implementation language of the tool.
  16. Physical conformance, therefore, is checked by their respective compilers (\textit{e.g.}, GCC and Java compiler).
  17. But since it is checked only by the compiler, no restrictions are placed upon the crossing of modelling levels.
  18. Indeed, all models, metamodels, metametamodels, and so on, are similar at this level: they are data created by the user that can be manipulated by the tool.
  19. Tool internals, as well as model management operations, are mostly implemented at this level, as it allows all possible modifications to the model.
  20. Additionally, this level is efficient due to its close relation to the implementation, and use of advanced tools such as efficient compilers.
  21. Since this is the lowest level of conformance, to which every model conforms by definition, all operations need to be applicable to all models.
  22. Most of the time, the only common representation of all models is the data structure used to store them.
  23. These operations thus alter the internal data structure directly, without any kind of domain-specific algorithm in between.
  24. While these modifications are again efficient, and furthermore easy to implement for the tool developer, the strong link to the implementation is made obvious.
  25. Porting all tool internals to a different tool doesn't only require porting between programming languages, but also between different internal data representations.
  26. Changing implementation details, which should be transparent to the user, will have significant implications on these algorithms as well.
  27. In our petri net example, this relates to how the petri net is stored in memory: with all elements being instances of a generic \textit{Class} defined by the implementation language.
  28. This is shown in Figure~\ref{fig:pn_physical}: the model conforms to a simple graph representation, where places and transitions are represented as nodes, and the edge between them is mapped to the edge of a graph.
  29. Depending on the implementation, a different physical metamodel can be used, for example that of an SQL database.
  30. The metamodel is the same for every model, be it petri nets, class diagrams, object diagrams, statecharts, or even a domain-specific language.
  31. The reason for this is simple: if the model doesn't conform to this metamodel, the tool has no way of representing it in memory.
  32. \begin{figure}
  33. \centering
  34. \includegraphics[width=0.5\columnwidth]{figures/pn_physical.pdf}
  35. \caption{Physical conformance of a petri net model.}
  36. \label{fig:pn_physical}
  37. \end{figure}
  38. \subsection{Linguistic Conformance}
  39. \textit{Linguistic conformance} is the traditional view on conformance, which is heavily used for domain specific modelling.
  40. It is also the view offered to users: if a user creates a metamodel, and subsequently instantiates it, this is through linguistic conformance.
  41. The relation defines whether or not a user-defined model is a valid instance of another user-defined (possibly by another user) metamodel.
  42. Checks mostly have a structural notion (\textit{e.g.}, is a link between these entities allowed and are all required attributes present), though minor semantical constraints are also possible.
  43. These semantical constraints are for example range checks on attributes (\textit{e.g.}, integer must be larger than 5), global restrictions on values of attributes (\textit{e.g.}, the sum of these two attributes needs to be greater than 10), or global restrictions on the structure (\textit{e.g.}, no loop possible for a certain association).
  44. Whereas structural checks are easily implemented through the use of a metamodel, the additional semantic constraints are often implemented using some kind of executable language.
  45. Constraints are written in constraint languages, such as OCL, but are sometimes already shifted to the implementation language (\textit{e.g.}, implemented in Python as in AToM$^3$~\cite{AToM3} and AToMPM~\cite{AToMPM}).
  46. Contrary to the physical conformance dimension, users can extend the linguistic conformance dimension by adding, modifying, or deleting metamodels.
  47. As such, a model is not, by definition, always conforming to its provided metamodel.
  48. This conformance relation is also not checked by the implementation language, but by the tool itself.
  49. But whereas most programming languages are standardized and have a clear definition on what it means to conform, this is not always the case in the linguistic dimension.
  50. Each tool has its own interpretation of what it means for models to conform to another model.
  51. Making this relation explicit, and thus offering the user the choice, was the primary effort of our previous work~\cite{MultiConformance}.
  52. It is also at this level that strict metamodelling comes into play: no links, except for the \textit{instanceOf} link, is allowed to cross the levels defined by this relation.
  53. Tool users should ideally only be concerned with this dimension, as it offers support for domain-specific languages and makes use of all the features implemented by the tool (\textit{e.g.}, strict metamodelling, type checking, model transformations, and consistency management).
  54. In our petri net example, this relates to the metamodel of petri nets which constrains the structure of the net.
  55. Example constraints are that no direct link between places is possible (specified by the omission of an association from \textit{Place} to itself), and the number of tokens in a place needs to be positive (specified by a static semantics constraint).
  56. This is shown in Figure~\ref{fig:pn_linguistic}, where each element conforms to a metamodel that is specific to the model.
  57. Contrary to physical conformance, this metamodel is only valid for petri net instances.
  58. At this level, it is impossible to create, for example, a link from the place instance to the place type, due to strict metamodelling.
  59. There is also no mention of the implementation: this relation does not imply anything on how a place is represented in memory (\textit{e.g.}, as a node in a graph or as an ID in a SQL database).
  60. It does, however, constrain the structure of the model.
  61. The metamodel contains an association from \textit{Place} to \textit{Transition}, and vice versa, but no transition from \textit{Place} or \textit{Transition} to itself.
  62. This constrains the instances more than was the case with physical conformance.
  63. Furthermore, it is often this dimension of conformance that is used to specify concrete syntax.
  64. Strictly speaking, the representation of the model in physical conformance would have to be the actual graph that is stored in memory.
  65. We did not do this to prevent confusion.
  66. \begin{figure}
  67. \centering
  68. \includegraphics[width=0.5\columnwidth]{figures/pn_linguistic.pdf}
  69. \caption{Linguistic conformance of a petri net model.}
  70. \label{fig:pn_linguistic}
  71. \end{figure}
  72. \subsection{Ontological Conformance}
  73. The final conformance dimension is \textit{ontological conformance}, which relates purely to the semantics of the model.
  74. It is also one of the views offered to users, but is not related to the structure of the model, only to the properties the model satisfies.
  75. As it relates to semantics, execution of the model is required.
  76. Depending on the property of interest, the algorithm executed varies from, for example, simulation (\textit{e.g.}, trace satisfies some property) to state space analysis (\textit{e.g.}, deadlocking system).
  77. The algorithm to be executed often again relates back to the physical dimension, as this is where the implementation is defined in case the implementation language is used.
  78. In our petri net example, this relates to the properties satisfied by the petri net, such as deadlocking, safety, or reachability.
  79. Figure~\ref{fig:pn_ontological} represents a petri net without any tokens and not generators, so the petri net is clearly deadlocking and not live.
  80. Ontologically speaking, the petri net thus conforms to the \textit{deadlocking} property and not to the \textit{live} property.
  81. This concept is again broader than petri nets only, and might also be applicable to formalisms that have similar sementics or properties.
  82. But while previous conformance relations focussed purely on static aspects of the model (\textit{i.e.}, structure and static semantics), this conformance dimension focusses exclusively on the semantics through execution.
  83. \begin{figure}
  84. \centering
  85. \includegraphics[width=0.5\columnwidth]{figures/pn_ontological.pdf}
  86. \caption{Ontological conformance of a petri net model.}
  87. \label{fig:pn_ontological}
  88. \end{figure}