Reversibility in Chemical Reactions

. In this chapter we give an overview of techniques for the modelling and reasoning about reversibility of systems, including out-of-causal-order reversibility, as it appears in chemical reactions. We consider the autoprotolysis of water reaction, and model it with the Calculus of Covalent Bonding, the Bonding Calculus


Introduction
Biological reactions, pathways, and reaction networks have been extensively studied in the literature using various techniques, including process calculi and Petri nets. Initial research was mainly focused on reaction rates by the modelling and simulating networks of reactions, in order to analyse or even predict the common paths through the network. Reversibility was not considered explicitly. Later on reversibility started to be taken into account, since it plays a crucial rôle in many processes, typically by going back to a previous state in the system. Two common types of reversibility are backtracking and causallyconsistent reversibility [8,25,19]. Backtracking executes exactly the inverse order of the forward execution, and causally-consistent reversibility allows undoing effects before causes, but not necessarily in the exact inverse order. Beyond backtracking and causally-consistent reversibility, there is a more general form of reversibility, known as out-of-causal-order reversibility [28], which makes it possible to get to states which cannot be reached by forward reactions alone. Such sequences of forward and reverse reaction steps are important as they lead to new chemical structures and new reactions, which would not be possible without out-of-causal-order reversibility [28]. A typical example is a catalytic reaction: a catalyst C enables compounds A and B to combine, a combination that would not normally happen or be very unlikely without the presence of C. Initially, catalyst C binds with B resulting in a compound BC. Then A combines with BC creating ABC. Finally, with its job done, C breaks away from ABC, leaving A and B bonded. This sequence of reactions can be written as follows: This is a typical example of out-of-causal order reversibility since the bond between B and C is undone before its effect, namely the bond from A to B (which is not undone at all). The modelling of such reactions is the focus of this chapter. For further motivation, formal definitions and more illustrating examples of the various types of reversibility we refer the reader to [8,25,19,28].

Contribution
This chapter presents and compares three formalisms, the Calculus of Covalent Bonding (CCB) [15,16], the Bonding Calculus [1], and Reversing Petri Nets [23], that have been developed during COST Action IC1405. These models are variations of existing formalisms and set out to study reversible computation by allowing systems to reverse at any time leading to previously visited states or even new states without the need of additional forward actions. The contribution of this chapter is a comparative overview of the three formalisms, a discussion of their expressiveness, and a demonstration of their use on a common case study, namely the autoprotolysis of water reaction.
Our case study was selected to be non-trivial, of manageable size, and to allow us to exhibit the crucial features of the formalisms. It is a chemical reaction that involves small molecules, so it is different from biological reactions that involve proteins and other macromolecules. New modelling techniques may be needed in order to capture fully reversible behaviour of biological systems, however, in this chapter we concentrate on chemical reactions, a domain that offers interesting examples of out-of-causal-order reversibility.
The discussed formalisms enable us to model the intermediate steps of chemical reactions where some bonds are only "helping" to achieve the overall aim of the reaction: specifically, they are only formed to be broken before the end of the reactions. Thus, the allowed level of detail makes a more accurate depiction of the reversibility possible, and allows a more thorough understanding of the underlying reaction mechanisms compared to higher-level models.

