Browse Source

Some more information/ideas in the AToMPM conformance relation

Yentl Van Tendeloo 7 years ago
parent
commit
e70044eb9b
2 changed files with 33 additions and 3 deletions
  1. 32 2
      models/Conformance/AToMPM.alc
  2. 1 1
      wrappers/modelverse_SCCD.py

+ 32 - 2
models/Conformance/AToMPM.alc

@@ -1,4 +1,6 @@
 include "primitives.alh"
+include "object_operations.alh"
+include "modelling.alh"
 
 Boolean function main(model : Element):
 	// Contains three types of models: model, metamodel, and type_mapping.
@@ -8,11 +10,39 @@ Boolean function main(model : Element):
 	// Thus only the check for multiple inheritance is being done, which checks for attributes.
 	// A full example is given in the Modelverse's internal conformance relation.
 
+	// TODO should the incoming "model" be typed by conformance bottom all the time, as otherwise the mapping is already done beforehand?
+	// TODO similarly for the metamodel: we can't be sure what comes out here
+	// TODO only thing we are sure about is the type mapping
+
+	log("Performing conformance check!")
+
 	// Find all instances of classes
+	// First, find the class types
+	Element classes
+	classes = allInstances(model, "metamodel/Class")
+	log("Got classes: " + set_to_string(classes))
 
-	// Figure out the set of required attributes
+	// TODO maybe make the type mapping links resemble a traceability link more, such that it is automatically merged in?
+	// TODO now the type_mapping is completely different and no relation can be inferred...
+	// TODO other option: make the type mapping refer to names/IDs instead of identifiers, although this is problematic in case we connect to ourselves (self-conformance!)
+	Element links
+	String link
+	links = allInstances(model, "type_mapping/TypeLink")
+	while (set_len(links) > 0):
+		link = set_pop(links)
+		log("Association connects: " + readAssociationSource(model, link) + " --> " + readAssociationDestination(model, link))
+
+	String class
+	Element instances
+	String instance
+	while (set_len(classes) > 0):
+		class = set_pop(classes)
+		instances = allAssociationOrigins(model, class, "type_mapping/TypeLink")
+		log("Got instances: " + set_to_string(instances))
+
+		while (set_len(instances) > 0):
+			instance = set_pop(instances)
 
 	// Check if each attribute is there, and satisfies the constraints
-	log("Performing conformance check!")
 
 	return True!

+ 1 - 1
wrappers/modelverse_SCCD.py

@@ -1,7 +1,7 @@
 """
 Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
 
-Date:   Thu May 24 16:50:33 2018
+Date:   Thu May 24 17:42:24 2018
 
 Model author: Yentl Van Tendeloo
 Model name:   MvK Server