Yentl Van Tendeloo 8 gadi atpakaļ
vecāks
revīzija
2aeae868fb

+ 27 - 13
core/core_algorithm.alc

@@ -481,7 +481,7 @@ Boolean function pm_finished(worklist : Element, pm : String):
 
 	return False!
 
-Element function execute_operation(operation_id : String, input_models : Element, output_metamodels : Element):
+Element function execute_operation(operation_id : String, input_models : Element, output_metamodels : Element, tracability_model : Element):
 	// Operations are always in-place and uses only a single metamodel
 	// Therefore, we must:
 	//		1) Find merged metamodel
@@ -507,6 +507,7 @@ Element function execute_operation(operation_id : String, input_models : Element
 	String metamodel_name
 	Element metamodel
 	String metamodel_ID
+	Boolean tracability
 
 	// 1) Find merged metamodel
 
@@ -561,6 +562,11 @@ Element function execute_operation(operation_id : String, input_models : Element
 
 		// 4) Split in different models depending on type
 
+		if (element_neq(tracability_model, read_root())):
+			tracability = True
+		else:
+			tracability = False
+
 		if (result):
 			model_tuples = create_node()
 			while (read_nr_out(output_metamodels) > 0):
@@ -568,7 +574,18 @@ Element function execute_operation(operation_id : String, input_models : Element
 				metamodel_name = read_attribute(core, metamodel_ID, "name")
 				metamodel = get_full_model(metamodel_ID)
 				set_add(model_tuples, create_tuple(metamodel_name, metamodel))
-			return model_split(merged_model, model_tuples, False)!
+
+			result = model_split(merged_model, model_tuples, tracability)
+
+			if (tracability):
+				Element new_tracability_model
+				new_tracability_model = result["__tracability"]
+				dict_overwrite(tracability_model, "model", new_tracability_model["model"])
+				dict_overwrite(tracability_model, "type_mapping", new_tracability_model["type_mapping"])
+				dict_overwrite(tracability_model, "metamodel", new_tracability_model["metamodel"])
+				dict_delete(result, "__tracability")
+
+			return result!
 		else:
 			return read_root()!
 
@@ -614,25 +631,20 @@ Boolean function enact_action(pm : Element, element : String, prefix : String, u
 		elem_name = read_attribute(pm, elem, "name")
 		dict_add(outputs, type_name, prefix + elem_name)
 
-	result = execute_operation(transformation_id, inputs, dict_keys(outputs))
+	result = execute_operation(transformation_id, inputs, dict_keys(outputs), read_root())
 
 	if (element_eq(result, read_root())):
 		// Something went wrong!
 		return False!
 	else:
-		log("Results: " + dict_to_string(result))
 		keys = dict_keys(result)
 		while (read_nr_out(keys) > 0):
 			key = set_pop(keys)
-			log("Expanding: " + key)
-			log("New name: " + cast_v2s(outputs[key]))
 			if (get_model_id(outputs[key]) == ""):
 				// New model
 				model_create(result[key], outputs[key], user_id, get_model_id(key), "Model")
-				log("New model!")
 			else:
 				model_overwrite(result[key], get_model_id(outputs[key]))
-				log("Overwrite!")
 
 	return result!
 
@@ -790,7 +802,8 @@ Void function user_function_skip_init(user_id : String):
 
 			output("Creating new model!")
 			output("Model type?")
-			type_id = get_model_id(input())
+			type = input()
+			type_id = get_model_id(type)
 			if (type_id != ""):
 				// Type exists
 				if (allow_read(user_id, type_id)):
@@ -810,7 +823,7 @@ Void function user_function_skip_init(user_id : String):
 				else:
 					output("Permission denied")
 			else:
-				output("Could not find type model!")
+				output("Could not find type model: " + type)
 
 		elif (cmd == "process_execute"):
 			// Execute a process model until it reaches termination
@@ -848,7 +861,8 @@ Void function user_function_skip_init(user_id : String):
 			String key
 
 			output("Which transformation do you want to execute?")
-			transformation_id = get_model_id(input())
+			transformation_id = input()
+			transformation_id = get_model_id(transformation_id)
 			if (transformation_id != ""):
 				if (allow_read(user_id, transformation_id)):
 					if (is_nominal_instance(core, transformation_id, "Transformation")):
@@ -865,7 +879,7 @@ Void function user_function_skip_init(user_id : String):
 									// Check for conformance to the requested metamodel
 									if (check_is_typed_by(source_model_ID, source)):
 										if (check_conformance(source_model_ID)):
-											set_add(inputs, source_model_ID)
+											set_add(inputs, source_model_name)
 											continue!
 										else:
 											output("Model has correct type but does not conform completely!")
@@ -897,7 +911,7 @@ Void function user_function_skip_init(user_id : String):
 									output("Permission denied; try again")
 									set_add(targets, target)
 
-						result = execute_operation(transformation_id, inputs, dict_keys(outputs))
+						result = execute_operation(transformation_id, inputs, dict_keys(outputs), read_root())
 
 						// Now write out the models again
 						if (element_eq(result, read_root())):

+ 0 - 3
integration/code/pm_pn_reachability.mvc

@@ -31,14 +31,11 @@ ProcessModel combo_reach {
 
     Produces (initializePN, pn) {}
     Consumes (refinePN, pn) {
-        name = "pn"
     }
     Produces (refinePN, pn) {}
     Consumes (reachability, pn) {
-        name = "pn"
     }
     Produces (reachability, reachability_graph) {}
     Consumes (reachability_print, reachability_graph) {
-        name = "reachability_graph"
     }
 }

+ 7 - 21
integration/code/pn_simulate.alc

@@ -5,23 +5,9 @@ include "model_management.alh"
 include "object_operations.alh"
 include "modelling.alh"
 
-Element function simulate(inputs : Element):
-	log("Start PN step!")
-	Element outputs
-	outputs = create_node()
-
-	log("Inputs: " + dict_to_string(inputs))
-	log("PN input: " + cast_e2s(inputs["PetriNets_Runtime"]))
-	log("Outgoing: " + set_to_string(dict_keys(inputs["PetriNets_Runtime"])))
-
-	// Copy over the model to the output dictionary
-	dict_add(outputs, "PetriNets_Runtime", model_copy(inputs["PetriNets_Runtime"]))
-
-	log("Copy OK!")
-
+Boolean function simulate(model : Element):
 	// Do a single simulation step
-	Element model
-	model = outputs["PetriNets_Runtime"]
+	log("Start PN step!")
 
 	// Find enabled transitions
 	Element all_transitions
@@ -31,7 +17,7 @@ Element function simulate(inputs : Element):
 	Element in_arcs
 	String arc_under_study
 
-	all_transitions = allInstances(model, "Transition")
+	all_transitions = allInstances(model, "PetriNets/Transition")
 	enabled_transitions = create_node()
 
 	while (0 < read_nr_out(all_transitions)):
@@ -39,7 +25,7 @@ Element function simulate(inputs : Element):
 		enabled = True
 
 		// Find all incoming transitions
-		in_arcs = allIncomingAssociationInstances(model, under_study, "P2T")
+		in_arcs = allIncomingAssociationInstances(model, under_study, "PetriNets/P2T")
 
 		while (0 < read_nr_out(in_arcs)):
 			arc_under_study = set_pop(in_arcs)
@@ -68,7 +54,7 @@ Element function simulate(inputs : Element):
 	String working_place
 	Integer new_value
 
-	workset = allIncomingAssociationInstances(model, transition, "P2T")
+	workset = allIncomingAssociationInstances(model, transition, "PetriNets/P2T")
 	while (0 < read_nr_out(workset)):
 		working_arc = set_pop(workset)
 		working_place = reverseKeyLookup(model["model"], read_edge_src(model["model"][working_arc]))
@@ -76,7 +62,7 @@ Element function simulate(inputs : Element):
 		instantiate_attribute(model, working_place, "tokens", new_value)
 
 	// Add tokens
-	workset = allOutgoingAssociationInstances(model, transition, "T2P")
+	workset = allOutgoingAssociationInstances(model, transition, "PetriNets/T2P")
 	while (0 < read_nr_out(workset)):
 		working_arc = set_pop(workset)
 		working_place = reverseKeyLookup(model["model"], read_edge_dst(model["model"][working_arc]))
@@ -85,4 +71,4 @@ Element function simulate(inputs : Element):
 
 	// Finish up
 	log("Finished PN Step!")
-	return outputs!
+	return True!

+ 31 - 36
integration/code/reachability.alc

@@ -2,12 +2,8 @@ include "primitives.alh"
 include "modelling.alh"
 include "object_operations.alh"
 
-Element function reachability_graph(params : Element, output_mms : Element):
-	Element result
-	Element model
+Boolean function reachability_graph(model : Element):
 	Element workset
-	Element out_model
-	Element in_model
 	Element transition_vectors_produce
 	Element transition_vectors_consume
 	Element all_transitions
@@ -37,44 +33,40 @@ Element function reachability_graph(params : Element, output_mms : Element):
 	Element cache
 	cache = create_node()
 
-	result = create_node()
-	out_model = instantiate_model(output_mms["ReachabilityGraph"])
-	in_model = params["pn"]
-
 	// Create a dictionary representation for each transition
 	transition_vectors_produce = create_node()
 	transition_vectors_consume = create_node()
-	all_transitions = allInstances(in_model, "Transition")
+	all_transitions = allInstances(model, "PetriNet/Transition")
 	while (read_nr_out(all_transitions) > 0):
 		transition = set_pop(all_transitions)
 
 		tv = create_node()
-		links = allIncomingAssociationInstances(in_model, transition, "P2T")
+		links = allIncomingAssociationInstances(model, transition, "PetriNet/P2T")
 		while (read_nr_out(links) > 0):
 			link = set_pop(links)
-			name = reverseKeyLookup(in_model["model"], read_edge_src(in_model["model"][link]))
-			link_weight = read_attribute(in_model, link, "weight")
+			name = reverseKeyLookup(model["model"], read_edge_src(model["model"][link]))
+			link_weight = read_attribute(model, link, "weight")
 			dict_add_fast(tv, name, link_weight)
 		dict_add_fast(transition_vectors_consume, transition, tv)
 
 		tv = create_node()
-		links = allOutgoingAssociationInstances(in_model, transition, "T2P")
+		links = allOutgoingAssociationInstances(model, transition, "PetriNet/T2P")
 		while (read_nr_out(links) > 0):
 			link = set_pop(links)
-			name = reverseKeyLookup(in_model["model"], read_edge_dst(in_model["model"][link]))
-			link_weight = read_attribute(in_model, link, "weight")
+			name = reverseKeyLookup(model["model"], read_edge_dst(model["model"][link]))
+			link_weight = read_attribute(model, link, "weight")
 			dict_add_fast(tv, name, link_weight)
 		dict_add_fast(transition_vectors_produce, transition, tv)
 
 	workset = create_node()
 
-	all_places = allInstances(in_model, "Place")
+	all_places = allInstances(model, "PetriNet/Place")
 	dict_repr = create_node()
 	while (read_nr_out(all_places) > 0):
 		place = set_pop(all_places)
-		dict_add_fast(dict_repr, place, read_attribute(in_model, place, "tokens"))
+		dict_add_fast(dict_repr, place, read_attribute(model, place, "tokens"))
 
-	all_transitions_original = allInstances(in_model, "Transition")
+	all_transitions_original = allInstances(model, "PetriNet/Transition")
 
 	mappings = create_node()
 	state_id = 0
@@ -85,15 +77,16 @@ Element function reachability_graph(params : Element, output_mms : Element):
 	set_add(workset, state_id)
 
 	// And add in the model itself
-	state = instantiate_node(out_model, "State", cast_i2s(state_id))
-	instantiate_attribute(out_model, state, "name", cast_i2s(state_id))
+	state = instantiate_node(model, "ReachabilityGraph/InitialState", cast_i2s(state_id))
+	instantiate_attribute(model, state, "name", cast_i2s(state_id))
+	instantiate_attribute(model, state, "error", False)
 	keys = dict_keys(dict_repr)
 	while (read_nr_out(keys) > 0):
 		key = set_pop(keys)
-		place = instantiate_node(out_model, "Place", "")
-		instantiate_attribute(out_model, place, "name", read_attribute(in_model, key, "name"))
-		instantiate_attribute(out_model, place, "tokens", dict_repr[key])
-		instantiate_link(out_model, "Contains", "", state, place)
+		place = instantiate_node(model, "ReachabilityGraph/Place", "")
+		instantiate_attribute(model, place, "name", read_attribute(model, key, "name"))
+		instantiate_attribute(model, place, "tokens", dict_repr[key])
+		instantiate_link(model, "ReachabilityGraph/Contains", "", state, place)
 
 	while (read_nr_out(workset) > 0):
 		state_id = set_pop(workset)
@@ -136,6 +129,7 @@ Element function reachability_graph(params : Element, output_mms : Element):
 
 				keys = dict_keys(reachable_states)
 				target_id = -1
+				Float start
 				while (read_nr_out(keys) > 0):
 					other_state_id = set_pop(keys)
 
@@ -154,33 +148,34 @@ Element function reachability_graph(params : Element, output_mms : Element):
 					set_add(workset, target_id)
 
 					// And add in the model itself
-					state = instantiate_node(out_model, "State", cast_i2s(target_id))
-					instantiate_attribute(out_model, state, "name", cast_i2s(target_id))
+					state = instantiate_node(model, "ReachabilityGraph/State", cast_i2s(target_id))
+					instantiate_attribute(model, state, "name", cast_i2s(target_id))
+					instantiate_attribute(model, state, "error", False)
 
 					keys = dict_keys(new_dict_repr)
 					Element sub
 					String name
 					while (read_nr_out(keys) > 0):
 						key = set_pop(keys)
-						name = read_attribute(in_model, key, "name")
+						name = read_attribute(model, key, "name")
 						if (bool_not(dict_in(cache, name))):
 							dict_add_fast(cache, name, create_node())
 						sub = cache[name]
 						if (bool_not(dict_in(sub, new_dict_repr[key]))):
-							place = instantiate_node(out_model, "Place", "")
-							instantiate_attribute(out_model, place, "name", name)
-							instantiate_attribute(out_model, place, "tokens", new_dict_repr[key])
+							place = instantiate_node(model, "ReachabilityGraph/Place", "")
+							instantiate_attribute(model, place, "name", name)
+							instantiate_attribute(model, place, "tokens", new_dict_repr[key])
 							dict_add_fast(sub, new_dict_repr[key], place)
 						else:
 							place = sub[new_dict_repr[key]]
-						instantiate_link(out_model, "Contains", "", state, place)
+						instantiate_link(model, "ReachabilityGraph/Contains", "", state, place)
 
 				// Anyway, we have found a transition, which we should store
 				dict_add_fast(mappings[state_id], transition, target_id)
 
 				// And also store it in the model itself
-				new_transition = instantiate_link(out_model, "Transition", "", cast_i2s(state_id), cast_i2s(target_id))
-				instantiate_attribute(out_model, new_transition, "name", read_attribute(in_model, transition, "name"))
+				new_transition = instantiate_link(model, "ReachabilityGraph/Transition", "", cast_i2s(state_id), cast_i2s(target_id))
+				instantiate_attribute(model, new_transition, "name", read_attribute(model, transition, "name"))
 
-	dict_add_fast(result, "ReachabilityGraph", out_model)
-	return result!
+	log("# reachable states: " + cast_v2s(next_id))
+	return True!

+ 7 - 0
integration/code/reachability_graph.mvc

@@ -5,10 +5,17 @@ include "modelling.alh"
 SimpleClassDiagrams ReachabilityGraph {
     SimpleAttribute String {}
     SimpleAttribute Natural {}
+    SimpleAttribute Boolean {}
 
     Class State {
         name : String
+        error : Boolean
     }
+    Class InitialState : State {
+        lower_cardinality = 1
+        upper_cardinality = 1
+    }
+
     Class Place {
         name : String
         tokens : Natural

+ 93 - 127
integration/test_mvc.py

@@ -318,9 +318,9 @@ class TestModelverseCore(unittest.TestCase):
                 set(["  PetriNets",
                     ]),
                 "",
-                "Which ones do you want to use as source (empty string to finish)?",
-                "Which ones do you want to use as target (empty string to finish)?",
-                "Name of new transformation?",
+                "Which metamodels do you want to use as source for the operation (empty string to finish)?",
+                "Which metamodels do you want to use as target for the operation (empty string to finish)?",
+                "Name of new operation?",
                 "Waiting for model constructors...",
                 "Ready for command...",
                 set(model_full_list) |
@@ -388,9 +388,9 @@ class TestModelverseCore(unittest.TestCase):
                 set(["  PetriNets",
                     ]),
                 "",
-                "Which ones do you want to use as source (empty string to finish)?",
-                "Which ones do you want to use as target (empty string to finish)?",
-                "Name of new transformation?",
+                "Which metamodels do you want to use as source for the operation (empty string to finish)?",
+                "Which metamodels do you want to use as target for the operation (empty string to finish)?",
+                "Name of new operation?",
                 "Waiting for model constructors...",
                 "Ready for command...",
                 set(["  200  root nobody   [ModelTransformation] PetriNets_Print : PetriNets_RAM"
@@ -464,22 +464,20 @@ class TestModelverseCore(unittest.TestCase):
                 "Supported metamodels:",
                 set(["  PetriNets",
                     ]),
-                "",
-                "Which ones do you want to use as source (empty string to finish)?",
-                "Which ones do you want to use as target (empty string to finish)?",
-                "Name of new transformation?",
+                "Which metamodels do you want to use as source for the operation (empty string to finish)?",
+                "Which metamodels do you want to use as target for the operation (empty string to finish)?",
+                "Name of new operation?",
                 "Waiting for model constructors...",
                 "Ready for command...",
                 set(["  200  root nobody   [ModelTransformation] PetriNets_Print : PetriNets_RAM"
                     ]),
                 "Ready for command...",
                 "Which transformation do you want to execute?",
-                "Which model to bind for source element PetriNets",
+                "Which model to bind for source type PetriNets",
                 set(['"p1" --> 1',
                      '"p2" --> 2',
                      '"p3" --> 3',
                     ]),
-                "Transformation executed with result: True",
                 "Ready for command...",
             ]))
 
@@ -689,10 +687,9 @@ class TestModelverseCore(unittest.TestCase):
                 set(["  PetriNets",
                      "  PetriNets_Runtime",
                     ]),
-                "",
-                "Which ones do you want to use as source (empty string to finish)?",
-                "Which ones do you want to use as target (empty string to finish)?",
-                "Name of new transformation?",
+                "Which metamodels do you want to use as source for the operation (empty string to finish)?",
+                "Which metamodels do you want to use as target for the operation (empty string to finish)?",
+                "Name of new operation?",
                 "Waiting for model constructors...",
                 "Ready for command...",
                 # transformation_add_MT
@@ -701,10 +698,9 @@ class TestModelverseCore(unittest.TestCase):
                 set(["  PetriNets",
                      "  PetriNets_Runtime",
                     ]),
-                "",
-                "Which ones do you want to use as source (empty string to finish)?",
-                "Which ones do you want to use as target (empty string to finish)?",
-                "Name of new transformation?",
+                "Which metamodels do you want to use as source for the operation (empty string to finish)?",
+                "Which metamodels do you want to use as target for the operation (empty string to finish)?",
+                "Name of new operation?",
                 "Waiting for model constructors...",
                 "Ready for command...",
                 # transformation_add_MT
@@ -713,10 +709,9 @@ class TestModelverseCore(unittest.TestCase):
                 set(["  PetriNets",
                      "  PetriNets_Runtime",
                     ]),
-                "",
-                "Which ones do you want to use as source (empty string to finish)?",
-                "Which ones do you want to use as target (empty string to finish)?",
-                "Name of new transformation?",
+                "Which metamodels do you want to use as source for the operation (empty string to finish)?",
+                "Which metamodels do you want to use as target for the operation (empty string to finish)?",
+                "Name of new operation?",
                 "Waiting for model constructors...",
                 "Ready for command...",
                 # transformation_add_MT
@@ -725,10 +720,9 @@ class TestModelverseCore(unittest.TestCase):
                 set(["  PetriNets",
                      "  PetriNets_Runtime",
                     ]),
-                "",
-                "Which ones do you want to use as source (empty string to finish)?",
-                "Which ones do you want to use as target (empty string to finish)?",
-                "Name of new transformation?",
+                "Which metamodels do you want to use as source for the operation (empty string to finish)?",
+                "Which metamodels do you want to use as target for the operation (empty string to finish)?",
+                "Name of new operation?",
                 "Waiting for model constructors...",
                 "Ready for command...",
                 # model_list
@@ -752,39 +746,34 @@ class TestModelverseCore(unittest.TestCase):
                 "Ready for command...",
                 # transformation_execute (pn_print)
                 "Which transformation do you want to execute?",
-                "Which model to bind for source element PetriNets",
+                "Which model to bind for source type PetriNets",
                 set(['"p1" --> 1',
                      '"p2" --> 2',
                      '"p3" --> 3',
                     ]),
-                "Transformation executed with result: True",
                 "Ready for command...",
                 # transformation_execute (pn_design_to_runtime)
                 "Which transformation do you want to execute?",
-                "Which model to bind for source element PetriNets",
+                "Which model to bind for source type PetriNets",
                 "Which model to create for target element PetriNets_Runtime",
-                "Transformation executed with result: True",
                 "Ready for command...",
                 # transformation_execute (pn_step)
                 "Which transformation do you want to execute?",
-                "Which model to bind for source element PetriNets_Runtime",
+                "Which model to bind for source type PetriNets_Runtime",
                 "Which model to create for target element PetriNets_Runtime",
-                "Transformation executed with result: True",
                 "Ready for command...",
                 # transformation_execute (pn_runtime_to_design)
                 "Which transformation do you want to execute?",
-                "Which model to bind for source element PetriNets_Runtime",
+                "Which model to bind for source type PetriNets_Runtime",
                 "Which model to create for target element PetriNets",
-                "Transformation executed with result: True",
                 "Ready for command...",
                 # transformation_execute (pn_print)
                 "Which transformation do you want to execute?",
-                "Which model to bind for source element PetriNets",
+                "Which model to bind for source type PetriNets",
                 set(['"p1" --> 0',
                      '"p2" --> 1',
                      '"p3" --> 5',
                     ]),
-                "Transformation executed with result: True",
                 "Ready for command...",
             ]))
 
@@ -794,23 +783,20 @@ class TestModelverseCore(unittest.TestCase):
             return [ \
                 # transformation_execute (pn_step)
                 "Which transformation do you want to execute?",
-                "Which model to bind for source element PetriNets_Runtime",
+                "Which model to bind for source type PetriNets_Runtime",
                 "Which model to create for target element PetriNets_Runtime",
-                "Transformation executed with result: True",
                 "Ready for command...",
                 # transformation_execute (pn_runtime_to_design)
                 "Which transformation do you want to execute?",
-                "Which model to bind for source element PetriNets_Runtime",
+                "Which model to bind for source type PetriNets_Runtime",
                 "Which model to create for target element PetriNets",
-                "Transformation executed with result: True",
                 "Ready for command...",
                 # transformation_execute (pn_print)
                 "Which transformation do you want to execute?",
-                "Which model to bind for source element PetriNets",
+                "Which model to bind for source type PetriNets",
                 None,
                 None,
                 None,
-                "Transformation executed with result: True",
                 "Ready for command...",
                 ]
 
@@ -1007,10 +993,9 @@ class TestModelverseCore(unittest.TestCase):
                 set(["  PetriNets",
                      "  PetriNets_Runtime",
                     ]),
-                "",
-                "Which ones do you want to use as source (empty string to finish)?",
-                "Which ones do you want to use as target (empty string to finish)?",
-                "Name of new transformation?",
+                "Which metamodels do you want to use as source for the operation (empty string to finish)?",
+                "Which metamodels do you want to use as target for the operation (empty string to finish)?",
+                "Name of new operation?",
                 "Waiting for model constructors...",
                 "Ready for command...",
                 # transformation_add_MT
@@ -1019,10 +1004,9 @@ class TestModelverseCore(unittest.TestCase):
                 set(["  PetriNets",
                      "  PetriNets_Runtime",
                     ]),
-                "",
-                "Which ones do you want to use as source (empty string to finish)?",
-                "Which ones do you want to use as target (empty string to finish)?",
-                "Name of new transformation?",
+                "Which metamodels do you want to use as source for the operation (empty string to finish)?",
+                "Which metamodels do you want to use as target for the operation (empty string to finish)?",
+                "Name of new operation?",
                 "Waiting for model constructors...",
                 "Ready for command...",
                 # transformation_add_MT
@@ -1031,10 +1015,9 @@ class TestModelverseCore(unittest.TestCase):
                 set(["  PetriNets",
                      "  PetriNets_Runtime",
                     ]),
-                "",
-                "Which ones do you want to use as source (empty string to finish)?",
-                "Which ones do you want to use as target (empty string to finish)?",
-                "Name of new transformation?",
+                "Which metamodels do you want to use as source for the operation (empty string to finish)?",
+                "Which metamodels do you want to use as target for the operation (empty string to finish)?",
+                "Name of new operation?",
                 "Waiting for model constructors...",
                 "Ready for command...",
                 # transformation_add_MT
@@ -1043,10 +1026,9 @@ class TestModelverseCore(unittest.TestCase):
                 set(["  PetriNets",
                      "  PetriNets_Runtime",
                     ]),
-                "",
-                "Which ones do you want to use as source (empty string to finish)?",
-                "Which ones do you want to use as target (empty string to finish)?",
-                "Name of new transformation?",
+                "Which metamodels do you want to use as source for the operation (empty string to finish)?",
+                "Which metamodels do you want to use as target for the operation (empty string to finish)?",
+                "Name of new operation?",
                 "Waiting for model constructors...",
                 "Ready for command...",
                 # model_list
@@ -1070,18 +1052,16 @@ class TestModelverseCore(unittest.TestCase):
                 "Ready for command...",
                 # transformation_execute (pn_print)
                 "Which transformation do you want to execute?",
-                "Which model to bind for source element PetriNets",
+                "Which model to bind for source type PetriNets",
                 set(['"lock_available" --> 1',
                      '"critical_section_1" --> 0',
                      '"critical_section_2" --> 0',
                     ]),
-                "Transformation executed with result: True",
                 "Ready for command...",
                 # transformation_execute (pn_design_to_runtime)
                 "Which transformation do you want to execute?",
-                "Which model to bind for source element PetriNets",
+                "Which model to bind for source type PetriNets",
                 "Which model to create for target element PetriNets_Runtime",
-                "Transformation executed with result: True",
                 "Ready for command...",
                 ] + \
                     step_and_print() * 10 +
@@ -1278,10 +1258,9 @@ class TestModelverseCore(unittest.TestCase):
                 set(["  PetriNets",
                      "  PetriNets_Runtime",
                     ]),
-                "",
-                "Which ones do you want to use as source (empty string to finish)?",
-                "Which ones do you want to use as target (empty string to finish)?",
-                "Name of new transformation?",
+                "Which metamodels do you want to use as source for the operation (empty string to finish)?",
+                "Which metamodels do you want to use as target for the operation (empty string to finish)?",
+                "Name of new operation?",
                 "Waiting for model constructors...",
                 "Ready for command...",
                 # transformation_add_MT
@@ -1290,16 +1269,15 @@ class TestModelverseCore(unittest.TestCase):
                 set(["  PetriNets",
                      "  PetriNets_Runtime",
                     ]),
-                "",
-                "Which ones do you want to use as source (empty string to finish)?",
-                "Which ones do you want to use as target (empty string to finish)?",
-                "Name of new transformation?",
+                "Which metamodels do you want to use as source for the operation (empty string to finish)?",
+                "Which metamodels do you want to use as target for the operation (empty string to finish)?",
+                "Name of new operation?",
                 "Waiting for model constructors...",
                 "Ready for command...",
                 # transformation_add_AL
-                "Which metamodels do you want to use as source for the action code (empty string to finish)?",
-                "Which metamodels do you want to use as target for the action code (empty string to finish)?",
-                "Name of Action Language model?",
+                "Which metamodels do you want to use as source for the operation (empty string to finish)?",
+                "Which metamodels do you want to use as target for the operation (empty string to finish)?",
+                "Name of operation model?",
                 "Waiting for model constructors...",
                 "Ready for command...",
                 # transformation_add_MT
@@ -1308,10 +1286,9 @@ class TestModelverseCore(unittest.TestCase):
                 set(["  PetriNets",
                      "  PetriNets_Runtime",
                     ]),
-                "",
-                "Which ones do you want to use as source (empty string to finish)?",
-                "Which ones do you want to use as target (empty string to finish)?",
-                "Name of new transformation?",
+                "Which metamodels do you want to use as source for the operation (empty string to finish)?",
+                "Which metamodels do you want to use as target for the operation (empty string to finish)?",
+                "Name of new operation?",
                 "Waiting for model constructors...",
                 "Ready for command...",
                 # model_list
@@ -1335,38 +1312,34 @@ class TestModelverseCore(unittest.TestCase):
                 "Ready for command...",
                 # transformation_execute (pn_print)
                 "Which transformation do you want to execute?",
-                "Which model to bind for source element PetriNets",
+                "Which model to bind for source type PetriNets",
                 set(['"p1" --> 1',
                      '"p2" --> 2',
                      '"p3" --> 3',
                     ]),
-                "Transformation executed with result: True",
                 "Ready for command...",
                 # transformation_execute (pn_design_to_runtime)
                 "Which transformation do you want to execute?",
-                "Which model to bind for source element PetriNets",
+                "Which model to bind for source type PetriNets",
                 "Which model to create for target element PetriNets_Runtime",
-                "Transformation executed with result: True",
                 "Ready for command...",
                 # transformation_execute (pn_step)
                 "Which transformation do you want to execute?",
-                "Which model to bind for source element PetriNets_Runtime",
+                "Which model to bind for source type PetriNets_Runtime",
                 "Which model to create for target element PetriNets_Runtime",
                 "Ready for command...",
                 # transformation_execute (pn_runtime_to_design)
                 "Which transformation do you want to execute?",
-                "Which model to bind for source element PetriNets_Runtime",
+                "Which model to bind for source type PetriNets_Runtime",
                 "Which model to create for target element PetriNets",
-                "Transformation executed with result: True",
                 "Ready for command...",
                 # transformation_execute (pn_print)
                 "Which transformation do you want to execute?",
-                "Which model to bind for source element PetriNets",
+                "Which model to bind for source type PetriNets",
                 set(['"p1" --> 0',
                      '"p2" --> 1',
                      '"p3" --> 5',
                     ]),
-                "Transformation executed with result: True",
                 "Ready for command...",
             ]))
 