Related Work
Process calculi, originally designed for the modelling of sequential and concurrent computation, have been applied to biochemical and biological systems. The main instances are the π-calculus [34], BioAmbients [33], the stochastic π-calculus [30], beta binders [31] and bioPEPA [6]. Another way to model biochemical reactions is with rule-based formalisms such as BIOCHAM [10], the κ-calculus [7], and the BioNetGen Language (BNGL) [9]. The formalisms κ and BNGL can be used to model interactions between proteins, while this is not possible in BIOCHAM. BNGL allows the use of molecule sites having the same name, which is not allowed in the κ-calculus.
Most of the formalisms mentioned above do not explicitly represent reversibility. If an action is the reverse of another action performed before, there is no explicit knowledge of that in the model. Reversibility was added explicitly to process calculi in RCCS [8], CCSK [25], and reversible π [17,18]. CCSK and RCCS are based on the Calculus of Communicating Systems (CCS) [21]. They extend CCS by keeping track of past actions and enabling an undo of those. So a reverse action is the reverse execution of a forward action. These calculi support backtracking and causally-consistent reversibility. Out-of-causal-order reversibility was first addressed in CCSK extended with controller processes [28], and in the context of reversible event structures [27,26,37]. CCB [16] allows all types of reversibility in the context of chemical reactions and in other settings.
Petri nets (PNs) [35] are another formalism that has been widely used to model and reason about a wide range of applications featuring concurrency and distribution. They are a graphical language associated with a rich mathematical theory and supported by a variety of tools. Their use in systems biology dates back to [32,12]. Since then, they have been employed for the modelling, analysis, and simulation of biochemical reactions in metabolic pathways, gene expression, signal transduction, and neural processes [4,5,2]. Indeed, PNs seem to be a natural framework for representing biochemical systems as they constitute a set of interdependent transitions/reactions which consume and produce resources, and are represented graphically in a similar fashion to the systems in question. Several specialised Petri net classes, such as qualitative, stochastic, continuous, or hybrid Petri nets and their coloured counterparts, have been used to describe different biochemical systems [22,13,29,20,38].
Even though classical PNs and their extensions have been extensively used to model biochemical systems, they cannot directly model reversibility. Specifically, when modelling reversible reactions in these formalisms it is required to employ mechanisms involving two distinct transitions, one for the forward and one for the reverse version of a reaction. This may result in expanded models and less natural and/or less accurate models of reversible behaviour. It is also in contrast to the notion of reversible computation, where the intention is not to return to a state via arbitrary execution but to reverse the effect of already executed transitions. For this reason, the formalism of reversing Petri nets [23] has been proposed to allow systems to reverse already executed transitions leading to previously visited states or even new ones without the need of additional forward actions.
Reversing Petri nets have also been extended with a mechanism for controlling transition reversal by associating transitions with conditions [24].

Paper organisation
In the next section, we introduce the autoprotolysis of water reaction, which will be modelled using our three formalisms. This is followed by a section introducing the formalisms, their syntax and, informally, their operational semantics. We also give three models of the autoprotolysis of water using the formalisms. In Section 4, we compare the formalisms and the models of our example reaction, and we also briefly discuss software support for the three formalisms. Finally, Section 5 concludes the paper.

Autoprotolysis of Water
We consider a chemical reaction that transfers a hydrogen atom between two water molecules. This reaction is known as the autoprotolysis of water and is shown in Figure 1. There, O indicates an oxygen atom and H a hydrogen atom. The lines indicate bonds. Positive and negative charges on atoms are shown by ⊕ and respectively. The meaning of the curved arrows and the dots will be explained in the next paragraphs. The reaction is reversible and it takes place at a relatively low rate, making pure water slightly conductive. We have chosen this reaction as our example reaction, since it is non-trivial but manageable, and has some interesting aspects to be represented. To model the reaction we need to understand why it takes place and what causes it. The main reason is that the oxygen in the water molecule is nucleophilic, meaning it has the tendency to bond to another atomic nucleus, which would serve as an electrophile. This is because oxygen has a high electronegativity, therefore it attracts electrons and has an abundance of electrons around it. The electrons around the atomic nucleus are arranged on electron shells, where only those in the outer shell participate in bonding. Oxygen has four electrons in its outer shell, which are not involved in the initial bonding with hydrogen atoms. These electrons form two lone pairs of two electrons each, which can form new bonds (lone pairs are shown in Figure 1 by pairs of dots). All this makes oxygen nucleophilic: it tends to connect to other atomic nuclei by forming bonds from its lone pairs. Since oxygen attracts electrons, the hydrogen atoms in water have a positive partial charge and oxygen has a negative partial charge.
The reaction starts when an oxygen in one water molecule is attracted by a hydrogen in another water molecule due to their opposite charges. This results in a hydrogen bond. This bond is formed out of the electrons of one of the lone pairs of the oxygen. The large curved arrow in Figure 1 indicates the movements of the electrons. Since a hydrogen atom cannot have more than one bond, the creation of a new bond is compensated by breaking the existing hydrogen-oxygen bond (indicated by the small curved arrow). When this happens, the two electrons, which formed the original hydrogen-oxygen bond, remain with the oxygen. Since a hydrogen contains one electron and one proton, it is only the proton that is transferred, so the process can be called a proton transfer as well as a hydrogen transfer. The forming of the new bond and the breaking of the old bond are concerted, meaning that they happen together without a stable intermediate configuration. As a result we have reached the state where one oxygen atom has three bonds to hydrogen atoms and is positively charged, represented on the right side of the reaction in Figure 1. This molecule is called hydronium and is written as H 3 O + . The other oxygen atom bonds to only one hydrogen and is negatively charged, having an electron in surplus. This molecule is called a hydroxide and is written as OH − .
Note that the reaction is reversible: the oxygen that lost a hydrogen can pull back one of the hydrogens from the other molecule, the H 3 O + molecule. This is the case since the negatively charged oxygen is a strong nucleophile and the hydrogens in the H 3 O + molecule are all positively charged. Thus, any of the hydrogens can be removed, making both oxygens formally uncharged, and restoring the two water molecules. In Figure 1 the curved arrows are given for the reaction going from left to right. Since the reaction is reversible (indicated by the double arrow) there are corresponding electron movements when going from right to left. These are not given in line with usual conventions, but can be inferred.
In this simple reaction, the forward and the reverse step consist of two steps each. The breaking of the old and the forming of the new bond occur simultaneously. This means that there is no strict causality of actions, since none of them can be called the cause of the overall reaction. Furthermore, the reverse step can be done with a different atom to the one used during the forward step because each of the molecules are in a sense identical and in practice there does not exist a single "reverse" path corresponding to a forward one.
It should be noted that there are two types of bonding modelled here. Firstly, we have the initial bonds where two atoms contribute an electron each. Secondly, the dative or coordinate bonds are formed where both electrons come from one atom (an oxygen in this case). Both are covalent bonds, and once formed they cannot be distinguished. Specifically, in the oxygen with three bonds all bonds are the same and no distinction can be made. If one of the bonds is broken by a deprotonation (as in the autoprotolysis of water) the two electrons are left behind and they form a lone pair. If the broken bond was not previously formed as a dative bond, the electrons changed their "rôle". This explains why any proton can be transferred in the reverse reaction and not just the one that was involved in the forward path.

