123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507 |
- include "primitives.alh"
- include "modelling.alh"
- include "object_operations.alh"
- A B {
- Composite schedule {
- {Contains} Success success {}
- {Contains} Failure failure {}
- {Contains} ForAll unselect_all {
- LHS {
- Pre_Encapsulated_PetriNet/Port pre_ua_1 {
- label = "1"
- }
- }
- RHS {
- Post_Encapsulated_PetriNet/Port post_ua_1 {
- label = "1"
- value_selected = $
- Boolean function value(model : Element, name : String, mapping : Element):
- return False!
- $
- }
- }
- }
- {Contains} Atomic select {
- LHS {
- Pre_Encapsulated_PetriNet/Place pre_s_1 {
- label = "1"
- }
- Pre_Encapsulated_PetriNet/Port pre_s_0 {
- label = "0"
- constraint_selected = $
- Boolean function constraint(value : Boolean):
- return bool_not(value)!
- $
- }
- Pre_Encapsulated_PetriNet/PortPlace (pre_s_0, pre_s_1){
- label = "2"
- }
- }
- NAC {
- Pre_Encapsulated_PetriNet/Port nac_s_0 {
- label = "0"
- }
- Pre_Encapsulated_PetriNet/Port nac_s_3 {
- label = "3"
- constraint_selected = $
- Boolean function constraint(value : Boolean):
- return value!
- $
- }
- constraint = $
- Boolean function constraint(model : Element, mapping : Element):
- return value_eq(read_attribute(model, mapping["0"], "name"), read_attribute(model, mapping["3"], "name"))!
- $
- }
- RHS {
- Post_Encapsulated_PetriNet/Place post_s_1 {
- label = "1"
- }
- Post_Encapsulated_PetriNet/Port post_s_0 {
- label = "0"
- value_selected = $
- Boolean function value(model : Element, name : String, mapping : Element):
- log("Mark as selected: " + cast_v2s(read_attribute(model, name, "name")))
- return True!
- $
- }
- Post_Encapsulated_PetriNet/PortPlace (post_s_0, post_s_1){
- label = "2"
- }
- }
- }
- {Contains} ForAll link {
- LHS {
- Pre_Encapsulated_PetriNet/Port pre_link_1 {
- label = "1"
- constraint_selected = $
- Boolean function constraint(value : Boolean):
- return value!
- $
- constraint = $
- Boolean function constraint(model : Element, name : String):
- return (read_nr_out(allOutgoingAssociationInstances(model, name, "Encapsulated_PetriNet/Related")) == 0)!
- $
- }
- Pre_Encapsulated_PetriNet/Port pre_link_2 {
- label = "2"
- constraint_selected = $
- Boolean function constraint(value : Boolean):
- return bool_not(value)!
- $
- }
- Pre_Encapsulated_PetriNet/Place pre_link_4 {
- label = "4"
- }
- Pre_Encapsulated_PetriNet/Place pre_link_5 {
- label = "5"
- }
- Pre_Encapsulated_PetriNet/PortPlace (pre_link_1, pre_link_4) {
- label = "6"
- }
- Pre_Encapsulated_PetriNet/PortPlace (pre_link_2, pre_link_5) {
- label = "7"
- }
- constraint = $
- Boolean function constraint(model : Element, mapping : Element):
- return value_eq(read_attribute(model, mapping["1"], "name"), read_attribute(model, mapping["2"], "name"))!
- $
- }
- RHS {
- Post_Encapsulated_PetriNet/Port post_link_1 {
- label = "1"
- }
- Post_Encapsulated_PetriNet/Port post_link_2 {
- label = "2"
- }
- Post_Encapsulated_PetriNet/Related (post_link_1, post_link_2) {
- label = "3"
- }
- Post_Encapsulated_PetriNet/Place post_link_4 {
- label = "4"
- value_tokens = $
- Integer function value(model : Element, name : String, mapping : Element):
- Integer tokens_4
- Integer tokens_5
- tokens_4 = read_attribute(model, mapping["4"], "tokens")
- tokens_5 = read_attribute(model, mapping["5"], "tokens")
- if (bool_or(tokens_4 > 0, tokens_5 > 0)):
- return 1!
- else:
- return 0!
- $
- }
- Post_Encapsulated_PetriNet/Place post_link_5 {
- label = "5"
- }
- Post_Encapsulated_PetriNet/PortPlace (post_link_1, post_link_4) {
- label = "6"
- }
- Post_Encapsulated_PetriNet/PortPlace (post_link_2, post_link_5) {
- label = "7"
- }
- }
- }
- {Contains} ForAll merge_P2T {
- LHS {
- Pre_Encapsulated_PetriNet/Place pre_p2t_1 {
- label = "1"
- }
- Pre_Encapsulated_PetriNet/Port pre_p2t_2 {
- label = "2"
- constraint_selected = $
- Boolean function constraint(value : Boolean):
- return value!
- $
- }
- Pre_Encapsulated_PetriNet/PortPlace (pre_p2t_2, pre_p2t_1){
- label = "3"
- }
- Pre_Encapsulated_PetriNet/Place pre_p2t_4 {
- label = "4"
- }
- Pre_Encapsulated_PetriNet/Port pre_p2t_5 {
- label = "5"
- constraint_selected = $
- Boolean function constraint(value : Boolean):
- return bool_not(value)!
- $
- }
- Pre_Encapsulated_PetriNet/PortPlace (pre_p2t_5, pre_p2t_4){
- label = "6"
- }
- Pre_Encapsulated_PetriNet/Transition pre_p2t_7 {
- label = "7"
- }
- Pre_Encapsulated_PetriNet/P2T (pre_p2t_4, pre_p2t_7) {
- label = "8"
- }
- Pre_Encapsulated_PetriNet/Related (pre_p2t_2, pre_p2t_5) {
- label = "10"
- }
- }
- RHS {
- Post_Encapsulated_PetriNet/Place post_p2t_1 {
- label = "1"
- }
- Post_Encapsulated_PetriNet/Port post_p2t_2 {
- label = "2"
- }
- Post_Encapsulated_PetriNet/PortPlace (post_p2t_2, post_p2t_1){
- label = "3"
- }
- Post_Encapsulated_PetriNet/Place post_p2t_4 {
- label = "4"
- }
- Post_Encapsulated_PetriNet/Port post_p2t_5 {
- label = "5"
- }
- Post_Encapsulated_PetriNet/PortPlace (post_p2t_5, post_p2t_4){
- label = "6"
- }
- Post_Encapsulated_PetriNet/Transition post_p2t_7 {
- label = "7"
- }
- Post_Encapsulated_PetriNet/P2T (post_p2t_4, post_p2t_7) {
- label = "8"
- }
- Post_Encapsulated_PetriNet/P2T (post_p2t_1, post_p2t_7) {
- label = "9"
- }
- Post_Encapsulated_PetriNet/Related (post_p2t_2, post_p2t_5) {
- label = "10"
- }
- }
- }
- {Contains} ForAll merge_T2P {
- LHS {
- Pre_Encapsulated_PetriNet/Place pre_t2p_1 {
- label = "1"
- }
- Pre_Encapsulated_PetriNet/Port pre_t2p_2 {
- label = "2"
- constraint_selected = $
- Boolean function constraint(value : Boolean):
- return value!
- $
- }
- Pre_Encapsulated_PetriNet/PortPlace (pre_t2p_2, pre_t2p_1){
- label = "3"
- }
- Pre_Encapsulated_PetriNet/Place pre_t2p_4 {
- label = "4"
- }
- Pre_Encapsulated_PetriNet/Port pre_t2p_5 {
- label = "5"
- constraint_selected = $
- Boolean function constraint(value : Boolean):
- return bool_not(value)!
- $
- }
- Pre_Encapsulated_PetriNet/PortPlace (pre_t2p_5, pre_t2p_4){
- label = "6"
- }
- Pre_Encapsulated_PetriNet/Transition pre_t2p_7 {
- label = "7"
- }
- Pre_Encapsulated_PetriNet/T2P (pre_t2p_7, pre_t2p_4) {
- label = "8"
- }
- Pre_Encapsulated_PetriNet/Related (pre_t2p_2, pre_t2p_5) {
- label = "10"
- }
- }
- RHS {
- Post_Encapsulated_PetriNet/Place post_t2p_1 {
- label = "1"
- }
- Post_Encapsulated_PetriNet/Port post_t2p_2 {
- label = "2"
- }
- Post_Encapsulated_PetriNet/PortPlace (post_t2p_2, post_t2p_1){
- label = "3"
- }
- Post_Encapsulated_PetriNet/Place post_t2p_4 {
- label = "4"
- }
- Post_Encapsulated_PetriNet/Port post_t2p_5 {
- label = "5"
- }
- Post_Encapsulated_PetriNet/PortPlace (post_t2p_5, post_t2p_4){
- label = "6"
- }
- Post_Encapsulated_PetriNet/Transition post_t2p_7 {
- label = "7"
- }
- Post_Encapsulated_PetriNet/T2P (post_t2p_7, post_t2p_4) {
- label = "8"
- }
- Post_Encapsulated_PetriNet/T2P (post_t2p_7, post_t2p_1) {
- label = "9"
- }
- Post_Encapsulated_PetriNet/Related (post_t2p_2, post_t2p_5) {
- label = "10"
- }
- }
- }
- {Contains} ForAll remove_old {
- LHS {
- Pre_Encapsulated_PetriNet/Place pre_rem_1 {
- label = "1"
- }
- Pre_Encapsulated_PetriNet/Port pre_rem_2 {
- label = "2"
- constraint_selected = $
- Boolean function constraint(value : Boolean):
- return bool_not(value)!
- $
- }
- Pre_Encapsulated_PetriNet/PortPlace (pre_rem_2, pre_rem_1){
- label = "3"
- }
- }
- RHS {
- }
- }
- {Contains} ForAll copy_transitions {
- LHS {
- Pre_Encapsulated_PetriNet/Transition {
- label = "0"
- }
- }
- RHS {
- Post_Encapsulated_PetriNet/Transition ct1 {
- label = "0"
- }
- Post_PetriNet/Transition ct2 {
- label = "1"
- value_name = $
- Integer function value(model : Element, name : String, mapping : Element):
- return read_attribute(model, mapping["0"], "name")!
- $
- }
- Post_EPN2PN_transition_link (ct1, ct2){
- label = "2"
- }
- }
- }
- {Contains} ForAll copy_places {
- LHS {
- Pre_Encapsulated_PetriNet/Place {
- label = "0"
- }
- }
- RHS {
- Post_Encapsulated_PetriNet/Place cp1 {
- label = "0"
- }
- Post_PetriNet/Place cp2 {
- label = "1"
- value_tokens = $
- Integer function value(model : Element, name : String, mapping : Element):
- return read_attribute(model, mapping["0"], "tokens")!
- $
- value_name = $
- Integer function value(model : Element, name : String, mapping : Element):
- return read_attribute(model, mapping["0"], "name")!
- $
- }
- Post_EPN2PN_place_link (cp1, cp2){
- label = "2"
- }
- }
- }
- {Contains} ForAll copy_P2T {
- LHS {
- Pre_Encapsulated_PetriNet/Place cp2t_p{
- label = "0"
- }
- Pre_Encapsulated_PetriNet/Transition cp2t_t{
- label = "1"
- }
- Pre_Encapsulated_PetriNet/P2T (cp2t_p, cp2t_t){
- label = "2"
- }
- Pre_PetriNet/Place cp2t_p2{
- label = "3"
- }
- Pre_PetriNet/Transition cp2t_t2{
- label = "4"
- }
- Pre_EPN2PN_place_link (cp2t_p, cp2t_p2){
- label = "5"
- }
- Pre_EPN2PN_transition_link (cp2t_t, cp2t_t2){
- label = "6"
- }
- }
- RHS {
- Post_Encapsulated_PetriNet/Place rhs_cp2t_p{
- label = "0"
- }
- Post_Encapsulated_PetriNet/Transition rhs_cp2t_t{
- label = "1"
- }
- Post_Encapsulated_PetriNet/P2T rhs_cp2t_p2t (rhs_cp2t_p, rhs_cp2t_t){
- label = "2"
- }
- Post_PetriNet/Place rhs_cp2t_p2 {
- label = "3"
- }
- Post_PetriNet/Transition rhs_cp2t_t2 {
- label = "4"
- }
- Post_EPN2PN_place_link (rhs_cp2t_p, rhs_cp2t_p2){
- label = "5"
- }
- Post_EPN2PN_transition_link (rhs_cp2t_t, rhs_cp2t_t2){
- label = "6"
- }
- Post_PetriNet/P2T rhs_cp2t_p2t2(rhs_cp2t_p2, rhs_cp2t_t2) {
- label = "7"
- value_weight = $
- Integer function value(host_model : Element, name : String, mapping : Element):
- return 1!
- $
- }
- }
- }
- {Contains} ForAll copy_T2P {
- LHS {
- Pre_Encapsulated_PetriNet/Place ct2p_p{
- label = "0"
- }
- Pre_Encapsulated_PetriNet/Transition ct2p_t{
- label = "1"
- }
- Pre_Encapsulated_PetriNet/T2P (ct2p_t, ct2p_p){
- label = "2"
- }
- Pre_PetriNet/Place ct2p_p2{
- label = "3"
- }
- Pre_PetriNet/Transition ct2p_t2{
- label = "4"
- }
- Pre_EPN2PN_place_link (ct2p_p, ct2p_p2){
- label = "5"
- }
- Pre_EPN2PN_transition_link (ct2p_t, ct2p_t2){
- label = "6"
- }
- }
- RHS {
- Post_Encapsulated_PetriNet/Place rhs_ct2p_p{
- label = "0"
- }
- Post_Encapsulated_PetriNet/Transition rhs_ct2p_t{
- label = "1"
- }
- Post_Encapsulated_PetriNet/T2P (rhs_ct2p_t, rhs_ct2p_p){
- label = "2"
- }
- Post_PetriNet/Place rhs_ct2p_p2 {
- label = "3"
- }
- Post_PetriNet/Transition rhs_ct2p_t2 {
- label = "4"
- }
- Post_EPN2PN_place_link (rhs_ct2p_p, rhs_ct2p_p2){
- label = "5"
- }
- Post_EPN2PN_transition_link (rhs_ct2p_t, rhs_ct2p_t2){
- label = "6"
- }
- Post_PetriNet/T2P (rhs_ct2p_t2, rhs_ct2p_p2) {
- label = "7"
- value_weight = $
- Integer function value(host_model : Element, name : String, mapping : Element):
- return 1!
- $
- }
- }
- }
- }
- Initial (schedule, unselect_all) {}
- OnSuccess (unselect_all, select) {}
- OnFailure (unselect_all, select) {}
- OnSuccess (select, link) {}
- OnFailure (select, merge_P2T) {}
- OnSuccess (link, select) {}
- OnFailure (link, select) {}
- OnSuccess (merge_P2T, merge_T2P) {}
- OnFailure (merge_P2T, merge_T2P) {}
- OnSuccess (merge_T2P, remove_old) {}
- OnFailure (merge_T2P, remove_old) {}
- OnSuccess (remove_old, copy_places) {}
- OnFailure (remove_old, copy_places) {}
- OnSuccess (copy_places, copy_transitions) {}
- OnSuccess (copy_transitions, copy_P2T) {}
- OnSuccess (copy_P2T, copy_T2P) {}
- OnSuccess (copy_T2P, success) {}
- OnFailure (copy_places, copy_transitions) {}
- OnFailure (copy_transitions, copy_P2T) {}
- OnFailure (copy_P2T, copy_T2P) {}
- OnFailure (copy_T2P, success) {}
- }
|