@@ -1575,9 +1548,9 @@ class TestModelverseCore(unittest.TestCase):
                 "Where do you want to store the RAMified metamodel?",
                 "Ready for command...",
                 # transformation_add_MANUAL
-                "Which metamodels do you want to use as source for the manual operation (empty string to finish)?",
-                "Which metamodels do you want to use as target for the manual operation (empty string to finish)?",
-                "Name of Manual operation model?",
+                "Which metamodels do you want to use as source for the operation (empty string to finish)?",
+                "Which metamodels do you want to use as target for the operation (empty string to finish)?",
+                "Name of operation model?",
                 "Ready for command...",
                 # transformation_add_MT
                 "RAMified metamodel to use?",
@@ -1585,10 +1558,9 @@ class TestModelverseCore(unittest.TestCase):
                 set(["  PetriNets",
                      "  PetriNets_Runtime",
                     ]),
-                "",
-                "Which ones do you want to use as source (empty string to finish)?",
-                "Which ones do you want to use as target (empty string to finish)?",
-                "Name of new transformation?",
+                "Which metamodels do you want to use as source for the operation (empty string to finish)?",
+                "Which metamodels do you want to use as target for the operation (empty string to finish)?",
+                "Name of new operation?",
                 "Waiting for model constructors...",
                 "Ready for command...",
                 # transformation_add_MT