Calculus of Covalent Bonding
In this subsection we introduce the Calculus of Covalent Bonding (CCB) [16], concentrating on the new general prefixing operator (s; b).P which, together with a generalised composition operator, produces pairs of concerted actions. Then we present a CCB model of the autoprotolysis of water.
Definition of CCB We recall the definition of CCB, presenting only the main ideas. More details can be found in [15,16]. First, we introduce some preliminary notions and notations.
Let A be the set of (forward) action labels, ranged over by a, b, c, d, e, f . We partition A into the set of strong actions, written as SA, and the set of weak actions, written as WA. Reverse (or past) action labels are members of A, with typical members a, b, c, d, e, f , and represent undoing of actions. The set P(A∪A) is ranged over by L.
Let K be an infinite set of communication keys (or keys for short) [25], ranged over by k, l, m, n. The Cartesian product A × K, denoted by AK, represents past actions, which are written as a[k] for a ∈ A and k ∈ K. Correspondingly, we have the set AK that represents undoing of past actions. We use α, β to identify actions which are either from A or AK. It would be useful to consider sequences of actions or past actions, namely the elements of (A ∪ AK) * , which are ranged over by s, s and sequences of purely past actions, namely the elements of AK * , which are ranged over by t, t . The empty sequence is denoted by . We use the notation "α,s" and "s,s " to denote a concatenation of elements, which can be strings or single actions.
We shall also use two sets of auxiliary action labels, namely the set (A) = {(a) | a ∈ A}, and its product with the set of keys, namely (A)K. These labels will be used in the auxiliary rules when defining the semantics of CCB. They denote the execution of a weak action, which makes it possible in the SOS rules to force breaking of a bond for those actions only.
The syntax of CCB is given below where P is a process term: The set of process identifiers (constants) PI contains typical elements S and T . Each process identifier S has a defining equation S def = P where P contains only forward actions (and no past actions). There is also a special identifier 0, denoting the deadlocked process, which has no defining equation. For restrictions L ⊆ A holds.
We have a general prefixing operator (s; b).P , where s is a non-empty sequence of actions or past actions. This operator extends the prefixing operator in [28]. The action b is a weak action and it can be omitted, in which case the prefixing is written as (s).P and is called the simple prefix. The simple prefix (which is still a sequence) is the prefixing operator in [28]. Exactly one of the actions in s in (s).P may be a weak action from WA. A weak action in s is only allowed for the simple prefix, in the (s; b) operator b is the only allowed weak action. If s is a sequence that contains a single action, then the action is a strong action and the operator is the prefixing operator of CCS [21]. We omit trailing 0s so, for example, (s).0 is written as (s). The new feature of the operator (s; b).P is the execution of the weak action b, which can happen only after all the actions in s have taken place. Performing b then forces undoing one of the past actions in s (by the concert rule in Figure 4). If a (s; b) operator is followed by another sequence of actions, where all actions in s have already taken place, then there is a non-deterministic choice of either doing b or progressing to the next sequence of actions (see act1 and act2).
P | Q represents two systems P and Q which can perform actions or reverse actions on their own, or which can interact with each other according to a communication function γ. As in the calculus ACP [11], the communication function is a partial function γ : A × A → A which is commutative and associative. The function γ is used in the operational semantics to define when two processes can interact. Processes P and Q in P | Q can also perform a pair of concerted actions, which is the new feature of our calculus. We also have the ACP-like restriction operator \L, where L is a set of labels. It prevents actions from taking place and, due to the synchronisation algebra used, it also blocks communication. If γ(a, b) = c then a.P and b.Q cannot communicate in (a.P | b.Q) \ c.
The set Proc of process terms is ranged over by P, Q and R. In the setting of CCB these terms are simply called processes. We define the semantics of our calculus using SOS rules (Figures 2-4) and rewrite rules ( Figure 5).
We use some predicates and functions, which are formally defined in [16]. Informally, a process P is standard, written std(P ), if it contains no past actions (hence no keys). A key n is fresh in Q, written fsh[n](Q), if Q contains no past action with the key n. Function k returns the keys in a sequence of actions, whereas keys returns the keys in a process, and fn gives the actions of a process which could be executed.
The forward and reverse SOS rules for CCB are given in Figures 2 and 3. Figure 4 contains the SOS rules that define the new concerted actions transitions. The rule concert defines when a pair of concerted actions takes place. This enables the linking of forming and breaking of bonds, and therefore a degree of control over the reversing of actions. The modelling in the next section will give examples of the application. Note that the concert rule uses lookahead [36]. Lookahead is a property of SOS rules, where a variable appears both on the right hand side and on the left hand side of a transition in the premises. for example P and Q Recall that s is a sequence of actions and past actions and t is a sequence of purely past actions. in concert. The rule concert par requires that k is fresh in Q, correspondingly as in par. Moreover, we need to ensure that when we reverse h with the key l in P we do not leave out any actions with the key l in Q which make up a multiaction communication with the key l. Hence, we also include the premise fsh[l](Q) in concert par. The rule concert act requires, correspondingly as act, that k is fresh in t. Our operational semantics guarantees that if a standard process evolves to (t; b).P , for some P , and P reverses an action with the key l, then l is fresh in t. Hence, we do not include Next, we recall the main new rewrite rules for a reduction relation for CCB in Figure 5. All the rules can be found in [15,16] but here we only give rules for promotion of actions. These are prom, move-r, and move-l which promote weak bonds (here b) to strong bonds (here a). The rule prom applies to the full version of our prefix operator (with the ; construct), and move-r and move-l apply only to the simple prefix. These three rules are here to model what happens in chemical systems: a bond on a weak action is temporary and as soon as there is a strong action that can accommodate that bond (as the result of concerted actions) the bond establishes itself on the strong action thus releasing the weak action. In order to align the use of these three rules to what happens in chemical reactions, we insist that they are used as soon as they becomes applicable, a formal definition is given in [15,16].   The synchronisation function γ is as follows: Each water molecule is a structure consisting of two hydrogen atoms and one oxygen atom which are bonded appropriately. We shall use subscripts to distinguish the individual copies of atoms and actions; for example H 1 is a specific copy of hydrogen defined by (h 1 ; p).H 1 , similarly for O 1 defined as (o 1 , o 2 , n).O 1 . The atoms are composed with the parallel composition operator "|" using the communication keys (which are natural numbers) to combine actions into bonds. So a water molecule is modelled by the following process, where the key 1 shows that h 1 of H 1 has bonded with o 1 of O 1 (correspondingly for key 2). The restriction \{h 1 , h 2 , o 1 , o 2 } ensures that these actions cannot happen on their own, but only together with their partners, forming a bond.
The system of two water molecules in Figure 1 is represented by the parallel composition of two water processes, where the restriction \{n, p} represses actions n, p from taking place separately by forcing them to combine into bonds (according to γ).
Following a general principle in process calculi in the style of CCB we can move the restrictions to the outside. The rule used can be written as (P | Q) \ L = P \ L | Q if the actions of L are not used in Q. Applying this gives us a water molecule modelled as follows: Note the h i , o j , and n are not restricted: this allows us to break bonds via concerted actions involving these actions. We will see an example of this shortly. We now leave out the restrictions to improve readability.
Actions n in O 1 and p in H 3 combine (we use the new key 5), representing a transfer of a proton from one atom of oxygen (O 2 in our model) to another one (O 1 in our model). As a hydrogen atom consists of a proton and an electron, and the electron stays in such a transfer, it can either be called a proton transfer or the transfer of a (positively charged) hydrogen atom. We perform the transfer of H 3 from O 2 to O 1 . The creation of the bond with key 5 from O 1 to H 3 forces a break of the bond with key 3 (between h 3 and o 3 ) due to the property of the operator (s; b).P discussed earlier. These two reactions happen almost simultaneously so we represent them as a pair of concerted actions.
We have now arrived at the state on the right hand side in Figure 1. There are weak bonds between n and p (denoted by key 5) and strong bonds between h i and o j for all appropriate i, j. Since H 3 is weakly bonded to O 1 and its strong capability h 3 has become available, the bond 5 gets promoted to the stronger bond, releasing the capability p of H 3 . We represent this change as a rewrite and we obtain the following process: Note that we wrote h 3 , o 3 and the key 5, the actions and keys affected by the promotion, in bold font to improve readability. We shall do correspondingly below.
Oxygen O 1 is still blocked, which represents it being fully bonded (and positively charged). Oxygen O 2 has a free n capability and can remove any of the hydrogens from O 1 . As a result the process can reverse to its original state.
We show this by again transferring H 3 . We then execute promotion again:

