|
@@ -113,9 +113,9 @@ String function conformance_scd(model : Element):
|
|
keys = dict_keys(model["model"])
|
|
keys = dict_keys(model["model"])
|
|
while (0 < list_len(keys)):
|
|
while (0 < list_len(keys)):
|
|
model_name = set_pop(keys)
|
|
model_name = set_pop(keys)
|
|
- log("Check " + model_name)
|
|
|
|
element = model["model"][model_name]
|
|
element = model["model"][model_name]
|
|
type_name = reverseKeyLookup(metamodel["model"], dict_read_node(typing, element))
|
|
type_name = reverseKeyLookup(metamodel["model"], dict_read_node(typing, element))
|
|
|
|
+ log((("Check " + model_name) + " : ") + type_name)
|
|
|
|
|
|
if (bool_not(dict_in_node(typing, element))):
|
|
if (bool_not(dict_in_node(typing, element))):
|
|
return "Model has no type specified: " + model_name
|
|
return "Model has no type specified: " + model_name
|
|
@@ -123,8 +123,9 @@ String function conformance_scd(model : Element):
|
|
if (bool_not(set_in_node(metamodel["model"], dict_read_node(typing, element)))):
|
|
if (bool_not(set_in_node(metamodel["model"], dict_read_node(typing, element)))):
|
|
return "Type of element not in specified metamodel: " + model_name
|
|
return "Type of element not in specified metamodel: " + model_name
|
|
|
|
|
|
- if (bool_not(is_nominal_instance(model, model_name, type_name))):
|
|
|
|
- return "Element is not an instance of its specified type: " + model_name
|
|
|
|
|
|
+ // This is true by definition of is_nominal_instance
|
|
|
|
+ //if (bool_not(is_nominal_instance(model, model_name, type_name))):
|
|
|
|
+ // return "Element is not an instance of its specified type: " + model_name
|
|
|
|
|
|
if (is_edge(element)):
|
|
if (is_edge(element)):
|
|
src_model = reverseKeyLookup(model["model"], read_edge_src(element))
|
|
src_model = reverseKeyLookup(model["model"], read_edge_src(element))
|
|
@@ -146,6 +147,7 @@ String function conformance_scd(model : Element):
|
|
// First the incoming, so we are at B in the above figure
|
|
// First the incoming, so we are at B in the above figure
|
|
if (bool_not(dict_in(spo_cache, type_name))):
|
|
if (bool_not(dict_in(spo_cache, type_name))):
|
|
dict_add(spo_cache, type_name, selectPossibleOutgoing(metamodel, type_name, dict_keys(cardinalities)))
|
|
dict_add(spo_cache, type_name, selectPossibleOutgoing(metamodel, type_name, dict_keys(cardinalities)))
|
|
|
|
+
|
|
check_list = spo_cache[type_name]
|
|
check_list = spo_cache[type_name]
|
|
while (0 < list_len(check_list)):
|
|
while (0 < list_len(check_list)):
|
|
check_type = set_pop(check_list)
|
|
check_type = set_pop(check_list)
|
|
@@ -171,6 +173,7 @@ String function conformance_scd(model : Element):
|
|
// Identical, but for outgoing, and thus for A in the figure
|
|
// Identical, but for outgoing, and thus for A in the figure
|
|
if (bool_not(dict_in(spi_cache, type_name))):
|
|
if (bool_not(dict_in(spi_cache, type_name))):
|
|
dict_add(spi_cache, type_name, selectPossibleIncoming(metamodel, type_name, dict_keys(cardinalities)))
|
|
dict_add(spi_cache, type_name, selectPossibleIncoming(metamodel, type_name, dict_keys(cardinalities)))
|
|
|
|
+
|
|
check_list = spi_cache[type_name]
|
|
check_list = spi_cache[type_name]
|
|
while (0 < list_len(check_list)):
|
|
while (0 < list_len(check_list)):
|
|
check_type = set_pop(check_list)
|
|
check_type = set_pop(check_list)
|
|
@@ -195,8 +198,10 @@ String function conformance_scd(model : Element):
|
|
|
|
|
|
Element constraint_function
|
|
Element constraint_function
|
|
constraint_function = read_attribute(metamodel, reverseKeyLookup(metamodel["model"], dict_read_node(typing, element)), "constraint")
|
|
constraint_function = read_attribute(metamodel, reverseKeyLookup(metamodel["model"], dict_read_node(typing, element)), "constraint")
|
|
|
|
+ log((("Constraint for " + model_name) + ": ") + cast_e2s(constraint_function))
|
|
if (element_neq(constraint_function, read_root())):
|
|
if (element_neq(constraint_function, read_root())):
|
|
String result
|
|
String result
|
|
|
|
+ log("Execute constraint")
|
|
result = constraint_function(model, model_name)
|
|
result = constraint_function(model, model_name)
|
|
if (result != "OK"):
|
|
if (result != "OK"):
|
|
return result
|
|
return result
|