@@ -1597,10 +1569,9 @@ class TestModelverseCore(unittest.TestCase):
                 set(["  PetriNets",
                      "  PetriNets_Runtime",
                     ]),
-                "",
-                "Which ones do you want to use as source (empty string to finish)?",
-                "Which ones do you want to use as target (empty string to finish)?",
-                "Name of new transformation?",
+                "Which metamodels do you want to use as source for the operation (empty string to finish)?",
+                "Which metamodels do you want to use as target for the operation (empty string to finish)?",
+                "Name of new operation?",
                 "Waiting for model constructors...",
                 "Ready for command...",
                 # transformation_add_MT
@@ -1609,10 +1580,9 @@ class TestModelverseCore(unittest.TestCase):
                 set(["  PetriNets",
                      "  PetriNets_Runtime",
                     ]),
-                "",
-                "Which ones do you want to use as source (empty string to finish)?",
-                "Which ones do you want to use as target (empty string to finish)?",
-                "Name of new transformation?",
+                "Which metamodels do you want to use as source for the operation (empty string to finish)?",
+                "Which metamodels do you want to use as target for the operation (empty string to finish)?",
+                "Name of new operation?",
                 "Waiting for model constructors...",
                 "Ready for command...",
                 # model_list
@@ -1637,16 +1607,15 @@ class TestModelverseCore(unittest.TestCase):
                 "Ready for command...",
                 # transformation_execute (pn_print)
                 "Which transformation do you want to execute?",
