Browse Source

Updated test_MvC to use the wrapper for the parts that already work

Yentl Van Tendeloo 8 years ago
parent
commit
5df214ee18

+ 2 - 1
core/core_algorithm.alc

@@ -389,6 +389,7 @@ Element function user_function():
 	exec(root["bootstrap/transform.alc"]["initializers"])
 	exec(root["bootstrap/transform.alc"]["initializers"])
 	exec(root["bootstrap/conformance_scd.alc"]["initializers"])
 	exec(root["bootstrap/conformance_scd.alc"]["initializers"])
 	exec(root["bootstrap/metamodels.alc"]["initializers"])
 	exec(root["bootstrap/metamodels.alc"]["initializers"])
+	exec(root["bootstrap/random.alc"]["initializers"])
 	exec(root["core/core_algorithm.alc"]["initializers"])
 	exec(root["core/core_algorithm.alc"]["initializers"])
 
 
 	// Load in a hard-reference to the previously created model
 	// Load in a hard-reference to the previously created model
@@ -1506,7 +1507,7 @@ String function cmd_transformation_list():
 	String type
 	String type
 	String result
 	String result
 
 
-	result = ""
+	result = "Success: "
 	models = allInstances(core, "Transformation")
 	models = allInstances(core, "Transformation")
 	while (read_nr_out(models) > 0):
 	while (read_nr_out(models) > 0):
 		m = set_pop(models)
 		m = set_pop(models)

+ 29 - 29
integration/code/pn_design_to_runtime.mvc

@@ -1,4 +1,4 @@
-import models/RAM_PetriNets_Design_Runtime as RAM_PN_DR
+import models/RAM_PetriNet_Design_Runtime as RAM_PN_DR
 include "primitives.alh"
 include "primitives.alh"
 include "modelling.alh"
 include "modelling.alh"
 
 
