|
@@ -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!
|