Yentl Van Tendeloo před 8 roky
rodič
revize
1c2eb18c90

+ 10 - 2
core/core_algorithm.alc

@@ -455,12 +455,17 @@ Boolean function pm_finished(worklist : Element, pm : String):
 	finished = allInstances(pm, "Finish")
 	i = 0
 	cnt = read_nr_out(finished)
+	log("Finished elements: " + set_to_string(finished))
 
+	log("Check finished")
 	while (i < cnt):
 		// Check each finished element individually
-		if (set_in(worklist, read_edge_dst(read_out(finished, i)))):
+		log("Check element " + cast_v2s(dict_read(read_edge_dst(read_out(worklist, i)), 0)))
+		if (set_in(finished, dict_read(read_edge_dst(read_out(worklist, i)), 0))):
+			log("Yes")
 			return True!
 		i = i + 1
+	log("NO")
 
 	return False!
 
@@ -482,7 +487,6 @@ Boolean function enact_action(pm : Element, element : String, prefix : String, u
 
 	// TODO use the prefix for data locations (in model write/read in MvC)
 
-	log("Enacting action " + cast_v2s(read_attribute(pm, element, "name")))
 	// Read out the referenced element from the MvC
 	transformation_id = get_model_id(read_attribute(pm, element, "name"))
 
@@ -695,6 +699,8 @@ Void function enact_PM(pm : Element, prefix : String, user_id : String):
 		element = tuple[0]
 		result = tuple[1]
 
+		log("Enacting " + cast_v2s(element))
+
 		// Find the type (to see what to do with it)
 		//   this does not yet yield the type of transformation, if it is an Execution
 		type = read_type(pm, element)
@@ -749,8 +755,10 @@ Void function enact_PM(pm : Element, prefix : String, user_id : String):
 		String next
 		while (read_nr_out(all_next) > 0):
 			next = set_pop(all_next)
+			log("Adding to worklist: " + next)
 			set_add(worklist, create_tuple(next, result))
 
+	log("FINISHED")
 	// Reached a finish element, so stop
 	return !
 

+ 0 - 4
integration/code/reachabilitygraph_print.mvc

@@ -23,11 +23,9 @@ ReachabilityGraph_RAM reachabilitygraph_print {
                             String place
                             dict_values = create_node()
                             all_values = allAssociationDestinations(model, name, "ReachabilityGraph/Contains")
-                            log("All values: " + set_to_string(all_values))
                             while (read_nr_out(all_values) > 0):
                                 place = set_pop(all_values)
                                 dict_add(dict_values, read_attribute(model, place, "name"), read_attribute(model, place, "tokens"))
-                            log((cast_v2s(read_attribute(model, name, "name")) + ": ") + dict_to_string(dict_values))
                             output((cast_v2s(read_attribute(model, name, "name")) + ": ") + dict_to_string(dict_values))
                             return!
                         $
@@ -58,8 +56,6 @@ ReachabilityGraph_RAM reachabilitygraph_print {
                     label = "2"
                     action = $
                         Void function action(model : Element, name : String, mapping : Element):
-                            log("Transition action")
-                            log((((cast_v2s(read_attribute(model, mapping["0"], "name")) + " --[") + cast_v2s(read_attribute(model, name, "name"))) + "]--> ") + cast_v2s(read_attribute(model, mapping["1"], "name")))
                             output((((cast_v2s(read_attribute(model, mapping["0"], "name")) + " --[") + cast_v2s(read_attribute(model, name, "name"))) + "]--> ") + cast_v2s(read_attribute(model, mapping["1"], "name")))
                             return!
                         $

+ 7 - 1
integration/test_mvc.py

@@ -2105,6 +2105,11 @@ class TestModelverseCore(unittest.TestCase):
                         "Value of attribute?",
                         "Added attribute!",
                         "Please give your command.",
+                set(['"0": {"p1": 1, }',
+                     '"1": {"p1": 0, }',
+                    ]),
+                set(['"0" --["t1"]--> "1"',
+                    ]),
                 "Ready for command...",
                 # model_list
                 model_list |
@@ -2118,7 +2123,8 @@ class TestModelverseCore(unittest.TestCase):
                      "  pn_reachability : ProcessModel",
                      "  PetriNet_RAM : SimpleClassDiagrams",
                      "  ReachabilityGraph_RAM : SimpleClassDiagrams",
-                     "  my_PN : PetriNet",
+                     "  my_pn : PetriNet",
+                     "  my_reachability : ReachabilityGraph",
                      "  __merged_PetriNet_RAM : SimpleClassDiagrams",
                      "  __merged_ReachabilityGraph_RAM : SimpleClassDiagrams",
                      "  __merged_refine_PN : SimpleClassDiagrams",