Browse Source

Updated rules and their integration

Yentl Van Tendeloo 8 years ago
parent
commit
cf211a3b73

+ 25 - 18
integration/test_powerwindow.py

@@ -41,39 +41,39 @@ class TestPowerWindow(unittest.TestCase):
                 "model_add",
                 "model_add",
                     "SimpleClassDiagrams",
                     "SimpleClassDiagrams",
                     "ReachabilityGraph",
                     "ReachabilityGraph",
-                    ] + get_model_constructor(open("integration/code/reachability_graph.mvc", "r").read()) + [
+                    ] + get_model_constructor_2("integration/code/reachability_graph.mvc") + [
                 "model_add",
                 "model_add",
                     "SimpleClassDiagrams",
                     "SimpleClassDiagrams",
                     "PetriNet",
                     "PetriNet",
-                    ] + get_model_constructor(open("integration/code/pn_design.mvc", "r").read()) + [
+                    ] + get_model_constructor_2("integration/code/pn_design.mvc") + [
                 "model_add",
                 "model_add",
                     "SimpleClassDiagrams",
                     "SimpleClassDiagrams",
                     "Encapsulated_PetriNet",
                     "Encapsulated_PetriNet",
-                    ] + get_model_constructor(open("models/petrinet_ports.mvc", "r").read()) + [
+                    ] + get_model_constructor_2("models/petrinet_ports.mvc") + [
                 "model_add",
                 "model_add",
                     "SimpleClassDiagrams",
                     "SimpleClassDiagrams",
                     "PW_Plant",
                     "PW_Plant",
-                    ] + get_model_constructor(open("models/plant_PW.mvc", "r").read()) + [
+                    ] + get_model_constructor_2("models/plant_PW.mvc") + [
                 "model_add",
                 "model_add",
                     "SimpleClassDiagrams",
                     "SimpleClassDiagrams",
                     "PW_Environment",
                     "PW_Environment",
-                    ] + get_model_constructor(open("models/environment_PW.mvc", "r").read()) + [
+                    ] + get_model_constructor_2("models/environment_PW.mvc") + [
                 "model_add",
                 "model_add",
                     "SimpleClassDiagrams",
                     "SimpleClassDiagrams",
                     "PW_Control",
                     "PW_Control",
-                    ] + get_model_constructor(open("models/control_PW.mvc", "r").read()) + [
+                    ] + get_model_constructor_2("models/control_PW.mvc") + [
                 "model_add",
                 "model_add",
                     "SimpleClassDiagrams",
                     "SimpleClassDiagrams",
                     "Requirements",
                     "Requirements",
-                    ] + get_model_constructor(open("models/requirements.mvc", "r").read()) + [
+                    ] + get_model_constructor_2("models/requirements.mvc") + [
                 "model_add",
                 "model_add",
                     "SimpleClassDiagrams",
                     "SimpleClassDiagrams",
                     "Query",
                     "Query",
-                    ] + get_model_constructor(open("models/query.mvc", "r").read()) + [
+                    ] + get_model_constructor_2("models/query.mvc") + [
                 "model_add",
                 "model_add",
                     "ProcessModel",
                     "ProcessModel",
                     "pm_powerwindow",
                     "pm_powerwindow",
-                    ] + get_model_constructor(open("models/pm_req_analyse.mvc", "r").read()) + [
+                    ] + get_model_constructor_2("models/pm_req_analyse.mvc") + [
                 "model_list",
                 "model_list",
                 "transformation_add_MT_language",
                 "transformation_add_MT_language",
                 "PetriNet",
                 "PetriNet",
@@ -113,24 +113,28 @@ class TestPowerWindow(unittest.TestCase):
                     "",
                     "",
                     "define_req",
                     "define_req",
                 "transformation_add_MANUAL",
                 "transformation_add_MANUAL",
+                    "Requirements",
                     "PW_Environment",
                     "PW_Environment",
                     "",
                     "",
                     "PW_Environment",
                     "PW_Environment",
                     "",
                     "",
                     "refine_environment",
                     "refine_environment",
                 "transformation_add_MANUAL",
                 "transformation_add_MANUAL",
+                    "Requirements",
                     "PW_Plant",
                     "PW_Plant",
                     "",
                     "",
                     "PW_Plant",
                     "PW_Plant",
                     "",
                     "",
                     "refine_plant",
                     "refine_plant",
                 "transformation_add_MANUAL",
                 "transformation_add_MANUAL",
+                    "Requirements",
                     "PW_Control",
                     "PW_Control",
                     "",
                     "",
                     "PW_Control",
                     "PW_Control",
                     "",
                     "",
                     "refine_control",
                     "refine_control",
                 "transformation_add_MANUAL",
                 "transformation_add_MANUAL",
+                    "Requirements",
                     "Query",
                     "Query",
                     "",
                     "",
                     "Query",
                     "Query",
@@ -145,7 +149,7 @@ class TestPowerWindow(unittest.TestCase):
                     "Query",
                     "Query",
                     "",
                     "",
                     "make_initial_models",
                     "make_initial_models",
-                    ] + get_model_constructor(open("models/initialize.mvc", "r").read()) + [
+                    ] + get_model_constructor_2("models/initialize.mvc") + [
                 "transformation_add_MT",
                 "transformation_add_MT",
                     "All_RAM",
                     "All_RAM",
                     "PW_Plant",
                     "PW_Plant",
@@ -153,7 +157,7 @@ class TestPowerWindow(unittest.TestCase):
                     "Encapsulated_PetriNet",
                     "Encapsulated_PetriNet",
                     "",
                     "",
                     "plant_to_EPN",
                     "plant_to_EPN",
-                    ] + get_model_constructor(open("models/plant_to_EPN.mvc", "r").read()) + [
+                    ] + get_model_constructor_2("models/plant_to_EPN.mvc") + [
                 "transformation_add_MT",
                 "transformation_add_MT",
                     "All_RAM",
                     "All_RAM",
                     "PW_Control",
                     "PW_Control",
@@ -161,7 +165,7 @@ class TestPowerWindow(unittest.TestCase):
                     "Encapsulated_PetriNet",
                     "Encapsulated_PetriNet",
                     "",
                     "",
                     "control_to_EPN",
                     "control_to_EPN",
-                    ] + get_model_constructor(open("models/control_to_EPN.mvc", "r").read()) + [
+                    ] + get_model_constructor_2("models/control_to_EPN.mvc") + [
                 "transformation_add_MT",
                 "transformation_add_MT",
                     "All_RAM",
                     "All_RAM",
                     "PW_Environment",
                     "PW_Environment",
@@ -169,7 +173,7 @@ class TestPowerWindow(unittest.TestCase):
                     "Encapsulated_PetriNet",
                     "Encapsulated_PetriNet",
                     "",
                     "",
                     "environment_to_EPN",
                     "environment_to_EPN",
-                    ] + get_model_constructor(open("models/environment_to_EPN.mvc", "r").read()) + [
+                    ] + get_model_constructor_2("models/environment_to_EPN.mvc") + [
                 "transformation_add_AL",
                 "transformation_add_AL",
                     "PetriNet",
                     "PetriNet",
                     "",
                     "",
@@ -183,23 +187,23 @@ class TestPowerWindow(unittest.TestCase):
                 "pm_",
                 "pm_",
                 # define_req
                 # define_req
                 "upload",
                 "upload",
-                ] + get_model_constructor(open("models/requirements_model.mvc", "r").read()) + [
+                ] + get_model_constructor_2("models/requirements_model.mvc") + [
                 "exit",
                 "exit",
                 # refine_plant
                 # refine_plant
                 "upload",
                 "upload",
-                ] + get_model_constructor(open("models/plant_model.mvc", "r").read()) + [
+                ] + get_model_constructor_2("models/plant_model.mvc") + [
                 "exit",
                 "exit",
                 # refine_environment
                 # refine_environment
                 "upload",
                 "upload",
-                ] + get_model_constructor(open("models/environment_model.mvc", "r").read()) + [
+                ] + get_model_constructor_2("models/environment_model.mvc") + [
                 "exit",
                 "exit",
                 # refine_control
                 # refine_control
                 "upload",
                 "upload",
-                ] + get_model_constructor(open("models/control_model.mvc", "r").read()) + [
+                ] + get_model_constructor_2("models/control_model.mvc") + [
                 "exit",
                 "exit",
                 # refine_query
                 # refine_query
                 "upload",
                 "upload",
-                ] + get_model_constructor(open("models/query_model.mvc", "r").read()) + [
+                ] + get_model_constructor_2("models/query_model.mvc") + [
                 "exit",
                 "exit",
             ],
             ],
             [   # bootup phase
             [   # bootup phase
@@ -264,6 +268,7 @@ class TestPowerWindow(unittest.TestCase):
                 ] + [
                 ] + [
                     "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",
+                    "Model added as source",
                     "Which metamodels do you want to use as target for the manual operation (empty string to finish)?",
                     "Which metamodels do you want to use as target for the manual operation (empty string to finish)?",
                     "Model added as target",
                     "Model added as target",
                     "Name of Manual operation model?",
                     "Name of Manual operation model?",
@@ -428,4 +433,6 @@ class TestPowerWindow(unittest.TestCase):
                 "Please give your command.",
                 "Please give your command.",
                 "Waiting for model constructors...",
                 "Waiting for model constructors...",
                 "Please give your command.",
                 "Please give your command.",
+                # Computations happen without output
+                "",
             ]))
             ]))