Bonding Calculus
In this subsection we recall briefly the Bonding Calculus [1], and illustrate its expressiveness by modelling the autoprotolysis of water.
Definition of the Bonding Calculus The abstraction "processes as interactions" from process calculi is used in the Bonding Calculus, but processes are not able to communicate values in order to interact. Just like in the BNGL [9], the Bonding Calculus allows the use of molecule sites having the same name, while this is not possible in the κ-calculus. While the κ-calculus describes molecules as a set of sites and uses rules to manipulate these sites between two or more molecules, in the Bonding Calculus a molecule is described by the sequence of operations it can perform on its sites (including also non-deterministic choices), regardless of the form of the other molecules. This allows to use the compositionality of the process calculus. The syntax of the Bonding Calculus syntax is presented in Figure 6.  The process 0 denotes inactivity. The availability to perform an action α, and then to continue the execution as process P is denoted by the process α.P . The process P + Q offers a choice between the processes P and Q, while the process P | Q allows the execution of processes P and Q in parallel, with possible interactions between them by using appropriate actions.
As we work with bonds, we use the function : M × N N × M → Bool to check whether between two molecules there exist certain bonds. For example, a N b checks for the existence of all bonds in N between the molecules a and b; it returns true when such bonds exist, and false otherwise. When we consider N = ∅, then a ∅ b checks if at least a bond exists between the two molecules. When b = ε, then a N ε checks if a has all of bonds from N , regardless of the molecules he has them with. The Boolean result a N b used in the testing process is defined formally as: Depending on the truth value of a N b, the process if a N b then P else Q executes either P or Q. An identifier A(b 1 , . . . , b n ) is used to provide recursion by creating new instances of processes defined as A(a 1 , . . . , a n ) = P , where a i = a j for all i = j ∈ {1, . . . , n}; the new process is defined as A(b 1 , . . . , b n ) = P {b 1 /a 1 , . . . , b n /a n }, where {b i /a i } denotes the replacement of variable a i by value b i . A system S is given as a composition of a process P and the multiset of bonds L, written as P || L.
The calculus presented in [1] was intended to model the creation and breaking of covalent bonds. In order to be able to model both covalent and hydrogen bonds, we apply a minor update to the operational semantics in [1] because we need two instances of the rules used to create and to break bonds. The only difference between the two instances of the same rule is given by the names of the bonds appearing in the interacting processes, and by the fact that a bond cannot be created using the names x + and x − if other bonds exist between the same molecules; more details about this restriction are given in the example below.
The operational semantics of the Bonding Calculus is given in Figure 7.  The autoprotolysis of water in the Bonding Calculus We use two types of bond names, namely c and h, to stand for the covalent and hydrogen bonds, respectively. Using our calculus, the system composed of two molecules of water is described by: where the molecules are those of hydrogen and oxygen that are described below: Each molecule of water is a structure consisting of one molecule of oxygen and two molecules of hydrogen which are properly bonded. For example, the process We use unique names for the molecules given as O i (for oxygen) and H i (for hydrogen), while the processes having the names MolHy i and MolOxy i identify processes modelling hydrogen and oxygen molecules with i bonds, respectively. For example, the process M olOxy 1 (O i ) can either create or break bonds, and this is why we use the operator + to describe such a (non-deterministic) choice. Now we present the steps of one of the possible sequences of reactions modelling the autoprotolysis of water. The system of two molecules of water can be rewritten as follows (where we extend the definitions for the processes that will interact in the next step, and bold the actions to be executed): This leads to the next system, where we again bold the processes to be executed: The creation of the hydrogen bond forces the break of the other bond in which the hydrogen molecule H 4 is involved. This leads to the following system containing the H 3 O and HO molecules: Since some bonds are weaker, the system is evolving to: followed by the breaking of the hydrogen bond O 1 − h H 4 : The obtained system contains again two water molecules of water.

