Controlling Reversibility in Reversing Petri Nets with Application to Wireless Communications
CControlling Reversibility in Reversing Petri Netswith Application to Wireless Communications
Anna Philippou , Kyriaki Psara , and Harun Siljak Department of Computer Science, University of Cyprus { annap,kpsara01 } @cs.ucy.ac.cy CONNECT Centre, Trinity College Dublin, [email protected]
Abstract.
Petri nets are a formalism for modelling and reasoning aboutthe behaviour of distributed systems. Recently, a reversible approach toPetri nets, Reversing Petri Nets (RPN), has been proposed, allowingtransitions to be reversed spontaneously in or out of causal order. In thiswork we propose an approach for controlling the reversal of actions of anRPN, by associating transitions with conditions whose satisfaction/viola-tion allows the execution of transitions in the forward/reversed direction,respectively. We illustrate the framework with a model of a novel, dis-tributed algorithm for antenna selection in distributed antenna arrays.
Reversibility is a phenomenon that occurs in a variety of systems, e.g., biochemi-cal systems and quantum computations. At the same time, it is often a desirablesystem property. To begin with, technologies based on reversible computationare considered to be the only way to potentially improve the energy efficiency ofcomputers beyond the fundamental Landauer limit. Further applications are en-countered in programming languages, concurrent transactions, and fault-tolerantsystems, where in case of an error a system should reverse back to a safe state.As such, reversible computation has been an active topic of research in recentyears and its interplay with concurrency is being investigated within a variety oftheoretical models of computation. The notion of causally-consistent reversibil-ity was first introduced in the process calculus RCCS [5], advocating that atransition can be undone only if all its effects, if any, have been undone before-hand. Since then the study of reversibility continued in the context of processcalculi [6,14,9,12,4], event structures [17], and Petri nets [3,13,2].A distinguishing feature between the cited approaches is that of c ontrollingreversibility: while various frameworks make no restriction as to when a tran-sition can be reversed (uncontrolled reversibility), it can be argued that somemeans of controlling the conditions of transition reversal is often useful in prac-tice. For instance, when dealing with fault recovery, reversal should only betriggered when a fault is encountered. Based on this observation, a numberof strategies for controlling reversibility have been proposed: [6] introduces theconcept of irreversible actions, and [11] introduces compensations to deal with a r X i v : . [ c s . L O ] M a y rreversible actions in the context of programming abstractions for distributedsystems. Another approach for controlling reversibility is proposed in [15] wherean external entity is employed for capturing the order in which transitions can beexecuted in the forward or the backward direction. In another line of work, [10]defines a roll-back primitive for reversing computation, and in [9] roll-back isextended with the possibility of specifying the alternatives to be taken on re-suming the forward execution. Finally, in [1] the authors associate the directionof action reversal with energy parameters capturing environmental conditions ofthe modelled systems.In this work we focus on the framework of reversing Petri nets (RPNs) [13],which we extend with a mechanism for controlling reversibility. This control isenforced with the aid of conditions associated with transitions, whose satisfac-tion/violation acts as a guard for executing the transition in the forward/back-ward direction, respectively. The conditions are enunciated within a simple log-ical language expressing properties relating to available tokens. The mechanismmay capture environmental conditions, e.g., changes in temperature, or the pres-ence of faults. We present a causal-consistent semantics of the framework. Notethat conditional transitions can also be found in existing Petri net models, e.g.,in [8], a Petri-net model that associates transitions and arcs with expressions.We conclude with the model of a novel antenna selection (AS) algorithmwhich inspired our framework. Centralized AS in DM MIMO (distributed, mas-sive, multiple input, multiple output) systems [7] is computationally complex,demands a large information exchange, and the communication channel betweenantennas and users changes rapidly. We introduce an RPN-based, distributed,time-evolving solution with reversibility, asynchronous execution and local con-dition tracking for reliable performance and fault tolerance. In this section we extend the reversing Petri nets of [13] by associating transitionswith conditions that control their execution and reversal, and allow tokens tocarry data values of specific types (clauses (2), (6) and (7) in the followingdefinition). We introduce a causal-consistent semantics for the framework.
Definition 1. A reversing Petri net (RPN) is a tuple ( P, T, Σ, A, B, F, C, I )where:1. P is a finite set of places and T is a finite set of transitions .2. Σ forms a finite set of data types with V the associated set of data values.3. A is a finite set of bases or tokens ranged over by a, b, . . . . A = { a | a ∈ A } contains a “negative” instance for each token and we write A = A ∪ A .4. B ⊆ A × A is a set of undirected bonds ranged over by β, γ, . . . . We use thenotation a − b for a bond ( a, b ) ∈ B . B = { β | β ∈ B } contains a “negative”instance for each bond and we write B = B ∪ B .5. F : ( P × T ∪ T × P ) → A∪B is a set of directed labelled arcs .2. C : T → COND is a function that assigns a condition to each transition t such that type ( C ( t )) = Bool .7. I : A → V is a function that associates a data value from V to each token a such that type ( I ( a )) = type ( a ).RPNs are built on the basis of a set of tokens or bases which correspond tothe basic entities that occur in a system. Tokens have a type from the set Σ ,and we write type ( e ) to denote the type of a token or expression in the language.Values of these types are associated to tokens of an RPN via function I . Tokensmay occur as stand-alone elements but as computation proceeds they may alsomerge together to form bonds . Transitions represent events and are associatedwith conditions COND defined over the data values associated with the tokensof the model and functions/predicates over the associated data types. Places have the standard meaning. Directed arcs connect places to transitions and viceversa and are labelled by a subset of
A ∪ B . Intuitively, these labels express therequirements for a transition to fire when placed on arcs incoming the transition,and the effects of the transition when placed on the outgoing arcs. Graphically,a Petri net is a directed bipartite graph where tokens are indicated by • , placesby circles, transitions by boxes, and bonds by lines between tokens.The association of tokens to places is called a marking such that M : P → A ∪ B where a − b ∈ M ( x ), for some x ∈ P , implies a, b ∈ M ( x ). In addition,we employ the notion of a history , which assigns a memory to each transition H : T → N . Intuitively, a history of H ( t ) = ∅ for some t ∈ T captures thatthe transition has not taken place, and a history of k ∈ H ( t ), captures that thetransition was executed as the k th transition occurrence and it has not beenreversed. Note that | H ( t ) | > (cid:104) M, H (cid:105) , describes a state of a RPN with (cid:104) M , H (cid:105) theinitial state, where H ( t ) = ∅ for all t ∈ T .We introduce the following notations. We write ◦ t = { x ∈ P | F ( x, t ) (cid:54) = ∅} and t ◦ = { x ∈ P | F ( t, x ) (cid:54) = ∅} for the incoming and outgoing placesof transition t , respectively. Furthermore, we write pre ( t ) = (cid:83) x ∈ P F ( x, t ) and post ( t ) = (cid:83) x ∈ P F ( t, x ). Finally, we define con ( a, C ), where a is a token and C ⊆ A ∪ B a set of connections, to be the tokens connected to a via a sequenceof bonds in B , together with the bonds creating these connections.In what follows we assume that: (1) transitions do not erase tokens ( A ∩ pre ( t ) = A ∩ post ( t )), and (2) tokens/bonds cannot be cloned into more thanone outgoing places of a transition ( F ( t, x ) ∩ F ( t, y ) = ∅ for all x, y ∈ P, x (cid:54) = y ).Furthermore, we assume for all a ∈ A, |{| x | a ∈ M ( x ) |}| = 1, i.e., there existsexactly one base of each type in M . Note that we extend the exposition of [13]by allowing transitions to break bonds and by permitting cyclic structures. For a transition to be forward-enabled in an
RPN the following must hold:
Definition 2.
Consider a
RPN ( P, T, Σ, A, B, F, C, I ), a transition t , and astate (cid:104) M, H (cid:105) . We say that t is forward-enabled in (cid:104) M, H (cid:105) if:3. If a ∈ F ( x, t ) (resp. β ∈ F ( x, t )) for some x ∈ ◦ t , then a ∈ M ( x ) (resp. β ∈ M ( x )), and if a ∈ F ( x, t ) (resp. β ∈ F ( x, t )) for some x ∈ ◦ t , then a (cid:54)∈ M ( x ) (resp. β (cid:54)∈ M ( x )),2. If β ∈ F ( t, x ) for some x ∈ t ◦ and β ∈ M ( y ) for some y ∈ ◦ t then β ∈ F ( y, t ),3. E ( C ( t ))= True.Thus, t is enabled in state (cid:104) M, H (cid:105) if (1) all tokens and bonds required forthe transition are available in t ’s incoming places and none of the tokens/bondswhose absence is required exists in t ’s incoming place, (2) if a pre-existing bondappears in an outgoing arc of a transition, then it is also a precondition of thetransition to fire, and (3) the transition’s condition C ( t ) evaluates to true. Wewrite E ( c ) for the value of the condition based on the assignment function I .When a transition t is executed in the forward direction, all tokens and bondsoccurring in its outgoing arcs are relocated from the input to the output placesalong with their connected components. The history of t is extended accordingly: Definition 3.
Given a
RPN ( P, T, Σ, A, B, F, C, I ), a state (cid:104)
M, H (cid:105) , and a tran-sition t enabled in (cid:104) M, H (cid:105) , we write (cid:104)
M, H (cid:105) t −→ (cid:104) M (cid:48) , H (cid:48) (cid:105) where: M (cid:48) ( x ) = M ( x ) − (cid:83) a ∈ F ( x,t ) con ( a, M ( x )) ∪ (cid:83) a ∈ F ( t,x ) ,y ∈◦ t con ( a, M ( y ) − pre ( t ) ∪ F ( t, x ))and H (cid:48) ( t (cid:48) ) = H ( t (cid:48) ) ∪{ max( { }∪ (cid:83) t (cid:48)(cid:48) ∈ T H ( t (cid:48)(cid:48) ))+1 } , if t (cid:48) = t , and H ( t (cid:48) ), otherwise. We now move on to causal-order reversibility . The following definition enunciatesthat a transition t is co -enabled (‘ co ’ standing for causal-order reversing) if ithas been previously executed and all the tokens on the outgoing arcs of thetransition are available in its outplaces. Furthermore, to handle causality in thepresence of cycles, clause (1) additionally requires that all bonds involved in theconnected components of such tokens have been constructed by transitions t (cid:48) that have preceded t . Furthermore, clause (2) of the definition requires that thecondition of the transition is not satisfied. Definition 4.
Consider a RPN (
P, T, Σ, A, B, F, C, I ), a state (cid:104)
M, H (cid:105) , and atransition t ∈ T with k = max( H ( t )). Then t is co -enabled in (cid:104) M, H (cid:105) if: (1) forall a ∈ F ( t, y ) then a ∈ M ( y ), and if con ( a, M ( y )) ∩ post ( t (cid:48) ) (cid:54) = ∅ for some t (cid:48) ∈ T with k (cid:48) ∈ H ( t (cid:48) ), then k (cid:48) ≤ k , and, (2) E ( C ( t ))= False.When a transition t is reversed all tokens and bonds in the pre-conditions of t , as well as their connected components, are transferred to t ’s incoming places. Definition 5.
Given a
RPN a state (cid:104)
M, H (cid:105) , and a transition t co -enabled in (cid:104)
M, H (cid:105) with history k ∈ H ( t ), we write (cid:104) M, H (cid:105) t (cid:32) (cid:104) M (cid:48) , H (cid:48) (cid:105) where: M (cid:48) ( x ) = M ( x ) − (cid:83) a ∈ F ( t,x ) con ( a, M ( x )) ∪ (cid:83) y ∈ t ◦ ,a ∈ F ( x,t ) con ( a, M ( y ) − post ( t ) ∪ F ( x, t ))and H (cid:48) ( t (cid:48) ) = H ( t (cid:48) ) − { k } if t (cid:48) = t , and H ( t (cid:48) ), otherwise.4 a) antennas and users (b) a part of the RPN model Fig. 1.
RPN for antenna selection in DM MIMO (large antenna array).
The search for a suitable set of antennas is a sum capacity maximization problem: C = max P , H c log det (cid:18) I + ρ N R N T S H c PH c H (cid:19) (1)where ρ is the signal to noise ratio, N T S the number of antennas selected from atotal of N T antennas, N R the number of users, I the N T S × N T S identity matrix, P a diagonal N R × N R power matrix. H c is the N T S × N R submatrix of N T × N R channel matrix H [7]. Instead of centralized AS, in our approach (1) is calculatedlocally for small sets of antennas (neighborhoods), switching on only antennaswhich improve the capacity: in Fig. 1(a), antenna A i − will not be selected. Inthe RPN interpretation, we present the antennas by places A , . . . , A n , where n = N T , and the overlapping neighbourhoods by places M , . . . , M h . Theseplaces are connected together via transitions t i,j , connecting A i , A j and M k ,whenever there is a connection link between antennas A i and A j . The transitioncaptures that, based on the neighbourhood knowledge in place M k , antenna A i may be preferred over A j or vice versa (the transition may be reversed).To implement the intended mechanism, we employ three types of tokens.First, we have the power tokens p , . . . , p l , where l is the number of enabledantennas. If token p is located on place A i , antenna A i is considered to be on.Transfer of these tokens results into new antenna selections, ideally convergingto a locally optimal solution. Second, tokens m , . . . , m h , each represent oneneighborhood. Finally, a , . . . , a n , represent the antennas. The tokens are usedas follows: Given transition t i,j between antenna places A i and A j in neighbour-hood M k , transition t i,j is enabled if token p is available on A i , token a j on A j , and bond ( a i , m k ) on M k , i.e., F ( A i , t i,j ) = { p } , F ( A j , t i,j ) = { a j } , and F ( M k , t i,j ) = { ( a i , m k ) } . This configuration captures that antennas A i and A j are on and off, respectively. (Note that the bonds between token m k and tokensof type a in M k capture the active antennas in the neighbourhood.) Then, theeffect of the transition is to break the bond ( a i , m k ), and release token a i toplace A i , transferring the power token to A j , and creating the bond ( a j , m k ) on5 ig. 2. Results of antenna selection on a distributed 64 antenna array. M k , i.e., F ( t i,j , A i ) = { a i } , F ( t i,j , A j ) = { p } , and F ( t i,j , M k ) = { ( a j , m k ) } . Themechanism achieving this for two antennas can be seen in Fig. 1(b).Finally, to capture the transition’s condition, an antenna token a i is associ-ated with data vector I ( a i ) = h i , type ( h i ) = R (= C ), i.e., the correspondingrow of H . The condition constructs the matrix H c of (1) by collecting the datavectors h i associated with the antenna tokens a i in place M k : H c = ( h , ..., h n ) T where h i = I ( a i ) if a i ∈ M k , otherwise h i = (0 . . . t i,j will oc-cur if the sum capacity calculated for all currently active antennas (including a i ), C a i , is less than the sum capacity calculated for the same neighbourhood withthe antenna A i replaced by A j , C a j , i.e., C a i < C a j . Note that if the condition isviolated, the transition may be executed in the reverse direction.Results of the RPN-based approach on an array consisting of 64 antennasserving 16 users, varying the number of selected antennas from 16 to 64 areshown in Fig. 2 [16]. If we run five RPN models in parallel and select the onewith the best performance for the final selection, the results are consistentlysuperior to those of a centralised (greedy) algorithm, and if we run just one(equivalent to the average of the performance of these five models) the resultsare on par with those of the centralised algorithm. We have extended RPNs with conditions that control reversibility by determin-ing the direction of transition execution, and we have applied our frameworkto model an AS algorithm. Preliminary results show superior performance tocentralised approaches. Our experience strongly suggests that resource manage-ment can be studied and understood in terms of RPNs as, along with their visualnature, they offer a number of relevant features. In subsequent work, we planto extend RPNs for allowing multiple tokens of the same base/type to occurin a model and for developing out-of-causal-order reversibility semantics in thepresence of conditional transitions as well as the destruction of bonds.6 cknowledgents:
This work was partially supported by the European COSTAction IC 1405: Reversible Computation - Extending Horizons of Computing,Science Foundation Ireland (SFI) and European Regional Development Fund un-der Grant Number 13/RC/2077, and the EU Horizon 2020 research & innovationprogramme under the Marie Sklodowska-Curie grant agreement No 713567.
References
1. G. Bacci, V. Danos, and O. Kammar. On the statistical thermodynamics of re-versible communicating processes. In
Proceedings of CALCO 2011 , LNCS 6859,pages 1–18. Springer, 2011.2. K. Barylska, A. Gogolinska, L. Mikulski, A. Philippou, M. Piatkowski, andK. Psara. Reversing computations modelled by coloured Petri nets. In
Proceedingsof ATAED 2018 , CEUR Workshop Proceedings 2115, pages 91–111, 2018.3. K. Barylska, M. Koutny, L. Mikulski, and M. Piatkowski. Reversible computationvs. reversibility in Petri nets. In
Proceedings of RC 2016 , LNCS 9720, pages 105–118. Springer, 2016.4. L. Cardelli and C. Laneve. Reversible structures. In
Proceedings of CMSB 2011 ,pages 131–140. ACM, 2011.5. V. Danos and J. Krivine. Reversible communicating systems. In
Proceedings ofCONCUR 2004 , LNCS 3170, pages 292–307. Springer, 2004.6. V. Danos and J. Krivine. Transactions in RCCS. In
Proceedings of CONCUR2005 , LNCS 3653, pages 398–412. Springer, 2005.7. X. Gao, O. Edfors, F. Tufvesson, and E. G. Larsson. Massive mimo in real prop-agation environments: Do all antennas contribute equally?
IEEE Transactions onCommunications , 63(11):3917–3928, 2015.8. K. Jensen and L. M. Kristensen.
Coloured Petri Nets - Modelling and Validationof Concurrent Systems . Springer, 2009.9. I. Lanese, M. Lienhardt, C. A. Mezzina, A. Schmitt, and J. Stefani. Concurrentflexible reversibility. In
Proceedings of ESOP 2013 , LNCS 7792, pages 370–390.Springer, 2013.10. I. Lanese, C. A. Mezzina, A. Schmitt, and J. Stefani. Controlling reversibility inhigher-order pi. In
Proceedings of CONCUR 2011 , LNCS 6901, pages 297–311.Springer, 2011.11. I. Lanese, C. A. Mezzina, and J. Stefani. Controlled reversibility and compensa-tions. In
Proceedings of RC 2012 , LNCS 7581, pages 233–240. Springer, 2012.12. I. Lanese, C. A. Mezzina, and J. Stefani. Reversibility in the higher-order π -calculus. Theoretical Computer Science , 625:25–84, 2016.13. A. Philippou and K. Psara. Reversible computation in Petri nets. In
Proceedingsof RC 2018 , LNCS 11106, pages 84–101. Springer, 2018.14. I. Phillips and I. Ulidowski. Reversing algebraic process calculi. In
Proceedings ofFOSSACS 2006 , LNCS 3921, pages 246–260. Springer, 2016.15. I. Phillips, I. Ulidowski, and S. Yuen. A reversible process calculus and the mod-elling of the ERK signalling pathway. In
Proceedings of RC 2012 Revised Papers ,LNCS 7581, pages 218–232. Springer, 2012.16. H. Siljak, K. Psara, and A. Philippou. Distributed antenna selection for massiveMIMO using reversing Petri nets.
IEEE Wireless Communications Letters , 2019.17. I. Ulidowski, I. Phillips, and S. Yuen. Concurrency and reversibility. In
Proceedingsof RC 2014 , LNCS 8507, pages 1–14. Springer, 2014., LNCS 8507, pages 1–14. Springer, 2014.