Browse Source

Fixed many compilation/syntax errors

Yentl Van Tendeloo 8 years ago
parent
commit
9ea44ba6e6

+ 55 - 83
integration/test_powerwindow.py

@@ -70,10 +70,6 @@ class TestPowerWindow(unittest.TestCase):
                     "SimpleClassDiagrams",
                     "SimpleClassDiagrams",
                     "Query",
                     "Query",
                     ] + get_model_constructor(open("models/query.mvc", "r").read()) + [
                     ] + get_model_constructor(open("models/query.mvc", "r").read()) + [
-                "model_add",
-                    "SimpleClassDiagrams",
-                    "Network",
-                    ] + get_model_constructor(open("models/network.mvc", "r").read()) + [
                 "model_add",
                 "model_add",
                     "ProcessModel",
                     "ProcessModel",
                     "pm_powerwindow",
                     "pm_powerwindow",
@@ -87,7 +83,6 @@ class TestPowerWindow(unittest.TestCase):
                 "PW_Environment",
                 "PW_Environment",
                 "Requirements",
                 "Requirements",
                 "ReachabilityGraph",
                 "ReachabilityGraph",
-                "Network",
                 "Query",
                 "Query",
                 "",
                 "",
                 "All_RAM",
                 "All_RAM",
@@ -95,14 +90,19 @@ class TestPowerWindow(unittest.TestCase):
                     "__merged_All_RAM",
                     "__merged_All_RAM",
                         "instantiate",
                         "instantiate",
                             "Association",
                             "Association",
-                            "C2P_PlaceLink",
+                            "CTRL2EPN/link",
                             "PW_Control/State",
                             "PW_Control/State",
                             "Encapsulated_PetriNet/Place",
                             "Encapsulated_PetriNet/Place",
                         "instantiate",
                         "instantiate",
                             "Association",
                             "Association",
-                            "C2P_TransitionLink",
-                            "PW_Control/Transition",
-                            "Encapsulated_PetriNet/Transition",
+                            "PLANT2EPN/link",
+                            "PW_Plant/State",
+                            "Encapsulated_PetriNet/Place",
+                        "instantiate",
+                            "Association",
+                            "ENV2EPN/link",
+                            "PW_Environment/Event",
+                            "Encapsulated_PetriNet/Place",
                         "exit",
                         "exit",
                 "transformation_RAMify",
                 "transformation_RAMify",
                     "__merged_All_RAM",
                     "__merged_All_RAM",
@@ -130,12 +130,6 @@ class TestPowerWindow(unittest.TestCase):
                     "PW_Control",
                     "PW_Control",
                     "",
                     "",
                     "refine_control",
                     "refine_control",
-                "transformation_add_MANUAL",
-                    "Network",
-                    "",
-                    "Network",
-                    "",
-                    "refine_network",
                 "transformation_add_MANUAL",
                 "transformation_add_MANUAL",
                     "Query",
                     "Query",
                     "",
                     "",
@@ -148,7 +142,6 @@ class TestPowerWindow(unittest.TestCase):
                     "PW_Plant",
                     "PW_Plant",
                     "PW_Environment",
                     "PW_Environment",
                     "PW_Control",
                     "PW_Control",
-                    "Network",
                     "Query",
                     "Query",
                     "",
                     "",
                     "make_initial_models",
                     "make_initial_models",
@@ -169,6 +162,14 @@ class TestPowerWindow(unittest.TestCase):
                     "",
                     "",
                     "control_to_EPN",
                     "control_to_EPN",
                     ] + get_model_constructor(open("models/control_to_EPN.mvc", "r").read()) + [
                     ] + get_model_constructor(open("models/control_to_EPN.mvc", "r").read()) + [
+                "transformation_add_MT",
+                    "All_RAM",
+                    "PW_Environment",
+                    "",
+                    "Encapsulated_PetriNet",
+                    "",
+                    "environment_to_EPN",
+                    ] + get_constructor(open("models/environment_to_EPN.mvc", "r").read()) + [
                 "transformation_add_AL",
                 "transformation_add_AL",
                     "PetriNet",
                     "PetriNet",
                     "",
                     "",
@@ -176,13 +177,6 @@ class TestPowerWindow(unittest.TestCase):
                     "",
                     "",
                     "reachability",
                     "reachability",
                     ] + get_constructor(open("integration/code/reachability.alc", "r").read()) + [
                     ] + get_constructor(open("integration/code/reachability.alc", "r").read()) + [
-                "transformation_add_AL",
-                    "PW_Environment",
-                    "",
-                    "Encapsulated_PetriNet",
-                    "",
-                    "environment_to_EPN",
-                    ] + get_constructor(open("models/environment_to_EPN.alc", "r").read()) + [
                 "model_list",
                 "model_list",
             ],
             ],
             [   # bootup phase
             [   # bootup phase
@@ -193,13 +187,13 @@ class TestPowerWindow(unittest.TestCase):
                 "Welcome to the Model Management Interface v2.0!",
                 "Welcome to the Model Management Interface v2.0!",
                 "Use the 'help' command for a list of possible commands",
                 "Use the 'help' command for a list of possible commands",
                 "Ready for command...",
                 "Ready for command...",
-                # model_add * 10
+                # model_add * 9
                 ] + [   "Creating new model!",
                 ] + [   "Creating new model!",
                         "Model type?",
                         "Model type?",
                         "Model name?",
                         "Model name?",
                         "Waiting for model constructors...",
                         "Waiting for model constructors...",
                         "Model upload success!",
                         "Model upload success!",
-                        "Ready for command...", ] * 10 + [
+                        "Ready for command...", ] * 9 + [
                 # model_list
                 # model_list
                 model_list |
                 model_list |
                 set([
                 set([
@@ -211,7 +205,6 @@ class TestPowerWindow(unittest.TestCase):
                      "  PW_Control : SimpleClassDiagrams",
                      "  PW_Control : SimpleClassDiagrams",
                      "  Requirements : SimpleClassDiagrams",
                      "  Requirements : SimpleClassDiagrams",
                      "  Query : SimpleClassDiagrams",
                      "  Query : SimpleClassDiagrams",
-                     "  Network : SimpleClassDiagrams",
                      "  pm_powerwindow : ProcessModel",
                      "  pm_powerwindow : ProcessModel",
                      ]),
                      ]),
                 "Ready for command...",
                 "Ready for command...",
@@ -224,20 +217,13 @@ class TestPowerWindow(unittest.TestCase):
                 "Model loaded, ready for commands!",
                 "Model loaded, ready for commands!",
                 "Use 'help' command for a list of possible commands",
                 "Use 'help' command for a list of possible commands",
                 "Please give your command.",
                 "Please give your command.",
-                # instantiate 1
-                "Type to instantiate?",
-                "Name of new element?",
-                "Source name?",
-                "Destination name?",
-                "Instantiation successful!",
-                "Please give your command.",
-                # instantiate 2
-                "Type to instantiate?",
-                "Name of new element?",
-                "Source name?",
-                "Destination name?",
-                "Instantiation successful!",
-                "Please give your command.",
+                # instantiate * 3
+                ] + [   "Type to instantiate?",
+                        "Name of new element?",
+                        "Source name?",
+                        "Destination name?",
+                        "Instantiation successful!",
+                        "Please give your command.", ] * 3 + [
                 "Ready for command...",
                 "Ready for command...",
                 # transformation_RAMify
                 # transformation_RAMify
                 "Which metamodel do you want to RAMify?",
                 "Which metamodel do you want to RAMify?",
@@ -251,7 +237,7 @@ class TestPowerWindow(unittest.TestCase):
                     "Name of Manual operation model?",
                     "Name of Manual operation model?",
                     "Ready for command...",
                     "Ready for command...",
                     ] + [
                     ] + [
-                # transformation_add_MANUAL * 5
+                # transformation_add_MANUAL * 4
                 ] + [
                 ] + [
                     "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 source for the manual operation (empty string to finish)?",
                     "Model added as source",
                     "Model added as source",
@@ -259,14 +245,13 @@ class TestPowerWindow(unittest.TestCase):
                     "Model added as target",
                     "Model added as target",
                     "Name of Manual operation model?",
                     "Name of Manual operation model?",
                     "Ready for command...",
                     "Ready for command...",
-                    ] * 5 + [
+                    ] * 4 + [
                 # transformation_add_MT
                 # transformation_add_MT
                 "RAMified metamodel to use?",
                 "RAMified metamodel to use?",
                 "Supported metamodels:",
                 "Supported metamodels:",
                 set(["  PetriNet",
                 set(["  PetriNet",
                      "  Encapsulated_PetriNet",
                      "  Encapsulated_PetriNet",
                      "  PW_Plant",
                      "  PW_Plant",
-                     "  Network",
                      "  Query",
                      "  Query",
                      "  PW_Environment",
                      "  PW_Environment",
                      "  Requirements",
                      "  Requirements",
@@ -289,7 +274,6 @@ class TestPowerWindow(unittest.TestCase):
                 "Supported metamodels:",
                 "Supported metamodels:",
                 set(["  PetriNet",
                 set(["  PetriNet",
                      "  Encapsulated_PetriNet",
                      "  Encapsulated_PetriNet",
-                     "  Network",
                      "  Query",
                      "  Query",
                      "  PW_Plant",
                      "  PW_Plant",
                      "  PW_Environment",
                      "  PW_Environment",
@@ -306,42 +290,33 @@ class TestPowerWindow(unittest.TestCase):
                 "Waiting for model constructors...",
                 "Waiting for model constructors...",
                 "Ready for command...",
                 "Ready for command...",
                 # transformation_add_MT
                 # transformation_add_MT
-                "RAMified metamodel to use?",
-                "Supported metamodels:",
-                set(["  PetriNet",
-                     "  Encapsulated_PetriNet",
-                     "  Network",
-                     "  Query",
-                     "  PW_Plant",
-                     "  PW_Environment",
-                     "  Requirements",
-                     "  PW_Control",
-                     "  ReachabilityGraph",
-                    ]),
-                "",
-                "Which ones do you want to use as source (empty string to finish)?",
-                "Model added as source",
-                "Which ones do you want to use as target (empty string to finish)?",
-                "Model added as target",
-                "Name of new transformation?",
-                "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)?",
-                "Model added as source",
-                "Which metamodels do you want to use as target for the action code (empty string to finish)?",
-                "Model added as target",
-                "Name of Action Language model?",
-                "Waiting for model constructors...",
-                "Ready for command...",
+                ] + [   "RAMified metamodel to use?",
+                        "Supported metamodels:",
+                        set(["  PetriNet",
+                             "  Encapsulated_PetriNet",
+                             "  Query",
+                             "  PW_Plant",
+                             "  PW_Environment",
+                             "  Requirements",
+                             "  PW_Control",
+                             "  ReachabilityGraph",
+                            ]),
+                        "",
+                        "Which ones do you want to use as source (empty string to finish)?",
+                        "Model added as source",
+                        "Which ones do you want to use as target (empty string to finish)?",
+                        "Model added as target",
+                        "Name of new transformation?",
+                        "Waiting for model constructors...",
+                        "Ready for command...", ] * 3 + [
                 # transformation_add_AL
                 # transformation_add_AL
-                "Which metamodels do you want to use as source for the action code (empty string to finish)?",
-                "Model added as source",
-                "Which metamodels do you want to use as target for the action code (empty string to finish)?",
-                "Model added as target",
-                "Name of Action Language model?",
-                "Waiting for model constructors...",
-                "Ready for command...",
+                ] + [   "Which metamodels do you want to use as source for the action code (empty string to finish)?",
+                        "Model added as source",
+                        "Which metamodels do you want to use as target for the action code (empty string to finish)?",
+                        "Model added as target",
+                        "Name of Action Language model?",
+                        "Waiting for model constructors...",
+                        "Ready for command...", ] * 1 + [
                 # model_list
                 # model_list
                 model_list |
                 model_list |
                 set([
                 set([
@@ -351,27 +326,24 @@ class TestPowerWindow(unittest.TestCase):
                      "  PW_Environment : SimpleClassDiagrams",
                      "  PW_Environment : SimpleClassDiagrams",
                      "  PW_Control : SimpleClassDiagrams",
                      "  PW_Control : SimpleClassDiagrams",
                      "  Requirements : SimpleClassDiagrams",
                      "  Requirements : SimpleClassDiagrams",
-                     "  Network : SimpleClassDiagrams",
                      "  Query : SimpleClassDiagrams",
                      "  Query : SimpleClassDiagrams",
                      "  reachability : ActionLanguage",
                      "  reachability : ActionLanguage",
                      "  define_req : ManualOperation",
                      "  define_req : ManualOperation",
                      "  refine_plant : ManualOperation",
                      "  refine_plant : ManualOperation",
                      "  refine_control : ManualOperation",
                      "  refine_control : ManualOperation",
                      "  refine_environment : ManualOperation",
                      "  refine_environment : ManualOperation",
-                     "  refine_network : ManualOperation",
                      "  refine_query : ManualOperation",
                      "  refine_query : ManualOperation",
                      "  __merged_define_req : SimpleClassDiagrams",
                      "  __merged_define_req : SimpleClassDiagrams",
                      "  __merged_All_RAM : SimpleClassDiagrams",
                      "  __merged_All_RAM : SimpleClassDiagrams",
                      "  __merged_refine_plant : SimpleClassDiagrams",
                      "  __merged_refine_plant : SimpleClassDiagrams",
                      "  __merged_refine_control : SimpleClassDiagrams",
                      "  __merged_refine_control : SimpleClassDiagrams",
                      "  __merged_refine_environment : SimpleClassDiagrams",
                      "  __merged_refine_environment : SimpleClassDiagrams",
-                     "  __merged_refine_network : SimpleClassDiagrams",
                      "  __merged_refine_query : SimpleClassDiagrams",
                      "  __merged_refine_query : SimpleClassDiagrams",
                      "  All_RAM : SimpleClassDiagrams",
                      "  All_RAM : SimpleClassDiagrams",
                      "  make_initial_models : All_RAM",
                      "  make_initial_models : All_RAM",
                      "  pm_powerwindow : ProcessModel",
                      "  pm_powerwindow : ProcessModel",
                      "  plant_to_EPN : All_RAM",
                      "  plant_to_EPN : All_RAM",
-                     "  environment_to_EPN : ActionLanguage",
+                     "  environment_to_EPN : All_RAM",
                      "  control_to_EPN : All_RAM",
                      "  control_to_EPN : All_RAM",
                      "  ReachabilityGraph : SimpleClassDiagrams",
                      "  ReachabilityGraph : SimpleClassDiagrams",
                      ]),
                      ]),

+ 23 - 20
models/control_to_EPN.mvc

@@ -1,5 +1,6 @@
 include "primitives.alh"
 include "primitives.alh"
 include "modelling.alh"
 include "modelling.alh"
+include "object_operations.alh"
 
 
 All_RAM Control2EPN {
 All_RAM Control2EPN {
     Composite schedule {
     Composite schedule {
@@ -14,7 +15,7 @@ All_RAM Control2EPN {
                         String function value(model : Element, name : String, mapping : Element):
                         String function value(model : Element, name : String, mapping : Element):
                             return "cmdDown"!
                             return "cmdDown"!
                         $
                         $
-                    value_tokens = #
+                    value_tokens = $
                         Integer function value(model : Element, name : String, mapping : Element):
                         Integer function value(model : Element, name : String, mapping : Element):
                             return 0!
                             return 0!
                         $
                         $
@@ -36,7 +37,7 @@ All_RAM Control2EPN {
                         String function value(model : Element, name : String, mapping : Element):
                         String function value(model : Element, name : String, mapping : Element):
                             return "cmdNeutral"!
                             return "cmdNeutral"!
                         $
                         $
-                    value_tokens = #
+                    value_tokens = $
                         Integer function value(model : Element, name : String, mapping : Element):
                         Integer function value(model : Element, name : String, mapping : Element):
                             return 1!
                             return 1!
                         $
                         $
@@ -57,7 +58,7 @@ All_RAM Control2EPN {
                         String function value(model : Element, name : String, mapping : Element):
                         String function value(model : Element, name : String, mapping : Element):
                             return "cmdUp"!
                             return "cmdUp"!
                         $
                         $
-                    value_tokens = #
+                    value_tokens = $
                         Integer function value(model : Element, name : String, mapping : Element):
                         Integer function value(model : Element, name : String, mapping : Element):
                             return 0!
                             return 0!
                         $
                         $
@@ -78,7 +79,7 @@ All_RAM Control2EPN {
                         String function value(model : Element, name : String, mapping : Element):
                         String function value(model : Element, name : String, mapping : Element):
                             return "objDetected"!
                             return "objDetected"!
                         $
                         $
-                    value_tokens = #
+                    value_tokens = $
                         Integer function value(model : Element, name : String, mapping : Element):
                         Integer function value(model : Element, name : String, mapping : Element):
                             return 0!
                             return 0!
                         $
                         $
@@ -99,7 +100,7 @@ All_RAM Control2EPN {
                         String function value(model : Element, name : String, mapping : Element):
                         String function value(model : Element, name : String, mapping : Element):
                             return "no_objDetected"!
                             return "no_objDetected"!
                         $
                         $
-                    value_tokens = #
+                    value_tokens = $
                         Integer function value(model : Element, name : String, mapping : Element):
                         Integer function value(model : Element, name : String, mapping : Element):
                             return 1!
                             return 1!
                         $
                         $
@@ -120,7 +121,7 @@ All_RAM Control2EPN {
                         String function value(model : Element, name : String, mapping : Element):
                         String function value(model : Element, name : String, mapping : Element):
                             return "up"!
                             return "up"!
                         $
                         $
-                    value_tokens = #
+                    value_tokens = $
                         Integer function value(model : Element, name : String, mapping : Element):
                         Integer function value(model : Element, name : String, mapping : Element):
                             return 0!
                             return 0!
                         $
                         $
@@ -141,7 +142,7 @@ All_RAM Control2EPN {
                         String function value(model : Element, name : String, mapping : Element):
                         String function value(model : Element, name : String, mapping : Element):
                             return "neutral"!
                             return "neutral"!
                         $
                         $
-                    value_tokens = #
+                    value_tokens = $
                         Integer function value(model : Element, name : String, mapping : Element):
                         Integer function value(model : Element, name : String, mapping : Element):
                             return 1!
                             return 1!
                         $
                         $
@@ -162,7 +163,7 @@ All_RAM Control2EPN {
                         String function value(model : Element, name : String, mapping : Element):
                         String function value(model : Element, name : String, mapping : Element):
                             return "down"!
                             return "down"!
                         $
                         $
-                    value_tokens = #
+                    value_tokens = $
                         Integer function value(model : Element, name : String, mapping : Element):
                         Integer function value(model : Element, name : String, mapping : Element):
                             return 0!
                             return 0!
                         $
                         $
@@ -184,7 +185,7 @@ All_RAM Control2EPN {
                         String function value(model : Element, name : String, mapping : Element):
                         String function value(model : Element, name : String, mapping : Element):
                             return "interrupt"!
                             return "interrupt"!
                         $
                         $
-                    value_tokens = #
+                    value_tokens = $
                         Integer function value(model : Element, name : String, mapping : Element):
                         Integer function value(model : Element, name : String, mapping : Element):
                             return 0!
                             return 0!
                         $
                         $
@@ -286,7 +287,7 @@ All_RAM Control2EPN {
                 }
                 }
 
 
                 constraint = $
                 constraint = $
-                    Boolean constraint (host_model : Element, mapping : Element):
+                    Boolean function constraint (host_model : Element, mapping : Element):
                         // Check whether the bound primary places match with the state
                         // Check whether the bound primary places match with the state
                         String type_0
                         String type_0
                         String type_1
                         String type_1
@@ -428,7 +429,7 @@ All_RAM Control2EPN {
                 Pre_Control_PW/Transition (pre_co_0, pre_co_1) {
                 Pre_Control_PW/Transition (pre_co_0, pre_co_1) {
                     label = "2"
                     label = "2"
                     constraint_objDetected = $
                     constraint_objDetected = $
-                        Boolean constraint(value : String):
+                        Boolean function constraint(value : String):
                             return (bool_or(value == "Y", value == "N"))!
                             return (bool_or(value == "Y", value == "N"))!
                         $
                         $
                 }
                 }
@@ -450,7 +451,7 @@ All_RAM Control2EPN {
                 Pre_Encapsulated_PetriNet/Port pre_co_11 {
                 Pre_Encapsulated_PetriNet/Port pre_co_11 {
                     label = "11"
                     label = "11"
                     constraint_name = $
                     constraint_name = $
-                        Boolean constraint(value : String):
+                        Boolean function constraint(value : String):
                             return (bool_or(value == "objDetected", value == "no_objDetected"))!
                             return (bool_or(value == "objDetected", value == "no_objDetected"))!
                         $
                         $
                 }
                 }
@@ -468,7 +469,7 @@ All_RAM Control2EPN {
                 }
                 }
 
 
                 constraint = $
                 constraint = $
-                    Boolean constraint (host_model : Element, mapping : Element):
+                    Boolean function constraint (host_model : Element, mapping : Element):
                         // Check whether the bound primary places match with the state
                         // Check whether the bound primary places match with the state
                         String s1_value
                         String s1_value
                         String ps1_type
                         String ps1_type
@@ -541,7 +542,7 @@ All_RAM Control2EPN {
                 Pre_Control_PW/State pre_fi_1 {
                 Pre_Control_PW/State pre_fi_1 {
                     label = "1"
                     label = "1"
                     constraint_isError = $
                     constraint_isError = $
-                        Boolean constraint(value : Boolean):
+                        Boolean function constraint(value : Boolean):
                             return value!
                             return value!
                         $
                         $
                 }
                 }
@@ -572,7 +573,7 @@ All_RAM Control2EPN {
                 Pre_Encapsulated_PetriNet/Port pre_fi_15 {
                 Pre_Encapsulated_PetriNet/Port pre_fi_15 {
                     label = "15"
                     label = "15"
                     constraint_name = $
                     constraint_name = $
-                        Boolean constraint(value : String):
+                        Boolean function constraint(value : String):
                             return (value == "interrupt")!
                             return (value == "interrupt")!
                         $
                         $
                 }
                 }
@@ -581,7 +582,7 @@ All_RAM Control2EPN {
                 }
                 }
 
 
                 constraint = $
                 constraint = $
-                    Boolean constraint (host_model : Element, mapping : Element):
+                    Boolean function constraint (host_model : Element, mapping : Element):
                         // Check whether the bound primary places match with the state
                         // Check whether the bound primary places match with the state
                         String s_err_type
                         String s_err_type
                         String p_name
                         String p_name
@@ -605,7 +606,7 @@ All_RAM Control2EPN {
                 Post_Control_PW/State post_fi_1 {
                 Post_Control_PW/State post_fi_1 {
                     label = "1"
                     label = "1"
                     constraint_isError = $
                     constraint_isError = $
-                        Boolean constraint(value : Boolean):
+                        Boolean function constraint(value : Boolean):
                             return value!
                             return value!
                         $
                         $
                 }
                 }
@@ -654,13 +655,15 @@ All_RAM Control2EPN {
                 Post_Encapsulated_PetriNet/T2P (post_fi_7, post_fi_12) {
                 Post_Encapsulated_PetriNet/T2P (post_fi_7, post_fi_12) {
                     label = "11"
                     label = "11"
                 }
                 }
+            }
+        }
 
 
         {Contains} ForAll fix_interrupt_self {
         {Contains} ForAll fix_interrupt_self {
             LHS {
             LHS {
                 Pre_Control_PW/State pre_fis_0 {
                 Pre_Control_PW/State pre_fis_0 {
                     label = "0"
                     label = "0"
                     constraint_isError = $
                     constraint_isError = $
-                        Boolean constraint(value : Boolean):
+                        Boolean function constraint(value : Boolean):
                             return value!
                             return value!
                         $
                         $
                 }
                 }
@@ -677,7 +680,7 @@ All_RAM Control2EPN {
                 Pre_Encapsulated_PetriNet/Port pre_fis_4 {
                 Pre_Encapsulated_PetriNet/Port pre_fis_4 {
                     label = "4"
                     label = "4"
                     constraint_name = $
                     constraint_name = $
-                        Boolean constraint(value : String):
+                        Boolean function constraint(value : String):
                             return (value == "interrupt")!
                             return (value == "interrupt")!
                         $
                         $
                 }
                 }
@@ -696,7 +699,7 @@ All_RAM Control2EPN {
                 }
                 }
 
 
                 constraint = $
                 constraint = $
-                    Boolean constraint (host_model : Element, mapping : Element):
+                    Boolean function constraint (host_model : Element, mapping : Element):
                         // Check whether the bound primary places match with the state
                         // Check whether the bound primary places match with the state
                         String s_err_type
                         String s_err_type
                         String p_name
                         String p_name

+ 1 - 1
models/environment_PW.mvc

@@ -5,7 +5,7 @@ SimpleClassDiagrams Environment_PW{
     SimpleAttribute Natural{}
     SimpleAttribute Natural{}
     SimpleAttribute String{}
     SimpleAttribute String{}
 
 
-    Class Group {name}
+    Class Group {}
     Class Event {
     Class Event {
         initial : Boolean
         initial : Boolean
         name : String
         name : String

+ 18 - 16
models/plant_to_EPN.mvc

@@ -1,4 +1,6 @@
 include "primitives.alh"
 include "primitives.alh"
+include "modelling.alh"
+include "object_operations.alh"
 
 
 A B {
 A B {
     Composite schedule {
     Composite schedule {
@@ -13,7 +15,7 @@ A B {
                         String function value(model : Element, name : String, mapping : Element):
                         String function value(model : Element, name : String, mapping : Element):
                             return "down"!
                             return "down"!
                         $
                         $
-                    value_tokens = #
+                    value_tokens = $
                         Integer function value(model : Element, name : String, mapping : Element):
                         Integer function value(model : Element, name : String, mapping : Element):
                             return 0!
                             return 0!
                         $
                         $
@@ -35,7 +37,7 @@ A B {
                         String function value(model : Element, name : String, mapping : Element):
                         String function value(model : Element, name : String, mapping : Element):
                             return "neutral"!
                             return "neutral"!
                         $
                         $
-                    value_tokens = #
+                    value_tokens = $
                         Integer function value(model : Element, name : String, mapping : Element):
                         Integer function value(model : Element, name : String, mapping : Element):
                             return 0!
                             return 0!
                         $
                         $
@@ -57,7 +59,7 @@ A B {
                         String function value(model : Element, name : String, mapping : Element):
                         String function value(model : Element, name : String, mapping : Element):
                             return "down"!
                             return "down"!
                         $
                         $
-                    value_tokens = #
+                    value_tokens = $
                         Integer function value(model : Element, name : String, mapping : Element):
                         Integer function value(model : Element, name : String, mapping : Element):
                             return 0!
                             return 0!
                         $
                         $
@@ -79,7 +81,7 @@ A B {
                         String function value(model : Element, name : String, mapping : Element):
                         String function value(model : Element, name : String, mapping : Element):
                             return "interrupt"!
                             return "interrupt"!
                         $
                         $
-                    value_tokens = #
+                    value_tokens = $
                         Integer function value(model : Element, name : String, mapping : Element):
                         Integer function value(model : Element, name : String, mapping : Element):
                             return 0!
                             return 0!
                         $
                         $
@@ -101,7 +103,7 @@ A B {
                         String function value(model : Element, name : String, mapping : Element):
                         String function value(model : Element, name : String, mapping : Element):
                             return "objDetected"!
                             return "objDetected"!
                         $
                         $
-                    value_tokens = #
+                    value_tokens = $
                         Integer function value(model : Element, name : String, mapping : Element):
                         Integer function value(model : Element, name : String, mapping : Element):
                             return 0!
                             return 0!
                         $
                         $
@@ -123,7 +125,7 @@ A B {
                         String function value(model : Element, name : String, mapping : Element):
                         String function value(model : Element, name : String, mapping : Element):
                             return "no_objDetected"!
                             return "no_objDetected"!
                         $
                         $
-                    value_tokens = #
+                    value_tokens = $
                         Integer function value(model : Element, name : String, mapping : Element):
                         Integer function value(model : Element, name : String, mapping : Element):
                             return 1!
                             return 1!
                         $
                         $
@@ -145,7 +147,7 @@ A B {
                         String function value(model : Element, name : String, mapping : Element):
                         String function value(model : Element, name : String, mapping : Element):
                             return "objPresent"!
                             return "objPresent"!
                         $
                         $
-                    value_tokens = #
+                    value_tokens = $
                         Integer function value(model : Element, name : String, mapping : Element):
                         Integer function value(model : Element, name : String, mapping : Element):
                             return 0!
                             return 0!
                         $
                         $
@@ -167,7 +169,7 @@ A B {
                         String function value(model : Element, name : String, mapping : Element):
                         String function value(model : Element, name : String, mapping : Element):
                             return "no_objPresent"!
                             return "no_objPresent"!
                         $
                         $
-                    value_tokens = #
+                    value_tokens = $
                         Integer function value(model : Element, name : String, mapping : Element):
                         Integer function value(model : Element, name : String, mapping : Element):
                             return 1!
                             return 1!
                         $
                         $
@@ -307,7 +309,7 @@ A B {
                 Pre_Plant_PW/Transition pre_co_2{
                 Pre_Plant_PW/Transition pre_co_2{
                     label = "2"
                     label = "2"
                     constraint_objPresent = $
                     constraint_objPresent = $
-                        Boolean constraint(value : String):
+                        Boolean function constraint(value : String):
                             return (bool_or(value == "Y", value == "N"))!
                             return (bool_or(value == "Y", value == "N"))!
                         $
                         $
                 }
                 }
@@ -344,7 +346,7 @@ A B {
                 }
                 }
 
 
                 constraint = $
                 constraint = $
-                    Boolean constraint (host_model : Element, mapping : Element):
+                    Boolean function constraint (host_model : Element, mapping : Element):
                         // Check whether the bound primary places match with the state
                         // Check whether the bound primary places match with the state
                         String objPresent
                         String objPresent
                         String port_name
                         String port_name
@@ -459,7 +461,7 @@ A B {
                 Pre_Encapsulated_PetriNet/Port pre_de_14 {
                 Pre_Encapsulated_PetriNet/Port pre_de_14 {
                     label = "14"
                     label = "14"
                     constraint_name = $
                     constraint_name = $
-                        Boolean constraint(value : String):
+                        Boolean function constraint(value : String):
                             return (value == "interrupt")!
                             return (value == "interrupt")!
                         $
                         $
                 }
                 }
@@ -473,7 +475,7 @@ A B {
                 Pre_Encapsulated_PetriNet/Port pre_de_17 {
                 Pre_Encapsulated_PetriNet/Port pre_de_17 {
                     label = "17"
                     label = "17"
                     constraint_name = $
                     constraint_name = $
-                        Boolean constraint(value : String):
+                        Boolean function constraint(value : String):
                             return (value == "no_objDetected")!
                             return (value == "no_objDetected")!
                         $
                         $
                 }
                 }
@@ -487,7 +489,7 @@ A B {
                 Pre_Encapsulated_PetriNet/Port pre_de_20 {
                 Pre_Encapsulated_PetriNet/Port pre_de_20 {
                     label = "20"
                     label = "20"
                     constraint_name = $
                     constraint_name = $
-                        Boolean constraint(value : String):
+                        Boolean function constraint(value : String):
                             return (value == "objDetected")!
                             return (value == "objDetected")!
                         $
                         $
                 }
                 }
@@ -496,7 +498,7 @@ A B {
                 }
                 }
 
 
                 constraint = $
                 constraint = $
-                    Boolean constraint (host_model : Element, mapping : Element):
+                    Boolean function constraint (host_model : Element, mapping : Element):
                         // Check whether the bound primary places match with the state
                         // Check whether the bound primary places match with the state
                         String source_type
                         String source_type
                         String port_name
                         String port_name
@@ -638,7 +640,7 @@ A B {
                 Pre_Encapsulated_PetriNet/Port pre_rd_11 {
                 Pre_Encapsulated_PetriNet/Port pre_rd_11 {
                     label = "11"
                     label = "11"
                     constraint_name = $
                     constraint_name = $
-                        Boolean constraint(value : String):
+                        Boolean function constraint(value : String):
                             return (value == "objDetected")!
                             return (value == "objDetected")!
                         $
                         $
                 }
                 }
@@ -652,7 +654,7 @@ A B {
                 Pre_Encapsulated_PetriNet/Port pre_rd_14 {
                 Pre_Encapsulated_PetriNet/Port pre_rd_14 {
                     label = "14"
                     label = "14"
                     constraint_name = $
                     constraint_name = $
-                        Boolean constraint(value : String):
+                        Boolean function constraint(value : String):
                             return (value == "no_objDetected")!
                             return (value == "no_objDetected")!
                         $
                         $
                 }
                 }

+ 0 - 14
models/pm_req_analyse.mvc

@@ -20,9 +20,6 @@ ProcessModel analyse_requirements {
     Exec refine_control {
     Exec refine_control {
         name = "refine_control"
         name = "refine_control"
     }
     }
-    Exec refine_network {
-        name = "refine_network"
-    }
     Exec refine_query {
     Exec refine_query {
         name = "refine_query"
         name = "refine_query"
     }
     }
@@ -83,10 +80,6 @@ ProcessModel analyse_requirements {
         name = "environment_EPN"
         name = "environment_EPN"
         type = "Encapsulated_PetriNet"
         type = "Encapsulated_PetriNet"
     }
     }
-    Data network {
-        name = "network"
-        type = "Network"
-    }
     Data pn {
     Data pn {
         name = "pn"
         name = "pn"
         type = "PetriNet"
         type = "PetriNet"
@@ -106,12 +99,10 @@ ProcessModel analyse_requirements {
     Next (forkjoin1, refine_plant) {}
     Next (forkjoin1, refine_plant) {}
     Next (forkjoin1, refine_environment) {}
     Next (forkjoin1, refine_environment) {}
     Next (forkjoin1, refine_control) {}
     Next (forkjoin1, refine_control) {}
-    Next (forkjoin1, refine_network) {}
     Next (forkjoin1, refine_query) {}
     Next (forkjoin1, refine_query) {}
     Next (refine_plant, plant_to_EPN) {}
     Next (refine_plant, plant_to_EPN) {}
     Next (refine_environment, environment_to_EPN) {}
     Next (refine_environment, environment_to_EPN) {}
     Next (refine_control, control_to_EPN) {}
     Next (refine_control, control_to_EPN) {}
-    Next (refine_network, forkjoin2) {}
     Next (plant_to_EPN, forkjoin2) {}
     Next (plant_to_EPN, forkjoin2) {}
     Next (environment_to_EPN, forkjoin2) {}
     Next (environment_to_EPN, forkjoin2) {}
     Next (control_to_EPN, forkjoin2) {}
     Next (control_to_EPN, forkjoin2) {}
@@ -129,30 +120,25 @@ ProcessModel analyse_requirements {
     Produces (make_initial_models, plant_model) {}
     Produces (make_initial_models, plant_model) {}
     Produces (make_initial_models, environment_model) {}
     Produces (make_initial_models, environment_model) {}
     Produces (make_initial_models, control_model) {}
     Produces (make_initial_models, control_model) {}
-    Produces (make_initial_models, network) {}
     Produces (make_initial_models, query) {}
     Produces (make_initial_models, query) {}
 
 
     Consumes (req, refine_plant) {}
     Consumes (req, refine_plant) {}
     Consumes (req, refine_environment) {}
     Consumes (req, refine_environment) {}
     Consumes (req, refine_control) {}
     Consumes (req, refine_control) {}
-    Consumes (req, refine_network) {}
     Consumes (req, refine_query) {}
     Consumes (req, refine_query) {}
 
 
     Consumes (plant_model, refine_plant) {}
     Consumes (plant_model, refine_plant) {}
     Consumes (environment_model, refine_environment) {}
     Consumes (environment_model, refine_environment) {}
     Consumes (control_model, refine_control) {}
     Consumes (control_model, refine_control) {}
-    Consumes (network, refine_network) {}
     Consumes (query, refine_query) {}
     Consumes (query, refine_query) {}
     Produces (refine_plant, plant_EPN) {}
     Produces (refine_plant, plant_EPN) {}
     Produces (refine_control, control_EPN) {}
     Produces (refine_control, control_EPN) {}
     Produces (refine_environment, environment_EPN) {}
     Produces (refine_environment, environment_EPN) {}
-    Produces (refine_network, network) {}
     Produces (refine_query, query) {}
     Produces (refine_query, query) {}
 
 
     Consumes (plant_EPN, combine_EPN) {}
     Consumes (plant_EPN, combine_EPN) {}
     Consumes (environment_EPN, combine_EPN) {}
     Consumes (environment_EPN, combine_EPN) {}
     Consumes (control_EPN, combine_EPN) {}
     Consumes (control_EPN, combine_EPN) {}
-    Consumes (network, combine_EPN) {}
     Produces (combine_EPN, pn) {}
     Produces (combine_EPN, pn) {}
 
 
     Consumes (pn, analyse) {}
     Consumes (pn, analyse) {}