-                "Which model to bind for source element PetriNets",
+                "Which model to bind for source type PetriNets",
                 set(['"p1" --> 1',
                      '"p2" --> 2',
                      '"p3" --> 3',
                     ]),
-                "Transformation executed with result: True",
                 "Ready for command...",
                 # transformation_execute (pn_design_to_runtime)
                 "Which transformation do you want to execute?",
-                "Which model to bind for source element PetriNets",
+                "Which model to bind for source type PetriNets",
                 "Which model to create for target element PetriNets_Runtime",
                 "Model loaded, ready for commands!",
                 "Use 'help' command for a list of possible commands",
@@ -1745,24 +1714,21 @@ class TestModelverseCore(unittest.TestCase):
                 "Ready for command...",
                 # transformation_execute (pn_step)
                 "Which transformation do you want to execute?",
-                "Which model to bind for source element PetriNets_Runtime",
+                "Which model to bind for source type PetriNets_Runtime",
                 "Which model to create for target element PetriNets_Runtime",
-                "Transformation executed with result: True",
                 "Ready for command...",
                 # transformation_execute (pn_runtime_to_design)
                 "Which transformation do you want to execute?",
-                "Which model to bind for source element PetriNets_Runtime",
+                "Which model to bind for source type PetriNets_Runtime",
                 "Which model to create for target element PetriNets",
