-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfinal.tex
More file actions
1591 lines (1378 loc) · 88.2 KB
/
final.tex
File metadata and controls
1591 lines (1378 loc) · 88.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
% This is samplepaper.tex, a sample chapter demonstrating the
% LLNCS macro package for Springer Computer Science proceedings;
% Version 2.20 of 2017/10/04
%
\documentclass[runningheads]{llncs}
%
\usepackage{graphicx}
\usepackage{amsmath}
%\usepackage{psfrag}
\usepackage{url}
\usepackage{rotating}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{subfigure}
\usepackage{xcolor}
\newcommand\anna[1]{\textcolor{red}{#1}}
% Used for displaying a sample figure. If possible, figure files should
% be included in EPS format.
%
% If you use the hyperref package, please uncomment the following line
% to display URLs in blue roman font according to Springer's eBook style:
% \renewcommand\UrlFont{\color{blue}\rmfamily}
\newcommand{\Bsep}{\: \mid \: }
\newcommand{\Rule}[2]{\displaystyle{\frac{#1}{#2}}}
\newcommand{\SF}[1]{\mathsf{#1}}
\newcommand{\Act}{\mathsf{Act}}
\newcommand{\Vis}{\mathsf{Vis}}
\newcommand{\ActK}{\mathsf{ActK}}
\newcommand{\Proc}{\mathsf{Proc}}
\newcommand{\Var}{\mathsf{Var}}
\newcommand{\Procc}{\mathsf{ProcC}}
\newcommand{\Pred}{\mathsf{Pred}}
\newcommand{\Std}{\mathsf{Std}}
\newcommand{\rms}{\mathrm{S}}
\newcommand{\rmrec}{\mathrm{rec}}
\newcommand{\rmreck}{\mathrm{reck}}
\newcommand{\rmreckR}{\mathrm{reckR}}
\newcommand{\rma}{\mathrm{A}}
\newcommand{\rmp}{\mathrm{P}}
\newcommand{\rmf}{\mathrm{F}}
\newcommand{\rmr}{\mathrm{R}}
\newcommand{\rmfr}{\mathrm{FR}}
\newcommand{\equivS}{\equiv_{\mathrm{S}}}
\newcommand{\SigSA}{\Sigma_{\mathrm{SA}}}
\newcommand{\ltran}[1]{\stackrel{#1}{\longrightarrow}}
\newcommand{\tran}[1]{\stackrel{#1}{\rightarrow}}
\newcommand{\Tran}[1]{\stackrel{#1}{\Rightarrow}}
\newcommand{\nottran}[1]{\stackrel{#1}{\not\rightarrow}}
\newcommand{\Rtran}[1]{\stackrel{#1}{\rightsquigarrow}}
\newcommand{\notRtran}[1]{\stackrel{#1}{\not\rightsquigarrow}}
\newcommand{\trans}[1]{\stackrel{#1}{\rightarrow}_{\mathrm{S}}}
\newcommand{\Par}{\mid}
\newcommand{\restrict}[1]{\!\setminus\!#1}
\newcommand{\paral}{\; \vert \;}
\newcommand{\mA}{\mathcal{A}}
\newcommand{\mSA}{\mathcal{SA}}
\newcommand{\mWA}{\mathcal{WA}}
\newcommand{\mAK}{\mathcal{AK}}
\newcommand{\aAK}{\mathcal{(A)K}}
\newcommand{\umAK}{\underline{\mathcal{A}}\mathcal{K}}
\newcommand{\un}[1]{\underline {#1}}
\newcommand{\PI}{\mathcal{PI}}
\newcommand{\rom}[1]{\mbox{\rm{#1}}}
\newcommand{\Nil}{\mathbf{0}}
\newcommand{\New}[1]{\nu#1\: }
\newcommand{\Str}{\equiv}
\newcommand{\stdpred}{\mathsf{std}}
\newcommand{\std}[1]{\mathsf{std}(#1)}
%
\newcommand{\Bch}[2]{\mathsf{before}_{#1}(#2)}
\newcommand{\keys}[1]{\mathsf{keys}(#1)}
\newcommand{\kkey}[1]{\mathsf{k}(#1)}
\newcommand{\key}[1]{[#1]}
\newcommand{\Keys}{\mathcal{K}}
\newcommand{\Subscripts}{\mathcal{S}}
\newcommand{\freshpred}[1]{\mathsf{fsh}[#1]}
\newcommand{\fresh}[2]{\mathsf{fsh}[#1](#2)}
\newcommand{\freshsubscript}[2]{\mathsf{fshsubscript}[#1](#2)}
\newcommand{\subscript}[1]{\mathsf{s}(#1)}
\newcommand{\alphaconversionkey}[3]{\mathsf{\alpha keys}(#1,#2,#3)}
\newcommand{\alphaconversionkeyk}[3]{\mathsf{\alpha k}(#1,#2,#3)}
\newcommand{\alphaconversionsub}[3]{\mathsf{\alpha subscripts}(#1,#2,#3)}
\newcommand{\alphaconversionsubs}[3]{\mathsf{\alpha s}(#1,#2,#3)}
\newcommand{\alphaconversionsubsr}[3]{\mathsf{\alpha sr}(#1,#2,#3)}
\newcommand{\alphaconversionsubsc}[3]{\mathsf{\alpha sc}(#1,#2,#3)}
\newcommand{\ta}[1]{\mathsf{ta}(#1)}
\newcommand{\action}[1]{\mathsf{act}(#1)}
\newcommand{\intr}{\mbox{\ $\hat{}$\ }}
%\newcommand{\intr}{\mbox{\; $\widehat{}$\;}}
\newcommand{\sterm}{\mathsf{trm}}
\newcommand{\Sterm}[1]{\sterm(#1)}
\newcommand{\und}[1]{\underline{#1}}
\newcommand{\sqc}{\mathop{\cdot}}
\newcommand{\card}[1]{|#1|}
\newcommand{\bydef}{\stackrel{\emph{def}}{=}}
%
\newcommand{\Angle}[1]{\langle #1 \rangle}
\newcommand{\Tri}{\triangleright}
\newcommand{\Hole}{\bullet}
\newcommand{\rec}[1]{\mathrm{rec}\, #1}
\newcommand{\Rec}[1]{\rec #1 .}
\newcommand{\Rch}{\mathsf{Rch}}
\newcommand{\prune}{\pi}
\newcommand{\Prune}[1]{\prune(#1)}
\newcommand{\Root}[1]{\mathsf{rt}(#1)}
\newcommand{\hole}{\mbox{$[\ ]$}}
\newcommand{\Bis}{\sim}
\newcommand{\Biss}{\Bis_{\mathsf{S}}}
\newcommand{\Bisf}{\Bis_{\mathsf{F}}}
\newcommand{\Bisfr}{\Bis_{\mathsf{FR}}}
%\newcommand{\Bisu}{\Bis_{\Un}}
\newcommand{\Sim}{\mathcal{S}}
\newcommand{\Rem}{\backslash}
\newcommand{\sqeqt}{\sim}
% rules:
% static rule
\newcommand{\one}{\mbox{(I)}}
\newcommand{\onef}{\mbox{(1)}}
\newcommand{\oner}{\mbox{(1R)}}
% choice rule
\newcommand{\two}{\mbox{(II)}}
\newcommand{\twof}{\mbox{(2)}}
\newcommand{\twor}{\mbox{(2R)}}
% choice axiom
\newcommand{\thr}{\mbox{(III)}}
\newcommand{\thrf}{\mbox{(3)}}
\newcommand{\thrr}{\mbox{(3R)}}
\newcommand{\thrpf}{\mbox{(3\,$'$\!)}}
\newcommand{\thrpr}{\mbox{(3\,$'$\!R)}}
%
%
\newcommand{\Draft}[1]{}
\newcommand{\Comment}[1]{}
\newcommand{\Rev}[1]{{#1}^{-1}}
\newcommand{\Stefan}[1]{{\bf S(} #1 {\bf )S}}
\newcommand{\rulename}[1]{\textsf{#1}}
\newcommand{\A}{\mathcal{A}}
\newcommand{\B}{\mathcal{B}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\mN}{\mathcal{N}}
\newcommand{\mM}{\mathcal{M}}
\newcommand{\mP}{\mathcal{P}}
\newcommand{\I}{\mathcal{I}}
\newcommand{\Q}{\mathbb{Q}^+}
\newcommand{\C}{\mathcal{C}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\MolOxy}{\mathit{MolOxy}}
\newcommand{\MolHy}{\mathit{MolHy}}
\newcommand{\Uppaal}{{\scshape Uppaal}\,}
\newcommand{\PN}{reversing Petri net }
\newcommand{\guard}[1]{\mathsf{pre}(#1)}
\newcommand{\effects}[1]{\mathsf{post}(#1)}
\newcommand{\bond}{\!-\!}
\newcommand{\connected}{\mathsf{con}}
\newcommand{\state}[2]{\langle {#1}, {#2}\rangle}
\newcommand{\rtrans}[1]{\ensuremath{\stackrel{#1}{\rightsquigarrow}}}
\newcommand{\RPN}{\textsc{RPN\ }}
\newcommand{\type}{\mathit{type}}
\begin{document}
%
\title{Reversibility in Chemical Reactions\thanks{The authors acknowledge partial support
of COST Action IC1405 on Reversible Computation - Extending Horizons of Computing.}}
%
%\titlerunning{Abbreviated paper title}
% If the paper title is too long for the running head, you can set
% an abbreviated paper title here
%
\author{Stefan Kuhn\orcidID{0000-0002-5990-4157}\inst{1}, Bogdan Aman\orcidID{0000-0001-7649-8181}\inst{2,3}, Gabriel Ciobanu\orcidID{0000-0002-8166-9456}\inst{2,3}, Anna Philippou\orcidID{0000-0002-1665-9913}\inst{4}, Kyriaki Psara\orcidID{0000-0002-6554-7950}\inst{4}, and
Irek Ulidowski\orcidID{0000-0002-3834-2036}\inst{5}}
%
\authorrunning{S. Kuhn et al.}
% First names are abbreviated in the running head.
% If there are more than two authors, 'et al.' is used.
%
\institute{School of Computer Science and Informatics, De Montfort University, Leicester, UK\\ \email{\scriptsize stefan.kuhn@dmu.ac.uk} \and
Romanian Academy, Institute of Computer Science, Ia\c si, Rom\^ania\\
\and
A.I.Cuza University, Faculty of Computer Science, Ia\c si, Rom\^ania\\
\email{\scriptsize \{bogdan.aman, gabriel\}@info.uaic.ro }
\and
Department of Computer Science, University of Cyprus, Nicosia, Cyprus \\ \email{\scriptsize \{annap,kpsara01\}@cs.ucy.ac.cy} \and
School of Informatics, University of Leicester, Leicester, UK\\
\email{\scriptsize irek.ulidowski@leicester.ac.uk}
}
%
\maketitle % typeset the header of the contribution
%
\begin{abstract}
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, and Reversing Petri Nets.
This exercise demonstrates that the formalisms, developed for expressing advanced forms of
reversibility, are able to model autoprotolysis of water very accurately. Characteristics and
expressiveness of the three formalisms are discussed and illustrated.
\keywords{ Reversible Computation \and Reaction Modelling
\and Calculus of Covalent Bonding \and Bonding Calculus \and Reversing Petri Nets }
\end{abstract}
%
%
%
\section{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\^ole in
many processes, typically by going back to a previous state in the system.
Two common types of reversibility
are backtracking and causally-consistent reversibility~\cite{danos2004ccsr,Irek2007,LaneseMS10}.
%
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~\cite{Irek2012},
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~\cite{Irek2012}. 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:
$$ A + B + C \rightarrow A+ BC \rightarrow ABC \rightarrow AB + C$$
\noindent
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~\cite{danos2004ccsr,Irek2007,LaneseMS10,Irek2012}.
\subsection{Contribution} This chapter presents and compares three formalisms, the Calculus of Covalent
Bonding (CCB) \cite{KU16,KUHN201818}, the Bonding Calculus \cite{NaCo18}, and Reversing Petri Nets~\cite{RPNs}, 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.
\subsection{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 $\pi$-calculus \cite{Regev2004}, BioAmbients \cite{RegevBioambients}, the stochastic $\pi$-calculus \cite{PriamiStochasticPi}, beta binders~\cite{betabinders} and bioPEPA \cite{CiocchettaBiopepa}. Another way to model biochemical reactions is with rule-based formalisms such as BIOCHAM \cite{biocham}, the $\kappa$-calculus \cite{danoscausality}, and the BioNetGen Language (BNGL) \cite{pmid19399430}.
The formalisms $\kappa$ 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 $\kappa$-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 \cite{danos2004ccsr}, CCSK \cite{Irek2007}, and reversible
$\pi$ \cite{Lanese_controllingreversibility,Lanese_controlled}. CCSK and RCCS are based on the Calculus of Communicating Systems (CCS) \cite{Milner1980}. 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~\cite{Irek2012}, and in the context of reversible event
structures~\cite{Irek2013,irekconcur2013,irekNGC2018}.
CCB~\cite{KUHN201818} allows all types of reversibility in the context of chemical reactions and in
other settings.
Petri nets (PNs)~\cite{PNs} 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~\cite{DBLP:conf/ismb/ReddyML93,DBLP:journals/jsamas/HofestadtH94}.
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~\cite{PNbiology,DBLP:journals/bib/Chaouiya07,DBLP:journals/nc/BaldanCMS10}.
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~\cite{DBLP:journals/jamia/PelegRA05,DBLP:journals/isb/HofestadtT98,DBLP:journals/fuin/Popova-ZeugmannHK05,DBLP:journals/nc/MatsunoNM11,DBLP:journals/isb/VossHK03}.
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~\cite{RPNs} 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~\cite{RC19}.
\subsection{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~\ref{sec:evaluation}, we compare the formalisms and the models of our example reaction, and we also
briefly discuss software support for the three formalisms. Finally, Section~\ref{sec:conclusion} concludes the paper.
\section{Autoprotolysis of Water}
We consider a chemical reaction that transfers a hydrogen atom between two water molecules. This
reaction is known as the \emph{autoprotolysis of water} and is shown
in Figure~\ref{fig:autoprotolysis}. There, $O$ indicates an oxygen atom and $H$ a hydrogen atom. The lines indicate bonds. Positive and negative charges on atoms are shown by $\oplus$ and $\ominus$
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.
\begin{figure}
\vspace{-2ex}\centering
\includegraphics[height=2.5cm]{autoprotolysis_corr3}
\vspace{-2ex}\caption{Autoprotolysis of water.}
\label{fig:autoprotolysis}
\vspace{-2ex}\end{figure}
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 \emph{nucleophilic}, meaning it has the tendency to bond to another atomic nucleus, which would serve as an \emph{electrophile}. This is because oxygen has a high
electro-negativity, 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 \emph{lone pairs} of two electrons each, which can form new bonds (lone pairs are shown in Figure~\ref{fig:autoprotolysis} 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 \emph{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~\ref{fig:autoprotolysis} 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 %consists of
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 \emph{concerted}, meaning that %namely
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 %of
Figure~\ref{fig:autoprotolysis}. This molecule is called \emph{hydronium} and is written as $\mathrm{H_3O^+}$. The other oxygen atom bonds to only one hydrogen and is negatively charged, having an
electron in surplus. This molecule is called a \emph{hydroxide} and is written as $\mathrm{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 $\mathrm{H_3O^+}$ molecule. This is the case since the negatively
charged oxygen is a strong nucleophile and the hydrogens in the $\mathrm{H_3O^+}$ 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~\ref{fig:autoprotolysis} 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 is difficult to identify a clear forward and reverse path.
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 \emph{dative} or \emph{coordinate bonds} are formed where both electrons come from one atom (an oxygen in this case). Both are \emph{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\^ole''. This explains why any proton can be transferred in the reverse reaction and not just the one that was
involved in the forward path.
\section{Formalisms for Reversible Chemical Reactions}
\subsection{Calculus of Covalent Bonding}
\label{sec:ccb}
In this subsection we introduce the Calculus of Covalent Bonding (CCB) \cite{KUHN201818},
concentrating on the new general prefixing operator $(s;b).P$ which, together with a generalised composition operator, produces pairs of \emph{concerted} actions. Then we present a CCB
model of the autoprotolysis of water.
\subsubsection{Definition of CCB}\label{sec:calculusdef}
We recall the definition of CCB, presenting only the main ideas. More details can be found in
\cite{KU16,KUHN201818}. First, we introduce some preliminary notions and notations.
Let $\mA$ be the set of (forward) action labels,
ranged over by $a,b,c,d,e,f$. We partition $\mA$ into the set of \emph{strong actions}, written as
$\mSA$, and the set of \emph{weak actions}, written as $\mWA$. Reverse (or past) action labels are members of
$\underline\mA$, with typical members $\un{a},\un b, \un c,\un d, \un e ,\un f$, and represent
undoing of actions. The set $\mathcal{P}(\mA \cup \underline\mA)$ is ranged over by $L$.
Let $\Keys$ be an infinite set of {\em communication keys} (or {\em keys} for short)
\cite{Irek2007}, ranged over by $k,l, m,n$. The Cartesian product $\mathcal A \times \Keys$, denoted by $\mAK$,
represents past actions, which are written as $a[k]$ for $a\in \mA$ and $k\in\Keys$.
Correspondingly, we have the set $\umAK$ that represents undoing of past actions. We use $\alpha, \beta$ to identify actions which are either from $\mA$ or $\mAK$. It would be
useful to consider sequences of actions or past actions, namely the elements of $(\mA \cup \mAK)^*$,
which are ranged over by $s,s'$ and sequences of purely past actions, namely the elements of $\mAK^*$,
which are ranged over by $t,t'$. The empty sequence is denoted by $\epsilon$. We use the notation ``$\alpha$,$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 $(\mA) =\{ (a)\ \mid a\in\mA\}$, and its product with the set of keys, namely $(\mA)\Keys$. 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:
$$P ::= S \ \bigm\lvert \ S\bydef P \ \bigm\lvert \ (s;b).P \ \bigm\lvert \ P\lvert Q \ \bigm\lvert \ P\restrict L $$
The set of process identifiers (constants) $\PI$ contains typical elements $S$ and~$T$.
Each process identifier $S$ has a defining equation $S\bydef P$ where $P$ contains only forward
actions (and no past actions). There is also a special identifier
$\Nil$, denoting the deadlocked process, which has no defining equation. For restrictions $L \subseteq \mA$ 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 \cite{Irek2012}. 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
\emph{simple prefix}. The simple prefix (which is still a sequence) is the prefixing operator in \cite{Irek2012}.
Exactly one of the actions in~$s$ in $(s).P$ may be a weak action from $\mWA$. 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 \cite{Milner1980}.
We omit trailing $\Nil$s so, for example, $(s).\Nil$ 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 \rulename{concert} rule in Figure~\ref{fig:csos}).
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 \rulename{act1} and \rulename{act2}).
$P\paral 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
$\gamma$. As in the calculus ACP \cite{ACPBook}, the communication function is a partial function
$\gamma: \mathcal A \times \mathcal A \rightarrow \mathcal A$ which is commutative and associative. The function
$\gamma$ is used in the operational semantics to define when two processes can interact. Processes
$P$ and $Q$ in $P\paral 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
$\setminus 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 $\gamma(a,b)=c$ then $a.P$ and $b.Q$
cannot communicate in $(a.P\paral b.Q)\setminus c$.
The set $\Proc$ of \emph{process terms} is ranged over by $P,Q$ and $R$.
In the setting of CCB these terms are simply called \emph{processes}. We define the semantics of our calculus using SOS rules (Figures~\ref{fig:fsos}--\ref{fig:csos}) and rewrite rules (Figure~\ref{fig:reduction}).
We use some predicates and functions, which are formally defined in \cite{KUHN201818}. 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 $\freshpred{n}(Q)$, if $Q$ contains no past action with the key $n$. Function $\mathsf{k}$ returns the keys in a sequence of actions,
whereas $\mathsf{keys}$ returns the keys in a process, and $\mathsf{fn}$ gives the actions of a process
which could be executed.
\begin{figure}
\vspace{-4ex}\[
\begin{array}{ll}
\rulename{act1}\
\Rule
{\std{P} \quad \fresh{k}{s,s'}}
{(s,a,s';b).P \xrightarrow{a[k]}(s,a[k],s';b).P}
\qquad &
\rulename{act2}\
\Rule
{P \xrightarrow{a[k]} P' \quad \fresh{k}{t}}
{(t;b).P \xrightarrow{a[k]} (t;b).P'}
\\[15pt]
\rulename{par}\
\Rule
{P \xrightarrow{a[k]} P'\quad \fresh{k}{Q}}
{P \paral Q \xrightarrow{a[k]} P' \paral Q}
\qquad &
\rulename{com}\
\Rule
{P \xrightarrow{a[k]} P' \quad Q \xrightarrow{d[k]} Q'}
{P \paral Q \xrightarrow{c[k]} P' \paral Q'}
\; (*)
%
\\[15pt]
\rulename{res}\
\Rule
{P \xrightarrow{a[k]} P'}
{P\backslash L \xrightarrow{a[k]} P'\backslash L}
\; a \notin L
\qquad &
\rulename{con}\
\Rule
{P \xrightarrow{a[k]} P'}
{S \xrightarrow{a[k]} P'}
\; S \bydef P
\end{array}
\]
\vspace{-3ex}\caption[Forward SOS rules for CCB.]{Forward SOS rules for CCB.
The condition (*) is $\gamma(a,d)=c$, and $b \in \mathcal{WA}$. Recall that $s$ is a sequence
of actions and past actions and $t$ is a sequence of purely past actions.} \label{fig:fsos}
\vspace{-2ex}\end{figure}
\begin{figure}
\vspace{-2ex}\[
\begin{array}{ll}
\rulename{rev act1}\
\Rule
{\std{P} %\quad \fresh{k}{s,s'}
}
{(s,a[k],s';b).P \xrightarrow{\underline{a}[k]}(s,a,s';b).P}
\quad &
\rulename{rev act2}\
\Rule
{P \xrightarrow{\underline{a}[k]} P' %\quad \fresh{k}{t}
}
{(t;b).P \xrightarrow{\underline{a}[k]} (t;b).P'}
\\[15pt]
\rulename{rev par}\
\Rule
{P \xrightarrow{\underline{a}[k]} P'\quad \fresh{k}{Q}}
{P \paral Q \xrightarrow{\underline{a}[k]} P' \paral Q}
\quad &
\rulename{rev com}\
\Rule
{P \xrightarrow{\underline{a}[k]} P' \quad Q \xrightarrow{\underline{d}[k]} Q'}
{P \paral Q \xrightarrow{\underline{c}[k]} P' \paral Q'}
\; (*)
%
\\[15pt]
\rulename{rev res}\
\Rule
{P \xrightarrow{\underline{a}[k]} P'}
{P\backslash L \xrightarrow{\underline{a}[k]} P'\backslash L}
\; \underline{a} \notin L
\quad &
\rulename{rev con}\
\Rule
{P \xrightarrow{\underline{a}[k]} P'}
{P \xrightarrow{\underline{a}[k]} S}
\; S \bydef P'
\end{array}
\]
\vspace{-4ex}\caption[Reverse SOS rules for CCB.]{Reverse SOS rules for CCB. The condition (*) is $\gamma(a,d)=c$, and $b \in \mathcal{WA}$. %Note that $\beta \in \mA \cup \mAK$.
}
\label{fig:reversesos}
\vspace{-2ex}\end{figure}
The forward and reverse SOS rules for CCB are given in Figures~\ref{fig:fsos} and \ref{fig:reversesos}.
Figure \ref{fig:csos} contains the SOS rules that define the new concerted actions transitions.
The rule \rulename{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 \rulename{concert} rule uses \emph{lookahead}~\cite{Uli92}. 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'$ in \rulename{concert}.
The rule \rulename{concert par} requires that $k$ is fresh in $Q$,
correspondingly as in \rulename{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 $\fresh{l}{Q}$ in \rulename{concert par}.
The rule \rulename{concert act} requires, correspondingly as \rulename{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 $\fresh{l}{t}$
in the premises of \rulename{concert act}.
%
%
Overall, the transitions in Figures~\ref{fig:fsos}--\ref{fig:csos} are labelled with $a[k] \in \mAK$, or with
$\underline{c}[l] \in \umAK$, or with concerted actions $(a[k], \underline{c}[l])$.
\begin{figure}
\vspace{-1ex}\[
\begin{array}{l}
\rulename{aux1}\
\Rule{\std{P} \quad \fresh{k}{t}}
{(t;b).P \xrightarrow{(b)[k]}(t;b[k]).P}
\qquad
\rulename{aux2}\
\Rule
{P \xrightarrow{(b)[k]} P' \quad \fresh{k}{t}}
{(t;b').P \xrightarrow{(b)[k]} (t;b').P'}
\\[15pt]
\rulename{concert}\
\Rule
{P\xrightarrow{(b)[k]}P' \quad P'\xrightarrow{\underline{a}[l]}P'' \qquad Q\xrightarrow{\alpha[k]}Q'
\quad Q'\xrightarrow{\underline{d}[l]}Q''
}
{P \paral Q\xrightarrow{\{e[k],\underline{f}[l]\}} P'' \paral Q''} (*)\\[15pt]
\rulename{concert act}\
\Rule
{P \xrightarrow{\{{a}[k], \underline{h}[l]\}} P' \quad \fresh{k}{t}}
{(t;b).P \xrightarrow{\{{a}[k], \underline{h}[l]\}} (t;b).P'}\\[15pt]
\rulename{concert par}\
\Rule
{P \xrightarrow{\{{a}[k], \underline{h}[l]\}} P'\quad \fresh{k}{Q} \quad \fresh{l}{Q}}
{P \paral Q \xrightarrow{\{{a}[k], \underline{h}[l]\}} P' \paral Q}\\[15pt]
\rulename{concert res}\
\Rule
{P \xrightarrow{\{{a}[k], \underline{h}[l]\}} P'}
{P\backslash L \xrightarrow{\{{a}[k], \underline{h}[l]\}} P'\backslash L} (**)
%
\end{array}
\]
\vspace{-3ex}\caption[SOS rules for concerted actions in CCB.]{SOS rules for concerted actions in CCB. The condition (*) is 1. $\alpha= c \lor \alpha = (c)$
and $\exists c\in \mathcal{A} | \gamma(b,c)=e$, and 2. $\gamma(a,d)=f$.
The condition (**) is $a, \underline{h} \notin L \cup (L)$.
Recall that $t \in \mAK^*$, and $b \in \mathcal{WA}$.} \label{fig:csos}
\end{figure}
\begin{figure}
\vspace{-.5ex}\[
\begin{array}{lll}
\rulename{prom}: & (s,a,s';b[k]).P \Rightarrow (s,a[k],s';b).P & \mbox{ if } a \in \mathcal{SA}, b \in \mathcal{WA}
\\[5pt]
\rulename{move-r}: & (s,a,s',b[k],s'').P \Rightarrow (s,a[k],s',b,s'').P & \mbox{ if } a \in \mathcal{SA}, b \in \mathcal{WA}
\\[5pt]
\rulename{move-l}: & (s,b[k],s',a,s'').P \Rightarrow (s,b,s',a[k],s'').P & \mbox{ if } a \in \mathcal{SA}, b \in \mathcal{WA}
\end{array}
\]
\vspace{-3ex}\caption[Reduction rules for CCB.]{New reduction rules for CCB. Sequences $s, s', s''$ are members of $(\mathcal{A} \cup \mathcal{AK})^{*}$.}
\label{fig:reduction}
\end{figure}
Next, we recall the main new rewrite rules for a reduction relation for CCB in Figure~\ref{fig:reduction}.
All the rules can be found in~\cite{KU16,KUHN201818} but here we only give rules for {\em promotion}
of actions. These are \rulename{prom}, \rulename{move-r}, and \rulename{move-l} which
promote weak bonds (here~$b$) to strong bonds (here $a$).
The rule \rulename{prom} applies to the full version of our prefix operator (with the ; construct), and
\rulename{move-r} and \rulename{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
\cite{KU16,KUHN201818}.
We shall call henceforth the transitions derived by the forward SOS rules the \emph{forward transitions}
and, the transitions derived by the reverse SOS rules the \emph{reverse transitions}.
Correspondingly, there are the \emph{concerted (action)} transitions.
\subsubsection{The autoprotolysis of water in CCB}
When modelling the autoprotolysis of water in CCB, we shall model the hydrogen and oxygen atoms as processes $H$ and $O$ as follows, where
$h,o$ are actions representing the bonding capabilities of the atoms and $n,p$
representing negative and positive charges, respectively. $H'$ and $O'$ are process constants, and
$p$ and $n$ are weak actions.
$$\begin{array}{lllllll}
H & \bydef & (h;p).H' & \quad & O & \bydef & (o,o,n).O'
\end{array}$$
The synchronisation function $\gamma$ is as follows:
$$\begin{array}{lllllllll}
\gamma(h,o) & = & ho \qquad &
\gamma(n,p) & = & np \qquad &
\gamma(n,h) & = & nh
\end{array}$$
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 ``$\mid$'' 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 $\setminus\{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.
$$ ((h_1[1];p).H'_1 \paral (h_2[2];p).H'_2 \paral (o_1[1],o_2[2],n).O'_1)
\setminus\{h_1,h_2,o_1,o_2\} $$
The system of two water molecules in Figure~\ref{fig:autoprotolysis} is represented
by the parallel composition of two water processes, where the restriction $\setminus\{n,p\}$ represses actions $n,p$ from taking place separately
by forcing them to combine into bonds (according to $\gamma$).
%
\begin{flalign*}
&(( (h_1[1];p).H'_1 \paral (h_2[2];p).H'_2 \paral (o_1[1],o_2[2],n).O'_1)\setminus\{h_1,h_2,o_1,o_2\} \paral &&\\
&( (h_3[3];p).H'_3 \paral (h_4[4];p).H'_4 \paral (o_3[3],o_4[4],n).O'_2) \setminus\{h_3,h_4,o_3,o_4\} ) \setminus\{n,p\}&&
\end{flalign*}
%
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 \paral Q) \setminus L = P \setminus L \paral Q$ if the actions of $L$ are not used in $Q$. Applying this gives us a water molecule modelled as follows:
%
\begin{flalign*}
&( (h_1[1];p).H'_1 \paral (h_2[2];p).H'_2 \paral (o_1[1],o_2[2],n).O'_1) \paral (h_3[3];p).H'_3 \paral &&\\
&(h_4[4];p).H'_4 \paral (o_3[3],o_4[4],n).O'_2) ) \setminus\{h_1,h_2,o_1,o_2\}\setminus\{h_3,h_4,o_3,o_4\}\setminus\{n,p\}&&
\end{flalign*}
%
Note the $\underline{h_i}$, $\underline{o_j}$, and $\underline{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 \emph{concerted actions}.
\begin{flalign*}
& (h_1[1];p).H'_1 \paral (h_2[2];p).H'_2 \paral (o_1[1],o_2[2],n).O'_1 \paral
(h_3[3];p).H'_3 &&\\
&\paral (h_4[4];p).H'_4 \paral (o_3[3],o_4[4],n).O'_2) &&\\
&\xrightarrow{\{ np[5], \underline{h_{3}o_{3}}[3]\}}&&\\
&( (h_1[1];p).H'_1 \paral (h_2[2];p).H'_2 \paral (o_1[1],o_2[2],n\boldsymbol{[5]}).O'_1 \paral
(\boldsymbol{h_3};p\boldsymbol{[5]}).H'_3 &&\\
&\paral (h_4[4];p).H'_4 \paral (\boldsymbol{o_3},o_4[4],n).O'_2&&
\end{flalign*}
We have now arrived at the state on the right hand side in Figure~\ref{fig:autoprotolysis}.
There are weak bonds between $n$ and $p$ (denoted by key $5$) and \emph{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:
\begin{flalign*}
&( (h_1[1];p).H'_1 \paral (h_2[2];p).H'_2 \paral (o_1[1],o_2[2],n\boldsymbol{[5]}).O'_1 \paral
(\boldsymbol{h_3};p\boldsymbol{[5]}).H'_3 &&\\
&\paral (h_4[4];p).H'_4 \paral (\boldsymbol{o_3},o_4[4],n).O'_2 &&\\
&\Rightarrow &&\\
& ( (h_1[1];p).H'_1 \paral (h_2[2];p).H'_2 \paral (o_1[1],o_2[2],n[5]).O'_1) \paral (h_3\boldsymbol{[5]};p).H'_3) &&\\
&\paral (h_4[4];p).H'_4 \paral (o_3,o_4[4],n).O'_2&&
\end{flalign*}
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:
%
\begin{flalign*}
&(( (h_1[1];p).H'_1 \paral (h_2[2];p).H'_2 \paral (o_1[1],o_2[2],n[5]).O'_1) \paral (h_3[5];p).H'_3) &&\\
&\paral (h_4[4];p).H'_4 \paral (o_3,o_4[4],n).O'_2&&\\
&\xrightarrow{\{ np[3], \underline{nh_{3}}[5]\}}&&\\
&(( (h_1[1];p).H'_1 \paral (h_2[2];p).H'_2 \paral (o_1[1],o_2[2],\boldsymbol{n}).O'_1) \paral (\boldsymbol{h_3};\boldsymbol{p[3]}).H'_3) &&\\
&\paral (h_4[4];p).H'_4 \paral (o_3,o_4[4],\boldsymbol{n[3]}).O'_2\\
&\Rightarrow\\
&(( (h_1[1];p).H'_1 \paral (h_2[2];p).H'_2 \paral (o_1[1],o_2[2],\boldsymbol{n}).O'_1) \paral (\boldsymbol{h_3[3]};\boldsymbol{p}).H'_3) &&\\
&\paral (h_4[4];p).H'_4 \paral (\boldsymbol{o_3[3]},o_4[4],\boldsymbol{n}).O'_2
\end{flalign*}
%
This corresponds to the original process.
Putting back restrictions we obtain
%
\begin{flalign*}
&( (h_1[1];p).H'_1 \paral (h_2[2];p).H'_2 \paral (o_1[1],o_2[2],n).O'_1 \paral (h_3[3];p).H'_3 &&\\
&\paral (h_4[4];p).H'_4 \paral (o_3[3],o_4[4],n).O'_2) \setminus\{h_1,h_2,o_1,o_2\}\setminus\{h_3,h_4,o_3,o_4\}\setminus\{n,p\}&&
\end{flalign*}
%
and then if we apply the movement of restrictions in reverse we get
\begin{flalign*}
&(( (h_1[1];p).H'_1 \paral (h_2[2];p).H'_2 \paral (o_1[1],o_2[2],n).O'_1)\setminus\{h_1,h_2,o_1,o_2\} \paral &&\\
&( (h_3[3];p).H'_3 \paral (h_4[4];p).H'_4 \paral (o_3[3],o_4[4],n).O'_2) \setminus\{h_3,h_4,o_3,o_4\} ) \setminus\{n,p\}&&
\end{flalign*}
\subsection{Bonding Calculus}
In this subsection we recall briefly the Bonding Calculus \cite{NaCo18}, and
illustrate its expressiveness by modelling the autoprotolysis of water.
\subsubsection{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 \cite{pmid19399430}, the Bonding Calculus allows the use of molecule sites having the same name, while this is not possible in the $\kappa$-calculus. While the $\kappa$-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~\ref{table:syntax}.
Let us consider the set~$\mathbb{N}$ of natural numbers, the set
$\mN=\{x,x^+,x^-,\dots\}$ of bond names, the set $\mM=\{a,b,\dots\}$ of
molecules and the set $\mP=\{P,Q,\ldots\}$ of processes. A multiset over
$\mN$ is defined as a partial function $N:\mN \rightarrow \N$. In the Bonding
Calculus each molecule has a unique name, and the bond $x$ between two
molecules $a$ and $b$ is denoted by $\{a-^x b\}$.
\begin{figure}
\vspace{-2ex}\centering
\bgroup
\def\arraystretch{1.3}
\begin{tabular}{c@{\hspace{2ex}}lll@{\hspace{2ex}}l}
Bonds & $L$ & $::=$&$ \emptyset$ & {\sf (empty)}\\
&& $\shortmid$ &$ \{a-^x b\}$ & {\sf (bond)}\\
&& $\shortmid$ & $ L \uplus L $ & {\sf (union)}\\
Actions & $\alpha$&$::=$&$\overline{x}(b) $ & {\sf (bond)}\\
&& $\shortmid$ & $ \underline{x}(b) $ & {\sf (unbond)}\\
Processes &$P$&$::= $&$\textbf{0} $ & {\sf (empty)}\\
&& $\shortmid$ & $ \alpha.P $ & {\sf (action prefix)}\\
&& $\shortmid$ & $ P+Q$ & {\sf (choice)}\\
&& $\shortmid$ & $ P \mid Q$ & {\sf (parallel)}\\
&& $\shortmid$ & $ \textbf{if}\ a \Bumpeq^L b \ \textbf{then}\ P\ \textbf{else}\ Q $ & {\sf (testing)}\\
&& $\shortmid$ & $ A(b_1,\ldots,b_n) $ & {\sf (identifier)}\\
Definition & $A(a_1,\ldots,a_n)$&$::= $& $P$ & {\sf (recursion)}\\
System & $S$ & $::=$ & $ P \; ||\; L$ . \\
\end{tabular}
\egroup
\vspace{-2ex}\caption{Syntax of the Bonding Calculus}\label{table:syntax}
\vspace{-2ex}\end{figure}
A bond prefix $\overline{x}(b)$ is used to indicate the availability of
a molecule with name~$b$ to create a new bond with name $x$, while an unbond
prefix $\underline{x}(b)$ indicates the availability of $b$ to destroy an
existing bond $x$. Creating or breaking a bond leads to an
update of the global bond memory $L$. As several similar bonds can exist
between the same molecules, $L$ is actually a multiset of~bonds.
The process $\textbf{0}$ denotes inactivity. The availability to perform an
action $\alpha$, and then to continue the execution as process $P$ is denoted
by the process $\alpha.P$. The process $P+Q$ offers a choice
between the processes $P$ and $Q$, while the process $P \mid 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 $\Bumpeq: \mathcal{M}\times
\N^{\mN} \times \mathcal{M} \rightarrow Bool$ to check whether between two
molecules there exist certain bonds. For example, $a\Bumpeq^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=\emptyset$, then $a\Bumpeq^{\emptyset}b$ checks if at least a bond
exists between the two molecules. When $b=\varepsilon$, then $a\Bumpeq^N
{\varepsilon}$ checks if $a$ has all of bonds from $N$, regardless of
the molecules he has them with. The Boolean result $a \Bumpeq^N b$ used
in the testing process is defined formally as:
\smallskip
$a \Bumpeq^N b=\begin{cases}
\displaystyle(\biguplus_{x \in N} \{a-^x b\}) \in L & N \neq \emptyset~and ~a \neq b \neq \varepsilon\\[15pt]
\displaystyle(\biguplus_{x \in \mN} \{a-^x b\}) \cap L \neq \emptyset & N = \emptyset~and ~a \neq b \neq \varepsilon\\[15pt]
\displaystyle\bigwedge_{x \in N} (|L|_{a,x}=|N|_x) & N \neq \emptyset~and ~a \neq \varepsilon ~and~b = \varepsilon\\[15pt]
\emph{undefined} & \emph{otherwise},
\end{cases}$
\noindent where $|L|_{a,x}$ is the number of bonds containing the molecule
$a$ and bond name~$x$ that appear in the multiset $L$, while $|N|_x$ is
the number of occurrences of~$x$ in~$N$.
Depending on the truth value of $a \Bumpeq^N\!\! b $, the process
$\textbf{if}\;a \Bumpeq^N\!\! b$ $\;\textbf{then}\;P\;\textbf{else}\;Q$
executes either $P$ or $Q$. An identifier $ A(b_1,\ldots,b_n) $ is used
to provide recursion by creating new instances of processes defined as
$A(a_1,\ldots,a_n)=P$, where $a_i \neq a_j$ for all $i\neq j \in
\{1,\ldots,n\}$; the new process is defined as $ A(b_1,\ldots,b_n)
=P\{b_1/a_1,\ldots,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 structural congruence relation $\equiv$ is the least congruence such
that\linebreak $(\mP,+,{\bf 0})$ and $(\mP,\mid,{\bf 0})$ are commutative monoids
and the unfolding law\linebreak $A(b_1,\ldots,b_n) \equiv
P\{b_1/a_1,\ldots,b_n/a_n\}$ holds whenever $A(a_1,\ldots,a_n)$ = $P$.
The calculus presented in \cite{NaCo18} 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 \cite{NaCo18} 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.
\begin{figure}[t]
\begin{center}
\begin{tabular}{c}
\vspace{1ex}
{\sf (CREATE1)} $\dfrac{P=\overline{x}(b).P'+P'' \quad Q= \overline{x}(a).Q'+Q''}{(P\mid Q)\ || \ L \xrightarrow{} (P' \mid Q') \ ||\ L \uplus \{a-^x b\}}$\\[10pt]
\vspace{1ex}
{\sf (CREATE2)} $\dfrac{P=\overline{x^+}(b).P'+P'' \quad Q= \overline{x^-}(a).Q'+Q''\quad a \Bumpeq^{\emptyset} b~is~false~w.r.t.~L}{(P\mid Q)\ || \ L \xrightarrow{} (P' \mid Q') \ ||\ L \uplus \{a-^x b\}}$\\[10pt]
\vspace{1ex}
{\sf (REMOVE1)} $\dfrac{P=\underline{x}(b).P'+P'' \quad Q= \underline{x}(a).Q'+Q'' \quad a \Bumpeq^x b~is~true~w.r.t.~L }{(P\mid Q)\ || \ L \xrightarrow{} (P' \mid Q') \ || \ L \backslash \{a-^x b\}}$\\[10pt]
\vspace{1ex}
{\sf (REMOVE2)} $\dfrac{P=\underline{x^+}(b).P'+P'' \quad Q= \underline{x^-}(a).Q'+Q'' \quad a \Bumpeq^N b~is~true~w.r.t.~L }{(P\mid Q)\ || \ L \xrightarrow{} (P' \mid Q') \ || \ L \backslash \{a-^x b\}}$\\[10pt]
\vspace{1ex}
{\sf (PAR)} $ \dfrac{P\ || \ L\xrightarrow{} P'\ || \ L}{(P\mid Q)\ || \ L\xrightarrow{} (P' \mid Q) \ || \ L}$\\[10pt]
\vspace{1ex}
{\sf (TRUE)} $\dfrac{a \Bumpeq^N b~is~true~w.r.t.~L}{(\textbf{if}\;a \Bumpeq^N b \;\textbf{then}\;P\;\textbf{else}\;
Q)\ || \ L \xrightarrow{} P\ || \ L}$\\[10pt]
\vspace{1ex}
{\sf (FALSE)} $\dfrac{a \Bumpeq^N b~is~false~w.r.t.~L}{(\textbf{if}\;a \Bumpeq^N b \;\textbf{then}\;P\;\textbf{else}\;
Q)\ || \ L \xrightarrow{} Q\ || \ L}$\\[10pt]
\vspace{1ex}
{\sf (IDE)} $\dfrac{P\{b_1/a_1,\ldots,b_n/a_n\} \xrightarrow{} P'}{A(b_1,\ldots,b_n) \xrightarrow{} P'}$ \ if \ $A(a_1,\ldots,a_n) =P$\\[10pt]
{\sf (STRUCT)} $\dfrac{S_1 \rightarrow S'_1 \quad S_1 \equiv S_2 \quad S_2 \rightarrow S'_2}{S'_1 \rightarrow S'_2}$
\end{tabular}
\end{center}
\vspace{-2ex}\caption{Operational Semantics of the Bonding Calculus.}
\label{table:semantics}
\vspace{-4ex}
\end{figure}
The operational semantics of the Bonding Calculus is given in Figure~\ref{table:semantics}. The rules {\sf (CREATE1)} and {\sf (CREATE2)} describe the creation of a
new bond $\{a-^x b\}$, while the rules {\sf (REMOVE1)} and {\sf (REMOVE2)}
describe the breaking of a bond $\{a-^x b\}$. If there exist two bonds
$\{a-^x b\}$ in~$L$, then any of these bonds is broken. The rule
{\sf (PAR}) is used to compose processes in parallel, while the rules
{\sf (TRUE}) and {\sf (FALSE}) choose one of the branches of the testing
process based on the result of the checking. The rule {\sf (IDE)} describes
the recursion, while the {\sf (STRUCT)} rule indicates the fact that we reason
up to the structural congruence.
\subsubsection{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:
\begin{center}
$MolOxy_2(O_1) \mid \MolHy_1(H_1) \mid \MolHy_1(H_2) $
\end{center}
\begin{center}
$\mid \MolOxy_2(O_2) \mid \MolHy_1(H_3) \mid \MolHy_1(H_4) $
\end{center}
\begin{center}
$\mid\mid \{O_1 -^c H_1, O_1 -^c H_2, O_2 -^c H_3, O_2 -^c H_4\}$
\end{center}
\noindent
where the molecules are those of hydrogen and oxygen that are described below:
\vspace{1mm}
$\MolHy_0(H_i) = \overline{c}(H_i).\MolHy_1(H_i)$
\vspace{1mm}
$\MolHy_1(H_i) = \underline{c}(H_i).\MolHy_0(H_i) + \overline{h^+}(H_i).\MolHy_2(H_i)$;
\vspace{1mm}
$\MolHy_2(H_i) = \underline{c}(H_i).\overline{c}(H_i).\underline{h^+}(H_i).\MolHy_{1}(H_i)$.
\vspace{1mm}
$\MolOxy_0(O_i) = \overline{c}(O_i).\MolOxy_1(O_i)$;
\vspace{1mm}
$\MolOxy_1(O_i) = \underline{c}(O_i).\MolOxy_0(O_i) +\overline{c}(O_i).\MolOxy_2(O_i)$;
\vspace{1mm}
$\MolOxy_2(O_i) = \underline{c}(O_i).\MolOxy_1(O_i) +\overline{h^-}(O_i).\MolOxy_3(O_i)$.
\vspace{1mm}
$\MolOxy_3(O_i) = \underline{h^-}(O_i).\MolOxy_2(O_i)$.
\vspace{1mm}
\noindent
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
$\MolOxy_2(O_1) \mid \MolHy_1(H_1) \mid \MolHy(H_2) $ together with the
bonds $\{O_1 -^c H_1, O_1 -^c H_2\}$ model one molecule of water. 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 $MolOxy_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):
\begin{center}$\underline{c}(O_1).\MolOxy_1(O_1) +{\bf \overline{h^-}(O_1)}.\MolOxy_3(O_1) \mid \MolHy_1(H_1) \mid \MolHy_1(H_2) $
\end{center}
\begin{center}$\mid \MolOxy_2(O_2) \mid \MolHy_1(H_3) \mid \underline{c}(H_4).
\MolHy_0(H_4) + {\bf \overline{h^+}(H_4)}.\MolHy_2(H_4)$
\end{center}
\begin{center}$\mid\mid \{O_1 -^c H_1, O_1 -^c H_2, O_2 -^c H_3, O_2 -^c H_4\}$
\end{center}
\noindent
This leads to the next system, where we again bold the processes to be~executed:
\begin{center}$\MolOxy_3(O_1) \mid \MolHy_1(H_1) \mid \MolHy_1(H_2) $
\end{center}
\begin{center}$\mid {\bf \underline{c}(O_2)}.\MolOxy_1(O_2) +\overline{h^-}(O_2).\MolOxy_3(O_1) \mid \MolHy_1(H_3)$
\end{center}
\begin{center}$ \mid {\bf \underline{c}(H_4)}.\overline{c}(H_4).\underline{h^+}(H_4).\MolHy_{1}(H_4)$
\end{center}
\begin{center}$\mid\mid \{O_1 -^c H_1, O_1 -^c H_2, O_1-^h H_4,O_2 -^c H_3, O_2 -^c H_4\}$
\end{center}
\noindent
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_3O$ and $HO$ molecules:
\begin{center}$\MolOxy_3(O_1) \mid \MolHy_1(H_1) \mid \MolHy_1(H_2) $\end{center}
\begin{center}$\mid \underline{c}(O_2).\MolOxy_0(O_2) +{\bf \overline{c}(O_2)}.\MolOxy_2(O_2)$\end{center}
\begin{center}$ \mid \MolHy_1(H_3)$ $ \mid {\bf \overline{c}(H_4)}.\underline{h^+}(H_4).\MolHy_{1}(H_4)$\end{center}
\begin{center}$\mid\mid \{O_1 -^c H_1, O_1 -^c H_2, O_1-^h H_4,O_2 -^c H_3\}$\end{center}
\noindent
Since some bonds are weaker, the system is evolving to:
\begin{center}${\bf \underline{h^-}(O_1)}.\MolOxy_2(O_1) \mid \MolHy_1(H_1) \mid \MolHy_1(H_2) $\end{center}