|
@@ -2131,3 +2131,195 @@ class TestModelverseCore(unittest.TestCase):
|
|
|
]),
|
|
|
"Ready for command...",
|
|
|
]))
|
|
|
+
|
|
|
+ def test_process_model_simple_pn(self):
|
|
|
+ self.assertTrue(run_file(all_files,
|
|
|
+ [ "root", "root", "root",
|
|
|
+ "model_add",
|
|
|
+ "SimpleClassDiagrams",
|
|
|
+ "PetriNet",
|
|
|
+ ] + get_model_constructor(open("integration/code/pn_design.mvc", "r").read()) + [
|
|
|
+ "model_add",
|
|
|
+ "SimpleClassDiagrams",
|
|
|
+ "ReachabilityGraph",
|
|
|
+ ] + get_model_constructor(open("integration/code/reachability_graph.mvc", "r").read()) + [
|
|
|
+ "model_list",
|
|
|
+ "transformation_add_MT_language",
|
|
|
+ "PetriNet",
|
|
|
+ "",
|
|
|
+ "PetriNet_RAM",
|
|
|
+ "transformation_add_MT_language",
|
|
|
+ "ReachabilityGraph",
|
|
|
+ "",
|
|
|
+ "ReachabilityGraph_RAM",
|
|
|
+ "transformation_add_MT",
|
|
|
+ "PetriNet_RAM",
|
|
|
+ "",
|
|
|
+ "PetriNet",
|
|
|
+ "",
|
|
|
+ "initialize_PN",
|
|
|
+ ] + get_model_constructor(open("integration/code/initialize_PN.mvc", "r").read()) + [
|
|
|
+ "transformation_add_MANUAL",
|
|
|
+ "PetriNet",
|
|
|
+ "",
|
|
|
+ "PetriNet",
|
|
|
+ "",
|
|
|
+ "refine_PN",
|
|
|
+ "transformation_add_AL",
|
|
|
+ "PetriNet",
|
|
|
+ "",
|
|
|
+ "ReachabilityGraph",
|
|
|
+ "",
|
|
|
+ "reachability",
|
|
|
+ ] + get_constructor(open("integration/code/reachability.alc", "r").read()) + [
|
|
|
+ "transformation_add_MT",
|
|
|
+ "ReachabilityGraph_RAM",
|
|
|
+ "ReachabilityGraph",
|
|
|
+ "",
|
|
|
+ "",
|
|
|
+ "reachability_print",
|
|
|
+ ] + get_model_constructor(open("integration/code/reachabilitygraph_print.mvc", "r").read()) + [
|
|
|
+ "model_add",
|
|
|
+ "ProcessModel",
|
|
|
+ "pn_reachability",
|
|
|
+ ] + get_model_constructor(open("integration/code/pm_pn_reachability.mvc", "r").read()) + [
|
|
|
+ "model_list",
|
|
|
+ "process_execute",
|
|
|
+ "pn_reachability",
|
|
|
+ "my_",
|
|
|
+ "instantiate",
|
|
|
+ "PetriNet/Place",
|
|
|
+ "crit_1",
|
|
|
+ "attr_add",
|
|
|
+ "crit_1",
|
|
|
+ "name",
|
|
|
+ "crit_1",
|
|
|
+ "attr_add",
|
|
|
+ "crit_1",
|
|
|
+ "tokens",
|
|
|
+ 0,
|
|
|
+ "instantiate",
|
|
|
+ "PetriNet/Place",
|
|
|
+ "crit_2",
|
|
|
+ "attr_add",
|
|
|
+ "crit_2",
|
|
|
+ "name",
|
|
|
+ "crit_2",
|
|
|
+ "attr_add",
|
|
|
+ "crit_2",
|
|
|
+ "tokens",
|
|
|
+ 0,
|
|
|
+ "instantiate",
|
|
|
+ "PetriNet/Place",
|
|
|
+ "free",
|
|
|
+ "attr_add",
|
|
|
+ "free",
|
|
|
+ "name",
|
|
|
+ "free",
|
|
|
+ "attr_add",
|
|
|
+ "free",
|
|
|
+ "tokens",
|
|
|
+ 1,
|
|
|
+ "instantiate",
|
|
|
+ "PetriNet/Transition",
|
|
|
+ "acq_1",
|
|
|
+ "attr_add",
|
|
|
+ "acq_1",
|
|
|
+ "name",
|
|
|
+ "acq_1",
|
|
|
+ "instantiate",
|
|
|
+ "PetriNet/Transition",
|
|
|
+ "acq_2",
|
|
|
+ "attr_add",
|
|
|
+ "acq_2",
|
|
|
+ "name",
|
|
|
+ "acq_2",
|
|
|
+ "instantiate",
|
|
|
+ "PetriNet/Transition",
|
|
|
+ "rel_1",
|
|
|
+ "attr_add",
|
|
|
+ "rel_1",
|
|
|
+ "name",
|
|
|
+ "rel_1",
|
|
|
+ "instantiate",
|
|
|
+ "PetriNet/Transition",
|
|
|
+ "rel_2",
|
|
|
+ "attr_add",
|
|
|
+ "rel_2",
|
|
|
+ "name",
|
|
|
+ "rel_2",
|
|
|
+ "instantiate",
|
|
|
+ "PetriNet/P2T",
|
|
|
+ "a1i",
|
|
|
+ "free",
|
|
|
+ "acq_1",
|
|
|
+ "attr_add",
|
|
|
+ "a1i",
|
|
|
+ "weight",
|
|
|
+ 1,
|
|
|
+ "instantiate",
|
|
|
+ "PetriNet/T2P",
|
|
|
+ "a1o",
|
|
|
+ "acq_1",
|
|
|
+ "crit_1",
|
|
|
+ "attr_add",
|
|
|
+ "a1o",
|
|
|
+ "weight",
|
|
|
+ 1,
|
|
|
+ "instantiate",
|
|
|
+ "PetriNet/P2T",
|
|
|
+ "a2i",
|
|
|
+ "free",
|
|
|
+ "acq_2",
|
|
|
+ "attr_add",
|
|
|
+ "a2i",
|
|
|
+ "weight",
|
|
|
+ 1,
|
|
|
+ "instantiate",
|
|
|
+ "PetriNet/T2P",
|
|
|
+ "a2o",
|
|
|
+ "acq_2",
|
|
|
+ "crit_2",
|
|
|
+ "attr_add",
|
|
|
+ "a2o",
|
|
|
+ "weight",
|
|
|
+ 1,
|
|
|
+ "instantiate",
|
|
|
+ "PetriNet/P2T",
|
|
|
+ "r1i",
|
|
|
+ "crit_1",
|
|
|
+ "rel_1",
|
|
|
+ "attr_add",
|
|
|
+ "r1i",
|
|
|
+ "weight",
|
|
|
+ 1,
|
|
|
+ "instantiate",
|
|
|
+ "PetriNet/T2P",
|
|
|
+ "r1o",
|
|
|
+ "rel_1",
|
|
|
+ "free",
|
|
|
+ "attr_add",
|
|
|
+ "r1o",
|
|
|
+ "weight",
|
|
|
+ 1,
|
|
|
+ "instantiate",
|
|
|
+ "PetriNet/P2T",
|
|
|
+ "r2i",
|
|
|
+ "crit_2",
|
|
|
+ "rel_2",
|
|
|
+ "attr_add",
|
|
|
+ "r2i",
|
|
|
+ "weight",
|
|
|
+ 1,
|
|
|
+ "instantiate",
|
|
|
+ "PetriNet/T2P",
|
|
|
+ "r2o",
|
|
|
+ "rel_2",
|
|
|
+ "free",
|
|
|
+ "attr_add",
|
|
|
+ "r2o",
|
|
|
+ "weight",
|
|
|
+ 1,
|
|
|
+ "exit",
|
|
|
+ "model_list",
|
|
|
+ ], None))
|