Coalgebraic Modelling of Timed Processes
Total Page:16
File Type:pdf, Size:1020Kb
Coalgebraic Modelling of Timed Processes Marco Kick I V N E R U S E I T H Y T O H F G E R D I N B U Doctor of Philosophy Laboratory for Foundations of Computer Science School of Informatics University of Edinburgh 2003 Abstract This thesis presents an abstract mathematical account of timed processes and their operational semantics, where time is modelled by a special kind of monoids, so-called time domains, and (the operational behaviour of) timed processes is represented by special labelled transition systems, so-called timed transition systems (TTSs), together with time bisimulation as an appropriate notion of equivalence of such processes. The importance of monoid-related notions for describing timed phenomena is then illustrated by showing that TTSs are the same as the (partial) actions of the monoid of time; moreover, total monoid actions are also shown to arise naturally in this approach in the form of delay operators. The two kinds of monoid actions are suitably combined in a new notion of biaction which captures the interplay of two very important features of timed processes: letting time pass and delaying. The TTSs are then characterised as coalgebras ofanovelevolution comonad, which is inspired by well-known categorical descriptions of total monoid actions; in doing so, a coalgebraic description of time bisimulation is also provided. Additionally, biactions are characterised as bialgebras of a distributive law of a monad (for total monoid actions) over a comonad (the evolution comonad for partial monoid actions). Building on these results, it is possible to obtain an abstract categorical treatment of operational rules for timed processes. The approach taken here is based on the framework by Turi and Plotkin [TP97], using distributive laws and bialgebras (similar to the treatment of biactions), and which, subsequently, is extended to accommodate behaviour comonads, as required for the coalgebraic description of TTSs. These abstract rules then form the basis for the development of several new syn- tactic rule formats for timed processes which describe classes of particularly ‘well- behaved’ languages for specifying timed processes. iii Acknowledgements It is hard to express my enormous gratitude towards my two supervisors, Gordon Plotkin and Daniele Turi: the combination of Gordon’s vast experience and (some- times almost frightening) quickness in recognising the right mathematical structures (often while—or despite?—discussing some half-baked ideas of mine with him), and Daniele’s enthusiam, immediacy and patience, together with their shared appreciation of beautiful and elegant mathematical solutions (not to speak of Gordon’s generosity in financial matters!), provided me with an almost ideal working environment; I hope that I have not failed completely to meet their expectations. I would also like to thank John Power for many valuable suggestions and discus- sions, in particular for his help with the material on heterogeneous timed processes in Chapter 7, effectively taking on the job of third supervisor during the last stages of writing up; I would also like to acknowledge helpful discussions with Alexander Kurz and Alex Simpson; further thanks go to Terry Stroup for his help with the application for the PhD place. I am also grateful to Margaret Davis, Dyane Goodchild, Monika Lekuse, and Bill Orrok for efficiently handling administrative tasks, and to EPSRC for financial support under grant GR/M56333. Furthermore, I would like to thank the following people for their friendship and/or making Edinburgh a great place to stay: Tom Chotia, Markus Frick, Carsten F¨uhrmann, Martin and Berit Grohe, Jan J¨urjens, Martin and Becky Lange, Bruce McAdam, Conor McBride, and those I forgot to mention. Last, but certainly not least, I would like to thank my parents, my brother, and my girlfriend Andrea for their continuing support, who helped me through the sometimes difficult period of more than three years in a foreign country, where people think that having two water taps is an act of genius—which it definitely is not! v Declaration I declare that this thesis was composed by myself, that the work contained herein is my own except where explicitly stated otherwise in the text, and that this work has not been submitted for any other degree or professional qualification except as specified. Preliminary versions of (parts of) chapters 3–6 have appeared in the papers [Kic02a, Kic02b]. (Marco Kick) vii Table of Contents 1 Introduction 1 1.1 Distributed Real-Time Systems . ................. 2 1.2 Semantics of Programming Languages ................. 4 1.2.1 Operational Semantics . ................. 4 1.2.2 Denotational Semantics . ................. 5 1.2.3 Adequacy Results ........................ 7 1.3 Aspects of Categorical Methods in Semantics ............. 8 1.3.1 Initial Algebra Semantics . ................. 8 1.3.2 Final Coalgebra Semantics . ................. 9 1.4 Challenges . ............................... 10 1.5 Our Approach . ........................ 11 1.6 Contributions . ........................ 13 1.7 Layout of this Thesis . ........................ 13 2 Background 17 2.1 General Preliminaries . ........................ 17 2.2 Transition Systems, Bisimulation, and Operational Semantics . 18 2.3 Timed Process Algebras ........................ 20 2.3.1 A Taxonomy of Design Decisions . ............. 20 2.3.2 Some Languages ........................ 23 2.4 Category Theoretic Preliminaries . ................. 29 3 A Mathematical Model of Timed Processes 37 3.1 Notions of Time as Monoids . ................. 38 ix 3.1.1 The Commutative Case . .................. 44 3.1.2 The Non-Commutative Case .................. 52 3.1.3 Comparison with Other Models . ........... 55 3.2 Transition Systems for Timed Processes . ........... 56 3.2.1 Timed Transition Systems and Time Bisimulation ....... 56 3.2.2 TTSs as Partial Monoid Actions . ........... 67 3.3 Delay Operators and Total Monoid Actions . ........... 75 3.4 Biactions ................................ 80 4 Timed Processes Categorically 85 4.1 Categorical Descriptions of Total Monoid Actions ........... 86 4.1.1 Total Monoid Actions as Algebras . ........... 86 4.1.2 Total Monoid Actions as Coalgebras . ........... 88 4.2 Partial Monoid Actions, Categorically . ........... 89 4.2.1 The Evolution Comonad . .................. 89 4.2.2 Partial Actions as Coalgebras . ........... 102 4.2.3 Coalgebraic E-Bisimulation .................. 108 4.3 Partial Actions of Discrete Time . .................. 110 4.4 Distributing Total over Partial Monoid Actions . ........... 114 5 Abstract Rules for Timed Processes 125 5.1 Bialgebraic Semantics ......................... 126 5.2 Discrete Time . ......................... 134 5.3 Abstract SOS Rules for Behaviour Comonads . ........... 136 5.3.1 Comonadic SOS . .................. 138 5.3.2 Abstract Temporal Rules . .................. 148 6 Rule Formats for Timed Processes 153 6.1 A Format for Discrete Time . .................. 154 6.1.1 Single-step TeCCS . .................. 166 6.2 The General Case . ......................... 170 6.2.1 An Elementary Format . .................. 170 6.2.2 The Complete Characterisation . ........... 191 x 7 Heterogeneous Processes 209 7.1 Heterogeneous Transition Systems . ................. 211 7.2 Heterogeneous Behaviours . ................. 213 7.2.1 Discrete Time . ........................ 214 7.2.2 The General Case ........................ 218 7.3 Heterogeneous Abstract Rules . ................. 237 7.3.1 Discrete Time . ........................ 237 7.3.2 The General Case ........................ 241 7.4 Towards Heterogeneous Rule Formats ................. 247 7.4.1 Discrete Time . ........................ 247 7.4.2 The General Case ........................ 250 8 Conclusion 251 8.1 Summary of Results . ........................ 251 8.2 Future Work ............................... 255 A Total Monoid Actions Revisited 257 A.1 Total Monoid Actions as Presheaves . ................. 257 A.2 Varying the Monoid of Time . ................. 259 A.3 Coalgebras from Geometric Morphisms . ............. 262 Bibliography 263 xi Chapter 1 Introduction We aim at presenting a mathematical theory of timed processes, and their operational behaviour. In applications, such timed processes are usually used to model distributed real-time systems, e.g., in traffic control, or embedded systems. Our approach to providing such a theory is based on the use of categorical methods, some of which have been present in the field of programming language semantics for quite some time—to some extent since at least the 1970’s, i.e., almost since the inception of the whole field. In this introduction, we want to briefly survey the different aspects mentioned above, in order to give a brief outline of what is to come in later chapters. We will start with a brief motivation as to why time plays an important role in the domain of distributed systems, in particular such ones that deal with safety-critical applications. Following this, we will give some hints at the wide field of programming language semantics, focusing on operational and denotational semantics, and their mutual rela- tionship, as established in so-called adequacy results. At that point, we want to spell out some of the apparent challenges involved in our goal, followed by a brief outline of our approach how to overcome these challenges, and the contributions of this thesis. We conclude the chapter with a brief summary of all remaining chapters of the thesis. 1 2 Chapter 1. Introduction 1.1 Distributed