浏览代码

Temporary commit

Yentl Van Tendeloo 8 年之前
父节点
当前提交
6b92cddebb
共有 2 个文件被更改,包括 14 次插入19 次删除
  1. 0 6
      bootstrap/transform.alc
  2. 14 13
      integration/test_pn_interface.py

+ 0 - 6
bootstrap/transform.alc

@@ -297,10 +297,8 @@ Boolean function transform_composite(host_model : Element, schedule_model : Elem
 
 	current = set_pop(allAssociationDestinations(schedule_model, composite, "Initial"))
 	while (is_nominal_instance(schedule_model, current, "Rule")):
-		log("Exec composite: " + current)
 		// Still a rule that we must execute
 		typename = reverseKeyLookup(schedule_model["metamodel"]["model"], dict_read_node(schedule_model["type_mapping"], schedule_model["model"][current]))
-		log("Type: " + typename)
 		if (typename == "Atomic"):
 			result = transform_atomic(host_model, schedule_model, current)
 		elif (typename == "Query"):
@@ -324,11 +322,8 @@ Boolean function transform_atomic(host_model : Element, schedule_model : Element
 	Element mappings
 	String LHS
 	Element mapping
-	log("Exec atomic: " + current)
 	LHS = set_pop(allAssociationDestinations(schedule_model, current, "AtomicLHS"))
-	log("Got LHS: " + LHS)
 	mappings = match(host_model, schedule_model, LHS)
-	log("Matched!")
 
 	if (read_nr_out(mappings) > 0):
 		// Pick one!
@@ -348,7 +343,6 @@ Boolean function transform_query(host_model : Element, schedule_model : Element,
 	LHS = set_pop(allAssociationDestinations(schedule_model, current, "QueryLHS"))
 	mappings = match(host_model, schedule_model, LHS)
 
-	log("Exec query: " + current)
 	if (read_nr_out(mappings) > 0):
 		return True!
 	else:

+ 14 - 13
integration/test_pn_interface.py

@@ -629,24 +629,24 @@ Void function action(host_model : Element, name : String, mapping : Element):
                 "attr_add", "p2t2", "weight", 1,
                 "exit",
              "ramify", "PetriNets_runtime",
-             # Rule 1: mark transition to execute
              "new", "PetriNets_runtime_SCHEDULE", "pn_simulate",
-                "instantiate", "LHS", "lhs",
-                "instantiate", "Pre_Transition", "pre_t",
-                "attr_add", "pre_t", "label", "0",
-                "attr_add_code", "pre_t", "constraint", 
+                # Rule 1: mark transition to execute
+                "instantiate", "LHS", "lhs_mark",
+                "instantiate", "Pre_Transition", "pre_mark_t",
+                "attr_add", "pre_mark_t", "label", "0",
+                "attr_add_code", "pre_mark_t", "constraint", 
             ] + constructor_mark_constraint + [
-                "instantiate", "LHS_contains", "", "lhs", "pre_t",
-                "instantiate", "RHS", "rhs",
-                "instantiate", "Post_Transition", "post_t",
-                "attr_add", "post_t", "label", "0",
-                "attr_add_code", "post_t", "action",
+                "instantiate", "LHS_contains", "", "lhs_mark", "pre_mark_t",
+                "instantiate", "RHS", "rhs_mark",
+                "instantiate", "Post_Transition", "post_mark_t",
+                "attr_add", "post_mark_t", "label", "0",
+                "attr_add_code", "post_mark_t", "action",
             ] + constructor_mark_action + [
-                "instantiate", "RHS_contains", "", "rhs", "post_t",
+                "instantiate", "RHS_contains", "", "rhs_mark", "post_mark_t",
                 "instantiate", "Composite", "main",
                 "instantiate", "Atomic", "mark",
-                "instantiate", "AtomicLHS", "", "mark", "lhs",
-                "instantiate", "AtomicRHS", "", "mark", "rhs",
+                "instantiate", "AtomicLHS", "", "mark", "lhs_mark",
+                "instantiate", "AtomicRHS", "", "mark", "rhs_mark",
                 "instantiate", "Success", "success",
                 "instantiate", "Failure", "failure",
                 "instantiate", "Contains", "", "main", "mark",
@@ -655,6 +655,7 @@ Void function action(host_model : Element, name : String, mapping : Element):
                 "instantiate", "OnSuccess", "", "mark", "success",
                 "instantiate", "OnFailure", "", "mark", "failure",
                 "instantiate", "Initial", "", "main", "mark",
+                # Rule 2: consume tokens going into marked transition
                 "exit",
              "transform", "pn", "pn_simulate",
              "load", "pn",