-                "Transformation executed with result: True",
                 "Ready for command...",
                 # transformation_execute (pn_print)
                 "Which transformation do you want to execute?",
-                "Which model to bind for source element PetriNets",
+                "Which model to bind for source type PetriNets",
                 set(['"p1" --> 0',
                      '"p2" --> 1',
                      '"p3" --> 5',
                     ]),
-                "Transformation executed with result: True",
                 "Ready for command...",
             ]))
 
@@ -1891,31 +1857,29 @@ class TestModelverseCore(unittest.TestCase):
                 "RAMified metamodel to use?",
                 "Supported metamodels:",
                 set(["  PetriNet",]),
-                "",
-                "Which ones do you want to use as source (empty string to finish)?",
-                "Which ones do you want to use as target (empty string to finish)?",
-                "Name of new transformation?",
+                "Which metamodels do you want to use as source for the operation (empty string to finish)?",
+                "Which metamodels do you want to use as target for the operation (empty string to finish)?",
+                "Name of new operation?",
                 "Waiting for model constructors...",
                 "Ready for command...",
                 # transformation_add_MANUAL
-                "Which metamodels do you want to use as source for the manual operation (empty string to finish)?",
-                "Which metamodels do you want to use as target for the manual operation (empty string to finish)?",
-                "Name of Manual operation model?",
+                "Which metamodels do you want to use as source for the operation (empty string to finish)?",
+                "Which metamodels do you want to use as target for the operation (empty string to finish)?",
+                "Name of operation model?",
                 "Ready for command...",
                 # transformation_add_AL
