|
@@ -456,7 +456,6 @@ Element function constraint(model : Element, name : String):
|
|
"""
|
|
"""
|
|
|
|
|
|
constructors = get_constructor(constraint_code)
|
|
constructors = get_constructor(constraint_code)
|
|
- print(constructors)
|
|
|
|
|
|
|
|
self.assertTrue(run_file(all_files,
|
|
self.assertTrue(run_file(all_files,
|
|
["new", "SimpleClassDiagrams", "RPGame",
|
|
["new", "SimpleClassDiagrams", "RPGame",
|
|
@@ -496,7 +495,7 @@ Element function constraint(model : Element, name : String):
|
|
"attr_add", "tile_top", "target_upper_cardinality", 1,
|
|
"attr_add", "tile_top", "target_upper_cardinality", 1,
|
|
"attr_add", "tile_bottom", "source_upper_cardinality", 1,
|
|
"attr_add", "tile_bottom", "source_upper_cardinality", 1,
|
|
"attr_add", "tile_bottom", "target_upper_cardinality", 1,
|
|
"attr_add", "tile_bottom", "target_upper_cardinality", 1,
|
|
- "constrain", "Tile",
|
|
|
|
|
|
+ "attr_add_code", "Tile", "constraint",
|
|
] + constructors + ["verify"] + ["exit"] + [
|
|
] + constructors + ["verify"] + ["exit"] + [
|
|
"new", "RPGame", "my_game",
|
|
"new", "RPGame", "my_game",
|
|
"instantiate", "Scene", "scene",
|
|
"instantiate", "Scene", "scene",
|
|
@@ -539,6 +538,15 @@ Element function constraint(model : Element, name : String):
|
|
mode))
|
|
mode))
|
|
|
|
|
|
def test_po_pn_interface_transform(self):
|
|
def test_po_pn_interface_transform(self):
|
|
|
|
+ constraint_code = \
|
|
|
|
+ """
|
|
|
|
+include "primitives.alh"
|
|
|
|
+Integer function value(host_model : Element, RHS_model : Element):
|
|
|
|
+\treturn 5!
|
|
|
|
+ """
|
|
|
|
+
|
|
|
|
+ constructors = get_constructor(constraint_code)
|
|
|
|
+
|
|
self.assertTrue(run_file(all_files,
|
|
self.assertTrue(run_file(all_files,
|
|
["new", "PetriNets", "pn",
|
|
["new", "PetriNets", "pn",
|
|
"instantiate", "Place", "p1",
|
|
"instantiate", "Place", "p1",
|
|
@@ -573,20 +581,19 @@ Element function constraint(model : Element, name : String):
|
|
"new", "PetriNets_POST", "pn_RHS",
|
|
"new", "PetriNets_POST", "pn_RHS",
|
|
"instantiate", "RHS", "rhs",
|
|
"instantiate", "RHS", "rhs",
|
|
"instantiate", "Post_Place", "p",
|
|
"instantiate", "Post_Place", "p",
|
|
- "instantiate", "Post_Place", "p2",
|
|
|
|
"instantiate", "Post_Transition", "t",
|
|
"instantiate", "Post_Transition", "t",
|
|
"instantiate", "Post_Natural", "tokens",
|
|
"instantiate", "Post_Natural", "tokens",
|
|
"instantiate", "Post_Place_tokens", "p_tokens", "p", "tokens",
|
|
"instantiate", "Post_Place_tokens", "p_tokens", "p", "tokens",
|
|
"instantiate", "RHS_contains", "", "rhs", "p",
|
|
"instantiate", "RHS_contains", "", "rhs", "p",
|
|
- "instantiate", "RHS_contains", "", "rhs", "p2",
|
|
|
|
"instantiate", "RHS_contains", "", "rhs", "t",
|
|
"instantiate", "RHS_contains", "", "rhs", "t",
|
|
"instantiate", "RHS_contains", "", "rhs", "p_tokens",
|
|
"instantiate", "RHS_contains", "", "rhs", "p_tokens",
|
|
"instantiate", "RHS_contains", "", "rhs", "tokens",
|
|
"instantiate", "RHS_contains", "", "rhs", "tokens",
|
|
- "attr_add", "tokens", "label", "0_tokens",
|
|
|
|
- "attr_add", "p_tokens", "label", "1_p_tokens",
|
|
|
|
|
|
+ "attr_add", "tokens", "label", "5_tokens",
|
|
|
|
+ "attr_add", "p_tokens", "label", "6_p_tokens",
|
|
"attr_add", "p", "label", "2_p",
|
|
"attr_add", "p", "label", "2_p",
|
|
"attr_add", "t", "label", "3_t",
|
|
"attr_add", "t", "label", "3_t",
|
|
- "attr_add", "p2", "label", "5_p",
|
|
|
|
|
|
+ "attr_add_code", "tokens", "value",
|
|
|
|
+ ] + constructors + [
|
|
"exit",
|
|
"exit",
|
|
"transform", "pn", "pn_LHS", "pn_RHS",
|
|
"transform", "pn", "pn_LHS", "pn_RHS",
|
|
"load", "pn",
|
|
"load", "pn",
|