Reversing Petri Nets
In this subsection we present Reversing Petri Nets [23] (RPNs, pronounced as 'reversing Petri nets'), an extension of Petri nets developed for the modelling reversing computations, and we employ the formalism to model the autoprotolysis of water.

Definition of RPNs
We consider an extension of reversing Petri nets suitable for describing chemical reactions by allowing multiple tokens of the same type as well as the possibility for transitions to break bonds. Thus, a transition may simultaneously create and/or destroy bonds, and its reversal results in the opposite effect. Formally, a Reversing Petri net is defined as follows: 1. P is a finite set of places and T is a finite set of transitions.

2.
A is a finite set of base or token types ranged over by a, b, . . .. A = {a | a ∈ A} contains a "negative" version for each token type. We assume that for any token type a there may exist a finite number of token instances. We write a 1 , . . . , for instances of type a and A I for the set of all token instances. 3. A V is a finite set of token variables. We write type(v) for the type of variable v and assume that type(v) ∈ A for all v ∈ A V . 4. B ⊆ A × A is a finite set of undirected bond types ranged over by β, γ, . . ..
We use the notation a−b for a bond (a, b) ∈ B. B = {β | β ∈ B} contains a "negative" version for each bond type. B I ⊆ A I × A I is a finite set of bond instances, where we write β i for elements of B.
A reversing Petri net is built on the basis of a set of tokens or bases. These are organised in a set of token types A, where each token type is associated with a set of token instances. Token instances correspond to the basic entities that occur in a system and they may occur as stand-alone elements but as computation proceeds they may also merge together to form bond instances. Places and transitions have the standard meaning and are connected via directed arcs, which are labelled by a set of elements from Intuitively, these labels express the requirements 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 RPN is portrayed as a directed bipartite graph where token instances are indicated by •, places by circles, transitions by boxes, and bond instances by lines between token instances.
Before we recall the semantics of RPNs we need to introduce some notation. Note that in what follows we omit the discussion of negative tokens and negative bonds as they are not relevant to our case study. We write •t = {x ∈ P | F (x, t) = ∅} and t• = {x ∈ P | F (t, x) = ∅} for the incoming and outgoing places of transition t, respectively. Furthermore, we write pre(t) = x∈P F (x, t) for the union of all labels on the incoming arcs of transition t, and post(t) = x∈P F (t, x) for the union of all labels on the outgoing arcs of transition t. Definition 2. A reversing Petri net is well-formed, if for all t ∈ T : Thus, a reversing Petri net is well-formed if (1) whenever a variable exists in the incoming arcs of a transition then it also exists on the outgoing arcs, which implies that transitions do not erase tokens, and (2) tokens/bonds cannot be cloned into more than one outgoing places.
As with standard Petri nets the association of token/bond instances to places is called a marking such that M : P → 2 A I ∪B I , where we assume that if (u, v) ∈ M (x) then u, v ∈ 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) = 0 for some t ∈ T captures that the transition has not taken place, or every execution of it has been reversed, and a history of H(t) = k, k > 0, captures that the transition had k forward executions that have not been reversed. Note that H(t) > 1 may arise due to the consecutive execution of the transition with different token instances. A pair of a marking and a history, M, H , describes a state of a RPN with M 0 , H 0 the initial state, where H 0 (t) = 0 for all t ∈ T .
Finally, we define con(a i , C), where a i ∈ A I and C ⊆ 2 A I ∪B I , to be the token instances connected to a i as well as the bonds creating these connections according to set C. 1. for all v ∈ pre(t), if type(v) = a then type(U (v)) = a 2. for all a ∈ F (x, t), then U (a) ∈ M (x) and for all (a, b) ∈ F (x, t), then (U (a), Thus, t is enabled in state M, H if (1) there is a type-respecting assignment of token instances to the variables on the incoming edges, with (2) the token instances originating from the appropriate input places of the transition and connected with bonds as required by the variable bonds occurring on the incoming edges, and (3) if a bond occurs in the outgoing edges of the transition but not the incoming ones, then the selected instances associated with the bond's variables should not be bonded together in the incoming places of the transition (thus transitions do not recreate bonds). We refer to U as a forward enabling assignment.
To execute a transition t according to an enabling assignment U , the selected token instances, along with their connected components, are relocated to the outgoing places of the transition as specified by the outgoing arcs, with bonds created and destructed accordingly. Furthermore, the history of the executed transition is increased by one. Reversing Execution. We now move on to reversing transitions. A transition can be reversed in a certain state if it has been previously executed and there exist token instances in its output places that match the requirements on its outgoing arcs. Specifically, we define the notion of reverse enabledness as follows: Thus, a transition t is reverse-enabled in M, H if (1) the transition has been executed and (2) there exists a type-respecting assignment of token instances, from the instances in the out-places of the transition, to the variables on the outgoing edges of the transition, and where the instances are connected with bonds as required by the transition's outgoing edges. Also we do not recreate existing bonds when going backwards. We refer to W as a reversal enabling assignment. To implement the reversal of a transition t according to a reversal enabling assignment W , the selected instances are relocated from the outgoing places of the transition to the incoming places, as specified by the incoming arcs of the transition, with bonds created and destructed accordingly. and The autoprotolysis of water in RPNs Figure 8 shows Looking at the transitions, transition t 1 models the formation of a bond between a hydrogen token and an oxygen token. Precisely, the transition stipulates a selection of two such molecules with the use of variables o and h on the incoming arcs of the transition which are bonded together, as described in the outgoing arc of the transition. Subsequently, transition t 2 completes the formation of a water molecule by selecting an oxygen token from place x and a hydrogen token from place v and forming a bond between them, placing the resulting component at place y. Note that the selected oxygen instance in this transition will be connected to a hydrogen token via a bond created by transition t 1 ; this bond is preserved and the component resulting from the creation of the new o − h bond will be transferred to place y. Finally, transition t 3 models the autoprotolysis reaction: assuming the existence of two distinct oxygen instances, as required by the variables o 1 and o 2 on the incoming arc of the transition, connected with hydrogen instances as specified in F (y, t 3 ), the transition breaks the bond o 2 − h 3 and forms the bond o 1 − h 3 . As such, assuming the existence of two water molecules at place y, the transition will form a hydronium (H + 3 O) and a hydroxin (OH − ) molecule in place z of the net. The reversibility semantics of RPNs ensures that reversing the transition t 3 will result in the re-creation of two water molecules placed at y, while the use of variables  called isotopic labelling can be used to trace atoms by using different isotopes of, in this case hydrogen, confirming that the different options happen in reality. In CCB, we can trace the atoms as well as show which results are identical from a chemical point of view (see Section 6.5 of [16]).
The Bonding Calculus is suitable for modelling in a natural way the autoprotolysis of water by using only bond and unbond actions. Simulations by using a software platform can describe the dynamics of the bonding systems, and so it is possible to test the validity of some underlying assumptions. Also, we can verify various properties of the bonding compounds described by using the calculus.
Reversing Petri Nets are Petri net structures that assume tokens to be distinct and persistent. During the execution of transitions individual tokens can be bonded/unbonded with each other, and the creation/destruction of these bonds is considered to be the effect of a transition, whereas their destruction/creation is the effect of the transition's reversal. Reversing Petri Nets are a natural choice to model and analyse biochemical reaction systems, such as the autoprotolysis of water, which by nature has multi-party interactions, is inherently concurrent, and features reversible behaviour. In particular, the feature of token multiplicity and the use of variables allows to non-deterministically select different combinations of atoms of a particular element when creating molecules. Also the ability of transitions to break bonds allows to model concerted actions where, for example, a transition simultaneously destroys a water molecule and creates a hydronium whose reversal results in the opposite effect. Moreover, the collective token interpretation adopted in the framework, treating all tokens of the same type as equivalent, allows the reaction to reverse into two different water molecules than the original ones, i.e. using different instances of the atoms (as is possible in CCB). Note that the presented model abstracts away the positive/negative charge of the atoms and captures the existence of electrons by the enabledness of transitions. A model at a lower level of abstraction would be possible by introducing tokens to represent the electrons bonded to the associated atom tokens to illustrate the relevant charges.
The three formalisms presented can model our example fairly well but, as expected, there are some differences. In order to evaluate each formalism, we consider as first criterion if all chemically valid interactions between the compounds of the reaction can be represented well in our formalisms. CCB shows the linked forming and breaking of bonds. RPNs can also express these concerted actions, since a transition enables the simultaneous creation and destruction of bonds. In the Bonding Calculus, this link is not expressed. Each of the formalisms can perform the forward reaction using any of the hydrogens involved. CCB and RPNs can perform the reverse reaction by transferring arbitrary hydrogens, whereas the Bonding Calculus in the reverse reaction permits only the transfer of exactly those hydrogens that were used in the forward reaction. All models presented use subscripts and enable the tracking of atoms.
The other criterion for assessing the suitability of our formalisms for the modelling of chemical reactions is to ask if they enable in the produced model any transitions that actually do not occur in reality. Each formalism does not permit a H 3 O + molecule to be formed directly. CCB allows one reaction which is not realistic: If there are many water molecules and therefore several hydroxide and water molecules at the same time, it is possible that the remaining hydrogen is transferred from the hydroxide to a water. In reality, this is not possible since the hydroxide is strongly negatively charged and no hydrogen bond can form. Due to the nondeterministic behaviour of processes written with the '+' operator, such as those for hydrogen and oxygen in Subsection 3.2, the Bonding Calculus also presents the same problem. However, this is not the case for RPNs since, on the one hand, a transition's conditions make restrictions on the types of molecules that will participate in a transition firing or its reversal and, on the other hand, places impose a form of locality for molecules. For instance, in the autoprotolysis example, each place is the location of specific types of molecules, e.g., transition t 3 modelling the autoprotolysis reaction is only applied on water molecules and its reversal only on pairs of a hydronium and a hydroxide molecule, as required.
There are a number of software tools that can aid simulation and analysis for our formalisms. Regarding the Bonding Calculus, we can simulate various bonding descriptions by using an existing software platform called UPPAAL (as shown in [1]). For CCB, there is a simulation tool presented in [14]. It allows a much closer form of representation of chemical notation than that possible with a typical programming language. Reversing Petri nets have been shown to be closely related to Coloured Petri Nets, as a subset of the former model has been encoded into the latter [3]. Thus, an algorithmic translation can be implemented that transforms RPNs to CPNs in an automated manner using the transformation techniques discussed in [3]. This allows RPNs to exploit tools such as CPNTools that support traditional models of Petri nets.

Conclusion
We have presented the Calculus of Covalent Bonding, the Bonding Calculus, and Reversing Petri Nets as models of chemical reactions and reversible processes in general. We have shown that they can all model the out-of-causal-order reversibility present in such reactions. We have also noted that the two process calculi allow few reactions which do not happen in reality. This is due to the modelling that abstracts away from some chemical properties of atoms and molecules such as, for example, spacial arrangement and distance between molecules. In future work, we plan to develop these formalisms further and apply them to the modelling and reasoning about reversible biochemical reactions and processes.