-                "Which metamodels do you want to use as source for the action code (empty string to finish)?",
-                "Which metamodels do you want to use as target for the action code (empty string to finish)?",
-                "Name of Action Language model?",
+                "Which metamodels do you want to use as source for the operation (empty string to finish)?",
+                "Which metamodels do you want to use as target for the operation (empty string to finish)?",
+                "Name of operation model?",
                 "Waiting for model constructors...",
                 "Ready for command...",
                 # transformation_add_MT
                 "RAMified metamodel to use?",
                 "Supported metamodels:",
                 set(["  ReachabilityGraph",]),
-                "",
-                "Which ones do you want to use as source (empty string to finish)?",
-                "Which ones do you want to use as target (empty string to finish)?",
-                "Name of new transformation?",
+                "Which metamodels do you want to use as source for the operation (empty string to finish)?",
+                "Which metamodels do you want to use as target for the operation (empty string to finish)?",
+                "Name of new operation?",
                 "Waiting for model constructors...",
                 "Ready for command...",
                 # model_add
@@ -1940,12 +1904,13 @@ class TestModelverseCore(unittest.TestCase):
                      "  __merged_PetriNet_RAM : SimpleClassDiagrams",
                      "  __merged_ReachabilityGraph_RAM : SimpleClassDiagrams",
                      "  __merged_refine_PN : SimpleClassDiagrams",
