|
@@ -63,16 +63,16 @@ Element function precompute_cardinalities(model : Element):
|
|
tuc = read_attribute(metamodel, key, "target_upper_cardinality")
|
|
tuc = read_attribute(metamodel, key, "target_upper_cardinality")
|
|
|
|
|
|
if (element_neq(slc, read_root())):
|
|
if (element_neq(slc, read_root())):
|
|
- dict_add(tmp_dict, "slc", slc)
|
|
|
|
|
|
+ dict_add_fast(tmp_dict, "slc", slc)
|
|
if (element_neq(suc, read_root())):
|
|
if (element_neq(suc, read_root())):
|
|
- dict_add(tmp_dict, "suc", suc)
|
|
|
|
|
|
+ dict_add_fast(tmp_dict, "suc", suc)
|
|
if (element_neq(tlc, read_root())):
|
|
if (element_neq(tlc, read_root())):
|
|
- dict_add(tmp_dict, "tlc", tlc)
|
|
|
|
|
|
+ dict_add_fast(tmp_dict, "tlc", tlc)
|
|
if (element_neq(tuc, read_root())):
|
|
if (element_neq(tuc, read_root())):
|
|
- dict_add(tmp_dict, "tuc", tuc)
|
|
|
|
|
|
+ dict_add_fast(tmp_dict, "tuc", tuc)
|
|
|
|
|
|
if (list_len(tmp_dict) > 0):
|
|
if (list_len(tmp_dict) > 0):
|
|
- dict_add(cardinalities, key, tmp_dict)
|
|
|
|
|
|
+ dict_add_fast(cardinalities, key, tmp_dict)
|
|
|
|
|
|
keys = allInstances(metamodel, "AttributeLink")
|
|
keys = allInstances(metamodel, "AttributeLink")
|
|
while (0 < list_len(keys)):
|
|
while (0 < list_len(keys)):
|
|
@@ -80,17 +80,17 @@ Element function precompute_cardinalities(model : Element):
|
|
tmp_dict = create_node()
|
|
tmp_dict = create_node()
|
|
|
|
|
|
// Attributes always have 1 max
|
|
// Attributes always have 1 max
|
|
- dict_add(tmp_dict, "tuc", 1)
|
|
|
|
|
|
+ dict_add_fast(tmp_dict, "tuc", 1)
|
|
|
|
|
|
// Depending on whether it is optional or not, the cardinality is changed
|
|
// Depending on whether it is optional or not, the cardinality is changed
|
|
optional = read_attribute(metamodel, key, "optional")
|
|
optional = read_attribute(metamodel, key, "optional")
|
|
if (optional):
|
|
if (optional):
|
|
- dict_add(tmp_dict, "tlc", 0)
|
|
|
|
|
|
+ dict_add_fast(tmp_dict, "tlc", 0)
|
|
else:
|
|
else:
|
|
- dict_add(tmp_dict, "tlc", 1)
|
|
|
|
|
|
+ dict_add_fast(tmp_dict, "tlc", 1)
|
|
|
|
|
|
if (list_len(tmp_dict) > 0):
|
|
if (list_len(tmp_dict) > 0):
|
|
- dict_add(cardinalities, key, tmp_dict)
|
|
|
|
|
|
+ dict_add_fast(cardinalities, key, tmp_dict)
|
|
|
|
|
|
return cardinalities!
|
|
return cardinalities!
|
|
|
|
|
|
@@ -166,7 +166,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_fast(spo_cache, type_name, selectPossibleOutgoing(metamodel, type_name, dict_keys(cardinalities)))
|
|
|
|
|
|
check_list = set_copy(spo_cache[type_name])
|
|
check_list = set_copy(spo_cache[type_name])
|
|
while (0 < list_len(check_list)):
|
|
while (0 < list_len(check_list)):
|
|
@@ -190,7 +190,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_fast(spi_cache, type_name, selectPossibleIncoming(metamodel, type_name, dict_keys(cardinalities)))
|
|
|
|
|
|
check_list = set_copy(spi_cache[type_name])
|
|
check_list = set_copy(spi_cache[type_name])
|
|
while (0 < list_len(check_list)):
|
|
while (0 < list_len(check_list)):
|
|
@@ -226,10 +226,12 @@ String function conformance_scd(model : Element):
|
|
// Check multiplicities, if they are defined (optional)
|
|
// Check multiplicities, if they are defined (optional)
|
|
Element metamodel_keys
|
|
Element metamodel_keys
|
|
String metamodel_element
|
|
String metamodel_element
|
|
|
|
+ Element mm_model
|
|
Integer attr_value
|
|
Integer attr_value
|
|
|
|
+ mm_model = metamodel["model"]
|
|
|
|
|
|
- metamodel_keys = dict_keys(metamodel["model"])
|
|
|
|
- while (0 < list_len(metamodel_keys)):
|
|
|
|
|
|
+ metamodel_keys = dict_keys(mm_model)
|
|
|
|
+ while (read_nr_out(metamodel_keys) > 0):
|
|
metamodel_element = set_pop(metamodel_keys)
|
|
metamodel_element = set_pop(metamodel_keys)
|
|
|
|
|
|
// Lower multiplicities
|
|
// Lower multiplicities
|
|
@@ -297,7 +299,7 @@ String function check_location_conformance(instance_location : String, type_loca
|
|
Element function set_model_constraints(model : Element, func : Element):
|
|
Element function set_model_constraints(model : Element, func : Element):
|
|
if (dict_in(model, "constraints")):
|
|
if (dict_in(model, "constraints")):
|
|
dict_delete(model, "constraints")
|
|
dict_delete(model, "constraints")
|
|
- dict_add(model, "constraints", func)
|
|
|
|
|
|
+ dict_add_fast(model, "constraints", func)
|
|
return model!
|
|
return model!
|
|
|
|
|
|
Element function generate_bottom_type_mapping(model : Element):
|
|
Element function generate_bottom_type_mapping(model : Element):
|
|
@@ -306,18 +308,20 @@ Element function generate_bottom_type_mapping(model : Element):
|
|
dict_delete(model, "type_mapping")
|
|
dict_delete(model, "type_mapping")
|
|
Element tm
|
|
Element tm
|
|
tm = create_node()
|
|
tm = create_node()
|
|
- dict_add(model, "type_mapping", tm)
|
|
|
|
|
|
+ dict_add_fast(model, "type_mapping", tm)
|
|
|
|
|
|
// Iterate over every element
|
|
// Iterate over every element
|
|
Element elem_keys
|
|
Element elem_keys
|
|
- Element elem
|
|
|
|
|
|
+ String elem
|
|
|
|
+
|
|
elem_keys = dict_keys(model["model"])
|
|
elem_keys = dict_keys(model["model"])
|
|
- while (0 < read_nr_out(elem_keys)):
|
|
|
|
|
|
+ while (read_nr_out(elem_keys) > 0):
|
|
elem = set_pop(elem_keys)
|
|
elem = set_pop(elem_keys)
|
|
|
|
+
|
|
if (is_edge(model["model"][elem])):
|
|
if (is_edge(model["model"][elem])):
|
|
- dict_add(tm, elem, "Edge")
|
|
|
|
|
|
+ dict_add_fast(tm, elem, "Edge")
|
|
else:
|
|
else:
|
|
- dict_add(tm, elem, "Node")
|
|
|
|
|
|
+ dict_add_fast(tm, elem, "Node")
|
|
|
|
|
|
return model!
|
|
return model!
|
|
|
|
|