@@ -8,15 +8,15 @@ RAM_PN_DR annotate {
         {Contains} Success success {}
         {Contains} Success success {}
         {Contains} ForAll copy_transitions {
         {Contains} ForAll copy_transitions {
             LHS {
             LHS {
-                Pre_PetriNets/Transition {
+                Pre_PetriNet/Transition {
                     label = "0"
                     label = "0"
                 }
                 }
             }
             }
             RHS {
             RHS {
-                Post_PetriNets/Transition ct1 {
+                Post_PetriNet/Transition ct1 {
                     label = "0"
                     label = "0"
                 }
                 }
-                Post_PetriNets_Runtime/Transition ct2 {
+                Post_PetriNet_Runtime/Transition ct2 {
                     label = "1"
                     label = "1"
                     value_executing = $
                     value_executing = $
                         Boolean function value(model : Element, name : String, mapping : Element):
                         Boolean function value(model : Element, name : String, mapping : Element):
@@ -34,15 +34,15 @@ RAM_PN_DR annotate {
         }
         }
         {Contains} ForAll copy_places {
         {Contains} ForAll copy_places {
             LHS {
             LHS {
-                Pre_PetriNets/Place {
+                Pre_PetriNet/Place {
                     label = "0"
                     label = "0"
                 }
                 }
             }
             }
             RHS {
             RHS {
-                Post_PetriNets/Place cp1 {
+                Post_PetriNet/Place cp1 {
                     label = "0"
                     label = "0"
                 }
                 }
-                Post_PetriNets_Runtime/Place cp2 {
+                Post_PetriNet_Runtime/Place cp2 {
                     label = "1"
                     label = "1"
                     value_tokens = $
                     value_tokens = $
                         Integer function value(model : Element, name : String, mapping : Element):
                         Integer function value(model : Element, name : String, mapping : Element):
@@ -60,19 +60,19 @@ RAM_PN_DR annotate {
         }
         }
         {Contains} ForAll copy_P2T {
         {Contains} ForAll copy_P2T {
             LHS {
             LHS {
-                Pre_PetriNets/Place cp2t_p{
+                Pre_PetriNet/Place cp2t_p{
                     label = "0"
                     label = "0"
                 }
                 }
-                Pre_PetriNets/Transition cp2t_t{
+                Pre_PetriNet/Transition cp2t_t{
                     label = "1"
                     label = "1"
                 }
                 }
-                Pre_PetriNets/P2T (cp2t_p, cp2t_t){
+                Pre_PetriNet/P2T (cp2t_p, cp2t_t){
                     label = "2"
                     label = "2"
                 }
                 }
-                Pre_PetriNets_Runtime/Place cp2t_p2{
+                Pre_PetriNet_Runtime/Place cp2t_p2{
                     label = "3"
                     label = "3"
                 }
                 }
-                Pre_PetriNets_Runtime/Transition cp2t_t2{
+                Pre_PetriNet_Runtime/Transition cp2t_t2{
                     label = "4"
                     label = "4"
                 }
                 }
                 Pre_D2R_PlaceLink (cp2t_p, cp2t_p2){
                 Pre_D2R_PlaceLink (cp2t_p, cp2t_p2){
@@ -83,19 +83,19 @@ RAM_PN_DR annotate {
                 }
                 }
             }
             }
             RHS {
             RHS {
-                Post_PetriNets/Place rhs_cp2t_p{
+                Post_PetriNet/Place rhs_cp2t_p{
                     label = "0"
                     label = "0"
                 }
                 }
-                Post_PetriNets/Transition rhs_cp2t_t{
+                Post_PetriNet/Transition rhs_cp2t_t{
                     label = "1"
                     label = "1"
                 }
                 }
-                Post_PetriNets/P2T rhs_cp2t_p2t (rhs_cp2t_p, rhs_cp2t_t){
+                Post_PetriNet/P2T rhs_cp2t_p2t (rhs_cp2t_p, rhs_cp2t_t){
                     label = "2"
                     label = "2"
                 }
                 }
-                Post_PetriNets_Runtime/Place rhs_cp2t_p2 {
+                Post_PetriNet_Runtime/Place rhs_cp2t_p2 {
                     label = "3"
                     label = "3"
                 }
                 }
-                Post_PetriNets_Runtime/Transition rhs_cp2t_t2 {
+                Post_PetriNet_Runtime/Transition rhs_cp2t_t2 {
                     label = "4"
                     label = "4"
                 }
                 }
                 Post_D2R_PlaceLink (rhs_cp2t_p, rhs_cp2t_p2){
                 Post_D2R_PlaceLink (rhs_cp2t_p, rhs_cp2t_p2){
@@ -104,7 +104,7 @@ RAM_PN_DR annotate {
                 Post_D2R_TransitionLink (rhs_cp2t_t, rhs_cp2t_t2){
                 Post_D2R_TransitionLink (rhs_cp2t_t, rhs_cp2t_t2){
                     label = "6"
                     label = "6"
                 }
                 }
-                Post_PetriNets_Runtime/P2T rhs_cp2t_p2t2(rhs_cp2t_p2, rhs_cp2t_t2) {
+                Post_PetriNet_Runtime/P2T rhs_cp2t_p2t2(rhs_cp2t_p2, rhs_cp2t_t2) {
                     label = "7"
                     label = "7"
                     value_weight = $
                     value_weight = $
                         Integer function value(host_model : Element, name : String, mapping : Element):
                         Integer function value(host_model : Element, name : String, mapping : Element):
@@ -115,19 +115,19 @@ RAM_PN_DR annotate {
         }
         }
         {Contains} ForAll copy_T2P {
         {Contains} ForAll copy_T2P {
             LHS {
             LHS {
-                Pre_PetriNets/Place ct2p_p{
+                Pre_PetriNet/Place ct2p_p{
                     label = "0"
                     label = "0"
                 }
                 }
-                Pre_PetriNets/Transition ct2p_t{
+                Pre_PetriNet/Transition ct2p_t{
                     label = "1"
                     label = "1"
                 }
                 }
-                Pre_PetriNets/T2P (ct2p_t, ct2p_p){
+                Pre_PetriNet/T2P (ct2p_t, ct2p_p){
                     label = "2"
                     label = "2"
                 }
                 }
-                Pre_PetriNets_Runtime/Place ct2p_p2{
+                Pre_PetriNet_Runtime/Place ct2p_p2{
                     label = "3"
                     label = "3"
                 }
                 }
-                Pre_PetriNets_Runtime/Transition ct2p_t2{
+                Pre_PetriNet_Runtime/Transition ct2p_t2{
                     label = "4"
                     label = "4"
                 }
                 }
                 Pre_D2R_PlaceLink (ct2p_p, ct2p_p2){
                 Pre_D2R_PlaceLink (ct2p_p, ct2p_p2){
@@ -138,19 +138,19 @@ RAM_PN_DR annotate {
                 }
                 }
             }
             }
             RHS {
             RHS {
-                Post_PetriNets/Place rhs_ct2p_p{
+                Post_PetriNet/Place rhs_ct2p_p{
                     label = "0"
                     label = "0"
                 }
                 }
-                Post_PetriNets/Transition rhs_ct2p_t{
+                Post_PetriNet/Transition rhs_ct2p_t{
                     label = "1"
                     label = "1"
                 }
                 }
-                Post_PetriNets/T2P (rhs_ct2p_t, rhs_ct2p_p){
+                Post_PetriNet/T2P (rhs_ct2p_t, rhs_ct2p_p){
                     label = "2"
                     label = "2"
                 }
                 }
-                Post_PetriNets_Runtime/Place rhs_ct2p_p2 {
+                Post_PetriNet_Runtime/Place rhs_ct2p_p2 {
                     label = "3"
                     label = "3"
                 }
                 }
-                Post_PetriNets_Runtime/Transition rhs_ct2p_t2 {
+                Post_PetriNet_Runtime/Transition rhs_ct2p_t2 {
                     label = "4"
                     label = "4"
                 }
                 }
                 Post_D2R_PlaceLink (rhs_ct2p_p, rhs_ct2p_p2){
                 Post_D2R_PlaceLink (rhs_ct2p_p, rhs_ct2p_p2){
@@ -159,7 +159,7 @@ RAM_PN_DR annotate {
                 Post_D2R_TransitionLink (rhs_ct2p_t, rhs_ct2p_t2){
                 Post_D2R_TransitionLink (rhs_ct2p_t, rhs_ct2p_t2){
                     label = "6"
                     label = "6"
                 }
                 }
-                Post_PetriNets_Runtime/T2P (rhs_ct2p_t2, rhs_ct2p_p2) {
+                Post_PetriNet_Runtime/T2P (rhs_ct2p_t2, rhs_ct2p_p2) {
                     label = "7"
                     label = "7"
                     value_weight = $
                     value_weight = $
                         Integer function value(host_model : Element, name : String, mapping : Element):
                         Integer function value(host_model : Element, name : String, mapping : Element):

+ 2 - 2
integration/code/pn_print.mvc

@@ -7,12 +7,12 @@ RAM_PN_R print {
         {Contains} Success success {}
         {Contains} Success success {}
         {Contains} ForAll print_tokens {
         {Contains} ForAll print_tokens {
             LHS {
             LHS {
-                Pre_PetriNets/Place {
+                Pre_PetriNet/Place {
                     label = "0"
                     label = "0"
                 }
                 }
             }
             }
             RHS {
             RHS {
-                Post_PetriNets/Place {
+                Post_PetriNet/Place {
                     label = "0"
                     label = "0"
                     action = $
                     action = $
                         Void function action(model : Element, name : String, mapping : Element):
                         Void function action(model : Element, name : String, mapping : Element):

+ 29 - 29
integration/code/pn_runtime_to_design.mvc

@@ -1,4 +1,4 @@
-import models/RAM_PetriNets_Design_Runtime as RAM_PN_DR
+import models/RAM_PetriNet_Design_Runtime as RAM_PN_DR
 include "primitives.alh"
 include "primitives.alh"
 include "modelling.alh"
 include "modelling.alh"
 
 
@@ -8,15 +8,15 @@ RAM_PN_DR annotate {
         {Contains} Success success {}
         {Contains} Success success {}
         {Contains} ForAll copy_transitions {
         {Contains} ForAll copy_transitions {
             LHS {
             LHS {
-                Pre_PetriNets_Runtime/Transition {
+                Pre_PetriNet_Runtime/Transition {
                     label = "0"
                     label = "0"
                 }
                 }
             }
             }
             RHS {
             RHS {
-                Post_PetriNets_Runtime/Transition ct1 {
+                Post_PetriNet_Runtime/Transition ct1 {
                     label = "0"
                     label = "0"
                 }
                 }
-                Post_PetriNets/Transition ct2 {
+                Post_PetriNet/Transition ct2 {
                     label = "1"
                     label = "1"
                     value_name = $
                     value_name = $
                         Integer function value(model : Element, name : String, mapping : Element):
                         Integer function value(model : Element, name : String, mapping : Element):
@@ -30,15 +30,15 @@ RAM_PN_DR annotate {
         }
         }
         {Contains} ForAll copy_places {
         {Contains} ForAll copy_places {
             LHS {
             LHS {
-                Pre_PetriNets_Runtime/Place {
+                Pre_PetriNet_Runtime/Place {
                     label = "0"
                     label = "0"
                 }
                 }
             }
             }
             RHS {
             RHS {
-                Post_PetriNets_Runtime/Place cp1 {
+                Post_PetriNet_Runtime/Place cp1 {
                     label = "0"
                     label = "0"
                 }
                 }
-                Post_PetriNets/Place cp2 {
+                Post_PetriNet/Place cp2 {
                     label = "1"
                     label = "1"
                     value_tokens = $
                     value_tokens = $
                         Integer function value(host_model : Element, name : String, mapping : Element):
                         Integer function value(host_model : Element, name : String, mapping : Element):
@@ -56,19 +56,19 @@ RAM_PN_DR annotate {
         }
         }
         {Contains} ForAll copy_P2T {
         {Contains} ForAll copy_P2T {
             LHS {
             LHS {
-                Pre_PetriNets_Runtime/Place cp2t_p{
+                Pre_PetriNet_Runtime/Place cp2t_p{
                     label = "0"
                     label = "0"
                 }
                 }
-                Pre_PetriNets_Runtime/Transition cp2t_t{
+                Pre_PetriNet_Runtime/Transition cp2t_t{
                     label = "1"
                     label = "1"
                 }
                 }
-                Pre_PetriNets_Runtime/P2T (cp2t_p, cp2t_t){
+                Pre_PetriNet_Runtime/P2T (cp2t_p, cp2t_t){
                     label = "2"
                     label = "2"
                 }
                 }
-                Pre_PetriNets/Place cp2t_p2{
+                Pre_PetriNet/Place cp2t_p2{
                     label = "3"
                     label = "3"
                 }
                 }
-                Pre_PetriNets/Transition cp2t_t2{
+                Pre_PetriNet/Transition cp2t_t2{
                     label = "4"
                     label = "4"
                 }
                 }
                 Pre_R2D_PlaceLink (cp2t_p, cp2t_p2){
                 Pre_R2D_PlaceLink (cp2t_p, cp2t_p2){
@@ -79,19 +79,19 @@ RAM_PN_DR annotate {
                 }
                 }
             }
             }
             RHS {
             RHS {
-                Post_PetriNets_Runtime/Place rhs_cp2t_p{
+                Post_PetriNet_Runtime/Place rhs_cp2t_p{
                     label = "0"
                     label = "0"
                 }
                 }
-                Post_PetriNets_Runtime/Transition rhs_cp2t_t{
+                Post_PetriNet_Runtime/Transition rhs_cp2t_t{
                     label = "1"
                     label = "1"
                 }
                 }
-                Post_PetriNets_Runtime/P2T rhs_cp2t_p2t (rhs_cp2t_p, rhs_cp2t_t){
+                Post_PetriNet_Runtime/P2T rhs_cp2t_p2t (rhs_cp2t_p, rhs_cp2t_t){
                     label = "2"
                     label = "2"
                 }
                 }
-                Post_PetriNets/Place rhs_cp2t_p2 {
+                Post_PetriNet/Place rhs_cp2t_p2 {
                     label = "3"
                     label = "3"
                 }
                 }
-                Post_PetriNets/Transition rhs_cp2t_t2 {
+                Post_PetriNet/Transition rhs_cp2t_t2 {
                     label = "4"
                     label = "4"
                 }
                 }
                 Post_R2D_PlaceLink (rhs_cp2t_p, rhs_cp2t_p2){
                 Post_R2D_PlaceLink (rhs_cp2t_p, rhs_cp2t_p2){
@@ -100,7 +100,7 @@ RAM_PN_DR annotate {
                 Post_R2D_TransitionLink (rhs_cp2t_t, rhs_cp2t_t2){
                 Post_R2D_TransitionLink (rhs_cp2t_t, rhs_cp2t_t2){
                     label = "6"
                     label = "6"
                 }
                 }
-                Post_PetriNets/P2T rhs_cp2t_p2t2(rhs_cp2t_p2, rhs_cp2t_t2) {
+                Post_PetriNet/P2T rhs_cp2t_p2t2(rhs_cp2t_p2, rhs_cp2t_t2) {
                     label = "7"
                     label = "7"
                     value_weight = $
                     value_weight = $
                         Integer function value(host_model : Element, name : String, mapping : Element):
                         Integer function value(host_model : Element, name : String, mapping : Element):
@@ -111,19 +111,19 @@ RAM_PN_DR annotate {
         }
         }
         {Contains} ForAll copy_T2P {
         {Contains} ForAll copy_T2P {
             LHS {
             LHS {
-                Pre_PetriNets_Runtime/Place ct2p_p{
+                Pre_PetriNet_Runtime/Place ct2p_p{
                     label = "0"
                     label = "0"
                 }
                 }
-                Pre_PetriNets_Runtime/Transition ct2p_t{
+                Pre_PetriNet_Runtime/Transition ct2p_t{
                     label = "1"
                     label = "1"
                 }
                 }
-                Pre_PetriNets_Runtime/T2P (ct2p_t, ct2p_p){
+                Pre_PetriNet_Runtime/T2P (ct2p_t, ct2p_p){
                     label = "2"
                     label = "2"
                 }
                 }
-                Pre_PetriNets/Place ct2p_p2{
+                Pre_PetriNet/Place ct2p_p2{
                     label = "3"
                     label = "3"
                 }
                 }
-                Pre_PetriNets/Transition ct2p_t2{
+                Pre_PetriNet/Transition ct2p_t2{
                     label = "4"
                     label = "4"
                 }
                 }
                 Pre_R2D_PlaceLink (ct2p_p, ct2p_p2){
                 Pre_R2D_PlaceLink (ct2p_p, ct2p_p2){
@@ -134,19 +134,19 @@ RAM_PN_DR annotate {
                 }
                 }
             }
             }
             RHS {
             RHS {
-                Post_PetriNets_Runtime/Place rhs_ct2p_p{
+                Post_PetriNet_Runtime/Place rhs_ct2p_p{
                     label = "0"
                     label = "0"
                 }
                 }
-                Post_PetriNets_Runtime/Transition rhs_ct2p_t{
+                Post_PetriNet_Runtime/Transition rhs_ct2p_t{
                     label = "1"
                     label = "1"
                 }
                 }
-                Post_PetriNets_Runtime/T2P (rhs_ct2p_t, rhs_ct2p_p){
+                Post_PetriNet_Runtime/T2P (rhs_ct2p_t, rhs_ct2p_p){
                     label = "2"
                     label = "2"
                 }
                 }
-                Post_PetriNets/Place rhs_ct2p_p2 {
+                Post_PetriNet/Place rhs_ct2p_p2 {
                     label = "3"
                     label = "3"
                 }
                 }
-                Post_PetriNets/Transition rhs_ct2p_t2 {
+                Post_PetriNet/Transition rhs_ct2p_t2 {
                     label = "4"
                     label = "4"
                 }
                 }
                 Post_R2D_PlaceLink (rhs_ct2p_p, rhs_ct2p_p2){
                 Post_R2D_PlaceLink (rhs_ct2p_p, rhs_ct2p_p2){
@@ -155,7 +155,7 @@ RAM_PN_DR annotate {
                 Post_R2D_TransitionLink (rhs_ct2p_t, rhs_ct2p_t2){
                 Post_R2D_TransitionLink (rhs_ct2p_t, rhs_ct2p_t2){
                     label = "6"
                     label = "6"
                 }
                 }
-                Post_PetriNets/T2P (rhs_ct2p_t2, rhs_ct2p_p2) {
+                Post_PetriNet/T2P (rhs_ct2p_t2, rhs_ct2p_p2) {
                     label = "7"
                     label = "7"
                     value_weight = $
                     value_weight = $
                         Integer function value(host_model : Element, name : String, mapping : Element):
                         Integer function value(host_model : Element, name : String, mapping : Element):

+ 4 - 4
integration/code/pn_simulate.alc

@@ -19,7 +19,7 @@ Boolean function simulate(model : Element):
 
 
 	log("Got types: " + set_to_string(dict_keys(model["metamodel"]["model"])))
 	log("Got types: " + set_to_string(dict_keys(model["metamodel"]["model"])))
 
 
-	all_transitions = allInstances(model, "PetriNets_Runtime/Transition")
+	all_transitions = allInstances(model, "PetriNet_Runtime/Transition")
 	enabled_transitions = create_node()
 	enabled_transitions = create_node()
 
 
 	while (0 < read_nr_out(all_transitions)):
 	while (0 < read_nr_out(all_transitions)):
@@ -27,7 +27,7 @@ Boolean function simulate(model : Element):
 		enabled = True
 		enabled = True
 
 
 		// Find all incoming transitions
 		// Find all incoming transitions
-		in_arcs = allIncomingAssociationInstances(model, under_study, "PetriNets_Runtime/P2T")
+		in_arcs = allIncomingAssociationInstances(model, under_study, "PetriNet_Runtime/P2T")
 
 
 		while (0 < read_nr_out(in_arcs)):
 		while (0 < read_nr_out(in_arcs)):
 			arc_under_study = set_pop(in_arcs)
 			arc_under_study = set_pop(in_arcs)
@@ -56,7 +56,7 @@ Boolean function simulate(model : Element):
 	String working_place
 	String working_place
 	Integer new_value
 	Integer new_value
 
 
-	workset = allIncomingAssociationInstances(model, transition, "PetriNets_Runtime/P2T")
+	workset = allIncomingAssociationInstances(model, transition, "PetriNet_Runtime/P2T")
 	while (0 < read_nr_out(workset)):
 	while (0 < read_nr_out(workset)):
 		working_arc = set_pop(workset)
 		working_arc = set_pop(workset)
 		working_place = reverseKeyLookup(model["model"], read_edge_src(model["model"][working_arc]))
 		working_place = reverseKeyLookup(model["model"], read_edge_src(model["model"][working_arc]))
@@ -64,7 +64,7 @@ Boolean function simulate(model : Element):
 		instantiate_attribute(model, working_place, "tokens", new_value)
 		instantiate_attribute(model, working_place, "tokens", new_value)
 
 
 	// Add tokens
 	// Add tokens
-	workset = allOutgoingAssociationInstances(model, transition, "PetriNets_Runtime/T2P")
+	workset = allOutgoingAssociationInstances(model, transition, "PetriNet_Runtime/T2P")
 	while (0 < read_nr_out(workset)):
 	while (0 < read_nr_out(workset)):
 		working_arc = set_pop(workset)
 		working_arc = set_pop(workset)
 		working_place = reverseKeyLookup(model["model"], read_edge_dst(model["model"][working_arc]))
 		working_place = reverseKeyLookup(model["model"], read_edge_dst(model["model"][working_arc]))

+ 20 - 20
integration/code/pn_simulate.mvc

@@ -1,4 +1,4 @@
-import models/RAM_PetriNets_Runtime_Runtime as RAM_PN_R
+import models/RAM_PetriNet_Runtime_Runtime as RAM_PN_R
 include "primitives.alh"
 include "primitives.alh"
 include "modelling.alh"
 include "modelling.alh"
 
 
@@ -8,18 +8,18 @@ RAM_PN_R s {
         {Contains} Success success {}
         {Contains} Success success {}
         {Contains} Atomic mark {
         {Contains} Atomic mark {
             LHS {
             LHS {
-                Pre_PetriNets_Runtime/Transition {
+                Pre_PetriNet_Runtime/Transition {
                     label = "1"
                     label = "1"
                 }
                 }
             }
             }
             NAC {
             NAC {
-				Pre_PetriNets_Runtime/Transition mark_nac_t {
+				Pre_PetriNet_Runtime/Transition mark_nac_t {
 					label = "1"
 					label = "1"
 				}
 				}
-				Pre_PetriNets_Runtime/Place mark_nac_p{
+				Pre_PetriNet_Runtime/Place mark_nac_p{
 					label = "10"
 					label = "10"
 				}
 				}
-				Pre_PetriNets_Runtime/P2T (mark_nac_p, mark_nac_t){
+				Pre_PetriNet_Runtime/P2T (mark_nac_p, mark_nac_t){
 					label = "11"
 					label = "11"
 				}
 				}
 				constraint = $
 				constraint = $
@@ -32,7 +32,7 @@ RAM_PN_R s {
 					$
 					$
             }
             }
             RHS {
             RHS {
-                Post_PetriNets_Runtime/Transition {
+                Post_PetriNet_Runtime/Transition {
                     label = "1"
                     label = "1"
                     value_executing = $
                     value_executing = $
                         Boolean function value(host_model : Element, name : String, mapping : Element):
                         Boolean function value(host_model : Element, name : String, mapping : Element):
@@ -43,71 +43,71 @@ RAM_PN_R s {
         }
         }
         {Contains} ForAll consume {
         {Contains} ForAll consume {
             LHS {
             LHS {
-                Pre_PetriNets_Runtime/Transition lhs_consume_t{
+                Pre_PetriNet_Runtime/Transition lhs_consume_t{
                     label = "0"
                     label = "0"
                     constraint_executing = $
                     constraint_executing = $
                         Boolean function constraint(value : Boolean):
                         Boolean function constraint(value : Boolean):
                             return value!
                             return value!
                         $
                         $
                 }
                 }
-                Pre_PetriNets_Runtime/Place lhs_consume_p{
+                Pre_PetriNet_Runtime/Place lhs_consume_p{
                     label = "1"
                     label = "1"
                 }
                 }
-                Pre_PetriNets_Runtime/P2T lhs_consume_p2t(lhs_consume_p, lhs_consume_t){
+                Pre_PetriNet_Runtime/P2T lhs_consume_p2t(lhs_consume_p, lhs_consume_t){
                     label = "2"
                     label = "2"
                 }
                 }
             }
             }
             RHS {
             RHS {
-                Post_PetriNets_Runtime/Transition rhs_consume_t {
+                Post_PetriNet_Runtime/Transition rhs_consume_t {
                     label = "0"
                     label = "0"
                 }
                 }
-                Post_PetriNets_Runtime/Place rhs_consume_p {
+                Post_PetriNet_Runtime/Place rhs_consume_p {
                     label = "1"
                     label = "1"
                     value_tokens = $
                     value_tokens = $
                         Integer function value(host_model : Element, name : String, mapping : Element):
                         Integer function value(host_model : Element, name : String, mapping : Element):
                             return integer_subtraction(read_attribute(host_model, name, "tokens"), read_attribute(host_model, mapping["2"], "weight"))!
                             return integer_subtraction(read_attribute(host_model, name, "tokens"), read_attribute(host_model, mapping["2"], "weight"))!
                         $
                         $
                 }
                 }
-                Post_PetriNets_Runtime/P2T (rhs_consume_p, rhs_consume_t){
+                Post_PetriNet_Runtime/P2T (rhs_consume_p, rhs_consume_t){
                     label = "2"
                     label = "2"
                 }
                 }
             }
             }
         }
         }
         {Contains} ForAll produce {
         {Contains} ForAll produce {
             LHS {
             LHS {
-                Pre_PetriNets_Runtime/Transition lhs_produce_t{
+                Pre_PetriNet_Runtime/Transition lhs_produce_t{
                     label = "0"
                     label = "0"
                     constraint_executing = $
                     constraint_executing = $
                         Boolean function constraint(value : Boolean):
                         Boolean function constraint(value : Boolean):
                             return value!
                             return value!
                         $
                         $
                 }
                 }
-                Pre_PetriNets_Runtime/Place lhs_produce_p{
+                Pre_PetriNet_Runtime/Place lhs_produce_p{
                     label = "1"
                     label = "1"
                 }
                 }
-                Pre_PetriNets_Runtime/T2P (lhs_produce_t, lhs_produce_p){
+                Pre_PetriNet_Runtime/T2P (lhs_produce_t, lhs_produce_p){
                     label = "2"
                     label = "2"
                 }
                 }
             }
             }
             RHS {
             RHS {
-                Post_PetriNets_Runtime/Transition rhs_produce_t{
+                Post_PetriNet_Runtime/Transition rhs_produce_t{
                     label = "0"
                     label = "0"
                 }
                 }
-                Post_PetriNets_Runtime/Place rhs_produce_p{
+                Post_PetriNet_Runtime/Place rhs_produce_p{
                     label = "1"
                     label = "1"
                     value_tokens = $
                     value_tokens = $
                         Integer function value(host_model : Element, name : String, mapping : Element):
                         Integer function value(host_model : Element, name : String, mapping : Element):
                             return integer_addition(read_attribute(host_model, name, "tokens"), read_attribute(host_model, mapping["2"], "weight"))!
                             return integer_addition(read_attribute(host_model, name, "tokens"), read_attribute(host_model, mapping["2"], "weight"))!
                         $
                         $
                 }
                 }
-                Post_PetriNets_Runtime/T2P (rhs_produce_t, rhs_produce_p){
+                Post_PetriNet_Runtime/T2P (rhs_produce_t, rhs_produce_p){
                     label = "2"
                     label = "2"
                 }
                 }
             }
             }
         }
         }
         {Contains} Atomic unmark_transition {
         {Contains} Atomic unmark_transition {
             LHS {
             LHS {
-                Pre_PetriNets_Runtime/Transition {
+                Pre_PetriNet_Runtime/Transition {
                     label = "0"
                     label = "0"
                     constraint_executing = $
                     constraint_executing = $
                         Boolean function constraint(value : Boolean):
                         Boolean function constraint(value : Boolean):
@@ -116,7 +116,7 @@ RAM_PN_R s {
                 }
                 }
             }
             }
             RHS {
             RHS {
-                Post_PetriNets_Runtime/Transition {
+                Post_PetriNet_Runtime/Transition {
                     label = "0"
                     label = "0"
                     value_executing = $
                     value_executing = $
                         Boolean function value(host_model : Element, name : String, mapping : Element):
                         Boolean function value(host_model : Element, name : String, mapping : Element):

File diff suppressed because it is too large
+ 165 - 1315
integration/test_mvc.py


+ 2 - 2
kernel/modelverse_jit/jit.py

@@ -464,7 +464,7 @@ class ModelverseJit(object):
         """Checks if the function with the given body id is obviously non-jittable. If it's
         """Checks if the function with the given body id is obviously non-jittable. If it's
            non-jittable, then a `JitCompilationFailedException` exception is thrown."""
            non-jittable, then a `JitCompilationFailedException` exception is thrown."""
         if body_id is None:
         if body_id is None:
-            raise ValueError('body_id cannot be None')
+            raise ValueError('body_id cannot be None: ' + suggested_name)
         elif body_id in self.no_jit_entry_points:
         elif body_id in self.no_jit_entry_points:
             # We're not allowed to jit this function or have tried and failed before.
             # We're not allowed to jit this function or have tried and failed before.
             raise JitCompilationFailedException(
             raise JitCompilationFailedException(
@@ -570,7 +570,7 @@ class ModelverseJit(object):
     def jit_compile(self, task_root, body_id, suggested_name=None):
     def jit_compile(self, task_root, body_id, suggested_name=None):
         """Tries to jit the function defined by the given entry point id and parameter list."""
         """Tries to jit the function defined by the given entry point id and parameter list."""
         if body_id is None:
         if body_id is None:
-            raise ValueError('body_id cannot be None')
+            raise ValueError('body_id cannot be None: ' + suggested_name)
         elif body_id in self.jitted_entry_points:
         elif body_id in self.jitted_entry_points:
             raise primitive_functions.PrimitiveFinished(
             raise primitive_functions.PrimitiveFinished(
                 self.jit_globals[self.jitted_entry_points[body_id]])
                 self.jit_globals[self.jitted_entry_points[body_id]])

+ 58 - 34
wrappers/modelverse.py

@@ -21,7 +21,7 @@ from hutn_compiler.compiler import main as do_compile
 class ModelverseException(Exception):
 class ModelverseException(Exception):
     pass
     pass
 
 
-class UnknownException(ModelverseException):
+class UnknownError(ModelverseException):
     pass
     pass
 
 
 class UnknownIdentifier(ModelverseException):
 class UnknownIdentifier(ModelverseException):
@@ -265,15 +265,15 @@ def model_list():
     _input("model_list")
     _input("model_list")
     output = _handle_output("Success: ", split=" ")
     output = _handle_output("Success: ", split=" ")
     if output == "":
     if output == "":
-        return []
+        return set([])
 
 
-    lst = []
+    lst = set([])
     value = output.strip().split("\n")
     value = output.strip().split("\n")
     for v in value:
     for v in value:
         m, mm = v.split(":")
         m, mm = v.split(":")
         m = m.strip()
         m = m.strip()
         mm = mm.strip()
         mm = mm.strip()
-        lst.append((m, mm))
+        lst.add((m, mm))
 
 
     return lst
     return lst
 
 
@@ -284,14 +284,19 @@ def model_list_full():
     if  mode != MODE_MODELLING:
     if  mode != MODE_MODELLING:
         raise InvalidMode()
         raise InvalidMode()
     _input("model_list_full")
     _input("model_list_full")
-    lst = []
-    value = _output().strip().split("\n")
+    output = _handle_output("Success: ", split=" ")
+    if output == "":
+        return set([])
+
+    lst = set([])
+    value = output.strip().split("\n")
     for v in value:
     for v in value:
+        print("READ " + v)
         m, mm = v.split(":")
         m, mm = v.split(":")
         m = m.strip()
         m = m.strip()
         mm = mm.strip()
         mm = mm.strip()
         perm, own, grp, m = m.split(" ")
         perm, own, grp, m = m.split(" ")
-        lst.append((m, mm, own, grp, perm))
+        lst.add((m, mm, own, grp, perm))
 
 
     return lst
     return lst
 
 
@@ -331,7 +336,7 @@ def model_overwrite(model_name, new_model=None):
 def user_logout():
 def user_logout():
     """Log out the current user and break the connection."""
     """Log out the current user and break the connection."""
     # return None
     # return None
-    # raises UnknownException
+    # raises UnknownError
     global mode
     global mode
     if  mode != MODE_MODELLING:
     if  mode != MODE_MODELLING:
         raise InvalidMode()
         raise InvalidMode()
@@ -341,7 +346,7 @@ def user_logout():
 def user_delete():
 def user_delete():
     """Removes the current user and break the connection."""
     """Removes the current user and break the connection."""
     # return None
     # return None
-    # raises UnknownException
+    # raises UnknownError
     global mode
     global mode
     if  mode != MODE_MODELLING:
     if  mode != MODE_MODELLING:
         raise InvalidMode()
         raise InvalidMode()
@@ -351,7 +356,7 @@ def user_delete():
 def model_render(model, mapper):
 def model_render(model, mapper):
     """Fetch a rendered verion of a model."""
     """Fetch a rendered verion of a model."""
     # return JSON_representation
     # return JSON_representation
-    # raises UnknownException
+    # raises UnknownError
     # raises UnknownIdentifier
     # raises UnknownIdentifier
     # raises InterfaceMismatch
     # raises InterfaceMismatch
     global mode
     global mode
@@ -369,8 +374,8 @@ def transformation_between(source, target):
     _input(["transformation_between", source, target])
     _input(["transformation_between", source, target])
     output = _handle_output("Success: ", split=" ")
     output = _handle_output("Success: ", split=" ")
     if output == "":
     if output == "":
-        return []
-    lst = [v for v in output.split("\n")]
+        return set([])
+    lst = set([v for v in output.split("\n")])
 
 
 def transformation_add_MT_language(metamodels, RAMified_name):
 def transformation_add_MT_language(metamodels, RAMified_name):
     """Create a new Model Transformation language out of a set of metamodels."""
     """Create a new Model Transformation language out of a set of metamodels."""
@@ -467,6 +472,7 @@ def transformation_execute_MT(operation_name, input_models_dict, output_models_d
 
 
     # We are now executing, so everything we get is part of the dialog, except if it is the string for transformation termination
     # We are now executing, so everything we get is part of the dialog, except if it is the string for transformation termination
     while _output() not in ["Success", "Failure"]:
     while _output() not in ["Success", "Failure"]:
+        print("Got output: " + str(_last_output()))
         reply = callback(_last_output())
         reply = callback(_last_output())
         if reply is not None:
         if reply is not None:
             _input(reply)
             _input(reply)
@@ -479,19 +485,37 @@ def transformation_execute_MT(operation_name, input_models_dict, output_models_d
 
 
 def transformation_list():
 def transformation_list():
     """List existing model operations."""
     """List existing model operations."""
-    raise NotImplementedError()
+    global mode
+    if mode != MODE_MODELLING:
+        raise InvalidMode()
 
 
-def transformation_list_full():
-    """List detailed information on model operations."""
-    raise NotImplementedError()
+    _input("transformation_list")
+    output = _handle_output("Success: ", split=" ")
+    if output == "":
+        return set([])
+
+    lst = set([])
+    value = output.strip().split("\n")
+    for v in value:
+        t, m = v.strip().split(" ", 1)
+        t = t[1:-1].strip()
+        m = m.strip().split(":")[0].strip()
+        lst.add((t, m))
+
+    return lst
 
 
 def transformation_detail():
 def transformation_detail():
     """List full details of a a model operation."""
     """List full details of a a model operation."""
     raise NotImplementedError()
     raise NotImplementedError()
 
 
-def transformation_RAMify():
+def transformation_RAMify(metamodel_name, RAMified_metamodel_name):
     """Ramify an existing metamodel."""
     """Ramify an existing metamodel."""
-    raise NotImplementedError()
+    global mode
+    if mode != MODE_MODELLING:
+        raise InvalidMode()
+
+    _input(["transformation_RAMify", metamodel_name, RAMified_metamodel_name])
+    _handle_output("Success")
 
 
 def process_execute():
 def process_execute():
     """Execute a process model."""
     """Execute a process model."""
@@ -557,15 +581,15 @@ def element_list(model_name):
 
 
     try:
     try:
         _input("list_full")
         _input("list_full")
-        lst = []
+        lst = set([])
         output = _handle_output("Success: ", split=" ")
         output = _handle_output("Success: ", split=" ")
         if output == "":
         if output == "":
-            return []
+            return set([])
         for v in output.split("\n"):
         for v in output.split("\n"):
             m, mm = v.split(":")
             m, mm = v.split(":")
             m = m.strip()
             m = m.strip()
             mm = mm.strip()
             mm = mm.strip()
-            lst.append((m, mm))
+            lst.add((m, mm))
         return lst
         return lst
 
 
     finally:
     finally:
@@ -582,14 +606,14 @@ def types(model_name):
 
 
     try:
     try:
         _input("types")
         _input("types")
-        lst = []
+        lst = set([])
         output = _handle_output("Success: ", split=" ")
         output = _handle_output("Success: ", split=" ")
         if output == "":
         if output == "":
-            return []
+            return set([])
         for v in output.split("\n"):
         for v in output.split("\n"):
             m, mm = v.split(":")
             m, mm = v.split(":")
             m = m.strip()
             m = m.strip()
-            lst.append(m)
+            lst.add(m)
         return lst
         return lst
 
 
     finally:
     finally:
@@ -606,15 +630,15 @@ def types_full(model_name):
 
 
     try:
     try:
         _input("types")
         _input("types")
-        lst = []
+        lst = set([])
         output = _handle_output("Success: ", split=" ")
         output = _handle_output("Success: ", split=" ")
         if output == "":
         if output == "":
-            return []
+            return set([])
         for v in output.split("\n"):
         for v in output.split("\n"):
             m, mm = v.split(":")
             m, mm = v.split(":")
             m = m.strip()
             m = m.strip()
             mm = mm.strip()
             mm = mm.strip()
-            lst.append((m, mm))
+            lst.add((m, mm))
         return lst
         return lst
 
 
     finally:
     finally:
@@ -686,7 +710,7 @@ def read_attrs(model_name, ID):
     finally:
     finally:
         model_exit()
         model_exit()
 
 
-def instantiate(model_name, typename, edge=None):
+def instantiate(model_name, typename, edge=None, ID=""):
     """Create a new instance of the specified typename, between the selected elements (if not None), and with the provided ID (if any)"""
     """Create a new instance of the specified typename, between the selected elements (if not None), and with the provided ID (if any)"""
     # return instantiated_ID
     # return instantiated_ID
     # raises UnknownError
     # raises UnknownError
@@ -700,9 +724,9 @@ def instantiate(model_name, typename, edge=None):
 
 
     try:
     try:
         if edge is None:
         if edge is None:
-            _input(["instantiate_node", typename, ""])
+            _input(["instantiate_node", typename, ID])
         else:
         else:
-            _input(["instantiate_edge", typename, "", edge[0], edge[1]])
+            _input(["instantiate_edge", typename, ID, edge[0], edge[1]])
         return _handle_output("Success: ", split=" ")
         return _handle_output("Success: ", split=" ")
     finally:
     finally:
         model_exit()
         model_exit()
@@ -793,9 +817,9 @@ def read_outgoing(model_name, ID, typename):
         _input(["read_outgoing", ID, typename])
         _input(["read_outgoing", ID, typename])
         output = _handle_output("Success: ", split=" ")
         output = _handle_output("Success: ", split=" ")
         if output == "":
         if output == "":
-            return []
+            return set([])
         else:
         else:
-            return output.split("\n")
+            return set(output.split("\n"))
     finally:
     finally:
         model_exit()
         model_exit()
 
 
@@ -814,9 +838,9 @@ def read_incoming(model_name, ID, typename):
         _input(["read_incoming", ID, typename])
         _input(["read_incoming", ID, typename])
         output = _handle_output("Success: ", split=" ")
         output = _handle_output("Success: ", split=" ")
         if output == "":
         if output == "":
-            return []
+            return set([])
         else:
         else:
-            return output.split("\n")
+            return set(output.split("\n"))
     finally:
     finally:
         model_exit()
         model_exit()