+                     "  __merged_reachability : SimpleClassDiagrams",
                      ]),
                 "Ready for command...",
                 # process_execute
                 "Which process model do you want to execute?",
                 "Model prefix to use?",
-                    "Please perform manual transformation \"refine_PN\"",
+                    "Please perform manual operation \"refine_PN\"",
                     "Model loaded, ready for commands!",
                     "Use 'help' command for a list of possible commands",
                     "Please give your command.",
@@ -2009,6 +1974,7 @@ class TestModelverseCore(unittest.TestCase):
                      "  __merged_PetriNet_RAM : SimpleClassDiagrams",
                      "  __merged_ReachabilityGraph_RAM : SimpleClassDiagrams",
                      "  __merged_refine_PN : SimpleClassDiagrams",
+                     "  __merged_reachability : SimpleClassDiagrams",
                      ]),
                 "Ready for command...",
             ]))

+ 1 - 1
integration/utils.py

@@ -175,7 +175,7 @@ def run_file(files, parameters, expected, wait=False):
                     # Modelverse has already terminated, which isn't a good sign!
                     raise Exception("Modelverse died!")
 
-                #print("Got %s, expect %s" % (val, e))
+                print("Got %s, expect %s" % (val, e))
                 if isinstance(e, set):
                     assert val in e
                     if val not in e:

+ 1 - 0
scripts/run_local_modelverse.py

@@ -11,4 +11,5 @@ else:
     # Also, specifying a kernel here breaks the performance tests.
 
     subprocess.call([sys.executable, "run_mvk_server.py"] + sys.argv[1:], cwd="hybrid_server")
+    #subprocess.call([sys.executable, "run_mvk_server.py"] + sys.argv[1:] + ["--kernel=legacy-interpreter"], cwd="hybrid_server")
     #subprocess.call([sys.executable, "-m", "cProfile", "-s", "tottime", "run_mvk_server.py"] + sys.argv[1:], cwd="hybrid_server", stdout=open("/tmp/stdout", 'w'), stderr=open("/tmp/stderr", "w"))