Browse Source

More info on conformance bottom

Yentl Van Tendeloo 5 years ago
parent
commit
317a9191b0
1 changed files with 33 additions and 1 deletions
  1. 33 1
      doc/conformance.rst

+ 33 - 1
doc/conformance.rst

@@ -110,4 +110,36 @@ This can be the case if no type mapping is specified at all, or if the current t
 Conformance Bottom
 ------------------
 
-TODO
+The Modelverse makes the Physical Type Model (PTM) available in the linguistic dimension in the form of the Conformance Bottom relation.
+For each model, it is possible to open it using its defined metamodels, but also as an instance of the *formalisms/Bottom* model.
+This metamodel has no special definition in the Modelverse, but it is relatively simple and does not constrain anything.
+As such, it is guaranteed that each model in the Modelverse will conform to it.
+Additionally, the model is very simple, meaning that it is possible to automatically deduce the type mapping::
+
+    >>> model_types("models/my_pn")
+    [("formalisms/PetriNets", "type_mappings/123", None)]
+    >>> element_list_nice("models/my_pn")
+    [{"__id": "__1", "__type": "Place", "tokens": 1, "name": "my_place"}]
+    >>> alter_context("models/my_pn", "formalisms/Bottom")
+    >>> element_list_nice("models/my_pn")
+    [{"__id": "__1", "__type": "Node"},
+     {"__id": "__234", "__type": "Node"},
+     ...]
+
+As the conformance bottom relation can be automatically deduced, this detection can also be triggered when executing activities.
+Indeed, when an activity is executed that consumes a model conforming to *formalisms/Bottom*, any possible model can be passed to it, and the conversions will happen automatically and the conformance bottom relation will also be stored explicitly afterwards::
+
+    >>> model_types("models/my_pn")
+    [("formalisms/PetriNets", "type_mappings/123", None)]
+    >>> transformation_execute_MT("models/count_nodes", {"model": "models/my_pn"}, {})
+    >>> model_types("models/my_pn")
+    [("formalisms/PetriNets", "type_mappings/123", None),
+     ("formalisms/Bottom", "type_mappings/456", None)]
+
+Note that the same is true for other metamodels to which conformance can be automatically deduced, such as the type mapping metamodel.
+
+When changes are made to the model in the context of conformance bottom, no typing information is created for the other metamodels, as indeed there is no notion of typing upon creation.
+As such, previously conforming models will no longer conform without also specifying the type of the newly created elements.
+In the future, we intend to add completely automated type mapping completion, thereby automatically finding an applicable type for the new elements.
+For now, the type mapping model has to be manually extended with typing information for the missing elements.
+A model with an incomplete type mapping will not be opened by the Modelverse, as it cannot guarantee that all operations would work!