|
@@ -538,14 +538,22 @@ 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 = \
|
|
|
|
|
|
+ action_code = \
|
|
"""
|
|
"""
|
|
include "primitives.alh"
|
|
include "primitives.alh"
|
|
Integer function value(host_model : Element, RHS_model : Element):
|
|
Integer function value(host_model : Element, RHS_model : Element):
|
|
\treturn 5!
|
|
\treturn 5!
|
|
"""
|
|
"""
|
|
|
|
|
|
- constructors = get_constructor(constraint_code)
|
|
|
|
|
|
+ constraint_code = \
|
|
|
|
+ """
|
|
|
|
+include "primitives.alh"
|
|
|
|
+Boolean function constraint(host_model : Element, name : String):
|
|
|
|
+\treturn value_eq(host_model["model"][name], 3)!
|
|
|
|
+ """
|
|
|
|
+
|
|
|
|
+ constructor_action = get_constructor(action_code)
|
|
|
|
+ constructor_constraint = get_constructor(constraint_code)
|
|
|
|
|
|
self.assertTrue(run_file(all_files,
|
|
self.assertTrue(run_file(all_files,
|
|
["new", "PetriNets", "pn",
|
|
["new", "PetriNets", "pn",
|
|
@@ -574,6 +582,8 @@ Integer function value(host_model : Element, RHS_model : Element):
|
|
"instantiate", "LHS_contains", "", "lhs", "p_tokens",
|
|
"instantiate", "LHS_contains", "", "lhs", "p_tokens",
|
|
"attr_add", "tokens", "label", "0_tokens",
|
|
"attr_add", "tokens", "label", "0_tokens",
|
|
"attr_add", "p_tokens", "label", "1_p_tokens",
|
|
"attr_add", "p_tokens", "label", "1_p_tokens",
|
|
|
|
+ "attr_add_code", "tokens", "constraint",
|
|
|
|
+ ] + constructor_constraint + [
|
|
"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", "pt", "label", "4_pt",
|
|
"attr_add", "pt", "label", "4_pt",
|
|
@@ -593,7 +603,7 @@ Integer function value(host_model : Element, RHS_model : Element):
|
|
"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_code", "tokens", "value",
|
|
"attr_add_code", "tokens", "value",
|
|
- ] + constructors + [
|
|
|
|
|
|
+ ] + constructor_action + [
|
|
"exit",
|
|
"exit",
|
|
"transform", "pn", "pn_LHS", "pn_RHS",
|
|
"transform", "pn", "pn_LHS", "pn_RHS",
|
|
"load", "pn",
|
|
"load", "pn",
|
|
@@ -601,6 +611,8 @@ Integer function value(host_model : Element, RHS_model : Element):
|
|
"verify",
|
|
"verify",
|
|
"read",
|
|
"read",
|
|
"p1",
|
|
"p1",
|
|
|
|
+ "read",
|
|
|
|
+ "p2",
|
|
"exit",
|
|
"exit",
|
|
],
|
|
],
|
|
None, "PO"))
|
|
None, "PO"))
|