+ 3 - 2
integration/utils.py

@@ -315,6 +315,7 @@ def get_model_constructor(code):
         f.write(code)
         f.write(code)
         f.flush()
         f.flush()
 
 
-    constructors = do_compile("__model.mvc", "interface/HUTN/grammars/modelling.g", "M") + ["exit"]
+    return get_model_constructor_2("__model.mvc")
 
 
-    return constructors
+def get_model_constructor_2(f):
+    return do_compile(f, "interface/HUTN/grammars/modelling.g", "M") + ["exit"]

+ 1 - 1
models/control_PW.mvc

@@ -24,7 +24,7 @@ SimpleClassDiagram Control_PW{
     Class Neutral : State {}
     Class Neutral : State {}
 
 
     Association Transition (State, State) {
     Association Transition (State, State) {
-        objectDetected : TriState
+        objDetected : TriState
     }
     }
     Association UpPressed : Transition (State, State) {}
     Association UpPressed : Transition (State, State) {}
     Association NonePressed : Transition (State, State) {}
     Association NonePressed : Transition (State, State) {}

+ 15 - 15
models/control_model.mvc

@@ -1,36 +1,36 @@
 Control_PW control_model_PW {
 Control_PW control_model_PW {
-    Up up {
+    PW_Control/Up up {
         isInitial = False
         isInitial = False
         isError = False
         isError = False
         name = "up"
         name = "up"
     }
     }
-    Down down {
+    PW_Control/Down down {
         isInitial = False
         isInitial = False
         isError = False
         isError = False
         name = "down"
         name = "down"
     }
     }
-    Neutral neutral {
+    PW_Control/Neutral neutral {
         isInitial = True
         isInitial = True
         isError = True
         isError = True
         name = "neutral"
         name = "neutral"
     }
     }
 
 
-    UpPressed (down, neutral) {
-        objectDetected = "*"
+    PW_Control/UpPressed (down, neutral) {
+        objDetected = "*"
     }
     }
-    UpPressed (neutral, up) {
-        objectDetected = "N"
+    PW_Control/UpPressed (neutral, up) {
+        objDetected = "N"
     }
     }
-    DownPressed (up, neutral) {
-        objectDetected = "*"
+    PW_Control/DownPressed (up, neutral) {
+        objDetected = "*"
     }
     }
-    DownPressed (neutral, down) {
-        objectDetected = "*"
+    PW_Control/DownPressed (neutral, down) {
+        objDetected = "*"
     }
     }
-    NonePressed (up, neutral) {
-        objectDetected = "*"
+    PW_Control/NonePressed (up, neutral) {
+        objDetected = "*"
     }
     }
-    NonePressed (down, neutral) {
-        objectDetected = "*"
+    PW_Control/NonePressed (down, neutral) {
+        objDetected = "*"
     }
     }
 }
 }

+ 6 - 10
models/control_to_EPN.mvc

@@ -212,7 +212,7 @@ All_RAM Control2EPN {
                 Post_PW_Control/State post_cs_0 {
                 Post_PW_Control/State post_cs_0 {
                     label = "0"
                     label = "0"
                 }
                 }
-                Post_Encapsulated_PetriNet/Place post_cs1 {
+                Post_Encapsulated_PetriNet/Place post_cs_1 {
                     label = "1"
                     label = "1"
                     value_name = $
                     value_name = $
                         String function value(model : Element, name : String, mapping : Element):
                         String function value(model : Element, name : String, mapping : Element):
@@ -240,7 +240,7 @@ All_RAM Control2EPN {
                 Pre_PW_Control/State pre_ct_1 {
                 Pre_PW_Control/State pre_ct_1 {
                     label = "1"
                     label = "1"
                 }
                 }
-                Pre_PW_Control/Transition (pre_ct_0, pre_ct_1) {
+                Pre_PW_Control/Transition pre_ct_2 (pre_ct_0, pre_ct_1) {
                     label = "2"
                     label = "2"
                 }
                 }
                 Pre_Encapsulated_PetriNet/Place pre_ct_3 {
                 Pre_Encapsulated_PetriNet/Place pre_ct_3 {
@@ -249,10 +249,10 @@ All_RAM Control2EPN {
                 Pre_Encapsulated_PetriNet/Place pre_ct_4 {
                 Pre_Encapsulated_PetriNet/Place pre_ct_4 {
                     label = "4"
                     label = "4"
                 }
                 }
-                Pre_CTRL2EPN_link (pre_ct_s1, pre_ct_3) {
+                Pre_CTRL2EPN_link (pre_ct_1, pre_ct_3) {
                     label = "5"
                     label = "5"
                 }
                 }
-                Pre_CTRL2EPN_link (pre_ct_s2, pre_ct_4) {
+                Pre_CTRL2EPN_link (pre_ct_2, pre_ct_4) {
                     label = "6"
                     label = "6"
                 }
                 }
 
 
@@ -366,10 +366,10 @@ All_RAM Control2EPN {
                 Post_Encapsulated_PetriNet/Place post_ct_7 {
                 Post_Encapsulated_PetriNet/Place post_ct_7 {
                     label = "7"
                     label = "7"
                 }
                 }
-                Post_Encapsulated_PetriNet/Port post_ct_9 {
+                Post_Encapsulated_PetriNet/Port post_ct_8 {
                     label = "8"
                     label = "8"
                 }
                 }
-                Post_Encapsulated_PetriNet/PortPlace (post_ct_9, post_ct_8) {
+                Post_Encapsulated_PetriNet/PortPlace (post_ct_8, post_ct_7) {
                     label = "9"
                     label = "9"
                 }
                 }
 
 
@@ -605,10 +605,6 @@ All_RAM Control2EPN {
                 }
                 }
                 Post_PW_Control/State post_fi_1 {
                 Post_PW_Control/State post_fi_1 {
                     label = "1"
                     label = "1"
-                    constraint_isError = $
-                        Boolean function constraint(value : Boolean):
-                            return value!
-                        $
                 }
                 }
                 Post_Encapsulated_PetriNet/Place post_fi_2 {
                 Post_Encapsulated_PetriNet/Place post_fi_2 {
                     label = "2"
                     label = "2"

+ 7 - 7
models/environment_model.mvc

@@ -1,21 +1,21 @@
 Environment_PW environment_model_PW {
 Environment_PW environment_model_PW {
-    Group {
-        Event {
+    PW_Environment/Group {
+        PW_Environment/Event {
             name = "cmdUp"
             name = "cmdUp"
         }
         }
-        Event {
+        PW_Environment/Event {
             name = "cmdNeutral"
             name = "cmdNeutral"
         }
         }
-        Event {
+        PW_Environment/Event {
             name = "cmdDown"
             name = "cmdDown"
         }
         }
     }
     }
 
 
-    Group {
-        Event {
+    PW_Environment/Group {
+        PW_Environment/Event {
             name = "objPresent"
             name = "objPresent"
         }
         }
-        Event {
+        PW_Environment/Event {
             name = "no_objPresent"
             name = "no_objPresent"
         }
         }
     }
     }

+ 19 - 19
models/environment_to_EPN.mvc

@@ -13,7 +13,7 @@ A B {
                 }
                 }
             }
             }
             RHS {
             RHS {
-                Post_PW_Environment/Event {
+                Post_PW_Environment/Event cp_evt {
                     label = "1"
                     label = "1"
                 }
                 }
                 Post_Encapsulated_PetriNet/Place cp_place {
                 Post_Encapsulated_PetriNet/Place cp_place {
@@ -22,6 +22,10 @@ A B {
                         String function value(model : Element, name : String, mapping : Element):
                         String function value(model : Element, name : String, mapping : Element):
                             return read_attribute(model, mapping["0"], "name")!
                             return read_attribute(model, mapping["0"], "name")!
                         $
                         $
+                    value_tokens = $
+                        Integer function value(model : Element, name : String, mapping : Element):
+                            return 0!
+                        $
                 }
                 }
                 Post_Encapsulated_PetriNet/Port cp_port {
                 Post_Encapsulated_PetriNet/Port cp_port {
                     label = "3"
                     label = "3"
@@ -35,10 +39,6 @@ A B {
                 }
                 }
                 Post_Encapsulated_PetriNet/PortPlace (cp_port, cp_place) {
                 Post_Encapsulated_PetriNet/PortPlace (cp_port, cp_place) {
                     label = "5"
                     label = "5"
-                    value_tokens = $
-                        Integer function value(model : Element, name : String, mapping : Element):
-                            return 0!
-                        $
                 }
                 }
             }
             }
         }
         }
@@ -59,18 +59,18 @@ A B {
                 Pre_PW_Environment/Contains (pre_grp, pre_evt_b) {
                 Pre_PW_Environment/Contains (pre_grp, pre_evt_b) {
                     label = "5"
                     label = "5"
                 }
                 }
-                Pre_ENV2EPN_link (pre_evt_a, pre_place_a) {
-                    label = "6"
-                }
-                Pre_ENV2EPN_link (pre_evt_b, pre_place_b) {
-                    label = "7"
-                }
                 Pre_Encapsulated_PetriNet/Place pre_place_a {
                 Pre_Encapsulated_PetriNet/Place pre_place_a {
                     label = "8"
                     label = "8"
                 }
                 }
                 Pre_Encapsulated_PetriNet/Place pre_place_b {
                 Pre_Encapsulated_PetriNet/Place pre_place_b {
                     label = "9"
                     label = "9"
                 }
                 }
+                Pre_ENV2EPN_link (pre_evt_a, pre_place_a) {
+                    label = "6"
+                }
+                Pre_ENV2EPN_link (pre_evt_b, pre_place_b) {
+                    label = "7"
+                }
             }
             }
             RHS {
             RHS {
                 Post_PW_Environment/Group post_grp {
                 Post_PW_Environment/Group post_grp {
@@ -88,26 +88,26 @@ A B {
                 Post_PW_Environment/Contains (post_grp, post_evt_b) {
                 Post_PW_Environment/Contains (post_grp, post_evt_b) {
                     label = "5"
                     label = "5"
                 }
                 }
-                Post_ENV2EPN_link (post_evt_a, post_place_a) {
-                    label = "6"
-                }
-                Post_ENV2EPN_link (post_evt_b, post_place_b) {
-                    label = "7"
-                }
                 Post_Encapsulated_PetriNet/Place post_place_a {
                 Post_Encapsulated_PetriNet/Place post_place_a {
                     label = "8"
                     label = "8"
                 }
                 }
                 Post_Encapsulated_PetriNet/Place post_place_b {
                 Post_Encapsulated_PetriNet/Place post_place_b {
                     label = "9"
                     label = "9"
                 }
                 }
+                Post_Encapsulated_PetriNet/Transition post_transition {
+                    label = "12"
+                }
                 Post_Encapsulated_PetriNet/P2T (post_place_a, post_transition) {
                 Post_Encapsulated_PetriNet/P2T (post_place_a, post_transition) {
                     label = "10"
                     label = "10"
                 }
                 }
                 Post_Encapsulated_PetriNet/T2P (post_transition, post_place_b) {
                 Post_Encapsulated_PetriNet/T2P (post_transition, post_place_b) {
                     label = "11"
                     label = "11"
                 }
                 }
-                Post_Encapsulated_PetriNet/Transition post_transition {
-                    label = "12"
+                Post_ENV2EPN_link (post_evt_a, post_place_a) {
+                    label = "6"
+                }
+                Post_ENV2EPN_link (post_evt_b, post_place_b) {
+                    label = "7"
                 }
                 }
             }
             }
         }
         }

+ 1 - 1
models/plant_PW.mvc

@@ -11,7 +11,7 @@ A B{
     Class NormalState : State {}
     Class NormalState : State {}
 
 
     Association Transition (State, State) {
     Association Transition (State, State) {
-        objectPresent : TriState
+        objPresent : TriState
     }
     }
     Association OnUp : Transition (State, State) {}
     Association OnUp : Transition (State, State) {}
     Association OnDown : Transition (State, State) {}
     Association OnDown : Transition (State, State) {}

+ 57 - 57
models/plant_model.mvc

@@ -1,113 +1,113 @@
 B C{
 B C{
-    NormalState lt {
+    PW_Plant/NormalState lt {
         name = "low_top"
         name = "low_top"
         isInitial = False
         isInitial = False
     }
     }
-    NormalState mt {
+    PW_Plant/NormalState mt {
         name = "medium_top"
         name = "medium_top"
         isInitial = False
         isInitial = False
     }
     }
-    NormalState ht {
+    PW_Plant/NormalState ht {
         name = "high_top"
         name = "high_top"
         isInitial = False
         isInitial = False
     }
     }
-    NormalState lm {
+    PW_Plant/NormalState lm {
         name = "low_medium"
         name = "low_medium"
         isInitial = False
         isInitial = False
     }
     }
-    ErrorState mm {
+    PW_Plant/ErrorState mm {
         name = "medium_medium"
         name = "medium_medium"
         isInitial = False
         isInitial = False
     }
     }
-    ErrorState hm {
+    PW_Plant/ErrorState hm {
         name = "high_medium"
         name = "high_medium"
         isInitial = False
         isInitial = False
     }
     }
-    NormalState lb {
+    PW_Plant/NormalState lb {
         name = "low_bottom"
         name = "low_bottom"
         isInitial = False
         isInitial = False
     }
     }
-    NormalState mb {
+    PW_Plant/NormalState mb {
         name = "medium_bottom"
         name = "medium_bottom"
         isInitial = False
         isInitial = False
     }
     }
-    NormalState hb {
+    PW_Plant/NormalState hb {
         name = "high_bottom"
         name = "high_bottom"
         isInitial = True
         isInitial = True
     }
     }
 
 
-    OnUp (hb, mb) {
-        objectPresent = "*"
+    PW_Plant/OnUp (hb, mb) {
+        objPresent = "*"
     }
     }
-    OnUp (mb, lb) {
-        objectPresent = "*"
+    PW_Plant/OnUp (mb, lb) {
+        objPresent = "*"
     }
     }
-    OnUp (lb, lm) {
-        objectPresent = "*"
+    PW_Plant/OnUp (lb, lm) {
+        objPresent = "*"
     }
     }
-    OnUp (lm, lt) {
-        objectPresent = "N"
+    PW_Plant/OnUp (lm, lt) {
+        objPresent = "N"
     }
     }
-    OnUp (lm, mm) {
-        objectPresent = "Y"
+    PW_Plant/OnUp (lm, mm) {
+        objPresent = "Y"
     }
     }
-    OnUp (mm, hm) {
-        objectPresent = "Y"
+    PW_Plant/OnUp (mm, hm) {
+        objPresent = "Y"
     }
     }
-    OnUp (lt, mt) {
-        objectPresent = "*"
+    PW_Plant/OnUp (lt, mt) {
+        objPresent = "*"
     }
     }
-    OnUp (mt, ht) {
-        objectPresent = "*"
+    PW_Plant/OnUp (mt, ht) {
+        objPresent = "*"
     }
     }
 
 
-    OnDown (ht, mt) {
-        objectPresent = "*"
+    PW_Plant/OnDown (ht, mt) {
+        objPresent = "*"
     }
     }
-    OnDown (mt, lt) {
-        objectPresent = "*"
+    PW_Plant/OnDown (mt, lt) {
+        objPresent = "*"
     }
     }
-    OnDown (lt, lm) {
-        objectPresent = "*"
+    PW_Plant/OnDown (lt, lm) {
+        objPresent = "*"
     }
     }
-    OnDown (hm, mm) {
-        objectPresent = "*"
+    PW_Plant/OnDown (hm, mm) {
+        objPresent = "*"
     }
     }
-    OnDown (mm, lm) {
-        objectPresent = "*"
+    PW_Plant/OnDown (mm, lm) {
+        objPresent = "*"
     }
     }
-    OnDown (lm, lb) {
-        objectPresent = "*"
+    PW_Plant/OnDown (lm, lb) {
+        objPresent = "*"
     }
     }
-    OnDown (lb, mb) {
-        objectPresent = "*"
+    PW_Plant/OnDown (lb, mb) {
+        objPresent = "*"
     }
     }
-    OnDown (mb, hb) {
-        objectPresent = "*"
+    PW_Plant/OnDown (mb, hb) {
+        objPresent = "*"
     }
     }
 
 
-    OnNeutral (hb, mb) {
-        objectPresent = "*"
+    PW_Plant/OnNeutral (hb, mb) {
+        objPresent = "*"
     }
     }
-    OnNeutral (mb, lb) {
-        objectPresent = "*"
+    PW_Plant/OnNeutral (mb, lb) {
+        objPresent = "*"
     }
     }
-    OnNeutral (hm, mm) {
-        objectPresent = "*"
+    PW_Plant/OnNeutral (hm, mm) {
+        objPresent = "*"
     }
     }
-    OnNeutral (mm, lm) {
-        objectPresent = "*"
+    PW_Plant/OnNeutral (mm, lm) {
+        objPresent = "*"
     }
     }
-    OnNeutral (hm, mm) {
-        objectPresent = "*"
+    PW_Plant/OnNeutral (hm, mm) {
+        objPresent = "*"
     }
     }
-    OnNeutral (mm, lm) {
-        objectPresent = "*"
+    PW_Plant/OnNeutral (mm, lm) {
+        objPresent = "*"
     }
     }
-    OnNeutral (ht, mt) {
-        objectPresent = "*"
+    PW_Plant/OnNeutral (ht, mt) {
+        objPresent = "*"
     }
     }
-    OnNeutral (mt, lt) {
-        objectPresent = "*"
+    PW_Plant/OnNeutral (mt, lt) {
+        objPresent = "*"
     }
     }
 }
 }

+ 1 - 1
models/plant_to_EPN.mvc

@@ -196,7 +196,7 @@ A B {
                 Post_PW_Plant/State post_cs_0 {
                 Post_PW_Plant/State post_cs_0 {
                     label = "0"
                     label = "0"
                 }
                 }
-                Post_Encapsulated_PetriNet/Place post_cs1 {
+                Post_Encapsulated_PetriNet/Place post_cs_1 {
                     label = "1"
                     label = "1"
                     value_name = $
                     value_name = $
                         String function value(model : Element, name : String, mapping : Element):
                         String function value(model : Element, name : String, mapping : Element):

+ 12 - 0
models/query_model.mvc

@@ -0,0 +1,12 @@
+A B {
+    Query/State a {
+        name = "illegal"
+    }
+
+    Query/Place med_mid {
+        name = "med_mid"
+        tokens = 1
+    }
+
+    Query/Contains (a, med_mid) {}
+}

+ 1 - 0
models/requirements.mvc

@@ -13,6 +13,7 @@ SimpleClassDiagrams Requirements{
 
 
     Class UseCase {
     Class UseCase {
         name : String
         name : String
+        scope : String
         level : String
         level : String
         actors : String
         actors : String
         preconditions : String
         preconditions : String

+ 1 - 1
models/requirements_model.mvc

@@ -1,5 +1,5 @@
 Requirements req {
 Requirements req {
-    UseCase {
+    Requirements/UseCase {
         name = "Raise passenger window"
         name = "Raise passenger window"
         scope = "System-wide"
         scope = "System-wide"
         postconditions = "Window has stopped."
         postconditions = "Window has stopped."