Browse Source

Updated MetaDepth conformance semantics as well

Yentl Van Tendeloo 3 years ago
parent
commit
d449cc0843
3 changed files with 15 additions and 15 deletions
  1. 0 4
      models/Conformance/AToMPM.alc
  2. 14 10
      models/Conformance/MetaDepth.alc
  3. 1 1
      wrappers/modelverse_SCCD.py

+ 0 - 4
models/Conformance/AToMPM.alc

@@ -16,11 +16,7 @@ Boolean function main(model : Element):
 	Element classes
 	classes = allInstances(model, "metamodel/Class")
 
-	Element links
-	String link
 	Element type_mapping
-	type_mapping = dict_create()
-
 	Element instances
 	String instance
 	type_mapping = model["model"][set_pop(allInstances(model, "type_mapping/Root"))]

+ 14 - 10
models/Conformance/MetaDepth.alc

@@ -16,18 +16,22 @@ Boolean function main(model : Element):
 	Element classes
 	classes = allInstances(model, "metamodel/Class")
 
-	Element links
-	String link
 	Element type_mapping
-	type_mapping = dict_create()
+    Element instances
+    String instance
+    type_mapping = model["model"][set_pop(allInstances(model, "type_mapping/Root"))]
+
+	Element new_type_mapping
+    Element keys
+    String key
+    new_type_mapping = dict_create()
+    keys = dict_keys(type_mapping)
+    while (set_len(keys) > 0):
+        key = set_pop(keys)
+        dict_add(new_type_mapping, "model/" + key, "metamodel/" + cast_string(type_mapping[key]))
+
+    type_mapping = new_type_mapping
 
-	Element instances
-	String instance
-	instances = allInstances(model, "type_mapping/Instance")
-	while (set_len(instances) > 0):
-		instance = set_pop(instances)
-		dict_add(type_mapping, "model/" + string_replace(instance, "type_mapping/instance_", ""), "metamodel/" + string_replace(set_pop(allAssociationDestinations(model, instance, "type_mapping/TypeLink")), "type_mapping/type_", ""))
-	
 	// Check if each attribute is there, and satisfies the constraints
 	instances = dict_keys(type_mapping)
 	while (set_len(instances) > 0):

+ 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 31 08:03:22 2018
+Date:   Thu May 31 08:08:52 2018
 
 Model author: Yentl Van Tendeloo
 Model name:   MvK Server