advanced topics in biosimulation and coinduction

342

description

advanced topics in biosimulation and coinduction

Transcript of advanced topics in biosimulation and coinduction

Page 1: advanced topics in biosimulation and coinduction
Page 2: advanced topics in biosimulation and coinduction
Page 3: advanced topics in biosimulation and coinduction

Cambridge Tracts in Theoretical Computer Science 52

Advanced Topics in Bisimulation and Coinduction

Coinduction is a method for specifying and reasoning about infinite data types andautomata with infinite behaviour. In recent years, it has come to play an ever moreimportant role in the theory of computing. It is studied in many disciplines, includingprocess theory and concurrency, modal logic and automata theory. Typically,coinductive proofs demonstrate the equivalence of two objects by constructing asuitable bisimulation relation between them.

This collection of surveys is aimed at both researchers and Master’s students incomputer science and mathematics, and deals with various aspects of bisimulation andcoinduction, with an emphasis on process theory. Seven chapters cover the followingtopics: history; algebra and coalgebra; algorithmics; logic; higher-order languages;enhancements of the bisimulation proof method; and probabilities. Exercises are alsoincluded to help the reader master new material.

davide sangiorgi is Full Professor in Computer Science at the University ofBologna, Italy, and Head of the University of Bologna/INRIA team ‘Focus’.

jan rutten is a senior researcher at Centrum Wiskunde & Informatica (CWI) inAmsterdam and Professor of Theoretical Computer Science at the Radboud UniversityNijmegen.

Page 4: advanced topics in biosimulation and coinduction

Cambridge Tracts in Theoretical Computer Science 52

Editorial Board

S. Abramsky, Computer Laboratory, Oxford UniversityP. H. Aczel, Department of Computer Science, University of ManchesterJ. W. de Bakker, Centrum voor Wiskunde en Informatica, AmsterdamY. Gurevich, Microsoft ResearchJ. V. Tucker, Department of Mathematics and Computer Science, University College ofSwansea

Titles in the seriesA complete list of books in the series can be found atwww.cambridge.org/mathematics.Recent titles include the following:

29. P. Gardenfors (ed) Belief Revision30. M. Anthony & N. Biggs Computational Learning Theory31. T. F. Melham Higher Order Logic and Hardware Verification32. R. Carpenter The Logic of Typed Feature Structures33. E. G. Manes Predicate Transformer Semantics34. F. Nielson & H. R. Nielson Two-Level Functional Languages35. L. M. G. Feijs & H. B. M. Jonkers Formal Specification and Design36. S. Mauw & G. J. Veltink (eds) Algebraic Specification of Communication

Protocols37. V. Stavridou Formal Methods in Circuit Design38. N. Shankar Metamathematics, Machines and Godel’s Proof39. J. B. Paris The Uncertain Reasoner’s Companion40. J. Desel & J. Esparza Free Choice Petri Nets41. J.-J. Ch. Meyer & W. van der Hoek Epistemic Logic for AI and Computer Science42. J. R. Hindley Basic Simple Type Theory43. A. S. Troelstra & H. Schwichtenberg Basic Proof Theory44. J. Barwise & J. Seligman Information Flow45. A. Asperti & S. Guerrini The Optimal Implementation of Functional

Programming Languages46. R. M. Amadio & P.-L. Curien Domains and Lambda-Calculi47. W.-P. de Roever & K. Engelhardt Data Refinement48. H. Kleine Buning & T. Lettmann Propositional Logic49. L. Novak & A. Gibbons Hybrid Graph Theory and Network Analysis50. J. C. M. Baeten, T. Basten & M. A. Reniers Process Algebra: Equational Theories

of Communicating Processes51. H. Simmons Derivation and Computation52. D. Sangiorgi & J. Rutten (eds) Advanced Topics in Bisimulation and Coinduction53. P. Blackburn, M. de Rijke & Y. Venema Modal Logic54. W.-P. de Roever et al. Concurrency Verification55. Terese Term Rewriting Systems56. A. Bundy et al. Rippling: Meta-Level Guidance for Mathematical Reasoning

Page 5: advanced topics in biosimulation and coinduction

Advanced Topics inBisimulation and Coinduction

Edited by

DAVIDE SANGIORGIUniversity of Bologna (Italy)

and INRIA (France)

JAN RUTTENCentrum Wiskunde & Informatica (CWI), Amsterdam

and the Radboud University Nijmegen

Page 6: advanced topics in biosimulation and coinduction

cambridge university pressCambridge, New York, Melbourne, Madrid, Cape Town,

Singapore, Sao Paulo, Delhi, Tokyo, Mexico City

Cambridge University PressThe Edinburgh Building, Cambridge CB2 8RU, UK

Published in the United States of America by Cambridge University Press, New York

www.cambridge.orgInformation on this title: www.cambridge.org/9781107004979

C� Cambridge University Press 2012

This publication is in copyright. Subject to statutory exceptionand to the provisions of relevant collective licensing agreements,no reproduction of any part may take place without the written

permission of Cambridge University Press.

First published 2012

Printed in the United Kingdom at the University Press, Cambridge

A catalogue record for this publication is available from the British Library

ISBN 978-1-107-00497-9 Hardback

Additional resources for this publication at www.cs.unibo.it/�sangio/Book Bis Coind.html

Cambridge University Press has no responsibility for the persistence oraccuracy of URLs for external or third-party internet websites referred to inthis publication, and does not guarantee that any content on such websites is,

or will remain, accurate or appropriate.

Page 7: advanced topics in biosimulation and coinduction

Contents

List of contributors page viiiPreface xi

1 Origins of bisimulation and coinduction 1Davide Sangiorgi1.1 Introduction 11.2 Bisimulation in modal logic 31.3 Bisimulation in computer science 71.4 Set theory 151.5 The introduction of fixed points in computer science 261.6 Fixed-point theorems 29

Bibliography 31

2 An introduction to (co)algebra and (co)induction 38Bart Jacobs and Jan Rutten2.1 Introduction 382.2 Algebraic and coalgebraic phenomena 422.3 Inductive and coinductive definitions 472.4 Functoriality of products, coproducts and powersets 502.5 Algebras and induction 532.6 Coalgebras and coinduction 662.7 Proofs by coinduction and bisimulation 762.8 Processes coalgebraically 792.9 Trace semantics, coalgebraically 872.10 Exercises 90

Bibliography 94

v

Page 8: advanced topics in biosimulation and coinduction

vi Contents

3 The algorithmics of bisimilarity 100Luca Aceto, Anna Ingolfsdottir and Jirı Srba3.1 Introduction 1003.2 Classical algorithms for bisimilarity 1023.3 The complexity of checking bisimilarity

over finite processes 1223.4 Decidability results for bisimilarity over

infinite-state systems 1423.5 The use of bisimilarity checking in verification and tools 157

Bibliography 163

4 Bisimulation and logic 173Colin Stirling4.1 Introduction 1734.2 Modal logic and bisimilarity 1754.3 Bisimulation invariance 1794.4 Modal mu-calculus 1844.5 Monadic second-order logic and bisimulation invariance 190

Bibliography 195

5 Howe’s method for higher-order languages 197Andrew Pitts5.1 Introduction 1975.2 Call-by-value λ-calculus 2005.3 Applicative (bi)similarity for call-by-value λ-calculus 2015.4 Congruence 2045.5 Howe’s construction 2075.6 Contextual equivalence 2105.7 The transitive closure trick 2145.8 CIU-equivalence 2185.9 Call-by-name equivalences 2255.10 Summary 2295.11 Assessment 229

Bibliography 230

6 Enhancements of the bisimulation proof method 233Damien Pous and Davide Sangiorgi6.1 The need for enhancements 2356.2 Examples of enhancements 2396.3 A theory of enhancements 2496.4 Congruence and up to context techniques 260

Page 9: advanced topics in biosimulation and coinduction

Contents vii

6.5 The case of weak bisimilarity 2696.6 A summary of up-to techniques for bisimulation 286

Bibliography 287

7 Probabilistic bisimulation 290Prakash Panangaden7.1 Introduction 2907.2 Discrete systems 2957.3 A rapid survey of measure theory 3007.4 Labelled Markov processes 3067.5 Giry’s monad 3087.6 Probabilistic bisimulation 3107.7 Logical characterisation 3137.8 Probabilistic cocongruences 3167.9 Kozen’s coinduction principle 3197.10 Conclusions 321

Bibliography 323

Page 10: advanced topics in biosimulation and coinduction

Contributors

Luca AcetoSchool of Computer Science, Reykjavik University, Menntavegur 1,101 Reykjavik, Iceland.email: [email protected]: www.ru.is/faculty/luca/

Anna IngolfsdottirSchool of Computer Science, Reykjavik University, Menntavegur 1,101 Reykjavik, Iceland.email: [email protected]: www.ru.is/faculty/annai/

Bart JacobsInstitute for Computing and Information Sciences (ICIS), Radboud UniversityNijmegen, Heyendaalseweg 135, 6525 AJ Nijmegen, The Netherlands.email: [email protected]: www.cs.ru.nl/B.Jacobs/

Prakash PanangadenMcGill University, 3480 rue University, Room 318 Montreal, Quebec,H3A 2A7 Canada.email: [email protected]: www.cs.mcgill.ca/�prakash/

Andrew M. PittsUniversity of Cambridge, Computer Laboratory, William Gates Building,15 JJ Thomson Ave, Cambridge CB3 0FD, UK.email: [email protected]: www.cl.cam.ac.uk/�amp12/

viii

Page 11: advanced topics in biosimulation and coinduction

List of contributors ix

Damien PousCNRS, Team Sardes, INRIA Rhone-Alpes, 655, avenue de l’Europe,Montbonnot, 38334 Saint Ismier, France.email: [email protected]: http://sardes.inrialpes.fr/�pous/

Jan RuttenCWI, P.O. Box 94079, 1090 GB Amsterdam, The Netherlands.Also: Radboud University Nijmegen.email: [email protected]: http://homepages.cwi.nl/�janr/

Davide SangiorgiUniversita di Bologna/INRIA Team Focus, Dipartimento di Scienzedell’Informazione, Universita di Bologna, Mura Anteo Zamboni, 7 40126Bologna, Italy.email: [email protected]: www.cs.unibo.it/�sangio/

Jiri SrbaDepartment of Computer Science, University of Aalborg, Selma Lagerlofs Vej300, 9220 Aalborg East, Denmark.email: [email protected]: www.brics.dk/�srba/

Colin StirlingSchool of Informatics, Edinburgh University, Informatics Forum, 10 CrichtonStreet, Edinburgh EH8 9AB.email: [email protected]: http://homepages.inf.ed.ac.uk/cps/

Page 12: advanced topics in biosimulation and coinduction
Page 13: advanced topics in biosimulation and coinduction

Preface

This book is about bisimulation and coinduction. It is the companion bookof the volume An Introduction to Bisimulation and Coinduction, by DavideSangiorgi (Cambridge University Press, 2011), which deals with the basics ofbisimulation and coinduction, with an emphasis on labelled transition systems,processes, and other notions from the theory of concurrency.

In the present volume, we have collected a number of chapters, by dif-ferent authors, on several advanced topics in bisimulation and coinduction.These chapters either treat specific aspects of bisimulation and coinduction ingreat detail, including their history, algorithmics, enhanced proof methods andlogic. Or they generalise the basic notions of bisimulation and coinduction todifferent or more general settings, such as coalgebra, higher-order languagesand probabilistic systems. Below we briefly summarise the chapters in thisvolume.

� The origins of bisimulation and coinduction, by Davide SangiorgiIn this chapter, the origins of the notions of bisimulation and coinduction

are traced back to different fields, notably computer science, modal logic,and set theory.

� An introduction to (co)algebra and (co)induction, by Bart Jacobs and JanRutten

Here the notions of bisimulation and coinduction are explained in termsof coalgebras. These mathematical structures generalise all kinds of infinite-data structures and automata, including streams (infinite lists), deterministicand probabilistic automata, and labelled transition systems. Coalgebras areformally dual to algebras and it is this duality that is used to put both inductionand coinduction into a common perspective. This generalises the treatment inthe companion introductory volume, where induction and coinduction wereexplained in terms of least and greatest fixed points.

xi

Page 14: advanced topics in biosimulation and coinduction

xii Preface

� The algorithmics of bisimilarity, by Luca Aceto, Anna Ingolfsdottir and JirıSrba

This chapter gives an overview of the solutions of various algorithmic prob-lems relating bisimilarity and other equivalences and preorders on labelledtransition systems. Typical questions that are addressed are: How can onecompute bisimilarity? What is the complexity of the algorithms? When isbisimilarity decidable?

� Bisimulation and logic, by Colin StirlingThis chapter discloses the strong and beautiful ties that relate bisimula-

tion and modal logics. Various logical characterisations of bisimilarity arediscussed. The main results are the characterisations of bisimilarity via asimple modal logic, the Hennessy–Milner logic, and the characterisation ofthis modal logic as the fragment of first-order logic that is bisimulation invari-ant. The results are then extended to modal logic with fixed points and tosecond-order logic.

� Howe’s Method for higher-order languages, by Andrew PittsIn programming languages, an important property of bisimulation-based

equivalences is whether they are a congruence, that is, compatible withthe language constructs. This property may be difficult to prove if suchlanguages involve higher-order constructs, that is, ones permitting functionsand processes to be data that can be manipulated by functions and processes.This chapter presents a method for establishing compatibility of coinductivelydefined program equalities, originally due to Howe.

� Enhancements of the bisimulation proof method, by Damien Pous and DavideSangiorgi

This chapter discusses enhancements of the bisimulation proof method,with the goal of facilitating the proof of bisimilarity results. The bisimulationproof method is one of the main reasons for the success of bisimilarity.According to the method, to establish the bisimilarity between two givenobjects one has to find a bisimulation relation containing these objects asa pair. This means proving a certain closure property for each pair in therelation. The amount of work needed in proofs therefore depends on thesize of the relation. The enhancements of the method in the chapter allowone to reduce such work by using relations that need only be contained inbisimulation relations. The chapter shows that it is possible to define a wholetheory of enhancements, which can be very effective in applications.

� Probabilistic bisimulation, by Prakash PanangadenHere notions of bisimulation are introduced for probabilistic systems.

These differ from non-deterministic ones in that they take quantitative datainto account on the basis of which they make quantitative predictions about a

Page 15: advanced topics in biosimulation and coinduction

Preface xiii

system’s behaviour. The chapter first discusses the basic example of discretesystems, called labelled Markov chains. After a rapid introductory sectionon measure theory, the more general continuous case, of so-called labelledMarkov processes, is treated. For both the discrete and the continuous case,logical characterisations of bisimilarity are given.

The chapters on probabilities and higher-order linguistic constructs deal withtwo important refinements of bisimulation. While these are certainly not theonly interesting refinements of bisimulation (one could mention, for instance,the addition of time or of space constraints), probabilities and higher-orderconstructs have strong practical relevance (e.g. in distributed systems and othercomplex systems such as biological systems, and in programming languages)and offer technical challenges that make them one of the most active researchtopics in the area of coinduction and bisimulation.

Each chapter is a separate entity, therefore notations among chapters mayoccasionally differ. We are very grateful to the colleagues who contributed thechapters for the time, effort, and enthusiasm that they put into this book project.

We recall the Web page with general information and auxiliary materialabout the two volumes, including solutions to exercises in some of the chapters.At the time of writing, the page is

www.cs.unibo.it/�sangio/Book Bis Coind.html

Davide Sangiorgi and Jan Rutten

Page 16: advanced topics in biosimulation and coinduction
Page 17: advanced topics in biosimulation and coinduction

1

Origins of bisimulation and coinduction

davide sangiorgi

1.1 Introduction

In this chapter, we look at the origins of bisimulation. We show that bisimulationhas been discovered not only in computer science, but also – and roughly at thesame time – in other fields: philosophical logic (more precisely, modal logic),and set theory. In each field, we discuss the main steps that led to the discovery,and introduce the people who made these steps possible.

In computer science, philosophical logic, and set theory, bisimulation hasbeen derived through refinements of notions of morphism between algebraicstructures. Roughly, morphisms are maps (i.e. functions) that are ‘structure-preserving’. The notion is therefore fundamental in all mathematical theoriesin which the objects of study have some kind of structure, or algebra. The mostbasic forms of morphism are the homomorphisms. These essentially give us away of embedding a structure (the source) into another one (the target), so thatall the relations in the source are present in the target. The converse, however,need not be true; for this, stronger notions of morphism are needed. Onesuch notion is isomorphism, which is, however, extremely strong – isomorphicstructures must be essentially the same, i.e. ‘algebraically identical’. It is aquest for notions in between homomorphism and isomorphism that led to thediscovery of bisimulation.

The kind of structures studied in computer science, philosophical logic, andset theory were forms of rooted directed graphs. On such graphs bisimulation iscoarser than graph isomorphism because, intuitively, bisimulation allows us toobserve a graph only through the movements that are possible along its edges.By contrast, with isomorphisms the identity of the nodes is observable too. Forinstance, isomorphic graphs have the same number of nodes, which need notbe the case for bisimilar graphs (bisimilarity on two graphs indicates that theirroots are related in a bisimulation).

1

Page 18: advanced topics in biosimulation and coinduction

2 Davide Sangiorgi

The independent discovery of bisimulation in three different fields suggeststhat only limited exchanges and contacts among researchers existed at the time.The common concept of bisimulation has somehow helped to improve thissituation. An example of this are the advances in set theory and computerscience derived from Aczel’s work.

Bisimilarity and the bisimulation proof method represent examples of acoinductive definition and the coinduction proof method, and as such are inti-mately related to fixed points, in particular greatest fixed points. We thereforealso discuss the introduction of fixed points, and of coinduction. In this case,however, with a more limited breadth: we only consider computer science –fixed points have a much longer history in mathematics – and we simply dis-cuss the main papers in the introduction of coinduction and fixed-point theoryin the field. We conclude with some historical remarks on the main fixed-pointtheorems that underpin the theory of induction and coinduction presented in[San12].

In each section of the chapter, we focus on the origins of the concept dealtwith in that section, and do not attempt to follow the subsequent developments.The style of presentation is generally fairly informal, but – we hope – technicalenough to make the various contributions clear, so that the reader can appreciatethem.

I believe that examining the developments through which certain conceptshave come to light and have been discovered is not a matter of purely intellectualcuriosity, but it also useful to understand the concepts themselves (e.g. problemsand motivations behind them, relationship with other concepts, alternatives,etc.). Further, the chapter offers the opportunity of discussing bisimulation inset theory, where nowadays the role of bisimulation is well recognised. Settheory is not considered in other chapters of the book.

Structure of the chapter In Sections 1.2–1.4 we examine the origins of bisim-ulation and bisimilarity in modal logic, computer science, and set theory. Wereport on the introduction of coinduction and fixed points in computer sciencein Section 1.5, and, in Section 1.6, we discuss the fixed-point theorems.

This chapter is extracted from [San09]; I refer to this for further details onthe topic. Solutions to most of the exercises can be found in [San09] and in theWeb pages for the book.

Acknowledgements I am very grateful to the following people who helpedme to find relevant papers and materials or helped me in tracing back bits ofhistory: L. Aceto, P. Aczel, G. Boudol, J. van Benthem, E. Clarke, Y. Deng,R. Hinnion, F. Honsell, J.-P. Katoen, A. Mazurkiewicz, Y. N. Moschovakis, L.

Page 19: advanced topics in biosimulation and coinduction

Origins of bisimulation and coinduction 3

Moss, R. Milner, U. Montanari, P. Panangaden, W.P. de Roever, W. Thomas,M. Tofte.

1.2 Bisimulation in modal logic

1.2.1 Modal logics

Philosophical logic studies and applies logical techniques to problems of inter-est to philosophers, somewhat similarly to what mathematical logic does forproblems that interest mathematicians. Of course, the problems do not onlyconcern philosophers or mathematicians; for instance, nowadays both philo-sophical and mathematical logics have deep and important connections withcomputer science.

Strictly speaking, in philosophical logic a modal logic is any logic that usesmodalities. A modality is an operator used to qualify the truth of a statement,that is, it creates a new statement that makes an assertion about the truth of theoriginal statement.

For the discussion below we use the ‘full propositional logic’ introducedin [Sti12], to which we refer for explanations and the interpretation of theformulas:

φdefD p j :φ j φ1 ^ φ2 j hμiφ j ?

where p is a proposition letter. We recall that Labelled Transition Systems(LTSs) with a valuation, also called Kripke models, are the models for the logic.In the examples we will give, when we do not mention proposition letters it isintended that no proposition letters hold at the states under consideration.

1.2.2 From homomorphism to p-morphism

Today, some of the most interesting results in the expressiveness of modal logicsrely on the notion of bisimulation. Bisimulation is indeed discovered in modallogic when researchers begin to investigate seriously issues of expressivenessfor the logics, in the 1970s. For this, important questions tackled are: When isthe truth of a formula preserved when the model changes? Or, even better, underwhich model constructions are modal formulas invariant? Which properties ofmodels can modal logics express? (When moving from a model M to anothermodel N , preserving a property means that if the property holds in M thenit holds also when one moves to N ; the property being invariant means thatalso the converse is true, that is, the property holds in M iff it holds when onemoves to N .)

Page 20: advanced topics in biosimulation and coinduction

4 Davide Sangiorgi

To investigate such questions, it is natural to start from the most basicstructure-preserving construction, that of homomorphism. A homomorphismfrom a model M to a model N is a function F from the points of M to thepoints of N such that

� whenever a proposition letter holds at a point P of M then the same letteralso holds at F (P ) in N ;

� whenever there is a μ-transition between two points P,P 0 in M then thereis also a μ-transition between F (P ) and F (P 0) in N .

Thus, contrasting homomorphism with bisimulation, we note that

(i) homomorphism is a functional, rather than relational, concept;(ii) in the definition of homomorphism there is no back condition; i.e. the

reverse implication, from transitions in N to those in M, is missing.

It is easy to see that homomorphisms are too weak to respect the truth ofmodal formulas:

Exercise 1.2.1 Show, by means of a counterexample, that modal formulas arenot preserved by homomorphisms. �

That is, a homomorphism H from a model M to a model N does not guaranteethat if a formula holds at a point Q of M then the same formula also holds atH (Q) in N .

The culprit for the failure of homomorphisms is the lack of a back condition.We can therefore hope to repair the invariance by adding some form of reverseimplication. There are two natural ways of achieving this:

(1) turning the ‘implies’ of the definition of homomorphism into an ‘iff’ (thatis, a propositional letter holds at P in M iff it holds at F (P ) in N ; and

Pμ�! P 0 in M iff F (P )

μ�! F (P 0) in N , for any P and P 0);

(2) explicitly adding back conditions (that is, if a propositional letter holds atF (P ) in N then it also holds at P in M; and if in N there is a transition

F (P )μ�! Q, for some point Q, then in M there exists a point P 0 such that

Pμ�! P 0 and Q D F (P 0).

Solution (1) is the requirement of strong homomorphisms. Solution (2) is firstformalised by Krister Segerberg in his famous dissertation [Seg71], as therequirement of p-morphisms.

Segerberg starts the study of morphisms between models of modal log-ics that preserve the truth of formulas in [Seg68]. Initially, p-morphisms arecalled pseudo-epimorphims [Seg68], and are indeed surjective mappings. Later

Page 21: advanced topics in biosimulation and coinduction

Origins of bisimulation and coinduction 5

[Seg70, Seg71], the term is shortened to p-morphisms, and thereafter used todenote also non-surjective mappings. A notion similar to p-morphisms had alsooccurred earlier, in a work of Jongh and Troelstra [JT66], for certain surjec-tive mappings on partial orders that were called strongly isotone. Sometimes,today, p-morphisms are called bounded morphisms, after Goldbatt [Gol89]. Thep-morphisms can be regarded as the natural notion of homomorphism in LTSsor Kripke models; indeed other reasons make p-morphisms interesting formodal logics, for instance they are useful in the algebraic semantics of modallogics (e.g. when relating modal algebras).

With either of the additions in (1) or (2), the invariance property holds:modal formulas are invariant both under surjective strong homomorphisms andunder p-morphisms. (The surjective condition is necessary for strong homo-morphisms, but not for p-morphisms.)

Exercise 1.2.2

(1) Exhibit a surjective p-morphism that is not a surjective strong homomor-phism.

(2) Show that the invariance property does not hold for non-surjective stronghomomorphisms. �

As far as invariance is concerned, the surjective strong homomorphism con-dition is certainly a very strong requirement – we are not far from isomorphism,in fact (the only difference is injectivity of the function, but even when func-tions are not injective only states with essentially the ‘same’ transitions can becollapsed, that is, mapped onto the same point). In contrast, p-morphisms aremore interesting. Still, they do not capture all situations of invariance. That is,there can be states s of a model M and t of a model N that satisfy exactly thesame modal formulas and yet there is no p-morphisms that take s into t or viceversa (Exercise 1.2.3).

1.2.3 Johan van Benthem

The next step is made by Johan van Benthem in his PhD thesis [Ben76] (the book[Ben83] is based on the thesis), who generalises the directional relationshipbetween models in a p-morphism (the fact that a p-morphism is a function) toa symmetric one. This leads to the notion of bisimulation, which van Benthemcalls p-relation. (Later [Ben84] he renames p-relations as zigzag relations.) OnKripke models, a p-relation between models M and N is a total relation S onthe states of the models (the domain of S are the states of M and the codomainthe states of N ) such that whenever P S Q then: a propositional letter holds at

Page 22: advanced topics in biosimulation and coinduction

6 Davide Sangiorgi

P iff it holds at Q; for all P 0 with Pμ�! P 0 in M there is Q0 such that Q

μ�! Q0

in N and P 0 S Q0; the converse of the previous condition, on the transitionsfrom Q.

Exercise 1.2.3 Find an example of points in two models that are in a p-relationbut no p-morphism can be established between them. �

Van Benthem defines p-relations while working on correspondence theory,precisely the relationship between modal and classical logics. Van Benthem’sobjective is to characterise the fragment of first-order logic that ‘corresponds’ tomodal logic – an important way of measuring expressiveness. He gives a sharpanswer to the problem, via a theorem that is today called the ‘van Benthemcharacterisation theorem’. In nowadays’s terminology, van Benthem’s theoremsays that a first-order formula A containing one free variable is equivalent toa modal formula iff A is invariant for bisimulations. That is, modal logic isthe fragment of first-order logic whose formulas have one free variable and areinvariant for bisimulation. We refer to [Sti12] for discussions on this theorem.

The original proof of the theorem is also interesting. The difficult impli-cation is the one from right to left. A key part of the proof is to show that apoint P in a model M and a point Q in a model N satisfy the same modalformulas if there are extensions M0 and N 0 of the models M and N in whichP and Q are bisimilar. The extensions are obtained as the limits of appropriateelementary chains of models, starting from the original models. Further, theembedding of the original models into the limits of the chains preserves modalformulas. The reason why it is necessary to move from the original modelsM and N to the extended models M0 and N 0 is that on arbitrary modelstwo points may satisfy the same set of formulas without being bisimilar. Thismay occur if the models are not finitely branching. By contrast, the extendedmodels M0 and N 0 are ‘saturated’, in the sense that they have ‘enough points’.On such models, two points satisfy the same modal formulas iff they are bisim-ilar. As all finitely branching models are saturated, van Benthem’s constructionalso yields the familiar Hennessy–Milner theorem for modal logics [HM85](an earlier version is [HM80]): on finitely branching models, two points arebisimilar iff they satisfy the same modal formulas. Saturated models need notbe finitely branching, however, thus van Benthem’s construction is somewhatmore general. Note that the need for saturation also would disappear if thelogic allowed some infinitary constructions, for instance infinite conjunction.In modern textbooks, such as [BRV01], the proof is sometimes presented in adifferent way, by directly appealing to the existence of saturated models; how-ever, elementary chains are employed to show the existence of such saturated

Page 23: advanced topics in biosimulation and coinduction

Origins of bisimulation and coinduction 7

models. Again, for details on the above proof and on the characterisation ofbisimulation via modal logic, we refer to [Sti12].

After van Benthem’s theorem, bisimulation has been used extensively inmodal logic, for instance, to analyse the expressive power of various dialectsof modal logics, to understand which properties of models can be expressed inmodal logics, and to define operations on models that preserve the validity ofmodal formulas.

1.2.4 Discussion

In philosophical logic we see, historically, the first appearance of the notionof bisimulation. We do not find here, however, coinduction, at least not in anexplicit way. Thus total relations between models that represent bisimulationsare defined – the p-relations – but there is no explicit definition and use ofbisimilarity. Similarly no links are made to fixed-point theory.

In retrospect, today we could say that bisimulation, as a means of character-ising equivalence of modal properties, ‘was already there’ in the Ehrenfeucht–Fraısse games. In the 1950s, Roland Fraısse [Fra53] gave an algebraic for-mulation, as a weak form of isomorphism, of indistinguishability by formulasof first-order logic. Andrzej Ehrenfeucht [Ehr61] then extended the result andgave it a more intuitive game-theoretic formulation, in what is now called theEhrenfeucht–Fraısse games. Such games are today widely used in computerscience, notably in logic, finite model theory, but also in other areas such ascomplexity theory, following Immerman [Imm82]. It is clear that the restrictionof the Ehrenfeucht–Fraısse games to modal logic leads to game formulationsof bisimulation. However, such a connection has been made explicit only afterthe discovery of bisimulation. See, for instance, Thomas [Tho93].

1.3 Bisimulation in computer science

1.3.1 Algebraic theory of automata

In computer science, the search for the origins of bisimulation takes us back tothe algebraic theory of automata, well-established in the 1960s. A good refer-ence is Ginzburg’s book [Gin68]. Homomorphisms can be presented on differ-ent forms of automata. We follow here Mealy automata. In these automata, thereare no initial and final states; however, an output is produced whenever an inputletter is consumed. Thus Mealy automata can be compared on the set of outputstrings produced. Formally, a Mealy automaton is a 5-tuple (W,�,�, T ,O)where

Page 24: advanced topics in biosimulation and coinduction

8 Davide Sangiorgi

� W is the finite set of states;� � is the finite set of inputs;� � is a finite set of outputs;� T is the transition function, that is a set of partial functions fTa j a 2 �g

from W to W ;� O is the output function, that is, a set of partial functions fOa j a 2 �g fromW to �.

The output string produced by a Mealy automaton is the translation of the inputstring with which the automaton was fed; of course the translation depends onthe state on which the automaton is started. Since transition and output functionsof a Mealy automaton are partial, not all input strings are consumed entirely.

Homomorphism is defined on Mealy automata following the standard notionin algebra, e.g. in group theory: a mapping that commutes with the operationsdefined on the objects of study. Below, if A is an automaton, then WA is theset of states of A, and similarly for other symbols. As we deal with partialfunctions, it is convenient to view these as relations, and thereby use for themrelational notations. Thus fg is the composition of the two function f and g

where f is used first (that is, (fg)(a) D g(f (a))); for this, one requires that thecodomain of f be included in the domain of g. Similarly, f � g means thatwhenever f is defined then so is g, and they give the same result.

A homomorphism from the automaton A to the automaton B is a surjectivefunction F from WA to WB such that for all a 2 �:

(1) T Aa F � FT B

a (condition on the states); and(2) OA

a � FOBa (condition on the outputs).

(We assume here for simplicity that the input and output alphabets are the same,otherwise appropriate coercion functions would be needed.)

At the time (the 1960s), homomorphism and similar notions are all expressedin purely algebraic terms. Today we can make an operational reading of them,

which for us is more enlightening. Writing Pa!b

Q if the automaton, on state P

and input a, produces the output b and evolves into the state Q, and assumingfor simplicity that OA

a and T Aa are undefined exactly on the same points, the

two conditions above become:

� for all P,P 0 2 WA, if Pa!b

P 0 then also F (P )a!b

F (P 0).

Homomorphisms are used in that period to study a number of properties ofautomata. For instance, minimality of an automaton becomes the conditionthat the automaton has no proper homomorphic image. Homomorphisms arealso used to compare automata. Mealy automata are compared using the notion

Page 25: advanced topics in biosimulation and coinduction

Origins of bisimulation and coinduction 9

of covering (written�): A � B (read ‘automaton B covers automaton A’) if B

can do, statewise, at least all the translations that A does. That is, there is a totalfunction ψ from the states of A to the states of B such that, for all states P ofA, all translations performed by A when started in P can also be performed byB when started in ψ(P ). Note that B can however have states with a behaviourcompletely unrelated to that of any state of A; such states of B will not be theimage of states of A. If both A � B and B � A hold, then the two automataare deemed equivalent.

Homomorphism implies covering, i.e. if there is a homomorphism from A

to B then A � B. The converse result is (very much) false. The implicationbecomes stronger if one uses weak homomorphisms. These are obtained byrelaxing the functional requirement of homomorphism into a relational one.Thus a weak homomorphism is a total relation R on WA �WB such that forall a 2 �:

(1) R�1T Aa � T B

a R�1 (condition on the states); and(2) R�1OA

a � OBa (condition on the outputs)

where relational composition, inverse, and inclusion are defined in the usualway for relations [San12, section 0.5], and again functions are taken as specialforms of relations. In an operational interpretation as above, the conditionsgive:

� whenever P R Q and Pa!b

P 0 hold in A, then there is Q0 such that Qa!b

Q0

holds in B and P 0 R Q0.

(On the correspondence between the algebraic and operational definitions, seealso Remark 1.3.1 below.) Weak homomorphism reminds us of the notion ofsimulation (see [San12]). The former is however stronger, because the relationR is required to be total. (Also, in automata theory, the set of states and thesets of input and output symbols are required to be finite, but this difference isless relevant.)

Remark 1.3.1 To understand the relationship between weak homomorphismsand simulations, we can give an algebraic definition of simulation on LTSs,taking these to be triples (W,�, fTa j a 2 �g) whose components have thesame interpretation as for automata. A simulation between two LTSs A and B

becomes a relation R on WA �WB such that, for all a 2 �, condition (1) ofweak homomorphism holds, i.e.

� R�1T Aa � T B

a R�1.

Page 26: advanced topics in biosimulation and coinduction

10 Davide Sangiorgi

This is precisely the notion of simulation (as defined operationally in [San12]).Indeed, given a state Q 2 WB and a state P 0 2 WA, we have Q R�1 T A

a P 0

whenever there is P 2 WA such that Pa�! P 0. Then, requiring that the pair

(Q,P 0) is also in T Ba R�1 is the demand that there is Q0 such that Q

a�! Q0

and P 0 R Q0. �

Exercise 1.3.2 Suppose we modified the condition on states of weak homo-morphism as follows:

� T Aa R � RT B

a ,

and similarly for the condition on outputs. Operationally, what would thismean? What is the relationship to simulations? �

Exercise 1.3.3 Suppose we strengthen the condition in Remark 1.3.1 byturning the inclusion � into an equality. What would it mean, operationally?Do we obtain bisimulations? Do we obtain relations included in bisimilarity?How can bisimulation (on LTSs) be formulated algebraically? �

As homomorphisms, so weak homomorphisms imply covering. The resultfor weak homomorphism is stronger as the homomorphisms are strictlyincluded in the weak homomorphisms.

Exercise 1.3.4 Find an example of a weak homomorphism that is not ahomomorphism. �

Exercise 1.3.5 Show that there can be automata B and A with A � B and yetthere is no weak homomorphism between A and B. (Hint: use the fact that therelation of weak homomorphism is total.) �

In conclusion: in the algebraic presentation of automata in the 1960s we findconcepts that remind us of bisimulation, or better, simulation. However, thereare noticeable differences, as we have outlined above. But the most importantdifference is due to the fact that the objects are deterministic. To see howsignificant this is, consider the operational reading of weak homomorphism,namely ‘whenever P R Q ... then there is Q0 such that ....’. As automataare deterministic, the existential in front of Q0 does not play a role. Thusthe alternation of universal and existential quantifiers – a central aspect ofthe definitions of bisimulation and simulation – does not really show up ondeterministic automata.

Page 27: advanced topics in biosimulation and coinduction

Origins of bisimulation and coinduction 11

1.3.2 Robin Milner

Decisive progress towards bisimulation is made by Robin Milner in the1970s. Milner transplants the idea of weak homomorphism into the studyof the behaviour of programs in a series of papers in the early 1970s([Mil70, Mil71a, Mil71b], with [Mil71b] being a synthesis of the previoustwo). He studies programs that are sequential, imperative, and that may notterminate. He works on the comparisons among such programs. The aim is todevelop techniques for proving the correctness of programs, and for abstractingfrom irrelevant details so that it is clear when two programs are realisations ofthe same algorithm. In short, the objective is to understand when and why twoprograms can be considered ‘intensionally’ equivalent.

To this end, Milner proposes – appropriately adapting it to his setting –the algebraic notion of weak homomorphism that we have described in Sec-tion 1.3.1. He renames weak homomorphism as simulation, a term that betterconveys the idea of the application in mind. Although the definition of simula-tion is still algebraic, Milner now clearly spells out its operational meaning. Butperhaps the most important contribution in his papers is the proof techniqueassociated to simulation that he strongly advocates. This techniques amountsto exhibiting the set of pairs of related states, and then checking the simulationclauses on each pair. The strength of the technique is precisely the locality ofthe checks that have to be made, in the sense that we only look at the immediatetransitions that emanate from the states (as opposed to, say, trace equivalencewhere one considers sequences of transitions, which may require examiningstates other than the initial one of a sequence). The technique is proposed toprove not only results of simulation, but also results of input/output correctnessfor programs, as a simulation between programs implies appropriate relation-ships on their inputs and outputs. Besides the algebraic theory of automata,other earlier works that have been influential for Milner are those on programcorrectness, notably Floyd [Flo67], Manna [Man69], and Landin [Lan69], whopioneers the algebraic approach to programs.

Formally, however, Milner’s simulation remains the same as weak homo-morphism and as such it is not today’s simulation. Programs for Milner aredeterministic, with a total transition function, and these hypotheses are essen-tial. Non-deterministic and concurrent programs or, more generally, programswhose computations are trees rather than sequences, are mentioned in the con-clusions for future work. It is quite possible that if this challenge had beenquickly taken up, then today’s notion of simulation (or even bisimulation)would have been discovered much earlier.

Milner himself, later in the 1970s, does study concurrency very inten-sively, but under a very different perspective: he abandons the view of parallel

Page 28: advanced topics in biosimulation and coinduction

12 Davide Sangiorgi

programs as objects with an input/output behaviour akin to functions, in favourof the view of parallel programs as interactive objects. This leads Milner todevelop a new theory of processes and a calculus – CCS – in which the notionof behavioural equivalence between processes is fundamental. Milner howeverkeeps, from his earlier works, the idea of ‘locality’ – an equivalence should bebased outcomes that are local to states.

The behavioural equivalence that Milner puts forward, and that is prominentin the first book on CCS [Mil80], is inductively defined. It is the stratification

of bisimilarity�ωdefD⋂

n �n presented in [San12, section 2.10]. Technically, incontrast with weak homomorphisms, �ω has also the reverse implication (onthe transitions of the second components of the pairs in the relation), and can beused on non-deterministic structures. The addition of a reverse implication wasnot obvious. For instance, a natural alternative would have been to maintainan asymmetric basic definition, possibly refine it, and then take the inducedequivalence closure to obtain a symmetric relation (if needed). Indeed, amongthe main behavioural equivalences in concurrency – there are several of them,see [Gla93, Gla90] – bisimulation is the only one that is not naturally obtainedas the equivalence-closure of a preorder.

With Milner’s advances, the notion of bisimulation is almost there: itremained to turn an inductive definition into a coinductive one. This will beDavid Park’s contribution.

It is worth pointing out that, towards the end of the 1970s, homomorphisms-like notions appear in other attempts at establishing ‘simulations’, or even‘equivalences’, between concurrent models – usually variants of Petri nets.Good examples are John S. Gourlay, William C. Rounds, and Richard Statman[GRS79] and Kurt Jensen [Jen80], which develop previous work by DanielBrand [Bra78] and Y.S. Kwong [Kwo77]. Gourlay, Rounds, and Statman’shomomorphisms (called contraction) relate an abstract system with a more con-crete realisation of it – in other words, a specification with an implementation.Jensen’s proposal (called simulation), which is essentially the same as Kwong’sstrict reduction [Kwo77], is used to compare the expressiveness of differentclasses of Petri nets. The homomorphisms in both papers are stronger thantoday’s simulation or bisimulation; for instance they are functions rather thanrelations. Interestingly, in both cases there are forms of ‘reverse implications’on the correspondences between the transitions of related states. Thus thesehomomorphisms, but especially those in [GRS79], remind us of bisimulation,at least in the intuition behind it. In [GRS79] and [Jen80], as well as othersimilar works of that period, the homomorphisms are put forward because theyrepresent conditions sufficient to preserve certain important properties (such asChurch–Rosser and deadlock freedom). In contrast with Milner, little emphasis

Page 29: advanced topics in biosimulation and coinduction

Origins of bisimulation and coinduction 13

is given to the proof technique based on local checks that they bear upon.For instance the definitions of the homomorphisms impose correspondence onsequences of actions from related states.

1.3.3 David Park

In 1980, Milner returns to Edinburgh after a six-month appointment at AarhusUniversity, and completes his first book on CCS. Towards the end of that year,David Park begins a sabbatical in Edinburgh, and stays at the top floor ofMilner’s house.

Park is one of the top experts in fixed-point theory at the time. He makesthe final step in the discovery of bisimulation precisely guided by fixed-pointtheory. Park notices that the inductive notion of equivalence that Milner is usingfor his CCS processes is based on a monotone functional over a complete lat-tice. And by adapting an example by Milner, he sees that Milner’s equivalence(�ω) is not a fixed point for the functional, and that therefore the functional isnot cocontinuous. He then defines bisimilarity as the greatest fixed point of thefunctional, and derives the bisimulation proof method from the theory of great-est fixed points. Further, Park knows that, to obtain the greatest fixed point ofthe functional in an inductive way, the ordinals and transfinite induction, ratherthen the naturals and standard induction, are needed [San12, theorem 2.8.8].Milner immediately and enthusiastically adopts Park’s proposal. Milner knewthat �ω is not invariant under transitions. Indeed he is not so much struck bythe difference between�ω and bisimilarity as behavioural equivalences, as theprocesses exhibiting such differences can be considered rather artificial. Whatexcites him is the coinductive proof technique for bisimilarity. Both bisimi-larity and �ω are rooted in the idea of locality, but the coinductive methodof bisimilarity further facilitates proofs. In the years to come Milner makesbisimulation popular and the cornerstone of the theory of CCS [Mil89].

In computer science, the standard reference for bisimulation and the bisim-ulation proof method is Park’s paper ‘Concurrency on automata and infinitesequences’ [Par81a] (one of the most quoted papers in concurrency). However,Park’s discovery is only partially reported in [Par81a], whose main topic isa different one, namely omega-regular languages (extensions of regular lan-guages containing also infinite sequences) and operators for fair concurrency.Bisimulation appears at the end, as a secondary contribution, as a proof tech-nique for trace equivalence on automata. Bisimulation is first given on finiteautomata, but only as a way of introducing the concept on the Buchi-likeautomata investigated in the paper. Here, bisimulation has additional clausesthat make it non-transitive and different from the definition of bisimulation

Page 30: advanced topics in biosimulation and coinduction

14 Davide Sangiorgi

we know today. Further, bisimilarity and the coinduction proof method are notmentioned in the paper.

Indeed, Park never writes a paper to report on his findings about bisimulation.It is possible that this does not appear to him a contribution important enoughto warrant a paper: he considers bisimulation a variant of the earlier notion ofsimulation by Milner [Mil70, Mil71b]; and it is not in Park’s style to write manypapers. A good account of Park’s discovery of bisimulation and bisimilarity arethe summary and the slides of his talk at the 1981 Workshop on the Semanticsof Programming Languages [Par81b].

1.3.4 Discussion

In computer science, the move from homomorphism to bisimulation follows asomewhat opposite path with respect to modal logic: first homomorphisms aremade relational, then they are made symmetric, by adding a reverse implication.

It remains puzzling why bisimulation has been discovered so late in computerscience. For instance, in the 1960s weak homomorphism is well-known inautomata theory and, as discussed in Section 1.3.1, this notion is not that farfrom simulation. Another emblematic example, again from automata theory,is given by the algorithm for minimisation of deterministic automata, alreadyknown in the 1950s [Huf54, Moo56] (also related to this is the Myhill–Nerodetheorem [Ner58]). The aim of the algorithm is to find an automaton equivalentto a given one but minimal in the number of states. The algorithm proceeds byprogressively constructing a relation S with all pairs of non-equivalent states. Itroughly goes as follows. First step (a) below is applied, to initialise S; then step(b), where new pairs are added to S, is iterated until a fixed point is reached,i.e. no further pairs can be added:

(a) For all states P,Q, if P final and Q is not, or vice versa, then P S Q.(b) For all states P,Q such that :(P S Q): if there is a such that Ta(P ) S

Ta(Q) then P S Q.

The final relation gives all pairs of non-equivalent states. Then its complement,say S , gives the equivalent states. In the minimal automaton, the states in thesame equivalence class for S are collapsed into a single state.

The algorithm strongly reminds us of the partition refinement algorithms forcomputing bisimilarity and for minimisation modulo bisimilarity, discussed in[AIS12]. Indeed, the complement relation S that one wants to find has a naturalcoinductive definition, as a form of bisimilarity, namely the largest relation Rsuch that

Page 31: advanced topics in biosimulation and coinduction

Origins of bisimulation and coinduction 15

(1) if P R Q then either both P and Q are final or neither is;(2) for each a, if P R Q then Ta(P ) R Ta(Q).

Further, any relation R that satisfies the conditions (1) and (2) – that is, anybisimulation – only relates pairs of equivalent states and can therefore be usedto determine equivalence of specific states.

The above definitions and algorithm are for deterministic automata. Bisim-ulation would have been interesting also on non-deterministic automata.Although on such automata bisimilarity does not coincide with trace equiv-alence – the standard equality on automata – at least bisimilarity implies traceequivalence and the algorithms for bisimilarity have a better complexity (P-complete, rather than PSPACE-complete; see [AIS12]).

Lumpability in probability theory An old concept in probability theory thattoday may be viewed as somehow reminiscent of bisimulation is Kemeny andSnell’s lumpability [KS60]. A lumping equivalence is a partition of the states ofa continuous-time Markov chain. The partition must satisfy certain conditionson probabilities guaranteeing that related states of the partition can be collapsed(i.e. ‘lumped’) into a single state. These conditions, having to do with sumsof probabilities, are rather different from the standard one of bisimulation.(Kemeny and Snell’s lumpability roughly corresponds to what today is calledbisimulation for continuous-time Markov chains in the special case where thereis only one label for transitions.)

The first coinductive definition of behavioural equivalence, as a form ofbisimilarity, that takes probabilities into account appears much later, put for-ward by Larsen and Skou [LS91]. This paper is the initiator of a vast body ofwork on coinductive methods for probabilistic systems in computer science.Larsen and Skou were not influenced by lumpability. The link with lumpabilitywas in fact noticed much later [Buc94].

In conclusion: in retrospect we can see that Kemeny and Snell’s lumpabilitycorresponds to a very special form of bisimulation (continuous-time Markovchains, only one label). However, Kemeny and Snell’s lumpability has notcontributed to the discovery of coinductive concepts such as bisimulation andbisimilarity.

1.4 Set theory

In mathematics, bisimulation and concepts similar to bisimulation are formu-lated in the study of properties of extensionality of models. Extensionalityguarantees that equal objects cannot be distinguished within the given model.

Page 32: advanced topics in biosimulation and coinduction

16 Davide Sangiorgi

When the structure of the objects, or the way in which the objects are supposedto be used, are non-trivial, the ‘correct’ notion of equality may be non-obvious.This is certainly the case for non-well-founded sets, as they are objects withan infinite depth, and indeed most of the developments in set theory towardsbisimulation are made in a line of work on the foundations of theories of non-well-founded sets. Bisimulation is derived from the notion of isomorphism (andhomomorphism), intuitively with the objective of obtaining relations coarserthan isomorphism but still with the guarantee that related sets have ‘the same’internal structure.

Bisimulation is first introduced by Forti and Honsell and, independently, byHinnion, around the same time (the beginning of the 1980s). It is recognisedand becomes important with the work of Aczel and Barwise. Some earlierconstructions, however, have a clear bisimulation flavour, notably Mirimanoff’sisomorphism at the beginning of the twentieth century.

1.4.1 Non-well-founded sets

Non-well-founded sets are, intuitively, sets that are allowed to contain them-selves. As such they violate the axiom of foundation, according to which themembership relation on sets does not give rise to infinite descending sequences

. . . An 2 An�1 2 . . . 2 A1 2 A0 .

For instance, a set � which satisfies the equation � D f�g is circular andas such non-well-founded. A set can also be non-well-founded without beingcircular; this can happen if there is an infinite membership chain through asequence of sets all different from each other.

If the axiom of foundation is used, the sets are well-founded. On well-founded sets the notion of equality is expressed by Zermelo’s extensionalityaxiom: two sets are equal if they have exactly the same elements. In otherwords, a set is precisely determined by its elements. This is very intuitive andnaturally allows us to reason on equality proceeding by (transfinite) inductionon the membership relation. For instance, we can thus establish that the relationof equality is unique. Non-well-founded sets, by contrast, may be infinite indepth, and therefore inductive arguments may not be applicable. For instance,consider the sets A and B defined via the equations A D fBg and B D fAg.If we try to establish that they are equal via the extensionality axiom we endup with a tautology (‘A and B are equal iff A and B are equal’) that takes usnowhere.

Different formulations of equality on non-well-founded sets appear duringthe twentieth century, together with proposals for axioms of anti-foundation.

Page 33: advanced topics in biosimulation and coinduction

Origins of bisimulation and coinduction 17

1.4.2 The stratified approach to set theory

The first axiomatisation of set theory by Ernst Zermelo in 1908 [Zer08] hasseven axioms, among which is the axiom of extensionality. However, it has noaxioms of foundation, and the possibility of having circular sets is in fact leftopen (page 263, op. cit.).

In the same years, Bertrand Russell strongly rejects all definitions thatcan involve forms of circularity (‘whatever involves all of a collection mustnot be one of the collection’, in one of Russell’s formulations [Rus08]). Hefavours a theory of types that only allows stratified constructions, where objectsare hereditarily constructed, starting from atoms or primitive objects at thebottom and then iteratively moving upward through the composite objects. Apreliminary version of the theory is announced by Russell already in 1903[Rus03, Appendix B]; more complete and mature treatments appear in 1908[Rus08] and later, in 1910, 1912, 1913, in the monumental work with AlfredNorth Whitehead [RW13].

Russell’s approach is followed by the main logicians of the first half ofthe twentieth century, including Zermelo himself, Abraham Fraenkel, ThoralfSkolem, Johann von Neumann, Kurt Godel, Paul Bernays. Their major achieve-ments include the formulation of the axiom of foundation, and the proofs of itsconsistency and independence. An axiom of foundation is deemed necessaryso as to have a ‘canonical’ universe of sets. Without foundation, different inter-pretations are possible, some including circular sets. This possibility is clearlypointed out as a weakness by Skolem [Sko23], and by Fraenkel [Fra22], wherecircular sets (precisely, Mirimanoff’s ‘ensembles extraordinaires’, see below)are labelled as ‘superfluous’. It will be formally proved by Bernays only in1954 [Ber54] that the existence of circular sets does not lead to contradictionsin the Zermelo–Fraenkel system without the axiom of foundation.

Remark 1.4.1 The axiom of foundation forces the universe of sets in which theother axioms (the basic axioms) should be interpreted to be the smallest possibleone; i.e. to be an ‘inductive universe’. By contrast, axioms of anti-foundationlead to the largest possible universe, i.e. a ‘coinductive universe’. Indeed,referring to the algebraic/coalgebraic interpretation of induction/coinduction,the foundation axiom can be expressed as a requirement that the universe ofsets should be an initial algebra for a certain powerset functor, whereas anti-foundation (as in Forti and Honsell, Aczel, and Barwise) can be expressed as arequirement that the universe should be a final coalgebra for the same functor.The former is an inductive definition of the universe, whereas the latter is acoinductive one. �

Page 34: advanced topics in biosimulation and coinduction

18 Davide Sangiorgi

The motivations for formalising and studying the stratified approach advo-cated by Russell were strong at the beginning of the twentieth century. Thediscovery of paradoxes such as Burali-Forti’s and Russell’s had made the settheory studied by Cantor and Frege shaky, and circularity – with no distinc-tion of cases – was generally perceived as the culprit for these as well as forparadoxes known in other fields. Further, the stratified approach was in linewith common sense and perception (very important in Russell’s conception ofscience), which denies the existence of circular objects.

The stratified approach remains indeed the only approach considered (inlogics and set theory), up to roughly the 1960s, with the exception of Mirimanoffand Finsler that we discuss below. The stratified approach has also inspired –both in the name and in the method – type theory in computer science, notablyin the works of Church, Scott, and Martin-Lof. It will be first disputed byJean-Yves Girard and John Reynolds, in the 1970s, with the introduction ofimpredicative polymorphism.

1.4.3 Non-well-founded sets and extensionality

Dimitry Mirimanoff first introduces in 1917 the distinction between well-founded and non-well-founded sets, the ‘ensembles ordinaires et extraordi-naires’ in Mirimanoff’s words [Mir17a] (on the same topic are also the twosuccessive papers [Mir17b] and [Mir20]). Mirimanoff realises that Zermelo’sset theory admitted sophisticated patterns of non-well-foundedness, beyondthe ‘simple’ circularities given by self-membership as in the purely reflex-ive set � D f�g. In [Mir17b], Mirimanoff also tries to give an intuition forthe non-well-founded sets; he recalls the cover of a children’s book he hadseen, with the image of two children looking at the cover of a book, which inturn had the image of two children, in a supposedly infinite chain of nestedimages.

Mirimanoff defines an interesting notion of isomorphism between sets, thatwe report in Section 1.4.8. Mirimanoff does not however go as far as propos-ing an axiom of extensionality more powerful than Zermelo’s. This is firstattempted by Paul Finsler, in 1926 [Fin26]. Finsler presents three axioms fora universe of sets equipped with the membership relation. The second one isan extensionality axiom, stipulating that isomorphic sets are equal. Finsler’snotion of isomorphism between two sets X and Y – which is different fromMirimanoff’s – is, approximately, a bijection between the transitive closures ofX and Y (more precisely, the transitive closures of the unit sets fXg and fY g;the precise meaning of isomorphism for Finsler can actually be debated, for it

Page 35: advanced topics in biosimulation and coinduction

Origins of bisimulation and coinduction 19

appears in different forms in his works).1 Finsler uses graph theory to explainthe properties and structure of sets, something that later Aczel will make morerigorous and at the heart of his theory of non-well-founded sets.

Mirimanoff’s and Finsler’s works are remarkable: they go against the stan-dard approach to set theory at the time; and against common sense according towhich objects are stratified and circular sets are ‘paradoxical’. For Mirimanoffand Finsler, not all circular definitions are dangerous, and the challenge is toisolate the ‘good’ ones.

The attempts by Mirimanoff and Finsler remain little known. We have towait till around the 1960s with, e.g. Specker [Spe57] and Scott [Sco60], to seea timid revival of interest in non-well-founded structures, and the late 1960s,and then the 1970s and 1980s, for a wider revival, with Boffa (with a numberof papers, including [Bof68, Bof69, Bof72]) and many others. New proposalsfor anti-foundation axioms are thus made, and with them, new interpretationsof extensionality on non-well-founded sets, notably from Scott [Sco60], andForti and Honsell [FH83]. Forti and Honsell obtain bisimulation; their work isthen developed by Aczel and Barwise. We discuss the contributions of Fortiand Honsell, Aczel, and Barwise’s. On the history of non-well-founded sets,the reader may also consult Aczel [Acz88, appendix A].

1.4.4 Marco Forti and Furio Honsell

Marco Forti’s and Furio Honsell’s work on non-well-founded sets [Hon81,FH83] (and various papers thereafter) is spurred by Ennio De Giorgi, a well-known analyst who, in the 1970s and 1980s, organises regular weekly meetingsat the Scuola Normale Superiore di Pisa, on logics and foundations of Mathe-matics. In some of these meetings, De Giorgi proposes constructions that couldyield infinite descending chains of membership on sets, that Forti and Honsellthen go on to elaborate and develop.

The most important paper is [FH83]. Here Forti and Honsell study a numberof anti-foundation axioms, derived from a ‘Free Construction Principle’ pro-posed by De Giorgi. They include axioms that already appeared in the literature(such as Scott’s [Sco60]), and a new one, called X1, that gives the strongestextensionality properties, in the sense that it equates more sets. (We recall X1 inthe next section, together with Aczel’s version of it.) The main objective of the

1 A set A is transitive if each set B that is an element of A has the property that all the elementsof B also belong to A; that is, all composite elements of A are also subsets of A. The transitiveclosure of a set C is the smallest transitive set that contains C. Given C, its transitive closure isintuitively obtained by copying at the top level all sets that are elements of C, and thenrecursively continuing so with the new top-level sets.

Page 36: advanced topics in biosimulation and coinduction

20 Davide Sangiorgi

paper is to compare the axioms, and define models that prove their consistency.Bisimulations and similar relations are used in the constructions to guaranteethe extensionality of the models.

Forti and Honsell use, in their formulation of bisimulation, functionsf : A 7! ℘(A) from a set A to its powerset ℘(A). Bisimulations are calledf -conservative relations and are defined along the lines of the fixed-pointinterpretation of bisimulation in [San12, section 2.10]. We can make a state-transition interpretation of their definitions, for a comparison with today’sdefinition. If f is the function from A to ℘(A) in question, then we can think ofA as the set of the possible states, and of f itself as the (unlabelled) transitionfunction; so that f (x) indicates the set of possible ‘next states’ for x. Forti andHonsell define the fixed-point behaviour of f on the relations on A, via thefunctional F defined as follows.2 If R is a relation on A, and P,Q 2 A, then(P,Q) 2 F (R) if:

� for all P 0 2 f (P ) there is Q0 2 f (Q) such that P 0 R Q0;� the converse, i.e. for all Q0 2 f (Q) there is P 0 2 f (P ) such that P 0 R Q0.

A reflexive and symmetric relation R is f -conservative if R � F (R); it isf -admissible if it is a fixed point of F , i.e. R D F (R). The authors note thatF is monotone over a complete lattice, hence it has a greatest fixed point (thelargest f -admissible relation). They also prove that such a greatest fixed pointcan be obtained as the union over all f -conservative relations (the coinductionproof principle), and also, inductively, as the limit of a sequence of decreasingrelations over the ordinals that starts with the universal relation A � A (akin tothe characterisation in [San12, theorem 2.8.8]). The main difference between f -conservative relations and today’s bisimulations is that the former are requiredto be reflexive and symmetric.

However, while the bisimulation proof method is introduced, as derivedfrom the theory of fixed points, it remains rather hidden in Forti and Honsell’sworks, whose main goal is to prove the consistency of anti-foundation axioms.For this the main technique uses the f -admissible relations.

1.4.5 Peter Aczel

In mathematics, bisimulation and non-well-founded sets are made popular byPeter Aczel, notably with his book [Acz88]. Aczel is looking for mathematicalfoundations of processes, prompted by the work of Milner on CCS and his wayof equating processes with an infinite behaviour via a bisimulation quotient.Aczel reformulates Forti and Honsell’s anti-foundation axiom X1. In Forti and

2 We use a notation different from Forti and Honsell here.

Page 37: advanced topics in biosimulation and coinduction

Origins of bisimulation and coinduction 21

2

�����

����

���������

0 1��

c

���������

��a b

��

Fig. 1.1. Sets as graphs.

Honsell [FH83], the axiom says that from every relational structure there isa unique homomorphism onto a transitive set (a relational structure is a setequipped with a relation on its elements; a set A is transitive if each set B thatis an element of A has the property that all the elements of B also belong to A;that is, all composite elements of A are also subsets of A). Aczel calls the axiomAFA and expresses it with the help of graph theory, in terms of graphs whosenodes are decorated with sets. For this, sets are thought of as (pointed) graphs,where the nodes represent sets, the edges represent the converse membershiprelation (e.g. an edge from a node x to a node y indicates that the set representedby y is a member of the set represented by x), and the root of the graph indicatesthe starting point, that is, the node that represents the set under consideration.For instance, the sets f;, f;gg and D D f;, fDgg naturally correspond to thegraphs of Figure 1.1 (where for convenience nodes are named) with nodes 2 andc being the roots. The graphs for the well-founded sets are those without infinitepaths or cycles, such as the graph on the left in Figure 1.1. AFA essentiallystates that each graph represents a unique set. This is formalised via the notionof decoration. A decoration for a graph is an assignment of sets to nodes thatrespects the structure of the edges; that is, the set assigned to a node is equalto the set of the sets assigned to the children of the node. For instance, thedecoration for the graph on the left of Figure 1.1 assigns ; to node 0, f;g tonode 1, and f;, f;gg to node 2, whereas that for the graph on the right assigns; to a, fDg to b, and f;, fDgg to c. Axiom AFA stipulates that every graphhas a unique decoration. (In Aczel, the graph plays the role of the relationalstructure in Forti and Honsell, and the decoration the role of the homomorphisminto a transitive set.) In this, there are two important facts: the existence of thedecoration, and its uniqueness. The former tells us that the non-well-foundedsets we need do exist. The latter tell us what is equality for them. Thus two setsare equal if they can be assigned to the same node of a graph. For instance thesets A and B in Section 1.4.1 and � in Section 1.4.3 are equal because the graph

����

has a decoration in which both nodes receive �, and another decoration inwhich the node on the left receives A and that on the right B. Bisimulation

Page 38: advanced topics in biosimulation and coinduction

22 Davide Sangiorgi

comes out when one tries to extract the meaning of equality. A bisimulationrelates sets A and B such that

� for all A1 2 A there is B1 2 B with A1 and B1 related; and the converse, forthe elements of B1.

Two sets are equal precisely if there is a bisimulation relating them. Thebisimulation proof method can then be used to prove equalities between sets,for instance the equality between the sets A and B above. This equality amongsets is the most generous, or coarsest, equality that is compatible with themembership structure of sets: two sets are different only if there they presentsome genuine, observable, structural difference.

Exercise 1.4.2 AFA postulates that graphs have unique decoration. Showthat the converse is false, i.e. there are (non-well-founded) sets that decoratedifferent graphs. �

Aczel formulates AFA towards the end of 1983; he does not publish it imme-diately having then discovered the earlier work of Forti and Honsell and theequivalence between AFA and X1. Instead, he goes on developing the theory ofnon-well-founded sets, mostly through a series of lectures in Stanford betweenJanuary and March 1985, which leads to the book [Acz88]. Aczel shows howto use the bisimulation proof method to prove equalities between non-well-founded sets, and develops a theory of coinduction that sets the basis for thecoalgebraic approach to semantics (final semantics).

Up to Aczel’s book [Acz88], all the works on non-well-founded sets hadremained outside the mainstream. This changes with Aczel, for two mainreasons: the elegant theory that he develops, and the concrete motivations forstudying non-well-founded sets that he brings up.

Something that influences the developments of non-well-founded sets, andthat is manifest in Aczel’s work, is Mostowski’s collapse lemma (proved prob-ably sometime in the 1940s and today recognised as fundamental in the studyof models of set theory). The original statement of the lemma talks aboutwell-founded relations; roughly it says that given any such relation there is aunique set that faithfully represents the relation in its membership structure.Aczel reformulates the collapse on graphs. It becomes the assertion that everywell-founded graph has a unique decoration. Axiom AFA is then obtained byremoving the well-foundedness hypothesis (of course now, on the non-well-founded sets, it is an axiom, whereas Mostowski’s collapse on the well-foundedsets is a lemma). The collapse is also fundamental for the formal representationof sets as graphs, as it allows us to conclude that we can associate a uniqueset to each pointed graph, via the decoration. When Finsler writes his 1926

Page 39: advanced topics in biosimulation and coinduction

Origins of bisimulation and coinduction 23

paper [Fin26], the collapse construction is not known and indeed Finsler’s useof graph theory remains informal.

Exercise 1.4.3 Using AFA, show that a graph has a decoration in which allnodes are mapped to � iff all nodes of the graphs have a child. �

1.4.6 Jon Barwise

Aczel’s original motivation for the study on non-well-founded sets is to provideset-theoretic models for CCS. Jon Barwise brings up other applications, notablythe study of paradoxes such as the liar paradox in philosophical logic and morebroadly the study of meaning in natural (i.e. human spoken) languages [BE87].

Further, Barwise develops a theory of non-well-founded sets that is not basedon the relationship between sets and graph theory as Aczel, but, instead, onsystems of equations. The axiom AFA becomes a requirement that appropriatesystems of equations have a unique solution. To understand this point considerthat, as the purely reflexive set � can be seen as the solution to the equationx D fxg, so all non-well-founded sets arise from systems of equations withvariables on the left-hand side, and well-founded sets possibly containing suchvariables on the right-hand side. In Aczel [Acz88] this is expressed as the‘solution lemma’. Barwise makes it the base assumption from which all thetheory of sets is derived. For more details, the reader may consult Barwise’sexcellent book with Lawrence Moss [BM96].

1.4.7 Extensionality quotients: Roland Hinnion and others

More or less at the same time as Forti and Honsell, and independently ofthem, bisimulation-like relations are used by Roland Hinnion [Hin80, Hin81](a related, but later, paper is also [Hin86]). Hinnion follows Mostowski’s col-lapse; Mostowski’s construction allows one to obtain, from a well-foundedrelational structure, a model of set theory in which Zermelo’s axiom of exten-sionality holds. Hinnion aims at generalising this to arbitrary (i.e. not nec-essarily well-founded) structures. Thus he defines forms of bisimulation onrelational structures, as usual the ‘transitions’ of the bisimulation game beingdictated by the relation on the structure. He considers two such forms. The finalequivalences (later [Hin86] called increasing) are the bisimulations that arealso equivalences. The contractions are the final equivalences whose quotienton the original structure satisfies the extensionality axiom. Roughly we canthink of contractions as bisimulation equivalences that are also congruences,

Page 40: advanced topics in biosimulation and coinduction

24 Davide Sangiorgi

in that they are preserved by the operators of the model, i.e. by the addition ofexternal structure.

Hinnion does not formulate axioms of anti-foundation. Thus while imposingthe AFA axiom makes equality the only possible bisimulation for any structure,Hinnion uses bisimulations to define new structures, via a quotient.

Although Hinnion points out that final equivalences and contractions form acomplete lattice, he does not put emphasis on the maximal ones. The equalitiesobtained via his quotients can indeed be finer than the equality that the AFAaxiom yields (which corresponds to the quotient with bisimilarity, the maximalbisimulation). Consequently, he also does not put emphasis on the coinductionproof principle associated to bisimulation.

Constructions similar to Hinnion’s, that is, uses of relations akin to bisimu-lation to obtain extensional quotient models, also appear in works by HarveyFriedman [Fri73] and Lev Gordeev [Gor82]. In this respect, however, the firstappearance of a bisimulation relation I have seen is in a work by Jon Barwise,Robin O. Gandy, and Yiannis N. Moschovakis [BGM71], and used in the mainresult about the characterisation of the structure of the next admissible set AC

over a given set A. (Admissible sets form a set theory weaker than Zermelo–Fraenkel’s in the principles of set existence; it was introduced in the mid-1960sby Saul Kripke and Richard Platek with the goal of generalising ordinary recur-sion theory on the integers to ordinals smaller than a given ‘well-behaved’ one.)A stronger version of the result is found in Moschovakis’s book [Mos74] (wherethe main result is theorem 9E.1, in chapter 9, and the bisimulation relation isused in the proof of lemma 9). As with most of the results we have men-tioned in set theory, so the Barwise–Gandy–Moschovakis theorem is inspiredby Mostowski’s collapse lemma. While the papers [BGM71, Fri73, Gor82]make use of specific bisimulation-like relations, they do not isolate or study theconcept.

1.4.8 Discussion

It may appear surprising that also in mathematics it takes so long for the notionof bisimulation to appear. This is partly explained by the limited attention tonon-well-founded structures up to the 1980s, as discussed in Section 1.4.2.

It is fair to say, however, that some of the very early constructions alreadyhad a definite bisimulation flavour. An enlightening example is Mirimanoff’spioneering work on non-well-founded sets. Mirimanoff [Mir17a] defines anotion of isomorphism for sets that have atoms (often called urelements), i.e.elements that cannot be decomposed and that are not the empty set. Two suchsets E and E0 are deemed isomorphic when the two conditions below hold:

Page 41: advanced topics in biosimulation and coinduction

Origins of bisimulation and coinduction 25

(1) The sets E and E0 are equivalent; that is, a perfect correspondence can beestablished between the elements of E and E0.

(2) Further, the above correspondence can be established in such a way thateach atom e in E corresponds to an atom e0 in E0 and conversely; and eachelement-set F of E corresponds to an element-set F 0 of E0 (an element-setof a set G is an element of G that is a set). The perfect correspondencebetween F and F 0 can then be established in such a way that each atom inF corresponds to an atom in F 0, and each element-set of F corresponds toan element-set of F 0; and so forth.

Although today we would give this definition in a different way, its meaning isclear. Mirimanoff’s isomorphism abstracts from the nature and identity of theatoms. His intention – clearly stated in [Mir17b] – is to relate sets with the sametree structure, as determined by the membership relation. (In other words, ifwe think of sets as trees, along the lines of the representation of sets as graphsmentioned in Section 1.4.5, then Mirimanoff’s isomorphism is essentially anisomorphism between such trees.)

Mirimanoff’s isomorphism is not far from the equality on sets given byFinsler’s and Scott’s anti-foundation axioms. These equalities too, indeed, arebased on notions of isomorphism. The peculiarity of Mirimanoff’s definition isthat it is built on the idea of equating potentially infinite objects by decomposing,or observing, them top-down, from a composite object to its constituents. Thisidea is also at the heart of the definition of bisimulation (where, for instance,decomposing a process is observing its transitions). The ‘perfect correspon-dence’ used by Mirimanoff is however a bijection between the components ofthe sets, rather than a relation, and as such the resulting notion of equality isfiner than bisimilarity. For instance, consider the purely reflexive set � and theset U D f�,Ug. It is easy to see that they are bisimilar. However they are notisomorphic for Mirimanoff as their trees, in Figure 1.2, are quite different. (Thetwo sets are also different under Finsler’s and Scott’s equalities; bisimilarity isindeed strictly coarser than Finsler’s and Scott’s equalities, see [Acz88].)

What really makes Mirimanoff’s isomorphism different from bisimulation isthat Mirimanoff fails to promote isomorphism to equality for sets. For instance,the sets A D fBg and B D fAg are isomorphic but not equal, hence the setfA,Bg has two elements and is not isomorphic to the set fAg or to the set fBg,which have only one element. To identify isomorphism and equality, the clauseof isomorphism, in establishing the ‘perfect correspondence’ between the ele-ments of two isomorphic sets, should take into account the collapse given byisomorphism itself. This can be easily obtained by weakening the requirementsof injectivity and surjectivity in the correspondences, for instance making the

Page 42: advanced topics in biosimulation and coinduction

26 Davide Sangiorgi

...

�����

����

���������

�����

����

���������

�����

����

����������

... �

......

...

Fig. 1.2. Tree unfolding of the sets � and U .

correspondences total relations – i.e. making them bisimulations. In conclu-sion, had Mirimanoff investigated the impact of isomorphism on extensionality,while retaining the spirit of his definition, he would have probably discoveredbisimulation.

However, Mirimanoff pays little attention to extensionality. His main inter-est, motivated by Burali–Forti and Russell’s paradoxes, is understanding whatare the conditions for the existence of a set of objects. And his main resultsare theorems asserting – using modern terminology – that certain classes arenot sets. In set theory, even more than in modal logic or computer science, themove from the ‘functional’ concepts of homomorphism and isomorphism tothe ‘relational’ concept of bisimulation will take time.

1.5 The introduction of fixed points in computer science

Bisimulation and the bisimulation proof method, as coinductive concepts, areintimately related to fixed points. We have seen the characterisation of bisim-ulation via greatest fixed points in [San12, section 2.10]. We therefore alsoexamine coinduction and fixed points. We do not attempt, however, to trace thegeneral history of fixed-point theory – in mathematics this is a story stretch-ing far back in time. Instead, we concentrate on computer science, and recallsome papers that well witness the introduction of coinduction and fixed-pointtheory for the design and analysis of programming languages. The Fixed-Point

Page 43: advanced topics in biosimulation and coinduction

Origins of bisimulation and coinduction 27

Theorem 2.3.21 in [San12], about the existence of a least and greatest fixedpoint for a monotone function on a complete lattice, or variations of this suchas Theorem 2.8.5 in the same volume, are the starting point for all the workswe mention.

The earliest uses of fixed points in computer science, in the form of least fixedpoints, can be found in recursive function theory, see for instance Rogers’s book[Rog67] and references therein, and formal language theory, as in the work ofArden [Ard60] and Ginsburg and Rice [GR62]. However, distinguishing com-puter science from recursive function theory, the importance of fixed points incomputer science really comes up only at the end of the 1960s, with four inde-pendent papers, roughly at the same time, by Dana Scott and Jaco de Bakker[SdB69], Hans Bekic [Bek69], David Park [Par69], and Antoni Muzurkiewicz[Maz71] (however [Maz71] does not make explicit reference to fixed-pointtheory). Although [Maz71] is published in 1971, it is already made available,as a working paper, in December 1969 to the IFIP Working Group 2.2, whosemembers included some of the most influential researchers on programminglanguage concepts at that time; this paper also had an impact on the discoveryof continuations in denotational semantics, see [Rey93]. It might sound surpris-ing that [SdB69] and [Bek69] should be considered ‘independent’, given thatboth appear as manuscripts from the same place, the Vienna IBM Laboratory.The reason is that Bekic’s work is mainly carried out during a one-year visit(November 1968–November 1969) to Queen Mary College, London, whereBekic stays in Peter Landin’s group (indeed Landin has a strong influence on[Bek69]). Thus when Scott and de Bakker’s work is presented at the ViennaIBM Laboratory in August 1969, Bekic – who is a member of the Laboratory –is still in London. The first time when the two works can be discussed andcompared is the IFIP Working Group 2.2 meeting in Colchester in September1969.

The above four papers bring out the importance of least fixed points forthe semantics of programs, the relevance of lattice theory and the Fixed-PointTheorem, and propose various rules for reasoning about least fixed points. Pro-grams take the form of recursive function definitions or of flowcharts. Further,[SdB69] paves the way for the fundamental work on denotational semantics byScott and Strachey in Oxford in the 1970s, where least fixed points, and conti-nuity of functions, are essential. Influential on the above four papers are earlierworks on program correctness and on uses of the ‘paradoxical combinator’ Y

of the λ-calculus, notably papers by Landin such as [Lan64], by McCarthy suchas [McC61, McC63], and by Floyd such as [Flo67]. For instance, McCarthy[McC61, McC63] proposes the first method for proving properties of recur-sive programs, called recursion induction; variants and stronger versions of the

Page 44: advanced topics in biosimulation and coinduction

28 Davide Sangiorgi

method are formulated in [SdB69], [Bek69], and [Par69]. Also, the fixed-pointproperties of the Y combinator of the λ-calculus had been known for a longtime (used for instance by Curry, Feys, Landin, and Strachey), but the precisemathematical meaning of Y as fixed point remains unclear until Scott worksout his theory of reflexive domains, at the end of 1969 [Sco69b, Sco69a]; see[Par70]. (Another relevant paper is [Sco69c], in which fixed points appear butwhich precedes the discovery of reflexive domains. We may also recall JamesH. Morris, who earlier [Mor68] had proved a minimal fixed-point property forthe Y combinator; in the same document, Morris had considered the relation-ship between least fixed points and functions computed by first-order recursivedefinitions of programs.)

During the 1970s, further fixed-point techniques and rules are put forward.A number of results on fixed points and induction rules, and the basic theory ofcontinuous functions, are due to Scott, e.g. [Sco72b, Sco72a, Sco76]. On usesof least fixed points in semantics and in techniques for program correctness,we should also mention the work of de Bakker and his colleagues in TheNetherlands, e.g. [BR73, Bak75, Bak71]; the Polish school, with Mazurkiewicz,Blikle, and colleagues, e.g. [Maz71, Maz73, Bli77]; and the work of UgoMontanari and colleagues in Pisa, such as [GM76] that contains notions ofobservations and equivalence of representations in abstract data types thattoday we recognise as related to fixed points via the concept of finality. Otherreferences to the early works on fixed points can be found in Zohar Manna’stextbook [Man74].

The above works all deal with least fixed points. Greatest fixed points, andrelated coinductive techniques, begin to appear as well in the 1970s. It is hardto tell what is the first appearance. One reason for this is that the rules forgreatest fixed points are not surprising, being the dual of rules for least fixedpoints that had already been studied. I would think however that the first tomake explicit and non-trivial use of greatest fixed points is David Park, who,throughout the 1970s, works intensively on fairness issues for programs thatmay contain constructs for parallelism and that may not terminate. The fixed-point techniques he uses are rather sophisticated, possibly involving alternationof least and greatest fixed points. Park discusses his findings in several publicpresentations. A late overview paper is [Par79]; we already pointed out inSection 1.3.3 that Park did not publish much.

Other early interesting uses of greatest fixed points are made by the follow-ing authors. Mazurkiewicz [Maz73] studies properties of computations fromprocesses, where processes are modelled via forms of LTSs; the propertiesstudied include divergence and termination. The way in which Mazurkiewiczdefines divergent states (i.e. the states from which a computation may not

Page 45: advanced topics in biosimulation and coinduction

Origins of bisimulation and coinduction 29

terminate) and the technique proposed to prove divergence of states are coin-ductive, though – as in his earlier paper [Maz71] – there is no explicit referenceto fixed-point theory.

Edmund Clarke [Cla77] shows that the correctness proofs for Floyd–Hoareaxiom systems – deductive systems for partial correctness based on invarianceassertions intensively investigated in the 1970s – could be elegantly formalisedby means of fixed-point theory, whereby: program invariants become greatestfixed points; completeness of a system becomes the proof of the existenceof a fixed point for an appropriate functional; and soundness is derived fromthe maximality of such a fixed point. Thus soundness is a coinductive proof.Willem-Paul de Roever [dR77] strongly advocates the coinduction principleas a proof technique (he calls it ‘greatest fixed-point induction’). De Roeveruses the technique to reason about divergence, bringing up the duality betweenthis technique and inductive techniques that had been proposed previously toreason on programs.

Coinduction and greatest fixed points are implicit in a number of earlierworks in the 1960s and 1970s. Important examples, with a wide literature, arethe works on unification, for instance on structural equivalence of graphs, andthe works on invariance properties of programs. Fixed points are also central instream processing systems (including data flow systems). The introduction ofstreams in computer science is usually attributed to Peter Landin, in the early1960s (see [Lan65a, Lan65b] where Landin discusses the semantics of Algol60 as a mapping into a language based on the λ-calculus and Landin’s SECDmachine [Lan64], and historical remarks in [Bur75]). However, fixed pointsare explicitly used to describe stream computations only after Scott’s theory ofdomain, with the work of Gilles Kahn [Kah74].

1.6 Fixed-point theorems

We conclude with a few remarks on the main fixed-point theorems in [San12].The Fixed-Point Theorem 2.3.21 is usually called the ‘Knaster–Tarski fixed-point theorem’. The result was actually obtained by Tarski, who, in a footnote to[Tar55] (footnote 2, page 286), where the result appears as theorem 1, explainsits genesis:

In 1927 Knaster and the author [i.e. Tarski] proved a set-theoretical fixed pointtheorem by which every function on and to the family of all subsets of a set, whichis increasing under set-theoretical inclusion has at least one fixed point; see[Kna28] where some applications of this result in set theory [...] and topology arealso mentioned. A generalisation of this result is the lattice-theoretical fixed point

Page 46: advanced topics in biosimulation and coinduction

30 Davide Sangiorgi

theorem stated above as Theorem 1. The theorem in its present form and its variousapplications and extensions were found by the author in 1939 and discussed it in afew public lectures in 1939–1942. (See, for example, a reference in the AmericanMathematical Monthly 49(1942), 402.) An essential part of Theorem 1 wasincluded in [Bir48, p. 54]; however the author was informed by Professor GarretBirkhoff that a proper historical reference to this result was omitted by mistake.

Tarski first properly publishes the theorem in 1955 [Tar55], together with afew related results, proofs, and applications to boolean algebras and topology.He had anticipated a summary of [Tar55] in 1949, as [Tar49]. Credit for thetheorem is also given to Bronislaw Knaster because of the following result in[Kna28]:

If F is monotone function over sets such thatthere is a set Pr with F (Pr) � Pr thenthere is a subset Q of Pr such that F (Q) D Q.

(�)

While the fixed-point theorem describes the structure of the fixed points for afunction, the result (�) only asserts the existence of at least one fixed point.Moreover the fixed-point theorem is on arbitrary lattices, whereas we can thinkof (�) as being on the special lattices given by the powerset construction.[Kna28] is actually a very short note – about one page – in which the lemmais used to derive, as a special case, a theorem on monotone functions over sets.The note itself confirms that the results presented had been obtained by Knastertogether with Tarski.

It would not be so surprising if the fixed-point theorem had been obtainedaround the same period also by Stephen C. Kleene or Leonid V. Kantorovich,although the writings from these authors that we have today only deal withconstructive proofs of the existence of least and greatest fixed points along thelines of the Continuity/Cocontinuity Theorem 2.8.5 in [San12] (see below).(Leonid Vitalyevich Kantorovich [1912–1986] was a Russian mathematicianwho obtained the Nobel Prize for Economics in 1975 for his work on theallocation and optimisation of resources, in which he pioneers the technique oflinear programming.)

In computer science, the Continuity/Cocontinuity Theorem is often calledthe ‘Kleene fixed-point theorem’, with reference to Kleene’s first recursiontheorem [Kle52], and often presented on pointed complete partial orders andfor least fixed points. The first recursion theorem is obtained by Kleene aroundthe end of the 1930s, as reported in [Kle52, Kle70]. Around that time, or any-how before the 1950s, the Continuity/Cocontinuity Theorem is independentlyknown to other authors, first of all Tarski and Kantorovich (for instance theoremI in [Kan39] is similar to the Continuity/Cocontinuity Theorem), but possibly

Page 47: advanced topics in biosimulation and coinduction

Origins of bisimulation and coinduction 31

others – see also the discussion in [CC79, page 56]. It is indeed unclear whoshould be credited for the theorem. Lassez, Nguyen, and Sonenberg [LNS82]consider the origins of this theorem (as well as of the other fixed-point theo-rems) and conclude that it should be regarded as a ‘folk theorem’.

The ordinal characterisation in [San12, theorem 2.8.8] is from Hitchcockand Park [HP73]. Similar versions are also given by Devide [Dev63], Pasini[Pas74], Cadiou [Cad72], Cousot and Cousot [CC79]. A related theorem alsoappears in Bourbaki [Bou50].

Bibliography

[Acz88] P. Aczel. Non-Well-Founded Sets. CSLI Lecture Notes, no. 14, 1988.[AIS12] L. Aceto, A. Ingolfsdottir, and J. Srba. The algorithmics of bisimilarity.

Chapter 3 of this volume.[Ard60] D.N. Arden. Delayed logic and finite state machines. In Theory of Computing

Machine Design, pages 1–35. University of Michigan Press, 1960.[Bak71] J.W. de Bakker. Recursive Procedures. Mathematical Centre Tracts 24, Math-

ematisch Centrum, Amsterdam, 1971.[Bak75] J.W. de Bakker. The fixed-point approach in semantics: theory and appli-

cations. In J.W. de Bakker, editor, Foundations of Computer Science, pages3–53. Mathematical Centre Tracts 63, Mathematisch Centrum, Amsterdam,1975.

[BE87] J. Barwise and J. Etchemendy. The Liar: an Essay in Truth and Circularity.Oxford University Press, 1987.

[Bek69] H. Bekic. Definable operations in general algebras and the theory of automataand flowcharts. Unpublished Manuscript, IBM Lab. Vienna 1969. Alsoappeared in [Jon84].

[Ben76] J. van Benthem. Modal correspondence theory. PhD thesis, MathematishInstituut & Instituut voor Grondslagenonderzoek, University of Amsterdam,1976.

[Ben83] J. van Benthem. Modal Logic and Classical Logic. Bibliopolis, 1983.[Ben84] J. van Benthem. Correspondence theory. In D.M. Gabbay and F. Guenthner,

editors, Handbook of Philosophical Logic, volume 2, pages 167–247. Reidel,1984.

[Ber54] P. Bernays. A system of axiomatic set theory–Part VII. Journal of SymbolicLogic, 19(2):81–96, 1954.

[BGM71] J. Barwise, R.O. Gandy, and Y.N. Moschovakis. The next admissible set.Journal of Symbolic Logic, 36:108–120, 1971.

[Bir48] G. Birkhoff. Lattice Theory (Revised Edition). Volume 25 of American Math-ematical Society Colloquium Publications. American Mathematical Society,1948.

[Bli77] A. Blikle. A comparative review of some program verification methods.In Jozef Gruska, editor, 6th Symposium on Mathematical Foundations of

Page 48: advanced topics in biosimulation and coinduction

32 Davide Sangiorgi

Computer Science (MFCS’77), volume 53 of Lecture Notes in ComputerScience, pages 17–33. Springer, 1977.

[BM96] J. Barwise and L. Moss. Vicious Circles: On the Mathematics of Non-Wellfounded Phenomena. CSLI (Center for the Study of Language andInformation), 1996.

[Bof68] M. Boffa. Les ensembles extraordinaires. Bulletin de la SocieteMathematique de Belgique, XX:3–15, 1968.

[Bof69] M. Boffa. Sur la theorie des ensembles sans axiome de fondement. Bulletinde la Societe Mathematique de Belgique, XXXI:16–56, 1969.

[Bof72] M. Boffa. Forcing et negation de l’axiome de fondement. Academie Royalede Belgique, Memoires de la Classe des Sciences, 2e serie, XL(7):1–53,1972.

[Bou50] N. Bourbaki. Sur le theoreme de Zorn. Archiv der Mathematik, 2:434–437,1950.

[BR73] J.W. de Bakker and W.P. de Roever. A calculus for recursive programschemes. In M. Nivat, editor, Proceedings of the IRIA Symposium onAutomata, Languages and Programming, Paris, France, July, 1972, pages167–196. North-Holland, 1973.

[Bra78] D. Brand. Algebraic simulation between parallel programs. Research ReportRC 7206, Yorktown Heights, NY, 39 pp., June 1978.

[BRV01] P. Blackburn, M. de Rijke, and Y. Venema. Modal Logic. Cambridge Uni-versity Press, 2001.

[Buc94] P. Buchholz. Markovian process algebra: composition and equivalence. InU. Herzog and M. Rettelbach, editors, Proceedings of the 2nd Workshop onProcess Algebras and Performance Modelling, pages 11–30. Arbeitsberichtedes IMMD, Band 27, Nr. 4, 1994.

[Bur75] W.H. Burge. Stream processing functions. IBM Journal of Research andDevelopment, 19(1):12–25, 1975.

[Cad72] J.M. Cadiou. Recursive definitions of partial functions and their computa-tions. PhD thesis, Computer Science Department, Stanford University, 1972.

[CC79] P. Cousot and R. Cousot. Constructive versions of Tarski’s fixed point theo-rems. Pacific Journal of Mathematics, 81(1):43–57, 1979.

[Cla77] E.M. Clarke. Program invariants as fixed points (preliminary reports). InFOCS, pages 18–29. IEEE, 1977. Final version in Computing, 21(4):273–294, 1979. Based on Clarke’s PhD thesis, Completeness and IncompletenessTheorems for Hoare-like Axiom Systems, Cornell University, 1976.

[Dev63] V. Devide. On monotonous mappings of complete lattices. FundamentaMathematicae, LIII:147–154, 1963.

[dR77] W.P. de Roever. On backtracking and greatest fixpoints. In Arto Salomaa andMagnus Steinby, editors, Fourth Colloquium on Automata, Languages andProgramming (ICALP), volume 52 of Lecture Notes in Computer Science,pages 412–429. Springer, 1977.

[Ehr61] A. Ehrenfeucht. An application of games to the completeness problem forformalized theories. Fundamenta Mathematicae, 49:129–141, 1961.

[FH83] M. Forti and F. Honsell. Set theory with free construction principles. AnnaliScuola Normale Superiore, Pisa, Serie IV, X(3):493–522, 1983.

[Fin26] P. Finsler. Uber die Grundlagen der Mengenlehre. I. Math. Zeitschrift,25:683–713, 1926.

Page 49: advanced topics in biosimulation and coinduction

Origins of bisimulation and coinduction 33

[Flo67] R.W. Floyd. Assigning meaning to programs. In Proceeding of Symposiain Applied Mathematics, volume 19, pages 19–32. American MathematicalSociety, 1967.

[Fra22] A. Fraenkel. Zu den Grundlagen der Cantor-Zermeloschen Mengenlehre.Mathematische Annalen, 86:230–237, 1922.

[Fra53] R. Fraısse. Sur quelques classifications des systemes de relations. PhD thesis,University of Paris, 1953. Also in Publications Scientifiques de l’Universited’Alger, series A, 1, 35–182, 1954.

[Fri73] H. Friedman. The consistency of classical set theory relative to a set theorywith intuitionistic logic. Journal of Symbolic Logic, 38:315–319, 1973.

[Gin68] A. Ginzburg. Algebraic Theory of Automata. Academic Press, 1968.[Gla90] R.J. van Glabbeek. The linear time-branching time spectrum (extended

abstract). In J.C.M. Baeten and J.W. Klop, editors, First Conference on Con-currency Theory (CONCUR’90), volume 458 of Lecture Notes in ComputerScience, pages 278–297. Springer, 1990.

[Gla93] R.J. van Glabbeek. The linear time–branching time spectrum II (the seman-tics of sequential systems with silent moves). In E. Best, editor, Fourth Con-ference on Concurrency Theory (CONCUR’93), volume 715, pages 66–81.Springer, 1993.

[GM76] F. Giarratana, V. Gimona and U. Montanari. Observability concepts inabstract data type specification. In A. Mazurkievicz, editor, 5th Symposiumon Mathematical Foundations of Computer Science, volume 45 of LectureNotes in Computer Science, pages 576–587. Springer, 1976.

[Gol89] R. Goldblatt. Varieties of complex algebras. Annals of Pure and AppliedLogic, 44:173–242, 1989.

[Gor82] L. Gordeev. Constructive models for set theory with extensionality. In A.S.Troelstra and D. van Dalen, editors, The L.E.J. Brouwer Centenary Sympo-sium, pages 123–147, 1982.

[GR62] S. Ginsburg and H. Gordon Rice. Two families of languages related to algol.Journal of the ACM, 9(3):350–371, 1962.

[GRS79] J.S. Gourlay, W.C. Rounds, and R. Statman. On properties preserved by con-traction of concurrent systems. In G. Kahn, editor, International Symposiumon Semantics of Concurrent Computation, volume 70 of Lecture Notes inComputer Science, pages 51–65. Springer, 1979.

[HE67] J. van Heijenoort, editor. From Frege to Godel: A Source Book in Mathemat-ical Logic 1879–1931. Harvard University Press, 1967.

[Hin80] R. Hinnion. Contraction de structures et application a NFU. Comptes RendusAcademie des Sciences de Paris, Ser. A 290:677–680, 1980.

[Hin81] R. Hinnion. Extensional quotients of structures and applications to the studyof the axiom of extensionality. Bulletin de la Societe Mathematique de Bel-gique, XXXIII (Fas. II, Ser. B):173–206, 1981.

[Hin86] R. Hinnion. Extensionality in Zermelo–Fraenkel set theory. Zeitschrift furMathematische Logik und Grundlagen Mathematik, 32:51–60, 1986.

[HM80] M. Hennessy and R. Milner. On observing nondeterminism and concur-rency. In J.W. de Bakker and J. van Leeuwen, editors, Proc. 7th ColloquiumAutomata, Languages and Programming, volume 85 of Lecture Notes inComputer Science, pages 299–309. Springer, 1980.

Page 50: advanced topics in biosimulation and coinduction

34 Davide Sangiorgi

[HM85] M. Hennessy and R. Milner. Algebraic laws for nondeterminism and con-currency. Journal of the ACM, 32:137–161, 1985.

[Hon81] F. Honsell. Modelli della teoria degli insiemi, principi di regolarita e dilibera costruzione. Tesi di Laurea, Universita di Pisa, 1981.

[HP73] P. Hitchcock and D. Park. Induction rules and termination proofs. In M. Nivat,editor, Proceedings of the IRIA Symposium on Automata, Languages andProgramming, Paris, France, July, 1972, pages 225–251. North-Holland,1973.

[Huf54] D.A. Huffman. The synthesis of sequential switching circuits. Journal ofthe Franklin Institute (Mar. 1954) and (Apr. 1954), 257(3–4):161–190 and275–303, 1954.

[Imm82] N. Immerman. Upper and lower bounds for first order expressibility. Journalof Computer and System Science, 25(1):76–98, 1982.

[Jen80] K. Jensen. A method to compare the descriptive power of different typesof petri nets. In P. Dembinski, editor, Proc. 9th Mathematical Foundationsof Computer Science 1980 (MFCS’80), Rydzyna, Poland, September 1980,volume 88 of Lecture Notes in Computer Science, pages 348–361. Springer,1980.

[Jon84] C.B. Jones, editor. Programming Languages and Their Definition – HansBekic (1936–1982), volume 177 of Lecture Notes in Computer Science.Springer, 1984.

[JT66] D.H.J. de Jongh and A.S. Troelstra. On the connection of partially orderedsets with some pseudo-Boolean algebras. Indagationes Mathematicae,28:317–329, 1966.

[Kah74] G. Kahn. The semantics of simple language for parallel programming. InIFIP Congress, pages 471–475. North-Holland, 1974.

[Kan39] L.V. Kantorovich. The method of successive approximations for functionalequations. Acta Mathematica, 71:63–97, 1939.

[Kle52] S.C. Kleene. Introduction to Metamathematics. Van Nostrand, 1952.[Kle70] S.C. Kleene. The origin of recursive function theory. In 20th Annual

Symposium on Foundations of Computer Science, pages 371–382. IEEE,1970.

[Kna28] B. Knaster. Un theoreme sur les fonctions d’ensembles. Annales de la SocietePolonaise de Mathematique, 6:133–134, 1928.

[KS60] J. Kemeny and J.L. Snell. Finite Markov Chains. Van Nostrand, 1960.[Kwo77] Y.S. Kwong. On reduction of asynchronous systems. Theoretical Computer

Science, 5(1):25–50, 1977.[Lan64] P.J. Landin. The mechanical evaluation of expressions. The Computer Jour-

nal, 6(4):308–320, 1964.[Lan65a] P.J. Landin. Correspondence between ALGOL 60 and Church’s Lambda-

notation: Part I. Communications of the ACM, 8(2):89–101, 1965.[Lan65b] P.J. Landin. A correspondence between ALGOL 60 and Church’s Lambda-

notations: Part II. Communications of the ACM, 8(3):158–167, 1965.[Lan69] P. Landin. A program-machine symmetric automata theory. Machine Intel-

ligence, 5:99–120, 1969.[LNS82] J.-L. Lassez, V.L. Nguyen, and L. Sonenberg. Fixed point theorems and

semantics: A folk tale. Information Processing Letters, 14(3):112–116, 1982.

Page 51: advanced topics in biosimulation and coinduction

Origins of bisimulation and coinduction 35

[LS91] K.G. Larsen and A. Skou. Bisimulation through probabilistic testing.Information and Computation, 94(1):1–28, 1991. Preliminary version inPOPL’89, 344–352, 1989.

[Man69] Z. Manna. The correctness of programs. Journal of Computer and SystemSciences, 3(2):119–127, 1969.

[Man74] Z. Manna. Mathematical Theory of Computation. McGraw-Hill, 1974.[Maz71] A.W. Mazurkiewicz. Proving algorithms by tail functions. Information and

Control, 18(3):220–226, 1971.[Maz73] A. Mazurkiewicz. Proving properties of processes. Technical report 134,

Computation Center of Polish Academy of Sciences, Warsaw, 1973. Also inAlgorytmy, 11, 5–22, 1974.

[McC61] J. McCarthy. A basis for a mathematical theory of computation. In Proceed-ings of the Western Joint Computer Conference, volume 19, pages 225–238.Spartan Books, 1961. Reprinted, with corrections and an added tenth sec-tion, in Computer Programming and Formal Systems, P. Braffort and D.Hirschberg, editors, pages 33–70, North-Holland, 1963.

[McC63] J. McCarthy. Towards a mathematical science of computation. In Proceed-ings of IFIP Congress 62, pages 21–28. North-Holland, 1963.

[Mil70] R. Milner. A formal notion of simulation between programs. Memo 14,Computers and Logic Research Group, University College of Swansea, UK,1970.

[Mil71a] R. Milner. Program simulation: an extended formal notion. Memo 17, Com-puters and Logic Research Group, University College of Swansea, UK, 1971.

[Mil71b] R. Milner. An algebraic definition of simulation between programs. In Pro-ceedings of the 2nd International Joint Conferences on Artificial Intelligence.British Computer Society, London, 1971.

[Mil80] R. Milner. A Calculus of Communicating Systems, volume 92 of LectureNotes in Computer Science. Springer, 1980.

[Mil89] R. Milner. Communication and Concurrency. Prentice Hall, 1989.[Mir17a] D. Mirimanoff. Les antinomies de Russell et de Burali-Forti et le probleme

fondamental de la theorie des ensembles. L’Enseignement Mathematique,19:37–52, 1917.

[Mir17b] D. Mirimanoff. Remarques sur la theorie des ensembles et les antinomiescantoriennes I. L’Enseignement Mathematique, 19:209–217, 1917.

[Mir20] D. Mirimanoff. Remarques sur la theorie des ensembles et les antinomiescantoriennes II. L’Enseignement Mathematique, 21:29–52, 1920.

[Moo56] E.F. Moore. Gedanken experiments on sequential machines. Automata Stud-ies, Annals of Mathematics Series, 34:129–153, 1956.

[Mor68] J.H. Morris. Lambda-calculus models of programming languages. PhD the-sis, MIT, project MAC, Dec. 1968.

[Mos74] Y.N. Moschovakis. Elementary Induction on Abstract Structures, volume 77of Studies in Logic and the Foundations of Mathematics. North-Holland,Amsterdam, 1974.

[Ner58] A. Nerode. Linear automaton transformations. In Proceedings of the Ameri-can Mathematical Society, 9, 541–544, 1958.

[Par69] D. Park. Fixpoint induction and proofs of program properties. In B. Meltzerand D. Michie, editors, Machine Intelligence 5, pages 59–78. EdinburghUniversity Press, 1969.

Page 52: advanced topics in biosimulation and coinduction

36 Davide Sangiorgi

[Par70] D. Park. The Y-combinator in Scott’s lambda-calculus models. Symposiumon Theory of Programming, University of Warwick, unpublished (A revisedversion: Research Report CS-RR-013, Department of Computer Science,University of Warwick, June 1976), 1970.

[Par79] D. Park. On the semantics of fair parallelism. In Proceedings of Abstract Soft-ware Specifications, Copenhagen Winter School, Lecture Notes in ComputerScience, pages 504–526. Springer, 1979.

[Par81a] D. Park. Concurrency on automata and infinite sequences. In P. Deussen,editor, Conference on Theoretical Computer Science, volume 104 of LectureNotes in Computer Science, pages 167–183. Springer, 1981.

[Par81b] D. Park. A new equivalence notion for communicating systems. In G. Maurer,editor, Bulletin EATCS, volume 14, pages 78–80, 1981. Abstract of thetalk presented at the Second Workshop on the Semantics of ProgrammingLanguages, Bad Honnef, March 16–20 1981. Abstracts collected in theBulletin by B. Mayoh.

[Pas74] A. Pasini. Some fixed point theorems of the mappings of partially orderedsets. Rendiconti del Seminario Matematico della Universita di Padova,51:167–177, 1974.

[Rey93] J.C. Reynolds. The discoveries of continuations. Lisp and Symbolic Compu-tation, 6(3–4):233–248, 1993.

[Rog67] H. Rogers. Theory of Recursive Functions and Effective Computability.McGraw Hill, 1967. Reprinted, MIT Press, 1987.

[Rus03] B. Russell. Principles of Mathematics. Cambridge University Press, 1903.[Rus08] B. Russell. Mathematical logic as based on the theory of types. American

Journal of Mathematics, 30:222–262, 1908. Also in [HE67], pages 153–168.[RW13] B. Russell and A.N. Whitehead. Principia Mathematica, 3 vols. Cambridge

University Press, 1910, 1912, 1913.[San09] D. Sangiorgi. On the origins of bisimulation and coinduction. ACM Trans-

actions on Programming Languages and Systems, 31(4), 2009.[San12] D. Sangiorgi. An Introduction to Bisimulation and Coinduction. Cambridge

University Press, 2012.[Sco60] D. Scott. A different kind of model for set theory. Unpublished paper, given

at the 1960 Stanford Congress of Logic, Methodology and Philosophy ofScience, 1960.

[Sco69a] D. Scott. Models for the λ-calculus. Manuscript, draft, Oxford, December1969.

[Sco69b] D. Scott. A construction of a model for the λ-calculus. Manuscript, Oxford,November 1969.

[Sco69c] D. Scott. A type-theoretical alternative to CUCH, ISWIM, OWHY. Typedscript, Oxford. Also appeared as [Sco93], October 1969.

[Sco72a] D. Scott. Continuous lattices. In E. Lawvere, editor, Toposes, AlgebraicGeometry and Logic, volume 274 of Lecture Notes in Mathematics, pages97–136. Springer, 1972.

[Sco72b] D. Scott. The lattice of flow diagrams. In E. Engeler, editor, Symposiumof Semantics of Algorithmic Languages, volume 188 of Lecture Notes inMathematics, pages 311–366. Springer, 1972.

Page 53: advanced topics in biosimulation and coinduction

Origins of bisimulation and coinduction 37

[Sco76] D. Scott. Data types as lattices. SIAM Journal on Computing, 5:522–587,1976. A manuscript with the same title was written in 1972.

[Sco93] D.S. Scott. A type-theoretical alternative to ISWIM, CUCH, OWHY. Theo-retical Computer Science, 121(1&2):411–440, 1993.

[SdB69] D. Scott and J.W. de Bakker. A theory of programs. Handwritten notes. IBMLab., Vienna, Austria, 1969.

[Seg68] K. Segerberg. Decidability of S4.1. Theoria, 34:7–20, 1968.[Seg70] K. Segerberg. Modal logics with linear alternative relations. Theoria, 36:301–

322, 1970.[Seg71] K. Segerberg. An essay in classical modal logic. Filosofiska Studier, Uppsala,

1971.[Sko23] T. Skolem. Einige Bemerkungen zur Axiomatischen Begrundung der Men-

genlehre. In Proceedings of the 5th Scandinavian Mathematics Congress,Helsinki, 1922, pages 217–232. Akademiska Bokhandeln, Helsinki, 1923.English translation, ‘Some remarks on axiomatized set theory’, in [HE67],pages 290–301.

[Spe57] E. Specker. Zur Axiomatik der Mengenlehre. Zeitschrift fur MathematischeLogik und Grundlagen der Mathematik, 3(3):173–210, 1957.

[Sti12] C. Stirling. Bisimulation and Logic. Chapter 4 of this volume.[Tar49] A. Tarski. A fixpoint theorem for lattices and its applications (preliminary

report). Bulletin of the American Mathematical Society, 55:1051–1052 and1192, 1949.

[Tar55] A. Tarski. A lattice-theoretical fixpoint theorem and its applications. PacificJournal of Mathematics, 5:285–309, 1955.

[Tho93] W. Thomas. On the Ehrenfeucht–Fraısse game in theoretical computer sci-ence. In M.-C. Gaudel and J.-P. Jouannaud, editors, TAPSOFT, volume 668of Lecture Notes in Computer Science, pages 559–568. Springer, 1993.

[Zer08] E. Zermelo. Untersuchungen uber die Grundlagen der Mengenlehre I. Math-ematische Annalen, 65:261–281, 1908. English translation, ‘Investigationsin the foundations of set theory’, in [HE67], pages 199–215.

Page 54: advanced topics in biosimulation and coinduction

2

An introduction to (co)algebra and (co)induction

bart jacobs and jan rutten

2.1 Introduction

Algebra is a well-established part of mathematics, dealing with sets with oper-ations satisfying certain properties, like groups, rings, vector spaces, etc. Itsresults are essential throughout mathematics and other sciences. Universalalgebra is a part of algebra in which algebraic structures are studied at a highlevel of abstraction and in which general notions like homomorphism, subalge-bra, congruence are studied in themselves, see e.g. [Coh81, MT92, Wec92]. Afurther step up the abstraction ladder is taken when one studies algebra with thenotions and tools from category theory. This approach leads to a particularlyconcise notion of what is an algebra (for a functor or for a monad), see forexample [Man74]. The conceptual world that we are about to enter owes muchto this categorical view, but it also takes inspiration from universal algebra, seee.g. [Rut00].

In general terms, a program in some programming language manipulatesdata. During the development of computer science over the past few decades itbecame clear that an abstract description of these data is desirable, for exampleto ensure that one’s program does not depend on the particular representationof the data on which it operates. Also, such abstractness facilitates correctnessproofs. This desire led to the use of algebraic methods in computer science,in a branch called algebraic specification or abstract data type theory. Theobjects of study are data types in themselves, using notions and techniqueswhich are familiar from algebra. The data types used by computer scientistsare often generated from a given collection of (constructor) operations. Thesame applies in fact to programs, which themselves can be viewed as datatoo. It is for this reason that ‘initiality’ of algebras plays such an importantrole in computer science (as first clearly emphasised in [GTW78]). See forexample [EM85, Wir90, Wec92] for more information.

38

Page 55: advanced topics in biosimulation and coinduction

An introduction to (co)algebra and (co)induction 39

Standard algebraic techniques have proved useful in capturing various essen-tial aspects of data structures used in computer science. But it turned out to bedifficult to algebraically describe some of the inherently dynamical structuresoccuring in computing. Such structures usually involve a notion of state, whichcan be transformed in various ways. Formal approaches to such state-baseddynamical systems generally make use of automata or transition systems, seee.g. [Plo81, Par81, Mil89] as classical early references. During the last decadethe insight gradually grew that such state-based systems should not be describedas algebras, but as so-called coalgebras. These are the formal duals of algebras,in a way which will be made precise in this chapter. The dual property of ini-tiality for algebras, namely finality, turned out to be crucial for such coalgebras.And the logical reasoning principle that is needed for such final coalgebras isnot induction but coinduction.

These notions of coalgebra and coinduction are still relatively unfamiliar,and it is our aim in this chapter to explain them in elementary terms. Most ofthe literature already assumes some form of familiarity either with categorytheory, or with the (dual) coalgebraic way of thinking (or both).

Before we start, we should emphasise that there is no new (research) materialin this chapter. Everything that we present is either known in the literature, orin the folklore, so we do not have any claims to originality. Also, our mainconcern is with conveying ideas, and not with giving a correct representationof the historical developments of these ideas. References are given mainly inorder to provide sources for more (background) information.

Also, we should emphasise that we do not assume any knowledge of categorytheory on the part of the reader. We shall often use the diagrammatic notationwhich is typical of category theory, but only in order to express equality of twocomposites of functions, as often used also in other contexts. This is simply themost efficient and most informative way of presenting such information. But inorder to fully appreciate the underlying duality between algebra and inductionon the one hand, and coalgebra and coinduction on the other, some elementarynotions from category theory are needed, especially the notions of functor(homomorphism of categories), and of initial and final (also called terminal)object in a category. Here we shall explain these notions in the concrete set-theoretic setting in which we are working, but we definitely encourage theinterested reader who wishes to further pursue the topic of this chapter to studycategory theory in greater detail. Among the many available texts on categorytheory, [Pie91, Wal91, AM75, Awo06] are recommended as easy-going startingpoints, [BW90, Cro93, LS86] as more substantial texts, and [Lan71, Bor94] asadvanced reference texts.

Page 56: advanced topics in biosimulation and coinduction

40 Bart Jacobs and Jan Rutten

This chapter starts with some introductory expositions in Sections 2.2–2.4.The technical material in the subsequent sections is organised as follows.

(1) The starting point is ordinary induction, both as a definition principle and asa proof principle. We shall assume that the reader is familiar with induction,over natural numbers, but also over other data types, say of lists, trees or (ingeneral) of terms. The first real step is to reformulate ordinary induction ina more abstract way, using initiality (see Section 2.5). More precisely, usinginitiality for ‘algebras of a functor’. This is something which we do notassume to be familiar. We therefore explain how signatures of operationsgive rise to certain functors, and how algebras of these functors correspondto algebras (or models) of the signatures (consisting of a set equipped withcertain functions interpreting the operations). This description of inductionin terms of algebras (of functors) has the advantage that it is highly generic,in the sense that it applies in the same way to all kinds of (algebraic) datatypes. Further, it can be dualised easily, thus giving rise to the theory ofcoalgebras.

(2) The dual notion of an algebra (of a functor) is a coalgebra (of a functor).It can also be understood as a model consisting of a set with certainoperations, but the direction of these operations is not as in algebra. Thedual notion of initiality is finality, and this finality gives us coinduction,both as a definition principle and as a reasoning principle. This pattern isas in the previous point, and is explained in Section 2.6.

(3) In Section 2.7 we give an alternative formulation of the coinductive reason-ing principle (introduced in terms of finality) which makes use of bisimula-tions. These are relations on coalgebras which are suitably closed under the(coalgebraic) operations; they may be understood as duals of congruences,which are relations which are closed under algebraic operations. Bisimu-lation arguments are used to prove the equality of two elements of a finalcoalgebra, and require that these elements are in a bisimulation relation.

(4) In Section 2.8 we present a coalgebraic account of transition systems and asimple calculus of processes. The latter will be defined as the elements of afinal coalgebra. An elementary language for the construction of processeswill be introduced and its semantics will be defined coinductively. As weshall see, this will involve the mixed occurrence of both algebraic andcoalgebraic structures. The combination of algebra and coalgebra will alsoplay a central role in Section 2.9, where a coalgebraic description is givenof trace semantics.

In a first approximation, the duality between induction and coinduction that weintend to describe can be understood as the duality between least and greatest

Page 57: advanced topics in biosimulation and coinduction

An introduction to (co)algebra and (co)induction 41

fixed points (of a monotone function), see Exercise 2.10.3. These notionsgeneralise to least and greatest fixed points of a functor, which are suitablydescribed as initial algebras and final coalgebras. The point of view mentionedin (1) and (2) above can be made more explicit as follows – without going intotechnicalities yet. The abstract reformulation of induction that we will describeis:

induction D use of initiality for algebras.

An algebra (of a certain kind) is initial if for an arbitrary algebra (of thesame kind) there is a unique homomorphism (structure-preserving mapping)of algebras: (

initialalgebra

) unique

homomorphism

(arbitraryalgebra

). (2.1)

This principle is extremely useful. Once we know that a certain algebra isinitial, by this principle we can define functions acting on this algebra. Initialityinvolves unique existence, which has two aspects:

Existence This corresponds to (ordinary) definition by induction.

Uniqueness This corresponds to proof by induction. In such uniquenessproofs, one shows that two functions acting on an initial algebra are the sameby showing that they are both homomorphisms (to the same algebra).

The details of this abstract reformulation will be elaborated as we proceed.Dually, coinduction may be described as:

coinduction D use of finality for coalgebras.

A coalgebra (of some kind) is final if for an arbitrary coalgebra (of the samekind), there is a unique homomorphism of coalgebras as shown:(

arbitrarycoalgebra

)unique

homomorphism (

finalcoalgebra

). (2.2)

Again we have the same two aspects: existence and uniqueness, correspondingthis time to definition and proof by coinduction.

The initial algebras and final coalgebras which play such a prominent rolein this theory can be described in a canonical way: an initial algebra can beobtained from the closed terms (i.e. from those terms which are generated by

Page 58: advanced topics in biosimulation and coinduction

42 Bart Jacobs and Jan Rutten

iteratively applying the algebra’s constructor operations), and the final coalge-bra can be obtained from the pure observations. The latter is probably not veryfamiliar, and will be illustrated in several examples in Section 2.2.

History of this chapter An earlier version of this chapter was published as‘A tutorial on (co)algebras and (co)induction’, in EATCS Bulletin 62 (1997),pp. 222–259. More than 10 years later, the present version has been updated.Notably, two sections have been added that are particularly relevant for thecontext of the present book: processes coalgebraically (Section 2.8), and tracesemantics coalgebraically (Section 2.9). In both these sections both initialalgebras and final coalgebras arise in a natural combination. In addition, thereferences to related work have been brought up-to-date.

Coalgebra has by now become a well-established part of the founda-tions of computer science and (modal) logic. In the last decade, muchnew coalgebraic theory has been developed, such as so-called universalcoalgebra [Rut00, Gum99], in analogy to universal algebra, and coalge-braic logic, generalising in various ways classical modal logic, see forinstance [Kur01, Kur06, CP07, Kli07] for an overview. But there is much more,none of which is addressed in any detail here. Much relevant recent work andmany references can be found in the proceedings of the workshop series CMCS:Coalgebraic Methods in Computer Science (published in the ENTCS series)and CALCO: Conference on Algebra and Coalgebra in Computer Science (pub-lished in the LNCS series). The aim of this chapter is in essence still the sameas it was 10 years ago: to provide a brief introduction to the field of coalgebra.

2.2 Algebraic and coalgebraic phenomena

The distinction between algebra and coalgebra pervades computer science andhas been recognised by many people in many situations, usually in termsof data versus machines. A modern, mathematically precise way to expressthe difference is in terms of algebras and coalgebras. The basic dichotomymay be described as construction versus observation. It may be found inprocess theory [Mil89], data type theory [GGM76, GM82, AM82, Kam83](including the theory of classes and objects in object-oriented program-ming [Rei95, HP95, Jac96b, Jac96a]), semantics of programming lan-guages [MA86] (denotational versus operational [RT94, Tur96, BV96]) andof lambda-calculi [Pit94, Pit96, Fio96, HL95], automata theory [Par81], sys-tem theory [Rut00], natural language theory [BM96, Rou96] and many otherfields.

Page 59: advanced topics in biosimulation and coinduction

An introduction to (co)algebra and (co)induction 43

We assume that the reader is familiar with definitions and proofs by (ordi-nary) induction. As a typical example, consider for a fixed dataset A, the setA D list(A) of finite sequences (lists) of elements of A. One can inductivelydefine a length function len : A ! N by the two clauses:

len(hi) D 0 and len(a σ ) D 1C len(σ )

for all a 2 A and σ 2 A. Here we have used the notation h i 2 A for theempty list (sometimes called nil), and a σ (sometimes written as cons(a, σ ))for the list obtained from σ 2 A by prefixing a 2 A. As we shall see later, thedefinition of this length function len : A ! N can be seen as an instance ofthe above initiality diagram (2.1).

A typical induction proof that a predicate P � A holds for all lists requiresus to prove the induction assumptions

P (h i) and P (σ )) P (a σ )

for all a 2 A and σ 2 A. For example, in this way one can prove that len(σ a) D 1C len(σ ) by taking P D fσ 2 A j 8a 2 A. len(σ a) D 1C len(σ )g.Essentially, this induction proof method says that A has no proper subalgebras.In this (algebraic) setting we make use of the fact that all finite lists of elementsof A can be constructed from the two operations nil 2 A and cons : A � A !

A. As above, we also write h i for nil and a σ for cons(a, σ ).Next we describe some typically coalgebraic phenomena, by sketching some

relevant examples. Many of the issues that come up during the description ofthese examples will be explained in further detail in later sections.

(i) Consider a black-box machine (or process) with one (external) button andone light. The machine performs a certain action only if the button is pressed.And the light goes on only if the machine stops operating (i.e. has reached afinal state); in that case, pressing the button has no effect any more. A client onthe outside of such a machine cannot directly observe the internal state of themachine, but (s)he can only observe its behaviour via the button and the light.In this simple (but paradigmatic) situation, all that can be observed directlyabout a particular state of the machine is whether the light is on or not. But auser may iterate this experiment, and record the observations after a change ofstate caused by pressing the button.1 In this situation, a user can observe howmany times (s)he has to press the button to make the light go on. This may bezero times (if the light is already on), n 2 N times, or infinitely many times (ifthe machine keeps on operating and the light never goes on).

1 It is assumed that such actions of pressing a button happen instantaneously, so that there isalways an order in the occurrence of such actions.

Page 60: advanced topics in biosimulation and coinduction

44 Bart Jacobs and Jan Rutten

Mathematically, we can describe such a machine in terms of a set X, whichwe understand as the unknown state space of the machine, on which we havea function

button : X f�g [X

where � is a new symbol not occurring in X. In a particular state s 2 X,applying the function button – which corresponds to pressing the button – hastwo possible outcomes: either button(s) D �, meaning that the machine stopsoperating and that the light goes on, or button(s) 2 X. In the latter case themachine has moved to a next state as a result of the button being pressed.(And in this next state, the button can be pressed again.) The above pair(X, button : X! f�g [X) is an example of a coalgebra.

The observable behaviour resulting from iterated observations as describedabove yields an element of the set N D N [ f1g, describing the number oftimes the button has to be pressed to make the light go on. Actually, we candescribe this behaviour as a function beh : X! N. As we shall see later, it canbe obtained as an instance of the finality diagram (2.2).

(ii) Let us consider a slightly different machine with two buttons: value andnext. Pressing the value button results in some visible indication (or attribute)of the internal state (e.g. on a display), taking values in a dataset A, withoutaffecting the internal state. Hence pressing value twice consecutively yields thesame result. By pressing the next button the machine moves to another state(the value of which can be inspected again). Abstractly, this new machine canbe described as a coalgebra

hvalue, nexti : X A �X

on a state space X. The behaviour that we can observe of such machines isthe following: for all n 2 N, read the value after pressing the next button n

times. This results in an infinite sequence (a0, a1, a2, . . .) 2 AN of elementsof the dataset A, with element ai describing the value after pressing nexti times. Observing this behaviour for every state s 2 X gives us a functionbeh : X! AN.

The set AN of infinite sequences, in computer science also known as streams,carries itself a coalgebra structure

hhead, taili : AN ! A � AN

given, for all α D (a0, a1, a2, . . .) 2 AN, by

head(α) D a0 tail(α) D (a1, a2, a3, . . .).

Page 61: advanced topics in biosimulation and coinduction

An introduction to (co)algebra and (co)induction 45

This coalgebra is final and the behaviour function beh : X! AN can thus beseen as an instance of (2.2).

(iii) The previous example is leading us in the direction of a coalgebraicdescription of classes in object-oriented languages. Suppose we wish to capturethe essential aspects of the class of points in a (real) plane that can be movedaround by a client. In this situation we certainly want two attribute buttonsfirst : X! R and second : X! R which tell us, when pushed, the first andsecond coordinate of a point belonging to this class. As before, the X plays therole of a hidden state space, and elements of X are seen as objects of the class(so that an object is identified with a state). Further we want a button (or method,in object-oriented terminology) move : X � (R � R)! X which requires twoparameters (corresponding to the change in first and second coordinate). Thismove operation allows us to change a state in a certain way, depending on thevalues of the parameters. The move method can equivalently be described as afunction move : X! X(R�R) taking the state as single argument, and yieldinga function (R � R)! X from parameters to states.

As a client of such a class we are not interested in the actual details ofthe implementation (what the state space X exactly looks like) as long as thebehaviour is determined by the following two equations:

first(move(s, (d1, d2))) D first(s)C d1

second(move(s, (d1, d2))) D second(s)C d2.

These describe the first and second coordinates after a move in terms of theoriginal coordinates and the parameters of the move. Such equations can beseen as constraints on the observable behaviour.

An important aspect of the object-oriented approach is that classes are builtaround a hidden state space, which can only be observed and modified viacertain specified operations. A user is not interested in the details of the actualimplementation, but only in the behaviour that is realised. This is why ourblack-box description of classes with an unknown state space X is appropriate.

The three buttons of such a class (as abstract machine) can be combined intoa single function

hfirst, second, movei : X R � R �X(R�R)

which forms a coalgebra on the state space X. The observable behaviouris very simple in this case. It consists of the values of the first and secondcoordinates, since if we know these values, then we know the future observablebehaviour: the only change of state that we can bring about is through the movebutton; but its observable effect is determined by the above two equations.Thus what we can observe about a state is obtained by direct observation, and

Page 62: advanced topics in biosimulation and coinduction

46 Bart Jacobs and Jan Rutten

repeated observations do not produce new information. Hence our behaviourfunction takes the form beh : X! R � R, and is again an instance of (2.2).2 Inautomata-theoretic terms one can call the space R � R the minimal realisation(or implementation) of the specified behaviour.

In the above series of examples of coalgebras we see each time a state spaceX about which we make no assumptions. On this state space a function isdefined of the form

f : X! X

where the box on the right is some expression involving X again. Later this willbe identified as a functor. The function f often consists of different compo-nents, which allow us either to observe some aspect of the state space directly,or to move on to next states. We have limited access to this state space in thesense that we can only observe or modify it via these specified operations. Insuch a situation all that we can describe about a particular state is its behaviour,which arises by making successive observations. This will lead to the notionof bisimilarity of states: it expresses of two states that we cannot distinguishthem via the operations that are at our disposal, i.e. that they are ‘equal asfar as we can see’. But this does not mean that these states are also identi-cal as elements of X. Bisimilarity is an important, and typically coalgebraic,concept.

The above examples are meant to suggest the difference between construc-tion in algebra, and observation in coalgebra. This difference will be describedmore formally below. In practice it is not always completely straightforward todistinguish between algebraic and coalgebraic aspects, for the following tworeasons.

(1) Certain abstract operations, like X � A! X, can be seen as both algebraicand coalgebraic. Algebraically, such an operation allows us to build newelements in X starting from given elements in X and parameters in A.Coalgebraically, this operation is often presented in the equivalent fromX! XA using function types. It is then seen as acting on the state spaceX, and yielding for each state a function from A to X which producesfor each parameter element in A a next state. The context should makeclear which view is prevalent. But operations of the form A! X aredefinitely algebraic (because they gives us information about how to putelements in X), and operations of the form X ! A are coalgebraic (becausethey give us observable attribute values holding for elements of X). A

2 To be precise, for coalgebras of a comonad.

Page 63: advanced topics in biosimulation and coinduction

An introduction to (co)algebra and (co)induction 47

further complication at this point is that on an initial algebra X one mayhave operations of the form X! A, obtained by initiality. An example isthe length function on lists. Such operations are derived, and are not anintegral part of the (definition of the) algebra. Dually, one may have derivedoperations A! X on a final coalgebra X.

(2) Algebraic and coalgebraic structures may be found in different hierarchiclayers. For example, one can start with certain algebras describing one’sapplication domain. On top of these one can have certain dynamical sys-tems (processes) as coalgebras, involving such algebras (e.g. as codomainsof attributes). And such coalgebraic systems may exist in an algebra ofprocesses.

A concrete example of such layering of coalgebra on top of algebra is givenby Plotkin’s so-called structural operational semantics [Plo81]. It involves atransition system (a coalgebra) describing the operational semantics of somelanguage, by giving the transition rules by induction on the structure of theterms of the language. The latter means that the set of terms of the languageis used as (initial) algebra. See Section 2.8 and [RT94, Tur96] for a furtherinvestigation of this perspective. Hidden sorted algebras, see [GM94, GD94,BD94, GM96, Mal96], can be seen as other examples: they involve ‘algebras’with ‘invisible’ sorts, playing a (coalgebraic) role of a state space. Coinductionis used to reason about such hidden state spaces, see [GM96].

2.3 Inductive and coinductive definitions

In the previous section we have seen that ‘constructor’ and ‘destructor/observer’operations play an important role for algebras and coalgebras, respectively.Constructors tell us how to generate our (algebraic) data elements: the emptylist constructor nil and the prefix operation cons generate all finite lists.And destructors (or observers, or transition functions) tell us what we canobserve about our data elements: the head and tail operations tell us allabout infinite lists: head gives a direct observation, and tail returns a nextstate.

Once we are aware of this duality between constructing and observing, itis easy to see the difference between inductive and coinductive definitions(relative to given collections of constructors and destructors):

In an inductive definition of a function f ,one defines the value of f on all constructors.

Page 64: advanced topics in biosimulation and coinduction

48 Bart Jacobs and Jan Rutten

And:

In a coinductive definition of a function f ,one defines the values of all destructors on each outcome f (x).

Such a coinductive definition determines the observable behaviour of eachf (x).

We shall illustrate inductive and coinductive definitions in some examplesinvolving finite lists (with constructors nil and cons) and infinite lists (withdestructors head and tail) over a fixed dataset A, as in the previous section.We assume that inductive definitions are well-known, so we only mention twotrivial examples: the (earlier mentioned) function len from finite lists to naturalnumbers giving the length, and the function empty? from finite lists to booleansftrue, falseg telling whether a list is empty or not:{

len(nil) D 0len(cons(a, σ )) D 1C len(σ ).

{empty?(nil) D trueempty?(cons(a, σ )) D false.

Typically in such inductive definitions, the constructors on the left-hand sideappear ‘inside’ the function that we are defining. The example of empty? above,where this does not happen, is a degenerate case.

We turn to examples of coinductive definitions (on infinite lists, say oftype A). If we have a function f : A! A, then we would like to define anextension ext(f ) of f mapping an infinite list to an infinite list by applyingf componentwise. According to the above coinductive definition scheme wehave to give the values of the destructors head and tail for a sequence ext(f )(σ ).They should be: {

head(ext(f )(σ )) D f (head(σ ))tail(ext(f )(σ )) D ext(f )(tail(σ )).

Here we clearly see that on the left-hand side, the function that we are definingoccurs ‘inside’ the destructors. At this stage it is not yet clear if ext(f ) iswell-defined, but this is not our concern at the moment.

Alternatively, we can write the definition of ext(f ) as:

σa�! σ 0

ext(f )(σ )f (a)�! ext(f )(σ 0)

.

Suppose next, that we wish to define an operation even which takes aninfinite list, and produces a new infinite list which contains (in order) all theelements occurring in evenly numbered places of the original list. That is, we

Page 65: advanced topics in biosimulation and coinduction

An introduction to (co)algebra and (co)induction 49

would like the operation even to satisfy

even(σ (0), σ (1), σ (2), . . .) D (σ (0), σ (2), σ (4), . . .). (2.3)

A little thought leads to the following definition clauses:{head(even(σ )) D head(σ )tail(even(σ )) D even(tail(tail(σ ))).

(2.4)

Or, in the transition relation notation:

σa�! σ 0

a0

�! σ 0

even(σ )a�! even(σ 0)

.

Let us convince ourselves that this definition gives us what we want. Thefirst clause in (2.4) says that the first element of the list even(σ ) is the firstelement of σ . The next element in even(σ ) is head(tail(even(σ ))), and can becomputed as

head(tail(even(σ ))) D head(even(tail(tail(σ )))) D head(tail(tail(σ ))).

Hence the second element in even(σ ) is the third element in σ . It is not hard toshow for n 2 N that head(tail(n)(even(σ ))) is the same as head(tail(2n)(σ )).

In a similar way one can coinductively define a function odd which keepsall the oddly listed elements. But it is much easier to define odd as: odd Deven ı tail.

As another example, we consider the merge of two infinite lists σ, τ into asingle list, by taking elements from σ and τ in turn, starting with σ , say. Acoinductive definition of such a function merge requires the outcomes of thedestructors head and tail on merge(σ, τ ). They are given as:{

head(merge(σ, τ )) D head(σ )tail(merge(σ, τ )) D merge(τ, tail(σ )).

In transition system notation, this definition looks as follows.

σa�! σ 0

merge(σ, τ )a�! merge(τ, σ 0)

.

Now one can show that the n-th element of σ occurs as the 2n-th element inmerge(σ, τ ), and that the n-th element of τ occurs as the (2nC 1)-th elementof merge(σ, τ ):

head(tail(2n)(merge(σ, τ ))) D head(tail(n)(σ ))

head(tail(2nC1)(merge(σ, τ ))) D head(tail(n)(τ )).

Page 66: advanced topics in biosimulation and coinduction

50 Bart Jacobs and Jan Rutten

One can also define a function merge2,1(σ, τ ) which takes two elements of σ

for every element of τ (see Exercise 2.10.6).An obvious result that we would like to prove is: merging the lists of evenly

and oddly occuring elements in a list σ returns the original list σ . That is:merge(even(σ ), odd(σ )) D σ . From what we have seen above we can easilycompute that the n-th elements on both sides are equal:

head(tail(n)(merge(even(σ ), odd(σ ))))

D

{head(tail(m)(even(σ ))) if n D 2m

head(tail(m)(odd(σ ))) if n D 2mC 1

D

{head(tail(2m)(σ )) if n D 2m

head(tail(2mC1)(σ )) if n D 2mC 1D head(tail(n)(σ )).

There is however a more elegant coinductive proof technique, which will bepresented later: in Example 2.6.3 using uniqueness – based on the finalitydiagram (2.2) – and in the beginning of Section 2.7 using bisimulations.

2.4 Functoriality of products, coproducts and powersets

In the remainder of this chapter we shall put the things we have discussedso far in a general framework. Doing so properly requires a certain amountof category theory. We do not intend to describe the relevant matters at thehighest level of abstraction, making full use of category theory. Instead, weshall work mainly with ordinary sets. That is, we shall work in the universegiven by the category of sets and functions. What we do need is that manyoperations on sets are ‘functorial’. This means that they not act only on sets,but also on functions between sets, in an appropriate manner. This is familiarin the computer science literature, not in categorical terminology, but usinga ‘map’ terminology. For example, if list(A) D A describes the set of finitelists of elements of a set A, then for a function f : A! B one can definea function list(A)! list(B) between the corresponding sets of lists, which isusually called3 map list(f ). It sends a finite list (a1, . . . , an) of elements of A

to the list (f (a1), . . . , f (an)) of elements of B, by applying f elementwise. Itis not hard to show that this map list operation preserves identity functions andcomposite functions, i.e. that map list(idA) D idlist(A) and map list(g ı f ) Dmap list(g) ımap list(f ). This preservation of identities and compositions isthe appropriateness that we mentioned above. In this section we concentrate

3 In the category theory literature one uses the same name for the actions of a functor on objectsand on morphisms; this leads to the notation list(f ) or f for this function map list(f ).

Page 67: advanced topics in biosimulation and coinduction

An introduction to (co)algebra and (co)induction 51

on such functoriality of several basic operations, such as products, coproducts(disjoint unions) and powersets. It will be used in later sections.

We recall that for two sets X, Y the Cartesian product X � Y is the set ofpairs

X � Y D f(x, y) j x 2 X and y 2 Y g.

There are then obvious projection functions π : X � Y ! X and π 0 : X �

Y ! Y by π (x, y) D x and π 0(x, y) D y. Also, for functions f : Z ! X

and g : Z ! Y there is a unique ‘pair function’ hf, gi : Z ! X � Y withπ ı hf, gi D f and π 0 ı hf, gi D g, namely hf, gi(z) D (f (z), g(z)) 2 X � Y

for z 2 Z. Notice that hπ, π 0i D id : X � Y ! X � Y and that hf, gi ı h D

hf ı h, g ı hi : W ! X � Y , for functions h : W ! Z.Interestingly, the product operation (X, Y ) 7! X � Y not only applies to

sets, but also to functions: for functions f : X! X0 and g : Y ! Y 0 we candefine a function X � Y ! X0 � Y 0 by (x, y) 7! (f (x), g(y)). One writes thisfunction as f � g : X � Y ! X0 � Y 0, whereby the symbol � is overloaded: itis used both on sets and on functions. We note that f � g can be described interms of projections and pairing as f � g D hf ı π, g ı π 0i. It is easily verifiedthat the operation � on functions satisfies

idX � idY D idX�Y and (f ı h) � (g ı k) D (f � g) ı (h � k).

This expresses that the product � is functorial: it not only applies to sets, butalso to functions; and it does so in such a way that identity maps and compositesare preserved.

Many more operations are functorial. Also the coproduct (or disjoint union,or sum)C is. For sets X, Y we write their disjoint union as X C Y . Explicitly:

X C Y D fh0, xi j x 2 Xg [ fh1, yi j y 2 Y g.

The first components 0 and 1 serve to force this union to be disjoint. These‘tags’ enable us to recognise the elements of X and of Y inside X C Y . Insteadof projections as above we now have ‘coprojections’ κ : X! X C Y andκ 0 : Y ! X C Y going in the other direction. One puts κ(x) D h0, xi andκ 0(y) D h1, yi. And instead of tupleing we now have ‘cotupleing’ (sometimescalled ‘source tupleing’): for functions f : X! Z and g : Y ! Z there is aunique function [f, g] : X C Y ! Z with [f, g] ı κ D f and [f, g] ı κ 0 D g.One defines [f, g] by case distinction:

[f, g](w) D

{f (x) if w D h0, xi

g(y) if w D h1, yi.

Notice that [κ, κ 0] D id and h ı [f, g] D [h ı f, h ı g].

Page 68: advanced topics in biosimulation and coinduction

52 Bart Jacobs and Jan Rutten

This is the coproduct X C Y on sets. We can extend it to functions in thefollowing way. For f : X! X0 and g : Y ! Y 0 there is a function f C g : X C

Y ! X0 C Y 0 defined by

(f C g)(w) D

{h0, f (x)i if w D h0, xi

h1, g(y)i if w D h1, yi.

Equivalently, we could have defined: f C g D [κ ı f, κ 0 ı g]. This operationC on functions preserves identities and composition:

idX C idY D idXCY and (f ı h)C (g ı k) D (f C g) ı (hC k).

We should emphasise that this coproductC is very different from ordinary union[. For example,[ is idempotent: X [X D X, but there is not an isomorphismbetween X CX and X (if X 6D ;).

For a fixed set A, the assignment X 7! XA D ff j f is a function A! Xg

is functorial: a function g : X! Y yields a function gA : XA ! YA sendingf 2 XA to (g ı f ) 2 YA. Clearly, idA D id and (h ı g)A D hA ı gA.

Another example of a functorial operation is powerset: X 7! P(X). For afunction f : X! X0 one defines P(f ) : P(X)! P(X0) by

U 7! ff (x) j x 2 Ug.

Then P(idX) D idP(X) and P(f ı h) D P(f ) ı P(h). We shall write Pfin(�)for the (functorial) operation which maps X to the set of its finite subsets.

Here are some trivial examples of functors. The identity operation X 7! X

is functorial: it acts on functions as f 7! f . And for a constant set C we havea constant functorial operation X 7! C; a function f : X! X0 is mapped tothe identity function idC : C ! C.

Once we know these actions on functions, we can define functorial opera-tions (or: functors, for short) merely by giving their actions on sets. We willoften say things like: consider the functor

T (X) D X C (C �X).

The action on sets is then X 7! X C (C �X). And for a function f : X! X0

we have an action T (f ) of the functor T on f as a function T (f ) : T (X)!T (X0). Explicitly, T (f ) is the function

f C (idC � f ) : X C (C �X) �! X0 C (C �X0)

given by:

w 7!

{h0, f (x)i if w D h0, xi

h1, (c, f (x))i if w D h1, (c, x)i.

Page 69: advanced topics in biosimulation and coinduction

An introduction to (co)algebra and (co)induction 53

The only functors that we shall use in the sequel are such ‘polynomial’ functorsT , which are built up with constants, identity functors, products, coproducts andalso (finite) powersets. We describe these functors by only giving their actionson sets. Mostly, the functors in this chapter will be of the sort Set! Set, actingon sets and functions between them, with the exception of Section 2.9 on tracesemantics where we shall use functors Rel! Rel, acting on sets with relationsbetween them as morphisms.

There is a more general notion of functor C! D as mapping from one‘category’ C to another D, see e.g. [Awo06]. Here we are only interested inthese polynomial functors, going from the category Set of sets and functionsto itself (or from Rel to Rel). But much of the theory applies to more generalsituations.

We shall write 1 D f�g for a singleton set, with typical inhabitant �. Noticethat for every set X there is precisely one function X! 1. This says that 1 isfinal (or terminal) in the category of sets and functions. And functions 1! X

correspond to elements of X. Usually we shall identify the two. Thus, forexample, we sometimes write the empty list as nil : 1! A so that it can becotupled with the function cons : A � A ! A into the algebra

[nil, cons] : 1C (A � A)! A

that will be studied more deeply in Example 2.5.6.We write 0 for the empty set. For every set X there is precisely one function

0! X, namely the empty function. This property is the initiality of 0. Thesesets 1 and 0 can be seen as the empty product and coproduct.

We list some useful isomorphisms.

X � Y �D Y �X X C Y �D Y CX

1 �X �D X 0CX �D X

X � (Y � Z) �D (X � Y ) � Z X C (Y C Z) �D (X C Y )C Z

X � 0 �D 0 X � (Y C Z) �D (X � Y )C (X � Z).

The last two isomorphisms describe the distribution of products over finitecoproducts. We shall often work ‘up-to’ the above isomorphisms, so that wecan simply write an n-ary product as X1 � �Xn without bothering aboutbracketing.

2.5 Algebras and induction

In this section we start by showing how polynomial functors – as introduced inthe previous section – can be used to describe signatures of operations. Algebras

Page 70: advanced topics in biosimulation and coinduction

54 Bart Jacobs and Jan Rutten

of such functors correspond to models of such signatures. They consist of acarrier set with certain functions interpreting the operations. A general notionof homomorphism is defined between such algebras of a functor. This allowsus to define initial algebras by the following property: for an arbitrary algebrathere is precisely one homomorphism from the initial algebra to this algebra.This turns out to be a powerful notion. It captures algebraic structures whichare generated by constructor operations, as will be shown in several examples.Also, it gives rise to the familiar principles of definition by induction and proofby induction.

We start with an example. Let T be the polynomial functor T (X) D 1CX C (X �X), and consider for a set U a function a : T (U )! U . Such amap a may be identified with a 3-cotuple [a1, a2, a3] of maps a1 : 1! U ,a2 : U ! U and a3 : U � U ! U giving us three separate functions goinginto the set U . They form an example of an algebra (of the functor T ): aset together with a (cotupled) number of functions going into that set. Forexample, if one has a group G, with unit element e : 1! G, inverse functioni : G! G and multiplication function m : G �G! G, then one can organisethese three maps as an algebra [e, i,m] : T (G)! G via cotupling.4 The shapeof the functor T determines a certain signature of operations. Had we taken adifferent functor S(X) D 1C (X �X), then maps (algebras of S) S(U )! U

would capture pairs of functions 1! U , U � U ! U (e.g. of a monoid).

Definition 2.5.1 Let T be a functor. An algebra of T (or, a T -algebra) is apair consisting of a set U and a function a : T (U )! U .

We shall call the set U the carrier of the algebra, and the function a thealgebra structure, or also the operation of the algebra.

For example, the zero and successor functions 0: 1! N, S : N! Non the natural numbers form an algebra [0, S] : 1C N! N of the functorT (X) D 1CX. And the set of A-labelled finite binary trees Tree(A) comeswith functions nil : 1! Tree(A) for the empty tree, and node : Tree(A) � A �

Tree(A)! Tree(A) for constructing a tree out of two (sub)trees and a (node)label. Together, nil and node form an algebra 1C (Tree(A) � A � Tree(A))!Tree(A) of the functor S(X) D 1C (X � A �X).

We illustrate the link between signatures (of operations) and functors withfurther details. Let � be a (single-sorted, or single-typed) signature, given by afinite collection � of operations σ , each with an arity ar(σ ) 2 N. Each σ 2 �

4 Only the group’s operations, and not its equations, are captured in this map T (G)! G.

Page 71: advanced topics in biosimulation and coinduction

An introduction to (co)algebra and (co)induction 55

will be understood as an operation

σ : X � �X︸ ︷︷ ︸ar(σ ) times

�! X

taking ar(σ ) inputs of some type X, and producing an output of type X. Withthis signature �, say with set of operations fσ1, . . . , σng we associate a functor

T�(X) D Xar(σ1) C CXar(σn),

where for m 2 N the set Xm is the m-fold product X � �X. An alge-bra a : T�(U )! U of this functor T� can be identified with an n-cotuplea D [a1, . . . an] : U ar(σ1) C C U ar(σn) ! U of functions ai : U ar(σi ) ! U

interpreting the operations σi in � as functions on U . Hence algebras of thefunctor T� correspond to models of the signature �. One sees how the aritiesin the signature � determine the shape of the associated functor T� . Noticethat as a special case when an arity of an operation is zero we have a constantin �. In a T�-algebra T�(U )! U we get an associated map U 0 D 1! U

giving us an element of the carrier set U as interpretation of the constant. Theassumption that the signature � is finite is not essential for the correspondencebetween models of � and algebras of T� ; if � is infinite, one can define T�

via an infinite coproduct, commonly written as T�(X) D∐

σ2� Xar(σ ).Polynomial functors T built up from the identity functor, products and

coproducts (without constants) have algebras which are models of the kindof signatures � described above. This is because by the distribution of prod-ucts over coproducts one can always write such a functor in ‘disjunctive nor-mal form’ as T (X) D Xm1 C CXmn for certain natural numbers n andm1, . . . , mn. The essential role of the coproducts is to combine multiple oper-ations into a single operation.

The polynomial functors that we use are not only of this form T (X) DXm1 C CXmn , but may also involve constant sets. This is quite useful,for example, to describe for an arbitrary set A a signature for lists of A’s,with function symbols nil : 1! X for the empty list, and cons : A �X!

X for prefixing an element of type A to a list. A model (interpretation) forsuch a signature is an algebra T (U )! U of the functor T (X) D 1C (A �X)associated with this signature.

We turn to ‘homomorphisms of algebras’, to be understood as structure-preserving functions between algebras (of the same signature, or functor).Such a homomorphism is a function between the carrier sets of the algebraswhich commutes with the operations. For example, suppose we have twoalgebras �1 : 1! U1, c1 : A � U1 ! U1 and �2 : 1! U2, c2 : A � U2 ! U2

of the above list signature. A homomorphism of algebras from the first to the

Page 72: advanced topics in biosimulation and coinduction

56 Bart Jacobs and Jan Rutten

second consists of a function f : U1 ! U2 between the carriers with f ı �1 D

�2 and f ı c1 D c2 ı (id � f ). In two diagrams:

1

�1

1

�2

U1

f U2

and

A � U1id�f

c1

A � U2

c2

U1

f U2

Thus, writing n1 D �1(�) and n2 D �2(�), these diagrams express that f (n1) Dn2 and f (c1(a, x)) D c2(a, f (x)), for a 2 A and x 2 U1.

These two diagrams can be combined into a single diagram:

1C (A � U1)idC(id�f )

[�1,c1]

1C (A � U2)

[�2,c2]

U1

f U2

i.e., for the list-functor T (X) D 1C (A �X),

T (U1)T (f )

[�1,c1]

T (U2)

[�2,c2]

U1

f U2

The latter formulation is entirely in terms of the functor involved. This motivatesthe following definition.

Definition 2.5.2 Let T be a functor with algebras a : T (U )! U andb : T (V )! V . A homomorphism of algebras (also called a map of algebras,or an algebra map) from (U, a) to (V, b) is a function f : U ! V between thecarrier sets which commutes with the operations: f ı a D b ı T (f ) in

T (U )T (f )

a

T (V )

b

U

f V

As a triviality we notice that for an algebra a : T (U )! U the identityfunction U ! U is an algebra map (U, a)! (U, a). And we can compose

Page 73: advanced topics in biosimulation and coinduction

An introduction to (co)algebra and (co)induction 57

algebra maps as functions: given two algebra maps(T (U )

a�! U

)f (

T (V )b�! V

)g (T (W )

c�! W

)then the composite function g ı f : U ! W is an algebra map from (U, a)to (W, c). This is because g ı f ı a D g ı b ı T (f ) D c ı T (g) ı T (f ) D c ı

T (g ı f ), see the following diagram:

T (U )

a

T (f )

T (gıf )

��T (V )

b

T (g) T (W )

c

U

f

gıf

��Vg W

Thus: algebras and their homomorphisms form a category.Now that we have a notion of homomorphism of algebras we can formulate

the important concept of ‘initiality’ for algebras.

Definition 2.5.3 An algebra a : T (U )! U of a functor T is initial if foreach algebra b : T (V )! V there is a unique homomorphism of algebras from(U, a) to (V, b). Diagrammatically we express this uniqueness by a dashedarrow, call it f , in

T (U )

a

T (f )T (V )

b

U

fV

We shall sometimes call this f the ‘unique mediating algebra map’.

We emphasise that unique existence has two aspects, namely existence of analgebra map out of the initial algebra to another algebra, and uniqueness, in theform of equality of any two algebra maps going out of the initial algebra to someother algebra. Existence will be used as an (inductive) definition principle, anduniqueness as an (inductive) proof principle.

As a first example, we shall describe the set N of natural numbers as initialalgebra.

Example 2.5.4 Consider the set N of natural number with its zero and suc-cessor function 0: 1! N and S : N! N. These functions can be combinedinto a single function [0, S] : 1C N! N, forming an algebra of the functor

Page 74: advanced topics in biosimulation and coinduction

58 Bart Jacobs and Jan Rutten

T (X) D 1CX. We will show that this map [0, S] : 1C N! N is the initialalgebra of this functor T . And this characterises the set of natural numbers (upto isomorphism), by Lemma 2.5.5(ii) below.

To prove initiality, assume we have an arbitrary set U carrying a T -algebrastructure [u, h] : 1C U ! U . We have to define a ‘mediating’ homomorphismf : N! U . We try iteration:

f (n) D h(n)(u)

where we simply write u instead of u(�). That is,

f (0) D u and f (nC 1) D h(f (n)).

These two equations express that we have a commuting diagram

1C N

[0,S]

idCf 1C U

[u,h]

N

f U

making f a homomorphism of algebras. This can be verified easily by distin-guishing for an arbitrary element x 2 1C N in the upper-left corner the twocases x D (0,�) D κ(�) and x D (1, n) D κ 0(n), for n 2 N. In the first casex D κ(�) we get

f ([0, S](κ(�))) D f (0) D u D [u, h](κ(�)) D [u, h]((id C f )(κ(�))).

In the second case x D κ 0(n) we similarly check:

f ([0, S](κ 0(n))) D f (S(n)) D h(f (n)) D [u, h](κ 0(f (n)))

D [u, h]((id C f )(κ 0(n))).

Hence we may conclude that f ([0, S](x)) D [u, h]((id C f )(x)), for all x 2

1C N, i.e. that f ı [0, S] D [u, h] ı (id C f ).This looks promising, but we still have to show that f is the only map

making the diagram commute. If g : N! U also satisfies g ı [0, S] D [u, h] ı(id C g), then g(0) D u and g(nC 1) D h(g(n)), by the same line of reasoningfollowed above. Hence g(n) D f (n) by induction on n, so that g D f : N! U .

We shall give a simple example showing how to use this initiality forinductive definitions. Suppose we wish to define by induction the functionf (n) D 2�n from the natural numbers N to the rational numbers Q. Its definingequations are:

f (0) D 1 and f (nC 1) D 12f (n).

Page 75: advanced topics in biosimulation and coinduction

An introduction to (co)algebra and (co)induction 59

In order to define this function f : N! Q by initiality, we have to put analgebra structure 1CQ! Q on the set of rational numbers Q, see the abovedefinition. This algebra on Q corresponds to the right-hand side of the twodefining equations of f , given as two functions

11 Q Q

12 (�)

Q

� 1 x

12x

(where we use ‘1’ both for the singleton set 1 D f�g and for the number 1 2 Q)which combine into a single function

1CQ[1, 1

2 (�)] Q

forming an algebra on Q. The function f (n) D 2�n is then determined byinitiality as the unique function making the following diagram commute.

1C N

[0,S]

idCf 1CQ

[1, 12 (�)]

N

f Q

This shows how initiality can be used to define functions by induction. Itrequires that one puts an appropriate algebra structure on the codomain (i.e. therange) of the intended function, corresponding to the induction clauses thatdetermine the function.

We emphasise that the functor T is a parameter in Definitions 2.5.2 and 2.5.3of ‘homomorphism’ and ‘initiality’ for algebras, yielding uniform notions forall functors T (representing certain signatures). It turns out that initial algebrashave certain properties, which can be shown for all functors T at once. Diagramsare convenient in expressing and proving these properties, because they displayinformation in a succinct way. And they are useful both in existence anduniqueness arguments.

Lemma 2.5.5 Let T be a functor.(i) Initial T -algebras, if they exist, are unique, up-to-isomorphism of alge-

bras. That is, if we have two initial algebras a : T (U )! U and a0 : T (U 0)!

Page 76: advanced topics in biosimulation and coinduction

60 Bart Jacobs and Jan Rutten

U 0 of T , then there is a unique isomorphism f : U�D! U 0 of algebras:

T (U )

a

�D

T (f ) T (U 0)

a0

U �D

f U 0

(ii) The operation of an initial algebra is an isomorphism: if a : T (U )! U

is an initial algebra, then a has an inverse a�1 : U ! T (U ).

The first point tells us that a functor can have (essentially) at most oneinitial algebra.5 Therefore, we often speak of the initial algebra of a functor T .And the second point – which is due to Lambek – says that an initial algebraT (U )! U is a fixed point T (U ) �D U of the functor T . Initial algebras may beseen as generalisations of least fixed points of monotone functions, since theyhave a (unique) map into an arbitrary algebra, see Exercise 2.10.3.

Proof (i) Suppose both a : T (U )! U and a0 : T (U 0)! U 0 are initial algebrasof the functor T . By initiality of a there is a unique algebra map f : U ! U 0.Similarly, by initiality of a0 there is a unique algebra map f 0 : U 0 ! U in theother direction:

T (U ) T (f )

a

T (U 0)

a0

U

fU 0

T (U 0)

a0

T (f 0)T (U )

a

U 0

f 0U

Here we use the existence parts of initiality. The uniqueness part gives us thatthe two resulting algebra maps (U, a)! (U, a), namely f ı f 0 and id in:

T (U )

a

T (f ) T (U 0)

a0

T (f 0) T (U )

a

U

f U 0

f 0 U

and

T (U )

a

T (id) T (U )

a

U

id U

must be equal, i.e. that f 0 ı f D id. Uniqueness of algebra maps (U 0, a0)!(U 0, a0) similarly yields f ı f 0 D id. Hence f is an isomorphism of algebras.

(ii) Let a : T (U )! U be an initial T -algebra. In order to show that thefunction a is an isomorphism, we have to produce an inverse function U !

5 This is a more general property of initial objects in a category.

Page 77: advanced topics in biosimulation and coinduction

An introduction to (co)algebra and (co)induction 61

T (U ). Initiality of (U, a) can be used to define functions out of U to arbitraryalgebras. Since we seek a function U ! T (U ), we have to put an algebrastructure on the set T (U ). A moment’s thought yields a candidate, namelythe result T (a) : T (T (U ))! T (U ) of applying the functor T to the functiona. This function T (a), by initiality of a : T (U )! U , gives rise to a functiona0 : U ! T (U ) with T (a) ı T (a0) D a0 ı a in:

T (U )

a

T (a0)T (T (U ))

T (a)

U

a0T (U )

The function a ı a0 : U ! U is an algebra map (U, a)! (U, a):

T (U )

a

T (a0) T (T (U ))T (a)

T (a)

T (U )

a

U

a0 T (U )

a U

so that a ı a0 D id by uniqueness of algebra maps (U, a)! (U, a). But then

a0 ı a D T (a) ı T (a0) by definition of a0

D T (a ı a0) since T preserves composition

D T (id) as we have just seen

D id since T preserves identities.

Hence a : T (U )! U is an isomorphism with a0 as its inverse. �

From now on we shall often write an initial T -algebra as a map a : T (U )�D!

U , making this isomorphism explicit.

Example 2.5.6 Let A be a fixed set and consider the functor T (X) D 1C(A �X) that we used earlier to capture models of the list signature 1! X,A �X! X. We claim that the initial algebra of this functor T is the setA D list(A) D

⋃n2N An of finite sequences of elements of A, together with the

function (or element) 1! A given by the empty list nil D ( ), and the functionA � A ! A which maps an element a 2 A and a list α D (a1, . . . , an) 2 A

to the list cons(a, α) D (a, a1, . . . , an) 2 A, obtained by prefixing a to α.These two functions can be combined into a single function [nil, cons] : 1C(A � A)! A, which, as one easily checks, is an isomorphism. But this doesnot yet mean that it is the initial algebra. We will check this explicitly.

Page 78: advanced topics in biosimulation and coinduction

62 Bart Jacobs and Jan Rutten

For an arbitrary algebra [u, h] : 1C (A � U )! U of the list-functor T wehave a unique homomorphism f : A ! U of algebras:

1C (A � A)

[nil,cons]

idC(id�f ) 1C (A � U )

[u,h]

A

f U

namely

f (α) D

{u if α D nilh(a, f (β)) if α D cons(a, β).

We leave it to the reader to verify that f is indeed the unique function A ! U

making the diagram commute.Again we can use this initiality of A to define functions by induction (for

lists). As an example we take the length function len : A ! N, describedalready in the beginning of Section 2.2. In order to define it by initiality, it hasto arise from a list-algebra structure 1C A � N! N on the natural numbersN. This algebra structure is the cotuple of the two functions 0: 1! N andS ı π 0 : A � N! N. Hence len is determined as the unique function in thefollowing initiality diagram.

1C (A � A)

[nil,cons] �D

idC(id�len) 1C (A � N)

[0,Sıπ 0]

A

len N

The algebra structure that we use on N corresponds to the defining clauseslen(nil) D 0 and len(cons(a, α)) D S(len(α)) D S(len(π 0(a, α))) D S(π 0(id �len)(a, α)).

We proceed with an example showing how proof by induction involvesusing the uniqueness of a map out of an initial algebra. Consider therefore the‘doubling’ function d : A ! A which replaces each element a in a list α bytwo consecutive occurrences a, a in d(α). This function is defined as the uniqueone making the following diagram commute.

1C (A � A)

[nil,cons] �D

idC(id�d) 1C (A � A)

[nil,λ(a,α). cons(a,cons(a,α))]

A

d A

Page 79: advanced topics in biosimulation and coinduction

An introduction to (co)algebra and (co)induction 63

That is, d is defined by the induction clauses d(nil) D nil and d(cons(a, α)) Dcons(a, cons(a, d(α)). We wish to show that the length of the list d(α) is twicethe length of α, i.e. that

len(d(α)) D 2 len(α).

The ordinary induction proof consists of two steps:

len(d(nil)) D len(nil) D 0 D 2 0 D 2 len(nil)

and

len(d(cons(a, α))) D len(cons(a, cons(a, d(α))))

D 1C 1C len(d(α))(IH)D 2C 2 len(α)

D 2 (1C len(α))

D 2 len(cons(a, α)).

The ‘initiality’ induction proof of the fact len ı d D 2 (�) ı len uses unique-ness in the following manner. Both len ı d and 2 (�) ı len are homomorphismfrom the (initial) algebra (A, [nil, cons]) to the algebra (N, [0, S ı S ı π 0]), sothey must be equal by initiality. First we check that len ı d is an appropriatehomomorphism by inspection of the following diagram:

1C (A � A)

[nil,cons]�D

idC(id�d) 1C (A � A)

[nil,λ(a,α). cons(a,cons(a,α))]

idC(id�len) 1C (A � N)

[0,SıSıπ 0]

A

d A

len N

The rectangle on the left commutes by definition of d. And commutation of therectangle on the right follows easily from the definition of len. Next we checkthat 2 (�) ı len is also a homomorphism of algebras:

1C (A � A)

[nil,cons]�D

idC(id�len) 1C (A � N)

idCπ 0

idC(id�2�(�)) 1C (A � N)

idCπ 0

��

��[0,SıSıπ 0]

��

1C N

[0,S] �D

idC2�(�) 1C N

[0,SıS]

A

len N

2�(�) N

Page 80: advanced topics in biosimulation and coinduction

64 Bart Jacobs and Jan Rutten

The square on the left commutes by definition of len. Commutation of the uppersquare on the right follows from an easy computation. And the lower square onthe right may be seen as defining the function 2 (�) : N! N by the clauses:2 0 D 0 and 2 (S(n)) D S(S(2 n)), which we took for granted in the earlier‘ordinary’ proof.

We conclude our brief discussion of algebras and induction with a few remarks.

(1) Given a number of constructors one can form the carrier set of the associatedinitial algebra as the set of ‘closed’ terms (or ‘ground’ terms, not containingvariables) that can be formed with these constructors. For example, the zeroand successor constructors 0 : 1! X and S : X! X give rise to the setof closed terms,

f0, S(0), S(S(0))), . . .g

which is (isomorphic to) the set N of natural numbers. Similarly, the set ofclosed terms arising from the A-list constructors nil : 1! X, cons : A �

X! X is the set A of finite sequences (of elements of A).Although it is pleasant to know what an initial algebra looks like, in

using initiality we do not need this knowledge. All we need to know is thatthere exists an initial algebra. Its defining property is sufficient to use it.There are abstract results, guaranteeing the existence of initial algebras forcertain (continuous) functors, see e.g. [LS81, SP82], where initial algebrasare constructed as suitable colimits, generalising the construction of leastfixed points of continuous functions.

(2) The initiality format of induction has the important advantage that it gen-eralises smoothly from natural numbers to other (algebraic) data types,like lists or trees. Once we know the signature containing the constructoroperations of these data types, we know what the associated functor is andwe can determine its initial algebra. This uniformity provided by initialitywas first stressed by the ‘ADT-group’ [GTW78], and forms the basis forinductively defined types in many programming languages. For example,in the (functional) language ml, the user can introduce a new inductivetype X via the notation

datatype X D c1 of σ1(X) j j cn of σn(X).

The idea is that X is the carrier of the initial algebra associated with theconstructors c1 : σ1(X)! X, . . ., cn : σn(X)! X. That is, with the functorT (X) D σ1(X)C C σn(X). The σi are existing types which may contain

Page 81: advanced topics in biosimulation and coinduction

An introduction to (co)algebra and (co)induction 65

X (positively).6 The uniformity provided by the initial algebra format (anddually also by the final coalgebra format) is very useful if one wishesto automatically generate various rules associated with (co)inductivelydefined types (for example in programming languages like charity [CS95]or in proof tools like pvs [ORRC96], hol/isabelle [GM93, Mel89, Pau90,Pau97], or coq [PM93]).

Another advantage of the initial algebra format is that it is dual to thefinal coalgebra format, as we shall see in the next section. This forms thebasis for the duality between induction and coinduction.

(3) We have indicated only in one example that uniqueness of maps out of aninitial algebra corresponds to proof (as opposed to definition) by induc-tion. To substantiate this claim further we show how the usual predicateformulation of induction for lists can be derived from the initial algebraformulation. This predicate formulation says that a predicate (or subset)P � A is equal to A in case nil 2 P and α 2 P ) cons(a, α) 2 P ,for all a 2 A and α 2 A. Let us consider P as a set in its own right,with an explicit inclusion function i : P ! A (given by i(x) D x). Theinduction assumptions on P essentially say that P carries an algebra struc-ture nil : 1! P , cons : A � P ! P , in such a way that the inclusion mapi : P ! A is a map of algebras:

1C (A � P )

[nil,cons]

idC(id�i) 1C (A � A)

[nil,cons]�D

P

i A

In other words: P is a subalgebra of A. By initiality we get a functionj : A ! P as on the left below. But then i ı j D id, by uniqueness.

1C (A � A)

[nil,cons] �D

idC(id�j )

idC(id�id)

��1C (A � P )

[nil,cons]

idC(id�i) 1C (A � A)

[nil,cons]�D

A

j

id

��Pi A

This means that P D A, as we wished to derive.

6 This definition scheme in ml contains various aspects which are not investigated here, e.g. itallows (a) X D X(Eα) to contain type variables Eα, (b) mutual dependencies between suchdefinitions, (c) iteration of inductive definitions (so that, for example, the list operation whichis obtained via this scheme can be used in the σi ).

Page 82: advanced topics in biosimulation and coinduction

66 Bart Jacobs and Jan Rutten

(4) The initiality property from Definition 2.5.3 allows us to define functionsf : U ! V out of an initial algebra (with carrier) U . Often one wishes todefine functions U �D ! V involving an additional parameter rangingover a set D. A typical example is the addition function plus : N � N! N,defined by induction on (say) its first argument, with the second argumentas parameter. One can handle such functions U �D ! V via Currying:they correspond to functions U ! V D . And the latter can be defined via theinitiality scheme. For example, we can define a Curryied addition functionplus : N! NN via initiality by putting an appropriate algebra structure1C NN ! NN on N (see Example 2.5.4):

1C N

[0,S] �D

plus 1C NN

[λx. x, λf . λx. S(f (x))]

N

plus NN

This says that

plus(0) D λx. x and plus(nC 1) D λx. S(plus(n)(x)).

Alternatively, one may formulate initiality ‘with parameters’,see [Jac95], so that one can handle such functions U �D ! V directly.

2.6 Coalgebras and coinduction

In Section 2.4 we have seen that a ‘co’-product C behaves like a product�, except that the arrows point in opposite direction: one has coprojectionsX! X C Y Y instead of projections X X � Y ! Y , and cotupleinginstead of tupleing. One says that the coproduct C is the dual of the product�, because the associated arrows are reversed. Similarly, a ‘co’-algebra is thedual of an algebra.

Definition 2.6.1 For a functor T , a coalgebra (or a T -coalgebra) is a pair(U, c) consisting of a set U and a function c : U ! T (U ).

Like for algebras, we call the set U the carrier and the function c the struc-ture or operation of the coalgebra (U, c). Because coalgebras often describedynamical systems (of some sort), the carrier set U is also called the statespace.

Page 83: advanced topics in biosimulation and coinduction

An introduction to (co)algebra and (co)induction 67

What, then, is the difference between an algebra T (U )! U and a coalgebraU ! T (U )? Essentially, it is the difference between construction and observa-tion. An algebra consists of a carrier set U with a function T (U )! U goinginto this carrier U . It tells us how to construct elements in U . And a coalgebraconsists of a carrier set U with a function U ! T (U ) in the opposite direction,going out of U . In this case we do not know how to form elements in U , but weonly have operations acting on U , which may give us some information aboutU . In general, these coalgebraic operations do not tell us all there is to sayabout elements of U , so that we only have limited access to U . Coalgebras –like algebras – can be seen as models of a signature of operations – not ofconstructor operations, but of destructor/observer operations.

Consider for example the functor T (X) D A �X, where A is a fixed set. Acoalgebra U ! T (U ) consists of two functions U ! A and U ! U , whichwe earlier called value : U ! A and next : U ! U . With these operations wecan do two things, given an element u 2 U :

(1) produce an element in A, namely value(u);(2) produce a next element in U , namely next(u).

Now we can repeat (1) and (2) and therefore form another element in A, namelyvalue(next(u)). By proceeding in this way we can get for each element u 2 U

an infinite sequence (a1, a2, . . .) 2 AN of elements an D value(next(n)(u)) 2 A.This sequence of elements that u gives rise to is what we can observe about u.Two elements u1, u2 2 U may well give rise to the same sequence of elementsof A, without actually being equal as elements of U . In such a case one callsu1 and u2 observationally indistinguishable, or bisimilar.

Here is another example. Let the functor T (X) D 1C A �X have a coal-gebra pn : U ! 1C A � U , where ‘pn’ stands for ‘possible next’. If we havean element u 2 U , then we can see the following.

(1) Either pn(u) D κ(�) 2 1C A � U is in the left component of C. If thishappens, then our experiment stops, since there is no state (element of U )left with which to continue.

(2) Or pn(u) D κ 0(a, u) 2 1C A � U is in the rightC-component. This givesus an element a 2 A and a next element u0 2 U of the carrier, with whichwe can proceed.

Repeating this we can observe for an element u 2 U either a finite sequence(a1, a2, . . . , an) 2 A, or an infinite sequence (a1, a2, . . .) 2 AN. The observ-able outcomes are elements of the set A1 D A C AN of finite and infinite listsof a’s.

Page 84: advanced topics in biosimulation and coinduction

68 Bart Jacobs and Jan Rutten

These observations will turn out to be elements of the final coalgebra of thefunctors involved, see Example 2.6.3 and 2.6.5 below. But in order to formulatethis notion of finality for coalgebras we first need to know what a ‘homomor-phism of coalgebras’ is. It is, like in algebra, a function between the underlyingsets which commutes with the operations. For example, let T (X) D A �X bethe ‘infinite list’ functor as used above, with coalgebras hh1, t1i : U1 ! A � U1

and hh2, t2i : U2 ! A � U2. A homomorphism of coalgebras from the first tothe second consists of a function f : U1 ! U2 between the carrier sets (statespaces) with h2 ı f D h1 and t2 ı f D f ı t1 in:

U1

h1

f U2

h2

A A

and

U1

t1

f U2

t2

U1

f U2

These two diagrams can be combined into a single one:

U1

hh1,t1i

f U2

hh2,t2i

A � U1

id�f A � U2

that is, into

U1

hh1,t1i

f U2

hh2,t2i

T (U1)

T (f ) T (U2)

Definition 2.6.2 Let T be a functor.(i) A homomorphism of coalgebras (or, map of coalgebras, or coalgebra

map) from a T -coalgebra U1c1�! T (U1) to another T -coalgebra U2

c2�! T (U2)

consists of a function f : U1 ! U2 between the carrier sets which commuteswith the operations: c2 ı f D T (f ) ı c1 as expressed by the following diagram:

U1

c1

f U2

c2

T (U1)

T (f ) T (U2)

Page 85: advanced topics in biosimulation and coinduction

An introduction to (co)algebra and (co)induction 69

(ii) A final coalgebra d : Z ! T (Z) is a coalgebra such that for every coal-gebra c : U ! T (U ) there is a unique map of coalgebras (U, c)! (Z, d).

Notice that where the initiality property for algebras allows us to definefunctions going out of an initial algebra, the finality property for coalgebrasgives us means to define functions into a final coalgebra. Earlier we haveemphasised that what is typical in a coalgebraic setting is that there are nooperations for constructing elements of a state space (of a coalgebra), and thatstate spaces should therefore be seen as black boxes. However, if we knowthat a certain coalgebra is final, then we can actually form elements in its statespace by this finality principle. The next example contains some illustrations.Besides a means for constructing elements, finality also allows us to definevarious operations on final coalgebras, as will be shown in a series of examplesbelow. In fact, in this way one can put a certain algebraic structure on top of acoalgebra, see [Tur96] for a systematic study in the context of process algebras.

Now that we have seen the definitions of initiality (for algebras, see Def-inition 2.5.3) and finality (for coalgebras) we are in a position to see theirsimilarities. At an informal level we can explain these similarities as follows.A typical initiality diagram may be drawn as:

T (U )

initialalgebra

�D

T (V )base step

plusnext step

U ‘and-so-forth’

V

The map ‘and-so-forth’ that is defined in this diagram applies the ‘next step’operations repeatedly to the ‘base step’. The pattern in a finality diagram issimilar:

V

observeplus

next step

‘and-so-forth’U

finalcoalgebra

�D

T (V ) T (U )

In this case the ‘and-so-forth’ map captures the observations that arise byrepeatedly applying the ‘next step’ operation. This captures the observablebehaviour.

The technique for defining a function f : V ! U by finality is thus: describethe direct observations together with the single next steps of f as a coalgebrastructure on V . The function f then arises by repetition. Hence a coinductive

Page 86: advanced topics in biosimulation and coinduction

70 Bart Jacobs and Jan Rutten

definition of f does not determine f ‘at once’, but ‘step-by-step’. In the nextsection we shall describe proof techniques using bisimulations, which fullyexploit this step-by-step character of coinductive definitions.

But first we identify a simple coalgebra concretely, and show how we canuse finality.

Example 2.6.3 For a fixed set A, consider the functor T (X) D A �X. Weclaim that the final coalgebra of this functor is the set AN of infinite lists ofelements from A, with coalgebra structure

hhead, taili : AN A � AN

given by

head(α) D α(0) and tail(α) D λx. α(x C 1).

Hence head takes the first element of an infinite sequence (α(0), α(1), α(2), . . .)of elements of A, and tail takes the remaining list. We notice that the pair offunctions hhead, taili : AN ! A � AN is an isomorphism.

We claim that for an arbitrary coalgebra hvalue, nexti : U ! A � U there isa unique homomorphism of coalgebras f : U ! AN; it is given for u 2 U andn 2 N by

f (u)(n) D value(next(n)(u)

).

Then indeed, head ı f D value and tail ı f D f ı next, making f a map ofcoalgebras. And f is unique in satisfying these two equations, as can be checkedeasily.

Earlier in this section we saw that what we can observe about an elementu 2 U is an infinite list of elements of A arising as value(u), value(next(u)),value(next(next(u))), . . . Now we see that this observable behaviour of u isprecisely the outcome f (u) 2 AN at u of the unique map f to the final coalgebra.Hence the elements of the final coalgebra give the observable behaviour. Thisis typical for final coalgebras.

Once we know that AN is a final coalgebra – or, more precisely, carries a finalcoalgebra structure – we can use this finality to define functions into AN. Letus start with a simple example, which involves defining the constant sequenceconst(a) D (a, a, a, . . .) 2 AN by coinduction (for some element a 2 A). Weshall define this constant as a function const(a) : 1! AN, where 1 D f�gis a singleton set. Following the above explanation, we have to produce acoalgebra structure 1! T (1) D A � 1 on 1, in such a way that const(a) arisesby repetition. In this case the only thing we want to observe is the elementa 2 A itself, and so we simply define as coalgebra structure 1! A � 1 the

Page 87: advanced topics in biosimulation and coinduction

An introduction to (co)algebra and (co)induction 71

function � 7! (a,�). Indeed, const(a) arises in the following finality diagram:

1

�7!(a,�)

const(a) AN

�D hhead,taili

A � 1id�const(a)

A � AN

It expresses that head(const(a)) D a and tail(const(a)) D const(a).We consider another example, for the special case where A D N. We now

wish to define (coinductively) the function from : N! NN which maps a nat-ural number n 2 N to the sequence (n, nC 1, nC 2, nC 3, . . .) 2 NN. Thisinvolves defining a coalgebra structure N! N � N on the domain N of thefunction from that we are trying to define. The direct observation that we canmake about a ‘state’ n 2 N is n itself, and the next state is then nC 1 (inwhich we can directly observe nC 1). Repetition then leads to from(n). Thuswe define the function from in the following diagram.

N

λn. (n,nC1)

from NN

�D hhead,taili

N � Nid�from

N � NN

It is then determined by the equations head(from(n)) D n and tail(from(n)) Dfrom(nC 1).

We are now in a position to provide the formal background for the examplesof coinductive definitions and proofs in Section 2.3. For instance, the functionmerge : AN � AN ! AN which merges two infinite lists into a single one arisesas the unique function to the final coalgebra AN in:

AN � ANmerge

λ(α,β). (head(α),(β,tail(α)))

AN

�D hhead,taili

A � (AN � AN)id�merge

A � AN

Notice that the coalgebra structure on the left that we put on the domainAN � AN of merge corresponds to the defining ‘coinduction’ clauses for merge,as used in Section 2.3. It expresses the direct observation after a merge, togetherwith the next state (about which we make a next direct observation).

It follows from the commutativity of the above diagram that

head(merge(α, β)) D head(α) and tail(merge(α, β)) D merge(β, tail(α)).

Page 88: advanced topics in biosimulation and coinduction

72 Bart Jacobs and Jan Rutten

The function even : AN ! AN can similarly be defined coinductively, thatis, by finality of AN, as follows:

AN even

λα. (head(α),tail(tail(α)))

AN

hhead,taili�D

A � AN

id�even A � AN

The coalgebra structure on AN on the left gives rise, by finality, to a uniquecoalgebra homomorphism, called even. By the commutatitivity of the diagram,it satisfies:

head(even(α)) D head(α) and tail(even(α)) D even(tail(tail(α))).

As before, we define

odd(α) D even(tail(α)).

Next we prove for all α in AN: merge(even(α), odd(α)) D α, by showing thatmerge ı heven, oddi is a homomorphism of coalgebras from (AN, hhead, taili)to (AN, hhead, taili). The required equality then follows by uniqueness,because the identity function id : AN ! AN is (trivially) a homomorphism(AN, hhead, taili)! (AN, hhead, taili) as well. Thus, all we have to prove isthat we have a homomorphism, i.e. that

hhead, tailiı(mergeıheven, oddi)D (id�(mergeıheven, oddi))ıhhead, taili.

This follows from the following two computations.

head(merge(even(α), odd(α))) D head(even(α))

D head(α).

And:

tail(merge(even(α), odd(α))) D merge(odd(α), tail(even(α)))

D merge(odd(α), even(tail(tail(α))))

D merge(even(tail(α)), odd(tail(α)))

D (merge ı heven, oddi)(tail(α)).

In Section 2.7, an alternative method for proving facts such as the one above,will be introduced, which is based on the notion of bisimulation.

Clearly, there are formal similarities between algebra maps and coalgebramaps. We leave it to the reader to check that coalgebra maps can be composedas functions, and that the identity function on the carrier of a coalgebra is a

Page 89: advanced topics in biosimulation and coinduction

An introduction to (co)algebra and (co)induction 73

map of coalgebras. There is also the following result, which is dual – includingits proof – to Lemma 2.5.5.

Lemma 2.6.4 (i) Final coalgebras, if they exist, are uniquely determined (upto isomorphism).

(ii) A final coalgebra Z ! T (Z) is a fixed point Z�D! T (Z) of the

functor T . �

Final coalgebras are generalisations of greatest fixed points of monotonefunctions. As for initial algebras, the existence of final coalgebras is moreimportant than their actual (internal) structure. Their use is determined entirelyby their finality property, and not by their structure. Often, the existence of afinal coalgebra follows from general properties of the relevant functor (and ofthe underlying category), see e.g. [LS81, SP82, Ada03].

The unique existence of a map of coalgebras into a final coalgebra has twoaspects: existence, which gives us a principle of definition by coinduction, anduniqueness, which gives us a principle of proof by coinduction. This will befurther illustrated in a series of examples, which will occupy the remainder ofthis section.

Example 2.6.5 It is not hard to show that the final coalgebra of the functorT (X) D 1C (A �X) has as carrier the set A1 D A C AN of finite and infinitelists of A’s. The associated ‘possible next’ coalgebra structure

pn : A1 1C A � A1 is α 7!

{κ(�) if α D h i

κ 0(a, α0) if α D a α0

is final: for an arbitrary coalgebra g : U ! 1C (A � U ) of the functor T thereis a unique homomorphism of coalgebras f : U ! A1. Earlier in this sectionwe identified such lists in A1 as the observable behaviour for machines whosesignature of operations is described by T .

We give some examples of coinductive definitions for such finite and infinitelists. First an easy one, describing an empty list nil : 1! A1 as the uniquecoalgebra homomorphisms in the following situation.

1nil

κ

A1

�D pn

1C (A � 1)idC(id�nil)

1C (A � A1)

This determines nil as pn�1 ı κ . We define a prefix operation cons : A � A1 !

A1 as pn�1 ı κ 0.

Page 90: advanced topics in biosimulation and coinduction

74 Bart Jacobs and Jan Rutten

We can coinductively define a list inclusion function list incl : A ! A1 viathe coalgebra structure A ! 1C (A � A) given by

α 7!

{κ(�) if α D nilκ 0(a, β) if α D cons(a, β).

We leave it to the reader to (coinductively) define an infinite list inclusionAN ! A1.

A next, more serious example, involves the concatenation functionconc : A1 � A1 ! A1 which yields for two lists x, y 2 A1 a new listcons(x, y) 2 A1 which contains the elements of x followed by the elementsof y. Coinductively one defines conc(x, y) by laying down what the possi-ble observations are on this new list conc(x, y). Concretely, this means thatwe should define what pn(conc(x, y)) is. The intuition we have of concatena-tion tells us that the possible next pn(conc(x, y)) is the possible next pn(x)of x if x is not the empty list (i.e. if pn(x) 6D κ(�) 2 1), and the possi-ble next pn(y) of y otherwise. This is captured in the coalgebra structureconc struct : A1 � A1 ! 1C (A � (A1 � A1)) given by:

(α, β) 7!

⎧⎨⎩κ(�) if pn(α) D pn(β) D κ(�)κ 0(a, (α0, β)) if pn(α) D κ 0(a, α0)κ 0(b, (α, β 0)) if pn(α) D κ(�) and pn(β) D κ 0(b, β 0).

The concatenation function conc : A1 � A1 ! A1 that we wished to definearises as the unique coalgebra map resulting from conc struct.

The interested reader may wish to prove (by uniqueness!) that:

conc(x, nil) D x D conc(nil, x)

conc(conc(x, y), z) D conc(x, conc(y, z)).

This makes A1 a monoid. It is clearly not commutative. One can also provethat conc(cons(a, x), y)) D cons(a, conc(x, y)). The easiest way is to showthat applying pn on both sides yields the same result. Then we are done, sincepn is an isomorphism.

Example 2.6.6 Consider the functor T (X) D 1CX from Example 2.5.4.Remember that its initial algebra is given by the set N D f0, 1, 2, . . . , g of nat-ural numbers with cotuple of zero and successor functions as algebra structure

[0, S] : 1C N�D�! N.

The final coalgebra N�D�! 1C N of T is the set

N D f0, 1, 2, . . . , g [ f1g

Page 91: advanced topics in biosimulation and coinduction

An introduction to (co)algebra and (co)induction 75

of natural numbers augmented with an extra element 1. The final coalgebrastructure N! 1C N is best called a predecessor pred because it sends

0 7! κ(�), nC 1 7! κ 0(n), 1 7! κ 0(1)

where we have written the coprojections κ, κ 0 explicitly in order to emphasisetheC-component to which pred(x) 2 1C N belongs. This final coalgebra maybe obtained by taking as the constant set A a singleton set 1 for the functorX 7! 1C (A �X) in the previous example. And indeed, the set 11 D 1 C 1N

is isomorphic to N. The ‘possible next’ operation pn : 11 ! 1C (1 � 11) isthen indeed the predecessor.

The defining property of this final coalgebra pred : N! 1C N says thatfor every set U with a function f : U ! 1C U there is a unique functiong : U ! N in the following diagram.

U

f

g

N

pred�D

1C U

idCg1C N

This says that g is the unique function satisfying

pred(g(x)) D

{κ(�) if f (x) D κ(�)κ 0(g(x0)) if f (x) D κ 0(x0).

This function g gives us the behaviour that one can observe about systemswith one button X! 1CX, as mentioned in the first (coalgebra) example inSection 2.2.

Consider now the function f : N � N! 1C (N � N) defined by

f (x, y) D

⎧⎨⎩κ(�) if pred(x) D pred(y) D κ(�)κ 0(hx0, yi) if pred(x) D κ 0(x0)κ 0(hx, y0i) if pred(x) D κ(�), pred(y) D κ 0(y0).

This f puts a coalgebra structure on N � N, for the functor X 7! 1CX thatwe are considering. Hence it gives rise to a unique coalgebra homomorphism˚ : N � N! N in the following situation.

N � N

f

˚ N

pred�D

1C (N � N)

idC˚ 1C N

Page 92: advanced topics in biosimulation and coinduction

76 Bart Jacobs and Jan Rutten

Hence˚ is the unique function N � N! N with

pred(x ˚ y) D

⎧⎨⎩κ(�) if pred(x) D κ(�) D pred(y)κ 0(x ˚ y0) if pred(x) D κ(�), pred(y) D κ 0(y0)κ 0(x0 ˚ y) if pred(x) D κ 0(x0).

It is not hard to see that n˚m D nCm for n,m 2 N and n˚1 D1 D

1˚ n, so that ˚ behaves like addition on the ‘extended’ natural numbers inN. One easily verifies that this addition function˚ : N � N! N is the specialcase (for A D 1) of the concatenation function conc : A1 � A1 ! A1 that weintroduced in the previous example. This special case distinguishes itself in animportant aspect: it can be shown that concatenation (or addition)˚ : N � N!N on the extended natural numbers is commutative – e.g. by uniqueness, orby bisimulation (see [Rut00] for details) – whereas concatenation conc : A1 �

A1 ! A1 in general is not commutative. If A has more than two elements,then conc(x, y) 6D conc(y, x), because they give rise to different observations,e.g. for both x, y singleton sequences containing different elements.

There exist also coalgebraic treatments of the real numbers, see for instance[PP02].

2.7 Proofs by coinduction and bisimulation

In this section, we shall give an alternative formulation for one of the earlierproofs by coinduction. The new proof does not directly exploit (the uniquenessaspect of) finality, but makes use of the notion of bisimulation. We also presentone new example and then formulate the general case, allowing us to proveequalities on final coalgebras via bisimulations.

We recall from Example 2.6.3 that the final coalgebra of the functor T (X) DA �X is the set of infinite lists AN of elements of A with coalgebra structurehhead, taili. A bisimulation on this carrier AN is a relation R � AN � AN

satisfying

(α, β) 2 R){

head(α) D head(β), and(tail(α), tail(β)) 2 R.

Sometimes we shall also write R(α, β) for (α, β) 2 R.Now AN satisfies the following coinductive proof principle, or cpp for short:

For all α and β in AN,

if (α, β) 2 R, for some bisimulation R on AN, then α D β. (cpp)

Page 93: advanced topics in biosimulation and coinduction

An introduction to (co)algebra and (co)induction 77

Before we give a proof of the principle, which will be based on the finality ofAN, we illustrate its use by proving, once again, for all α in AN,

merge(even(α), odd(α)) D α.

To this end, define the following relation on AN:

R D f(merge(even(α), odd(α)), α) j α 2 ANg.

In order to prove the above equality it is, by the coinductive proof princi-ple (cpp), sufficient to show that R is a bisimulation. First, for each pair(merge(even(α), odd(α)), α) 2 R we have equal head’s:

head(merge(even(α), odd(α))) D head(even(α))

D head(α).

And secondly, if we have a pair (merge(even(α), odd(α)), α) in R, then apply-ing tail on both sides yields a new pair in R, since we can rewrite, using thatodd D even ı tail,

tail(merge(even(α), odd(α))) D merge(odd(α), tail(even(α)))

D merge(even(tail(α)), even(tail(tail(α))))

D merge(even(tail(α)), odd(tail(α)).

For a proof of the cpp, let R be any bisimulation on AN. If we consider Ras a set (of pairs), then it can be supplied with an A � (�)-coalgebra structureby defining a function

γ : R A �R (α, β) 7! (head(α), (tail(α), tail(β))).

Note that γ is well-defined since (tail(α), tail(β)) is in R, because R is abisimulation. Now it is straightforward to show that the two projection functions

π1 : R AN and π2 : R AN

are homomorphisms of coalgebras from (R, γ ) to (AN, hhead, taili). Thereforeit follows from the finality (cf. Definition 2.6.2) of AN that π1 D π2. That is, if(α, β) 2 R then α D β.

The above definition of a bisimulation is a special instance of the followingcategorical definition of bisimulation, which was introduced in [AM89], andwhich applies to coalgebras of arbitrary functors T .

Definition 2.7.1 Let T be a functor. Take two T -coalgebras (X, αX : X!

T (X)) and (Y, αY : Y ! T (Y )). A T -bisimulation between (X, αX) and(Y, αY ) is a relation R � X � Y for which there exists a T -coalgebra struc-ture γ : R! T (R) such that the two projection functions π1 : R! X and

Page 94: advanced topics in biosimulation and coinduction

78 Bart Jacobs and Jan Rutten

π2 : R! Y are homomorphisms of T -coalgebras:

X

αX

Rπ1�� π2

γ

Y

αY

T (X) T (R)

T (π1)��

T (π2) T (Y )

We call a bisimulation between a coalgebra (X, αX) and itself a bisimulationon X. And we use the following notation:

x � x0 () there exists a T -bisimulation R on X with (x, x0) 2 R.

The general formulation of the coinduction proof principle is now as follows.

Theorem 2.7.2 Let c : Z�D�! T (Z) be the final T -coalgebra. For all z and z0

in Z,

if z � z0 then z D z0. (cpp)

As in the example above, the proof of this principle is immediate by finality:both the projections π1 and π2 are homomorphisms from (R, γ ) to the finalcoalgebra (Z, c). By finality, π1 D π2, which proves the theorem.

This general version of the coinduction proof principle is surprisingly pow-erful, notwithstanding the fact that the proof of cpp is almost trivial. The readeris referred to [Rut00] for further examples of definitions and proofs by coinduc-tion. In Section 2.8, we shall see how this coalgebraic notion of bisimulationcoincides with the classical notion of Park and Milner for the case of processes.

There exist other formalisations of the notion of bisimulation: in [HJ98]a bisimulation is described as a coalgebra in a category of relations, for asuitably lifted functor (associated with the original functor T ); in the context of(coalgebraic) modal logic the notion of behavioural equivalence if often used,see e.g. [CP07, Kli07]; in [JNW96], bisimulations occur as spans of so-calledopen maps; and in [Bar03, CHL03], stronger versions of bisimulation (andcoinduction) are given called λ-bisimulations. But in a set-theoretic context, theabove definition seems to be most convenient. Simulations, or ‘bisimulations’in one direction only, are described in [HJ04].

The above categorical definition of bisimulation can be seen to be the formal(categorical) dual of the notion of congruence on algebras, which for T -algebras(U, a) and (V, b) can be defined as a relation R � U � V for which there existsa T -algebra structure c : T (R)! R such that the two projection functions

Page 95: advanced topics in biosimulation and coinduction

An introduction to (co)algebra and (co)induction 79

π1 : R! U and π2 : R! V are homomorphisms of T -algebras:

T (U )

a

T (R)T (π1)��

c

T (π2) T (V )

b

U Rπ1

��π2

V

Using the above notions of congruence on algebras and bisimulation on coalge-bras, the duality between induction and coinduction can be succinctly expressedas follows. For initial algebras (A, a), we have:

for every congruence relation R � A � A , �A � R

where �A D f(a, a) j a 2 A g is the diagonal on A. Dually, for final coalgebras(Z, z) we have the following:

for every bisimulation relation R � Z � Z , R � �Z .

One can show that the above property of initial algebras is precisely the familiarinduction principle on algebras such as the natural numbers. (The above prop-erty of final coalgebras is trivially equivalent to the formulation of Theorem2.7.2.) We refer the reader to [Rut00, Section 13] for further details.

2.8 Processes coalgebraically

In this section, we shall present labelled transition systems as coalgebras of acertain ‘behaviour’ functor B. We shall see that the corresponding coalgebraicnotion of bisimulation coincides with the classical notion of Park and Milner.Finally, we shall introduce the final coalgebra for the functor B, the elementsof which can be seen as (canonical representatives of) processes.

A (possibly non-deterministic) transition system (X,A,�!X) consists ofa set X of states, a set A of transition labels, and a transition relation �!X�

X � A �X. As usual, we write xa�!X x0 for transitions (x, a, x0) 2�!X.

Consider the functor B defined by

B(X) D P(A �X) D fV j V � A �Xg

A labeled transition system (X,A,�!X) can be identified with a B-coalgebra(X, αX : X! B(X)), by putting

(a, x0) 2 αX(x) () xa�!X x0.

Page 96: advanced topics in biosimulation and coinduction

80 Bart Jacobs and Jan Rutten

In other words, the class of all labelled transition systems coincides with theclass of all B-coalgebras. Let (X,A,�!X) and (Y,A,�!Y ) be two labelledtransition systems with the same set A of labels. An interesting question is whata coalgebra homomorphism between these two transition systems (as coalge-bras (X, αX) and (Y, αY )) is, in terms of the transition structures �!X and�!Y . Per definition, a B-homomorphism f : (X, αX)! (Y, αY ) is a func-tion f : X! Y such that B(f ) ı αX D αY ı f , where the function B(f ), alsodenoted by P(A � f ), is defined by

B(f )(V ) D P(A � f )(V ) D fha, f (s)i j ha, si 2 V g.

One can easily prove that the equality B(f ) ı αX D αY ı f is equivalent to thefollowing two conditions, for all x 2 X:

(1) for all x0 in X, if xa�!X x0 then f (x)

a�!Y f (x0);

(2) for all y in Y , if f (x)a�!Y y then there is an x0 in X with x

a�!X x0 and

f (x0) D y.

Thus a homomorphism is a function that preserves and reflects transitions.This notion is quite standard, but sometimes only preservation is required, seee.g. [JNW96].

There is the following well-known notion of bisimulation for transitionsystems [Mil89, Par81]: a bisimulation between transition systems X and Y (asabove) is a relation R � X � Y satisfying, for all (x, y) 2 R,

(i) for all x0 in X, if xa�!X x0 then there is y0 in Y with y

a�!Y y0 and (x0, y0)

2 R;(ii) for all y0 in Y , if y

a�!Y y0 then there is x0 in X with x

a�!X x0 and (x0, y0)

2 R.

For the relation between this notion of bisimulation and the notion of zig-zagrelation from modal logic, see Chapter 1.

The coalgebraic notion of B-bisimulation (Definition 2.7.1) coincides withthe above definition: If R is a B-bisimulation then conditions (i) and (ii) followfrom the fact that both π1 and π2 are homomorphisms. Conversely, any relationR satisfying (i) and (ii) above can be seen to be a B-bisimulation by defininga coalgebra structure γ : R! B(R) as follows:

γ (x, y) D f < a, (x0, y0) > j xa�!X x0 and y

a�!Y y0 and (x0, y0) 2 R g.

One then readily proves that π1 and π2 are homomorphisms.

Page 97: advanced topics in biosimulation and coinduction

An introduction to (co)algebra and (co)induction 81

A concrete example of a bisimulation relation between two transition sys-tems X and Y is the following. Consider two systems X and Y :

X D

⎛⎜⎜⎜⎝x0

a

b x1

a

b

x00 x01

⎞⎟⎟⎟⎠ Y D

⎛⎜⎜⎜⎜⎜⎝y

a

���� b��

y0

⎞⎟⎟⎟⎟⎟⎠ .

The relation

f (xi, xj ) j i, j 0g [ f(x0i , x0j ) j i, j 0g

is then a bisimulation on X. And

R D f(xi, y) j i 0g [ f(x0i , y0) j i 0g

is a bisimulation between X and Y . The latter relation R is called a functionalbisimulation because it is the graph

f(x, f (x)) j x 2 X g

of a homomorphism f : X! Y defined by f (xi) D y and f (x0i ) D y0. Notethat there exists no homomorphism in the reverse direction from Y to X.

For cardinality reasons, a final B-coalgebra cannot exist: by Lemma 2.6.4(ii),any final coalgebra is a fixed point: X �D P(A �X), and such a set does notexist because the cardinality of P(A �X) is strictly greater than that of X

(for non-empty sets of labels A). Therefore we restrict to so-called finitelybranching transition systems, satisfying, for all states s,

fha, si j sa�!X s0 g is finite.

Such systems can be identified with coalgebras of the functor

Bf (X) D Pf (A �X) D fV � A �X j V is finiteg.

For this functor, a final coalgebra does exist. The proof, which is a bit technical,is due to Barr [Bar93] (see also [RT94, Rut00]), and is omitted here (cf. thediscussion in Section 2.2).

In what follows, let (�,π ) be the final Bf -coalgebra, which is unique upto isomorphism. Borrowing the terminology of concurrency theory, we call theelements of � processes and denote them by P,Q,R. As before, we shalldenote transitions by

Pa�! Q () (a,Q) 2 π (P ).

Page 98: advanced topics in biosimulation and coinduction

82 Bart Jacobs and Jan Rutten

Being a final coalgebra, (�,π ) satisfies the coinduction proof principle (The-orem 2.7.2): for all P,Q 2 �,

if P � Q then P D Q.

The following theorem shows that we can view the elements of � as canonical,minimal representatives of (finitely branching) labelled transition systems.

Theorem 2.8.1 Let (X,αX) be a Bf -coalgebra, that is, a finitely branchinglabelled transition system. By finality, there is a unique homomorphism f :(X,αX)! (�,π ). It satisfies, for all x, x0 2 X:

x � x0 () f (x) D f (x0).

Proof The implication from left to right follows from the fact that homomor-phisms are (functional) bisimulations and the coinduction proof principle. Forthe implication from right to left, note that

R D f(x, x0) 2 X �X j f (x) D f (x0) g

is a bisimulation relation on X. �

In conclusion of the present section, we define a number of operators onprocesses by coinduction, and then prove various of their properties by thecoinduction proof principle.

As a first example, we define a non-deterministic merge operation on pro-cesses. To this end, we supply � �� with a Bf -coalgebra structure

μ : � ��! Bf (� ��)

defined by

μhP,Qi D fha, hP 0,Qii j Pa�! P 0g [ fha, hP,Q0ii j Q

a�! Q0g. (2.5)

By finality of �, there exists a unique Bf -homomorphism

merge : � ��! �.

We shall use the following standard notation:

P j Q � mergehP,Qi.

It follows from the fact that merge is a homomorphism of transition systems,i.e. from

Bf (merge) ı μ D π ımerge

Page 99: advanced topics in biosimulation and coinduction

An introduction to (co)algebra and (co)induction 83

that it satisfies precisely the following rules:

Pa�! P 0

P j Qa�! P 0 j Q

andQ

a�! Q0

P j Qa�! P j Q0

. (2.6)

The function j satisfies a number of familiar properties. Let 0 be the terminatedprocess: formally,

0 D π�1(;)

for which no transitions exist. The following equalities

(1) 0 j P D P ;(2) P j Q D Q j P ;(3) (P j Q) j R D P j (Q j R),

are a consequence of (cpp) and the fact that the following relations are bisim-ulations on �:

(a) f(0 j P, P ) j P 2 �g;(b) f(P j Q, Q j P ) j P,Q 2 �g;(c) f((P j Q) j R, P j (Q j R)) j P,Q,R 2 �g.

For instance, the first relation (a) is a bisimulation because we have transitions,for any P in �:

0 j Pa�! 0 j P 0 if and only if P

a�! P 0,

and (0 j P 0, P 0) is again in the relation. For the second relation (b), consider apair of processes (P j Q, Q j P ), and suppose that we have a transition step

P j Qa�! R,

for some process R in �. (The other case, where a first step of Q j P isconsidered, is proved in exactly the same way.) It follows from the definitionof merge that one of the following two situations applies: either there exists

a transition Pa�! P 0 and R D P 0 j Q, or there exists a transition Q

a�! Q0

and R D P j Q0. Let us consider the first situation, the second being similar.

If Pa�! P 0 then it follows again from the rules above that there exists also a

transition

Q j Pa�! Q j P 0.

Page 100: advanced topics in biosimulation and coinduction

84 Bart Jacobs and Jan Rutten

But then we have mimicked the transition step of P j Q by a transition step ofQ j P , in such a way that the resulting processes are again in the relation:

(P 0 j Q, Q j P 0)

is again a pair in relation (b). This shows that also relation (b) is a bisimulation.For (c), the same kind of argument can be given.

Let us return for a moment to the coinductive definition of the merge operatorabove. There is a very close correspondence between the two transition rules(2.6) and the definition (2.5) of the coalgebra structure μ on � ��. In fact, wecould take the transition rules as a specification of the merge operator we wereafter; then use these rules to define μ as above; and finally define the mergeoperator by the homomorphism into �, as we did above.

We illustrate this approach by the coinductive definition of a number ofprocess operators at the same time, which together constitute a simple CCS-like process calculus. Let the set Exp of syntactic expressions (denoted byE,F , etc.) be given by

E ::D 0

j a (for every a 2 A)

j P (for every P 2 �)

j E jF

j E CF

j E ; F .

Here we use the symbol hat to indicate that we are dealing with syntacticentities. For instance, for every process P 2 �, the set Exp contains a syntacticexpression P . Thus we have mappings A! Exp and �! Exp.

Next we define a transition relation on Exp by the following axioms andrules:

aa�! 0

Pa�! Q () P

a�! Q (() (a,Q) 2 π (P ))

Ea�! E0

E CFa�! E0

Fa�! F 0

E CFa�! F 0

Ea�! E0

E jFa�! E0 jF

Fa�! F 0

E jFa�! E jF 0

Ea�! E0

E ; Fa�! E0 ; F

E 6! and Fa�! F 0

E ; Fa�! F 0

.

Page 101: advanced topics in biosimulation and coinduction

An introduction to (co)algebra and (co)induction 85

Having such a transition structure on Exp, we can define a Bf -coalgebrastructure γ : Exp! Bf (Exp) by

γ (E) D fha, F i j Ea�! F g.

Note that by construction : �! Exp is now a coalgebra homomorphism.By finality of �, there exists a unique homomorphism h : (Exp, γ )!

(�,π ) which assigns to each syntactic expression E a corresponding processh(E) 2 �. We can use it to define semantic operators on � corresponding tothe syntactic operators on Exp, as follows:

0defD h(0)

adefD h(a)

P j QdefD h(P j Q)

P CQdefD h(P C Q)

P ; QdefD h(P ; Q).

(2.7)

In this manner, we have obtained three operators on processes P and Q: themerge P j Q; the choice P CQ; and the sequential composition P ; Q. (It isstraightforward to check that the present definition of the merge coincides withthe one given earlier.) The constant 0 is defined as the process that cannotmake any transitions (since the transition relation on Exp does not specify anytransitions for 0). As a consequence, 0 coincides with the terminated process(also denoted by 0) introduced earlier. The constant a denotes a process that cantake a single a-step to 0 and then terminates. Furthermore it is worth noticingthat the homomorphism h acts as the identity on processes; that is, h(P ) D P ,which can be easily proved by (ccp) or directly by finality of �. Also note thatit is possible to add recursive process definitions to the above, see for instance[RT94]. This would allow us to use guarded equations such as X D a ; X C b,

which would define a process P D h(X) with transitions Pa�! P and P

b�! 0.

In the above, we have exploited the finality of the set � of all processes todefine constants and operators by coinduction. Essentially the same procedurecan be followed to define operators on various other structures such as, forinstance, formal languages and power series [Rut03] and binary trees [SR07].

A question that naturally arises is under which conditions the above type ofdefinition scheme works, that is, when does it uniquely determine the operatorsone wants to define. As it turns out, this very much depends on the syntacticshape of the defining equations or, in terms of the transition relation defined onExp above, on the shape of the axioms and rules used to specify the transitionrelation. There is in fact a close relationship between the various syntactic

Page 102: advanced topics in biosimulation and coinduction

86 Bart Jacobs and Jan Rutten

transition system specification formats studied in the literature (such as GSOS,tyft-tyxt, and the like), on the one hand, and well-formed coinductive definitionschemes, on the other hand.

In conclusion of this section, let us indicate how the above construction ofsemantic operators out of operational specifications can be put into a generalcategorical perspective. First of all, we observe that the set Exp of expressionsis the initial algebra of the functor

T (X) D 1C AC�C (X �X)C (X �X)C (X �X)

where the constituents on the right correspond, respectively, to the constantsymbol 0; the elements a with a 2 A; the elements P with P 2 �; and thethree operations of merge, choice, and sequential composition. Above we hadalready supplied the set Exp with a Bf -coalgebra structure (Exp, γ ). ThereforeExp is a so-called bialgebra: a set which has both an algebra and a coalgebrastructure. Similarly, the definition of the semantic operators above (2.7) supplies�, which was defined as the final Bf -coalgebra, with a T -algebra structure,turning it thereby into a bialgebra as well. The relationship between the T -algebra and Bf -coalgebra structures on Exp and � is provided by the factthat the mapping h above is both a homomorphism of Bf -coalgebras and ahomomorphism of T -algebras. All of which can be pleasantly expressed by thefollowing diagram:

T (Exp)

�D

T (h) T (�)

Exp

h �

�D

Bf (Exp)

Bf (h) Bf (Y )

The interplay between algebra (syntactic operators) and coalgebra (theirbehaviour) has become an important topic of research within the coalgebra com-munity. For further reading see for instance [RT94] and [TP97, Bar03, Jac06].In these latter references, natural transformations called distributive laws areused to relate the syntax functor and the behaviour functor. Compositionalitythen comes for free. Other examples of the interplay between algebraic andcoalgebraic structure include recent generalisations of Kleene’s theorem andKleene algebra to large families of coalgebras, including processes, Mealymachines, and weighted and probabilistic systems [BRS09, BBRS09].

Page 103: advanced topics in biosimulation and coinduction

An introduction to (co)algebra and (co)induction 87

2.9 Trace semantics, coalgebraically

Let �!� X � A �X be a transition system as in the previous section. Aswe have seen, it may be written as a coalgebra (X,α : X! P(A �X)). Anexecution is a sequence of consecutive transition steps:

x0a0�! x1

a1�! x2

a2�!

A trace of this transition system is then a sequence ha0, a1, a2, . . .i of actionsoccurring in such an execution.

This section describes a systematic way to capture such traces coalge-braically, following [HJ05, HJS07], which is general and generic. Here weconcentrate on the powerset case. This involves both initial algebras andfinal coalgebras, in different ‘universes’. The description involves a numberof preparatory steps.

Finite executions and traces Our description applies to finite traces. In orderto capture them we introduce an additional symbol � for successful termination.We can do so by considering coalgebras of a slightly different functor, namelyP(1C A �X) with additional singleton set 1 D f�g. For a coalgebra α : X!

P(1C A �X) we then write xa�! x0 if (a, x0) 2 α(x) and x ! � if � 2 α(x).

We shall write F (X) D 1C A �X for the functor inside the powerset.Hence we concentrate on PF -coalgebras.

A finite execution is one that ends with �, as in x0a0�! x1

a1�!

an�1���!

xn ! �. A trace is called finite if it comes from such a finite execution. Weshall write tr(x) for the set of finite traces of executions that start in x 2 X.This yields a function tr : X! P(A) where A is the set of finite sequencesof elements of A. Notice that A is the initial algebra of the functor F , seeExample 2.5.6.

A category of relations A map of the form X! P(Y ) can be seen as a ‘non-deterministic’ function that yields a set of outcomes in Y for a single inputelement from X. It may be identified with a relation between X and Y , i.e. witha subset of the product X � Y . We can understand such a function/relation asan arrow in a category Rel of sets and relations.

This category Rel has ordinary sets as objects. Morphism X! Y in Relare ordinary functions X! P(Y ). They can be composed via ‘relational’composition. For arrows f : X! Y and g : Y ! Z in Rel we have to form g ı

f : X! Z. As ordinary functions we define g ı f : X! P(Z) for f : X!

P(Y ) and g : Y ! P(Z), by:

(g ı f )(x) D⋃fg(y) j y 2 f (x)g. (2.8)

Page 104: advanced topics in biosimulation and coinduction

88 Bart Jacobs and Jan Rutten

Notice that our notation is now (deliberately) ambiguous, depending on thecategory (or universe) in which we work. An arrow X! Y in Set is an ordinaryfunction from X to Y , but an arrow X! Y in Rel is a ‘non-deterministic’function X! P(Y ).

It is not hard to see that the singleton map f�g : X! P(X) forms the identitymap X! X on the object X in the category Rel. Explicitly, f�g ı f D f andg ı f�g D g, for relational composition ı.

There is an obvious functor J : Set! Rel that sends a set X to itself and afunction f : X! Y to its graph relation f(x, f (x)) j x 2 Xg. This graph may

be identified with the composite Xf�! Y

f�g�! P(Y ).

Lifting the functor For the main result of this section we need to consider aPF -coalgebra (X,α : X! P(F (X))) as an F -coalgebra (X,α : X! F (X)),by moving to the category Rel. Indeed, a map X! P(F (X)) is an arrowX! F (X) in Rel. In order to understand it as coalgebra we need to knowthat F is – or lifts to – a functor F : Rel! Rel. It is obvious how such liftingworks on objects, namely F (X) D F (X), but how it works on morphisms inRel requires some care.

For an arrow X! Y in Rel we need to construct a new map FX! FY

in Rel. That is, a function f : X! P(Y ) yields a function F (f ) : FX!

P(F (Y )), defined as follows.

1C A �XF (f ) P(1C A � Y )

� f�g(a, x) f(a, y) j y 2 f (x)g.

It is not hard to check that this ‘lifting’ of F : Set! Set to F : Rel! Relindeed preserves identities and composition – from Rel. It yields a commutingdiagram:

RelF Rel

Set

J

��

F Set

J

�� (2.9)

The trace theorem The following result (from [HJ05]) combines initial alge-bras and final coalgebras for a description of trace semantics.

Theorem 2.9.1 The initial F -algebra in Set yields a final F -coalgebra inRel. �

Page 105: advanced topics in biosimulation and coinduction

An introduction to (co)algebra and (co)induction 89

There are several ways to prove this result. A particularly snappy proof ispresented in [HJS07, theorem 3.8]; it uses adjunctions and is therefore outsidethe scope of this chapter. Here we omit the proof and concentrate on therelevance of this result for trace semantics.

So we first spell out what is actually stated in the theorem. Recall fromExample 2.5.6 that the initial algebra of the functor F D 1C A � (�) is theset A of finite sequences of elements in A with operations [nil, cons] : 1C

A � A�D�! A. Since this initial algebra is an isomorphism, we can consider

its inverse A�D�! F (A), formally as an isomorphism in the category Set.

By applying the functor J : Set! Rel from the diagram (2.9) this yields anisomorphism in Rel

A D J (A)�D J (F (A)) D F (J (A)) D F (A),

which is an F -coalgebra (recall that F is F and J the identity on objects/sets).The theorem claims that this map is the final F -coalgebra in Rel.

In order to clarify this switch of categories we go a bit deeper into the details.

Let’s write β D [nil, cons]�1 : A�D�! 1C A � A D F (A) for the inverse of

the initial algebra (in Set). It yields J (β) D f�g ı β : A ! P(F (A)). Weclaim that this β is an isomorphism A ! F (A), an isomorphism in thecategory Rel! This J (β) may not look like an isomorphism, but we have tokeep in mind that composition in Rel, as described in (2.8), is different fromcomposition in Set. In general, for an isomorphism f : Y ! X in Set we havein Rel:

(J (f ) ı J (f �1)

)(x) D

⋃{J (f )(y) j y 2 J (f �1)(x)

}by (2.8)

D⋃{ff (y)g j y 2 ff �1(x)

}D ff (f �1(x))gD fxg

D idX(x)

where the latter identity map idX is the identity in Rel, given by the singletonmap.

Assume now that we have a transition system α : X! P(1C A �X) asin the beginning of this section. We may now understand it as an F -coalgebraX! F (X). We shall do so and continue to work in the category Rel. The

Page 106: advanced topics in biosimulation and coinduction

90 Bart Jacobs and Jan Rutten

finality claimed in the theorem then yields a unique homomorphism in:

X

α

tr A

�D

F (X)F (tr) F (A)

It is essential that this is a diagram in the category Rel. We shall unravel whatcommutation means, using composition as in (2.8). The composite F (tr) ı α isthe relation on X � (1C A � A) consisting of:

f(x,�) j � 2 α(x)g [ f(x, (a, σ )) j 9x0. (a, x0) 2 α(x) ^ σ 2 tr(x0)g.

The other composition, �D ı tr, yields the relation:

f(x,�) j nil 2 tr(x)g [ f(x, (a, σ )) j cons(a, σ ) 2 tr(x)g.

The equality of these sets yields the defining clauses for trace semantics,namely:

nil 2 tr(x)() x ! �cons(a, σ ) 2 tr(x)() 9x0. x

a�! x0 ^ σ 2 tr(x0),

where we have used the transition notation for the coalgebra α.What we thus see is that the abstract idea of finality (for coalgebras) makes

sense not only in the standard category/universe of sets and functions, but alsoin the world of sets and relations. This genericity can only be formulated andappreciated via the language of categories. It demonstrates clearly why thetheory of coalgebras relies so heavily on category theory.

Theorem 2.9.1 allows for considerable generalisation. The crucial aspect ofthe powerset that is used is that it is a so-called monad, with the category Rel asits ‘Kleisli’ category. The result may be formulated more generally for suitablemonads and functors F , see [HJS07]. It can then also be applied to probabilistictransition systems, and even to a combination of probabilistic and possibilistic(non-deterministic) systems (see [Jac08]).

2.10 Exercises

Exercise 2.10.1 Use initiality to define a function sum : N ! N such thatsum(nil) D 0 and

sum(a1, . . . , an) D a1 C C an

for all (a1, . . . , an) 2 N.

Page 107: advanced topics in biosimulation and coinduction

An introduction to (co)algebra and (co)induction 91

Exercise 2.10.2 Use initiality to define a function L : N! N such that

L(n) D (0, 1, 2, . . . , n)

for all n 0. Same question, now for H : N! N such that H (0) D h i and

H (n) D (0, 1, 2, . . . , n � 1)

for all n 1.

Exercise 2.10.3 A preorder (P,�) can be viewed as a category. Objects arethe elements of P and we have an arrow p! q iff p � q. An order-preservingfunction f : P ! P can then be seen as a functor from the category P to itself.Show that least fixed points of f are precisely the initial algebras and thatgreatest fixed points correspond to final coalgebras.

Exercise 2.10.4 The set of (finite) binary trees with (node) labels in a givenset A can be defined as the initial algebra BTA of the functor

B(X) D 1C (X � A �X).

Use initiality to define a function size : BTA ! N. Next use initiality to definetwo tree traversal functions of type BTA ! A that flatten a tree into a wordconsisting of its labels: one depth-first and one breadth-first.

Exercise 2.10.5 Let us call a relation R � N � N a congruence if (0, 0) 2 Rand

if (n,m) 2 R then (S(n), S(m)) 2 R

for all (n,m) 2 N � N.

(i) Show that any relation R � N � N is a congruence iff there exists analgebra structure ρ : 1CR! R such that the projections π1 : R! Nand π2 : R! N are algebra homomorphisms.

(ii) Let � D f(n, n) j n 2 N g. Use the initiality of N to show:

(�) if R is a congruence relation then � � R.

(iii) Show that (�) is equivalent to the principle of mathematical induction,which says, for any predicate P � N,

if P (0) and 8n 2 N : P (n)) P (nC 1), then 8n 2 N : P (n).

(iv) Note that the characterisation of congruence in (i) above is, in a precisesense, dual to the definition of T -bisimulation, for the functor T (X) D1CX.

Page 108: advanced topics in biosimulation and coinduction

92 Bart Jacobs and Jan Rutten

Exercise 2.10.6 Use finality to define a function merge3 : (AN)3 ! AN suchthat

merge3(σ, τ, ρ) D (σ (0), τ (0), ρ(0), σ (1), τ (1), ρ(1), . . .).

Next use merge3 to define the function merge2,1 at the end of Section 2.3.

Exercise 2.10.7 Show that the singleton set 1 D f�g is (the carrier of) a finalcoalgebra for the functor T (X) D X. Show that it is also a final coalgebra forthe functor T (X) D XA, with A an arbitrary non-empty set.

Exercise 2.10.8 Is it possible to define the factorial function F : N! N givenby F (n) D n! by initiality? Hint: define by initiality a function G : N! N � Nsuch that π1 ıG D S, the successor function, and π2 ıG D F .

Exercise 2.10.9 Let 2 D f0, 1g and let A be an arbitrary non-empty set. Weconsider T (X) D 2 �XA. We view a T -coalgebra (o, n) : X! 2 �XA as adeterministic automaton with transitions

xa�! y () n(x)(a) D y.

A state x is accepting (final) iff o(x) D 1. Consider the set

P(A) D fL j L � A g

of languages over A. Define for L � A

o(L) D 1 () h i 2 L

n(L)(a) D fw 2 A j cons(a,w) 2 L g.

Now show that (P(A), (o, n)) is a final T -coalgebra. Hint: show that thereis a unique homomorphism from any T -coalgebra (o, n) : X! 2 �XA into(P(A), (o, n)) mapping any state x 2 X to the language that it accepts.

Exercise 2.10.10 Let T (X) D 2 �XA, as in Exercise 2.10.9, and consider a T -coalgebra (o, n) : X! 2 �XA. Show that if x and x0 in X are T -bisimilar thenthey are mapped by the final homomorphism to the same language. Concludefrom this observation that T -bisimilarity is language equivalence.

Exercise 2.10.11 Let A be an arbitrary non-empty set. We view a (�)A-coalgebra n : X! XA as a deterministic automaton with transitions

xa�! y () n(x)(a) D y.

For x 2 X we define xε D x and

xw�a D n(xw)(a).

Page 109: advanced topics in biosimulation and coinduction

An introduction to (co)algebra and (co)induction 93

The set A carries a (�)A-coalgebra structure γ : A ! (A)A given by

γ (w)(a) D w a.

Show that for any (�)A-coalgebra n : X! XA with initial state xo : 1! X

there exists a unique (�)A-coalgebra homomorphism r : (A, γ )! (X, n)such that

r(w) D (x0)w.

(The function r could be called the reachability map.)

Exercise 2.10.12 Use finality to define, for any function f : A! A, a functioniteratef : A! AN satisfying

iteratef (a) D (a, f (a), f ı f (a), . . .).

Exercise 2.10.13 Show by the coinduction proof principle (cpp) that

even ı iteratef D iteratef ıf

where even is defined in Equation (2.3) of Section 2.3.

Exercise 2.10.14 Prove by the coinduction proof principle (cpp) that

odd(merge(σ, τ )) D τ

for all σ, τ 2 AN. (See Section 2.3 for the definitions of odd and merge.)

Exercise 2.10.15 For a stream σ 2 AN we define

σ (0) � head(σ )

σ 0 � tail(σ )

and call these the initial value and the stream derivative of σ . Let a 2 A andconsider the following stream differential equation:

σ (0) D a σ 0 D σ .

Compute the unique solution of this equation. For a, b 2 A, compute the solu-tion of the following system of equations:

σ (0) D a σ 0 D τ

τ (0) D b τ 0 D σ .

Page 110: advanced topics in biosimulation and coinduction

94 Bart Jacobs and Jan Rutten

Exercise 2.10.16 Which function f : AN ! AN is the solution of the following(functional) stream differential equation?:

f (σ )(0) D σ (0)

f (σ )0 D f (σ 0).

Exercise 2.10.17 The following system of stream differential equations(uniquely) defines two functions˚,˝ : NN � NN ! NN:

(σ ˚ τ )(0) D σ (0)C τ (0) (σ ˚ τ )0 D σ 0 ˚ τ 0

(σ ˝ τ )(0) D σ (0) � τ (0) (σ ˝ τ )0 D (σ 0 ˝ τ ) ˚ (σ ˝ τ 0).

Show that, for all n 0:

(σ ˚ τ )(n) D σ (n)C τ (n)

(σ ˝ τ )(n) Dn∑

kD0

(n

k.

)� σ (k) � τ (n � k)

Exercise 2.10.18 Prove by the coinduction proof principle (cpp) that

(P CQ); R D (P ; R)C (Q; R)

for all processes P,Q,R 2 �.

Bibliography

[Ada03] J. Adamek. On final coalgebras of continuous functors. Theoretical Com-puter Science, 294:3–29, 2003.

[AM75] M.A. Arbib and E.G. Manes. Arrows, Structures and Functors. The Cate-gorical Imperative. Academic Press, 1975.

[AM82] M.A. Arbib and E.G. Manes. Parametrized data types do not needhighly constrained parameters. Information and Control, 52:139–158,1982.

[AM89] P. Aczel and N. Mendler. A final coalgebra theorem. In D.H. Pitt, A. Poigne,and D.E. Rydeheard, editors, Category Theory and Computer Science,number 389 in Lecture Notes Computer Science, pages 357–365. Springer,1989.

[Awo06] S. Awodey. Category Theory. Oxford University Press, 2006.[Bar93] M. Barr. Terminal coalgebras in well-founded set theory. Theoretical Com-

puter Science, 114(2):299–315, 1993. Corrigendum in Theoretical Com-puter Science 124:189–192, 1994.

[Bar03] F. Bartels. Generalised coinduction. Mathematical Structures in ComputerScience, 13(2):321–348, 2003.

Page 111: advanced topics in biosimulation and coinduction

An introduction to (co)algebra and (co)induction 95

[BBRS09] F. Bonchi, M.M. Bonsangue, J.J.M.M. Rutten, and A. Silva. Deriving syn-tax and axioms for quantitative regular behaviours. In International Con-ference on Concurrency Theory (CONCUR 2009), Lecture Notes ComputerScience, Springer, 2009.

[BD94] R. Burstall and R. Diaconescu. Hiding and behaviour: an institutionalapproach. In A.W. Roscoe, editor, A Classical Mind. Essays in Honourof C.A.R. Hoare, pages 75–92. Prentice Hall, 1994.

[BM96] J. Barwise and L.S. Moss. Vicious Circles: On the Mathematics of Non-wellfounded Phenomena. CSLI Lecture Notes 60, Stanford, 1996.

[Bor94] F. Borceux. Handbook of Categorical Algebra, volume 50, 51 and 52 ofEncyclopedia of Mathematics. Cambridge University Press, 1994.

[BRS09] M.M. Bonsangue, J.J.M.M. Rutten, and A. Silva. Algebras for Kripkepolynomial coalgebras. In A. Pitts, editor, Logic in Computer Science.IEEE, Computer Science Press, 2009.

[BV96] J.W. de Bakker and E. Vink. Control Flow Semantics. MIT Press, 1996.[BW90] M. Barr and Ch. Wells. Category Theory for Computing Science. Prentice

Hall, 1990.[CHL03] D. Cancila, F. Honsell and M. Lenisa. Generalized coiteration schemata.

In H.P. Gumm, editor, Coalgebraic Methods in Computer Science, number82(1) in Electronic Notes in Theoretical Computer Science, Elsevier, 2003.

[Coh81] P.M. Cohn. Universal Algebra, volume 6 of Mathematics and its Applica-tions. Reidel, 1981.

[CP07] C. Cırstea and D. Pattinson. Modular proof systems for coalgebraic logics.Theoretical Computer Science, 388:83–108, 2007.

[Cro93] R.L. Crole. Categories for Types. Cambridge Mathematical Textbooks.Cambridge University Press, 1993.

[CS95] J.R.B. Cockett and D. Spencer. Strong categorical datatypes II: A term logicfor categorical programming. Theoretical Computer Science, 139:69–113,1995.

[EM85] H. Ehrig and B. Mahr. Fundamentals of Algebraic Specification I: Equa-tions and Initial Semantics. Number 6 in EATCS Monographs. Springer,1985.

[Fio96] M.P. Fiore. A coinduction principle for recursive data types based on bisim-ulation. Information and Computation, 127(2):186–198, 1996.

[GD94] J.A. Goguen and R. Diaconescu. Towards an algebraic semantics for theobject paradigm. In H. Ehrig and F. Orejas, editors, Recent Trends in DataType Specification, number 785 in Lecture Notes in Computer Science,pages 1–29. Springer, 1994.

[GGM76] V. Giarrantana, F. Gimona, and U. Montanari. Observability concepts inabstract data specifications. In A. Mazurkiewicz, editor, MathematicalFoundations of Computer Science, number 45 in Lecture Notes in Com-puter Science, pages 576–587. Springer, 1976.

[GM82] J.A Goguen and J. Meseguer. Universal realization, persistent intercon-nection and implementation of abstract modules. In M. Nielsen and E.M.Schmidt, editors, International Colloquium on Automata, Languages andProgramming, number 140 in Lecture Notes in Computer Science, pages263–281. Springer, 1982.

Page 112: advanced topics in biosimulation and coinduction

96 Bart Jacobs and Jan Rutten

[GM93] M.J.C. Gordon and T.F. Melham. Introduction to HOL: A Theorem Pro-ing Environment for Higher Order Logic. Cambridge University Press,1993.

[GM94] J.A. Goguen and G. Malcolm. Proof of correctness of object represen-tations. In A.W. Roscoe, editor, A Classical Mind. Essays in Honour ofC.A.R. Hoare, pages 119–142. Prentice Hall, 1994.

[GM96] J.A. Goguen and G. Malcolm. An extended abstract of a hidden agenda.In J. Meystel, A. Meystel, and R. Quintero, editors, Proceedings of theConference on Intelligent Systems: A Semiotic Perspective, pages 159–167.National Institute of Standards and Technology, 1996.

[GTW78] J.A. Goguen, J. Thatcher, and E. Wagner. An initial algebra approach tothe specification, correctness and implementation of abstract data types. InR. Yeh, editor, Current Trends in Programming Methodoloy, pages 80–149.Prentice Hall, 1978.

[Gum99] H.P. Gumm. Elements of the general theory of coalgebras. Notes of lecturesgiven at LUATCS’99: Logic, Universal Algebra, Theoretical ComputerScience, Johannesburg. Available aswww.mathematik.uni-marburg.de/˜gumm/Papers/Luatcs.ps, 1999.

[HJ98] C. Hermida and B. Jacobs. Structural induction and coinduction in a fibra-tional setting. Information and Computer, 145:107–152, 1998.

[HJ04] J. Hughes and B. Jacobs. Simulations in coalgebra. Theoretical ComputerScience, 327(1–2):71–108, 2004.

[HJ05] I. Hasuo and B. Jacobs. Context-free languages via coalgebraic trace seman-tics. In J.L. Fiadeiro, N. Harman, M. Roggenbach, and J. Rutten, edi-tors, Algebra and Coalgebra in Computer Science (CALCO’05), number3629 in Lecture Notes in Computer Science, pages 213–231. Springer,2005.

[HJS07] I. Hasuo, B. Jacobs, and A. Sokolova. Generic trace theory. Logical Methodsin Computer Science, 3(4:11), 2007.

[HL95] F. Honsell and M. Lenisa. Final semantics for untyped λ-calculus. InM. Dezani-Ciancaglini and G. Plotkin, editors, Typed Lambda Calculi andApplications, number 902 in Lecture Notes in Computer Science, pages249–265. Springer, 1995.

[HP95] M. Hofmann and B.C. Pierce. A unifying type-theoretic framework forobjects. Journal of Functional Programming, 5(4):593–635, 1995.

[Jac95] B. Jacobs. Parameters and parametrization in specification using distribu-tive categories. Fundamental Informaticae, 24(3):209–250, 1995.

[Jac96a] B. Jacobs. Inheritance and cofree constructions. In P. Cointe, editor, Euro-pean Conference on Object-Oriented Programming, number 1098 in Lec-ture Notes in Computer Science, pages 210–231. Springer, 1996.

[Jac96b] B. Jacobs. Objects and classes, co-algebraically. In B. Freitag, C.B. Jones,C. Lengauer, and H.-J. Schek, editors, Object-Orientation with Parallelismand Persistence, pages 83–103. Kluwer, 1996.

[Jac06] B. Jacobs. A bialgebraic review of deterministic automata, regular expres-sions and languages. In K. Futatsugi, J.-P. Jouannaud, and J. Meseguer,editors, Algebra, Meaning and Computation: Essays Dedicated to Joseph

Page 113: advanced topics in biosimulation and coinduction

An introduction to (co)algebra and (co)induction 97

A. Goguen on the Occasion of His 65th Birthday, number 4060 in LectureNotes in Computer Science, pages 375–404. Springer, 2006.

[Jac08] B. Jacobs. Coalgebraic trace semantics for combined possibilistic and prob-abilistic systems. In J. Adamek and C. Kupke, editors, Coalgebraic Meth-ods in Computer Science, volume 203(5) of Electronic Notes in TheoreticalComputer Science, pages 131–152. Elsevier, 2008.

[JNW96] A. Joyal, M. Nielsen, and G. Winskel. Bisimulation from open maps. Infor-mation and Computation, 127(2):164–185, 1996.

[Kam83] S. Kamin. Final data types and their specification. ACM Transactions onProgramming Languages and Systems, 5(1):97–123, 1983.

[Kli07] B. Klin. Coalgebraic modal logic beyond sets. In M. Fiore, editor, Mathe-matical Foundations of Programming Semantics, number 173 in ElectronicNotes in Theoretical Computer Science, Elsevier, Amsterdam, 2007.

[Kur01] A. Kurz. Specifying coalgebras with modal logic. Theoretical ComputerScience, 260(1–2):119–138, 2001.

[Kur06] A. Kurz. Coalgebras and their logics. SIGACT News Logic Column,37(2):57–77, 2006.

[Lan71] S. Mac Lane. Categories for the Working Mathematician. Springer, 1971.[LS81] D.J. Lehmann and M.B. Smyth. Algebraic specification of data types: A

synthetic approach. Mathematical Systems Theory, 14:97–139, 1981.[LS86] J. Lambek and P.J. Scott. Introduction to Higher Order Categorical Logic.

Number 7 in Cambridge Studies in Advanced Mathematics. CambridgeUniversity Press, 1986.

[MA86] E.G. Manes and M.A. Arbib. Algebraic Appoaches to Program Semantics.Texts and Monographs in Computer Science. Springer, 1986.

[Mal96] G. Malcolm. Behavioural equivalence, bisimulation and minimal realisa-tion. In M. Haveraaen, O. Owe, and O.J. Dahl, editors, Recent Trendsin Data Type Specification, number 1130 in Lecture Notes in ComputerScience, pages 359–378. Springer, 1996.

[Man74] E.G. Manes. Algebraic Theories. Springer, 1974.[Mel89] T.F. Melham. Automating recursive type definitions in higher order logic. In

G. Birtwistle and P.A. Subrahmanyam, editors, Current Trends in HardwareVerification and Automated Theorem Proving, Lecture Notes in ComputerScience, pages 341–386. Springer, 1989.

[Mil89] R. Milner. A Calculus of Communicating Systems. Lecture Notes in Com-puter Science, Springer, 1989.

[MT92] K. Meinke and J.V. Tucker. Universal algebra. In S. Abramsky, Dov M.Gabbai, and T.S.E. Maibaum, editors, Handbook of Logic in ComputerScience, volume 1, pages 189–411. Oxford University Press, 1992.

[ORRC96] S. Owre, S. Rajan, J.M. Rushby, N. Shankar, and M. Srivas. PVS: Combin-ing specification, proof checking, and model checking. In R. Alur and T.A.Henzinger, editors, Computer Aided Verification, number 1102 in LectureNotes in Computer Science, pages 411–414. Springer, 1996.

[Par81] D.M.R. Park. Concurrency and automata on infinite sequences. InP. Deussen, editor, Proceedings 5th GI Conference on Theoretical Com-puter Science, number 104 in Lecture Notes in Computer Science, pages15–32. Springer, 1981.

Page 114: advanced topics in biosimulation and coinduction

98 Bart Jacobs and Jan Rutten

[Pau90] L.C. Paulson. Isabelle: The next 700 theorem provers. In P. Odifreddi,editor, Logic and Computer Science, pages 361–386. Academic Press, 1990.The APIC series, vol. 31.

[Pau97] L.C. Paulson. Mechanizing coinduction and corecursion in higher-orderlogic. Journal of Logic and Computation, 7:175–204, 1997.

[Pie91] B.C. Pierce. Basic Category Theory for Computer Scientists. MIT Press,1991.

[Pit94] A.M. Pitts. A co-induction principle for recursively defined domains. The-oretical Computer Science, 124(2):195–219, 1994.

[Pit96] A.M. Pitts. Relational properties of domains. Information and Computing,127(2):66–90, 1996.

[Plo81] G.D. Plotkin. A structural approach to operational semantics. ReportDAIMI FN-19, Aarhus University, 1981.

[PM93] Ch. Paulin-Mohring. Inductive definitions in the system Coq. Rules andproperties. In M. Bezem and J.F. Groote, editors, Typed Lambda Calculiand Applications, number 664 in Lecture Notes in Computer Science, pages328–345. Springer, 1993.

[PP02] D. Pavlovic and V. Pratt. The continuum as a final coalgebra. TheoreticalComputer Science, 280 (1–2):105–122, 2002.

[Rei95] H. Reichel. An approach to object semantics based on terminal co-algebras.Mathematical Structures in Computer Science, 5:129–152, 1995.

[Rou96] W.C. Rounds. Feature logics. In J. van Benthem and A. ter Meulen, editors,Handbook of Logic and Language. Elsevier, 1996.

[RT94] J. Rutten and D. Turi. Initial algebra and final coalgebra semantics forconcurrency. In J.W. de Bakker, W.P. de Roever, and G. Rozenberg, editors,A Decade of Concurrency, number 803 in Lecture Notes in ComputerScience, pages 530–582. Springer, 1994.

[Rut00] J. Rutten. Universal coalgebra: a theory of systems. Theoretical ComputerScience, 249:3–80, 2000.

[Rut03] J. Rutten. Behavioural differential equations: a coinductive calculus ofstreams, automata, and power series. Theoretical Computer Science, 308:1–53, 2003.

[SP82] M.B. Smyth and G.D. Plotkin. The category theoretic solution of recursivedomain equations. SIAM Journal of Computing, 11:761–783, 1982.

[SR07] A. Silva and J. Rutten. Behavioural differential equations and coinduc-tion for binary trees. In D. Leivant and R. de Queiroz, editors, Logic,Language, Information and Computation, 14th International Workshop,WoLLIC 2007, number 4576 in Lecture Notes in Computer Science, pages322–336. Springer, 2007.

[TP97] D. Turi and G. Plotkin. Towards a mathematical operational semantics.In G. Winskel, editor, Logic in Computer Science, pages 280–291. IEEE,Computer Science Press, 1997.

[Tur96] D. Turi. Functorial operational semantics and its denotational dual. PhDthesis, Free University Amsterdam, 1996.

[Wal91] R.F.C. Walters. Categories and Computer Science. Carslaw Publications,Sydney, 1991. Also available as: Cambridge Computer Science Text 28,1992.

Page 115: advanced topics in biosimulation and coinduction

An introduction to (co)algebra and (co)induction 99

[Wec92] W. Wechler. Universal Algebra for Computer Scientists. Number 25 inEATCS Monographs. Springer, Berlin, 1992.

[Wir90] M. Wirsing. Algebraic specification. In J. van Leeuwen, editor, Handbookof Theoretical Computer Science, volume B, pages 673–788. Elsevier/MITPress, 1990.

Page 116: advanced topics in biosimulation and coinduction

3

The algorithmics of bisimilarity

luca aceto, anna ingolfsdottir and jir ı srba

3.1 Introduction

A model for reactive computation, for example that of labelled transitionsystems [Kel76], or a process algebra (such as ACP [BW90], CCS [Mil89], CSP[Hoa85]) can be used to describe both implementations of processes and spec-ifications of their expected behaviours. Process algebras and labelled transitionsystems therefore naturally support the so-called single-language approach toprocess theory, that is, the approach in which a single language is used todescribe both actual processes and their specifications. An important ingredi-ent of the theory of these languages and their associated semantic models istherefore a notion of behavioural equivalence or behavioural approximationbetween processes. One process description, say SYS, may describe an imple-mentation, and another, say SPEC, may describe a specification of the expectedbehaviour. To say that SYS and SPEC are equivalent is taken to indicate thatthese two processes describe essentially the same behaviour, albeit possiblyat different levels of abstraction or refinement. To say that, in some formalsense, SYS is an approximation of SPEC means roughly that every aspect ofthe behaviour of this process is allowed by the specification SPEC, and thusthat nothing unexpected can happen in the behaviour of SYS. This approach toprogram verification is also sometimes called implementation verification orequivalence checking.

Designers using implementation verification to validate their (models of)reactive systems need only learn one language to describe both their systemsand their specifications, and can benefit from the intrinsic compositionalityof their descriptions, at least when they are using a process algebra for denotingthe labelled transition systems in their models and an equivalence (or preorder)that is preserved by the operations in the algebra. Moreover, specificationspresented as labelled transitions or as terms in a process algebra are rather

100

Page 117: advanced topics in biosimulation and coinduction

The algorithmics of bisimilarity 101

detailed and typically describe both what a correct system should do and whatbehaviour it cannot afford. An implementation that conforms to such a detailedspecification offers excellent correctness guarantees.

The single-language approach to the specification and verification of reac-tive systems underlies much of the work on process algebras, and several ofthe early classic textbooks on those languages, such as the above-mentionedones, present verifications of non-trivial concurrent systems using equivalenceor preorder checking. (See also the book [Bae90], which is entirely devoted toearly applications of the process algebra ACP.) It became clear, however, ratherearly on in the development of verification techniques from the field of pro-cess algebra and in their application in the verification of case studies that toolsupport was necessary in the analysis of the behaviour of models of real-lifecomputing systems. This realisation was, amongst others, a powerful incentivefor the work on the development of software tools for computer-aided veri-fication based on process-algebraic verification techniques and on the modelof labelled transition systems underlying them. Examples of such tools arethe Edinburgh Concurrency Workbench and its successors [CPS93, CS96],CADP [GLMS07] and mCRL2 [GKMC08].

In order to develop suitable tools for computer-aided verification and tounderstand their limitations, researchers needed to answer some of the mostbasic and fundamental questions that are naturally associated with the algorith-mic problems underlying implementation verification.

� What equivalences or preorders over labelled transition systems are decid-able, and over what classes of labelled transition systems?

� What equivalences or preorders are efficiently decidable over finite labelledtransition systems or parallel compositions of such systems? And if so, bywhat algorithms?

� Are there equivalences that are (efficiently) decidable over classes of infinitelabelled transition systems that can be ‘finitely specified’?

� What is the computational complexity of checking decidable equivalences orpreorders over ‘interesting’ classes of labelled transition systems? Can onecome up with matching lower and upper bounds?

Apart from their usefulness in the development of the algorithmics of imple-mentation verification, the questions above are of intrinsic and fundamentalscientific interest within the field of concurrency theory and related fields ofcomputer science. Indeed, the results that have been obtained over the years inan attempt to solve the algorithmic problems associated with equivalence andpreorder checking over labelled transition systems and related models have putthe theory of processes on a par with the classic theory of automata and formal

Page 118: advanced topics in biosimulation and coinduction

102 Luca Aceto, Anna Ingolfsdottir and Jirı Srba

languages (see, for instance, the textbooks [HU79, Sip06]) in terms of depthand elegance.

In this chapter, we shall address some of these questions and present classicresults that have been achieved in the literature on concurrency theory sincethe 1980s. We shall mostly focus on (variations on) bisimilarity as the chosennotion of equivalence between (states in) labelled transition systems, but, whereappropriate, we shall also hint at results that have been obtained for otherequivalences and preorders in the literature. Our presentation will largely followclassical lines of exposition in the field of concurrency theory. However, inSections 3.3.2–3.3.3, we shall present some well-known results in a new light,using the view of bisimilarity and other coinductively defined process semanticsas games. We shall also highlight some general proof techniques based ontableaux techniques and on the so-called ‘Defender’s forcing technique’ [JS08].We feel that the use of these techniques makes the proofs of some results moretransparent than the ones originally presented in the literature. Finally, whereappropriate, we have elected to present proofs that allow us to introduce generaland reusable proof techniques, even though they do not yield the best possiblecomplexity bounds for some algorithmic problems. In such cases, we alwaysgive references to the papers offering the best-known complexity results.

Roadmap of the chapter The chapter is organised as follows. We begin bysurveying the classical algorithms by Kanellakis and Smolka, and Paige andTarjan, for computing bisimilarity over finite labelled transition systems inSection 3.2. There we also briefly mention the basic ideas underlying symbolicalgorithms for bisimilarity checking based on reduced ordered binary decisiondiagrams. Section 3.3 is devoted to results on the computational complexityof bisimilarity, and related behavioural relations, over finite processes. In thatsection, we consider the complexity of the relevant decision problems whenmeasured as a function of the ‘size’ of the input labelled transition system,as well as the one measured with respect to the length of the description of aparallel composition of labelled transition systems. In Section 3.4, we offer aglimpse of the plethora of remarkable decidability and complexity results thathave been obtained for bisimilarity over classes of infinite-state processes. Weconclude the chapter with a discussion of the main uses of bisimilarity checkingin verification and tools (Section 3.5).

3.2 Classical algorithms for bisimilarity

In this section, we consider one of the most fundamental algorithmic problemsassociated with equivalence checking over labelled transition systems, namelythe problem of deciding bisimilarity over finite labelled transition systems, that

Page 119: advanced topics in biosimulation and coinduction

The algorithmics of bisimilarity 103

is, labelled transition systems with a finite set of states and finitely many transi-tions [San12, section 1.2]. It is well known that deciding language equivalenceover this class of labelled transition systems is PSPACE-complete [HRS76].(See also [SM73].) In sharp contrast with this negative result, efficient algo-rithms have been developed for deciding strong bisimilarity over finite labelledtransition systems. Our main aim in this section is to present a brief expositionof two such classical algorithms that are due to Kanellakis and Smolka [KS83](see also the journal version [KS90]) and to Paige and Tarjan [PT87]. Both thesealgorithms are essentially based on the characterisation of strong bisimilarityas a largest fixed point discussed in [San12, section 2.10.1], and Tarski’s fixedpoint theorem [San12, theorem 2.3.21] plays an important role in establishingtheir correctness.

For the sake of readability, we recall here the classical notion of stratifiedbisimulation relations, which are also known as approximants to bisimilarity.We refer the interested reader to [San12, section 2.10.2] for more information.

Definition 3.2.1 A labelled transition system is a triple (Pr, Act,�!), where

� Pr is a set of states;� Act is a set of actions; and� �!� Pr � Act � Pr is a transition relation.

Definition 3.2.2 Given a labelled transition system (Pr, Act,�!), the strati-fied bisimulation relations [Mil80, HM85] �k� Pr � Pr for k 2 N are definedas follows:

� E �0 F for all E,F 2 Pr;� E �kC1 F iff for each a 2 Act : if E

a�! E0 then there is F 0 2 Pr such that

Fa�! F 0 and E0 �k F 0; and if F

a�! F 0 then there is E0 2 Pr such that

Ea�! E0 and E0 �k F 0.

Given a labelled transition system (Pr, Act,�!), we define

next(E, a) D fE0 2 Pr j Ea�! E0g

for E 2 Pr and a 2 Act . We also define

next(E,�) D⋃

a2Act

next(E, a).

A labelled transition system is image-finite iff the set next(E, a) is finite forevery E 2 Pr and a 2 Act .

The following lemma is a standard one.

Page 120: advanced topics in biosimulation and coinduction

104 Luca Aceto, Anna Ingolfsdottir and Jirı Srba

Lemma 3.2.3 ([HM85]) Assume that (Pr, Act,�!) is an image-finitelabelled transition system and let E,F 2 Pr. Then E � F iff E �k F for allk 2 N.

The characterisation of bisimilarity given in the above lemma immediatelyyields an algorithm skeleton for computing bisimilarity over any finite labelledtransition system, namely:

Let �0 be the universal relation over the set of states of the input labelled transitionsystem. For each i > 0, compute the i-th approximant of bisimilarity �i until�iD�i�1.

If the input labelled transition system is finite, the computation of each approx-imant of bisimilarity can obviously be carried out effectively. Moreover, a veryrough analysis indicates that the non-increasing sequence of approximants sta-bilises in O(n2) iterations, where n is the number of states in the labelledtransition system. But how efficiently can the above algorithm skeleton beimplemented? How can one best compute the i-th approximant of bisimilarity,for i 1, from the previous one? And what is the complexity of optimal algo-rithms for the problem of computing bisimilarity over finite labelled transitionsystems?

The algorithms that we shall present in what follows indicate that, in sharpcontrast with well-known results in formal language theory, the problem ofdeciding bisimilarity over finite labelled transition systems can be solved veryefficiently. In Section 3.3.2, we shall discuss lower bounds on the complexityof checking bisimilarity over finite labelled transition systems. As confirmedby further results surveyed in later sections in this chapter, bisimilarity affordsremarkable complexity and decidability properties that set it apart from othernotions of equivalence and preorder over various classes of labelled transitionsystems.

3.2.1 Preliminaries

Let (Pr, Act,�!) be a finite labelled transition system. An equivalence relationover the set of states Pr can be represented as a partition of Pr, that is, as a setfB0, . . . , Bkg, k 0, of non-empty subsets of Pr such that

� Bi \ Bj D ;, for all 0 � i < j � k, and� Pr D B0 [ B1 [ [ Bk .

Page 121: advanced topics in biosimulation and coinduction

The algorithmics of bisimilarity 105

The sets Bi in a partition are usually called blocks. In what follows, we shalltypically not distinguish between partitions and their associated equivalencerelations.

Let π and π 0 be two partitions of Pr. We say that π 0 is a refinement of π

if for each block B 0 2 π 0 there exists some block B 2 π such that B 0 � B.Observe that if π 0 is a refinement of π , then the equivalence relation associatedwith π 0 is included in the one associated with π .

The algorithms for computing bisimilarity due to Kanellakis and Smolka,and Paige and Tarjan compute successive refinements of an initial partition πinit

and converge to the largest strong bisimulation over the input finite labelledtransition system. Algorithms that compute strong bisimilarity in this fash-ion are often called partition-refinement algorithms and reduce the problemof computing bisimilarity to that of solving the so-called relational coars-est partitioning problem [KS90, PT87]. In what follows, we shall present themain ideas underlying the above-mentioned algorithms. We refer the inter-ested reader to the survey paper [CS01] for more information and for otheralgorithmic approaches to deciding bisimilarity over finite labelled transitionsystems.

3.2.2 The algorithm of Kanellakis and Smolka

Let π D fB0, . . . , Bkg, k 0, be a partition of the set of states Pr. The algorithmdue to Kanellakis and Smolka is based on the notion of splitter.

Definition 3.2.4 A splitter for a block Bi 2 π is a block Bj 2 π such that, forsome action a 2 Act, some states in Bi have a-labelled transitions whose targetis a state in Bj and others do not.

Intuitively, thinking of blocks as representing approximations of equivalenceclasses of processes with respect to strong bisimilarity, the existence of a splitterBj for a block Bi in the current partition indicates that we have a reason fordistinguishing two groups of sets of states in Bi , namely those that afford ana-labelled transition leading to a state in Bj and those that do not. Therefore,Bi can be split by Bj with respect to action a into the two new blocks:

B1i D fs j s 2 Bi and s

a! s0, for some s0 2 Bj g and

B2i D Bi � B1

i .

This splitting results in the new partition

π 0 D fB0, . . . , Bi�1, B1i , B

2i , BiC1, . . . , Bkg,

Page 122: advanced topics in biosimulation and coinduction

106 Luca Aceto, Anna Ingolfsdottir and Jirı Srba

which is a refinement of π . The basic idea underlying the algorithm of Kanel-lakis and Smolka is to iterate the splitting of some block Bi by some block Bj

with respect to some action a until no further refinement of the current partitionis possible. The resulting partition is often called the coarsest stable partitionand coincides with strong bisimilarity over the input labelled transition systemwhen the initial partition πinit is chosen to be fPrg. (We shall define the notionof stable partition precisely in Section 3.2.3 since it plays an important role inthe algorithm proposed by Paige and Tarjan. The definitions we present in thissection suffice to obtain an understanding of the algorithm of Kanellakis andSmolka.)

Before presenting the details of the algorithm of Kanellakis and Smolka,we illustrate the intuition behind the algorithm by means of a couple ofexamples.

Example 3.2.5 Consider the labelled transition system depicted below.

s

a

�������������

a

�����

����

����

t

a

s1

b s2

b

�� t1

b

��

Since we are interested in computing bisimilarity, let the initial partition asso-ciated with this labelled transition system be fPrg, where

Pr D fs, s1, s2, t, t1g.

The block Pr is a splitter for itself. Indeed, some states in Pr afford a-labelledtransitions while others do not. If we split Pr by Pr with respect to action a

we obtain a new partition consisting of the blocks fs, tg (the set of states thatafford a-labelled transitions) and fs1, s2, t1g (the set of states that do not afforda-labelled transitions). Note that we would have obtained the same partitionif we had done the splitting with respect to action b. You can now readilyobserve that neither of the blocks fs, tg and fs1, s2, t1g can be split by the otherwith respect to any action. Indeed, states in each block are all bisimilar to oneanother, whereas states in different blocks are not.

Page 123: advanced topics in biosimulation and coinduction

The algorithmics of bisimilarity 107

Example 3.2.6 Consider now the following labelled transition system.

s0

a

a

�����

����

���

s1

a

������������

b

�����

����

��� s2

a

s3

a

��

s4

a

�� t0

a

a t3a t4

a

��

t1

b

a

b t5

a

��

a

�����������

t2

a

��

Let the initial partition associated with this labelled transition system be fPrg,where

Pr D fsi, tj j 0 � i � 4, 0 � j � 5g.

The block Pr is a splitter for itself. Indeed, some states in Pr afford b-labelledtransitions while others do not. If we split Pr by Pr with respect to action b weobtain a new partition consisting of the blocks

fs1, t1g and fsi, tj j 0 � i � 4, 0 � j � 5 with i, j 6D 1g.

Note now that the former block is a splitter for the latter with respect to actiona. Indeed only states s0 and t0 in that block afford a-labelled transitions thatlead to a state in the block fs1, t1g. The resulting splitting yields the partition

ffs0, t0g, fs1, t1g, fsi, tj j 2 � i � 4, 2 � j � 5gg.

The above partition can be refined further. Indeed, some states in the third blockhave a-labelled transitions leading to states in the first block, but others do not.Therefore the first block is a splitter for the third one with respect to action a.The resulting splitting yields the partition

ffs0, t0g, fs1, t1g, fs3, s4, t2, t4, t5g, fs2, t3gg.

We continue by observing that the block fs3, s4, t4, t2, t5g is a splitter for itself

with respect to action a. For example t5a! t4, but the only a-labelled transition

from s4 is s4a! s0. The resulting splitting yields the partition

ffs0, t0g, fs1, t1g, ft5g, fs3, s4, t2, t4g, fs2, t3gg.

We encourage you to continue refining the above partition until you reach thecoarsest stable partition. What is the resulting partition?

Page 124: advanced topics in biosimulation and coinduction

108 Luca Aceto, Anna Ingolfsdottir and Jirı Srba

function split(B, a, π )choose some state s 2 B

B1, B2 :D ;for each state t 2 B do

if s and t can reach the same set of blocks in π via a-labelledtransitions

then B1 :D B1 [ ftg

else B2 :D B2 [ ftg

if B2 is empty then return fB1g

else return fB1, B2g

Fig. 3.1. The function split(B, a, π ).

π :D fPrgchanged :D truewhile changed do

changed :D falsefor each block B 2 π do

for each action a do

sort the a-labelled transitions from states in B

if split(B, a, π ) D fB1, B2g 6D fBg

then refine π by replacing B with B1 and B2, and setchanged to true

Fig. 3.2. The algorithm of Kanellakis and Smolka.

The pseudo-code for the algorithm of Kanellakis and Smolka is given inFigure 3.2. The algorithm uses the function split(B, a, π ) described in Fig-ure 3.1, which, given a partition π , a block B in π and an action a, splits B withrespect to each block in π and action a. For example, considering the labelledtransition system in Example 3.2.6, the call

split(fs1, t1g, b, ffs0, t0g, fs1, t1g, ft5g, fs3, s4, t2, t4g, fs2, t3gg)

returns the pair (fs1g, ft1g) because the only block in the partition that can bereached from s1 via a b-labelled transition is fs3, s4, t2, t4g, whereas t1 can alsoreach the block ft5g.

In order to decide efficiently whether the sets of blocks that can be reachedfrom s and t are equal, the algorithm orders the transitions from each state

Page 125: advanced topics in biosimulation and coinduction

The algorithmics of bisimilarity 109

lexicographically by their labels, and transitions with the same label are orderedby the block in the partition that contains the target state of the transition.Note that the algorithm in Figure 3.2 sorts the a-labelled transitions fromstates in a block B before calling split(B, a, π ). This is necessary because asplitting of a block may change the ordering of transitions into that block. Thelexicographic sorting of transitions can be done in O(mC j Act j) time andspace, and therefore in O(m) time and space because the number of actionscan be taken to be at most m, using a classical algorithm from [AHU74].

Theorem 3.2.7 (Kanellakis and Smolka) When applied to a finite labelledtransition system with n states and m transitions, the algorithm of Kanellakisand Smolka computes the partition corresponding to strong bisimilarity in timeO(nm).

Proof We first argue that the algorithm of Kanellakis and Smolka is correct,that is, that when it reaches the coarsest stable partition π that partition isthe one corresponding to strong bisimilarity over the input labelled transitionsystem. To see this, let πi , i 0, denote the partition after the i-th iterationof the outermost loop in the algorithm in Figure 3.2. Below, we shall use πi

to denote also the equivalence relation induced by the partition πi . Recall,furthermore, that �i denotes the i-th approximant to bisimilarity.

Observe, first of all, that

���i� πi

holds for each i 0. This can be easily proved by induction on i. It followsthat �� π .

Conversely, if π is a partition that cannot be refined further, then it is not hardto see that π is a post-fixed point of the function F� that was used in [San12,section 2.10.1] to characterise � as a largest fixed point. Since � is the largestpost-fixed point of F�, it follows that π ��. Therefore �D π .

As far as the complexity of the algorithm is concerned, note that the mainloop of the algorithm is repeated at most n � 1 times. Indeed, the number ofblocks in π must be between one and n, and this number increases at eachiteration of the outermost loop of the algorithm that leads to a refinement ofπ . The calls to the function split take O(m) time at each iteration of the mainloop. Indeed, that function is called for each block and each action at mostonce, and in each call it considers each transition of every state in the blockat most once. As we already remarked above, the sorting of transitions can bedone in O(m) time at each iteration of the main loop. Therefore we achieve theclaimed O(mn) complexity bound. �

Page 126: advanced topics in biosimulation and coinduction

110 Luca Aceto, Anna Ingolfsdottir and Jirı Srba

Exercise 3.2.8 Fill in the details in the proof of correctness of the algorithmthat we sketched above.

Remark 3.2.9 The algorithm of Kanellakis and Smolka also has O(nCm)space complexity.

A natural question to ask at this point is whether the algorithm of Kanellakisand Smolka is optimal. As we shall see in the following section, the answer tothis question is negative. Indeed, the time performance of a partition-refinementalgorithm like the one we just discussed can be improved substantially by meansof some clever use of data structures.

Remark 3.2.10 For the special case in which, for each action a and process s,the set

fs0 j sa! s0g

has size at most a constant c, Kanellakis and Smolka presented in [KS83](see also [KS90]) an O(c2n log n)-time algorithm to decide strong bisimilarity.They also conjectured the existence of an O(m log n)-time algorithm for theproblem. This conjecture was confirmed by Paige and Tarjan by means of thealgorithm we will present in the following section.

3.2.3 The algorithm of Paige and Tarjan

The algorithm of Paige and Tarjan is also based on the idea of partition refine-ment. However, by making use of more complex data structures, it significantlyimproves on the efficiency of the algorithm of Kanellakis and Smolka we dis-cussed in the previous section. The low complexity of the algorithm of Paigeand Tarjan is achieved by using information about previous splits to improveon the efficiency of future splits. In particular, each state can only appear ina number of splitters that is logarithmic in the number of states in the inputlabelled transition system.

In order to simplify the presentation of the algorithm, throughout this sectionwe shall assume that the input finite labelled transition system is over a singleaction a. The extension of the algorithm to arbitrary finite labelled transitionsystems is only notationally more complex. (See also Exercise 3.3.12, whichindicates that a single action is as general as any finite set of actions, also fromthe point of view of the complexity of algorithms.)

We begin our presentation of the algorithm of Paige and Tarjan by definingformally the notion of stable partition. In what follows, given a set of states S,

Page 127: advanced topics in biosimulation and coinduction

The algorithmics of bisimilarity 111

we define:

pre(S) D fs j sa! s0 for some s0 2 Sg.

Definition 3.2.11 ((Coarsest) Stable partition)

� A set B � Pr is stable with respect to a set S � Pr if• either B � pre(S)• or B \ pre(S) D ;.

� A partition π is stable with respect to a set S if so is each block B 2 π .� A partition π is stable with respect to a partition π 0 if π is stable with respect

to each block in π 0.� A partition π is stable if it is stable with respect to itself.

The coarsest stable refinement (of a partition πinit) is a stable partition that isrefined by any other stable partition (that refines πinit).

Note that B � Pr is stable with respect to a block S � Pr if, and only if, S isnot a splitter for B. (The notion of splitter was presented in Definition 3.2.4.)

Example 3.2.12 Consider the following labelled transition system.

s0

a

t0

a

��

a

s1

a

�� t1

a

��

a

t2

The block fsi, ti j 0 � i � 1g is stable with respect to the set of states fsi, tj j

0 � i � 1, 0 � j � 2g. On the other hand, the block fsi, tj j 0 � i � 1, 0 �j � 2g is not stable with respect to itself because

pre(fsi, tj j 0 � i � 1, 0 � j � 2g) D fsi, ti j 0 � i � 1g.

The coarsest stable partition over the above labelled transition system thatrefines fPrg is

ffs0, s1g, ft0g, ft1g, ft2gg.

Note that this is the partition associated with� over the above labelled transitionsystem.

Page 128: advanced topics in biosimulation and coinduction

112 Luca Aceto, Anna Ingolfsdottir and Jirı Srba

Exercise 3.2.13 Show that � is the coarsest stable partition that refines fPrgover any finite labelled transition system with Act D fag.

The basic idea behind the algorithm proposed by Paige and Tarjan is that, givena partition π of Pr, one can identify two different types of blocks B that act assplitters for π : simple and compound splitters.

Simple splitters are used to split blocks in π into two disjoint subsets as donein the algorithm of Kanellakis and Smolka. Below, we rephrase this notion usingthe definitions introduced above.

Definition 3.2.14 (Simple splitting) Let π be a partition and let B be a set ofstates in Pr. We write split(B, π ) for the refinement of π obtained as follows.

For each block B0 2 π such that B0 is not stable with respect to B, replace B0 bythe blocks

B01 D B0 \ pre(B) and

B02 D B0 � pre(B).

We call B a splitter for π when split(B, π ) 6D π . In that case, we also say thatπ is refined with respect to B, and that split(B, π ) is the partition that resultsfrom that refinement.

For example, consider the labelled transition system in Example 3.2.12 andthe partition fPrg. As we already remarked, the block Pr is not stable withrespect to itself. Moreover,

split(Pr, fPrg) D ffs0, s1, t0, t1g, ft2gg.

Therefore Pr is a splitter for fPrg.We observe the following useful properties of the function split and of the

notion of stability.

Lemma 3.2.15

(1) Stability is preserved by refinement, that is, if π refines π 0 and π 0 is stablewith respect to a set of states S, then so is π .

(2) Stability is preserved by union, that is, if π is stable with respect to sets S1

and S2, then π is also stable with respect to S1 [ S2.(3) Assume that B � Pr. Let π1 and π2 be two partitions of Pr such that π1

refines π2. Then split(B, π1) refines split(B, π2).(4) Assume that B,B 0 � Pr. Let π be a partition of Pr. Then

split(B, split(B 0, π )) D split(B 0, split(B, π )),

that is, split is commutative.

Page 129: advanced topics in biosimulation and coinduction

The algorithmics of bisimilarity 113

Exercise 3.2.16 Prove the above lemma.

As a stepping stone towards introducing the algorithm of Paige and Tarjan,consider the following abstract version of the algorithm of Kanellakis andSmolka. The algorithm keeps a partition π that is initially the initial partitionπinit and refines it until it reaches the coarsest stable partition that refines πinit.It repeats the following steps until π is stable:

(1) Find a set S that is a union of some of the blocks in π and is a splitter of π .(2) Replace π by split(S, π ).

This refinement algorithm works just as well if one restricts oneself to usingonly blocks of π as splitters. However, allowing the use of unions of blocks assplitters is one of the key ideas behind the algorithm of Paige and Tarjan.

In order to implement the algorithm efficiently, it is useful to reduce theproblem to that of considering labelled transition systems without deadlockedstates, i.e. to labelled transition systems in which each state has an outgoingtransition. This can be done easily by preprocessing the initial partition πinit bysplitting each block B 2 πinit into

B1 D B \ pre(Pr) and

B2 D B � pre(Pr).

Note that the blocks B2 generated in this way will never be split again by therefinement algorithm. Therefore we can run the refinement algorithm startingfrom the partition

π 0init D fB1 j B 2 πinitg,

which is a partition of the set pre(Pr). The coarsest stable refinement of π 0init

together with the blocks of the form B2 for each B 2 πinit yield the coarseststable refinement of πinit.

Exercise 3.2.17 Prove the claims we just made.

In order to achieve its time complexity, the Paige–Tarjan algorithm employs avery clever way of finding splitters. In addition to the current partition π , thealgorithm maintains another partition X such that

� π is a refinement of X and� π is stable with respect to X.

Initially, π is the initial partition πinit and X D fPrg. The abstract version ofthe algorithm of Paige and Tarjan repeats the following steps until π D X:

Page 130: advanced topics in biosimulation and coinduction

114 Luca Aceto, Anna Ingolfsdottir and Jirı Srba

(1) Find a block S 2 X � π .(2) Find a block B 2 π such that B � S and j B j� jSj2 .(3) Replace S within X with the two sets B and S � B.(4) Replace π with split(S � B, split(B, π )).

The efficiency of the above algorithm relies on the heuristic for the choice ofthe block B at step 2 and on the use of what is usually called three-way splittingto implement step 4 efficiently. We now proceed to introduce the basic ideasbehind the notion of three-way splitting.

Suppose that we have a partition π that is stable with respect to a set ofstates S that is a union of some of the blocks in π . Assume also that π is refinedfirst with respect to a non-empty set B � S and then with respect to S � B. Wehave that:

� Refining π with respect to B splits a block D 2 π into two blocks D1 D

D \ pre(B) and D2 D D � pre(B) if, and only if, D is not stable with respectto B.

� Refining further split(B, π ) with respect to S � B splits the block D1 intotwo blocks D11 D D1 \ pre(S � B) and D12 D D1 � D11 if, and only if, D1

is not stable with respect to S � B.

A block S of the partition X is simple if it is also a block of π and is compoundotherwise. Note that a compound block S contains at least two blocks of π .Such a block S can be partitioned into B and S � B in such a way that both theabove-mentioned properties hold. The three-way splitting procedure outlinedabove gives the refinement of a partition with respect to a compound splitter.

Observe that refining split(B, π ) with respect to S � B does not split theblock D2. This is because D2 � pre(S � B). Indeed, since π is stable withrespect to S, we have that either D � pre(S) or D \ pre(S) D ;. If D is notstable with respect to B, it holds that

D 6� pre(B) and D \ pre(B) 6D ;.

Therefore, D � pre(S). Since D2 D D � pre(B), we can immediately inferthat D2 � pre(S � B), as claimed. Moreover,

D12 D D1 � D11 D D � pre(S � B) D D1 \ (pre(B) � pre(S � B)).

The identity

D12 D D1 \ (pre(B) � pre(S � B))

Page 131: advanced topics in biosimulation and coinduction

The algorithmics of bisimilarity 115

D

�������������

�����

����

����

D1

�������������

�����

����

����

D2

D11 D12

Fig. 3.3. Three-way splitting of a block. We use the following abbreviations:

D1 D D \ pre(B)

D2 D D � pre(B)

D11 D D \ pre(B)\ pre(S � B) and

D12 D D � pre(S � B).

is the crucial observation underlying the implementation of the algorithm ofPaige and Tarjan. We can visually depict the result of a three-way split of ablock D as the binary tree depicted in Figure 3.3.

The time performance of the algorithm Paige and Tarjan relies on the follow-ing observations. First of all note that each state in the input labelled transitionsystem is in at most log nC 1 blocks B used as refining sets. This is becauseeach refining set is at most half the size of the previous one. Moreover, asshown by Paige and Tarjan, a refinement step with respect to a block B can beimplemented in time

O

(j B j C

∑s2B

j pre(fsg) j

)

by means of a careful use of data structures. An O(m log n) time bound for thealgorithm follows.

In order to perform three-way splitting efficiently, namely in time propor-tional to the cardinality of the block B chosen at step 2 of the algorithm, thePaige–Tarjan algorithm uses an integer variable count(s, S) for each state s andeach block S. Intuitively, count(s, S) records the number of states in S that canbe reached from s via a transition.

Page 132: advanced topics in biosimulation and coinduction

116 Luca Aceto, Anna Ingolfsdottir and Jirı Srba

Exercise 3.2.18 Use the variables count(s, S) to decide in constant time towhich sub-block of D a state s 2 D belongs.

Apart from the count variables, the Paige–Tarjan algorithm uses additional datastructures to achieve its efficiency. Blocks and states are represented by records.Each block of the partition π is stored as a doubly linked list containing itselements and has an associated integer variable recording its cardinality. Eachblock of X points to a doubly linked list containing the blocks in π includedin it. Finally, each block of π points to the block of X that includes it. Theimplementation of the algorithm also uses a set C that contains the compoundblocks of X. Initially, C D fPrg and π is the initial partition πinit.

An efficient implementation of the Paige–Tarjan algorithm repeats the stepsgiven in Figure 3.4, taken from [PT87, page 981], until the set of compoundblocks becomes empty.

Theorem 3.2.19 (Paige and Tarjan) When applied to a finite labelled tran-sition system with n states and m transitions using fPrg as the initial partition,the algorithm of Paige and Tarjan computes the partition corresponding tostrong bisimilarity in time O(m log n).

We refer interested readers to [CS01, PT87] for further details on the algorithmof Paige and Tarjan.

3.2.4 Computing bisimilarity, symbolically

The algorithms for computing bisimilarity we have presented above requirethat the input labelled transition system be fully constructed in advance. Inpractice, a labelled transition system describing a reactive system is typi-cally specified as a suitable ‘parallel composition’ of some other labelledtransition systems representing the behaviour of the system components. Itis well known that the size of the resulting labelled transition system may growexponentially with respect to the number of parallel components. This phe-nomenon is usually referred to as the state-explosion problem and is a majorhindrance in the use of algorithms requiring the explicit construction of theinput labelled transition system in the automatic verification of large reactivesystems.

Amongst the approaches that have been proposed in order to deal with thestate-explosion problem, we shall briefly present here the main ideas under-lying a symbolic approach based on the use of reduced ordered binary deci-sion diagrams (ROBDDs) [Bry86, Bry92] to represent finite labelled transition

Page 133: advanced topics in biosimulation and coinduction

The algorithmics of bisimilarity 117

(1) Remove a compound block S from C. Find the first two blocks in the listof blocks of π that are included in S and let B be the smallest, breakingties arbitrarily.

(2) Replace S with S � B and create a new simple block in X containing B asits only block of π . If S is still compound, put S back into C.

(3) Compute pre(B) and count(s, B). This is done as follows. Copy B intoa temporary set B 0. Compute pre(B) by scanning the edges with a tar-get in B and adding the source of each such edge to pre(B) if it is notalready contained in that set. During the count compute the count variablescount(s, B).

(4) Replace π with split(B, π ) as follows. For each block D 2 π such thatD \ pre(B) 6D ;, split D into D1 D D \ pre(B) and D2 D D � D1. Thisis done by scanning the elements of pre(B). For each s 2 pre(B), determinethe block D 2 π containing it and create an associated block D0 if one doesnot exist already. Move s from D to D0.

During the scanning, build a list of the blocks D that are split. After thescanning is done, process the list of split blocks as follows. For each suchblock with associated block D0, mark D0 as no longer being associatedwith D; eliminate the record for D if D is empty; if D is non-empty andthe block of X containing D and D0 has been made compound by the split,add this block to C.

(5) Compute pre(B) � pre(S � B). This is done by scanning the transitions

whose target is in B 0. For each such edge sa! s0, add s to pre(B) �

pre(S � B) if s is not already in that set and count(s, B) D count(s, S).(6) Replace π with split(S � B, π ) as done in step 4 above, but scanning

pre(B) � pre(S � B) in lieu of pre(B).(7) Update the count variables. This is done by scanning the transitions whose

target is in B 0. For each such transition sa! s0, decrement count(s, S). If

this count becomes zero, delete the count record and make the transitionpoint to count(s, B). When the scan is done, discard B 0.

Fig. 3.4. The refinement steps of the Paige–Tarjan algorithm.

systems symbolically. The use of ROBDDs often permits a succinct represen-tation of finite objects, and has led to breakthrough results in the automationof the solution to many combinatorial problems. The use of ROBDDs in thecomputation of bisimilarity over finite labelled transition systems has beenproposed in [BS92].

Page 134: advanced topics in biosimulation and coinduction

118 Luca Aceto, Anna Ingolfsdottir and Jirı Srba

�������x1

�����������

���������x2

��

�������x2

����������������������

�������x3

��������

������

��

1 0

Fig. 3.5. Example of ROBDD where x1 < x2 < x3.

We recall here that an ROBDD represents a boolean function as a rooteddirected acyclic graph. The non-terminal nodes in the graph are labelled withinput variables and the terminal nodes are labelled by boolean constants. Eachnon-terminal node has two outgoing edges, one per possible value of the booleanvariable labelling it. In each path from the root of the graph to a terminalnode, the variables respect a given total variable ordering. Finally, an ROBDDcontains neither redundant tests nor duplicate nodes. The former requirementmeans that there is no non-terminal node in the graph whose two outgoingedges lead to the same node. The latter condition ensures that the sharing ofnodes in an ROBDD is maximal, in that there are no two distinct nodes in thegraph that are the roots of isomorphic sub-graphs. An example of ROBDD isgiven in Figure 3.5 where the solid edges leaving nodes labelled with variablesrepresent the truth assignment true, while the dotted edges correspond to thethruth assignment false. We can see that if, e.g. x1 is set to false, x2 to falseand x3 to true, the whole boolean function evaluates to true as we reached theterminal node labelled with 1.

The crucial property of ROBDDs is their canonicity. This means that, foreach boolean function with n arguments, there is exactly one ROBDD represent-ing it with respect to the variable ordering x1 < x2 < < xn, and thereforetwo ROBDDs representing the same function with respect to that ordering areisomorphic. For example, a boolean function is a tautology if, and only if, itsassociated ROBDD consists of a single node labelled with 1 (true) and it issatisfiable if, and only if, its associated ROBDD does not consist of a singlenode labelled with 0 (false).

Encoding a labelled transition system as an ROBDD The first step in usingROBBDs to compute bisimilarity over a finite labelled transition system is to

Page 135: advanced topics in biosimulation and coinduction

The algorithmics of bisimilarity 119

encode the input labelled transition system. This is done as follows. The statesin a finite labelled transition system with n > 1 states are represented by meansof a function that associates with each state a distinct boolean vector of lengthk D dlog2 ne. Each state s is therefore represented by a unique assignmentof truth values to a vector of boolean variables Ex D (x1, . . . , xk). The set ofactions labelling transitions is encoded in exactly the same way. Each actiona is therefore represented by a unique assignment of truth values to a vectorof boolean variables Ey D (y1, . . . , y�). The transition relation of the labelledtransition system is represented by its characteristic function Trans(Ex, Ey, Ex0),which returns true exactly when Ex, Ey and Ex0 are the encodings of some state

s, action a and state s0, respectively, such that sa! s0. In the definition of the

boolean formula describing the transition relation, the vector Ex0 D (x01, . . . , x0k)

consists of distinct fresh variables, which are often called the target variablesand are used to encode the targets of transitions.

Example 3.2.20 Consider, for instance, the labelled transition system over asingle action depicted below. (We have omitted the label of the transitions andwe shall not consider it in the encoding for the sake of simplicity.)

s0

�����

����

��� s1

s2

������������s3

To encode the states in this labelled transition system, we use two booleanvariables x1 and x2. Each state si , i 2 f0, 1, 2, 3g, is represented by the binaryrepresentation of the number i. The boolean formula describing the transitionrelation is

(x1 ^ x2 ^ x01 ^ x02)_

(x1 ^ x2 ^ x01 ^ x02)_

(x1 ^ x2 ^ x01 ^ x02)_

(x1 ^ x2 ^ x01 ^ x02)_

(x1 ^ x2 ^ x01 ^ x02).

For example, the transition from state s2 to state s3 is represented by the disjunct

x1 ^ x2 ^ x01 ^ x02

Page 136: advanced topics in biosimulation and coinduction

120 Luca Aceto, Anna Ingolfsdottir and Jirı Srba

in the above formula. The first two conjuncts say that the source of the transitionis the state whose encoding is the bit vector (1, 0), namely s2, and the lasttwo say that the target is the state whose encoding is the bit vector (1, 1),namely s3.

The boolean formula Trans(Ex, Ey, Ex0) can then be represented as an ROBDDchoosing a suitable variable ordering. It is important to realise here that the sizeof the ROBDD for a boolean function depends crucially on the chosen variableordering. Indeed, in the worst case, the size of an ROBDD is exponential inthe number of variables. (See [Bry92] for a detailed, but very accessible, dis-cussion of ROBDDs, their properties and their applications.) A useful propertyof the above-mentioned ROBDD representation of a labelled transition systemis that the ROBDD describing the transition relation of a labelled transitionsystem resulting from the application of the CCS operations of parallel compo-sition, relabelling and restriction to a collection of component reactive systems(themselves represented as ROBDDs) is guaranteed to only grow linearly inthe number of parallel components, provided an appropriate variable orderingis chosen, see [EFT93].

Remark 3.2.21 We remark that the above-stated linear upper bound appliesto the size of the resulting ROBDD, but not necessarily to the intermediateROBBDs that are constructed as stepping stones in the computation of thefinal result. However, in [EFT93], the authors claim that, in their practicalexperiments, the size of the intermediate ROBBDs never exceeded the size ofthe result ROBBD.

Symbolic computation of bisimilarity Like the aforementioned algorithms,the symbolic algorithm for computing bisimilarity is based upon the charac-terisation of bisimilarity as a largest fixed point given by Tarski’s fixed-pointtheorem. In order to implement the iterative computation of the largest fixedpoint efficiently using ROBDDs, we need to rephrase the function F� in a waythat is suitable for symbolic computation using ROBDD operations. The algo-rithm for the symbolic computation of bisimilarity is presented in Figure 3.6.In that algorithm, we assume that we are given two copies of the input labelledtransition system with transition relations expressed by the boolean formu-las Trans(Ex, Ey, Ex0) and Trans(Ez, Ey, Ez0). The algorithm computes the ROBDDrepresentation of the boolean formula Bis(Ex, Ez) that encodes the characteristicfunction of the largest bisimulation over the input labelled transition system,that is, Bis(s, s0) returns true exactly when s and s0 are bisimilar states in thelabelled transition system.

Page 137: advanced topics in biosimulation and coinduction

The algorithmics of bisimilarity 121

(1) Bis(Ex, Ez) :D 1(2) repeat

(a) Old(Ex, Ez) :D Bis(Ex, Ez)(b) Bis(Ex, Ez) :D 8 Ex08Ey. Trans(Ex, Ey, Ex0)) (9Ez0. Trans(Ez, Ey, Ez0) ^

Bis( Ex0, Ez0)) ^ 8Ez08Ey. Trans(Ez, Ey, Ez0)) (9 Ex0. Trans(Ex, Ey, Ex0) ^Bis( Ex0, Ez0))

(3) until Bis(Ex, Ez) D Old(Ex, Ez)

Fig. 3.6. Algorithm for the symbolic computation of bisimilarity.

The algorithm in Figure 3.6 uses existential and universal quantification overboolean variables. These can be readily implemented in terms of the standardboolean operations. By way of example, if f (x, y) is a boolean function then9x. f (x, y) is a shorthand for f (0, y) _ f (1, y). We refer interested readersto [BS92, CS01] for further details on the efficient implementation of theROBDD that encodes the right-hand side of the assignment at step 2 in thealgorithm in Figure 3.6, as well as for a discussion of performance issues relatedto the appropriate choice of the variable ordering to be used in the computation.

3.2.5 Checking weak equivalences

The problem of checking observational equivalence (weak bisimilarity) overfinite labelled transition systems can be reduced to that of checking strongbisimilarity using a technique called saturation. Intuitively, saturation amountsto

(1) first pre-computing the weak transition relation (see [San12, section 4.1]),and then

(2) constructing a new pair of finite processes whose original transitions arereplaced with the weak transitions.

The question of whether two states are weakly bisimilar now amounts to check-ing strong bisimilarity over the saturated systems. Since the computation of theweak transition relation can be carried out in polynomial time, the problem ofchecking for weak bisimilarity can also be decided in polynomial time. Thesame holds true for the problem of checking observational congruence [Mil89].(See [San12, section 4.4] for the definition of observational congruence, whichis there called rooted weak bisimilarity.)

Efficient algorithms are also available for deciding a variation on the notionof weak bisimilarity called branching bisimilarity [GW96] over finite labelled

Page 138: advanced topics in biosimulation and coinduction

122 Luca Aceto, Anna Ingolfsdottir and Jirı Srba

transition systems (see [San12, section 4.9]). Notably, Groote and Vaandragerhave developed in [GV90] an algorithm for checking branching bisimilaritythat has time complexity O(m log mCmn) and space complexity O(mC n).

3.3 The complexity of checking bisimilarityover finite processes

In the previous section, we saw that, unlike the classic notion of languageequivalence, bisimilarity can be efficiently decided over finite labelled transi-tion systems. In particular, the time complexity of the algorithm of Paige andTarjan offers an upper bound on the time complexity of checking bisimilarityover finite labelled transition systems. This naturally raises the question ofwhether it is possible to provide lower bounds on the computational complex-ity of computing bisimilarity over such structures. Indeed, computer scientistsoften consider a decidable computational problem ‘solved’ when they possessmatching lower and upper bounds on its computational complexity.

Our order of business in this section will be to survey some of the mostnotable results pertaining to lower bounds on the computational complexity ofbisimilarity checking for several classes of finite labelled transition systems. Weshall also present some rather general proof techniques that yield perspicuousproofs of the results we discuss in what follows.

Since the notion of bisimulation game plays an important role in our pre-sentation of the complexity and decidability results discussed in the remainderof this chapter, we now proceed to introduce it briefly. (We refer the readerto [San12] and [AILS07] for more comprehensive discussions.)

3.3.1 Game characterisation of bisimulation-like relations

We shall use a standard game-theoretic characterisation of (bi)similarity, see,for instance, [Tho93, Sti95] and [San12, chapter 2]. A bisimulation game on apair of processes (P1,Q1) is a two-player game between Attacker and Defender.The game is played in rounds. In each round the players change the currentpair of states (P,Q) (initially P D P1 and Q D Q1) according to the followingrules:

(1) Attacker chooses either P or Q, an action a and performs a move Pa�! P 0 or

Qa�! Q0, depending on whether he chose P or Q.

(2) Defender responds by choosing the other process (either Q or P ) and performs

a move Qa�! Q0 or P

a�! P 0 under the same action a.

(3) The pair (P 0, Q0) becomes the (new) current pair of states.

Page 139: advanced topics in biosimulation and coinduction

The algorithmics of bisimilarity 123

A play (of the bisimulation game) is a sequence of pairs of processes formedby the players according to the rules mentioned above. A play is finite iff oneof the players gets stuck (cannot make a move); the player who gets stuck losesthe play and the other player is the winner. If the play is infinite then Defenderis the winner.

We use the following standard fact, see [Tho93, Sti95] and [San12, chap-ter 2].

Proposition 3.3.1 It holds that P � Q iff Defender has a winning strategy inthe bisimulation game starting with the pair (P,Q), and P 6� Q iff Attackerhas a winning strategy in the corresponding game.

The rules of the bisimulation game can be easily modified in order to captureother coinductively defined equivalences and preorders.

� In the simulation preorder game, Attacker is restricted to attack only fromthe (left-hand-side) process P . In the simulation equivalence game, Attackercan first choose a side (either P or Q) but after that he is not allowed tochange the side any more.

� The completed/ready simulation game has the same rules as the simulationgame but Defender is moreover losing in any configuration which breaks theextra condition imposed by the definition (i.e. P and Q should have the sameset of initial actions in case of ready simulation, and their sets of initial actionsshould be both empty at the same time in case of completed simulation).

� In the 2-nested simulation preorder game, Attacker starts playing from theleft-hand-side process P and at most once during the play he is allowed toswitch sides. (The soundness of this game follows from the characterisationprovided in [AFI01].) In the 2-nested simulation equivalence game, Attackercan initially choose any side but the sides can be changed at most once duringthe play.

3.3.2 Deciding bisimilarity over finite labelledtransition systems is P-complete

The algorithmic results discussed in Section 3.2 indicate that strong, weak andbranching bisimilarity can be decided over finite labelled transition systemsmore efficiently than language equivalence (and indeed than many other equiv-alences). This is good news for researchers and practitioners who develop and/oruse software tools that implement various forms of bisimilarity checking. How-ever, the size of the labelled transition systems on which the above-mentionedalgorithms are run in practice is often huge. It is therefore natural to ask oneself

Page 140: advanced topics in biosimulation and coinduction

124 Luca Aceto, Anna Ingolfsdottir and Jirı Srba

whether one can devise efficient parallel algorithms for bisimilarity checking.Such algorithms might exploit the parallelism that is becoming increasinglyavailable on our computers to speed up checking whether two processes arebisimilar or not. It would be very satisfying, as well as practically useful, ifalgorithms for checking bisimilarity could run on a highly parallel machinewith a running time that is proportional to the logarithm of the size of thestate space of the input labelled transition system using a feasible number ofprocessors. But is an algorithm meeting the above desiderata likely to exist?

A most likely negative answer to the above question has been given byBalcazar, Gabarro and Santha, who showed in [BGS92] that deciding strongbisimilarity between finite labelled transition systems is P-complete; this meansthat it is one of the ‘hardest problems’ in the class P of problems solvable indeterministic polynomial time. P-complete problems are of interest becausethey appear to lack highly parallel solutions. So, showing that an algorithmicproblem is P-complete is interpreted as strong evidence that the existence of anefficient parallel solution for it is unlikely. See, for instance, the book [GHR95]for much more information on P-completeness.

We shall now present the main ideas behind the hardness proof of the abovementioned result, which we reiterate below in the form of a theorem.

Theorem 3.3.2 (Balcazar, Gabarro and Santha 1992) The bisimilaritychecking problem between two states in a finite labelled transition systemis P-complete.

The theorem can be proved by offering a reduction from a problem that isalready known to be P-complete to the problem of checking strong bisimilaritybetween a pair of finite-state processes P and Q. The reduction will be a so-called log-space reduction, which means that it is computable in deterministiclogarithmic space.

Similarly as in the original proof by Balcazar, Gabarro and Santha, we willprovide a reduction from the monotone Circuit Value Problem (mCVP), which isknown to be P-complete (see, e.g. [Pap94]). However, the ideas in the reductionpresented below are different from their original proof. For the purpose of thispresentation we shall use the so-called Defender’s forcing technique, whichsimplifies many of the constructions for hardness results. For a more detailedintroduction to this technique consult [JS08].

A monotone Boolean circuit C is a finite directed acyclic graph in which thenodes are either of indegree zero (input nodes) or of indegree two and there isexactly one node of outdegree zero (the output node).

Each node in C that is not an input node is labelled with one of the symbols^ and _, which stand for conjunction and disjunction, respectively.

Page 141: advanced topics in biosimulation and coinduction

The algorithmics of bisimilarity 125

�������^1

o

�������^1

u

!!��������� �������_1

v

""���������

�������1

1

w

!!��������� �������1

1

x

""���������

!!��������� �������0

0

y

""���������

Fig. 3.7. An instance of mCVP together with assigned truth values.

An input for the circuit C is an assignment of the truth values 0 (false) or1 (true) to all input nodes. Given an input, every node in the circuit can beuniquely assigned a truth value as follows:

� the value of an input node is given by the input assignment;� the value of a node labelled with ^ or _ is the logical conjunction or disjunc-

tion of values of its two predecessors, respectively.

Given an input for the circuit, the output value of the circuit C is the valueassigned to its output node.

The mCVP problem asks to decide, given a monotone Boolean circuit C

and its input, whether its output value is true.An example of a monotone Boolean circuit with an input assignment and

computed values at each node is given in Figure 3.7.Assume now a given monotone Boolean circuit C with the output node o

and with a given input. We shall construct a finite labelled transition system andtwo of its processes Po and Qo such that if the output value of C is true thenPo and Qo are strongly bisimilar, and if the output value is false then Qo doesnot strongly simulate Po. Such a construction will enable us to state a generalclaim about P-hardness for all relations between the simulation preorder andbisimilarity.

Remark 3.3.3 Indeed, we will be able to draw such a general conclusionfor any (perhaps not even yet ‘discovered’) relation on processes R such thatif P � Q then (P,Q) 2 R, and if Q does not simulate P then (P,Q) 62 R,because if the output value of C is true then P � Q and hence (P,Q) 2 R,and if the output value of C is false then Q does not simulate P and hence(P,Q) 62 R. Examples of such a relation R include, among others, simulation

Page 142: advanced topics in biosimulation and coinduction

126 Luca Aceto, Anna Ingolfsdottir and Jirı Srba

preorder/equivalence, completed simulation preorder/equivalence, ready sim-ulation preorder/equivalence, 2-nested simulation preorder/equivalence and, ofcourse, also bisimulation equivalence.

The processes of the constructed labelled transition system are

� Pend ,� Pv and Qv for every node v in C, and additionally,� P 0v , Q�

v and Qrv for every node v in C labelled with _.

The transition relation contains the following transitions:

� Pv

��! Pv1 , Pv

r�! Pv2 , and Qv

��! Qv1 , Qv

r�! Qv2 for every node v in C

labelled with ^ and with the predecessor nodes v1 and v2, and� Pv

a�! P 0v , Pv

a�! Q�

v , Pv

a�! Qr

v , and

P 0v��! Pv1 , P 0v

r�! Pv2 , and

Qv

a�! Q�

v , Qv

a�! Qr

v , and

Q�v

��! Qv1 , Q�

v

r�! Pv2 , Qr

v

r�! Qv2 , Qr

v

��! Pv1

for every node v in C labelled with _ and with the predecessor nodes v1 andv2, and

� Pv

0�! Pend for every input node v in C assigned the value false.

The reduction is clearly computable in log-space. An example of the construc-tion, taking as the input circuit the one in Figure 3.7, is presented in Figure 3.8.

Exercise 3.3.4 Consider the transition system constructed in Figure 3.8. Arguethat Defender has a winning strategy in the bisimulation game starting from(Po,Qo); in other words show that Po � Qo. �

We will now show that

� if the output value of C is true then Po and Qo are strongly bisimilar, and� if the output value of C is false then Qo does not strongly simulate Po.

As a conclusion, we will get that deciding any relation between the simulationpreorder and strong bisimilarity on finite labelled transition systems is P-hard.

Let us consider a play in the bisimulation game between Attacker andDefender starting from the pair (Po,Qo). The idea is that, after finitely manyrounds of a play, the players will eventually reach some input node. Duringeach play, Attacker is trying to reach an input node Pv with assigned valuefalse, as this is a winning configuration for Attacker. (Defender has no answerto the action 0 that Attacker can perform in the left-hand-side process.) Onthe other hand, Defender is trying to reach an input node with assigned valuetrue, as Attacker loses in such a situation (no further actions are available).

Page 143: advanced topics in biosimulation and coinduction

The algorithmics of bisimilarity 127

�������Po

##�������������������

r

$$�������������������

�������Qo

##�������������������

r

$$�������������������

�������Pu

##����������������������

r

$$����������������������

�������Pv

a

a

%%�����

������

������

������

�����

a

&&�������

��������

��������

��������

��������

�������Qu

##����������������������

r

$$����������������������

�������Qv

a

''����������

a

((����������

�������P 0v

''����������

r

((����������

�������Q�v

r

��������

������

������

����

�������Qrv

r

))����������

����������

����������

����������

����

�������Pw�������Px

�������Py

0

�������Qw�������Qx

�������Qy

�������Pend

Fig. 3.8. Constructed processes Po and Qo according to the reduction.

The processes Po and Qo are constructed in such a way that in the currentpair (Pv,Qv), where v is labelled by ^, it is Attacker who chooses the nextnode and forces reaching the next pair (Pvi

,Qvi) for a chosen i 2 f1, 2g by

playing either the action � or r . If the current pair (Pv,Qv) corresponds to anode v which is labelled by _, it should be Defender who decides the next pairof processes. This is achieved by using a particular instance of the so-calledDefender’s forcing technique [JS08]. Initially, Attacker has five possible movesunder the action a from the pair (Pv,Qv) where v is labelled by _. Clearly,

the only possible attack is by playing Pv

a�! P 0v; all the remaining four moves

can be matched by Defender in such a way that the play continues from apair of identical processes (a clear winning position for Defender). Defender

can now answer by playing either Qv

a�! Q�

v or Qv

a�! Qr

v and the playerscontinue from the pair (P 0v,Q

�v) or (P 0v,Q

rv), depending of Defender’s choice.

In the first case Attacker is forced to play the action � and the players reach

Page 144: advanced topics in biosimulation and coinduction

128 Luca Aceto, Anna Ingolfsdottir and Jirı Srba

the pair (Pv1 ,Qv1 ) (playing action r leads to an immediate loss for Attacker asDefender can again reach a pair of equal processes). Similarly, in the secondcase Attacker must play the action r and Defender forces the pair (Pv2 ,Qv2 ).

To sum up, starting from the pair (Po,Qo), where o is the output node ofthe circuit, the players choose, step by step, one particular path in the circuitleading to an input node. From the current pair (Pv,Qv), where v is labelled by^, it is Attacker who chooses the next pair; if the node v is labelled by _ it isDefender who chooses (in two rounds) the next pair. Attacker wins if, and onlyif, the players reach a pair of processes that represent an input node with theassigned value false. Hence if the output value of C is true then Defender hasa winning strategy in the strong bisimulation game. Note that if, on the otherhand, Attacker has a winning strategy then it can be achieved by attacking onlyfrom the left-hand-side process (in this case, when the output value of C isfalse, there must be an input node set to false, because the circuit is monotone).Hence if the output value of C is false then Attacker has a winning strategy inthe strong simulation game.

We have so argued for the following P-hardness theorem.

Theorem 3.3.5 The equivalence checking problem between two processesin a finite-state, acyclic labelled transition system is P-hard for any relationbetween strong simulation preorder and strong bisimilarity.

Exercise 3.3.6 Assume that the output of some given circuit C is true. Usingthe ideas of the proof presented above, generalise your solution to Exercise 3.3.4in order to construct a bisimulation containing the pair (Po,Qo).

In fact, Sawa and Jancar proved in [SJ01] that the problem is P-hard for allrelations between the trace preorder and bisimilarity. Their result is even moregeneral, but the encoding is more involved.

Finally, note that in the reduction presented above we used four differentactions. So the question is whether equivalence checking is P-hard even in caseof a singleton action alphabet. Unfortunately, the answer is positive also inthis case. For bisimilarity this result is a consequence of the original reductionprovided by Balcazar, Gabarro and Santha [BGS92], which uses only a singleaction for the encoding of any alternating mCVP instance. In order to show thatthe problem is P-hard also for other behavioural equivalences and preorders,we shall now present a simple construction based on [Srb01], which providesa general log-space reduction of bisimilarity checking on labelled transitionsystems with several actions to bisimilarity checking over a one-letter action set.

Assume two given processes P and Q over an LTS T with the set of actionsfa1, a2, . . . , a�g. We shall construct a modified LTS T 0 which contains all the

Page 145: advanced topics in biosimulation and coinduction

The algorithmics of bisimilarity 129

processes of T together with some additional ones defined in the following

way: for every transition P1ai

�! P2 in T we add into T 0

� two transitions P1 �! P(P1,ai ,P2) and P(P1,ai ,P2) �! P2 where P(P1,ai ,P2) is anewly added state, and

� a newly added path of length i from P(P1,ai ,P2).

Finally, for every process P in T we create in T 0 a newly added path of length�C 1 starting from P . As the LTS T 0 contains only one action, we omit its namefrom the transition relation. We shall call the newly added processes into T 0

intermediate processes. An example of the reduction is depicted in Figure 3.9.

Exercise 3.3.7 Consider the one-action LTS in Figure 3.9. Argue that Attackerhas a winning strategy in the bisimulation game starting from the pair (P1, P

0)where P 0 D P(P1,a2,P3) and from the pair (P1, P2).

The reduction presented above can clearly be carried out in log-space. More-over, we can observe the following property of the LTS T 0.

Lemma 3.3.8 Let P be a process of T and P 0 a newly added intermediateprocess in T 0. Then P 6� P 0 in the LTS T 0.

Proof We describe Attacker’s winning strategy from the pair (P,P 0). In thefirst round Attacker plays the transition from P that starts the path of length�C 1 that was added to the LTS T 0. Defender answers by a move from P 0. Nowif Defender ended again in some intermediate process, it must be in a branchstarting from some P(P1,ai ,P2), but this configuration is winning for Attacker bynot changing sides and by simply making the remaining � moves along thepath he chose initially. Defender cannot do as many moves and loses. If, on theother hand, Defender ended in some of the original processes in T , Attackerwill change sides and play the sequence of �C 1 transitions available from thisoriginal processes. Again, Defender cannot match this sequence in the otherprocess as the sequence of moves he has at his disposal is shorter by one. HenceDefender loses also in this case. �

Due to Lemma 3.3.8, we know that during any bisimulation game Defenderis forced to play in T 0 in such a way that every current configuration consistseither of two intermediate processes or of two processes from the originalLTS T .

We can now observe that for any two processes P and Q in T we have P � Q

in T if, and only if, P � Q in T 0. Indeed, each move P1ai

�! P2 by the Attackerin the original LTS T is simulated by two moves P1 �! P(P1,ai ,P2) �! P2 inthe LTS T 0 and Defender can only answer by some corresponding two moves

Page 146: advanced topics in biosimulation and coinduction

130 Luca Aceto, Anna Ingolfsdottir and Jirı Srba

�������P1a1

a2

**���

����

����

����

����

����

����

��������P2

a2

�������P3

�� ���� �� ������ ������

�� ������

�� ������

�� ���� �� ������

�������P1

��

++���

����

����

���� ������

�������P2

��

�� ����P 0

��

�� ����

�� ���� �� ������ ������ ���� �������P3

�� ���� �� ���� �� ����Fig. 3.9. Input LTS above and the one-action LTS below where P 0 D P(P1,a2,P3).

such that in the intermediate state the length of the available path leading to adeadlock is the same as on the Attacker’s side. Hence Defender has to use thesequence of two transitions that corresponds to the same action as played byAttacker. (Should Defender choose a different move, Attacker will easily winthe game.) Similarly, if Defender has a winning strategy in the original LTS T ,it can be easily extended to a winning strategy in T 0.

Page 147: advanced topics in biosimulation and coinduction

The algorithmics of bisimilarity 131

Because the proposed reduction preserves acyclicity, we obtain the followingtheorem.

Theorem 3.3.9 Strong bisimilarity checking over finite LTSs is log-spacereducible to strong bisimilarity checking over finite LTSs over a one-letteraction alphabet. Moreover, the reduction preserves acyclicity.

By combining Theorem 3.3.5 and Theorem 3.3.9 we obtain the promised P-hardness result for finite labelled transition systems over a singleton action set.

Corollary 3.3.10 The equivalence-checking problem between two processes ina finite, acyclic labelled transition system over a singleton action set is P-hardfor any relation between the strong simulation preorder and strong bisimilarity.

Remark 3.3.11 Note that the above presented reduction from LTS to a one-letter action alphabet LTS works even for infinite-state systems. The question is,though, what classes of infinite-state systems are closed under this constructionand whether it is efficiently implementable. Indeed, as argued in [Srb01], thisis true for may well-known classes of systems generated by, e.g. pushdownautomata or Petri nets and the transformation is efficient and moreover preservesanswers to μ-calculus model checking problems.

Exercise 3.3.12 Find a (small) modification of the reduction in the proof ofTheorem 3.3.9 (see also the example in Figure 3.9), such that one can reachthe following conclusion regarding the size of the constructed system over aone-letter action alphabet: if the original LTS has n states, m transitions and m0

actions, then the constructed LTS has O(nCm0) states and O(m) transitions.Since m0 � m, this will imply that the constructed system has O(nCm) statesand O(m) transitions.

It is well known that weak bisimilarity, observational congruence [Mil89],branching bisimilarity and rooted branching bisimilarity [GW96] coincide withstrong bisimilarity over τ -free labelled transition systems. Since the actionsused in constructing the labelled transition system from a monotone Booleancircuit as in the proof of Theorem 3.3.5 can be chosen to be different from τ , theproof of Theorem 3.3.5 also yields a log-space reduction of the monotone circuitvalue problem to that of deciding weak bisimilarity, observational congruence,branching bisimilarity and rooted branching bisimilarity over a finite, acycliclabelled transition system. We therefore have the following result.

Theorem 3.3.13 The problem of deciding weak bisimilarity, observationalcongruence, branching bisimilarity and rooted branching bisimilarity betweentwo states in a finite, acyclic labelled transition system is P-hard. This holdstrue even when the set of actions is a singleton.

Page 148: advanced topics in biosimulation and coinduction

132 Luca Aceto, Anna Ingolfsdottir and Jirı Srba

Readers who are familiar with [San12, section 2.10.2] will recall that, overimage-finite labelled transition systems (and hence over finite labelled transitionsystems), strong bisimilarity coincides with the relation

�ωD \i�0 �i ,

where �i , i 0, is the i-th approximant to bisimilarity. In their classicpaper [HM85], Hennessy and Milner defined an alternative non-increasing(with respect to set inclusion) sequence 'i , i 0, of approximants to bisimi-larity as follows:

� P '0 Q always holds.� P 'iC1 Q iff for each sequence of actions w:

(1) for each P 0 such that Pw! P 0, there is some Q0 such that Q

w! Q0 and

P 0 'i Q0;(2) for each Q0 such that Q

w! Q0, there is some P 0 such that P

w! P 0 and

P 0 'i Q0.

The relations 'i , i 0, are the so-called nested trace semantics [AFGI04].For instance, '1 is trace equivalence and '2 is possible-futures equiva-lence [RB81]. Each of the'i , i 0, is an equivalence relation and is preservedby the operators of CCS introduced in [San12, chapter 3].

Hennessy and Milner showed in [HM85] that, over image-finite labelledtransition systems, strong bisimilarity also coincides with the relation

'ωD \i�0 'i .

In stark contrast to the P -completeness of bisimilarity checking over finitelabelled transition systems, Kanellakis and Smolka proved in [KS90] the fol-lowing result to the effect that computing the relations'i , i 1, is much harderthan computing bisimilarity.

Theorem 3.3.14 (Kanellakis and Smolka) For each i 1, the problem ofdeciding the equivalence'i over finite labelled transition systems is PSPACE-complete.

Proof Recall that '1 is just trace equivalence. Deciding trace equivalenceover finite labelled transition systems is known to be PSPACE-complete. (Seelemma 4.2 in [KS90], where this result is attributed to Chandra and Stock-meyer.) We are therefore left to prove the claim for 'i , i 2.

We begin by arguing that deciding the equivalence 'i is PSPACE-hard foreach i 2. To this end, we prove that '1 reduces (in polynomial time) to 'i ,for each i 2. In order to show this claim, it suffices only to give a polynomial

Page 149: advanced topics in biosimulation and coinduction

The algorithmics of bisimilarity 133

time reduction from 'i to 'iC1, for each i 1. In presenting the reductionfrom'i to'iC1, we shall use the operators of action prefixing and choice fromCCS that were introduced in [San12, section 3.1]. (Note that those operatorscan be viewed as operations over the class of finite labelled transition systems.)

The reduction works as follows. Let P and Q be two states in a finite labelledtransition system. Define the processes P 0 and Q0 thus:

P 0 D a. (P CQ) and

Q0 D a. P C a. Q,

where a is an arbitrary action in our labelled transition system. We claim that

P 'i Q iff P 0 'iC1 Q0.

This can be shown as follows.

� If P 0 'iC1 Q0 then the definition of'i yields that P 'i P CQ 'i Q, fromwhich P 'i Q follows by the transitivity of'i .

� Assume now that P 'i Q holds. We prove that P 0 'iC1 Q0.We limit ourselves to showing that for each sequence of actions w and

process P 00 such that P 0w! P 00, there is some Q00 such that Q0

w! Q00 and

P 00 'i Q00. We proceed by considering three cases, depending on whether w

is empty, w D a or w is of length at least two.• Suppose that w is empty. Then P 0 D P 00 and Q0 D Q00. Recall that 'i is

a congruence with respect to action prefixing and choice. Therefore, sinceP 'i Q and choice is easily seen to be idempotent with respect to'i ,

P 0 D a. (P CQ) 'i a. P 'i a. P C a. P 'i a. P C a. Q 'i Q0,

and we are done.• Suppose that w D a. Then P 00 D P CQ and reasoning as in the previous

case we infer that, for instance, P 00 'i P . Since Q0a! P , we are done.

• Suppose that w is of length at least two. In this case, it is easy to see that

Q0w! P 00 and the claim follows since'i is reflexive.

Therefore 'i reduces to 'iC1, for each i 1, as claimed. It follows that '1

reduces (in polynomial time) to 'i , for each i 2, by applying the reductiongiven above (i � 1) times.

Membership of each 'i , i 2, in PSPACE can be shown by reducingthe problem of deciding 'i to the equivalence problem for non-deterministicfinite automata (see, e.g. [Sip06]), which is a well-known PSPACE-completeproblem [GJ79, SM73]. To this end, observe that, since we already knowthat '1 is in PSPACE, we can reason inductively as follows. Assume that

Page 150: advanced topics in biosimulation and coinduction

134 Luca Aceto, Anna Ingolfsdottir and Jirı Srba

'i is in PSPACE, for some i 1. Using this assumption, we proceed to provemembership in PSPACE for'iC1. Let P and Q be two states in a finite labelledtransition system. Let fB1, . . . , Bkg be the partition of the set of states inducedby the equivalence 'i . (The partition can be computed using a polynomialamount of space since 'i is in PSPACE by our inductive assumption.)

Observe now that we can view our input finite labelled transition system as anon-deterministic finite automaton with either P or Q as start state and with anyof the sets B1, . . . , Bk as set of accept states. For each � 2 f1, . . . , kg, let L�(P )(respectively, L�(Q)) denote the language accepted by the non-deterministicfinite automaton that results by taking P (respectively, Q) as start state and B�

as set of accept states. It is easy to see that

P 'iC1 Q iff L�(P ) D L�(Q), for each � 2 f1, . . . , kg.

This yields membership in PSPACE for'iC1, which was to be shown. �

In the light of the above theorem, bisimilarity over finite labelled transition sys-tems can be decided in polynomial time, but is the ‘limit’ of a non-increasingsequence of equivalences that are all PSPACE-complete. We shall meet ana-logues of this result in Section 3.4.

Remark 3.3.15 In the setting of equational axiomatisations of behaviouralrelations, the paper [AFGI04] presents hardness results for nested trace seman-tics that are akin to Theorem 3.3.14 and set them apart from bisimilarity. Moreprecisely, in that reference, the authors show that, unlike bisimilarity, none ofthe relations 'i , i 2, affords a finite, ground-complete axiomatisation overbasic CCS.

3.3.3 EXPTIME-completeness of equivalence checking onnetworks of finite processes

We have shown in Theorem 3.3.5 that the equivalence checking problem onfinite, acyclic processes is P-hard for any relation between the simulation pre-order and bisimilarity. In fact, the usually studied equivalences and preordersbetween the simulation preorder and bisimilarity, such as the completed, readyand 2-nested simulations preorders, are also decidable in deterministic polyno-mial time. (See [San12, chapter 6] or the encyclopaedic survey paper [Gla01]for the definition of those relations. An efficient algorithm for deciding theready simulation preorder is described in [BP95].)

The aforementioned results are rather encouraging and bode well for theuse of such relations in computer-aided implementation verification. However,one should realise that the complexity of the algorithms we have presented so

Page 151: advanced topics in biosimulation and coinduction

The algorithmics of bisimilarity 135

far is measured with respect to the size of the input labelled transition system.These systems are called flat systems. However, in practice the studied LTS isoften given indirectly, for example as a parallel composition of communicatingfinite-state agents. The semantics of such a composition is still given in terms oflabelled transition systems; however, the resulting LTS is often of exponentialsize with respect to the size of the description of the system. The formalismsthat provide such a succinct description of large labelled transition systems arecalled non-flat systems. In this section, we shall introduce one example of anon-flat system where a number of concurrent finite processes communicatevia synchronisation on common actions and we shall study the complexity ofbisimulation-like equivalence checking on such non-flat systems. As we shallsee, the resulting decision problems become computationally hard in such asetting.

Let (Pri, Acti,�!i) be a finite LTS for every i, 1 � i � n. A network offinite processes is a parallel composition P1 j P2 j j Pn where Pi 2 Pri foreach i 2 f1, . . . , ng. The semantics of such a composition is given in terms ofa flat LTS (Pr,Act,�!) where

� Pr D Pr1 � Pr2 � � Prn,� Act D Act1 [ Act2 [ [ Actn, and� (Q1,Q2, . . . ,Qn)

a�! (Q01,Q

02, . . . ,Q

0n) whenever Qi

a�!i Q0i if a 2 Acti ,

and Qi D Q0i if a 62 Acti .

The flattening of the network P1 j P2 j j Pn is then the process(P1, P2, . . . , Pn) in the above-defined LTS and the equivalence checking prob-lem on networks of finite processes is defined simply by using the standardnotion on the underlying flattened systems.

It was shown by Rabinovich [Rab97] that equivalence checking for networksof finite processes with hiding of actions is PSPACE-hard for any relationbetween trace equivalence and bisimilarity. Rabinovich conjectured that theproblem is EXPTIME-hard. Indeed, EXPTIME-hardness was already knownfor bisimilarity [JM96] and simulation equivalence [HKV97] and the conjec-ture was later partially confirmed by Laroussinie and Schnoebelen [LS00],who proved an EXPTIME-hardness result for all the relations between thesimulation preorder and bisimilarity on networks of finite processes. In theirproof, Laroussinie and Schnoebelen do not use any hiding of actions. Finally,Sawa [Saw03] settled Rabinovich’s conjecture by showing that equivalencechecking on networks of finite processes with hiding is EXPTIME-hard for allrelations between the trace preorder and bisimilarity.

We shall now argue that many equivalence checking problems with respect tobisimulation-like equivalences/preorders are EXPTIME-complete on networks

Page 152: advanced topics in biosimulation and coinduction

136 Luca Aceto, Anna Ingolfsdottir and Jirı Srba

of finite processes (without hiding). Our exposition of the hardness result isbased on the ideas from [LS00], though the construction is different in thetechnical details and the presentation is simplified by using the previouslydiscussed Defender’s forcing technique [JS08].

The EXPTIME-hardness proof is done by offering a polynomial-time reduc-tion from the acceptance problem for alternating linear bounded automata(ALBA), a well-known EXPTIME-complete problem, see, e.g. [Sip06].

An ALBA is a tuple M D (Q,Q9,Q8, �, �,�,�, q0, qacc, qrej , δ) where

� Q9 and Q8 are finite, disjoint sets of existential, respectively universal,control states and Q D Q9 [Q8,

� � is a finite input alphabet,� � � is a finite tape alphabet,� �,� 2 � are the left and right end-markers,� q0, qacc, qrej 2 Q are the initial, accept and reject states, respectively, and� δ : Q n fqacc, qrej g � � ! Q �Q � � � f�1,C1g is a computation step

function, such that whenever δ(p, x) D (q1, q2, y, d) then x D � iff y D �and if x D � then d D C1, and x D � iff y D � and if x D � then d D �1.

We can, without loss of generality, assume that the input alphabet is binary, thatis � D fa, bg and that the tape alphabet only contains the symbols from theinput alphabet and the end-markers, that is � D fa, b,�,�g. We shall write

px!y,d����! q1, q2 whenever δ(p, x) D (q1, q2, y, d). The intuition is that if the

machine M is in a state p and is reading the tape symbol x, it can replace x

with y, move the tape head one position to the right (if d D C1) or to the left(if d D �1) and enter the control state q1 or q2 (depending on the type of thecontrol state p the choice between q1 and q2 is either existential or universal).

A configuration of M is given by the current control state, the positionof the tape head and the content of the tape; we write it as a triple fromQ � N � (f�g. ��. f�)g. The head position on the left end-marker � is bydefinition 0. A step of computation is a relation between configurations, denotedby `, that is defined using the function δ in the usual way. For example, for

the transition pa!b,C1�����! q1, q2 we get (p, 1,�aab�) ` (q1, 2,�bab�) and

(p, 1,�aab�) ` (q2, 2,�bab�).Given a word w 2 ��, the initial configuration of M is (q0, 1,�w�). A con-

figuration is called accepting if it is of the form (qacc, i,�w0�), and it is calledrejecting if it is of the form (qrej , i,�w0�).

A computation tree on an input w 2 �� is a labelled tree such that theroot is labelled by the initial configuration, the leaves are the nodes labelledby accepting or rejecting configurations and every non-leaf node labelled by a

Page 153: advanced topics in biosimulation and coinduction

The algorithmics of bisimilarity 137

configuration c with existential control state has exactly one child labelled withsome c0 such that c ` c0, and every non-leaf node labelled by a configurationc with universal control state has exactly two children labelled with c1 andc2 such that c1 and c2 are the two successor configurations of c, i.e. c ` c1

and c ` c2. Without loss of generality, we shall assume from now on that anycomputation tree is finite (see e.g. [Sip06, page 198]).

A computation tree on an input w is called accepting if its leaves are labelledonly with accepting configurations. An ALBA M accepts a word w 2 ��, ifthere exists an accepting computation tree of M on w.

As already mentioned, the problem of deciding whether a given ALBA M

accepts a given word w 2 �� is EXPTIME-complete (see, e.g. [Sip06]).Let M be a given ALBA with an input w D w1w2 . . . wn 2 fa, bg�. We shall

construct (in polynomial time) two networks of finite processes

P D C(q0, 1) j T �0 j T

w11 j T

w22 j j T

wn

n j T�nC1

and

Q D D(q0, 1) j T �0 j T

w11 j T

w22 j j T

wn

n j T�nC1

such that

� if M accepts w then Defender has a winning strategy in the bisimulationgame from (P,Q), and

� if M does not accept w then Attacker has a winning strategy in the simulationgame from (P,Q).

Having shown these claims, we will be able to conclude that equivalencechecking for any relation between the simulation preorder and bisimilarity onnetworks of finite processes is EXPTIME-hard. (This kind of general reasoningwas explained in Remark 3.3.3.)

The intuition behind the construction is that in the processes

T �0 , T

w11 , T

w22 , . . . , T wn

n , T �nC1

we remember the actual content of the tape. Because the left and right end-markers cannot be rewritten, it is sufficient that the processes T �

0 and T �nC1 are

one-state processes and because we assume that the rest of the tape consistsonly of the symbols a and b, the remaining processes T

w11 , . . . , T wn

n will allcontain exactly two states, remembering the current content of the particulartape cell. Additionally, the process P has the parallel component C(p, i), whichrepresents the current control state and the position of the tape head; similarlythe same information is remembered in the process Q in the parallel componentD(p, i). In fact, the use of C or D is the only point where the processes P and

Page 154: advanced topics in biosimulation and coinduction

138 Luca Aceto, Anna Ingolfsdottir and Jirı Srba

Q differ. The processes representing the tape cells will communicate with theprocess C(p, i) or D(p, i) using actions of the form (x, y, i), meaning that ifthe tape cell i contains the symbol x, it is going to remember the symbol y afterthe (hand-shake) communication takes place. Defining the processes C(p, i)and D(p, i) is rather straightforward. The only challenge is the implementationof the choice between the new control states q1 and q2. If p is a universalstate then it will be Attacker who chooses one of them – implementation of thischoice by the Attacker is easy. If p is an existential state, it will be Defender whochooses the next control state – this part of the construction will be implementedusing the Defender’s forcing technique, which was already used in the proof ofTheorem 3.3.5 showing the P-hardness of the equivalence checking problem onflat processes. Finally, in the process C(qrej , i) Attacker will be able to performa special action rej for which Defender will have no answer in the processD(qrej , i).

Formally, the reduction is computed as follows.

(1) Create a process T �0 with the only transition T �

0

(�,�,0)�����! T �

0 .

(2) Create a process T �nC1 with the only transition T �

nC1

(�,�,nC1)�������! T �

nC1.(3) For every i, 1 � i � n, create two processes T a

i and T bi with the transitions

� T ai

(a,b,i)����! T b

i ,

� T ai

(a,a,i)����! T a

i ,

� T bi

(b,a,i)����! T a

i , and

� T bi

(b,b,i)����! T b

i .The following picture shows the processes constructed in parts (1)–(3).

��������T �0

(�,�,0)

,, ��������T a1

(a,a,1)

,,

(a,b,1)

--

. . . ��������T ai

(a,a,i)

,,

(a,b,i)

--

. . . ��������T an

(a,a,n)

,,

(a,b,n)

--

��������T �nC1

(�,�,nC1)

,,

��������T b1

(b,b,1)

..

(b,a,1)

//

. . . ��������T bi

(b,b,i)

..

(b,a,i)

//

. . . ��������T bn

(b,b,n)

..

(b,a,n)

//

(4) For every i, 0 � i � nC 1, and every transition px!y,d����! q1, q2 in M such

that p 2 Q8 create the processes C(p, i), C0(q1, q2, i C d,8), C(q1, i C

d), C(q2, i C d) and D(p, i), D0(q1, q2, i C d,8), D(q1, i C d), D(q2, i C

d) together with the transitions

Page 155: advanced topics in biosimulation and coinduction

The algorithmics of bisimilarity 139

� C(p, i)(x,y,i)����! C0(q1, q2, i C d,8),

� C0(q1, q2, i C d,8)1�! C(q1, i C d),

� C0(q1, q2, i C d,8)2�! C(q2, i C d), and

� D(p, i)(x,y,i)����! D0(q1, q2, i C d,8),

� D0(q1, q2, i C d,8)1�! D(q1, i C d),

� D0(q1, q2, i C d,8)2�! D(q2, i C d).

The two fragments of the leading processes in P and Q, pictured below

for the rule px!y,d����! q1, q2 with p 2 Q8, demonstrate the construction.

�� ��� ��C(p, i)

(x,y,i)

�� ��� ��D(p, i)

(x,y,i)�� ��� ��C0(q1, q2, i C d,8)

1

�������� 2

��!!!

!!!

�� ��� ��D0(q1, q2, i C d,8)

1

�������� 2

��!!!

!!!

�� ��� ��C(q1, i C d)�� ��� ��C(q2, i C d)

�� ��� ��D(q1, i C d)�� ��� ��D(q2, i C d)

Consider a play in the bisimulation game starting from the pair of processesC(p, i) j T and D(p, i) j T , where T D T �

0 j j Txi j j T

�nC1 is a par-

allel composition of the processes representing the tape content. Assume

that there is a rule px!y,d����! q1, q2. The only possible transition, a com-

munication between C(p, i), respectively D(p, i), and T xi under the action

(x, y, i), is uniquely determined in both of the processes C(p, i) j T andD(p, i) j T . Hence, after one round of the bisimulation game, the playersnecessarily reach a pair of processes of the form C0(q1, q2, i C d,8) j T 0

and D0(q1, q2, i C d,8) j T 0 for some modified tape content T 0. NowAttacker can play either the action 1 or 2 (without any communication) inorder to select the next control state q1 or q2 of the ALBA M .

(5) For every i, 0 � i � nC 1, and every transition px!y,d����! q1, q2 in

M such that p 2 Q9 create the processes C(p, i), C0(q1, q2, i C d, 9),C00(q1, q2, i C d), C(q1, i C d), C(q2, i C d) and D(p, i), D0(q1, q2, i C

d, 9), D1(q1, q2, i C d), D2(q1, q2, i C d), D(q1, i C d), D(q2, i C d)together with the transitions

� C(p, i)(x,y,i)����! C0(q1, q2, i C d, 9),

� C0(q1, q2, i C d, 9)a�! C00(q1, q2, i C d),

� C0(q1, q2, i C d, 9)a�! D1(q1, q2, i C d),

� C0(q1, q2, i C d, 9)a�! D2(q1, q2, i C d),

Page 156: advanced topics in biosimulation and coinduction

140 Luca Aceto, Anna Ingolfsdottir and Jirı Srba

� C00(q1, q2, i C d)1�! C(q1, i C d),

� C00(q1, q2, i C d)2�! C(q2, i C d), and

� D(p, i)(x,y,i)����! D0(q1, q2, i C d, 9),

� D0(q1, q2, i C d, 9)a�! D1(q1, q2, i C d),

� D0(q1, q2, i C d, 9)a�! D2(q1, q2, i C d),

� D1(q1, q2, i C d)1�! D(q1, i C d),

� D1(q1, q2, i C d)2�! C(q2, i C d),

� D2(q1, q2, i C d)2�! D(q2, i C d),

� D2(q1, q2, i C d)1�! C(q1, i C d).

The added transitions for the rule px!y,d����! q1, q2 where p 2 Q9 are

depicted below.

�� ��� ��C(p, i)

(x,y,i)

�� ��� ��D(p, i)

(x,y,i)

�� ��� ��C0(q1, q2, i C d, 9)

a

a

00"""

""""

""""

""""

""

a

11######

######

######

######

####

�� ��� ��D0(q1, q2, i C d, 9)

a

22$$$$$$$$$$$$

a

33%%%

%%%%

%%%%

%

�� ��� ��C00(q1, q2, i C d)

1

44&&&&&&&&&&&

2

55'''''''''''

�� ��� ��D1(q1, q2, i C d)

1

2

��(((((((((((((((

�� ��� ��D2(q1, q2, i C d)

2

1

66))))))))

))))))))

))))))))

))))))))

))

�� ��� ��C(q1, i C d) �� ��� ��C(q2, i C d) �� ��� ��D(q1, i C d) �� ��� ��D(q2, i C d)

As before, after one round of any play in the bisimulation game start-ing from C(p, i) j T and D(p, i) j T (where T is the parallel composi-tion of processes representing the tape content) the players necessarilyend in a pair consisting of processes of the form C0(q1, q2, i C d, 9) j T 0

and D0(q1, q2, i C d, 9) j T 0. Attacker is now forced to play the actiona (no communication) in the left-hand-side process and enter the stateC00(q1, q2, i C d) j T 0 – any other attack gives Defender the possibility to

Page 157: advanced topics in biosimulation and coinduction

The algorithmics of bisimilarity 141

enter the same state chosen by Attacker and leads therefore to a losingline of play for Attacker. Defender answers either by entering the stateD1(q1, q2, i C d) j T 0 or D2(q1, q2, i C d) j T 0. From the pair consistingof the processes C00(q1, q2, i C d) j T 0 and D1(q1, q2, i C d) j T 0, Attackerclearly has to play the action 1 (no communication) in order to avoid reach-ing a pair of equal processes after Defender’s answer to his move. Simi-larly, from the pair consisting of the processes C00(q1, q2, i C d) j T 0 andD2(q1, q2, i C d) j T 0, Attacker has to play the action 2. That means thatthe play will continue either from the pair consisting of C(q1, i C d) j T 0

and D(q1, i C d) j T 0, or from the one consisting of C(q2, i C d) j T 0 andD(q2, i C d) j T 0. Note that it was Defender who selected the next controlstate of the ALBA in this case.

(6) Finally, for every i, 0 � i � nC 1, add C(qrej , i)rej��! C(qrej , i).

This ensures that if during some play the players reach a rejectingconfiguration, Attacker wins by performing the action rej in the left-hand-side process to which Defender has no answer in the right-hand-sideprocess.

To sum up, the players can force each other to faithfully simulate a computationof a given ALBA M on a word w. Attacker is selecting the successor config-uration if the present control state is universal, Defender does the selection ifthe present control state is existential. Recall that we assumed that the compu-tation tree of M on w does not have any infinite branches. We can thereforeconclude that if M accepts w then Defender can force any play to reach a pairof processes representing an accepting leaf in the computation tree when it isAttacker’s turn to play next. This is clearly a winning position for Defender asno continuation of the play is possible in either of the processes. On the otherhand, if M does not accept w, Attacker can force any play to reach a pair of pro-cesses representing a rejecting leaf in the computation tree when it is his turn toplay the action rej , and Defender loses. In this case, Attacker is moreover ableto implement the winning strategy by playing exclusively in the left-hand-sideprocess. Therefore we can state the following generic hardness result.

Theorem 3.3.16 The equivalence checking problem between two networks offinite processes is EXPTIME-hard for any relation between the strong simula-tion preorder and strong bisimilarity.

Notice now that because essentially all bisimulation-like equivalences andpreorders studied in the literature are decidable in polynomial time on flat sys-tems, we get an immediate EXPTIME-algorithm for these equivalence check-ing problems on non-flat systems, simply by flattening the networks of finite

Page 158: advanced topics in biosimulation and coinduction

142 Luca Aceto, Anna Ingolfsdottir and Jirı Srba

processes (causing an exponential increase in size) and running the polyno-mial time algorithms on the flattened system. Hence we obtain the followingcorollary.

Corollary 3.3.17 The problems of checking the simulation preorder and equiv-alence, completed simulation preorder and equivalence, ready simulation pre-order and equivalence, 2-nested simulation preorder and equivalence, andbisimilarity on networks of finite processes are EXPTIME-complete.

3.4 Decidability results for bisimilarity overinfinite-state systems

We shall now consider the questions of decidability/undecidability of bisim-ilarity on so-called infinite-state systems, i.e. labelled transition systems withinfinitely many reachable states. For example, these systems naturally arisewhen one models infinite data domains, such as counters, integer variables,stacks and queues, or unbounded control structures, like recursive procedurecalls, dynamic process creation and mobility, and in parameterised reasoninginvolving an arbitrary number of identical processes.

Of course, an infinite-state system cannot be passed as an input to an algo-rithm as it is. We need to find a suitable finite representation of such a systemin order to ask decidability questions. For the purpose of this chapter, weshall consider the concept of process rewrite systems as it provides a finitedescription of many well-studied formalisms like pushdown automata or Petrinets. After introducing process rewrite systems, we shall focus on two selectedresults. First, we shall argue that bisimilarity is decidable over the class ofBasic Parallel Processes (BPP), which form the so-called communication-freesubclass of Petri nets. The result will be proved using the tableau technique,which is applicable also in many other cases. Second, we will demonstrate thatbisimilarity is undecidable over the whole class of Petri nets. Finally we givean overview of the current state of the art in the area.

3.4.1 Process rewrite systems

We start by introducing several well-studied classes of infinite-state processesby means of process rewrite systems (PRS). Process rewrite systems are anelegant and universal approach defined, in the form presented in this chap-ter, by Mayr [May00]. Mayr’s definition unifies and extends some previously

Page 159: advanced topics in biosimulation and coinduction

The algorithmics of bisimilarity 143

introduced formalisms for infinite-state systems (see, e.g. the overview arti-cles [BCMS01, BE97, Mol96]).

Let Const be a set of process constants. The classes of process expressionscalled 1 (process constants plus the empty process), P (parallel process expres-sions), S (sequential process expressions), and G (general process expressions)are defined by the following abstract syntax

1: E ::D ε j X

P: E ::D ε j X j E j E

S: E ::D ε j X j E. EG: E ::D ε j X j E j E j E. E

where ‘ε’ is the empty process, X ranges over Const, the operator ‘.’ standsfor sequential composition and ‘j’ stands for parallel composition. Obviously,1 � S, 1 � P , S � G and P � G. The classes S and P are incomparable andS \ P D 1.

We do not distinguish between process expressions related by a structuralcongruence, which is the smallest congruence over process expressions suchthat the following laws hold:

� ‘.’ is associative,� ‘j’ is associative and commutative, and� ‘ε’ is a unit for both ‘.’ and ‘j’.

Definition 3.4.1 Let α, β 2 f1,S,P,Gg be classes of process expressions suchthat α � β and let Act be a set of actions. An (α, β)-PRS [May00] is a finiteset

� �(α � fεg

)� Act � β

of rewrite rules, written Ea�! F for (E, a, F ) 2 �. By Const(�) we denote

the set of process constants that appear in � and by Act(�) the set of actionsthat appear in �.

An (α, β)-PRS determines a labelled transition system whose states are processexpressions from the class β (modulo the structural congruence), Act is the setof labels, and the transition relation is the least relation satisfying the followingSOS rules (recall that ‘j’ is commutative).

(Ea�! E0) 2 �

Ea�! E0

Ea�! E0

E. Fa�! E0. F

Ea�! E0

E j Fa�! E0 j F

.

Page 160: advanced topics in biosimulation and coinduction

144 Luca Aceto, Anna Ingolfsdottir and Jirı Srba

(G,G)-PRSPRS

��������

����

����

(S,G)-PRSPAD

��������

����

����

(P,G)-PRSPAN

��������

����

����

(S,S)-PRSPDA

(1,G)-PRSPA

(P,P)-PRSPN

(1,S)-PRSBPA

��������

��������(1,P)-PRS

BPP

��������

��������

(1, 1)-PRSFS

��������

��������

Fig. 3.10. Hierarchy of process rewrite systems.

Many classes of infinite-state systems studied so far – e.g. basic process algebra(BPA), basic parallel processes (BPP), pushdown automata (PDA), Petri nets(PN) and process algebra (PA) – are contained in the hierarchy of processrewrite systems presented in Figure 3.10. This hierarchy is strict with respect tostrong bisimilarity and we refer the reader to [May00] for further discussions.

We shall now take a closer look at the classes forming the PRS hierarchy.

Finite-state processes Finite-state processes (FS) – or equivalently (1, 1)-PRS – generate a class of transition systems with finitely many reachablestates. Here rules are of the form

Xa�! Y or X

a�! ε

where X, Y 2 Const(�) and a 2 Act(�).

Basic process algebra Basic process algebra (BPA) – or equivalently (1,S)-PRS – represents the class of processes introduced by Bergstra and Klop in,for instance, [BK85]. BPA is a model of purely sequential process behavioursuch that a process constant can be replaced by a finite sequence of symbols

Page 161: advanced topics in biosimulation and coinduction

The algorithmics of bisimilarity 145

via prefix rewriting. For example the rewrite rules

Xa�! X. Y and X

b�! ε and Y

c�! X

allow us to perform the sequence of transitions

Xa�!X. Y

a�!X. Y . Y

b�!Y . Y

c�!X. Y

a�!X. Y . Y

a�!X. Y . Y . Y

where the sequential composition of the process constants behaves like a stackwith the top on the left-hand side. This class also corresponds to the transitionsystems associated with context-free grammars in Greibach normal form, inwhich only left-most derivations are allowed.

Basic parallel processes Basic parallel processes (BPP) – or equivalently(1,P)-PRS – are a fragment of CCS [Mil89] without restriction, relabellingand communication. It is a parallel analogue of BPA where any occurrence ofa process constant inside a parallel composition can be replaced by a numberof process constants put in parallel. For example, the rewrite rules

Xa�! X j Y j Y and Y

b�! ε

allow us to derive the following sequence of transitions:

Xa�!X jY jY

b�!X jY

a�! X j Y jY jY

b�!X jY jY

a�!X j Y j Y j Y j Y .

The class BPP was first studied by Christensen [Chr93], and it is equivalent tothe communication-free subclass of Petri nets (each transition has exactly oneinput place). The classes BPA and BPP are also called simple process algebras.

Pushdown processes Pushdown processes (PDA) – or equivalently (S,S)-PRS – represent the class of processes introduced via sequential prefix rewritingwith unrestricted rules. Caucal [Cau92] showed that an arbitrary unrestricted(S,S)-PRS can be transformed into a PDA system (where rewrite rules are of

the form pXa�! qγ such that p and q are control states, X is a stack symbol

and γ is a sequence of stack symbols) in such a way that their generatedtransition systems are isomorphic. Hence (S,S)-PRS and PDA are equivalentformalisms.

PA-processes PA-processes (PA for process algebra) – or equivalently (1,G)-PRS – represent the class of processes originally introduced by Bergstra andKlop in [BK84]. This formalism combines the parallel and sequential operatorbut allows for neither communication nor global-state control.

Page 162: advanced topics in biosimulation and coinduction

146 Luca Aceto, Anna Ingolfsdottir and Jirı Srba

������ !X

77*****

**������ !U

a

88+++++++

77*****

**

�������� !Y

������ !V

Fig. 3.11. A Petri net fragment corresponding to the rule X j Ya�! U j V j Y

Petri nets Petri nets (PN) – or equivalently (P,P)-PRS – represent theclass of processes that correspond to the standard and well-studied notionof labelled place/transition (P/T) nets as originally proposed by Petri [Pet62].In fact, (P,P)-PRS capture exactly the class of Petri nets with multiple arcs(see, e.g. [Pet81]). The correspondence between (P,P)-PRS and Petri nets isstraightforward: process constants are names of places in the Petri net, anyexpression from P appearing during a computation is represented as a markingwhere the number of occurrences of a process constant gives the number oftokens in the place named after the process constant, and every rule gives riseto a labelled transition in the net as depicted in the example in Figure 3.11.

PAD, PAN and PRS processes The systems PAD, PAN and PRS correspondto (S,G)-PRS, (P,G)-PRS and (G,G)-PRS, respectively. These classes com-plete the hierarchy of process rewrite systems and were introduced by Mayr;see [May00]. The PAD class is the smallest common generalisation of PA andPDA [May98] and PAN is a combination of the models PA and PN [May97a].The most general class PRS subsumes all the previously mentioned classes. It isworth mentioning that even the class (G,G)-PRS is not Turing powerful since,e.g. the reachability problem (i.e. whether from a given process expressionwe can in finitely many steps reach another given process expression) remainsdecidable [May00]. In fact, reachability remains decidable even in the recentlyintroduced generalisation of PRS called weakly extended process rewrite sys-tems [KRS05], where a finite control-unit with a monotonic behaviour providesan extra control over the process behaviours.

Further motivation for studying the classes from the PRS hierarchy can befound in [Esp02] and the classes from the PRS hierarchy also have a direct linkwith interprocedural control-flow analysis of programs [EK99].

Bisimilarity-checking problem The problem we shall now study is whetherwe can decide the following:

Given two processes from some class in the PRS hierarchy, are the two processesbisimilar or not?

Page 163: advanced topics in biosimulation and coinduction

The algorithmics of bisimilarity 147

First, we shall argue that this problem is decidable for the BPP class and thenwe prove its undecidability for Petri nets.

3.4.2 Deciding bisimilarity on BPP using a tableau technique

Our aim is now to show decidability of bisimilarity on BPP. Christensen,Hirshfeld and Moller first proved this positive result in [Chr93, CHM93], usingthe so-called tableau technique. The presentation of the decidability result inthis section is based on their proof.

We shall now introduce our running example. Without loss of generalitywe assume that in what follows any BPP system � uses the process constantsConst(�) D fX1, . . . , Xng for some n.

Example 3.4.2 Assume a BPP system � with the following rules.

X1a�! X1 jX2

X2b�! X3

X3b�! ε

X4a�! X4 jX3 jX3.

We encourage the reader to draw initial fragments of labelled transition systemsgenerated by the processes X1 and X4 and to establish that X1 � X4. �

We mention the standard fact that any BPP process E over � can beviewed as a Parikh vector φ(E) D (k1, k2, . . . , kn) 2 Nn, where Const(�) DfX1, X2, . . . , Xng and ki is the number of occurrences of Xi in E. Hence theParikh vector simply counts the number of occurrences of the different pro-cess constants in a given expression. Clearly, two BPP processes E and F arestructurally congruent if and only if φ(E) D φ(F ).

Example 3.4.3 The rules from Example 3.4.2 can be viewed as rules overParikh vectors in the following way.

(1, 0, 0, 0)a�! (1, 1, 0, 0)

(0, 1, 0, 0)b�! (0, 0, 1, 0)

(0, 0, 1, 0)b�! (0, 0, 0, 0)

(0, 0, 0, 1)a�! (0, 0, 2, 1).

A sequence of transitions

X1a�! X1 jX2

a�! X1 jX2 jX2

b�! X1 jX2 jX3

b�! X1 jX2

Page 164: advanced topics in biosimulation and coinduction

148 Luca Aceto, Anna Ingolfsdottir and Jirı Srba

then has a straightforward analogue over Parikh vectors, namely

(1, 0, 0, 0)a�! (1, 1, 0, 0)

a�! (1, 2, 0, 0)

b�! (1, 1, 1, 0)

b�! (1, 1, 0, 0).

Definition 3.4.4 Let α D (α1, . . . , αn) 2 Nn and β D (β1, . . . , βn) 2 Nn.

� By α C β we denote a component-wise addition defined by α C β D (α1 C

β1, . . . , αn C βn) 2 Nn.� We define a lexicographical ordering <� such that α <� β iff there is somek, 0 � k � n, such that αk < βk and αi D βi for all i, 1 � i < k.

� We define a component-wise ordering �c such that α �c β iff αi � βi forevery i, 1 � i � n, i.e. iff there is α0 2 Nn such that β D α C α0. We writeα <c β iff α �c β and α 6D β.

Observe that <� is a well-founded ordering – that is, there is no infinite sequenceα1, α2, . . . such that α1 >� α2 >� . . . – and note that α 6D β implies that eitherα <� β or β <� α. The following fact is known as Dickson’s lemma.

Lemma 3.4.5 ([Dic13]) Every infinite sequence from Nn has an infinite non-decreasing subsequence with respect to �c.

Before we describe the construction of a tableau proving bisimilarity of BPPprocesses, we introduce some simple facts about stratified bisimulation relationsintroduced in Definition 3.2.2 that will be used in the proof of soundness.

We note, first of all, that labelled transition systems generated by BPPprocesses are clearly image-finite.

An important property of labelled transition systems generated by BPPprocesses is that the stratified bisimulation relations �k are congruences. Thisfact will be essential in the soundness proof of the tableau construction.

Lemma 3.4.6 Let E, F and G be BPP processes over �. If E �k F then(E jG) �k (F jG) for any k 2 N.

Exercise 3.4.7 Prove Lemma 3.4.6.

By Lemma 3.2.3 and Lemma 3.4.6 we can conclude that bisimilarity on BPPis a congruence.

Lemma 3.4.8 Let E, F and G be BPP processes over �. If E � F then(E jG) � (F jG).

We can now proceed with the description of the tableau technique in orderto demonstrate decidability of bisimilarity on BPP. Let E and F be BPP

Page 165: advanced topics in biosimulation and coinduction

The algorithmics of bisimilarity 149

processes over the set of rules �. Recall that by φ(E) and φ(F ) we denotethe corresponding Parikh vectors over Nn.

A tableau for E and F is a maximal proof tree rooted with (φ(E), φ(F )) andbuilt according to the following rules. Let (α, β) 2 N2n be a node in the tree. Anode (α, β) is either terminal (leaf) or non-terminal. The following nodes areterminal:

� (α, α) is a successful leaf for any α 2 Nn,� (α, β) is a successful leaf if next(α,�) [ next(β,�) D ;,� (α, β) is an unsuccessful leaf if for some a 2 Act(�) it is the case that

next(α, a) [ next(β, a) 6D ;, and either next(α, a) D ; or next(β, a) D ;.

We say that a node is an ancestor of (α, β) if it is on the path from the root to(α, β) and at least one application of the rule EXPAND (defined later) separatesthem. If (α, β) is not a leaf then we reduce it using the following RED rules aslong as possible.

REDL

(α, β)

(γ C ω, β)

if there is an ancestor (γ, δ) or (δ, γ ) of (α, β) suchthat γ <� δ and α D δ C ω for some ω 2 Nn

REDR

(α, β)

(α, γ C ω)

if there is an ancestor (γ, δ) or (δ, γ ) of (α, β) suchthat γ <� δ and β D δ C ω for some ω 2 Nn .

If no reduction RED is applicable and the resulting node is not a leaf, weapply the rule EXPAND for a set of relations Sa , a 2 Act(�), where Sa �

next(α, a) � next(β, a) such that

� for each α0 2 next(α, a), there is some β 0 2 next(β, a) such that (α0, β 0) 2 Sa,

and� for each β 0 2 next(β, a), there is some α0 2 next(α, a) such that (α0, β 0) 2 Sa .

Note that there are several possible relations Sa that might satisfy the conditionabove:

EXPAND(α, β)

f(α0, β 0) j a 2 Act(�) ^ (α0, β 0) 2 Sag.

The set notation used in the rule EXPAND means that each element (α0, β 0) inthe conclusion of the rule becomes a new child in the proof tree. Now, we startagain applying the RED rules to every such child (which is not a leaf) as longas possible. Note that reduction rules are applicable to a node iff the node isnot terminal (leaf).

We call a tableau for (E,F ) successful if it is maximal (no further rules areapplicable) and all its leaves are successful.

Page 166: advanced topics in biosimulation and coinduction

150 Luca Aceto, Anna Ingolfsdottir and Jirı Srba

Example 3.4.9 A successful tableau for X1 and X4 of the BPP system � fromExample 3.4.2 is given below.

(1, 0, 0, 0), (0, 0, 0, 1)

(1, 1, 0, 0), (0, 0, 2, 1)EXPAND

(0, 1, 0, 1), (0, 0, 2, 1)REDL

(0, 1, 2, 1), (0, 0, 4, 1)

(0, 0, 4, 1), (0, 0, 4, 1)REDL

(0, 0, 1, 1), (0, 0, 1, 1)EXPAND

Note that for the first application of the rule EXPAND there was only onechoice of how to pair the successor processes (due to the fact that X1 and X2

have unique a-successors). Then the rule REDL is applicable because

(0, 0, 0, 1)︸ ︷︷ ︸γ

<� (1, 0, 0, 0)︸ ︷︷ ︸δ

,

(1, 1, 0, 0)︸ ︷︷ ︸α

D (1, 0, 0, 0)︸ ︷︷ ︸δ

C (0, 1, 0, 0)︸ ︷︷ ︸ω

and

(0, 1, 0, 1) D (0, 0, 0, 1)︸ ︷︷ ︸γ

C (0, 1, 0, 0)︸ ︷︷ ︸ω

.

Now no more REDL nor REDR are applicable, so we can apply the ruleEXPAND. Again, there is a unique a-successor in both processes (left child)and a unique b-successor in both processes (right child). The right child is bydefinition a successful leaf. By one more applications of the REDL rule onthe left child where (0, 0, 2, 1)︸ ︷︷ ︸

γ

<� (0, 1, 0, 1)︸ ︷︷ ︸δ

and where ω D (0, 0, 2, 0), we

complete the tableau as the created child is a successful leaf. �

Lemma 3.4.10 Any tableau for BPP processes E and F is finite and there areonly finitely many tableaux.

Proof We first show that any tableau for E and F is finite. To this end, observe,first of all, that any tableau for E and F is finitely branching because Act(�)is a finite set and for a given a 2 Act(�) any relation Sa is finite and there arefinitely many such relations. Should the tableau be infinite, there must be aninfinite branch, which, gives an infinite sequence of vectors from N2n. Since therules RED can be used only finitely many times in a sequence (they decreasethe <� order, which is well founded), there must be an infinite subsequence ofvectors on which the rule EXPAND was applied. Using Dickson’s Lemma 3.4.5,this sequence must contain an infinite non-decreasing subsequence (α1, β1) �c

Page 167: advanced topics in biosimulation and coinduction

The algorithmics of bisimilarity 151

(α2, β2) �c . . . However, the rule EXPAND cannot be applied on (α2, β2) sinceone of the RED rules is applicable. This is a contradiction.

Since there are only finitely many relations Sa for any a 2 Act(�) availablein the EXPAND rule and there are finitely many possibilities for an applicationof the RED rule, there are always finitely many possibilities for extendingan already existing partial tableau. Suppose that there were infinitely manytableaux starting from (φ(E), φ(F )). Then there must be a tableau with aninfinite branch, which contradicts that every tableau is finite. �

Lemma 3.4.11 (Completeness) Let E and F be two BPP processes over �.If E � F then there is a successful tableau for E and F .

Proof We construct inductively a tableau with root (φ(E), φ(F )) such that everynode (α, β) in the tableau satisfies α � β. Hence this tableau cannot containany unsuccessful leaf and it must be finite because of Lemma 3.4.10. Supposethat (α, β) is already a node in the tableau such that α � β and consider the ruleREDL applied on (α, β). We may assume, without loss of generality, that (γ, δ)is an ancestor of (α, β). By induction, γ � δ, which means by Lemma 3.4.8 that(γ C ω) � (δ C ω) D α � β. Hence (γ C ω) � β. Similarly for REDR . Fromthe definition of bisimilarity it follows that the rule EXPAND is also forwardsound, i.e. if α � β then we can choose for every a 2 Act(�) a relation Sa

such that (α0, β 0) 2 Sa implies that α0 � β 0. �

Lemma 3.4.12 (Soundness) Let E and F be two BPP processes over �. Ifthere is a successful tableau for E and F then E � F .

Proof For the sake of contradiction assume that there is a successful tableaufor E and F and E 6� F . We show that we can construct a path from the root(φ(E), φ(F )) to some leaf, such that for any pair (α, β) on this path α 6� β.

If E 6� F then using Lemma 3.2.3 there is a minimal k such that E 6�k F .Notice that if α 6�k β such that k is minimal and we apply the rule EXPAND,then at least one of its children (α0, β 0) satisfies α0 6�k�1 β 0. We choose such achild to extend our path from the root.

If we apply REDL on (α, β) where α 6�k β and k is minimal, then the corre-sponding ancestor (γ, δ) is separated by at least one application of EXPAND andso γ �k δ. This implies that (γ C ω) 6�k β, otherwise using Lemma 3.4.6 weget that α D (δ C ω) �k (γ C ω) �k β, which is a contradiction with α 6�k β.The same is true for REDR . Thus there must be a path from the root to someleaf such that for any pair (α, β) on this path α 6� β. This is a contradictionwith the fact that the path contains a successful leaf. �

Page 168: advanced topics in biosimulation and coinduction

152 Luca Aceto, Anna Ingolfsdottir and Jirı Srba

We can now conclude that it is decidable whether E � F for given BPP pro-cesses E and F . Indeed, E � F iff there is a successful tableau for E andF (Lemma 3.4.11 and Lemma 3.4.12). Moreover, there are only finitely manytableaux and all of them are finite. We can therefore state the following theorem.

Theorem 3.4.13 ([CHM93]) It is decidable whether E � F for any two givenBPP processes E and F .

Remark 3.4.14 As mentioned above, one can in principle view BPP processesas elements over the free commutative monoid (Nn,C, (0, . . . , 0)). Becausebisimilarity is a congruence over this monoid (Lemma 3.4.8), we can applya classical result to the effect that every congruence on a finitely generatedcommutative semigroup is finitely generated [Red65], in order to derive thepositive decidability result. For further references on this topic see [Hir94a,BCMS01, Jan08].

Unfortunately, the complexity of the above-presented tableau-based proof fordecidability of bisimilarity on BPP is unknown – no primitive recursive upperbound was given. Only recently, Jancar proved the containment of the prob-lem in PSPACE [Jan03] using a different technique based on the so-calleddd-functions. Together with the previously known PSPACE-hardness resultfrom [Srb03], PSPACE-completeness of the problem was finally shown.

Even though the tableau technique did not provide the best complexity upperbound in this case, it demonstrates a useful proof strategy that is applicablealso to several other classes of systems. A successful tableau can be viewedas a compact (finite) representation of Defender’s winning strategy (whichis in general infinite). What is, in principle, happening during the tableauconstruction is that we repeatedly use the rule EXPAND in order to simulatepossible attacks on the pair of processes present in the tableau. Defender’sstrategy corresponds to the selection of appropriate sets Sa for every availableaction a. Because for infinite state systems a construction of such a tableauusing only the EXPAND rule might not terminate, we need a way to ensuretermination. How to do this depends on the particular infinite-state system inquestion. In case of BPP, the guarantee of termination is based on the fact thatbisimilarity is a congruence, and we can therefore ensure that any constructedtableau is finite by means of the application of the rules REDL and REDR . Wecan call this approach simplification of the sub-goals.

In fact, the assumptions in the proof of soundness and completeness of thetableau technique are quite general, which allows us to extend the technique tocover several other variants/extensions of BPP processes like, e.g. lossy BPP,BPP with interrupt and discrete timed-arc BPP nets [Srb02].

Page 169: advanced topics in biosimulation and coinduction

The algorithmics of bisimilarity 153

The tableau technique has been frequently used in the literature. Here welimit ourselves to mentioning a few references relevant to the classes in thePRS hierarchy. Huttel and Stirling designed tableau rules in order to showthat bisimilarity is decidable on normed BPA [HS98]. (Normed means that allprocess constants in the BPA system can be reduced to the empty process ε infinitely many transitions.) In that reference, the authors use a similar congruenceproperty in order to simplify the sub-goals in the tableau. A tableau techniqueproved useful also for the decidability of weak bisimilarity on a subclass ofBPP processes [Sti01].

Considerably more involved applications of the tableau technique canbe found in the proofs of decidability of bisimilarity for normed PA-processes [HJ99], normed pushdown systems [Sti98] as well as for generalpushdown system [Sti00].

Other uses of the tableau technique include model checking problems forvarious temporal logics [BEM96, Cle90, LP85, SW91] and some other prob-lems, such as those addressed in [May97b, Sti03].

As already mentioned for the class BPP, tableau techniques do not alwaysprovide the most efficient algorithms from the computational complexity pointof view. There have been other techniques developed for proving decidabil-ity of bisimilarity, most notably the techniques based on finite bisimulationbases. In some instances these techniques provide polynomial time algorithmsfor bisimilarity on infinite-state systems. For a regularly updated list of refer-ences consult [Srb04]. Readers interested in an intuitive explanation of suchtechniques are directed to some recent overview articles [KJ06, Jan08].

3.4.3 Undecidability of bisimilarity on Petri nets

In this section we shall demonstrate a negative result for bisimilarity checkingon infinite-state labelled transition systems generated by Petri nets. The pre-sentation of the result is to a large extent based on [JS08], slightly simplifyingthe original proof by Jancar [Jan95]. The proof is done by reduction from thehalting problem for 2-counter Minsky machines.

A (Minsky) 2-counter machine (MCM) M , with non-negative counters c1

and c2, is a sequence of (labelled) instructions:

1 : instr1; 2 : instr2; . . . n : instrn

where instrn D HALT and each instri , for i 2 f1, 2, . . . , n�1g, is of thefollowing two types (assuming j, k 2 f1, 2, . . . , ng, r 2 f1, 2g):

Type (1) cr :D cr C 1; goto j

Type (2) if cr D 0 then goto j else (cr :D cr � 1; goto k).

Page 170: advanced topics in biosimulation and coinduction

154 Luca Aceto, Anna Ingolfsdottir and Jirı Srba

The instructions of type (1) are called increment instructions, the instructionsof type (2) are zero-test (and decrement) instructions.

The computation of M on the input (i1, i2) 2 N � N is the sequence ofconfigurations (i, n1, n2), starting with (1, i1, i2), where i 2 f1, 2, . . . , ng is thelabel of the instruction to be performed, and n1, n2 2 N are the (current) countervalues; the sequence is determined by the instructions in the obvious way. Thecomputation is either finite, i.e. halting by reaching the instruction n : HALT,or infinite.

We define inf-MCM as the problem to decide whether the computationof a given 2-counter MCM on (0, 0) is infinite, and we recall the followingwell-known fact.

Proposition 3.4.15 [Min67] Problem inf-MCM is undecidable.

Given a 2-counter machine M with n instructions, we construct a (P,P)-PRSsystem (a Petri net) with Const D fq1, q2, . . . , qn, q

01, q02, . . . , q

0n, C1, C2g in

which q1 � q 01 iff the computation of M on (0, 0) is infinite. We use the pair ofprocess constants qi, q

0i for (the label of) the i-th instruction, i 2 f1, 2, . . . , ng,

and the constants C1, C2 for unary representations of the values of the countersc1, c2. We define the following rules corresponding to (all) instructions of M

(where action a can be read as ‘addition’, i.e. increment, d as ‘decrement’, z as‘zero’, and h as ‘halt’).

‘i : cr :D cr C 1; goto j ’:

qi

a�! qj j Cr q 0i

a�! q 0j j Cr

‘i : if cr D 0 then goto j else (cr :D cr � 1; goto k)’:

qi j Cr

d�! qk q 0i j Cr

d�! q 0k

qi

z�! qj q 0i

z�! q 0j

qi j Cr

z�! q 0j j Cr q 0i j Cr

z�! qj j Cr

‘n : HALT’:

qn

h�! ε

Let (i, n1, n2) be a configuration of M . It will be represented by the pair ofprocesses

qi j Cn11 j C

n22 and q 0i j C

n11 j C

n22

Page 171: advanced topics in biosimulation and coinduction

The algorithmics of bisimilarity 155

where Cnrr for r 2 f1, 2g is a parallel composition of nr process constants Cr . If

the current instruction is increment, it is clear that, no matter how Attacker andDefender play, in one round they reach a pair of processes that represent thesuccessor configuration (one occurrence of Cr is added on both sides). If thecurrent instruction is zero-test and decrement and Attacker plays the action d,Defender can only mimic the move under d in the other process and both playersremove one occurrence of Cr on both sides, again reaching a configurationrepresenting the successor configuration of M . The same happens if the counter

cr is empty and Attacker plays using the rule qi

z�! qj or q 0i

z�! q 0j . Defender’s

only choice is to play using the rule q 0iz�! q 0j or qi

z�! qj in the other process

and the players faithfully simulate the computation of the machine M . The onlysituation where Attacker can ‘cheat’ is when the counter cr is not empty andAttacker plays the action z according to one of the four available rules (twoon the left-hand side and two on the right-hand side). Nevertheless, Defendercan in this case answer on the other side under the action z is such a waythat the players reach a pair of syntactically equal processes, a clear win forDefender.

The rules for the zero-test and decrement instruction provide another exam-ple of the use of Defender’s forcing technique [JS08] as it was already explainedin the proofs of Theorem 3.3.5 and Theorem 3.3.16.

To sum up we note that if M halts on (0, 0) then Attacker can force thecorrect simulation of M in both components of the starting pair q1 and q 01 and

finally win by playing qn

h�! ε (because there is no such rule for q 0n). If the

computation of M on (0, 0) is infinite then Defender forces Attacker to performthe correct simulation of the infinite computation and Defender wins the game.

This implies the following undecidability result.

Theorem 3.4.16 ([Jan95]) Bisimilarity on Petri nets is undecidable.

Remark 3.4.17 We remind the reader of the fact that the simulation of a2-counter Minsky machine by a Petri net, as outlined above, provides onlya so-called weak simulation. This means that the Petri net can mimic anybehaviour of the Minsky machine, but also displays some additional ‘cheating’behaviours. Indeed, the Petri net might decide to use the action z (for zero)even if the counter is not empty. This means, for instance, that the reachabilityproblem for Petri nets is still decidable (as mentioned before even for thewhole class of PRS, a superclass of Petri nets), but bisimilarity has the extrapower to filter out such incorrect behaviours and hence bisimilarity checkingis undecidable.

Page 172: advanced topics in biosimulation and coinduction

156 Luca Aceto, Anna Ingolfsdottir and Jirı Srba

undecidable

(G,G)-PRSPRS

��������

����

����

��

��

��

��

��

��

open (S,G)-PRSPAD

��������

����

����

(P,G)-PRSPAN

��������

����

����

��

��

��

decidable

(S,S)-PRSPDA

(1,G)-PRSPA

(P,P)-PRSPN

(1,S)-PRSBPA

��������

��������(1,P)-PRS

BPP

��������

��������

(1, 1)-PRSFS

��������

��������

Fig. 3.12. (Un)decidability results for strong bisimilarity.

3.4.4 Overview of results

An overview of the state of the art for strong bisimilarity checking over theclasses of processes from the PRS hierarchy is provided in Figure 3.12. Asshown in Theorem 3.4.16, bisimilarity is undecidable for PN and the twoclasses above it. It is on the other hand decidable for PDA [Sen98, Sti00]and hence also for BPA (direct proofs are also available in [CHS95, BCS95]),and for BPP (Theorem 3.4.13). It is remarkable that most other behaviouralequivalences apart from bisimilarity are undecidable already for BPA and BPP.Bar-Hillel, Perles, and Shamir [BHPS61] showed that the equivalence problemfor languages generated by context-free grammars is undecidable. In fact, all theequivalences in van Glabbeek’s spectrum [Gla01] (apart from bisimilarity) areundecidable for BPA [HT95, GH94]. For the case of BPP, Hirshfeld [Hir94b]showed that once again language equivalence is undecidable and as before noneof the equivalences from van Glabbeek’s spectrum coarser than bisimilarity aredecidable [Hut94]. Finally, we note that decidability of bisimilarity remainsan open problem for PAD and PA, though for normed PA processes a positivedecidability result already exists [HJ99].

For the case of weak bisimilarity, we know that it is not only undecidablebut even highly undecidable (complete for the class �1

1 on the first level of the

Page 173: advanced topics in biosimulation and coinduction

The algorithmics of bisimilarity 157

analytical hierarchy) for PDA, PA and PN [JS08]. The problem still remainsopen for BPA and BPP.

For further references the reader may consult [Srb04], where an on-line andupdated list of results is available (including also results for strong/weak regu-larity checking problems). Some recent overview articles [BCMS01, MSS04,KJ06, Jan08] provide further introduction to the area of equivalence checkingover infinite-state systems.

3.5 The use of bisimilarity checking in verification and tools

As we stated in Section 3.1, a model of computation like that of labelled tran-sition systems can be used to describe both implementations of processes andspecifications of their expected behaviours. A notion of behavioural equiva-lence or preorder over labelled transition systems can therefore be used as theformal yardstick to establish the correctness of a proposed implementation withrespect to a specification, when both are represented as objects in that model.Furthermore, from a foundational viewpoint, in the single-language approachto process theory, the informal notion of ‘process’ is formally characterised asan equivalence class of labelled transition systems with respect to some chosenbehavioural relation.

In the light of the importance of behavioural relations in the single-languageapproach to process theory and of the lack of consensus on what constitutes a‘reasonable’ notion of observable behaviour for reactive systems, it is perhapsnot overly surprising that the literature on concurrency theory offers a largevariety of behavioural semantics over labelled transition systems. (See the ency-clopaedic survey paper [Gla01] and the conference article [Gla93] for the defi-nition of a large number of those relations. Chapter 5 and chapter 6 in [San12]provide a smaller representative sample.) However, as the results we surveyed inthe previous sections indicate, various notions of bisimilarity stand out amongstthe plethora of available behavioural semantics because of their pleasing math-ematical properties and the remarkable algorithmic, complexity and decidabil-ity results that are available for them. Those algorithmic results make notionsof bisimilarity the prime candidates for implementation in software tools forcomputer-aided verification based on the single-language approach to processtheory, such as CADP [GLMS07], the Edinburgh Concurrency Workbench andits further incarnations [CPS93, CS96], and mCRL2 [GKMC08] to name buta few. After about two decades from the first development of such tools and oftheir use in computer-aided verification, it is natural to try to assess the actualapplications of bisimilarity checking in the practice of verification. This is our

Page 174: advanced topics in biosimulation and coinduction

158 Luca Aceto, Anna Ingolfsdottir and Jirı Srba

aim in the present section. Let us state at the outset that we cannot possibly hopeto give a comprehensive account of the available software tools and of theirapplications here. What we shall try to do instead is to highlight some of themost common uses of bisimilarity checking in the practice of (computer-aided)verification and sometimes how, and whether, they are used in applications ofthe representative tools we have mentioned above. Apart from the referenceswe present below, our presentation is also based on personal communicationswith Rance Cleaveland, Hubert Garavel and Jan Friso Groote.

3.5.1 Some uses of bisimilarity checking

Variations on the notion of bisimilarity play several roles in verification. Inthe remainder of this section, in order to focus our discussion, we shall onlyconsider those that, to our mind, are the most common and/or remarkable ones.

Bisimilarity as a correctness criterion As mentioned above, bisimilarity canbe used as the notion of behavioural relation for establishing formally thatimplementations are correct with respect to specifications expressed as labelledtransition systems. In the light of the results we discussed in previous sections,the choice of bisimilarity as a formal yardstick for proving correctness isalgorithmically attractive.

However, notions of bisimilarity are amongst the finest semantics in vanGlabbeek’s lattice of behavioural semantics over labelled transition systems.This begs the questions of whether bisimulation-like behavioural equivalencesare coarse enough in practice and whether such an approach to verificationis widely applicable. Answers to those questions vary from researcher toresearcher and we are not aware of systematic studies on the applicabilityof bisimilarity in verification. However, the experts we consulted tended toagree that weak and branching bisimilarity [GW96, Mil89] are, in general,adequate in applications and are far more efficient than other alternatives, bothin manual and in computer-aided correctness proofs. By way of example, RanceCleaveland, one of the chief architects behind the development and the appli-cations of the Concurrency Workbench of the New Century [CS96], wrote tous [Cle09]:

I personally have not found bisimulation to be unnecessarily restrictive whencomparing a specification LTS to an implementation LTS, but this is because inalmost all the cases I have worked with, the specification is deterministic.

Hubert Garavel, the chief architect of CADP [GLMS07], supported this viewand wrote [Gar09]:

Page 175: advanced topics in biosimulation and coinduction

The algorithmics of bisimilarity 159

In practice, you can do a lot by using strong bisimulation, branching bisimulation,and safety equivalence together (with their preorders). I do not remember a casewhere a more exotic equivalence would have been mandatory.

(Safety equivalence was introduced in [BFGC91] in order to provide a topo-logical characterisation of safety properties in branching-time semantics. Twoprocesses are related by the safety preorder iff whenever the left-hand-side pro-cess performs a sequence of τ actions followed by a visible action a then theright-hand-side can also perform a sequence of τ actions followed by a in such away that the resulting processes are again related by the safety preorder. It turnsout that, mirroring the situation in linear-time semantics [AL91, MP89], safetyproperties are exactly the closed sets in the topology induced by this preorder.)There are a few notorious examples of implementations and specifications thatare not bisimulation equivalent, such as Bloom’s two-writer register [Blo88],which can be proved correct in trace semantics. However, such examples arerare [Gro09].

There are also some interesting variations on using bisimilarity as a directverification technique. The INRIA-Sophia Antipolis team of Robert de Simoneand others proposed the notion of ‘observation criteria’ [BRdSV89]. The basicidea behind this notion is

(1) to define contexts (that is, open systems with which the implementationlabelled transition system is expected to interact) describing ‘usage scenar-ios’,

(2) to put the system being verified in these contexts, and(3) then use bisimilarity to compare the composite system to a labelled transi-

tion system representing an expected result.

One example of successful application of this approach is provided by [RC04],where Ray and Cleaveland used this idea to good effect in verifying a medical-device model. (In that paper, the verification method is called ‘unit verifica-tion’.) A closely related analysis technique is presented in [Vaa90], togetherwith some applications. All these approaches may be seen as special instances ofthe notion of context-dependent bisimilarity developed in [Lar86] and are basedon the idea to combat the state-explosion problem by focusing on fragmentsof system behaviour; the context is responsible for identifying the relevantfragments. An early example of a compositional protocol verification usingcontext-dependent bisimilarity may be found in [LM92].

According to Jan Friso Groote [Gro09], when using the verification toolmCRL2 [GKMC08], a very common approach is currently to minimise a statespace with respect to weak or branching bisimilarity and to inspect the resulting

Page 176: advanced topics in biosimulation and coinduction

160 Luca Aceto, Anna Ingolfsdottir and Jirı Srba

labelled transition system using a visualisation tool (in their setting, the toolltsgraph from the mCRL2 tool set). (If the graphs are not too large, reducingthem further using weak trace equivalence often simplifies the picture evenmore and is satisfactory when the interesting properties are trace properties.)Bisimilarity is the key technology for this approach, which is also supportedand adopted by CADP [GLMS07] when the state space of the (minimised)model is small enough that one can draw it and verify it visually.

The debate on which notion of behavioural relation is the most ‘reasonable’(in some sense) and the most suitable in verification (see also the discussionin [San12, section 5.14]) has been going on at least since the publication ofMilner’s first book on the Calculus of Communicating Systems [Mil80]. (See,for instance, the postings related to this issue that appeared in a very interestingdebate that raged on the Concurrency mailing list in the late 1980s and early1990s [Con90].) We feel that this chapter is not the most appropriate settingfor a thorough discussion of the relative merits of linear and branching timesemantics in verification, as this would lead us astray from the main gist ofthis contribution. We refer our readers to, for example, the articles [Gla94,NV07] for further interesting discussions of this issue and more pointers tothe literature. In the former reference, van Glabbeek presents arguments forperforming verifications using behavioural relations that, like various forms ofbisimilarity, preserve the ‘internal structure’ of processes. The advantage ofthis approach is that verifications using such equivalences apply to any coarserbehavioural relation based on testing scenarios. In the latter reference, Nainand Vardi argue instead that branching-time-based behavioural equivalencesare not suitable for use in verification because they distinguish processes thatcannot be told apart by any reasonable notion of observation. (See also thearticle [BIM95].)

We hope that we have provided enough information to our readers so thatthey can draw their own conclusions on this long-standing debate.

Bisimilarity as a tool for checking other behavioural relations Algorithmsfor computing bisimilarity over finite labelled transition systems can be used tocompute other behavioural relations. See, for instance, the paper [CH93] for anearly example of this application of bisimilarity. In that reference, Cleavelandand Hennessy showed how to compute the testing semantics from [DNH84]by using algorithms for bisimilarity checking. The resulting algorithms havebeen implemented in the Edinburgh Concurrency Workbench and its furtherincarnations [CPS93, CS96].

Moreover, minimisation with respect to bisimilarity can be used to improveon the efficiency of computing other behavioural relations. Indeed, since

Page 177: advanced topics in biosimulation and coinduction

The algorithmics of bisimilarity 161

bisimilarity is a finer relation than the others in van Glabbeek’s lattice, onecan minimise systems before comparing them with respect to the chosenbehavioural semantics.

In the specific case of the classic simulation preorder (see [San12, exer-cise 1.4.17] or [Gla01] for a definition of this relation), there has been someinteresting work on combining the computation of the simulation preorderwith bisimulation minimisation. The main idea behind this line of work is tointertwine the computation of simulation with minimisation, so that one can ter-minate early whenever the constraints of the simulation preorder are violated –see, for instance, the paper [TC01], which reports experimental data indicat-ing that this approach yields a substantial improvement upon the best-knownalgorithm for computing the simulation preorder, even when the systems areminimised with respect to bisimulation equivalence before applying the simula-tion algorithm. It is interesting to note that, even though the simulation preorderlooks deceptively similar to bisimilarity, recasting the simulation problem as acoarsest partition problem, which is the basic idea underlying the algorithmswe discussed in Section 3.2, does not appear to be at all easy. See, for instance,the paper [GP08] for a detailed discussion of this issue in relation to earlierproposals.

Bisimulation minimisation as a preprocessing step Minimising a finitelabelled transition system modulo bisimilarity can be used to reduce the sizeof a system description before applying model checking [CGP00]. The useof bisimilarity in this context is particularly attractive because, as essentiallyshown in [HM85], bisimilarity provides an abstraction technique that preservesthe truth and falsehood of any formula expressed in the μ-calculus [Koz83],and hence all CTL� [Dam94], CTL [CE81, McM93], and LTL [Pnu77] prop-erties. Moreover, as we saw in Section 3.2.4, bisimilarity can be computedsymbolically and automatically over finite labelled transition systems.

Despite the aforementioned mathematically pleasing properties of minimi-sation with respect to bisimilarity, which make it a promising preprocessingstep before applying model checking, and the increasing use of model checkingformulas in the modal μ-calculus with data, state-space reduction is not usedin verifications using mCRL2 [Gro09]. Instead, mCRL2 reduces the modelchecking problem to that of finding a solution to a Parameterised BooleanEquation System [GW05]. As Jan Friso Groote wrote to us [Gro09]:

Bisimulation reduction is not of much (practical) relevance here.

This conclusion is supported by the work by Fisler and Vardi reportedin [FV98, FV02]. In [FV98], the authors provided experimental evidence

Page 178: advanced topics in biosimulation and coinduction

162 Luca Aceto, Anna Ingolfsdottir and Jirı Srba

showing that the use of bisimulation minimisation as a preprocessing stepto model checking does reduce the resource requirements of model checking.However, the work presented in that reference also indicates that the cost ofbisimulation minimisation often exceeds that of model checking significantly.In [FV02], Fisler and Vardi provide experimental and analytical comparisonsbetween symbolic model checking for invariance properties and three novelROBBD-based algorithms that combine bisimulation minimisation and modelchecking based on the original algorithms given in [BFH91, LY92, PT87].Their results indicate that the integrated algorithms are less efficient than modelchecking and strongly suggest that performing bisimulation minimisation doesnot lead to improvements over the direct use of model checking.

Bisimilarity in compositional verification In the context of compositionalverification approaches, bisimilarity can be used to minimise componentsbefore each composition. This is the so-called minimise-then-compose heuris-tic, which can also be used as a means to combat the state-explosion problemin the generation of the labelled transition system for a composite system fromthose for its components.

Such an approach is used substantially in verifications using the tools CADPand FDR [For00], but is never used in applications of mCRL2 [Gro09]. Accord-ing to Jan Friso Groote [Gro09], the benefits offered by bisimilarity do not differvery much from those provided by other equivalences in van Glabbeek’s spec-trum in this respect, but its algorithmic efficiency makes it more applicablethan other behavioural semantics.

Bisimilarity as a tool to handle infinite-state systems Minimisation of asystem with respect to bisimilarity can sometimes be used to collapse infinitelabelled transition systems to finite ones. A system that is bisimilar to a finiteone is often called a regular process. Regularity checking has been studiedsubstantially over the classes of infinite-state systems from the PRS hierarchy,see, e.g. [Srb04] for an overview of results in that area.

The existence of a finite quotient of a hybrid or real-time system withrespect to bisimilarity is the key theoretical step behind tool support for theverification of such systems [AILS07, AD94, AHLP00]. In the case of hybridand timed automata, bisimilarity, while not explicitly present in the imple-mentation of the algorithms embodied in tools such as HyTech [HHWT97],Kronos [BDMC98] and Uppaal [BDLC06], serves as a mathematical enablerof model checking and as theoretical background for providing correctness andtermination arguments for the implemented algorithms.

The same phenomenon holds true for probabilistic and stochastic systems;see, for instance, [GH02, Hil96, LS91]. In the setting of stochastic processes,

Page 179: advanced topics in biosimulation and coinduction

The algorithmics of bisimilarity 163

notions of Markovian bisimilarity [Hil96] play a key role since they are consis-tent with the notion of lumping over continuous-time Markov chains [Buc94].This means that, whenever two processes are Markovian bisimilar, they areguaranteed to possess the same performance characteristics.

3.5.2 Concluding remarks

Overall, apart from its very satisfying mathematical properties and its strongconnections with logics and games, bisimilarity is computationally superior tothe other behavioural semantics that have been considered in the literature onconcurrency theory. Its algorithmic, complexity and decidability properties thathave been surveyed in this chapter are, to our mind, truly remarkable. As far asits suitability for and actual uses in verification are concerned, we hope that wehave been able to provide our readers with enough information to draw theirown conclusions. We feel confident that the debate on the merits of bisimilarityand related notions will continue for some time amongst concurrency theoristsand members of the computer-aided-verification community. Perhaps, this is asign of the fact that, despite divergences of opinions, the notion of bisimilarityis considered important, or at least interesting, by researchers in the aforemen-tioned communities and that it has become part of our cultural heritage. Whywould it be worth discussing otherwise?

Acknowledgements We thank Rance Cleaveland, Hubert Garavel and JanFriso Groote for their contributions to the development of Section 3.5. With-out their expert and thought-provoking opinions that section would have beenmuch less informative and rather uninteresting, if not plain boring. We are alsoindebted to Arnar Birgisson for his detailed reading of, and his comments on,parts of the chapter. Luca Aceto and Anna Ingolfsdottir were partly supportedby the projects ‘The Equational Logic of Parallel Processes’ (nr. 060013021)and ‘New Developments in Operational Semantics’ (nr. 080039021) of The Ice-landic Research Fund. Jirı Srba acknowledges partial support from the Ministryof Education of the Czech Republic, grant no. MSM0021622419. The chapterwas revised while Luca Aceto held an Abel Extraordinary Chair at UniversidadComplutense de Madrid, Spain, supported by the NILS Mobility Project.

Bibliography

[AD94] R. Alur and D.L. Dill. A theory of timed automata. Theoretical ComputerScience, 126(2):183–235, 1994. Fundamental Study.

[AFGI04] L. Aceto, W. Fokkink, R. van Glabbeek, and A. Ingolfsdottir. Nestedsemantics over finite trees are equationally hard. Information and Compu-tation, 191(2):203–232, 2004.

Page 180: advanced topics in biosimulation and coinduction

164 Luca Aceto, Anna Ingolfsdottir and Jirı Srba

[AFI01] L. Aceto, W. Fokkink, and A. Ingolfsdottir. 2-nested simulation is notfinitely equationally axiomatizable. In Proceedings of the 18th Interna-tional Symposium on Theoretical Aspects of Computer Science, STACS2001 (Dresden), volume 2010 of Lecture Notes in Computer Science,pages 39–50. Springer-Verlag, 2001.

[AHLP00] R. Alur, T.A. Henzinger, G. Lafferriere, and G.J. Pappas. Discrete abstrac-tions of hybrid systems. In Proceedings of the IEEE, 88: 971–984, 2000.

[AHU74] A.V. Aho, J.E. Hopcroft, and J.D. Ullman. The Design and Analysis ofComputer Algorithms. Addison-Wesley, 1974.

[AILS07] L. Aceto, A. Ingolfsdottir, K.G. Larsen, and J. Srba. Reactive Systems:Modelling, Specification and Verification. Cambridge University Press,2007.

[AL91] M. Abadi and L. Lamport. The existence of refinement mappings. Theo-retical Computer Science, 82(2):253–284, 1991.

[Bae90] J. Baeten, editor. Applications of Process Algebra. Cambridge Tracts inTheoretical Computer Science 17. Cambridge University Press, 1990.

[BCMS01] O. Burkart, D. Caucal, F. Moller, and B. Steffen. Verification on infinitestructures. In J. Bergstra, A. Ponse, and S. Smolka, editors, Handbook ofProcess Algebra, chapter 9, pages 545–623. Elsevier Science, 2001.

[BCS95] O. Burkart, D. Caucal, and B. Steffen. An elementary decision proce-dure for arbitrary context-free processes. In Proceedings of the 20th Inter-national Symposium on Mathematical Foundations of Computer Science(MFCS’95), volume 969 of LNCS, pages 423–433. Springer-Verlag, 1995.

[BDLC06] G. Behrmann, A. David, K.G. Larsen, J. Hakansson, P. Pettersson, W. Yi,and M. Hendriks. UPPAAL 4.0. In Third International Conference on theQuantitative Evaluation of Systems (QEST 2006), 11–14 September 2006,Riverside, California, USA, pages 125–126. IEEE Computer Society, 2006.

[BDMC98] M. Bozga, C. Daws, O. Maler, A. Olivero, S. Tripakis, and S. Yovine. Kro-nos: A model-checking tool for real-time systems. In A.J. Hu and M.Y.Vardi, editors, Computer Aided Verification, 10th International Confer-ence, CAV ’98, Vancouver, BC, Canada, June 28–July 2, 1998, Proceed-ings, volume 1427 of Lecture Notes in Computer Science, pages 546–550.Springer-Verlag, 1998.

[BE97] O. Burkart and J. Esparza. More infinite results. Bulletin of the EuropeanAssociation for Theoretical Computer Science, 62:138–159, June 1997.Columns: Concurrency.

[BEM96] J.C. Bradfield, J. Esparza, and A. Mader. An effective tableau system forthe linear time μ-calculus. In Proceedings of the 23rd International Col-loquium on Automata, Languages and Programming (ICALP’96), volume1099 of LNCS, pages 98–109. Springer-Verlag, 1996.

[BFGC91] A. Bouajjani, J.-C. Fernandez, S. Graf, C. Rodriguez, and J. Sifakis.Safety for branching time semantics. In J. Leach Albert, B. Monien, andM. Rodrıguez, editors, Proceedings 18th ICALP, Madrid, volume 510 ofLecture Notes in Computer Science, pages 76–92. Springer-Verlag, 1991.

[BFH91] A. Bouajjani, J.-C. Fernandez, and N. Halbwachs. Minimal model gen-eration. In E.M. Clarke and R.P. Kurshan, editors, Proceedings ofthe 2nd International Conference on Computer-Aided Verification, New

Page 181: advanced topics in biosimulation and coinduction

The algorithmics of bisimilarity 165

Brunswick, NJ, USA June 1990, volume 531 of Lecture Notes in ComputerScience, pages 197–203. Springer-Verlag, 1991.

[BGS92] J. Balcazar, J. Gabarro, and M. Santha. Deciding bisimilarity is P-complete.Formal Aspects of Computing, 4:638–648, 1992.

[BHPS61] Y. Bar-Hillel, M. Perles, and E. Shamir. On formal properties of simplephrase structure grammars. Zeitschrift fur Phonetik, Sprachwissenschaft,und Kommunikationsforschung, 14:143–177, 1961.

[BIM95] B. Bloom, S. Istrail, and A. Meyer. Bisimulation can’t be traced. Journalof the ACM, 42(1):232–268, 1995.

[BK84] J. Bergstra and J.W. Klop. Process algebra for synchronous communica-tion. Information and Control, 60(1/3):109–137, 1984.

[BK85] J.A. Bergstra and J.W. Klop. Algebra of communicating processes withabstraction. Theoretical Computer Science, 37:77–121, 1985.

[Blo88] B. Bloom. Constructing two-writer registers. IEEE Transactions on Com-puters, 37(12):1506–1514, 1988.

[BP95] B. Bloom and R. Paige. Transformational design and implementation of anew efficient solution to the ready simulation problem. Science of Com-puter Programming, 24(3):189–220, 1995.

[BPS01] J. Bergstra, A. Ponse, and S.A. Smolka, editors. Handbook of ProcessAlgebra. Elsevier, 2001.

[BRdSV89] G. Boudol, V. Roy, R. de Simone, and D. Vergamini. Process calculi,from theory to practice: Verification tools. In J. Sifakis, editor, AutomaticVerification Methods for Finite State Systems, volume 407 of Lecture Notesin Computer Science, pages 1–10. Springer-Verlag, 1989.

[Bry86] R.E. Bryant. Graph-based algorithms for boolean function manipulation.IEEE Transactions on Computers, C-35(6):677–691, 1986.

[Bry92] R.E. Bryant. Symbolic boolean manipulation with ordered binary-decision diagrams. ACM Computing Surveys, 24(3):293–318,1992.

[BS92] A. Bouali and R. de Simone. Symbolic bisimulation minimisation. InProceedings of CAV’92, volume 663 of Lecture Notes in Computer Science,pages 96–108. Springer-Verlag, 1992.

[Buc94] P. Buchholz. Exact and ordinary lumpability in finite Markov chains. Jour-nal of Applied Probability, 31(1):59–75, 1994.

[BW90] J. Baeten and P. Weijland. Process Algebra. Cambridge Tracts in Theoret-ical Computer Science 18. Cambridge University Press, 1990.

[Cau92] D. Caucal. On the regular structure of prefix rewriting. Theoretical Com-puter Science, 106(1):61–86, 1992.

[CE81] E.M. Clarke and E.A. Emerson. Design and synthesis of synchroniza-tion skeletons using branching-time temporal logic. In D. Kozen, editor,Proceedings of the Workshop on Logic of Programs, Yorktown Heights,volume 131 of Lecture Notes in Computer Science, pages 52–71. Springer-Verlag, 1981.

[CGP00] E.M. Clarke, O. Grumberg, and D.A. Peled. Model Checking. MIT Press,2000.

[CH93] R. Cleaveland and M. Hennessy. Testing equivalence as a bisimulationequivalence. Formal Aspects of Computing, 5(1):1–20, 1993.

Page 182: advanced topics in biosimulation and coinduction

166 Luca Aceto, Anna Ingolfsdottir and Jirı Srba

[CHM93] S. Christensen, Y. Hirshfeld, and F. Moller. Bisimulation is decidable forbasic parallel processes. In Proceedings of the 4th International Confer-ence on Concurrency Theory (CONCUR’93), volume 715 of LNCS, pages143–157. Springer-Verlag, 1993.

[Chr93] S. Christensen. Decidability and decomposition in process algebras. PhDthesis, The University of Edinburgh, 1993.

[CHS95] S. Christensen, H. Huttel, and C. Stirling. A polynomial algorithm fordeciding bisimilarity of normed context-free processes. Information andComputation, 12(2):143–148, 1995.

[Cle09] R. Cleaveland. Personal communication, January 2009.[Cle90] R. Cleaveland. Tableau-based model checking in the propositional mu-

calculus. Acta Informatica, 27(8):725–747, 1990.[Con90] Concurrency mailing list archive, 1988–1990. Available online at

http://homepages.cwi.nl/�bertl/concurrency/.[CPS93] R. Cleaveland, J. Parrow, and B. Steffen. The concurrency workbench: A

semantics-based verification tool for finite state systems. ACM Transac-tions on Programming Languages and Systems, 15(1):36–72, 1993.

[CS96] R. Cleaveland and S. Sims. The NCSU Concurrency Workbench. InR. Alur and T.A. Henzinger, editors, Proceedings of the 8th InternationalConference on Computer Aided Verification, New Brunswick, NJ, USA,July/August 1996, volume 1102 of Lecture Notes in Computer Science,pages 394–397. Springer-Verlag, 1996.

[CS01] R. Cleaveland and O. Sokolsky. Equivalence and preorder checking forfinite-state systems. In Bergstra et al. [BPS01], chapter 6, pages 391–424.

[Dam94] M. Dam. CTL� and ECTL� as fragments of the modal μ-calculus. Theo-retical Computer Science, 126:77–96, 1994.

[Dic13] L.E. Dickson. Finiteness of the odd perfect and primitive abundant num-bers with distinct factors. American Journal of Mathematics, 35:413–422,1913.

[DNH84] R. De Nicola and M. Hennessy. Testing equivalences for processes. Theo-retical Computer Science, 34:83–133, 1984.

[EFT93] R. Enders, T. Filkorn, and D. Taubner. Generating BDDs for symbolicmodel checking in CCS. Distributed Computing, 6(3):155–164, 1993.

[EK99] J. Esparza and J. Knoop. An automata-theoretic approach to interproce-dural data-flow analysis. In Proceedings of the 2nd International Con-ference on Foundations of Software Science and Computation Structures(FOSSACS’99), volume 1578 of LNCS, pages 14–30. Springer-Verlag,1999.

[Esp02] J. Esparza. Grammars as processes. In W. Brauer, H. Ehrig, J. Karhumaki,and A. Salomaa, editors, Formal and Natural Computing, volume 2300 ofLNCS, pages 277–297. Springer-Verlag, 2002.

[For00] Formal Systems (Europe) Ltd. Failures-Divergence Refinement – FRD2User Manual, 2000.

[FV98] K. Fisler and M.Y. Vardi. Bisimulation minimization in an automata-theoretic verification framework. In G. Gopalakrishnan and P.J. Windley,editors, Formal Methods in Computer-Aided Design, 2nd InternationalConference, FMCAD ’98, Palo Alto, California, USA, November 4–6,

Page 183: advanced topics in biosimulation and coinduction

The algorithmics of bisimilarity 167

1998, Proceedings, volume 1522 of Lecture Notes in Computer Science,pages 115–132. Springer-Verlag, 1998.

[FV02] K. Fisler and M.Y. Vardi. Bisimulation minimization and symbolic modelchecking. Formal Methods in System Design, 21(1):39–78, 2002.

[Gar09] H. Garavel. Personal communication, January 2009.[GH94] J.F. Groote and H. Huttel. Undecidable equivalences for basic process

algebra. Information and Computation, 115(2):353–371, 1994.[GH02] H. Garavel and H. Hermanns. On combining functional verification and

performance evaluation using CADP. In L.-H. Eriksson and P.A. Lindsay,editors, FME 2002: Formal Methods – Getting IT Right, International Sym-posium of Formal Methods Europe, Copenhagen, Denmark, July 22–24,2002, Proceedings, volume 2391 of Lecture Notes in Computer Science,pages 410–429. Springer-Verlag, 2002.

[GHR95] R. Greenlaw, H. James Hoover, and W.R. Ruzzo. Limits to Parallel Com-putation: P-Completeness Theory. Oxford University Press, 1995.

[GJ79] M.R. Garey and D.S. Johnson. Computers and Intractability. W. H. Free-man, 1979. A guide to the theory of NP-completeness, A Series of Booksin the Mathematical Sciences.

[GKMC08] J.F. Groote, J. Keiren, A. Mathijssen, B. Ploeger, F. Stappers, C. Tankink,Y. Usenko, M. van Weerdenburg, W. Wesselink, T. Willemse, and J. van derWulp. The mCRL2 toolset. In Proceedings International Workshop onAdvanced Software Development Tools and Techniques (WASDeTT 2008),2008.

[Gla93] R. van Glabbeek. The linear time–branching time spectrum II: the seman-tics of sequential processes with silent moves. In E. Best, editor, Proceed-ings CONCUR 93, Hildesheim, Germany, volume 715 of Lecture Notes inComputer Science, pages 66–81. Springer-Verlag, 1993.

[Gla94] R. van Glabbeek. What is branching time semantics and why to use it?Bulletin of the EATCS, 53:191–198, 1994.

[Gla01] R. van Glabbeek. The linear time–branching time spectrum. I. Thesemantics of concrete, sequential processes. In Bergstra et al. [BPS01],pages 3–99.

[GLMS07] H. Garavel, F. Lang, R. Mateescu, and W. Serwe. CADP 2006: A toolboxfor the construction and analysis of distributed processes. In W. Damm andH. Hermanns, editors, Proceedings of the 19th International Conference onComputer Aided Verification CAV’2007 (Berlin, Germany), volume 4590of Lecture Notes in Computer Science. Springer-Verlag, 2007.

[GP08] R. van Glabbeek and B. Ploeger. Correcting a space-efficient simulationalgorithm. In A. Gupta and S. Malik, editors, Computer Aided Verification,20th International Conference, CAV 2008, Princeton, NJ, USA, July 7–14,2008, Proceedings, volume 5123 of Lecture Notes in Computer Science,pages 517–529. Springer-Verlag, 2008.

[Gro09] J.F. Groote. Personal communication, January 2009.[GV90] J.F. Groote and F. Vaandrager. An efficient algorithm for branching bisim-

ulation and stuttering equivalence. In M. Paterson, editor, Proceedings17th ICALP, Warwick, volume 443 of Lecture Notes in Computer Science,pages 626–638. Springer-Verlag, July 1990.

Page 184: advanced topics in biosimulation and coinduction

168 Luca Aceto, Anna Ingolfsdottir and Jirı Srba

[GW96] R. van Glabbeek and W.P. Weijland. Branching time and abstraction inbisimulation semantics. Journal of the ACM, 43(3):555–600, 1996.

[GW05] J.F. Groote and T.A.C. Willemse. Parameterised boolean equation systems.Theoretical Computer Science, 343(3):332–369, 2005.

[HHWT97] T.A. Henzinger, P.-H. Ho, and H. Wong-Toi. HYTECH: A model checkerfor hybrid systems. In O. Grumberg, editor, Computer Aided Verification,9th International Conference, CAV ’97, Haifa, Israel, June 22-25, 1997,Proceedings, volume 1254 of Lecture Notes in Computer Science, pages460–463. Springer-Verlag, 1997.

[Hil96] J. Hillston. A Compositional Approach to Performance Modelling. Cam-bridge University Press, 1996.

[Hir94a] Y. Hirshfeld. Congruences in commutative semigroups. Technical reportECS-LFCS-94-291, Department of Computer Science, University of Edin-burgh, 1994.

[Hir94b] Y. Hirshfeld. Petri nets and the equivalence problem. In Proceedings of the7th Workshop on Computer Science Logic (CSL’93), volume 832 of LectureNotes in Computer Science, pages 165–174. Springer-Verlag, 1994.

[HJ99] Y. Hirshfeld and M. Jerrum. Bisimulation equivalence is decidable fornormed process algebra. In Proceedings of 26th International Colloquiumon Automata, Languages and Programming (ICALP’99), volume 1644 ofLNCS, pages 412–421. Springer-Verlag, 1999.

[HKV97] D. Harel, O. Kupferman, and M.Y. Vardi. On the complexity of verifyingconcurrent transition systems. In Proceedings of the 8th International Con-ference on Concurrency Theory (CONCUR’07), volume 1243 of LNCS,pages 258–272. Springer-Verlag, 1997.

[HM85] M. Hennessy and R. Milner. Algebraic laws for nondeterminism and con-currency. Journal of the ACM, 32(1):137–161, 1985.

[Hoa85] C.A.R. Hoare. Communicating Sequential Processes. Prentice-Hall, 1985.[HRS76] H.B. Hunt, D.J. Rosenkrantz, and T.G. Szymanski. On the equiva-

lence, containment, and covering problems for the regular and context-free languages. Journal of Computer and System Sciences, 12:222–268,1976.

[HS98] H. Huttel and C. Stirling. Actions speak louder than words: Provingbisimilarity for context-free processes. Journal of Logic and Computa-tion, 8(4):485–509, 1998.

[HT95] D.T. Huynh and L. Tian. On deciding readiness and failure equivalences forprocesses in �P

2 . Information and Computation, 117(2):193–205, 1995.[HU79] J.E. Hopcroft and J.D. Ullman. Introduction to Automata Theory, Lan-

guages and Computation. Addison-Wesley, 1979.[Hut94] H. Huttel. Undecidable equivalences for basic parallel processes. In Pro-

ceedings of the 2nd International Symposium on Theoretical Aspects ofComputer Software (TACS’94), volume 789 of LNCS, pages 454–464.Springer-Verlag, 1994.

[Jan95] P. Jancar. Undecidability of bisimilarity for Petri nets and some relatedproblems. Theoretical Computer Science, 148(2):281–301, 1995.

[Jan03] P. Jancar. Strong bisimilarity on basic parallel processes is PSPACE-complete. In Proceedings of the 18th Annual IEEE Symposium on Logic

Page 185: advanced topics in biosimulation and coinduction

The algorithmics of bisimilarity 169

in Computer Science (LICS’03), pages 218–227. IEEE Computer SocietyPress, 2003.

[Jan08] P. Jancar. Selected ideas used for decidability and undecidability of bisim-ilarity. In Proceedings of the 12th International Conference on Develop-ments in Language Theory (DLT’08), volume 5257 of LNCS, pages 56–71.Springer-Verlag, 2008.

[JM96] L. Jategaonkar and A.R. Meyer. Deciding true concurrency equivalenceson safe, finite nets. Theoretical Computer Science, 154(1):107–143, 1996.

[JS08] P. Jancar and J. Srba. Undecidability of bisimilarity by defender’s forcing.Journal of the ACM, 55(1):1–26, 2008.

[Kel76] R.M. Keller. Formal verification of parallel programs. Communications ofthe ACM, 19(7):371–384, 1976.

[KJ06] A. Kucera and P. Jancar. Equivalence-checking on infinite-state systems:Techniques and results. Theory and Practice of Logic Programming,6(3):227–264, 2006.

[Koz83] D.Kozen. Results on the propositional mu-calculus. Theoretical ComputerScience, 27:333–354, 1983.

[KRS05] M. Kretınsky, V. Rehak, and J. Strejcek. Reachability of Hennessy–Milnerproperties for weakly extended PRS. In Proceedings of the 25th Conferenceon Foundations of Software Technology and Theoretical Computer Science(FSTTCS’05), volume 3821 of LNCS, pages 213–224. Springer-Verlag,2005.

[KS83] P.C. Kanellakis and S.A. Smolka. CCS expressions, finite state processes,and three problems of equivalence. In Proceedings of the 2nd AnnualACM SIGACT-SIGOPS Symposium on Principles of Distributed Comput-ing (PODC’83), pages 228–240. ACM, 1983.

[KS90] P.C. Kanellakis and S.A. Smolka. CCS expressions, finite state pro-cesses, and three problems of equivalence. Information and Computation,86(1):43–68, May 1990.

[Lar86] K.G. Larsen. Context-dependent bisimulation between processes. PhD the-sis, Department of Computer Science, University of Edinburgh, 1986.

[LM92] K.G. Larsen and R. Milner. A compositional protocol verification usingrelativized bisimulation. Information and Computation, 99(1):80–108,1992.

[LP85] O. Lichtenstein and A. Pnueli. Checking that finite state concurrent pro-grams satisfy their linear specification. In Conference Record of the 12th

Annual ACM Symposium on Principles of Programming Languages, pages97–107, New Orleans, Louisiana, January 1985.

[LS91] K.G. Larsen and A. Skou. Bisimulation through probabilistic testing. Infor-mation and Computation, 94(1):1–28, 1991.

[LS00] F. Laroussinie and Ph. Schnoebelen. The state explosion problem fromtrace to bisimulation equivalence. In Proceedings of the 3rd InternationalConference on Foundations of Software Science and Computation Struc-tures (FOSSACS’00), volume 1784 of LNCS, pages 192–207. Springer-Verlag, 2000.

[LY92] D. Lee and M. Yannakakis. Online minimization of transition systems(extended abstract). In Proceedings of the 24th Annual ACM Symposium

Page 186: advanced topics in biosimulation and coinduction

170 Luca Aceto, Anna Ingolfsdottir and Jirı Srba

on the Theory of Computing, pages 264–274, Victoria, British Columbia,Canada, 4–6 May 1992.

[May97a] R. Mayr. Combining petri nets and PA-processes. In Proceedings of the3rd International Symposium on Theoretical Aspects of Computer Software(TACS’97), volume 1281 of LNCS, pages 547–561. Springer-Verlag, 1997.

[May97b] R. Mayr. Tableau methods for PA-processes. In Proceedings of Interna-tional Conference on Automated Reasoning with Analytic Tableaux andRelated Methods (TABLEAUX’97), volume 1227 of LNCS, pages 276–290.Springer-Verlag, 1997.

[May98] R. Mayr. Decidability and complexity of model checking problems forinfinite-state systems. PhD thesis, TU-Munchen, 1998.

[May00] R. Mayr. Process rewrite systems. Information and Computation,156(1):264–286, 2000.

[McM93] K. McMillan. Symbolic Model Checking. Kluwer Academic, 1993.[Mil80] R. Milner. A Calculus of Communicating Systems, volume 92 of Lecture

Notes in Computer Science. Springer-Verlag, 1980.[Mil89] R. Milner. Communication and Concurrency. Prentice-Hall, 1989.[Min67] M.L. Minsky. Computation: Finite and Infinite Machines. Prentice-Hall,

1967.[Mol96] F. Moller. Infinite results. In Proceedings of the 7th International Con-

ference on Concurrency Theory (CONCUR’96), volume 1119 of LectureNotes in Computer Science, pages 195–216. Springer-Verlag, 1996.

[MP89] Z. Manna and A. Pnueli. The anchored version of the temporal frame-work. In J.W. de Bakker, W.P. de Roever, and G. Rozenberg, editors, REXSchool/Workshop on Linear Time, Branching Time and Partial Order inLogics and Models for Concurrency, Noordwijkerhout, The Netherlands,May/June 1988, volume 354 of Lecture Notes in Computer Science, pages201–284. Springer-Verlag, 1989.

[MSS04] F. Moller, S. Smolka, and J. Srba. On the computational complexity ofbisimulation, redux. Information and Computation, 192(2):129–143, 2004.

[NV07] S. Nain and M.Y. Vardi. Branching vs. linear time: Semantical perspec-tive. In K.S. Namjoshi, T. Yoneda, T. Higashino, and Y. Okamura, editors,Automated Technology for Verification and Analysis, 5th InternationalSymposium, ATVA 2007, Tokyo, Japan, October 22–25, 2007, Proceed-ings, volume 4762 of Lecture Notes in Computer Science, pages 19–34.Springer-Verlag, 2007.

[Pap94] Ch.H. Papadimitriou. Computational Complexity. Addison-Wesley,1994.

[Pet62] C.A. Petri. Kommunikation mit Automaten. PhD thesis, Darmstadt, 1962.[Pet81] J.L. Peterson. Petri Net Theory and the Modelling of Systems. Prentice-

Hall, 1981.[Pnu77] A. Pnueli. The temporal logic of programs. In Proceedings 18th Annual

Symposium on Foundations of Computer Science, pages 46–57. IEEE,1977.

[PT87] R. Paige and R.E. Tarjan. Three partition refinement algorithms. SIAMJournal on Computing, 16(6):973–989, 1987.

Page 187: advanced topics in biosimulation and coinduction

The algorithmics of bisimilarity 171

[Rab97] A.M. Rabinovich. Complexity of equivalence problems for concurrentsystems of finite agents. Information and Computation, 139(2):111–129,1997.

[RB81] W.C. Rounds and S.D. Brookes. Possible futures, acceptances, refusals andcommunicating processes. In 22nd Annual Symposium on Foundations ofComputer Science, Nashville, Tennessee, pages 140–149, New York, 1981.IEEE.

[RC04] A. Ray and R. Cleaveland. Unit verification: the CARA experience. Soft-ware Tools for Technology Transfer, 5(4):351–369, 2004.

[Red65] L. Redei. The Theory of Finitely Generated Commutative Semigroups.Oxford University Press, 1965.

[San12] D. Sangiorgi. An Introduction to Bisimulation and Coinduction. CambridgeUniversity Press, 2012.

[Saw03] Z. Sawa. Equivalence checking of non-flat systems is EXPTIME-hard. InProceedings of the 14th International Conference on Concurrency The-orem (CONCUR’03), volume 2761 of LNCS, pages 233–248. Springer-Verlag, 2003.

[Sen98] G. Senizergues. Decidability of bisimulation equivalence for equationalgraphs of finite out-degree. In Proceedings of the 39th Annual IEEESymposium on Foundations of Computer Science, pages 120–129. IEEE,1998.

[Sip06] M. Sipser. Introduction to the Theory of Computation. Course Technology,2006.

[SJ01] Z. Sawa and P. Jancar. P-hardness of equivalence testing on finite-state pro-cesses. In Proceedings of the 28th Annual Conference on Current Trends inTheory and Practice of Informatics (SOFSEM’01), volume 2234 of LNCS,pages 326–345. Springer-Verlag, 2001.

[SM73] L.J. Stockmeyer and A.R. Meyer. Word problems requiring exponentialtime. In Proceedings 5th ACM Symposium on Theory of Computing, Austin,Texas, pages 1–9, 1973.

[Srb01] J. Srba. On the power of labels in transition systems. In Proceedings ofthe 12th International Conference on Concurrency Theory (CONCUR’01),volume 2154 of LNCS, pages 277–291. Springer-Verlag, 2001.

[Srb02] J. Srba. Note on the tableau technique for commutative transition systems.In Proceedings of the 5th International Conference on Foundations of Soft-ware Science and Computation Structures (FOSSACS’02), volume 2303of LNCS, pages 387–401. Springer-Verlag, 2002.

[Srb03] J. Srba. Strong bisimilarity of simple process algebras: Complexity lowerbounds. Acta Informatica, 39:469–499, 2003.

[Srb04] J. Srba. Roadmap of Infinite Results, volume 2: Formal Models and Seman-tics. World Scientific, 2004. An updated version can be downloaded fromthe author’s home-page.

[Sti95] C. Stirling. Local model checking games. In Proceedings of the 6th Inter-national Conference on Concurrency Theory (CONCUR’95), volume 962of LNCS, pages 1–11. Springer-Verlag, 1995.

[Sti98] C. Stirling. Decidability of bisimulation equivalence for normed pushdownprocesses. Theoretical Computer Science, 195(2):113–131, 1998.

Page 188: advanced topics in biosimulation and coinduction

172 Luca Aceto, Anna Ingolfsdottir and Jirı Srba

[Sti00] C. Stirling. Decidability of bisimulation equivalence for pushdown pro-cesses. Available from the author’s homepage, 2000.

[Sti01] C. Stirling. Decidability of weak bisimilarity for a subset of basic parallelprocesses. In Proceedings of the 4th International Conference on Foun-dations of Software Science and Computation Structures (FOSSACS’01),volume 2030 of LNCS, pages 379–393. Springer-Verlag, 2001.

[Sti03] C. Stirling. Bisimulation and language equivalence. In Logic for Concur-rency and Synchronisation, volume 18 of Trends Log. Stud. Log. Libr.,pages 269–284. Kluwer, 2003.

[SW91] C. Stirling and D. Walker. Local model checking in the modal mu-calculus.Theoretical Computer Science, 89(1):161–177, 1991.

[TC01] L. Tan and R. Cleaveland. Simulation revisited. In T. Margaria andW. Yi, editors, Tools and Algorithms for the Construction and Analysisof Systems, 7th International Conference, TACAS 2001 Held as Part of theJoint European Conferences on Theory and Practice of Software, ETAPS2001 Genova, Italy, April 2–6, 2001, Proceedings, volume 2031 of LectureNotes in Computer Science, pages 480–495. Springer-Verlag, 2001.

[Tho93] W. Thomas. On the Ehrenfeucht–Fraısse game in theoretical computerscience (extended abstract). In Proceedings of the 4th International JointConference CAAP/FASE, Theory and Practice of Software Development(TAPSOFT’93), volume 668 of LNCS, pages 559–568. Springer-Verlag,1993.

[Vaa90] F. Vaandrager. Some observations on redundancy in a context. In Baeten[Bae90], pages 237–260.

Page 189: advanced topics in biosimulation and coinduction

4

Bisimulation and logic

colin stirling

4.1 Introduction

Bisimulation is a rich concept which appears in various areas of theoreticalcomputer science as this book testifies. Besides its origin by Park [Pa81] asa small refinement of the behavioural equivalence originally defined by Hen-nessy and Milner between basic concurrent processes [HM80, HM85], it wasindependently, and earlier, defined and developed in the context of the modeltheory of modal logic (under the names of p-relations and zigzag relations)by Van Benthem [vB84] to give an exact account of which subfamily of first-order logic is definable in modal logic. Interestingly, to make their definition ofprocess equivalence more palatable, Hennessy and Milner introduced a modallogic to characterise it. For more details of the history of bisimulation seeChapter 1.

A labelled transition system (LTS) is a triple (Pr, Act,�!), see [San12],where Pr is a non-empty set of states or processes, Act is a set of labels and

�!� ℘(Pr � Act � Pr) is the transition relation. As usual, we write Pa�! Q

when (P, a,Q) 2 �!. A transition Pa�! Q indicates that P can perform action

a and become Q. In logical presentations, there is often extra structure in atransition system, a labelling of states with atomic propositions (or colours): letProp be a set of propositions with elements p, q. Formally, this extra componentis a valuation, a function V : Prop! ℘(Pr) that maps each p 2 Prop to a setV (p) � Pr (those states coloured p). An LTS with a valuation is often calleda Kripke model.1

We recall the important definition of bisimulation and bisimilarity, see[San12].

1 Traditionally, a Kripke model has unlabelled transitions of the form P �! Q representing thatstate Q is accessible to P .

173

Page 190: advanced topics in biosimulation and coinduction

174 Colin Stirling

P3 Q2

b��Q3

P1a P2

b

99

c ::

Q1

a99

a ::P4 Q4

c

�� Q5

R1

a���������

a

�����

����

S1

a

;;

a

��,,,

,,,,

R2b R3

c<<

c== S2

b S3

c<<

c

66))))))))

))))))))

)))))

S4b

S5

c

��---------------------

c

>>

Fig. 4.1. Examples of bisimilar and non-bisimilar processes.

Definition 4.1.1 A binary relation R on states of an LTS is a bisimulation ifwhenever P1 R P2 and a 2 A,

(1) for all P 01 with P1a�! P 01, there is P 02 such that P2

a�! P 02 and P 01 R P 02;

(2) for all P 02 with P2a�! P 02, there is P 01 such that P1

a�! P 01 and P 01 R P 02.

P1 is bisimilar to P2, P1 � P2, if there is a bisimulation R with P1 R P2. �

In the case of an enriched LTS with valuation V there is an extra clause in thedefinition of a bisimulation that it preserves colours:

(0) for all p 2 Prop, P1 2 V (p) iff P2 2 V (p).

Definition 4.1.1 assumes that a bisimulation relation is between states of a singleLTS. Occasionally, we also allow bisimulations between states of different LTSs(a minor relaxation because the disjoint union of two LTSs is an LTS).

Example 4.1.2 In Figure 4.1, R1 � S1 because the following relation Ris a bisimulation f(R1, S1), (R2, S2), (R2, S4), (R3, S3), (R3, S5)g. For instance,take the pair (R3, S3) 2 R; we need to show it obeys the hereditary conditions of

Definition 4.1.1. R3c�! R1 and R3

c�! R2; however, S3

c�! S1 and (R1, S1) 2 R;

also, S3c�! S4 and (R2, S4) 2 R. If this transition system were enriched with

V (p) D fR2, S4g then R1 and S1 would no longer be bisimilar. Furthermore,

Page 191: advanced topics in biosimulation and coinduction

Bisimulation and logic 175

P1 6� Q1 because P2 can engage in both b and c transitions whereas Q2 andQ4 cannot. �

In the remainder of this chapter, we shall describe key relationships betweenlogics and bisimulation. In Section 4.2, we examine the Hennessy–Milnermodal characterisation of bisimilarity. In Section 4.3 we prove van Benthem’sexpressiveness result that modal logic corresponds to the fragment of first-order logic that is bisimulation invariant. These results are then extended inSections 4.4 and 4.5 to modal mu-calculus, that is, modal logic with fixed points,and to the bisimulation invariant fragment of monadic second-order logic.

4.2 Modal logic and bisimilarity

Let M be the following modal logic where a ranges over Act.

φ ::D tt j :φ j φ1 _ φ2 j haiφ .

A formula is either the ‘true’ formula tt, the negation of a formula, :φ, adisjunction of two formulas, φ1 _ φ2, or a modal formula, haiφ, ‘diamond a

φ’. M is often called Hennessy–Milner logic as it was introduced by Hennessyand Milner to clarify process equivalence [HM80, HM85]. Unlike a standardpresentation of modal logic at that time, such as [Ch80], it is multi-modal,involving families of modal operators, one for each element of Act, and itavoids atomic propositions. The inductive stipulation below defines when astate P 2 Pr of a LTS L has a modal property φ, written P jDL φ; however wedrop the index L.

P jD ttP jD :φ iff P 6jD φ

P jD φ1 _ φ2 iff P jD φ1 or P jD φ2

P jD haiφ iff P 0 jD φ for some P 0 with Pa�! P 0.

The critical clause here is the interpretation of hai as ‘after some a-transition’;

for instance, Q1 jD haihbitt, where Q1 is in Figure 4.1, because Q1a�! Q2

and Q2 jD hbitt. In the context of full propositional modal logic over anenriched LTS with a valuation V one adds propositions p 2 Prop, with semanticclause

P jD p iff P 2 V (p).

Other connectives are introduced as follows: ‘false’, ff D :tt, conjunc-tion, φ1 ^ φ2 D :(:φ1 _ :φ2), implication, φ1 ! φ2 D :φ1 _ φ2 and the

Page 192: advanced topics in biosimulation and coinduction

176 Colin Stirling

dual modal operator ‘box a’, [a]φ D :hai:φ. Derived semantic clauses forthese defined connectives are as follows.

P 6jD ffP jD φ1 ^ φ2 iff P jD φ1 and P jD φ2

P jD φ1 ! φ2 iff if P jD φ1 then P jD φ2

P jD [a]φ iff P 0 jD φ for every P 0 with Pa�! P 0.

So, [a] means ‘after every a-transition’; for example P1 jD [a]hbitt whereas

Q1 6jD [a]hbitt, where these are in Figure 4.1, because Q1a�! Q4 and Q4 6jD

hbitt.

Exercise 4.2.1 Show the following using the inductive definition of the satis-faction relation jD where the processes are depicted in Figure 4.1.

(1) S2 jD [a](hbitt ^ hcitt)(2) S1 6jD [a](hbitt ^ hcitt)(3) S2 jD [b][c](haitt _ hcitt)(4) S1 jD [b][c](haitt _ hcitt). �

A natural notion of equivalence between states of an LTS is induced by themodal logic (with or without atomic propositions).

Definition 4.2.2 P and P 0 have the same modal properties, written P �M P 0,if fφ 2 M j P jD φg D fφ 2 M j P 0 jD φg. �

Bisimilar states have the same modal properties.

Theorem 4.2.3 If P � P 0 then P �M P 0.

Proof By structural induction on φ 2 M we show for any P , P 0 if P � P 0

then P jD φ iff P 0 jD φ. The base case is when φ is tt which is clear (as is thecase p 2 Prop when considering an enriched LTS). For the inductive step,there are three cases when φ D :φ1, φ D φ1 _ φ2 and φ D haiφ1, assumingthe property holds for φ1 and for φ2. We just consider the last of these threeand leave the other two as an exercise for the reader. Assume P jD haiφ1. So,

Pa�! P1 and P1 jD φ1 for some P1. However, P � P 0 and so P 0

a�! P 01 for

some P 01 such that P1 � P 01. By the induction hypothesis, if Q � Q0 then Q jD

φ1 iff Q0 jD φ1. Therefore, P 01 jD φ1 because P1 jD φ1 and so P 0 jD haiφ1, asrequired. A symmetric argument applies if P 0 jD haiφ. �

The converse is true in the circumstance that the LTS is image-finite: that

is, when the set fP 0 j Pa�! P 0g is finite for each P 2 Pr and a 2 Act, see

[San12].

Page 193: advanced topics in biosimulation and coinduction

Bisimulation and logic 177

Theorem 4.2.4 If the LTS is image-finite and P �M P 0 then P � P 0.

Proof By showing that the binary relation�M is a bisimulation. Assume P �M

P 0. If the LTS is enriched then, clearly, P jD p iff P 0 jD p for any p 2 Prop.

Assume Pa�! P1. We need to show that P 0

a�! P 0i such that P1 �M P 0i . Since

P jD haitt also P 0 jD haitt and, so, the set fP 0i j P 0a�! P 0i g is non-empty.

As the LTS is image-finite, this set is finite, say fP 01, . . . , P0ng. If P1 6�M P 0i

for each i : 1 � i � n then there are formulas φ1, . . . , φn of M where P1 6jD φi

and P 0i jD φi and so P1 6jD φ0 and P 0i jD φ0 for each i when φ0 D φ1 _ . . . _ φn.But this contradicts P �M P 0 as P 6jD [a]φ0 and P 0 jD [a]φ0. So, for some P 0i ,

1 � i � n, P1 �M P 0i . The proof for the case P 0a�! P 01 is symmetric. �

Theorems 4.2.3 and 4.2.4 together are known as the Hennessy–Milner theorem,the modal characterisation of bisimilarity. Modal formulas can, therefore, bewitnesses for inequivalent (image-finite) processes; an example is that hai[b]ffdistinguishes Q1 and P1 of Figure 4.1.

Exercise 4.2.5 Sets of formulas of M can be stratified according to their modaldepth. The modal depth of φ 2 M , md(φ), is defined inductively: md(tt)D 0; md(:φ) D md(φ); md(φ1 _ φ2) D maxfmd(φ1), md(φ2)g; md(haiφ) Dmd(φ)C 1. Let�n

M mean having the same modal properties with modal depthat most n and recall the stratified bisimilar relations �n defined in [San12].What Hennessy and Milner showed is P �n P 0 iff P �n

M P 0.

(1) Prove by induction on n, P �n P 0 iff P �nM P 0.

(2) Therefore, show that the restriction to image-finite LTSs in Theorem 4.2.4is essential.

(3) Assume an LTS where Act is finite and which need not be image-finite.Show that for each P 2 Pr and for each n 0, there is a formula φ ofmodal depth n such that P 0 jD φ iff P 0 �n P . (Hint: if Act is finite thenfor each n 0 there are only finitely many inequivalent formulas of modeldepth n.) �

Exercise 4.2.6 Let M1 be modal logic M with arbitrary countable disjunction(and, therefore, conjunction because of negation). If � is a countable set offormulas then

∨� is a formula whose semantics is: P jD

∨� iff P jD φ for

some φ 2 �. Prove that if Pr is a countable set then P � Q iff P �M1 Q. �

Next, we identify when a process has the Hennessy–Milner property[BRV01].

Definition 4.2.7 P 2 Pr has the Hennessy–Milner property iff if P 0 �M P

then P 0 � P . �

Page 194: advanced topics in biosimulation and coinduction

178 Colin Stirling

Exercise 4.2.8 Pr is modally saturated if for each a 2 Act, P 2 Pr and � � M

if for each finite set �0 � � there is a Q 2 fQ j Pa�! Qg and Q jD φ for all

φ 2 �0 then there is a Q 2 fQ j Pa�! Qg such that Q jD φ for all φ 2 �.

Show that if Pr is modally saturated then each P 2 Pr has the Hennessy–Milner property. (See, for instance, [BRV01] for the notion of modal saturationand how to build LTSs with this feature using ultrafilter extensions.) �

A formula φ is characteristic for process P (with respect to bisimilarity)provided that P jD φ and if P 0 jD φ then P 0 � P . An LTS is acyclic if its

transition graph does not contain cycles; that is, if P 2 Pr and Pa�! P 0 and

P 0a1�! P1

a2�! . . .

an

�! Pn for n 0 then P 6D Pn.

Proposition 4.2.9 Assume an acyclic LTS (Pr, Act,�!) where Pr, Act andProp are finite. If P 2 Pr then there is a formula φ 2 M that is characteristicfor P .

Proof Assume an acyclic LTS with finite sets Pr, Act and Prop. For eachP 2 Pr we define a propositional formula PROP(P ) and for each a 2 Act amodal formula MOD(a, P ). Then FORM(P )D PROP(P ) ^

∧fMOD(a, P ) j

a 2 Actg is the characteristic formula for P .

PROP(P ) D∧fp 2 Prop j P jD pg ^

∧f:p 2 Prop j P 6jD pg

MOD(a, P ) D∧fhaiFORM(P 0) j P

a�!P 0g ^ [a]

∨fFORM(P 0) j P

a�!P 0g

where as usual∧; D tt and

∨; D ff. We need to show that FORM(P ) is

indeed well-defined and a modal formula; and that it is characteristic for P .The first depends on the fact that the LTS is acyclic and that the sets Pr, Actand Prop are finite; why? The proof that FORM(P ) is characteristic for P isalso left as an exercise for the reader. �

Example 4.2.10 The LTS in Figure 4.2 is acyclic with Pr D fP1, . . . , P4g,Act D fa, bg and Prop D ;. Now,

FORM(P2) D FORM(P4) D [a]ff ^ [b]ff

FORM(P3) D haiFORM(P4) ^ [a]FORM(P4) ^ [b[ff

FORM(P1) D haiFORM(P2) ^ haiFORM(P3)^

[a](FORM(P2) _ FORM(P3)) ^ [b]ff .

Here, we construct the formulas starting from the nodes P2 and P4 that have nooutgoing transitions; then we construct the formula for P3; and then finally forP1. �

Page 195: advanced topics in biosimulation and coinduction

Bisimulation and logic 179

P2

P1

a

??.......

a++�

����

��

P3b

P4

Fig. 4.2. The transition graph for Example 4.2.10.

Exercise 4.2.11 Give an example of a finite-state P such that no formula ofM is characteristic for P . �

Exercise 4.2.12 Recall that trace equivalence equates two states P and Q ifthey can perform the same finite sequences of transitions, see [San12].

(1) Show that Proposition 4.2.9 also holds for trace equivalence. That is,assume an acyclic LTS where Pr and Act are finite and Prop is empty.Prove that if P 2 Pr then there is formula φ 2 M that is characteristic forP with respect to trace equivalence.

(2) Construct the characteristic formula for P1 and Q1 of Figure 4.1. �

4.3 Bisimulation invariance

An alternative semantics of modal logic emphasises properties. Relative to aLTS and valuation V , let kφk D fP j P jD φg: we can think of kφk as theproperty expressed by φ on the LTS. In the case of the LTS in Figure 4.2,khaitt _ hbittk D fP1, P3g.

Exercise 4.3.1 Define kφk on a LTS directly by induction on φ (withoutappealing to the satisfaction relation jD). �

Another way of understanding Theorem 4.2.3 is that properties of states ofan LTS expressed by modal formulas are bisimulation invariant: if P 2 kφk

and P � P 0 then P 0 2 kφk. There are many kinds of properties that are notbisimulation invariant. Examples include counting of successor transitions,‘has three a-transitions’, or invocations of finiteness such as ‘is finite-state’ orbehavioural cyclicity, ‘has a sequence of transitions that is eventually cyclic’:each of these properties distinguishes P1 and Q1 in Figure 4.3 even though

Page 196: advanced topics in biosimulation and coinduction

180 Colin Stirling

P2a

@@

Q1a

a

Q2a Q3

a

a

Q4a

P1

a

AA��������

a���

����

���

a P3 Q01 Q03

P4

Fig. 4.3. More transition graphs

P1 � Q1. The definition of invariance is neither restricted to monadic propertiesnor to a particular logic within which properties of LTSs are expressed.

Definition 4.3.2 Assume Prn is (Pr � . . . � Pr) n-times, n 1.

(1) An n-ary property, n 1, of a LTS is a set � � Prn.(2) Property � � Prn is bisimulation invariant if whenever (P1, . . . , Pn) 2 �

and Pi � P 0i for each i : 1 � i � n, then also (P 01, . . . , P0n) 2 �. �

Exercise 4.3.3

(1) Prove that the property f(P,Q) j P,Q are trace equivalentg is bisimula-tion invariant. More generally, show that if� is a behavioural equivalencebetween processes such that P � Q implies P � Q, then� is bisimulationinvariant.

(2) A property � � Prn is safe for bisimulation if whenever (P1, . . . , Pn) 2 �

and P1 � P 01 then (P 01, . . . , P0n) 2 � for some P 02, . . . , P

0n (a notion due

to van Benthem [vB98]). Show that the general transition relationsw�!,

w 2 Act* (defined in [San12]) are safe for bisimulation.(3) Show that if � is bisimulation invariant then it is safe for bisimulation.

Another logic within which to express properties of a LTS is first-order logic,FOL. It has a countable family of variables Var typically represented as x, y, z

and a binary relation Ea for each a 2 Act (and a monadic predicate p for eachp 2 Prop when the LTS is enriched). Formulas of FOL have the following form:

φ ::D p(x) j xEay j x D y j :φ j φ1 _ φ2 j 9x. φ .

To interpret formulas with free variables we need a valuation σ : Var! Prthat associates a state with each variable. Also, we use a standard ‘updating’notation: σ fP1/x1, . . . , Pn/xng is the valuation that is the same as σ except

Page 197: advanced topics in biosimulation and coinduction

Bisimulation and logic 181

that its value for xi is Pi , 1 � i � n (where each xi is distinct). We inductivelydefine when the FOL formula φ is true on an LTS L with respect to a valuationσ as σ jDL φ, where again we drop the index L:

σ jD p(x) iff σ (x) 2 V (p)

σ jD xEay iff σ (x)a�! σ (y)

σ jD x D y iff σ (x) D σ (y)σ jD :φ iff σ 6jD φ

σ jD φ1 _ φ2 iff σ jD φ1 or σ jD φ2

σ jD 9x. φ iff σ fP/xg jD φ for some P 2 Pr.

The universal quantifier, the dual of 9x, is introduced as 8x. φ D :9x.:φ. Itsderived semantic clause is: σ jD 8x. φ iff σ fP/xg jD φ for all P 2 Pr.

Example 4.3.4 Assume σ (x1) D P1 and σ (x2) D Q1 of Figure 4.3. Then thefollowing pair hold:

(1) σ jD 9x. 9y. 9z. (x1Eax ^ x1Eay ^ x1Eaz ^ x 6D y ^ x 6D z ^ y 6D z)(2) σ jD 8y.8z. (x2Eay ^ yEaz! z 6D x2). �

There is a recognised translation of modal formulas into first-order formulas,for instance, see [BRV01].

Definition 4.3.5 The FOL translation of modal formula φ relative to variablex is Tx(φ) which is defined inductively:

Tx(p) D p(x)Tx(tt) D x D x

Tx(:φ) D : Tx(φ)Tx(φ1 _ φ2) D Tx(φ1) _ Tx(φ2)Tx(haiφ) D 9y. xEay ^ Ty(φ).

Exercise 4.3.6

(1) For each of the following formulas φ, present its FOL translation Tx(φ).(a) [a]hbitt(b) haip! [a]haip(c) [a]([a]p! p)! [a]p.

(2) FOL2 is first-order logic when Var is restricted to two variables fx, ygwhichcan be reused in formulas. Show that modal formulas can be translated intoFOL2. �

Page 198: advanced topics in biosimulation and coinduction

182 Colin Stirling

The translation of modal formulas into FOL, Definition 4.3.5, is clearlycorrect as it imitates the semantics.

Proposition 4.3.7 P jD φ iff σ fP/xg jD Tx(φ).

Proof By structural induction on φ 2 M . For the base cases, first P jD p iff P 2

V (p) iff σ fP/xg jD p(x) iff σ fP/xg jD Tx(p). Similarly, for the other basecase, P jD tt iff σ fP/xg jD x D x iff σ fP/xg jD Tx(tt). For the inductivestep we only examine the interesting case when φ D haiφ1. P jD φ iff P 0 jD φ1

for some P 0 where Pa�! P 0 iff σ fP 0/zg jD Tz(φ1) for some P 0 where P

a�! P 0,

by the induction hypothesis, iff σ fP/xg jD 9z. xEaz ^ Tz(φ1) iff σ fP/xg jD

Tx(φ). �

A FOL formula with free variables is bisimulation invariant if the propertyit expresses is bisimulation invariant.

Definition 4.3.8 Formula φ 2 FOL whose free variables belong to fx1, . . . , xng

is bisimulation invariant if f(P1, . . . , Pn) j σ fP1/x1, . . . , Pn/xng jD φg isbisimulation invariant. �

Corollary 4.3.9 Any first-order formula Tx(φ) is bisimulation invariant. �

Not all first-order formulas are bisimulation invariant. The two formulas inExample 4.3.4 are cases; the first says that ‘x1 has at least three different a-transitions’. Van Benthem introduced the notion of bisimulation (as a p-relationand a zig-zag relation) to identify which formulas φ(x) 2 FOL with one freevariable are equivalent to modal formulas [vB96].

Definition 4.3.10 A FOL formula φ(x) is equivalent to modal φ0 2 M providedthat for any LTS and for any state P , σ fP/xg jD φ iff P jD φ0. �

Van Benthem proved Proposition 4.3.12: a FOL formula φ(x) is equivalent toa modal formula iff it is bisimulation invariant. The proof utilises some modeltheory. Some notation first: if � is a set of first-order formulas then � jD ψ

provided that for any LTS and valuation σ , if for all φ 2 �, σ jD φ then σ jD ψ .The compactness theorem for first-order logic states that if � jD ψ then thereis a finite set �0 � � such that �0 jD ψ . Next we state a further property offirst-order logic that will also be used.

Fact 4.3.11 If � is a set of first-order formulas all of whose free variablesbelong to fx1, . . . , xng and σ fP1/x1, . . . , Pn/xng jD φ for all φ 2 �, then thereis a LTS and processes P 01, . . . , P

0n 2 Pr such that σ fP 01/x1, . . . , P

0n/xng jD φ

for all φ 2 � and each P 0i has the Hennessy–Milner property (Definition 4.2.7).�

Page 199: advanced topics in biosimulation and coinduction

Bisimulation and logic 183

Proposition 4.3.12 A FOL formula φ(x) is equivalent to a modal formula iffφ(x) is bisimulation invariant.

Proof If φ(x) is equivalent to a modal formula φ0 then fP j σ fP/xg jD φg

D kφ0k which is bisimulation invariant. For the converse property, assumethat φ(x) is bisimulation invariant. Consider the following family � D

fTx(ψ) j ψ 2 M and fφ(x)g jD Tx(ψ)g. We prove � jD φ(x) and, therefore,by the compactness theorem, φ(x) is equivalent to a modal formula ψ 0 suchthat Tx(ψ 0) 2 �. Assume σ fP/xg jD ψ for all ψ 2 �. We need to showthat σ fP/xg jD φ. We choose a P with the Hennessy–Milner property byFact 4.3.11. Let � D fTx(ψ) j P jD ψg. First, � � �. Next we show that� [ fφg is satisfiable. For suppose otherwise, � jD :φ and so by the com-pactness theorem there is a finite subset � 0 D fTx(ψ1), . . . , Tx(ψk)g � �

such that � 0 jD :φ. But then φ jD Tx(ψ 0) where ψ 0 is the modal formula:ψ1 _ . . . _ :ψk and so Tx(ψ 0) 2 � which contradicts that � � �. There-fore, for some Q, σ fQ/xg jD ψ for all ψ 2 � and σ fQ/xg jD φ. However,Q � P and because φ is bisimulation invariant, σ fP/xg jD φ as required. �

Exercise 4.3.13 Prove that a FOL formula φ(x1, . . . , xn) is bisimulationinvariant iff it is equivalent to a boolean combination of formulas of thefollowing form Tx1 (ψ11), . . . , Tx1 (ψ1k1 ), . . . , Txn

(ψn1), . . . , Txn(ψnkn

) for somek1, . . . , kn 0. �

An alternative proof of Proposition 4.3.12 appeals to tree (or forest) models.A LTS is a forest if it is acyclic and the ‘target’ of each transition is unique;

if Pa�! Q and R

b�! Q then P D R and a D b. The transition graph that is

rooted at Q1 in Figure 4.3 is a tree (a forest with a single tree).Given a LTS there is a way of unfolding P 2 Pr and all its reachable

processes into a tree rooted at P which is called unravelling.

Definition 4.3.14 Assume a LTS L D (Pr, Act,�!) with P0 2 Pr. The k-unravelling of P0, for k 0, is the following LTS, Lk D (Prk, Act,�!k) where

(1) Prk D fP0a1k1P1 . . . anknPn j n 0, 0 � ki � k, P0a1�! P1 . . .

an

�! Png;

(2) if Pa�! P 0 and P is the final state in π 2 Prk then π

a�!k πak0P 0 for each

0 � k0 � k;(3) if V is the valuation for L then Vk is the valuation for Lk where Vk(p) Dfπ 2 Prk j P is final in π and P 2 V (p)g.

The ω-unravelling of P0, the LTS Lω, permits all indices k 0: so, Prω includes

all sequences P0a1k1P1 . . . anknPn such that P0a1�! P1 . . .

an

�! Pn and eachki 0. �

Page 200: advanced topics in biosimulation and coinduction

184 Colin Stirling

π 01 π 03

π1a

a

a

��

π2a π3

a

a

a

��

π4a

π 001 π 003

Fig. 4.4. Unravelled LTS.

Example 4.3.15 The 0-unravelling of P1 of Figure 4.3 is presented inFigure 4.4 where π1 D P1, π2(iC1) D π2iC1a0P2, π2iC1 D π2ia0P1 π 02iC1 D

π2iC1a0P3 and π 002iC1 D π2iC1a0P4. The reader is invited to describe the 2-unravelling and the ω-unravelling of P1. �

Proposition 4.3.16 For any LTS and k : 0 � k � ω, if P 2 Pr and π 2 Prk

and the final state in π is P , then P � π .

Proof Clearly, the binary relation R � Pr � Prk containing all pairs (P, π )when the final state of π is P is a bisimulation because first, P 2 V (p) iff

π 2 Vk(p) and second, Pa�! P 0 iff π

a�!k πak0P 0 for k0 � k. �

Exercise 4.3.17 Let R1 and S1 be the processes depicted in Figure 4.1.

(1) Define the 0-unravellings of R1 and S1.(2) Define the ω-unravelling of R1 and S1 and show that they are isomorphic.(3) Assume L is a LTS containing P and Q and P � Q. Show that the ω-

unravellings of P and Q are isomorphic.(4) Reprove Proposition 4.3.12 using ω-unravelled LTSs. �

4.4 Modal mu-calculus

Modal logic M of Section 4.2 is not very expressive. For instance, temporalproperties of states of a LTS, such as liveness, ‘this desirable property willeventually hold’, and safety, ‘this defective property never holds’, are notexpressible in M. (Prove this; hint, use Exercise 4.2.5.) Such properties havebeen found to be very useful when analysing the behaviour of concurrentsystems. Modal mu-calculus, μM , modal logic with fixpoints, introduced byKozen [Ko83], has the required extra expressive power.

Page 201: advanced topics in biosimulation and coinduction

Bisimulation and logic 185

The setting for μM is the complete lattice generated by the powerset con-struction ℘(Pr) where the ordering is �, join is union and meet is intersection,; is the bottom element and Pr is the top element, see [San12].

Exercise 4.4.1 Consider a LTS and recall the definitions of monotone andcontinuous function f on the powerset ℘(Pr): f is monotone provided that ifS � S0 then f (S) � f (S0); f is continuous just in case if S1, . . . , Sn, . . . is anincreasing sequence of subsets of Pr (that is, if i � j then Si � Sj � Pr), thenf (⋃

i Si) D⋃

i f (Si); see [San12].

(1) Define the semantic functions khaik and k[a]k on ℘(Pr) such that for anyφ 2 M , khaikkφk D khaiφk and k[a]kkφk D k[a]φk.

(2) Show that these functions khaik and k[a]k are monotone.(3) Prove that khaik is continuous iff the LTS is image-finite with respect to

the label a; that is, if for each P 2 Pr, the set fP 0 j Pa�! P 0g is finite.

The new constructs of μM over and above those of M are

φ ::D X j . . . j μX. φ

where X ranges over a family of propositional variables. The semantics for aformula φ of μM is the set kφkV � Pr where V is a valuation that not onlymaps elements of Prop but also propositional variables to ℘(Pr). As usualwe employ updating notation: kφkV fS/Xg uses valuation V 0 like V except thatV 0(X) D S.

Exercise 4.4.2 Assume that φ is a formula of M when extended with propo-sitional variables. Prove that if all free occurrences of X in φ are within thescope of an even number of negations and V is a valuation then the func-tion f : ℘(Pr)! ℘(Pr) such that f (S) D kφkV fS/Xg is monotone. Therefore,show the following (see [San12])

(1) the least fixed point lfp(f ) exists and is the intersection of all pre-fixedpoints,

⋂fS j f (S) � Sg;

(2) the greatest fixed point gfp(f ) exists and is the union of post-fixed points,⋃fS j S � f (S)g. �

In the case of μX. φ there is, therefore, the restriction that all free occurrencesof X in φ are within the scope of an even number of negations (to guaranteemonotonicity). This formula expresses the least fixed point lfp of the semanticfunction induced by φ. Its dual, νX. φ, expresses the greatest fixed point gfpand is a derived construct in μM: νX. φ D :μX.:φf:X/Xg. Here are the

Page 202: advanced topics in biosimulation and coinduction

186 Colin Stirling

semantics for μM formulas.

kpkV D V (p)

kZkV D V (Z)

k:φkV D Pr � kφkV

kφ1 _ φ2kV D kφ1kV [ kφ2kV

khaiφkV D fP 2 Pr j for some Q. Pa�! Q and Q 2 kφkV g

kμZ. φkV D⋂fS � Pr j kφkV fS/Zg � Sg.

Exercise 4.4.3 Extend the first part of Exercise 4.4.2 by proving that if allfree occurrences of X in φ 2 μM are within the scope of an even numberof negations and V is a valuation then the function f on ℘(Pr) such thatf (S) D kφkV fS/Xg for S � Pr is monotone. �

Derived semantic clauses for other connectives are below:

kφ1 ^ φ2kV D kφ1kV \ kφ2kV

k[a]φkV D fP 2 Pr j for all Q. if Pa�! Q then Q 2 kφkV g

kνZ. φkV D⋃fS � Pr j S � kφkV fS/Zgg.

P satisfies the μM formula φ relative to valuation V , P jDV φ, iff P 2

kφkV ; as usual we omit V wherever possible.The standard theory of fixpoints tells us, see [San12], that if f is a monotone

function on a lattice, we can construct lfp(f ) by applying f repeatedly on theleast element of the lattice to form an increasing chain, whose limit is the leastfixed point. Similarly, gfp(f ) is constructed by applying f repeatedly on thelargest element to form a decreasing chain, whose limit is the greatest fixedpoint. The stages of these iterations μαX. φ and ναX. φ can be defined as M1

formulas, see Exercise 4.2.6, inductively as follows

μ0X. φ D ff ν0X. φ D ttμβC1X. φ D φfμβX. φ/Xg νβC1X. φ D φfνβX. φ/Xg

μλX. φ D∨

β<λ μβX. φ νλX. φ D∧

β<λ νβX. φ .

So for a minimal fixpoint formula μX. φ, if P satisfies the fixpoint, it satisfiessome iterate, say the (β C 1 )th so that P jD μβC1X. φ. Now if we unfold thisformula once, we get P jD φfμβX. φ/Xg. Therefore, the fact that P satisfiesthe fixpoint depends, via φ, on the fact that other states in Pr satisfy the fixpointat smaller iterates than P does. So if one follows a chain of dependencies,the chain terminates. Therefore, μ means ‘finite looping’, which, with a little

Page 203: advanced topics in biosimulation and coinduction

Bisimulation and logic 187

refinement, is sufficient to understand the logic μM . On the other hand, fora maximal fixpoint νX. φ, there is no such decreasing chain: P jD νX. φ iffP jD νβX. φ for every iterate β iff P jD φfνβX. φ/Xg for every iterate β iffP jD φfνX. φ/Xg, and so we may loop for ever.

Example 4.4.4 Assume P1 is the process in Figure 4.3, which can repeat-edly do an a transition. P1 fails to have the property μX. [a]X (whichexpresses that there cannot be an infinite sequence of a transitions). Con-sider its iterates, μ1X. [a]X D [a]ff, so P3 and P4 have this property;μ3X. [a]X is [a][a][a]ff and μωX. [a]X is

∨n�0[a]nff where [a]0ff D ff

and [a]iC1ff D [a][a]iff. Consequently, P1 jD νX. haiX. Iterates of this for-mula include νωX. haiX D

∧n�0hai

ntt where haii is hai i-times. �

Exercise 4.4.5 What properties are expressed by the following formulas?

(1) μX. p _ [a]X(2) μX. q _ (p ^ haiX)(3) νX.:p ^ [a]X(4) μX. νY . (p ^ [a]X) _ (:p ^ [a]Y ). �

Definition 4.2.2 of �M , ‘having the same modal properties’, is extendedto μM; so, P �μM P 0 means P and P 0 have the same μM properties, asexpressed by closed formulas of μM (that is, formulas without free variables).Bisimilar states have the same μM properties.

Theorem 4.4.6 If P � P 0 then P �μM P 0.

Proof The proof of this uses Exercise 4.2.6 that M1 characterises bisimilarityand the observation above that closed formulas of μM can be translated intoM1. �

Theorem 4.4.7 If the LTS is image-finite and P �μM P 0 then P � P 0.

Proof Because μM contains M this follows directly from Theorem 4.2.4. �

Is image-finiteness still necessary in Theorem 4.4.7? In Exercise 4.2.5 therelationship between stratified bisimilarity,�n, and formulas of M with modaldepth n is explored. It is possible P 6� Q but P �n Q for all n 0 and so,

P �M Q. For instance, let P be∑

i�0 Pi and Q D P C R where PjC1a�! Pj ,

P0 has no a transitions and Ra�! R. Unlike P , Q has an infinite sequence of a

transitions: so, P 6�μM Q (because P jD μX. [a]X). So, a more sophisticatedexample is needed for the presence of image-finiteness.

Page 204: advanced topics in biosimulation and coinduction

188 Colin Stirling

Example 4.4.8 The following example is from [BS07]. It uses a key propertyof μM , ‘the finite model property’: if P jD φ then there is a finite LTS anda P 0 within it with P 0 jD φ. Let φ1, φ2, . . . be an enumeration of all closedμM formulas over the finite label set fa, bg that are true at some state of someLTS. Let Pri , with initial state Pi , be a finite LTS such that Pi jD φi , with allPri disjoint. Let Pr0 be constructed by taking an initial state P0 and making

P0a�! Pi for all i > 0. Similarly, let Pr00 be constructed from initial state P 00

with transitions P 00a�! Pi for all i > 0 and P 00

a�! P 00. Clearly, P 00 6� P0 because

in Pr00 it is possible to defer indefinitely the choice of which Pri to enter. Onthe other hand, suppose that ψ is a closed μM formula, and w.l.o.g. assume thetopmost operator is a modality. If the modality is [b], ψ is true of both P0 andP 00; if it is hbi, ψ is false of both; if ψ is haiψ 0, then ψ is false at both P0 andP 00 iff ψ 0 is unsatisfiable, and true at both otherwise; if ψ is [a]ψ 0, then ψ istrue at both P0 and P 00 iff ψ 0 is valid, and false at both otherwise. Consequently,P0 �μM P 00. �

Definition 4.2.7 can be extended to μM formulas: P 2 Pr has the extendedHennessy–Milner property provided that if P �μM P 0 then P 0 � P . Little isknown about this property except that, if P has the Hennessy–Milner propertythen it also has the extended Hennessy–Milner property.

Exercise 4.4.9 In Exercise 4.2.8 a modally saturated LTS was defined. Thisnotion does not readily extend to μM formulas. A set of μM formulas isunsatisfiable if there is not a LTS and a process P belonging to it such thatP satisfies every formula in the set. Show that there is an unsatisfiable set� � μM such that every finite subset �0 � � is satisfiable. Show that this isequivalent to showing that μM fails the compactness theorem. �

Another indication that μM is more expressive than M is that it containscharacteristic formulas with respect to bisimilarity for finite-state processes.So, the restriction to acyclic LTSs in Proposition 4.2.9 can be relaxed.

Proposition 4.4.10 Assume (Pr, Act,�!) where Pr, Act and Prop are finite. IfP 2 Pr then there is a formula φ 2 μM that is characteristic for P .

Proof Let (Pr, Act,�!) be a LTS with finite sets Act, Prop and Pr. Assumewe want to define a characteristic formula for P 2 Pr. Let P1, . . . , Pn be thedistinct elements of Pr with P D P1 and let X1, . . . , Xn be distinct proposi-tional variables. We define a ‘modal equation’ Xi D φi(X1, . . . , Xn) for each

Page 205: advanced topics in biosimulation and coinduction

Bisimulation and logic 189

i which captures the behaviour of Pi .

Xi D PROP(Pi) ^∧fMOD0(a, P ) j a 2 Actg where

PROP(Pi) D∧fp 2 Prop j P jD pg ^

∧f:p 2 Prop j P 6jD pg

MOD0(a, Pi) D∧fhaiXj j Pi

a�! Pj g ^ [a]

∨fXj j Pi

a�! Pj g

where as usual∧; D tt and

∨; D ff. We now define the characteristic

formula for P1 as ψ1 where

ψn D νXn. φn(X1, . . . , Xn)...

...ψj D νXj . φj (X1, . . . , Xj , ψjC1, . . . , ψn)...

...ψ1 D νX1. φ1(X1, ψ2, . . . , ψn).

The proof that ψ1 is characteristic for P is left as an exercise for thereader. �

Example 4.4.11 Let R1, R2 and R3 be the processes in Figure 4.1 and assumeProp D ;. The modal equations are as follows.

X1 D φ1(X1, X2, X3) D (haiX2 ^ haiX3) ^ [a](X2 _X3) ^ [b]ff ^ [c]ffX2 D φ2(X1, X2, X3) D [a]ff ^ hbiX3 ^ [b]X3 ^ [c]ffX3 D φ3(X1, X2, X3) D [a]ff ^ [b]ff ^ hciX1 ^ hciX2 ^ [c](X1 _X2).

So, ψ3 is νX3. φ3(X1, X2, X3), and ψ2 is νX2. φ2(X1, X2, ψ3) and ψ1 is thefollowing formula

νX1. (haiψ2 ^ haiψ3) ^ [a](ψ2 _ ψ3) ^ [b]ff ^ [c]ff .

The reader can check that S1 jD ψ1 where S1 is also in Figure 4.1. �

Exercise 4.4.12 Provide a characteristic formula for P1 of Figure 4.3 andshow that Q1 in the same figure satisfies it. �

The proof of Proposition 4.4.10 shows that a characteristic formula for afinite state process only uses greatest fixpoints. Furthermore, there is a moresuccinct representation if simultaneous fixpoints are allowed.2 One applicationof characteristic formulas is the reduction of equivalence checking (whethertwo given processes are equivalent) to model checking (whether a given processhas a given property). This is especially useful in the case when only one of

2 Instead of defining ψi iteratively in the proof of Proposition 4.4.10, they are defined at the sametime in a vectorial form.

Page 206: advanced topics in biosimulation and coinduction

190 Colin Stirling

the two given processes is finite state, see [KJ06] for a survey of known resultswhich also covers weak bisimilarity and preorder checking.

A simple corollary of Theorem 4.4.6 is that μM has the tree model property.If a μM formula has a model, it has a model that is a tree. Just 0-unravel, seeDefinition 4.3.14, the original model, thereby preserving bisimulation. This canbe strengthened to the bounded branching degree tree model property (just cutoff all the branches that are not actually required by some diamond subformula;this leaves at most (number of diamond subformulas) branches at each node).

Clearly we cannot translate μM into FOL because of the fixpoints. (SeeExercise 4.4.9.) However, it can be translated into monadic second-orderlogic.

4.5 Monadic second-order logic and bisimulation invariance

MSO, monadic second-order logic of LTSs, extends FOL in Section 4.3 byallowing quantification over subsets of Pr. The new constructs over and abovethose of FOL are

φ ::D X(x) j . . . j 9X. φ

where X ranges over a family of monadic predicate variables, and 9X. φ quan-tifies over such predicates. To interpret formulas with free predicate and indi-vidual variables we extend a valuation σ to include a mapping from predicatevariables to sets of states. We inductively define when MSO formula φ is trueon an LTS L with respect to a valuation σ as σ jDL φ, where again we dropthe index L. The new clauses are as follows.

σ jD X(x) iff σ (x) 2 σ (X)σ jD 9X. φ iff σ fS/Xg jD φ for some S � Pr.

The universal monadic quantifier, the dual of 9X, is 8X. φ D :9X.:φ. Itsderived semantic clause is: σ jD 8X. φ iff σ fS/Xg jD φ for all S � Pr.

Example 4.5.1 Given a LTS with Act D fag the property that it is threecolourable is expressible in MSO as follows

9X. 9Y . 9Z.8x. φ(x,X, Y,Z) ^ 8y.8z. ψ(y, z,X, Y,Z)

where φ(x,X, Y,Z) expresses x has a unique colour X, Y or Z

(X(x) ^ :Y (x) ^ :Z(x)) _ (:X(x) ^ Y (x) ^ :Z(x))

_ (:X(x) ^ :Y (x) ^ Z(x))

Page 207: advanced topics in biosimulation and coinduction

Bisimulation and logic 191

and ψ(y, z,X, Y,Z) confirms that if there is an a transition from y to z thenthey are not coloured the same

yEaz! :(X(y) ^X(z)) ^ :(Y (y) ^ Y (z)) ^ :(Z(y) ^ Z(z)).

There is a translation of μM formulas into MSO that extends Defini-tion 4.3.5.

Definition 4.5.2 The MSO translation of μM formulas φ relative to variablex is TCx (φ) which is defined inductively.

T Cx (p) D p(x)T Cx (X) D X(x)TCx (tt) D x D x

T Cx (:φ) D : T Cx (φ)T Cx (φ1 _ φ2) D TCx (φ1) _ TCx (φ2)T Cx (haiφ) D 9y. xEay ^ TCy (φ)T Cx (μX. φ) D 8X. (8y. (T Cy (φ)! X(y)))! X(x).

The translation of a least fixpoint formula uses quantification and implicationto capture that x belongs to every pre-fixed point.

Exercise 4.5.3 For each of the following formulas φ, present its MSO transla-tion TCx (φ).

(1) μX. p _ [a]X(2) μX. q _ (p ^ haiX)(3) νX.:p ^ [a]X(4) μX. νY . (p ^ [a]X) _ (:p ^ [a]Y ). �

The translation of μM formulas into MSO, Definition 4.5.2, is correct.

Proposition 4.5.4 If for each variable Z, V (Z) D σ (Z) then P jDV φ iffσ fP/xg jD T Cx (φ).

Proof By structural induction on φ 2 M . The proofs for the modal and booleancases follow Proposition 4.3.7. There are just the two new cases. P jDV

X iff P 2 V (X) iff P 2 σ (X) iff σ fP/xg(x) 2 σ fP/xg(X) iff σ fP/xg jD

TCx (X). P jDV μX. φ iff for all S, if kφkV fS/Xg � S then P 2 S iff forall S, if 8y, y jDV fS/Xg φ implies y 2 S then P 2 S iff for all S, if8y, σ fS/Xg jD TCy (φ) by the induction hypothesis where σ obeys that for

Page 208: advanced topics in biosimulation and coinduction

192 Colin Stirling

all Z, σ (Z) D V (Z) iff σ fP/xg jD 8X. (8y. (TCy (φ)! X(y)))! X(x) iffσ fP/xg jD TCx (μX. φ). �

A corollary of Theorem 4.4.6 is that if φ is a closed μM formula then theMSO formula ψ(x) D TCx (φ) with one free variable is bisimulation invariant.As with FOL there are formulas of MSO which are not bisimulation invariant.Therefore, it is natural to ask the question whether van Benthem’s theorem,Proposition 4.3.12, can be extended to MSO formulas. The following resultwas shown by Janin and Walukiewicz [JW96].

Proposition 4.5.5 A MSO formula φ(x) is equivalent to a closed μM formulaiff φ(x) is bisimulation invariant.

However, its proof utilises automata (and games) which we shall provide aflavour of.

The aim is now to think of a different characterisation of logics on LTSsusing automata or games which operate locally on the LTS (compare [San12]).A particular logical formula of MSO or μM can only mention finitely manydifferent elements of Prop and finitely many different elements of Act; therefore,we assume now that these sets are finite in any given LTS. They will constitutefinite alphabets for automata; let �1 D Act and �2 D ℘Prop, where ℘ is thepowerset construct.

Let us begin with the notion of an automaton familiar from introductorycomputer science courses.

Definition 4.5.6 An automaton A D (S,�, δ, s0, F ) consists of a finite set ofstates S, a finite alphabet �, a transition function δ, an initial state s0 2 S andan acceptance condition F .

Traditionally, A does not operate on LTSs but on words, recognising a language,a subset of �*. Assuming A is non-deterministic, its transition function δ :S �� ! ℘S. Given a word w D a1 . . . an 2 �*, a run of A on w is a sequenceof states s0 . . . sn that traverses w, so siC1 2 δ(si, aiC1) for each i : 0 � i < n.The run is accepting if the sequence s0 . . . sn obeys F : classically, F � S is thesubset of accepting states and s0 . . . sn is accepting if the last state sn 2 F . Theremay be many different runs of A on w, some accepting the others rejecting, orno runs at all. The language recognised by A is the set of words for which thereis at least one accepting run.

Example 4.5.7 Let A D (fs0, s1g, fag, δ, s0, fs0g) with δ(s0, a) D fs1g andδ(s1, a) D fs0g. The language accepted by A is the set fa2n j n 0g of evenlength words. �

Page 209: advanced topics in biosimulation and coinduction

Bisimulation and logic 193

A simple extension is recognition of infinite length words. A run of A onw D a1 . . . ai . . . is an infinite sequence of states π D s0 . . . si . . . that travelsover w, so siC1 2 δ(si, aiC1), for all i 0; it is accepting if it obeys the conditionF . Let inf (π ) � S contain exactly the states that occur infinitely often in π .Classically, F � Q and π is accepting if inf (π ) \ F 6D ; which is the Buchiacceptance condition.

Buchi automata are an alternative notation for characterising infinite pathsof a LTS. There are different choices according to the alphabet �. If � D �1

and π D P0a1�! P1

a2�! . . . is an infinite sequence of transitions, then π jD A

if the automaton accepts the word a1a2 . . .; alternatively, � D �2 and π jD A

if it accepts Prop(P0) Prop(P1) . . . where Prop(P ) is the subset of Prop that istrue at P .

Exercise 4.5.8 Let Prop D fpg, S D fs, tg, δ(s, fpg) D ftg, δ(s,;) D fsg,δ(t, fpg) D ftg and δ(t,;) D ftg, s0 D s and F D ftg. What property of aninfinite run of a LTS does this Buchi automaton express? �

When each formula of a logic is equivalent to an automaton, satisfiabilitychecking reduces to the non-emptiness problem for those automata: whether anautomaton accepts some word (path or whatever). This may have algorithmicbenefits in reducing an apparently complex satisfiability question into simplegraph-theoretic procedures: a Buchi automaton, for instance, is non-empty ifthere is a path s0 �!

*s 2 F and a cycle s �!

*s (equivalent to an eventually

cyclic model). Indeed the introduction of Buchi and Rabin automata was forshowing decidability of monadic second-order theories by reducing them toautomata, see the tutorial text [GTW02] for details.

The idea of recognising bounded branching trees extends the definition of A

to accept n-branching infinite trees. With a word automaton, a state s0 belongedto δ(s, a); now it is tuples (s01, . . . , s

0n) that belong to δ(s, a). A tree automa-

ton traverses the tree, descending from a node to all n-child nodes, so theautomaton splits itself into n copies, and proceeds independently. A run of theautomaton is then an n-branching infinite tree labelled with states of the automa-ton. A run is accepting if every path through this tree satisfies the acceptancecondition F . In the case of Rabin acceptance F D f(G1, R1), . . . , (Gk,Rk)gwhere each Gi,Ri � S and π obeys F if there is a j such that inf (π ) \Gj 6D ;

and inf (π ) \ Rj D ;. A variant definition is parity acceptance where F mapseach state s of the automaton to a priority F (s) 2 N. We say that a path satisfiesF if the least priority seen infinitely often is even. It is not hard to see that aparity condition is a special case of a Rabin condition; it is also true, thoughsomewhat trickier, that a Rabin automaton can be translated to an equivalent

Page 210: advanced topics in biosimulation and coinduction

194 Colin Stirling

parity automaton. Such automata can recognise bounded branching unravel-lings of LTSs.

Exercise 4.5.9 Tree automata characterise rooted n-branching infinite treeLTS models for μM formulas. Such a model L jD A if A accepts thebehaviour tree that replaces each state P 2 Pr with Prop(P ). Let Prop Dfpg, S D fs, tg, δ(s, fpg) D f(s, s)g, δ(s,;) D f(t, t)g, δ(t, fpg) D f(s, s)g andδ(t,;) D f(t, t)g and s0 D s. This automaton A has parity acceptance condi-tion F (s) D 1 and F (t) D 2. What μM formula is equivalent to A over infinitebinary-tree models? (Hint: what fixpoints are ‘coded’ by states s and t?) �

There is a slight mismatch between (the unravellings of) LTSs and boundedbranching trees because of the fixed branching degree and the explicit indexedsuccessors; for instance, see the unravelled LTS of Figure 4.4. What is wantedis an automaton that can directly recognise a LTS and which preserves thevirtue of a simple local definition of a transition function. We shall define avariant of alternating parity automata which is due to Walukiewicz (also see[KVW00]).

The range of a transition function of an automaton A will be a localformula. For a word automaton, if δ(s, a) D fs1, . . . , smg then it is theformula s1 _ . . . _ sm. For an n-branching tree automaton if δ(s, a) Df(s1

1 , . . . , s1n), . . . , (sm

1 , . . . , smn )g then it is ((1, s1

1 ) ^ . . . ^ (n, s1n)) _ . . . _

((1, sm1 ) ^ . . . ^ (n, sm

n )): here the element (i, s0) means create an i-th childwith label s0. A word or tree is accepted if there exists an accepting run forthat word or tree; hence, the disjuncts. However, for a tree, every path throughit must be accepting; hence the conjuncts. In alternating word automata, thetransition function is given as an arbitrary boolean expression over states: forinstance, δ(s, a) D s1 ^ (s2 _ s3). In alternating tree automata it is a booleanexpression over directions and states: for instance, ((1, s1) ^ (1, s2)) _ (2, s3).Now the definition of a run becomes a tree in which successor transitions obeythe boolean formula. In particular, even for an alternating automaton on words,a run is a tree, and not just a word. The acceptance criterion is as before, thatevery path of the run must be accepting. An alternating automaton is just atwo-player game too where one player 8 is responsible for ^ choices and theother player 9 for _ choices.

The transition function for an automaton A that recognises LTSs has theform δ : S ��2 ! �(�1, S) where �(X, Y ) is a set of formulas over X andY . One idea is that this formula could be a simple modal formula. For instance,if s is the current automaton state at P 2 Pr and δ(s, Prop(P )) D hais1 ^ [c]s2

and Pa�! P1, P

b�! P2, P

c�! Qi , for all i 0 then the automaton moves

Page 211: advanced topics in biosimulation and coinduction

Bisimulation and logic 195

to P1 with state s1 and to each Qi with state s2. As with tree automata, a run ofA on a LTS is a labelled tree of arbitrary degree. Such ‘modal’ automata whenthe acceptance condition for infinite branches is the parity condition have thesame expressive power as μM .

However, to prove Proposition 4.5.5 Janin and Walukiewiciz use FOL for-mulas. The idea for atomic predicates is to replace pairs (i, s) of a tree automatonwith elements of U D f(a, s) j a 2 �1 and s 2 Sg. Now, for each s 2 S andW � Prop, δ(s,W ) is a formula of the form

(*) 9x1 . . . 9xk . (u1(x1) ^ . . . ^ uk(xk)) ^ 8x. (u1(x) _ . . . _ uk(x))

where each ui 2 U . An example is φ D 9x1. 9x2. (a, s)(x1) ^ (b, s0)(x2) ^8x. (a, s)(x) _ (b, s0)(x). If t labels the state P of the LTS and W D Prop(P )

and δ(t,W ) D φ and Pa�! Pi , P

b�! Qj , i, j > 0, then the automaton at the

next step would spawn a copy at each Pi with state s and each Qj with state s0.Notice that such a formula is quite similar to the components

∧MOD0(a, P )

of a characteristic formula described in Proposition 4.4.10. Every μM formulais equivalent to such an automaton; the different kinds of fixpoint are cateredfor in the parity acceptance condition.

Let dis(x1, . . . , xn) be the FOL formula∧

1�i<j�n xi 6D xj . There is a verysimilar characterisation of MSO formulas over trees where now each δ(s,W )has the form

(**)9x1 . . . 9xk . (D ^ u1(x1) ^ . . . ^ uk(xk)) ^ 8x. D0 ! (u1(x) _ . . . _ uk(x))

where D D dis(x1, . . . , xk) and D0 D dis(x, x1, . . . , xk).Now the result follows: if φ(x) is an MSO formula that is bisimulation

invariant then it is true on any n-unravelled model and so (*) and (**) will beequivalent for n k.

Bibliography

[vB84] J. van Benthem. Correspondence theory. In Handbook of PhilosophicalLogic, Vol. II, D. Gabbay and F. Guenthner, editors, pages 167–248, Reidel,1984.

[vB96] J. van Benthem. Exploring Logical Dynamics. CSLI Publications, 1996.[vB98] J. van Benthem. Program constructions that are safe for bisimulation, Studia

Logica, 60:311–330, 1998.[BRV01] P. Blackburn, M. de Rijke and Y. Venema. Modal Logic, Cambridge Uni-

versity Press, 2001.

Page 212: advanced topics in biosimulation and coinduction

196 Colin Stirling

[BS07] J. Bradfield and C. Stirling, Modal mu-calculi. In Handbook of ModalLogic, P. Blackburn, J. van Benthem and F. Wolter, editior pages 721–756,Elsevier, 2007.

[Ch80] B. Chellas, Modal Logic: An Introduction. Cambridge University Press,1980.

[GTW02] E. Gradel, W. Thomas and T. Wilke (editors), Automata, Logics, and InfiniteGames, Lecture Notes in Computer Science, 2500, 2002.

[HM80] M. Hennessy and R. Milner, On observing nondeterminism and concur-rency, Lecture Notes in Computer Science, 85:295–309, 1980.

[HM85] M. Hennessy and R. Milner. Algebraic laws for nondeterminism and concur-rency. Journal of Association of Computer Machinery, 32:137–162, 1985.

[JW96] D. Janin and I. Walukiewicz, On the expressive completeness of the propo-sitional mu-calculus with respect to monadic second order logic. LectureNotes in Computer Science, 1119:263–277, 1996.

[Ko83] D. Kozen, Results on the propositional mu-calculus. Theoretical ComputerScience, 27:333–354, 1983.

[KJ06] A. Kucera and P. Jancar, Equivalence-checking on infinite-state sys-tems: techniques and results. Theory and Practice of Logic Programming,6(3):227–264, 2006.

[KVW00] O. Kupferman, M. Vardi and P. Wolper, An automata-theoretic approachto branching-time model checking. Journal of Association of ComputerMachinery, 42(2):312–360, 2000.

[Pa81] D. Park. Concurrency and automata on infinite sequences. Lecture Notes inComputer Science, 154:561–572 1981.

[San12] D. Sangiorgi. An Introduction to Bisimulation and Coinduction. CambridgeUniversity Press, 2012.

Page 213: advanced topics in biosimulation and coinduction

5

Howe’s method for higher-order languages

andrew pitts

5.1 Introduction

A fundamental requirement for any notion of equality between programs isthat it be a congruence, in other words an equivalence relation that is com-patible with the various syntactical constructs of the programming language.Being an equivalence relation, in particular being transitive, allows one to use afamiliar technique of equational reasoning, namely the deduction of an equal-ity P ' P 0 via a chain of intermediate equalities, P ' P1 ' ' Pn ' P 0.Being compatible enables the use of an even more characteristic techniqueof equational reasoning, substitution of equals for equals, whereby an equal-ity between compound phrases, C[P ] ' C[P 0], is deduced from an equal-ity between sub-phrases, P ' P 0. If one regards the meaning of a programto be its '-equivalence class, then compatibility says that this semantics iscompositional – the meaning of a compound phrase is a function of the mean-ings of its constituent sub-phrases.

This book is concerned with coinductively defined notions of program equal-ity based on the notion of bisimulation. For these, the property of being anequivalence relation is easy to establish, whereas the property of compatibilitycan sometimes be difficult to prove and indeed in some cases is false.1 This isparticularly the case for languages involving higher-order features, that is, onespermitting functions and processes to be data that can be manipulated by func-tions and processes. For example, the language might feature parameterisedprograms P (x) where the parameter x can be instantiated not with simple data(booleans, numbers, names, finite trees, . . . ), but with other programs Q. In

1 The classic example is the failure of weak bisimilarity to be preserved by summation inMilner’s CCS [Mil89, section 5.3].

197

Page 214: advanced topics in biosimulation and coinduction

198 Andrew Pitts

this case, although it is usually easy to see that a bisimilarity' satisfies

8Q. P (x) ' P 0(x) ) P (Q) ' P 0(Q),

for compatibility of' we have to establish the stronger property

8Q,Q0. P (x) ' P 0(x) ^ Q ' Q0 ) P (Q) ' P 0(Q0).

This is often hard to prove directly from the definition of '.In this chapter we present a method for establishing such congruence

properties of coinductively defined program equalities, due originally toHowe [How89]. It is one that has proved to be particularly effective in thepresence of higher-order functions. Howe’s method was originally developedpartly to give a direct proof that Abramsky’s notion of applicative bisimilarityis a congruence for his ‘lazy’ λ-calculus [Abr90]. The latter consists of theterms of the untyped λ-calculus equipped with a non-strict, or call-by-nameevaluation strategy.2 Abramsky’s original proof of congruence is via a deno-tational semantics of the language,3 whereas Howe’s method provides a moredirect route to this purely syntactic result, just making use of the language’soperational semantics. Such syntactical methods can often be very brittle:small changes to the language’s syntax or operational semantics may break themethod. This has proved not to be the case for Howe’s method; essentially thesame technique has been applied, first by Howe and then by others, to quitea variety of higher-order languages, both typed and untyped, featuring bothsequential functions and concurrent processes, and with a variety of differentoperational semantics. Although far from being a universal panacea for proofsof congruence, Howe’s method certainly deserves the space we give it in thisbook.

Chapter outline Howe’s definitive account of his method [How96] uses ageneral framework that can be specialised to a number of different functionallanguages and evaluation strategies. Here we prefer to explain the methodby giving some concrete examples of it in action. To see the wood from thetrees, the examples are as syntactically simple as possible. In fact we useapplicative similarity and bisimilarity for the untyped λ-calculus with a call-by-value evaluation strategy as the running example; these notions are explainedin Sections 5.2 and 5.3. Then in Section 5.4 we see how far we can get with

2 The terminology ‘lazy’ is now more commonly used as a synonym for a call-by-needevaluation strategy (as used by the Haskell functional programming language, for example)rather than for the call-by-name strategy.

3 It is a corollary of his ‘domain theory in logical form’ [Abr91]; see [Pit97a] for an alternativedenotational proof making use of logical relations.

Page 215: advanced topics in biosimulation and coinduction

Howe’s method for higher-order languages 199

a proof of the congruence property for applicative similarity directly fromits coinductive definition. This motivates the use of Howe’s ‘precongruencecandidate’ construction, which is explained in Section 5.5 and used to provethat applicative similarity for the call-by-value λ-calculus is a precongruenceand hence that applicative bisimilarity is a congruence.

Section 5.6 explains an important consequence of this congruence result,namely that applicative bisimilarity for this language coincides with a Morris-style [Mor69] contextual equivalence, in which terms of the language are identi-fied if they behave the same in all contexts (with respect to some fixed notion ofobservation). The coincidence of these two notions of program equality dependsupon the deterministic nature of evaluation in call-by-value λ-calculus. So inSection 5.7 we consider what happens if we add a non-deterministic feature;we use ‘erratic’ binary choice as our example. As Howe observed, in sucha non-deterministic setting his precongruence candidate construction can stillbe used to prove congruence results for bisimilarities, via a finesse involvingtransitive closure.

In Section 5.8 we illustrate a perhaps less well-known application of Howe’smethod, namely to proving ‘context lemmas’ [Mil77] for contextual equiva-lences. In general, such lemmas tell us that two terms behave the same in allcontexts, that is, are contextually equivalent iff they behave the same in somerestricted collection of contexts. Context lemmas are a useful way of establish-ing certain basic properties of contextual equivalence – for example, that termswith the same reduction behaviour are contextually equivalent. We considerthe restriction to contexts that are ‘Uses of Closed Instantiations’ and the asso-ciated ‘CIU-equivalence’ of Mason and Talcott [MT91]. Specifically, we useHowe’s method to show that for call-by-value λ-calculus with erratic choice,and for the observational scenario based on ‘may-terminate’, CIU-equivalenceis a congruence and (hence) coincides with contextual equivalence. This resultis representative of the way Howe’s method can be used to establish contextlemmas for contextual equivalences.

Section 5.9 briefly considers the call-by-name version of all these results.Section 5.10 summarises what is involved in Howe’s method and then inSection 5.11 we outline some other applications of it that occur in the literatureand assess its limitations.

Table 5.1 gives the notation we use for the various types of preorder andequivalence considered in this chapter.

Prerequisites The reader is assumed to have some familiarity with the basicnotions of λ-calculus and its use in programming language semantics; see[Pie02, chapter 5], for example. The first few paragraphs of the next sectionsummarise what we need of this material.

Page 216: advanced topics in biosimulation and coinduction

200 Andrew Pitts

Table 5.1. Preorders and equivalences used in this chapter.

call-by-value call-by-name

applicative

{similaritybisimilarity

�v �n'v 'n

contextual

{preorderequivalence

�v �nDv Dn

CIU

{preorderequivalence

�ciuv �ciu

nDciu

v Dciun

5.2 Call-by-value λ-calculus

We take the set � of λ-terms and the subset V � � of λ-values to be given bythe following grammar

e 2 � ::D v j e e

v 2 V ::D x j λx. e(5.1)

where x ranges over a fixed, countably infinite set Var of variables. An occur-rence of a variable x in a λ-term e is a free occurrence if it is not withinthe scope of any λx. The substitution of e for all free occurrences of x ine0 is denoted e0fe/xg; more generally a simultaneous substitution is writtene0fe1, . . . , en/x1, . . . , xng. As usual when making a substitution e0fe/xg, we donot want free occurrences in e of a variable x0 to become bound by occur-rences of λx0 in e0; in other words, substitution should be ‘capture-avoiding’.To achieve this we identify the syntax trees generated by the above grammarup to α-equivalence of λ-bound variables: thus the elements of � and V arereally α-equivalence classes of abstract syntax trees, but we refer to a class bynaming one of its representatives. For example if x, y, z are distinct variables,then λy. x and λz. x are equal λ-terms (being α-equivalent) and (λy. x)fy/xg isλz. y, not λy. y.

The finite set of variables occurring free in e 2 � is denoted fv(e). If x 2

℘fin(Var) is a finite set of variables, we write

�(x)defD fe 2 � j fv(e) � xg

V (x)defD fv 2 V j fv(v) � xg

(5.2)

for the subsets of λ-terms and λ-values whose free variables are all in x. Thus�(;) is the subset of closed λ-terms and V (;) is the set of closed λ-abstractions.

Page 217: advanced topics in biosimulation and coinduction

Howe’s method for higher-order languages 201

Call-by-value evaluation of closed λ-terms is the binary relation +v �

�(;) � V (;) inductively defined by the following two rules.

v +v v(Val)

e1 +v λx. e e2 +v v efv/xg +v v0

e1 e2 +v v0. (Cbv)

Exercise 5.2.1 Consider the closed λ-values

onedefD λx. λy. x y

twodefD λx. λy. x (x y)

succdefD λn. λx. λy. x (n x y).

(These are the first two ‘Church numerals’ and the successor function forChurch numerals; see [Pie02, sect. 5.2], for example.) For all u, v,w 2 V (;),show that succ one u v +v w if and only if two u v +v w. Is it the case thatsucc one +v two holds?

Exercise 5.2.2 Prove that evaluation is deterministic, that is, satisfies

e +v v1 ^ e +v v2 ) v1 D v2. (5.3)

Show that it is also partial, in the sense that for some closed λ-term e 2 �(;)there is no v for which e +v v holds. [Hint: consider e D (λx. x x)(λx. x x), forexample.]

Call-by-value evaluation is sometimes called strict evaluation, in contrastwith non-strict, or call-by-name evaluation. We will consider the latter in Sec-tion 5.9.

5.3 Applicative (bi)similarity for call-by-value λ-calculus

We wish to define an equivalence relation ' � �(;) ��(;) that equates twoclosed λ-terms e1, e2 2 �(;) if they have the same behaviour with respectto call-by-value evaluation. But what does ‘behaviour’ mean in this case? Itis too simplistic to require that e1 and e2 both evaluate to the same λ-value(or both diverge); for example we might hope that the λ-term succ one fromExercise 5.2.1 is behaviourally equivalent to the λ-value two even though itdoes not evaluate to it under call-by-value evaluation. To motivate the kind ofbehavioural equivalence we are going to consider, recall that a λ-abstractionλx. e is a notation for a function; and indeed via the operation of substitution it

Page 218: advanced topics in biosimulation and coinduction

202 Andrew Pitts

determines a function on closed λ-values, mapping v 2 V (;) to efv/xg 2 �(;).So if e1 ' e2 and ei +v λxi . e0i (for i D 1, 2), it seems reasonable to require thatλx1. e01 and λx2. e02 determine the same functions V (;)! �(;) modulo ', inthe sense that e01fv/x1g ' e02f

v/x2g should hold for all v 2 V (;). This property ofan equivalence relation' is not yet a definition of it, because of the circularityit involves. We can break that circularity by taking the greatest4 relation withthis property, in other words by making a coinductive definition.

Definition 5.3.1 (Applicative simulation) A relation S � �(;) ��(;) is a(call-by-value) applicative simulation if for all e1, e2 2 �(;), e1 S e2 implies

e1 +v λx. e01 ) 9e02. e2 +v λx. e02 ^ 8v 2 V (;). e01fv/xg S e02f

v/xg.(v-Sim)

It is an applicative bisimulation if both S and its reciprocal Sop D f(e, e0) je0 S eg are applicative simulations. Note that the union of a family of applicative(bi)simulations is another such. So there is a largest applicative simulation,which we call applicative similarity and write as �v; and there is a largestapplicative bisimulation, which we call applicative bisimilarity and write as'v.

Example 5.3.2 It follows from Exercise 5.2.1 that

f(succ one, two)g [ f(e, e) j e 2 �(;)g

is an applicative bisimulation. Hence succ one and two are applicatively bisim-ilar, succ one 'v two.

Definition 5.3.1 (and Theorem 5.6.5 below) extends smoothly to manyapplied λ-calculi. For example, it provides a useful tool for proving equiv-alences between pure functional programs involving algebraic data types; see[Gor95] and [Pit97b, section 3].

Applicative similarity is by definition the greatest post-fixed point for themonotone endofunction F : ℘(�(;) ��(;))! ℘(�(;) ��(;)) that maps Sto

F (S)defD f(e1, e2) j 8x, e01. e1 +v λx. e01 ) 9e02. e2 +v λx. e02 ^

8v. e01fv/xg S e02f

v/xgg.

4 Taking the least such relation does not lead anywhere interesting, since that least relation isempty.

Page 219: advanced topics in biosimulation and coinduction

Howe’s method for higher-order languages 203

By the Knaster–Tarski fixed-point theorem [San12, theorem 2.3.21], it is alsothe greatest fixed point gfp(F ) and hence we have:

e1 �v e2

, 8x, e01. e1 +v λx. e01 ) 9e02. e2 +v λx. e02 ^ 8v. e01fv/xg �v e02f

v/xg.(5.4)

Similarly, applicative bisimulation satisfies:

e1 'v e2

, 8x, e01. e1 +v λx. e01 ) 9e02. e2 +v λx. e02 ^ 8v. e01f

v/xg 'v e02fv/xg

^8x, e02. e2 +v λx. e02 ) 9e01. e1 +v λx. e01 ^ 8v. e01f

v/xg 'v e02fv/xg.(5.5)

Exercise 5.3.3 Show that the identity relation f(e, e) j e 2 �(;)g is anapplicative bisimulation. Show that if S1 and S2 are applicative (bi)simulations,then so is their composition S1 ı S2 D f(e1, e3) j 9e2. e1 S1 e2 ^ e2 S2 e3g.Deduce that �v is a preorder (reflexive and transitive relation) and that 'v isan equivalence relation (reflexive, symmetric and transitive relation).

Because evaluation is deterministic (Exercise 5.2.2), applicative bisimula-tion is the equivalence relation generated by the preorder �v:

Proposition 5.3.4 For all e1, e2 2 �(;), e1 'v e2 holds iff e1 �v e2 ande2 �v e1.

Proof Since 'v and 'opv are both applicative bisimulations, and hence both

applicative simulations, they are contained in the greatest one, �v. Thus e1 'v

e2 implies e1 �v e2 and e2 �v e1.Conversely, since �v satisfies property (v-Sim) and +v satisfies (5.3), it

follows that �v \�opv is an applicative bisimulation and hence is contained in

'v. Thus e1 �v e2 and e2 �v e1 together imply e1 'v e2. �

Exercise 5.3.5 Show that

(8v 2 V (;). e1 +v v ) e2 +v v) ) e1 �v e2. (5.6)

[Hint: show that the union of f(e1, e2) j 8v. e1 +v v ) e2 +v vg with theidentity relation is an applicative simulation.]

Deduce that βv-equivalence is contained in applicative bisimilarity, that is,(λx. e)v 'v efv/xg.

Exercise 5.3.6 Show by example that η-equivalence is not contained inapplicative bisimilarity, in other words that e 'v λx. e x (where x /2 fv(e)) doesnot always hold. What happens if e is a λ-value?

Page 220: advanced topics in biosimulation and coinduction

204 Andrew Pitts

Exercise 5.3.7 Show that λx. e1 �v λx. e2 holds iff e1fv/xg �v e2fv/xg holdsfor all v 2 V (;).

5.4 Congruence

We noted in Exercise 5.3.3 that applicative bisimilarity is an equivalence rela-tion. To qualify as a reasonable notion of semantic equality for λ-terms, 'v

should not only be an equivalence relation, but also be a congruence; in otherwords it should also respect the way λ-terms are constructed. There are two suchconstructions: formation of application terms (e1, e2 7! e1 e2) and formation ofλ-abstractions (x, e 7! λx. e). The second is a variable-binding operation andto make sense of the statement that it respects applicative bisimilarity we firsthave to extend 'v to a binary relation between all λ-terms, open as well asclosed. To do this we will regard the free variables in a λ-term as implicitlyλ-bound and use the property of �v noted in Exercise 5.3.7.

Definition 5.4.1 (Open extension of applicative (bi)similarity) Given afinite set of variables x D fx1, . . . , xng 2 ℘fin(Var) and λ-terms e, e0 2 �(x),we write

x ` e �v e0 (5.7)

if efv1, . . . , vn/x1, . . . , xng �v e0fv1, . . . , vn/x1, . . . , xng holds for all v1, . . . , vn 2

V (;). Similarly

x ` e 'v e0 (5.8)

means efv1, . . . , vn/x1, . . . , xng 'v e0fv1, . . . , vn/x1, . . . , xng holds for all v1, . . . ,

vn 2 V (;).

Definition 5.4.2 (λ-term relations) The relations (5.7) and (5.8) are examplesof what we call a λ-term relation, by which we mean a set R of triples (x, e, e0)where x 2 ℘fin(Var) and e, e0 2 �(x). We will use mixfix notation and writex ` e R e0 to indicate that (x, e, e0) 2 R. We call a λ-term relationR symmetricif

8x 2 ℘fin(Var).8e, e0 2 �(x). x ` e R e0 ) x ` e0 R e, (Sym)

transitive if

8x 2 ℘fin(Var).8e, e0, e00 2 �(x).

x ` e R e0 ^ x ` e0 R e00 ) x ` e R e00 (Tra)

Page 221: advanced topics in biosimulation and coinduction

Howe’s method for higher-order languages 205

and compatible if8x 2 ℘fin(Var). x 2 x ) x ` x R x (Com1)

8x 2 ℘fin(Var).8x 2 Var � x.8e, e0 2 �(x [ fxg).x [ fxg ` e R e0 ) x ` λx. e R λx. e0 (Com2)

8x 2 ℘fin(Var).8e1, e01, e2, e

02 2 �(x).

x ` e1 R e01 ^ x ` e2 R e02 ) x ` e1 e2 R e01 e02. (Com3)

Property (Com1) is a special case of reflexivity:

8x 2 ℘fin(Var).8e 2 �(x). x ` e R e. (Ref)

Indeed, it is not hard to see that a compatible λ-term relation has to be reflexive.We say that R is a precongruence if it has the properties (Tra), (Com1), (Com2)and (Com3); and we call it a congruence if it also satisfies property (Sym).

Exercise 5.4.3 Prove that every compatible λ-term relation is reflexive.Deduce that property (Com3) implies

8x 2 ℘fin(Var).8e1, e01, e2 2 �(x). x ` e1 R e01 ) x ` e1 e2 R e01 e2

(Com3L)

8x 2 ℘fin(Var).8e1, e01, e2 2 �(x). x ` e2 R e02 ) x ` e1 e2 R e1 e02.

(Com3R)

Show that if R is transitive, then (Com3L) and (Com3R) together imply(Com3).

Remark 5.4.4 (Motivating Howe’s method) We will eventually prove thatthe open extension of applicative similarity is a precongruence relation (Theo-rem 5.5.5). It is illuminating to see how far we can get with a direct proof ofthis before we have to introduce the machinery of Howe’s method. CombiningExercise 5.3.3 with the way the open extension is defined from the relation onclosed λ-terms in Definition 5.4.1, it follows that properties (Tra), (Ref), andhence also (Com1), hold when R is �v. In the same way, the property in Exer-cise 5.3.7 implies (Com2). So to complete the proof that �v is a precongruence,we just have to prove that it has property (Com3); and for this it is sufficient toprove the special case when x D ;, that is, to prove

8e1, e01, e2, e

02 2 �(;). e1 �v e01 ^ e2 �v e02 ) e1 e2 �v e01 e02. (�)

Since we know that �v is a preorder, proving (�) is equivalent to proving thefollowing two special cases (cf. Exercise 5.4.3).

8e1, e01 2 �(;). e1 �v e01 ) 8e2 2 �(;). e1 e2 �v e01 e2 (�1)

8e2, e02 2 �(;). e2 �v e02 ) 8e1 2 �(;). e1 e2 �v e1 e02. (�2)

Page 222: advanced topics in biosimulation and coinduction

206 Andrew Pitts

Given the coinductive definition of �v (Definition 5.3.1), an obvious strategyfor proving these properties is to show that

S1defD f(e1 e2, e

01 e2) j e1 �v e01 ^ e2 2 �(;)g

S2defD f(e1 e2, e1 e02) j e1 2 �(;) ^ e2 �v e02g

are contained in applicative simulations; for then Si is contained in the largestsuch, �v, which gives (�i). We leave the proof of this for S1 as a straightforwardexercise (Exercise 5.4.5). Proving (�2) by the same method as in that exerciseis not so easy. Let us see why. It would suffice to show that

e2 �v e02 (5.9)

e1 e2 +v λx. e (5.10)

implies

9e0. e1 e02 +v λx. e0 ^ 8v 2 V (;). efv/xg �v e0fv/xg. (†)

The syntax-directed nature of the rules (Val) and (Cbv) inductively defining+v

mean that (5.10) holds because for some e3 and e4 we have

e1 +v λx. e3 (5.11)

e2 +v λx. e4 (5.12)

e3fλx. e4/xg +v λx. e. (5.13)

Then since �v is an applicative simulation, from (5.9) and (5.12) we concludethat there is some e04 with

e02 +v λx. e04 (5.14)

and 8v. e4fv/xg �v e04fv/xg, which by Exercise 5.3.7 implies

λx. e4 �v λx. e04. (5.15)

So to prove (†) we just have to show that

9e0. e3fλx. e04/xg +v λx. e0 ^ 8v. efv/xg �v e0fv/xg. (††)

In view of (5.13) and the fact that �v is an applicative simulation, to prove(††) we just need to show that e3fλx. e4/xg �v e3fλx. e04/xg. This would followfrom (5.15) if we knew that applicative similarity has the following substitutionproperty:

8x 2 ℘fin(Var).8x 2 Var � x.8e 2 �(x [ fxg).8v, v0 2 V (x).

x ` v �v v0 ) x ` efv/xg �v efv0/xg. (5.16)

Page 223: advanced topics in biosimulation and coinduction

Howe’s method for higher-order languages 207

Unfortunately the property (�2) that we are trying to prove is very similar tothis property (consider taking e to be e1 x) and we are stuck. To get unstuck, inthe next section we use Howe’s method of constructing a relation (�v)H out of�v that has property (5.16) by construction and which can be proved equal to�v via an induction over evaluation +v (the key Lemma 5.5.4).

Exercise 5.4.5 Prove property (�1) by showing that

f(e1 e2, e01 e2) j e1 �v e01 ^ e2 2 �(;)g [�v

is an applicative simulation.

5.5 Howe’s construction

Given a λ-term relationR, the λ-term relationRH is inductively defined fromRby the following rules. It is an instance of what Howe calls the ‘precongruencecandidate’ [How96, sect. 3].

x ` x R e

x ` x RH e(How1)

x [ fxg ` e1 RH e01 x ` λx. e01 R e2 x /2 x

x ` λx. e1 RH e2(How2)

x ` e1 RH e01 x ` e2 RH e02 x ` e01 e02 R e3

x ` e1 e2 RH e3. (How3)

We will need the following general properties of ( )H whose proof we leave asan exercise.

Lemma 5.5.1

(i) If R is reflexive, then RH is compatible.(ii) IfR is transitive, then x ` e1 RH e2 and x ` e2 R e3 imply x ` e1 RH e3.

(iii) If R is reflexive and transitive, then x ` e1 R e2 implies x ` e1 RH e2.�

Definition 5.5.2 (Substitutivity and closure under substitution)A λ-term relation R is called (value) substitutive if for all x 2 ℘fin(Var), x 2

Var � x, e, e0 2 �(x [ fxg) and v, v0 2 V (x)

x [ fxg ` e R e0 ^ x ` v R v0 ) x ` efv/xg R e0fv0/xg. (Sub)

Page 224: advanced topics in biosimulation and coinduction

208 Andrew Pitts

Note that if R is also reflexive, then this implies

x [ fxg ` e R e0 ^ v 2 V (x) ) x ` efv/xg R e0fv/xg. (Cus)

We say that R is closed under value-substitution if it satisfies (Cus).

Note that because of the way the open extension of applicative similarityand bisimilarity are defined (Definition 5.4.1), evidently they are closed undervalue-substitution. It is less clear that they are substitutive; this will followfrom the coincidence of �v with (�v)H that we prove below, because of thefollowing result.

Lemma 5.5.3 If R is reflexive, transitive and closed under value-substitution,then RH is substitutive and hence also closed under value-substitution.

Proof Property (Sub) for RH follows from property (Cus) for R by inductionon the derivation of x [ fxg ` e RH e0 from the rules (How1)–(How3), usingLemma 5.5.1(iii) in case e is a variable. �

Specialising Lemmas 5.5.1 and 5.5.3 to the case R D �v, we now give thekey property needed to show that (�v)H is in fact equal to �v.

Lemma 5.5.4 (Key lemma, version 1) If e1 +v λx. e and ; ` e1 (�v)H e2,then e2 +v λx. e0 holds for some e0 satisfying fxg ` e (�v)H e0.

Proof We show that

E defD f(e1, λx. e) j 8e2. ; ` e1 (�v)H e2

) 9e0. e2 +v λx. e0 ^ fxg ` e (�v)H e0g

is closed under the two rules (Val) and (Cbv) inductively defining +v.Closure under (Val): When e1 D λx. e, for any e2 if ; ` λx. e (�v)H e2

holds, it must have been deduced by an application of rule (How2) to

fxg ` e (�v)H e01 (5.17)

λx. e01 �v e2 (5.18)

for some e01. Since �v is an applicative simulation, from (5.18) it follows thate2 +v λx. e0 holds for some e0 with

fxg ` e01 �v e0. (5.19)

Applying Lemma 5.5.1(ii) to (5.17) and (5.19) gives fxg ` e (�v)H e0. So wedo indeed have (λx. e, λx. e) 2 E .

Closure under (Cbv): Suppose

(e1, λx. e2), (e01, λx. e02), (e2fλx. e02/xg, λx. e3) 2 E .

Page 225: advanced topics in biosimulation and coinduction

Howe’s method for higher-order languages 209

We have to show that (e1 e01, λx. e3) 2 E . For any e, if ; ` e1 e01 (�v)H e holdsit must have been deduced by an application of rule (How3) to

; ` e1 (�v)H e4 (5.20)

; ` e01 (�v)H e04 (5.21)

e4 e04 �v e (5.22)

for some e4, e04. Since (e1, λx. e2), (e01, λx. e02) 2 E , it follows from (5.20) and

(5.21) that

e4 +v λx. e5 (5.23)

fxg ` e2 (�v)H e5 (5.24)

e04 +v λx. e05 (5.25)

fxg ` e02 (�v)H e05

hold for some e5, e05, and hence also that

; ` λx. e02 (�v)H λx. e05. (5.26)

Now we can apply the substitutivity property of (�v)H (Lemma 5.5.3) to (5.24)and (5.26) to get ; ` e2fλx. e02/xg (�v)H e5fλx. e05/xg. From this and the fact that(e2fλx. e02/xg, λx. e3) 2 E , it follows that for some e6 it is the case that

e5fλx. e05/xg +v λx. e6 (5.27)

fxg ` e3 (�v)H e6. (5.28)

Applying rule (Cbv) to (5.23), (5.25) and (5.27), we have that e4 e04 +v λx. e6.Then since �v is an applicative simulation, from this and (5.22) we get thate +v λx. e0 holds for some e0 with

fxg ` e6 �v e0 (5.29)

and hence also with fxg ` e3 (�v)H e0 (by Lemma 5.5.1(ii) on (5.28) and(5.29)). Therefore we do indeed have (e1 e01, λx. e3) 2 E . �

Theorem 5.5.5 (Applicative bisimilarity is a congruence) The open exten-sion of applicative similarity is a precongruence relation and hence the openextension of applicative bisimilarity is a congruence relation.

Proof By Lemma 5.5.3, (�v)H is closed under value-substitution:

fxg ` e (�v)H e0 ) 8v 2 V (;). efv/xg (�v)H e0fv/xg.

Page 226: advanced topics in biosimulation and coinduction

210 Andrew Pitts

Therefore the key Lemma 5.5.4 implies that (�v)H restricted to closed λ-termsis an applicative simulation. So it is contained in the largest one, �v:

; ` e1 (�v)H e2 ) e1 �v e2.

Using closure of (�v)H under value-substitution once again, this lifts to openterms:

x ` e1 (�v)H e2 ) x ` e1 �v e2.

In view of Lemma 5.5.1(iii), this means that the λ-term relations (�v)H and �v

are equal. Since (�v)H is compatible by Lemma 5.5.1(i) and since we alreadyknow that �v is transitive, it follows that �v D (�v)H is a precongruencerelation. �

5.6 Contextual equivalence

One of the important consequences of Theorem 5.5.5 is that applicative bisim-ilarity coincides with the standard notion of contextual equivalence for thecall-by-value λ-calculus. A λ-term context C is a syntax tree with a unique5

‘hole’ []

C 2 Con ::D [] j λx. C j C e j e C (5.30)

and C[e] denotes the λ-term that results from filling the hole with a λ-term e:

[][e] D e

(λx. C)[e] D λx. C[e]

(C e0)[e] D C[e] e0

(e0 C)[e] D e0 C[e].

(5.31)

We also write C[C0] for the context resulting from replacing the occurrence of[] in the syntax tree C by the tree C0.

Remark 5.6.1 (Contexts considered too concrete) Note that (5.31) is a ‘cap-turing’ form of substitution – free variables in e may become bound in C[e]; forexample, (λx.�)[x] D λx. x. This means that it does not make sense to iden-tify contexts up to renaming of λ-bound variables, as we do with λ-terms. Forexample, if x and x0 are distinct variables, then C1 D λx. [] and C2 D λx0. []

5 In the literature one also finds treatments that use contexts with finitely many (including zero)occurrences of the hole. While it does not affect the associated notion of contextual equivalence,the restriction to ‘linear’ contexts that we use here makes for some technical simplifications.

Page 227: advanced topics in biosimulation and coinduction

Howe’s method for higher-order languages 211

are distinct contexts that give different results when their hole is filled withx: C1[x] D λx. x 6D λx0. x D C2[x]. The concreteness of the above notion of‘context’ forces us to take care with the actual names of bound variables. Thismight not seem so bad for the λ-calculus, because it is syntactically so simple.However it becomes increasingly irksome if one is producing fully formalisedand machine-checked proofs, or if one is dealing with more complicated pro-gramming languages with more complex forms of binding. Several differentremedies have been proposed for this problem of overly concrete represen-tations of contexts. We explain one of them in Remark 5.6.7, but postponediscussing it until we have given a more-or-less classical development of con-textual equivalence based on the above, rather too concrete notion of context.

Continuing the ‘hygiene’ of keeping track of free variables through use ofthe sets �(x) indexed by sets x of variables, and following [CH07, fig. 7], letus inductively define subsets Con(x; x0) of contexts by the rules:

[] 2 Con(x; x)(Con1)

C 2 Con(x; x0 [ fxg) x /2 x0

λx. C 2 Con(x; x0)(Con2)

C 2 Con(x; x0) e 2 �(x0)

C e 2 Con(x; x0)(Con3)

e 2 �(x0) C 2 Con(x; x0)

e C 2 Con(x; x0)(Con4)

For example, if x /2 x then λx. [] 2 Con(x [ fxg; x). The role in the abovedefinition of the double indexing over both x and x0 becomes clearer once onenotes the following properties, (5.32) and (5.33). They are easily proved, thefirst by induction on the derivation of C 2 Con(x; x0) from the rules (Con1)–(Con4), the second by induction on the derivation of C0 2 Con(x0; x00).

e 2 �(x) ^ C 2 Con(x; x0) ) C[e] 2 �(x0) (5.32)

C 2 Con(x; x0) ^ C0 2 Con(x0; x00) ) C0[C] 2 Con(x; x00). (5.33)

In particular, the elements of Con(x;;) are closing contexts for λ-terms withfree variables in x: if e 2 �(x) and C 2 Con(x;;), then C[e] 2 �(;) is a closedλ-term, which we can consider evaluating.

Definition 5.6.2 (Contextual equivalence) The contextual preorder withrespect to call-by-value evaluation is the λ-term relation given by

x ` e1 �v e2defD 8C 2 Con(x;;). C[e1]+v ) C[e2]+v

Page 228: advanced topics in biosimulation and coinduction

212 Andrew Pitts

where in general we write e+v to mean that e +v v holds for some v. Theλ-term relation of contextual equivalence, x ` e1 Dv e2, holds iff x ` e1 �v e2

and x ` e2 �v e1.

Exercise 5.6.3 Show that �v is a precongruence relation (Definition 5.4.2).[Hint: for property (Com2), given C 2 Con(x;;) consider C[λx. []] 2Con(x [ fxg;;); for property (Com3), given C 2 Con(x;;) consider C[e1 []]and C[[] e02] and use Exercise 5.4.3.]

Lemma 5.6.4 If x ` e1 �v e2 and C 2 Con(x; x0), then x0 ` C[e1] �v C[e2].

Proof By induction on the derivation of C 2 Con(x; x0) from the rules (Con1)–(Con4), using Theorem 5.5.5. �

Theorem 5.6.5 (Applicative bisimilarity is contextual equivalence)For all x 2 ℘fin(Var) and e1, e2 2 �(x), x ` e1 �v e2 iff x ` e1 �v e2 (andhence x ` e1 'v e2 iff x ` e1 Dv e2).

Proof We first prove

x ` e1 �v e2 ) x ` e1 �v e2. (5.34)

If x ` e1 �v e2, then for any C 2 Con(x;;) by Lemma 5.6.4 we have C[e1] �v

C[e2]. Since �v is an applicative bisimulation, this means in particular thatC[e1]+v implies C[e2]+v. So by definition, x ` e1 �v e2.

To prove the converse of (5.34), first note that it suffices to show that Dv

restricted to closed λ-terms is an applicative simulation and hence containedin �v. For then, if we have x ` e1 �v e2, by repeated use of the congruenceproperty (Com2) (which we know holds ofDv from Exercise 5.6.3), we get ; `λx. e1 Dv λx. e2 and hence λx. e1 �v λx. e2; but then we can use Exercise 5.3.7to deduce that x ` e1 �v e2.

So we just have to show that f(e1, e2) j ; ` e1 �v e2g has the applicativesimulation property. If ; ` e1 �v e2 and e1 +v λx. e01, then C[e1]+v with C D

[], so C[e2]+v, that is, e2 +v λx. e02 for some e02. From Exercise 5.3.5 we thushave ei 'v λx. e0i and hence by (5.34) that

; ` λx. e01 Dv e1 �v e2 Dv λx. e02.

So ; ` λx. e01 �v λx. e02 and hence for any v 2 V (;) we can use the congru-ence property of�v (Exercise 5.6.3) to deduce that ; ` (λx. e01) v �v (λx. e02) v.From Exercise 5.3.5 and (5.34), we have ; ` (λx. e0i) v Dv e0if

v/xg and there-fore ; ` e01f

v/xg �v e02fv/xg. Thus f(e1, e2) j ; ` e1 �v e2g does indeed have

property (v-Sim). �

Page 229: advanced topics in biosimulation and coinduction

Howe’s method for higher-order languages 213

As a corollary of the coincidence of contextual equivalence with applica-tive bisimulation, we have the following extensionality properties of λ-termsmodulo Dv.

Corollary 5.6.6 (Extensionality) Given variables x D fx1, . . . , xng and λ-terms e, e0 2 �(x), then x ` e Dv e0 iff ; ` λx. e Dv λx. e0 iff

8v1 . . . , vn 2 V (;). ; ` efv1, . . . , vn/x1, . . . , xng Dv efv1, . . . , vn/x1, . . . , xng.

Proof Just note that these properties hold of 'v (by definition of the openextension in Definition 5.4.1 and using Exercise 5.3.7); so we can apply Theo-rem 5.6.5. �

Remark 5.6.7 (‘Context free’ contextual equivalence) We noted inRemark 5.6.1 that the notion of context is unpleasantly concrete – it prevents onefrom working uniformly at the level of α-equivalence classes of syntax trees. Infact one can dispense with contexts entirely and work instead with a coinductivecharacterisation of the contextual preorder and equivalence phrased in terms ofλ-term relations. (This is an instance of the ‘relational’ approach to contextualequivalence first proposed by Gordon [Gor98] and Lassen [Las98a, Las98b].)The contextual preorder turns out to be the largest λ-term relation R that isboth compatible (Definition 5.4.2) and adequate (for call-by-value evaluation),which by definition means

8e. e0 2 �(;). ; ` e R e0 ) (e+v ) e0+v). (v-Adeq)

To see this, let CA be the collection of all compatible and adequate λ-termrelations and let

�cav

defD⋃

CA. (5.35)

We first want to show that�cav 2 CA and hence that�ca

v is the largest compatibleand adequate λ-term relation. Note that the identity relation f(x, e, e) j e 2

�(x)g is in CA; so�cav is reflexive and hence in particular satisfies compatibility

property (Com1). It is clear that properties (Com2) and (v-Adeq) are closedunder taking unions of relations, so that �ca

v has these properties; but the sameis not true for property (Com3). However, if R1,R22 CA then it is easy tosee that the composition R1 ıR2 is also in CA; hence �ca

v ı �cav � �

cav , that

is, �cav is transitive. So by Exercise 5.4.3, for (Com3) it is enough to show that

�cav satisfies (Com3L) and (Com3R); and this is straightforward, since unlike

(Com3) these properties clearly are closed under taking unions of relations.So the largest compatible and adequate λ-term relation not only exists, but

is reflexive and transitive.

Page 230: advanced topics in biosimulation and coinduction

214 Andrew Pitts

To see that �cav coincides with the contextual preorder, first note that it is

immediate from its definition that�v is adequate; and we noted in Exercise 5.6.3that it is a precongruence. So �v 2 CA and hence �v � �

cav . Since �ca

v is aprecongruence we can prove

x ` e1 �cav e2 ^ C 2 Con(x; x0) ) x0 ` C[e1] �ca

v C[e2]

in the same way that Lemma 5.6.4 was proved. Thus

x ` e1 �cav e2

) 8C 2 Con(x;;). ; ` C[e1] �cav C[e2]

) 8C 2 Con(x;;). C[e1]+v ) C[e2]+v since �cav is adequate

) x ` e1 �v e2.

So altogether we have that �cav is equal to �v.

Exercise 5.6.8 Show thatDv is the largest λ-term relation that is both compat-ible and bi-adequate:

8e. e0 2 �(;). ; ` e R e0 ) (e+v , e0+v). (Bi-adeq)

Exercise 5.6.9 Adapt the proof of Theorem 5.6.5 to give a direct proof (thatis, a proof making no use of �v) of the fact that �v coincides with the relation�ca

v defined in (5.35).

5.7 The transitive closure trick

We noted in Proposition 5.3.4 that because the evaluation relation +v is deter-ministic, applicative bisimilarity is the symmetrisation of applicative similarity:'v D �v \�op

v . We used this observation in Section 5.5 to deduce that 'v isa congruence by using Howe’s method to show that �v is a precongruence.What happens if we add features to the λ-calculus that cause 'v to be differ-ent from �v \�op

v ? Can one apply Howe’s method directly to 'v to deducethat it is a congruence in that case? Note that Howe’s ‘precongruence candi-date’ construction ( )H has an asymmetric nature: RH is obtained from R byinductively closing under the compatibility properties (Com1)–(Com3) at thesame time composing with R on the right. (This is needed to get the proofof the key Lemma 5.5.4 to go through.) So if we apply ( )H to 'v we donot get a symmetric relation, therefore it cannot coincide with 'v and hencein particular we cannot hope to transfer the congruence properties of ('v)H

to 'v in quite the same way that we did for applicative similarity. However,

Page 231: advanced topics in biosimulation and coinduction

Howe’s method for higher-order languages 215

as Howe observed [How96, lemma 3.3], the transitive closure of ('v)H is asymmetric relation and this fact is sufficient to deduce congruence of 'v via('v)H . We will illustrate this refinement of the method by adding an ‘erratic’choice operator (˚) to the call-by-value λ-calculus, which does indeed cause'v to be different from �v \�op

v (see Exercise 5.7.1).Let the set �˚ of λ˚-terms and the subset V˚ � �˚ of λ˚-values con-

sist of λ-terms and λ-values (modulo α-equivalence) extended with a binaryoperation ˚:

e 2 �˚ ::D v j e e j e˚ e,

v 2 V˚ ::D x j λx. e.(5.36)

We write �˚(x) (respectively, V˚(x)) for the subset of λ˚-terms (respectively,λ˚-values) whose free variables are in the finite set x of variables. A λ˚-termrelation R is a family of binary relations x ` ( ) R ( ) on �˚(x), as x rangesover ℘fin(Var) (cf. Definition 5.4.2). R is a congruence if it has the properties(Sym), (Tra), (Com1)–(Com3) and an additional compatibility property for thenew term constructor:

8x 2 ℘fin(Var).8e1, e01, e2, e

02 2 �(x).

x ` e1 R e01 ^ x ` e2 R e02 ) x ` e1 ˚ e2 R e01 ˚ e02. (Com4)

(As before, satisfaction of (Com1)–(Com4) implies that R is reflexive; so acongruence is in particular an equivalence relation.)

We extend call-by-value evaluation to a relation +v � �˚(;) ��˚(;) byadding to (Val) and (Cbv) the two rules

ei +v v

e1 ˚ e2 +v v(i D 1, 2). (Ch)

The definitions of call-by-value applicative similarity (�v) and bisimilarity('v) on closed λ˚-terms are as in Definition 5.3.1 except that �(;) is replacedby the extended set �˚(;); and these relations are extended to λ˚-term relationsas in Definition 5.4.1, using closed λ˚-value-substitutions.

Exercise 5.7.1 Defining

v1defD λx. x

v2defD λy. ((λx. x x) (λx. x x))

vdefD λz. (v1 ˚ v2)

edefD v ˚ (λz. v1)˚ (λz. v2),

Page 232: advanced topics in biosimulation and coinduction

216 Andrew Pitts

show that v �v e �v v, but that v 6'v e. (Compare this with the examplesin [San12, chapter 5], such as Exercise 5.8.11, showing the difference betweentrace equivalence and bisimilarity for labelled transition systems; recall thattesting equivalence implies trace equivalence.)

We wish to prove that call-by-value applicative bisimilarity is a congruencefor λ˚-terms. We can still do so using Howe’s precongruence candidate con-struction ( )H , which in this setting sends a λ˚-term relation R to the λ˚-termrelation RH inductively defined by the rules (How1)–(How3) from Section 5.5together with an extra rule for the new binary operation, ˚:

x ` e1 RH e01 x ` e2 RH e02 x ` e01 ˚ e02 R e3

x ` e1 ˚ e2 RH e3. (How4)

The rule follows the same pattern as for the existing λ-calculus constructsand does not disturb the validity of the general properties of ( )H given inLemmas 5.5.1 and 5.5.3. More delicate is the analogue of the key Lemma 5.5.4,since it depends not only upon the syntactical form of e˚ e0, but also upon itsoperational semantics, as defined by the rules (Ch).

Lemma 5.7.2 (Key lemma, version 2) For all e1, λx. e, e2 2 �˚(;)

e1 +v λx. e ^ ; ` e1 ('v)H e2

) 9e0 2 �˚. e2 +v λx. e0 ^ fxg ` e ('v)H e0. (5.37)

Proof This can be proved by showing that

E defD f(e1, λx. e) j 8e2. ; ` e1 ('v)H e2

) 9e0. e2 +v λx. e0 ^ fxg ` e ('v)H e0g

is closed under the rules (Val), (Cbv) and (Ch) inductively defining +v forλ˚-terms. The proof of closure under (Val) and (Cbv) is exactly as in the proofof Lemma 5.5.4. We give the proof of closure under the i D 1 case of (Ch), theargument for the other case being symmetric.

So suppose (e1, λx. e) 2 E . We have to show for any e01 2 �˚(;) that (e1 ˚

e01, λx. e) 2 E . For any e2, if ; ` e1 ˚ e01 ('v)H e2 holds it must have beendeduced by an application of rule (How4) to

; ` e1 ('v)H e3 (5.38)

; ` e01 ('v)H e03 (5.39)

e3 ˚ e03 'v e2 (5.40)

Page 233: advanced topics in biosimulation and coinduction

Howe’s method for higher-order languages 217

for some e3, e03. Since (e1, λx. e) 2 E , it follows from (5.38) that for some e00 it

is the case that

e3 +v λx. e00 (5.41)

x ` e ('v)H e00. (5.42)

Applying (Ch) to (5.41), we get e3 ˚ e03 +v λx. e00. Since 'v is an applicativebisimulation, it follows from this and (5.40) that

e2 +v λx. e0 (5.43)

x ` e00 'v e0. (5.44)

Applying Lemma 5.5.1(ii) to (5.42) and (5.44), we get x ` e ('v)H e0. There-fore we do indeed have (e1 ˚ e01, λx. e) 2 E . �

The lemma implies that ('v)H is an applicative simulation; but to get theapplicative bisimulation property we have to move to its transitive closure.

Definition 5.7.3 (Transitive closure) The transitive closure of a λ˚-termrelation R, is the λ˚-term relation RC inductively defined by the rules

x ` e R e0

x ` e RC e0

x ` e RC e0 x ` e0 RC e00

x ` e RC e00. (TC)

Exercise 5.7.4 Show that if R is compatible, then so is RC. Show that if Ris closed under value-substitution, then so is RC.

Lemma 5.7.5 If a λ˚-term relation R is an equivalence relation, then so is(RH )C.

Proof Being a transitive closure, (RH )C is of course transitive; and since R isreflexive, by Lemma 5.5.1(i) RH is reflexive and hence so is (RH )C. So the realissue is the symmetry property. To prove x ` e (RH )C e0 ) x ` e0 (RH )C e,it suffices to prove

x ` e RH e0 ) x ` e0 (RH )C e (5.45)

and then argue by induction on the derivation of x ` e (RH )C e0 from the rules(TC). To prove (5.45), one argues by induction on the derivation of x ` e RH e0

from the rules (How1)–(How4), using Lemma 5.5.1(iii). In addition to thatlemma, for closure under (How2)–(How4) one has to use the fact that (RH )C

satisfies (Com2)–(Com4) respectively, which follows from Lemma 5.5.1(i)and Exercise 5.7.4. �

Theorem 5.7.6 Call-by-value applicative bisimilarity is a congruence relationfor λ˚-terms.

Page 234: advanced topics in biosimulation and coinduction

218 Andrew Pitts

Proof We show that 'v is equal to (('v)H )C. The former is an equivalencerelation and the latter is a compatible λ˚-term relation by Lemma 5.5.1(i) andExercise 5.7.4; so altogether 'v D (('v)H )C is a congruence relation.

We have 'v � ('v)H � (('v)H )C by Lemma 5.5.1(iii) and by definitionof ( )C. For the reverse inclusion, since (('v)H )C is closed under value-substitution (Lemma 5.5.3 and Exercise 5.7.4), it suffices to show that itsrestriction to closed λ˚-terms is a call-by-value applicative bisimulation. FromLemma 5.7.2 we get

e1 +v λx. e ^ ; ` e1 ('v)H e2

) 9e0 2 �˚. e2 +v λx. e0 ^ 8e00 2 �˚(;). ; ` efe00/xg (('v)H )C e0fe

00/xg

(using the fact that (('v)H )C is closed under value-substitution and contains'v

H ). Therefore

e1 +v λx. e ^ ; ` e1 (('v)H )C e2

) 9e0 2 �˚. e2 +v λx. e0 ^ 8e00 2 �˚(;). ; ` efe00/xg (('v)H )C e0fe

00/xg.

So ; ` ( ) (('v)H )C ( ) is an applicative simulation; and since by Lemma 5.7.5it is a symmetric relation, it is in fact an applicative bisimulation, as required.

5.8 CIU-equivalence

Howe’s method has been applied most often in the literature to prove congru-ence properties of various kinds of bisimilarity. It is less well known that it alsoprovides a useful method for proving congruence of ‘CIU’ equivalences. Thisform of equivalence was introduced by Mason and Talcott in their work oncontextual equivalence of impure functional programs [MT91, MT92], but isprefigured by Milner’s context lemma for contextual equivalence for the purefunctional language PCF [Mil77]. In both cases the form of program equiva-lence of primary concern is the kind studied in Section 5.6, namely contextualequivalence. The quantification over all contexts that occurs in its definition(recall Definition 5.6.2) makes it hard to prove either specific instances of, orgeneral properties of contextual equivalence. Therefore one seeks alternativecharacterisations of contextual equivalence that make such tasks easier. Oneapproach is to prove a ‘context lemma’ to the effect that quantification over allcontexts can be replaced by quantification over a restricted class of contextswithout affecting the associated contextual equivalence. As we now explain, the

Page 235: advanced topics in biosimulation and coinduction

Howe’s method for higher-order languages 219

coincidence of CIU-equivalence with contextual equivalence is exactly such aresult.

We take the acronym ‘CIU’ to stand for a permutation of ‘Uses of ClosedInstantiations’: the ‘closed instantiations’ part refers to the fact that CIU-equivalence is first defined on closed terms and then extended to open ones viaclosing substitutions (just as for applicative bisimulation in Definition 5.4.1);the ‘uses’ part refers to the fact that closed terms are identified when theyhave the same evaluation behaviour in any context that ‘uses’ its hole, thatis, in any Felleisen-style evaluation context [FH92]. Thus CIU-equivalenceis a form of contextual equivalence in which restrictions are placed uponthe kind of contexts in which operational behaviour of program phrases isobserved. The restrictions make it easier to establish some properties of CIU-equivalence compared with contextual equivalence itself, for which there areno restrictions upon the contexts. Once one has proved that CIU-equivalenceis a congruence, it is straightforward to see that it actually coincides withcontextual equivalence. Therefore the notion of CIU-equivalence is really ameans of establishing properties of contextual equivalence, namely the onesthat stem from the reduction properties of terms, such as those in Exercise 5.8.5.

We illustrate these ideas in this section by defining CIU-equivalence for call-by-value λ-calculus with erratic choice (˚), using Howe’s method to prove thatit is a congruence and hence that it coincides with contextual equivalence.

We will adopt the more abstract, relational approach to contextual equiva-lence outlined in Remark 5.6.7: the contextual preorder�v for the call-by-valueλ˚-calculus is the largest λ˚-term relation that is both compatible (that is, sat-isfies (Com1)–(Com4)) and adequate (that is, satisfies (v-Adeq)). At the sametime, rather than using Felleisen’s notion of ‘evaluation context’, which in thiscase would be

E ::D [] j E e j v E ,

we will use an ‘inside out’ representation of such contexts as a stack of basicevaluation frames (which in this case are []e and v[]). Such a representation ofevaluation contexts yields a convenient, structurally inductive characterisationof the ‘may evaluate to some value in call-by-value’ property used in thedefinition of contextual equivalence (Lemma 5.8.3); see [Pit02, section 4] fora more detailed explanation of this point.

Definition 5.8.1 (Frame stacks) The set Stk˚ of call-by-value frame stacksis given by

s 2 Stk˚ ::D nil j []e :: s j v[] :: s. (5.46)

Page 236: advanced topics in biosimulation and coinduction

220 Andrew Pitts

As for terms and values, we write Stk˚(x) for the subset of frame stacks whosefree variables are in the finite set x. Given s 2 Stk˚(x) and e 2 �˚(x), we geta term Es[e] 2 �˚(x), defined by:⎧⎪⎪⎨⎪⎪⎩

Enil[e]defD e

E[�]e0::s[e]defD Es[e e0]

Ev[�]::s[e]defD Es[v e].

(5.47)

Definition 5.8.2 (Transition and may-termination) The binary relation ofcall-by-value transition between pairs (s , e) of frame stacks and closed λ˚-terms

(s , e)!v (s0 , e0)

is defined by cases as follows:

((λx. e)[] :: s , v)!v (s , efv/xg) (!v1)

([]e :: s , v)!v (v[] :: s , e) (!v2)

(s , e e0)!v ([]e0 :: s , e) (!v3)

(s , e1 ˚ e2)!v (s , ei) for i D 1, 2. (!v4)

We write (s , e)#(n)v if for some closed value v 2 V˚(;) there exists a

sequence of transitions (s , e)!v !v (nil , v) of length less than orequal to n; and we write (s , e)#v and say that (s , e) may terminate if(s , e)#(n)

v holds for some n 0.

The relationship between this termination relation and ‘may evaluate to

some value in call-by-value’, e+vdefD 9v. e +v v, is as follows.

Lemma 5.8.3 For all closed frame stacks s 2 Stk˚(;) and closed λ˚-termse 2 �˚(;), (s , e)#v iff Es[e]+v. In particular e+v holds iff (nil , e)#v.

Proof The result can be deduced from the following properties of transition,evaluation and termination, where!�v stands for the reflexive-transitive closureof!v and ( ) @ ( ) stands for the operation of appending two lists.

(s0 , Es[e])!�v (s @ s0 , e) (5.48)

(s0 , Es[e])#v ) (s @ s0 , e)#v (5.49)

e +v v ) (s , e)!�v (s , v) (5.50)

(s , e)#(n)v ) 9v. e +v v ^ (s , v)#(n)

v . (5.51)

Page 237: advanced topics in biosimulation and coinduction

Howe’s method for higher-order languages 221

Properties (5.48) and (5.49) are proved by induction on the length of the list s;(5.50) by induction on the derivation of e +v v; and (5.51) by induction on n

(and then by cases according to the structure of e).Therefore if(s , e)#v, then(nil , Es[e])#v by (5.48) and hence Es[e]+v

by (5.51). Conversely, if Es[e] +v v, then (nil , Es[e])#v by (5.50) andhence (s , e)#v by (5.49). �

Definition 5.8.4 (CIU-equivalence) Given e, e0 2 �˚(;), we define

e �ciuv e0

defD 8s 2 Stk˚(;). (s , e)#v ) (s , e0)#v.

This is extended to a λ˚-term relation, called the (call-by-value) CIU-preorder,via closing value-substitutions:

x ` e �ciuv e0

defD 8v1, . . . , vn 2 V˚(;).

efv1, . . . , vn/x1, . . . , xng �ciuv e0fv1, . . . , vn/x1, . . . , xng

(where x D fx1, . . . , xng). CIU-equivalence is the symmetrisation of this rela-tion:

x ` e Dciuv e0

defD x ` e �ciu

v e0 ^ x ` e0 �ciuv e0.

It is clear from its definition that the λ˚-term relation�ciuv is a preorder (reflexive

and transitive) and hence thatDciuv is an equivalence relation.

Exercise 5.8.5 Show that βv-equivalence holds up toDciuv :

x ` (λx. e) v Dciuv efv/xg.

Show that e1 ˚ e2 is the least upper bound of e1 and e2 with respect to theCIU-preorder, �ciu

v .

We will use Howe’s method to show that �ciuv is a compatible λ˚-term

relation and deduce that it coincides with the contextual preorder (and hencethat Dciu

v coincides with contextual equivalence). As for previous applicationsof Howe’s method, we know that (�ciu

v )H is a compatible λ˚-term relationcontaining �ciu

v (Lemma 5.5.1). So for compatibility of �ciuv , we just need to

show (�ciuv )H� �ciu

v . Since �ciuv is defined on open terms by taking closing

value-substitutions, both it and (�ciuv )H are closed under value-substitution

(Lemma 5.5.3); so it suffices to show for closed λ˚-terms that

; ` e (�ciuv )H e0 ) e �ciu

v e0

that is,

; ` e (�ciuv )H e0 ^ (s , e)#v ) (s , e0)#v.

Page 238: advanced topics in biosimulation and coinduction

222 Andrew Pitts

We do this by proving the following analogue of the key Lemma 5.5.4. It uses anextension of the Howe precongruence candidate construction ( )H to (closed)frame stacks: given a λ˚-term relation R, the relation s RH s0 is inductivelydefined by:

nil RH nil

; ` e RH e0 s RH s0

[]e :: s RH []e0 :: s0

fxg ` e RH e0 s RH s0

(λx. e)[] :: s RH (λx. e0)[] :: s0.

(How-Stk)

Lemma 5.8.6 (Key lemma, version 3)

8s, e, s0, e0. s (�ciuv )H s0 ^ ; ` e (�ciu

v )H e0 ^ (s , e)#(n)v ) (s0 , e0)#v.

(5.52)

Proof The proof is by induction on n. The base case n D 0 is straightforward,so we concentrate on the induction step. Assume (5.52) holds and that

s1 (�ciuv )H s0 (5.53)

; ` e1 (�ciuv )H e0 (5.54)

(s1 , e1)!v (s2 , e2) (5.55)

(s2 , e2)#(n)v . (5.56)

We have to show that (s0 , e0)#v and do so by analysing (5.55) against thefour possible cases (!v1)–(!v4) in the definition of the transition relation.

Case (!v1): So s1 D (λx. e)[] :: s2, e1 D λx. e01 and e2 D efλx. e01/xg, forsome x, e and e01. Thus (5.53) must have been deduced by applying (Howe-Stk)to

fxg ` e (�ciuv )H e0 (5.57)

s2 (�ciuv )H s02 (5.58)

where (λx. e0)[] :: s02 D s0. Since e1 D λx. e01, (5.54) must have been deducedby an application of (How2) to

fxg ` e01 (�ciuv )H e001 (5.59)

λx. e001 �ciuv e0 (5.60)

for some e001 . From Lemma 5.5.3 we have that (�ciuv )H is substitutive; so

since (5.59) implies ; ` λx. e01 (�ciuv )H λx. e001 , from this and (5.57) we get

; ` efλx. e01/xg (�ciuv )H e0fλx. e001/xg, that is, ; ` e2 (�ciu

v )H e0fλx. e001/xg. Apply-ing the induction hypothesis (5.52) to this, (5.58) and (5.56) gives (s02 ,e0fλx. e001/xg)#v and hence also ((λx. e0)[] :: s02 , λx. e001)#v. From this and

Page 239: advanced topics in biosimulation and coinduction

Howe’s method for higher-order languages 223

(5.60) we get ((λx. e0)[] :: s02 , e0)#v. In other words (s0 , e0)#v, as requiredfor the induction step.

Case (!v2): So s1 D []e2 :: s, e1 D λx. e01 and s2 D (λx. e01)[] :: s, forsome s, x and e01. Thus (5.53) must have been deduced by applying (How-Stk)to

s (�ciuv )H s02 (5.61)

; ` e2 (�ciuv )H e02 (5.62)

(5.63)

where []e02 :: s02 D s0. Since e1 D λx. e01, (5.54) must have been deduced byan application of (How2) to

fxg ` e01 (�ciuv )H e001 (5.64)

λx. e001 �ciuv e0 (5.65)

for some e001 . By (How-Stk) on (5.61) and (5.64), we get s2 (�ciuv )H (λx. e001 )[] ::

s02. Applying the induction hypothesis (5.52) to this, (5.62) and (5.56) gives((λx. e001 )[] :: s02 , e02)#v and hence also ([]e02 :: s02 , λx. e001)#v. From thisand (5.65) we get ([]e02 :: s02 , e0)#v. In other words (s0 , e0)#v, as requiredfor the induction step.

Case (!v3): So e1 D e2 e and s2 D []e :: s1, for some e. Thus (5.54) musthave been deduced by applying (How3) to

; ` e2 (�ciuv )H e002 (5.66)

; ` e (�ciuv )H e00 (5.67)

e002 e00 �ciuv e0 (5.68)

for some e002 and e00. Applying (How-Stk) to (5.67) and (5.53) we get s2 (�ciuv )H

[]e00 :: s0. Applying the induction hypothesis (5.52) to this, (5.66) and (5.56)gives ([]e00 :: s0 , e002)#v and hence also (s0 , e002 e00)#v. From this and (5.68)we get (s0 , e0)#v, as required for the induction step.

Case (!v4): We treat the i D 1 subcase of (!v4), the argument for thei D 2 subcase being symmetric. So s1 D s2 and e1 D e2 ˚ e, for some e. Thus(5.54) must have been deduced by applying (How4) to

; ` e2 (�ciuv )H e002 (5.69)

; ` e (�ciuv )H e00

e002 ˚ e00 �ciuv e0 (5.70)

for some e002 and e00. Since s1 D s2, we can apply the induction hypothesis (5.52)to (5.53), (5.69) and (5.56) to conclude that (s0 , e002)#v and hence also that

Page 240: advanced topics in biosimulation and coinduction

224 Andrew Pitts

(s0 , e002 ˚ e0)#v. From this and (5.70) we get (s0 , e0)#v, as required for theinduction step. �

Theorem 5.8.7 (CIU-equivalence is contextual equivalence) For all x 2

℘fin(Var) and e1, e2 2 �˚(x), x ` e1 �ciuv e2 iff x ` e1 �v e2 (and hence x `

e1 Dciuv e2 iff x ` e1 Dv e2).

Proof Since �ciuv is reflexive, so is the λ˚-term relation (�ciu

v )H and hence sois its extension to closed frame stacks. So we can take s D s0 in Lemma 5.8.6and conclude that ; ` e (�ciu

v )H e0 ) e �ciuv e0. As we remarked before the

lemma, this is enough to show that (�ciuv )HD �ciu

v and hence that �ciuv is com-

patible. It is immediate from Lemma 5.8.3 that it satisfies the adequacy property(v-Adeq) from Remark 5.6.7. So �ciu

v is contained in the largest compatibleadequate λ˚-term relation:

x ` e �ciuv e0 ) x ` e �v e0. (5.71)

To prove the converse of this, first note that since the contextual preorder iscompatible, if; ` e �v e0 then; ` Es[e] �v Es[e0] (by induction on the lengthof the list s, using (5.47)); hence by adequacy of �v and Lemma 5.8.3 we have

; ` e �v e0 ) ; ` e �ciuv e0.

So if x ` e �v e0, then by compatibility of �v we have ; ` λx. e �v λx. e0

and hence also ; ` λx. e �ciuv λx. e0. Then supposing x D fx1, . . . , xng, for

any closed values v1, . . . , vn, we can use the compatibility of �ciuv (established

in the first part of this proof) together with the validity of βv-equivalence(Exercise 5.8.5) to get ; ` efv1, . . . , vn/x1, . . . , xng �

ciuv e0fv1, . . . , vn/x1, . . . , xng.

Therefore we do indeed have that x ` e �v e0 implies x ` e �ciuv e0. �

Remark 5.8.8 Theorem 5.8.7 serves to establish some basic properties of con-textual equivalence for the call-by-value λ˚-calculus (such as βv-equivalence,via Exercise 5.8.5). Nevertheless, in this call-by-value setting its usefulness issomewhat limited.6 This is because of the presence in frame stacks of evalua-tion frames of the form (λx. e)[]. For closed values v we have (λx. e)v+v iffefv/xg+v; so testing may-termination with respect to such evaluation framesis essentially the same as testing may-termination in an arbitrary context. Inthe call-by-name setting the CIU theorem gives a more useful characterisa-tion of contextual equivalence; see Example 5.9.1. Nevertheless, such ‘context

6 In fact the properties ofDv for this calculus are rather subtle. For example, it is possible toshow that �v \�op

v is strictly contained inDv: the untyped nature of the calculus means thereare expressions with unbounded non-deterministic behaviour (via the usual encoding offixpoint recursion and arithmetic), thereby allowing one to encode Lassen’s example separatingmutual similarity from contextual equivalence [Las98b, pp. 72 and 90].

Page 241: advanced topics in biosimulation and coinduction

Howe’s method for higher-order languages 225

lemmas’ cannot help us with deeper properties that a contextual equivalencemay have (such as the extensionality and representation independence resultsconsidered in [Pit02]), where bisimilarities, logical relations and related notionscome into their own. However, the weakness of CIU theorems is also theirstrength; because they only give a weak characterisation of contextual equiva-lence, they seem to hold (and are relatively easy to prove via Howe’s method)in the presence of a very wide range of programming language features whereother more subtle analyses are not easily available or are more troublesome todevelop; see [PS08, appendix A], for example.

5.9 Call-by-name equivalences

In this section we consider briefly the call-by-name version of the resultsdescribed so far. Apart from changing the evaluation relation and using arbitrarysubstitutions instead of value-substitutions, the essential features of Howe’smethod for proving congruence results remains the same.

Syntax We will use the λ˚-calculus from Section 5.7, that is, the untypedλ-calculus extended with erratic choice, ˚. Recall from there that a λ˚-termrelation is compatible if it satisfies (Com1)–(Com4); is a precongruence if itis compatible and satisfies (Tra); and is a congruence if it is a precongruenceand satisfies (Sym). Howe’s ‘precongruence candidate’ construction is simi-larly unchanged: it sends a λ˚-term relation R to the λ˚-term relation RH

inductively defined by rules (How1)–(How4).

Operational semantics Call-by-name evaluation of closed λ˚-terms is thebinary relation +n � �˚(;) � V˚(;) inductively defined by the rules

v +n v(Val)

e1 +n λx. e efe2/xg +n v

e1 e2 +n v(Cbn)

ei +n v

e1 ˚ e2 +n v(i=1,2). (Ch)

The call-by-name transition relation, (s , e)!n (s0 , e0), is given by

([]e0 :: s , λx. e)!n (s , efe0/xg) (!n1)

(s , e e0)!n ([]e0 :: s , e) (!n2)

(s , e1 ˚ e2)!n (s , ei) for i D 1, 2 (!n3)

Page 242: advanced topics in biosimulation and coinduction

226 Andrew Pitts

where now s ranges over call-by-name frame stacks

s ::D nil j []e :: s. (5.72)

Defining

e+ndefD 9v 2 V˚(;). e +n v (5.73)

(s , e)#ndefD 9v 2 V˚(;). (s , e)!n !n (nil , v) (5.74)

the analogue of Lemma 5.8.3 holds and in particular we have

e+n , (nil , e)#n. (5.75)

Applicative (bi)similarity A relation S � �˚(;) ��˚(;) is a call-by-nameapplicative simulation if for all e1, e2 2 �˚(;), e1 S e2 implies

e1 +n λx. e01 ) 9e02. e2 +n λx. e02 ^ 8e 2 �˚(;). e01fe/xg S e02f

e/xg.(n-Sim)

We write �n for the largest such relation and call it call-by-name applica-tive similarity. A relation B � �˚(;) ��˚(;) is a call-by-name applicativebisimulation if both B and its reciprocal Bop are call-by-name applicative sim-ulations. We write 'n for the largest such relation and call it call-by-nameapplicative bisimilarity. We extend �n and'n to λ˚-term relations via closingsubstitutions:

x ` e �n e0defD 8e1, . . . , en 2 �˚(;).

efe1, . . . , en/x1, . . . , xng �n efe1, . . . , en/x1, . . . , xng

(5.76)

x ` e 'n e0defD 8e1, . . . , en 2 �˚(;).

efe1, . . . , en/x1, . . . , xng 'n efe1, . . . , en/x1, . . . , xng

(5.77)

(where x D fx1, . . . , xng).With these definitions, the proof that �n is a precongruence and that 'n is

a congruence proceeds as before, by using Howe’s method to show that theseλ˚-term relations are compatible. For R D �n or R D 'n one proves the keylemma

e1 +n λx. e ^ ; ` e1 RH e2 ) 9e0. e2 +n λx. e0 ^ fxg ` e RH e0

(5.78)by induction on the derivation of e1 +n λx. e. In case R D �n, this gives�n D (�n)H and so �n inherits the compatibility property from (�n)H . In caseR D 'n, one uses the transitive closure trick from Section 5.7 to deduce from

Page 243: advanced topics in biosimulation and coinduction

Howe’s method for higher-order languages 227

(5.78) that'n D ((�n)H )C and so'n inherits the compatibility property from(('n)H )C.

Contextual equivalence Taking the relational approach outlined in Remark5.6.7, we can define the call-by-name contextual preorder,Dn, to be the largestλ˚-term relation R that is both compatible and adequate for call-by-nameevaluation:

8e. e0 2 �˚(;). ; ` e R e0 ) (e+n ) e0+n) (n-Adeq)

(with the proviso that the existence of a largest such relation is not immedi-ately obvious, but can be deduced as in the remark). Call-by-name contextual

equivalence is the symmetrisation of this preorder:DndefD �n \ �

opn .

CIU-equivalence Two closed λ˚-terms are in the call-by-name CIU-preorder,e �ciu

n e0, if for all call-by-name frame stacks s we have that (s , e) #n implies(s , e0) #n. This is extended to a λ˚-term relation via closing substitutions:

x ` e �ciun e0

defD 8e1, . . . , en 2 �˚(;).

efe1, . . . , en/x1, . . . , xng �ciun e0fe1, . . . , en/x1, . . . , xng

(where x D fx1, . . . , xng). Call-by-name CIU-equivalence is the symmetrisa-

tion of this relation:Dciun

defD �ciu

n \ (�ciun )op.

The proof that �ciun is compatible is via the key lemma

8s, e, s0, e0. s (�ciun )H s0 ^ ; ` e (�ciu

n )H e0 ^ (s , e)#(n)n ) (s0 , e0)#n

(5.79)which, like Lemma 5.8.6, is proved by induction on the number n of steps oftransition in (s , e)#(n)

n and then by cases on the definition of the call-by-nametransition relation!n.

Compatibility of �ciun gives the call-by-name CIU-theorem:

�ciun D �n and Dciu

n D Dn (5.80)

as in the proof of Theorem 5.8.7, except that one uses validity of β-equivalence

x ` (λx. e)e0 Dciun efe

0/xg (5.81)

rather than βv-equivalence. Because call-by-name frame stacks have a rathersimple form (they are just a list of closed terms waiting to be applied asarguments for a function), this CIU-theorem is more useful than the call-by-value version. The following example illustrates this.

Page 244: advanced topics in biosimulation and coinduction

228 Andrew Pitts

Example 5.9.1 It is not hard to see that λx1. λx2. (x1 ˚ x2) 6�n (λx1. λx2. x1)˚(λx1. λx2. x2). However, it is the case that

λx1. λx2. (x1 ˚ x2) �n (λx1. λx2. x1)˚ (λx1. λx2. x2) (5.82)

(indeed the two terms are contextually equivalent). This can be shown byappealing to the CIU-theorem and checking that

(s , λx1. λx2. (x1 ˚ x2)) #n ) (s , (λx1. λx2. x1)˚ (λx1. λx2. x2)) #n

(5.83)holds for all call-by-name frame stacks s. For if s D nil or s D []e :: nil,then the right-hand side of the implication in (5.83) holds. Whereas if s D

[]e1 :: []e2 :: s0 is a frame stack of length two or more, then the first threetransitions of each configuration are

(s , λx1. λx2. (x1 ˚ x2))!n !n (s0 , e1 ˚ e2)!n (s0 , ei)

(s , (λx1. λx2. x1)˚ (λx1. λx2. x2))!n (s , λx1. λx2. xi)!n !n(s0 , ei)

for i D 1, 2; and hence

([]e1 :: []e2 :: s0 , λx1. λx2. (x1 ˚ x2)) #n

) (s0 , e1) #n _ (s0 , e2) #n

) ([]e1 :: []e2 :: s0 , (λx1. λx2. x1)˚ (λx1. λx2. x2)) #n.

Remark 5.9.2 The relationship between the various call-by-name equivalencesconsidered in this section is:

('n) � (�n \�opn ) � (Dn) D (Dciu

n ).

The first inclusion is a consequence of the definition of applicative(bi)similarity; it is proper because of Example 5.7.1 (which works the same forcall-by-name as for call-by-value). The second inclusion is a corollary of thecompatibility property for �n; and Example 5.9.1 shows that it is strict.

Exercise 5.9.3 Show that unlike for call-by-name contextual equivalence,the terms λx1. λx2. (x1 ˚ x2) and (λx1. λx2. x1)˚ (λx1. λx2. x2) are not call-by-value contextually equivalent. [Hint: consider the call-by-value evaluationbehaviour of t(λx1. λx2. (x1 ˚ x2)) and t((λx1. λx2. x1)˚ (λx1. λx2. x2)), where

tdefD λz. z z v2 v2 v1 v1 with v1 and v2 as in Example 5.7.1.]

Page 245: advanced topics in biosimulation and coinduction

Howe’s method for higher-order languages 229

5.10 Summary

Having seen Howe’s method in action in a few different settings, let us sum-marise what it involves.

(1) One has a notion R of program equivalence or preordering that one wishesto show is compatible with the constructs of the programming language:

P1 R P2 ) C[P1] R C[P2].

Higher-order features of the language make a direct proof difficult, oftenbecause any proof of compatibility requires a proof of a closely relatedsubstitutivity property

P1 R P2 ) P fP1/xg R P fP2/xg

(maybe with some restriction as to what P1 and P2 range over).(2) Howe’s precongruence candidate construction builds a relation RH that is

easily seen to have the required compatibility and substitutivity properties.In the case when R is a preorder, we get the desired properties of R byshowingR D RH . In the case whenR is an equivalence, we get the desiredproperties of R by showing that it is equal to the transitive closure (RH )C

of the precongruence candidate. (Use of transitive closure overcomes theinherent asymmetry in the definition of RH .)

(3) The key step in proving R D RH or R D (RH )C is to show that RH

is contained in R. This involves a delicate proof by induction over theoperational semantics of programs.

5.11 Assessment

Howe’s method was originally developed to prove congruence propertiesof bisimilarities for untyped functional languages. The method has sincebeen successfully applied to bisimilarities for higher-order languages withtypes [Gor95, Pit97b], objects [Gor98], local state [JR99] and concurrent com-munication [FHJ98, Bal98, GH05].

The transfer of the method from functions to process calculi has highlighteda couple of drawbacks of Howe’s method, the first more important than thesecond.

First, the operational semantics of processes is usually specified in termsof transitions labelled with actions, rather than in terms of evaluation tocanonical form. Evaluation-based applicative bisimilarities correspond totransition-based delay bisimilarities in which externally observable actions

Page 246: advanced topics in biosimulation and coinduction

230 Andrew Pitts

are matched by actions preceded by a number of internal (‘silent’) actions;see [San12, chapter 4]. Howe’s method works well for proving congruenceproperties for such delay bisimilarities; but it does not appear to work forthe more common weak bisimilarities in which externally observable actionsare matched by actions both preceded and followed by a number of inter-nal actions. For these reasons Jeffrey and Rathke [JR00] advocate replacingHowe’s method with the use of Sangiorgi’s trigger semantics from the higher-order π -calculus [San96]; see also [JR05, appendix A]. Another more recentapproach uses the notion of environment bisimulation introduced by Sangiorgi,Kobayashi and Sumii [SKS07, Sum09], who show how to obtain congruence(and ‘bisimilarity up to’) results for higher-order languages without the needto invoke Howe’s method.

Secondly, the induction proof in step (3) of the method (that is, ‘key lemmas’like Lemma 5.7.2) relies heavily on the syntax-directed nature of the definitionof the precongruence candidate RH ; this does not interact well with a quo-tient by a structural congruence that sometimes forms part of the operationalsemantics of processes; see [PR98], for example.

Despite these caveats, Howe’s method is unusually robust compared withmany techniques based on operational semantics, witnessed by the fact that itcan be applied to prove congruence properties for a variety of different formsof program equivalence. We believe it deserves a place in the semanticist’stool kit.

Bibliography

[Abr90] S. Abramsky. The lazy λ-calculus. In D.A. Turner, editor, Research Topicsin Functional Programming, chapter 4, pages 65–117. Addison Wesley,1990.

[Abr91] S. Abramsky. Domain theory in logical form. Annals of Pure and AppliedLogic, 51:1–77, 1991.

[Bal98] M. Baldamus. Semantics and logic of higher-order processes: Character-izing late context bisimulation. PhD thesis, Fachbereich 13 – Informatik,Technishen Universitat Berlin, 1998.

[CH07] K. Crary and R. Harper. Syntactic logical relations for polymorphic and recur-sive types. In L. Cardelli, M. Fiore, and G. Winskel, editors, Computation,Meaning and Logic, Articles dedicated to Gordon Plotkin, volume 172 ofElectronic Notes in Theoretical Computer Science, pages 259–299. Elsevier,2007.

[FH92] M. Felleisen and R. Hieb. The revised report on the syntactic theories ofsequential control and state. Theoretical Computer Science, 103:235–271,1992.

Page 247: advanced topics in biosimulation and coinduction

Howe’s method for higher-order languages 231

[FHJ98] W. Ferreira, M. Hennessy, and A. Jeffrey. A theory of weak bisimulation forcore CML. Journal of Functional Programming, 8(5):447–491, 1998.

[GH05] J.C. Godskesen and T. Hildebrandt. Extending Howe’s method to early bisim-ulations for typed mobile embedded resources with local names. In FSTTCS2005: Foundations of Software Technology and Theoretical Computer Sci-ence 25th International Conference, Hyderabad, India, December 15–18,2005. Proceedings, volume 3821 of Lecture Notes in Computer Science,pages 140–151. Springer, 2005.

[Gor95] A.D. Gordon. Bisimilarity as a theory of functional programming. In EleventhConference on the Mathematical Foundations of Programming Semantics,New Orleans, 1995, volume 1 of Electronic Notes in Theoretical ComputerScience. Elsevier, 1995.

[Gor98] A.D. Gordon. Operational equivalences for untyped and polymorphic objectcalculi. In Gordon and Pitts [GP98], pages 9–54.

[GP98] A.D. Gordon and A.M. Pitts, editors. Higher Order Operational Techniquesin Semantics. Cambridge University Press, 1998.

[How89] D.J. Howe. Equality in lazy computation systems. In 4th Annual Symposiumon Logic in Computer Science, pages 198–203. IEEE Computer Society Press,1989.

[How96] D.J. Howe. Proving congruence of bisimulation in functional programminglanguages. Information and Computation, 124(2):103–112, 1996.

[JR99] A. Jeffrey and J. Rathke. Towards a theory of bisimulation for local names. In14th Annual Symposium on Logic in Computer Science, pages 56–66. IEEEComputer Society Press, 1999.

[JR00] A. Jeffrey and J. Rathke. A theory of bisimulation for a fragment of concurrentML with local names. In Proceedings of the 15th Annual Symposium onLogic in Computer Science, pages 311–321. IEEE Computer Society Press,2000.

[JR05] A. Jeffrey and J. Rathke. Contextual equivalence for higher-order π -calculusrevisited. Logical Methods in Computer Science, 1:(1), April 2005.

[Las98a] S.B. Lassen. Relational reasoning about contexts. In Gordon and Pitts [GP98],pages 91–135.

[Las98b] S.B. Lassen. Relational reasoning about functions and nondeterminism. PhDthesis, Department of Computer Science, University of Aarhus, 1998.

[Mil77] R. Milner. Fully abstract models of typed lambda-calculi. Theoretical Com-puter Science, 4:1–22, 1977.

[Mil89] R. Milner. Communication and Concurrency. Prentice Hall, 1989.[Mor69] J. Morris. Lambda calculus models of programming languages. PhD thesis,

MIT, 1969.[MT91] I.A. Mason and C.L. Talcott. Equivalence in functional languages with effects.

Journal of Functional Programming, 1:287–327, 1991.[MT92] I.A. Mason and C.L. Talcott. Inferring the equivalence of functional programs

that mutate data. Theoretical Computer Science, 105:167–215, 1992.[Pie02] B.C. Pierce. Types and Programming Languages. MIT Press, 2002.

[Pit97a] A.M. Pitts. A note on logical relations between semantics and syntax. LogicJournal of the Interest Group in Pure and Applied Logics, 5(4):589–601,1997.

Page 248: advanced topics in biosimulation and coinduction

232 Andrew Pitts

[Pit97b] A.M. Pitts. Operationally-based theories of program equivalence. In P. Dybjerand A.M. Pitts, editors, Semantics and Logics of Computation, Publicationsof the Newton Institute, pages 241–298. Cambridge University Press, 1997.

[Pit02] A.M. Pitts. Operational semantics and program equivalence. In G. Barthe,P. Dybjer, and J. Saraiva, editors, Applied Semantics, Advanced Lectures,volume 2395 of Lecture Notes in Computer Science, Tutorial, pages 378–412. Springer, 2002. International Summer School, APPSEM 2000, Caminha,Portugal, September 9–15, 2000.

[PR98] A.M. Pitts and J.R.X. Ross. Process calculus based upon evaluation to com-mitted form. Theoretical Computer Science, 195:155–182, 1998.

[PS08] A.M. Pitts and M.R. Shinwell. Generative unbinding of names. Logical Meth-ods in Computer Science, 4(1:4):1–33, 2008.

[San96] D. Sangiorgi. Bisimulation for higher-order process calculi. Information andComputation, 131(2):141–178, 1996.

[San12] D. Sangiorgi. An Introduction to Bisimulation and Coinduction. CambridgeUniversity Press, 2012.

[SKS07] D. Sangiorgi, N. Kobayashi, and E. Sumii. Environmental bisimulations forhigher-order languages. In Twenty-Second Annual IEEE Symposium on LogicIn Computer Science (LICS’07), pages 293–302. IEEE Computer SocietyPress, July 2007.

[Sum09] E. Sumii. A complete characterization of observational equivalence in poly-morphic lambda-calculus with general references. In Computer ScienceLogic, Proceedings of 18th EACSL Annual Conference (CSL 2009), volume5771 of Lecture Notes in Computer Science, pages 455–469 Springer, 2009.

[Win93] G. Winskel. The Formal Semantics of Programming Languages. Foundationsof Computing. The MIT Press, 1993.

Page 249: advanced topics in biosimulation and coinduction

6

Enhancements of the bisimulation proof method

damien pous and davide sangiorgi

One of the main reasons for the success of bisimilarity is the strength ofthe associated proof method. We discuss here the method on processes, moreprecisely, on Labelled Transition Systems (LTSs). However the reader shouldbear in mind that the bisimulation concept has applications in many areasbeyond concurrency [San12]. According to the proof method, to establish thattwo processes are bisimilar it suffices to find a relation on processes thatcontains the given pair and that is a bisimulation. Being a bisimulation meansthat related processes can match each other’s transitions so that the derivativesare again related.

In general, when two processes are bisimilar there may be many relationscontaining the pair, including the bisimilarity relation, defined as the union ofall bisimulations. However, the amount of work needed to prove that a relationis a bisimulation depends on its size, since there are transition diagrams to checkfor each pair. It is therefore important to use relations as small as possible.

In this chapter we show that the bisimulation proof method can be enhanced,by employing relations called ‘bisimulations up to’. These relations need not bebisimulations; they are just contained in a bisimulation. The proof that a relationis a ‘bisimulation up to’ follows diagram-chasing arguments similar to thosein bisimulation proofs. The reason why ‘bisimulations up to’ are interesting isthat they can be substantially smaller than any enclosing bisimulation; hencethey may entail much less work in proofs. Sometimes the benefits of theseup-to techniques are spectacular. A ‘bisimulation up to’ can be finite – evena singleton – whereas any enclosing bisimulation is infinite. Sometimes itmay be hard even to define an enclosing bisimulation, let alone carry outthe whole proof. In certain languages, e.g. languages for mobility such as π -calculus or higher-order languages such as Higher-Order π -calculus [SW01] orAmbients [MN05], the enhancements seem essential to obtain any non-trivialbisimilarity result.

233

Page 250: advanced topics in biosimulation and coinduction

234 Damien Pous and Davide Sangiorgi

Many enhancements have been studied in the literature, usually referredto as up-to techniques. In this chapter, we focus on those that are most fun-damental, in that they are very common and can be used on a broad spec-trum of languages. Other enhancements exist that exploit peculiarities in thedefinition of bisimilarity on certain classes of languages. For instance, inname-passing languages such as π -calculus the bisimulation clauses makeuse of name substitutions, and then up-to-injective-substitution techniquesare heavily employed [BS98a, JR99, SW01]. In languages with informationhiding mechanisms (e.g. existential types, encryption and decryption con-structs [AG98, SP07b, SP07a]) or in higher-order languages [Las98, KW06],bisimulation relations are usually enriched with an environment that collects theobserver knowledge on the values exchanged with the processes. The appear-ance of environments brings up several forms of up-to techniques for manip-ulating them: e.g. techniques for shrinking or enlarging the environment, andtechniques for replacing information in the environment (based, for instance,on subtyping) [SKS07].

The theory of enhancements presented here allows one to derive complexup-to techniques algebraically, by composing simpler techniques by means ofa few operators. This is a general theory: while all examples in the chapterdeal with processes and bisimulation, the heart of the theory is presented onfixed-point theory, and is therefore applicable to coinductive objects otherthan bisimilarity. In particular, the theory can be applied to languages whosetransition semantics features more sophisticated LTSs than the plain CCS-likeLTS used in this chapter (e.g. value passing LTSs), and can be extended toenhancements not examined in this chapter.

A special place in the chapter is occupied by weak bisimilarity. Indeed,the basic theory of weak bisimilarity presents some delicate aspects (e.g.the congruence properties) [San12], and these differences over strong bisim-ilarity are magnified in theories of enhancements of the bisimulation proofmethod.

Outline of the chapter Section 6.1 details the motivations for studyingenhancements of the bisimulation proof method; concrete examples of enhance-ments are presented in Section 6.2. Section 6.3 introduces a general theory ofenhancements. Section 6.4 focuses on a particular form of enhancements, called‘up-to-context’, which is important when the language of processes is definedfrom a grammar. Section 6.5 treats weak bisimilarity. Section 6.6 gives a sum-mary of the main up-to techniques for strong and weak bisimulation discussedin the chapter.

Solutions to most of the exercises can be found from the Web page for thebook given in the preface.

Page 251: advanced topics in biosimulation and coinduction

Enhancements of the bisimulation proof method 235

Notation We write id for the identity function, and f ı g for the composition

of two functions f and g: (f ı g)(x)defD f (g(x)). We also use the notation

x 7! f (x) to define functions. Given a function f and a natural number n,

we define f n, the n-th iteration of f , by induction on n thus: f 0 defD id and

f nC1 defD f ı f n.

We let R,S range over binary relations on processes; we often use the infixnotation for relations: P R Q means (P,Q) 2 R; the notation is extendedpointwise to vectors, i.e. P R Q holds if P and Q are vectors of the samelength and componentwise related by R. The union of relations R and S isR [ S, their intersection is R \ S, and their composition is RS (i.e. P RS P 0

holds if P R Q and Q S P 0 for some process Q). We write I for the identityrelation. Like for functions, we define the n-th iteration of a relation R by

induction on the natural number n thus: R0 is the identity, and RnC1 defD RRn.

We moreover write:

� RD for the reflexive closure of R: the smallest reflexive relation that containsR, defined as R [ I;

� RC for the transitive closure ofR: the smallest transitive relation that containsR, defined as

⋃n>0 Rn;

� R for the reflexive and transitive closure of R: the smallest relation that isreflexive and transitive and contains R, defined as

⋃n�0 Rn.

We write R � S for the (set-theoretic) inclusion of relations, whereby R � Sif P R Q entails P S Q, for all P,Q.

We extend these operations to functions over relations in the expectedmanner, e.g. if f, g are two functions, then f \ g denotes the functionR 7! f (R) \ g(R), and f � g means that f (R) � g(R) for all R. We finallydenote by f ω the iteration of a function f over relations, defined as

⋃n f n.

6.1 The need for enhancements

6.1.1 The bisimulation game

We recall the definition of bisimilarity, from [San12]:

Definition 6.1.1 (Bisimulation, bisimilarity) A binary relationR is a bisimu-lation if for all processes P,Q such that P R Q, and for all labels μ, we have:

� for all P 0 with Pμ�! P 0, there exists Q0 such that P 0 R Q0 and Q

μ�! Q0;

� the converse on the transitions emanating from Q, i.e. for all Q0 with Qμ�!

Q0, there exists P 0 such that P 0 R Q0 and Pμ�! P 0.

Page 252: advanced topics in biosimulation and coinduction

236 Damien Pous and Davide Sangiorgi

Bisimilarity (�) is the union of all bisimulations: P � Q if there exists somebisimulation relation R such that P R Q. �

We sometimes call bisimilarity strong bisimilarity (and accordingly, a bisimula-tion a strong bisimulation), as in this chapter we also consider weak bisimilarity(and weak bisimulations).

The bisimulation clauses can be pictorially represented thus:

P

μ

R Q

μ

P 0 R Q0

In clause (1), the diagram should be read from left to right, with a universalquantification in front of P 0, and an existential one in front of Q0; converselyfor clause (2).

Bisimilarity is an equivalence relation. Moreover, bisimilarity itself is abisimulation and hence it is the largest bisimulation [San12].

6.1.2 Tracking redundancies

In the two clauses of Definition 6.1.1, the same relation R is mentioned in thehypothesis and in the thesis. In other words, when we check the bisimilarityclause on a pair (P,Q), all needed pairs of derivatives, like (P 0,Q0), mustbe present in R. We cannot discard any such pair of derivatives from R, oreven ‘manipulate’ its process components. In this way, a bisimulation relationoften contains many pairs strongly related with each other, in the sense that,at least, the bisimilarity between the processes in some of these pairs impliesthat between the processes in other pairs. For instance, in a process algebra,a bisimulation relation might contain pairs of processes obtainable from otherpairs through application of algebraic laws for bisimilarity, or obtainable ascombinations of other pairs and of the operators of the language. These redun-dancies can make both the definition and the verification of a bisimulationrelation annoyingly heavy and tedious: it is difficult at the beginning to guessall pairs that are needed; and the bisimulation clauses must be checked on allpairs introduced.

As an example, consider the language defined in Figure 6.1. It is the sameCCS language used in [San12], except that replication replaces recursivelydefined constants. We recall from [San12] that: a is a name, a is a coname, thesets of names and conames are disjoint and do not contain the special action τ ,

Page 253: advanced topics in biosimulation and coinduction

Enhancements of the bisimulation proof method 237

Actions μ ::D a j a j τ

Processes P,Q ::D 0 j P j P j P C P j μ. P j (νa)P j !P

Pμ�! P 0

P j Qμ�! P 0 j Q

Qμ�! Q0

P j Qμ�! P j Q0

Pμ�! P 0 Q

μ�! Q0

P j Qτ�! P 0 j Q0

Pμ�! P 0

P CQμ�! P 0

Qμ�! Q0

P CQμ�! Q0

μ. Pμ�! P

Pμ�! P 0

(νa)Pμ�! (νa)P 0

μ 6D a, a!P j P

μ�! P 0

!Pμ�! P 0

Fig. 6.1. The calculus of communicating systems (CCS).

and processes are ranged over by P,Q. By convention, a D a, and a trailing 0is often omitted, for instance abbreviating a. 0C b. 0 as a C b.

The replication of P , written !P , intuitively represents

P j P j . . . j P j . . .

i.e. an infinite parallel composition of copies of P . In certain process cal-culi, such as π -calculus, replication is the only form of recursion allowed,since it gives enough expressive power and enjoys interesting algebraic prop-erties [SW01]. In Figure 6.1, as rule for replication, one may have expected thesimpler

Pμ�! P 0

!Pμ�! !P j P 0

.

This rule is, however, troublesome in the presence of the sum operator, as itwould not allow us to derive τ -transitions from processes such as !(a. P Ca. Q) [SW01].

Exercise 6.1.2 Which bisimulation can be used to prove !P j P � !P ? �

Exercise 6.1.3 Suppose that !Pμ�! P0.

(1) Show that, if μ 6D τ , then P0 D ((((((!P j P ) . . . ) j P ) j P 0) j P ) . . . ) j P ,

for some P 0 such that Pμ�! P 0. What happens if μ D τ?

Page 254: advanced topics in biosimulation and coinduction

238 Damien Pous and Davide Sangiorgi

(2) Use the monoidal commutative laws of bisimilarity for parallel composition(laws stating that j is commutative, associative, and admits 0 as neutralelement) and the law !P j P � !P from the previous exercise to obtain amore concise characterisation of P0 modulo bisimilarity, namely:� either P0 � !P j P 0, for some P 0 with P

μ�! P 0,

� or μ D τ and P0 � !P j P 0 j P 00 for some P 0, P 00 and a with Pa�! P 0

and Pa�! P 0. �

Exercise 6.1.3 brings up the usefulness of bisimilarity laws when reasoningon process transitions. Enhancements of the bisimulation proof method, theup-to techniques, allow us to exploit such laws, as well as other means ofmanipulating the derivatives of process transitions. To illustrate this, supposewe wish to prove !(a C b) � !a j !b. Intuitively, the two processes are bisimilarbecause they both provide an infinite amount of a and b transitions, in anyorder. If we look for a bisimulation candidate, we may consider the followingsingleton relation as a candidate:

R0defD f(!(a C b), !a j !b)g .

Unfortunately, R0 is not a bisimulation. Indeed, for each n,m 0, writingP n for the parallel composition of n copies of P , we have the following a-transitions:

!(a C b)a�! !(a C b) j (a C b)n j 0 j (a C b)m

!a j !ba�! !a j an j 0 j am j !b.

The corresponding derivatives are not related by R0. To obtain a bisimulation,we therefore have to add new pairs to R0; we may thus try, as a new candidate,

R1defD⋃

n,m,p,q

f(!(a C b) j (a C b)n j 0 j (a C b)m, !a j ap j 0 j aq j !b),

(!(a C b) j (a C b)n j 0 j (a C b)m, !a j !b j bp j 0 j bq)g.

However R1 is not a bisimulation either: by adding new pairs of processes,we have also added new challenges, which cannot be matched within R1. Forexample, in the pair ((!(a C b) j 0, !a j 0 j !b), the right-hand side has the

transition !a j 0 j !bb�! !a j 0 j !b j 0 and the derivative appears nowhere in

R1.While it is possible to define a bisimulation relation containing the initial

pair (!(a C b), !a j !b), the endeavour is much more tedious than what wasoriginally expected. We have to add a lot of ‘redundant pairs’ to the initialcandidate relation R0. We call the pairs redundant because they do not say

Page 255: advanced topics in biosimulation and coinduction

Enhancements of the bisimulation proof method 239

anything new as far as bisimilarity is concerned: they can be derived from theinitial R0 by means of a few basic bisimilarity laws. For instance, considerthe redundant pair (!(a C b) j 0, !a j 0 j !b); using the law Q j 0 � Q and thecongruence laws of bisimilarity, we have

!(a C b) � !(a C b) j 0

and

!a j !b � !a j 0 j !b.

Hence, by transitivity, !(a C b) � !a j !b implies !(a C b) j 0 � !a j 0 j !b. Inthis example, since the addition of redundant pairs is forced by the bisimulationproof method; the initial singleton relation R0 turns into an infinite one.

More generally, redundant pairs may make it difficult to guess what is thesmallest bisimulation relating two given processes. The resulting bisimilaritymay also be difficult to describe succinctly, so that the relation may be awkwardto work with.

6.2 Examples of enhancements

The objective of enhancements of the bisimulation proof method is to provebisimilarity results using relations smaller than bisimulations; that is, rela-tions in which some redundant pairs have been omitted. To write enhance-ments formally, we first introduce the notion of progression and set someterminology.

Definition 6.2.1 (Progression) Given two relations R and S, we say that Rprogresses to S, written R � S, if P R Q implies:

(1) whenever Pμ�! P 0, there exists Q0 such that Q

μ�! Q0 and P 0 S Q0;

(2) whenever Qμ�! Q0, there exists P 0 such that P

μ�! P 0 and P 0 S Q0. �

As for the bisimulation clauses, the two clauses of a progression may bedepicted as follows:

P

μ

R Q

μ

P 0 S Q0

When R and S coincide, the progression clauses are the ordinary clauses inthe definition of bisimulation:R � R iffR is a bisimulation. By ‘enhancement

Page 256: advanced topics in biosimulation and coinduction

240 Damien Pous and Davide Sangiorgi

of the bisimulation proof method’ we refer to a technique that, for a givenrelation R, allows us to infer R � � from a progression

R � R [ fsome redundant pairsg .

That is, in a diagram-chasing we allow the derivative processes to belong to arelation larger than the original one.

The enhancements relieve the work involved with the bisimulation proofmethod in several ways: first, they make it easier to complete a diagram-chasing; second, they make it possible to work with smaller relations, so thatthere are fewer diagrams to check; third, they may make it simpler to definesuch a relation.

The enhancements are called up-to techniques, because the relationsemployed are bisimulations up to a certain set of redundant pairs. Beforedeveloping a theory of enhancements in Section 6.3, we present some exam-ples.

6.2.1 Diagram-based enhancements

Some up-to techniques were proposed shortly after the discovery of bisim-ulation. The best-known example is Milner’s bisimulation up to bisimilaritytechnique [Mil89], in which bisimilarity can be used to rewrite the derivativesobtained when playing bisimulation games.

Definition 6.2.2 (Bisimulation up to bisimilarity) A relation R is a bisimu-lation up to � if R � �R�; that is, whenever P R Q, we have:

(1) for all P 0 with Pμ�! P 0, there exist P 00,Q0, and Q00 such that P 0 � P 00,

Qμ�! Q0, Q0 � Q00, and P 00 R Q00;

(2) the converse, on the transitions emanating from Q. �

A bisimulation up to bisimilarity is not, in general, a bisimulation: thedefinition only requires that matching derivatives are bisimilar to processesin the relation. However, if R is a bisimulation up to bisimilarity, then R iscontained in bisimilarity. Intuitively, the technique is sound because bisimilarityis transitive; hence, in clause (1), from the bisimilarity between the processesP 00 and Q00 we can also infer the bisimilarity between the derivatives P 0 andQ0. This is indeed true for bisimilarity. However, in other formulations ofbisimilarity, as we shall see, transitivity does not ensure the soundness of thetechnique.

Page 257: advanced topics in biosimulation and coinduction

Enhancements of the bisimulation proof method 241

Lemma 6.2.3 The up-to-bisimilarity technique is sound; that is, if R is abisimulation up to bisimilarity, then R � �.

Proof If R is a bisimulation up to bisimilarity then �R� (the compositionof the three relations) is a bisimulation and �R� � �. Since � contains theidentity relation, we also have R � �R� which allows us to conclude. �

The technique is often used to reason modulo some bisimilarity laws. For

instance, the singleton relation R0defD f(!(a C b), !a j !b)g of the example in

Section 6.1.2 is a bisimulation up to bisimilarity; we can prove this by reasoningas in Exercise 6.1.3; we rearrange derivatives using the commutative monoidallaws of parallel composition and the law !P j P � !P , as in this diagram:

!(aC b)

a

BB//////

//////

/R0 !a j !b

a

CC0000

0000

0

!(aC b) j (aC b)n j 0 j (aC b)m � !(aC b) R0 !a j !b � !a j ap j 0 j aq j !b

Exercise 6.2.4 Prove !!a � !a using a singleton relation. �

An even simpler enhancement gives us the ability to rely on known equalities.

Definition 6.2.5 (Bisimulation up to [) A relation R is a bisimulation up-to[ if R � R [� . �

The validity of this technique goes by showing that R [� is a bisimulation.For a very simple example, the technique allows us to prove a j a � a. a usinga singleton relation, assuming we already have proved a j 0 � a:

a j a

a

R a. a

a

a j 0 � a

Yet another possibility is to work modulo transitivity.

Definition 6.2.6 (Bisimulation up to reflexive and transitive closure) Arelation R is a bisimulation up to reflexive and transitive closure if R � R .

Exercise 6.2.7 Prove that if R is a bisimulation up to reflexive and transitiveclosure, then R is a bisimulation. �

Page 258: advanced topics in biosimulation and coinduction

242 Damien Pous and Davide Sangiorgi

6.2.2 Context-based enhancements

A different form of enhancement is the up-to-context technique [San98, San93,BS98b], that allows us to cut a common context in matching derivatives. Thisof course applies only when the class of processes is defined from a grammar,so that the notion of context (a process expression with a single occurrence ofa hole [] in it, as a subexpression) makes sense. If C is a context and R is aprocess, then C[R] is the process obtained by replacing the hole of C with R. InCCS, up-to-context is defined using the following function, acting on relationson processes:

C : R 7! f(C[P ], C[Q]) j C is a context and P R Qg.

Definition 6.2.8 (Bisimulation up to context) A relation R is a bisimulationup to context if R � C(R). That is, whenever P R Q, we have:

(1) for all P 0 with Pμ�! P 0, there are processes P0 and Q0 and a context C

such that P 0 D C[P0], Qμ�! C[Q0], and P0 R Q0;

(2) the converse, on the transitions emanating from Q. �

Pictorially, the diagram-chasing in up-to-context is:

DD111111111

R Qμ

EE"""

""""

""

P 0 D C[P0] C(R) C[Q0] D Q0

P0 R Q0

The technique would seem sound whenever bisimilarity is substitutive (i.e.preserved by contexts): from the bisimilarity between P0 and Q0 we can inferthat the derivatives P 0 D C[P0] and Q0 D C[Q0] are bisimilar. The techniqueis indeed sound in CCS, where bisimilarity is substitutive; however, as wediscuss in Section 6.2.5, the connection between substitutivity of a bisimilarityand soundness of the associated up-to-context technique is a delicate issue.

Lemma 6.2.9 In CCS, the up-to-context technique is sound.

Proof See Section 6.4. �

Exercise� 6.2.10 Prove Lemma 6.2.9 in the replication-free fragment of CCS.(Hint: show that C(R) is a bisimulation whenever R � C(R).) �

The technique can be generalised to polyadic contexts; i.e. contexts thatmay contain an arbitrary number of different holes []1, . . . , []n, and, more-over, each of these holes may appear more than once. In this case, in the

Page 259: advanced topics in biosimulation and coinduction

Enhancements of the bisimulation proof method 243

bisimulation clause a common context is applied to pointwise related vectors(i.e. in Definition 6.2.8(1), there are P0 and Q0 and C such that P 0 D C[P0],

Qμ�! Q0, Q0 D C[Q0], and P0 R Q0). Examples of applications of the tech-

nique are presented in Section 6.2.4.

6.2.3 Combining enhancements

It can be useful to compose different techniques to obtain more powerfulenhancements. For instance, we may want to combine up-to-bisimilarity andup-to-context.

Definition 6.2.11 (Bisimulation up to bisimilarty and up to context) Arelation R is a bisimulation up to � and up to context if R � �C(R)�; thatis, whenever P R Q, we have:

(1) for all P 0 with Pμ�! P 0, there are processes Q0, P0 and Q0 and a context

C such that P 0 � C[P0], Qμ�! Q0, Q0 � C[Q0], and P0 R Q0;

(2) the converse, on the transitions emanating from Q. �

Intuitively, the technique is sound because bisimilarity is substitutive andtransitive; hence, in clause (1), from the bisimilarity between P0 and Q0 wecan infer, using substitutivity, that between C[P0] and C[Q0] and then, usingtransitivity, also that between the derivatives P 0 and Q0. We shall see howeverin Section 6.2.5 that in certain languages, and for certain forms of bisimilar-ity, transitivity and substitutivity are not sufficient for the soundness of thetechnique.

We study how to derive the soundness of a composite technique from thesoundness of the component techniques in Section 6.3. Without this theory, thesoundness of a composite technique has to be proved from scratch.

Lemma 6.2.12 In CCS, the up-to-bisimilarity-and-context technique is sound.

Proof See Section 6.3, in particular Proposition 6.3.11. �

Exercise� 6.2.13 Prove Lemma 6.2.12 in the replication-free fragment ofCCS, with monadic contexts. (Hint: show that� C(R) � is a bisimulation, anduse the congruence properties of bisimilarity.) �

Up-to-bisimilarity-and-context can be handy to reason about replications.We give an example here, which is a refinement of the example in Section 6.1.2.Other examples may be found in Section 6.2.4.2.

Lemma 6.2.14 In CCS, we have !(a. P C b. Q) � !a. P j !b. Q.

Page 260: advanced topics in biosimulation and coinduction

244 Damien Pous and Davide Sangiorgi

Proof We prove that the singleton relation R0defD f(!(a. P C b. Q), !a. P j

!b. Q)g is a bisimulation up to bisimilarity and context.

Consider a transition along a from the left-hand side: !(a. P C b. Q)a�! P0.

By Exercise 6.1.3, we have P0 � !(a. P C b. Q) j P . The right-hand side

can answer with !a. P j !b. Qa�! Q0 D (!a. P j P ) j !b. Q, and then Q0 �

(!a. P j !b. Q) j P using associativity and commutativity of parallel compo-sition. Thanks to the up-to-context technique, we can then remove the commonparallel context, [] j P , to recover the pair from R0:

!(a. P C b. Q)a

FF222222

222222

R0 !a. P C !b. Qa

::33333

333333

P0 � !(a. P C b. Q) j P C(R0) (!a. P j !b. Q) j P � Q0

!(a. P C b. Q) R0 !a. P j !b. Q

Challenges along b, and from the right-hand side, are handled similarly. �

6.2.4 Other examples of applications

6.2.4.1 Unique solutions of equationsWe apply the previous up-to techniques to prove a useful result of CCS: unique-ness of solutions of equations. This result says that if a context C obeys certainconditions, then all processes P that satisfy the equation P � C[P ] are bisim-ilar with each other.

We say that a polyadic context C is weakly guarded if each occurrence ofeach hole of C is within some subexpression of the form μ. C0. For instance,a. [] is weakly guarded, but [] j a. [] is not. The transitions performed byweakly guarded contexts are easy to analyse:

Lemma 6.2.15 If C is weakly guarded and C[P ]μ�! P 0, then there exists a

context C0 such that P 0 D C0[P ] and for all Q, C[Q]μ�! C0[Q].

Proof Simple induction on the structure of C. Intuitively, since C is weaklyguarded, the processes that fill the holes of C do not contribute to the firstproduced action. �

Theorem 6.2.16 (Unique solution of equations in CCS) Let C1, . . . , Cn beweakly guarded contexts, and let P , Q be processes such that, for all 1 � i � n,Pi � Ci[P ] and Qi � Ci[Q] (where Pi and Qi , respectively, denote the i-thcomponent of vectors P and Q). Then P � Q.

Page 261: advanced topics in biosimulation and coinduction

Enhancements of the bisimulation proof method 245

Proof Define the following finite relation:

R defD f(Pi,Qi) j 1 � i � ng,

and suppose Pi

μ�! P 0i (the case of a move from Qi is symmetric). From

Pi � Ci[P ], we deduce that there is some P 00i such that Ci[P ]μ�! P 00i and

P 0i � P 00i . Using Lemma 6.2.15, we have P 00i D C0i [P ] for some context C0i ,

and Ci[Q]μ�! C0i [Q]. Since Qi � Ci[Q] we finally get Q0i such that Qi

μ�! Q0i

and C0i [Q] � Q0i . This allows us to close the diagram, as depicted below:

Pi

μ

R

� Ci[P ]

μ

Ci[Q]

μ

� Qi

μ

P 0i � C0i [P ] C(R) C0i [Q] � Q0i

Therefore, R is a bisimulation up to bisimilarity and up to context and we aredone, by Lemma 6.2.12. �

In the proof of Theorem 6.2.16, the cardinality of the relation R is the sameas the cardinality of the vector of given contexts C. In particular, if we aredealing with only one context (i.e. only one equation), then R consists of onlyone pair. Without the help of up-to techniques the above result would be harder.Using only the up-to-bisimilarity technique, one would need to work with arelation including at least all pairs of the form (C[P ], C[Q]), where C can beany context, possibly unguarded. Dealing with these pairs is more complex, forwe cannot appeal to Lemma 6.2.15.

6.2.4.2 Replication lawsWe now apply the up-to-context technique to the proof of laws involving thereplication operator.

Lemma 6.2.17 For all CCS processes P and Q, we have:

(1) !(P j Q) � !P j !Q;(2) !(P CQ) � !P j !Q;(3) !P j !P � !P ;(4) !!P � !P .

Proof We rely on the law !P j P � !P , from Exercise 6.1.2; and on the char-acterisation given in Exercise 6.1.3, about the transitions emanating from areplicated process.

Page 262: advanced topics in biosimulation and coinduction

246 Damien Pous and Davide Sangiorgi

(1) We show that the singleton relation R defD f(!(P j Q), !P j !Q)g is a

bisimulation up to bisimilarity and up to context. We first consider

the left-to-right part of the game: suppose that !(P j Q)μ�! A and find

some B such that !P j !Qμ�! B and A � C(R) � B. According to Exer-

cise 6.1.3, we have A � !(P j Q) j A0 for some A0 with P j Qμ�! A0 or

(P j Q) j (P j Q)μ�! A0 (when μ D τ ). In both cases, since !P j !Q �

!P j !Q j P j Q � !P j !Q j P j Q j P j Q, we deduce that there exists

some B such that !P j !Qμ�! B � !P j !Q j A0. This allows us to con-

clude: the up-to-context technique can be used to remove the parallelcontext [] j A0, so as to recover the pair from R:

!(P j Q)μ

GG4444444444

R !P j !Qμ

00555

5555

555

A � !(P j Q) j A0 C(R) !P j !Q j A0 � B

For the right-to-left part of the game, suppose that !P j !Qμ�! B. By

analysing the rules for the transitions of a parallel composition, together

with Exercise 6.1.3, we have B � !P j !Q j B 0 for some B 0 with Rμ�! B 0

and R in fP,Q,P j P,Q j Q,P j Qg. Suppose that R D P (the othercases are similar); since !(P j Q) � !(P j Q) j P j Q, we find A such that

!(P j Q)μ�! A � !(P j Q) j B 0 j Q, which allows us to close the diagram,

by adding an occurrence of Q on the right-hand side using the law !Q �!Q j Q, and removing the parallel context [] j B 0 j Q thanks to the up-to-context technique:

!(P j Q)

μ

HH666666

66666

R !P j !Q

μ

%%�����

������

����

A � !(P j Q) j B0 j Q C(R) !P j !Q j B0 j Q � !P j !Q j B0 � B

(2) Similar to the previous point.(3) We can proceed by algebraic reasoning: by using (2) and the fact that

P C P � P , we have:

!P j !P � !(P C P ) � !P .

(4) By (3) and Exercise 6.1.3, we obtain (†): !Pμ�! Q entails Q � !P j Q. We

exploit this property to show that the singleton relationR defD f(!!P, !P )g is a

bisimulation up to bisimilarity and up to context. We first consider the right-

to-left part of the bisimulation game: if !Pμ�! R, then !!P

μ�! !!P j R, and

Page 263: advanced topics in biosimulation and coinduction

Enhancements of the bisimulation proof method 247

we have to relate !!P j R and R by� C(R) �. By (†), we have R � !P j R,and the latter process can be related to !!P j R by removing the commonparallel context [] j R:

!!Pμ

���������

R !Pμ

33777777

!!P j R C(R) !P j R � R

For the left-to-right part of the game, if !!Pμ�! Q, then Q � !!P j R, by

Exercise 6.1.3, and there are two cases to consider:� either !P

μ�! R, and we can conclude like previously, since !!P j R C(R)

!P j R � R,� or μ D τ and !P j !P

τ�! R. Here, the interesting case is that of a

synchronisation: R D R1 j R2, !Pa�! R1, !P

a�! R2. By Exercise 6.1.3

we deduce !Pτ�!� !P j R, which allows to conclude, as in the above

case. �

Exercise 6.2.18 Complete the proof for assertion (2) of Lemma 6.2.17. �

Without the up-to-context technique, the bisimulation candidates in theproof of Lemma 6.2.17 would consist of pairs of processes with at least afurther component. For instance, the last one would become

R0 defD f(!!P j R, !P j R)g

(R0 progresses to � R0 �). Having R0 in place of R does not make theproof conceptually more difficult; it does make it more tedious, however:interactions with the additional process R have to be taken into account,with reasoning similar to that involved in the proof that bisimilarity is pre-served by parallel composition. This extra work is not problematic in a sim-ple setting like CCS; it can become a burden, however, in more involvedcalculi.

6.2.5 What is a redundant pair?

Before moving to Section 6.3, which is devoted to a general theory of enhance-ments, we come back to the notion of redundant pairs. We said that we wouldlike to infer R � � from a progression

R � R [ fsome redundant pairsg .

Page 264: advanced topics in biosimulation and coinduction

248 Damien Pous and Davide Sangiorgi

The intuition for redundant pairs that we gave at the end of Section 6.1.2 –a pair is redundant if it can be derived from the remaining pairs using lawsfor bisimilarity – is actually not quite right, in the sense that the condition isimportant but, in itself, not sufficient. For a simple counterexample, we consider

the relation R defD f(a. b, a. c)g. Since we have P � Q whenever a. P � a. Q,

the pair (b, c) should be redundant in R [ f(b, c)g. However, we have

R � R [ f(b, c)g ,

and yet a. b 6� a. c.Even for the techniques discussed in Section 6.2, stating when they are

sound (i.e. for which languages, for which forms of bisimilarity) is difficult.For instance, consider the up-to-bisimilarity-and-context technique. We hintedin Section 6.2 that its soundness would seem to derive from the transitivity andsubstitutivity of bisimilarity. Again, surprisingly, this condition alone is notsufficient. For a counterexample, we consider the simple process language

P ::D op(P ) j a. P j 0

where a. P is a CCS-like prefix, 0 is the inactive process and op is an operatorwhose behaviour is given by the right-hand side rule below:

a. Pa�! P

Pa�! P 0 P 0

a�! P 00

op(P )a�! P 00

.

That is, in order to release some action, op requires the release of two actionsfrom its argument. On this language, bisimilarity is transitive and preservedby all contexts (in fact, we can infer that bisimilarity is a congruence from thefact that the transition rules of the operators are in the xyft/tyft format [GV92]).Despite this, the up-to-bisimilarity-and-context technique is not sound. Con-

sider the non-bisimilar processes a and a. a, and the relation R defD f(a, a. a)g.

The following diagram

a

a

II888888888 R a. a

a

EE999

9999

999

0 � op(a) C(R) op(a. a) � a

shows that R � �C(R)� holds: R is a bisimulation up to bisimilarity and upto context. However, R is not contained in bisimilarity.

One can also find examples where the up-to-context technique alone is notsound, while bisimilarity is a congruence: consider the following language

Page 265: advanced topics in biosimulation and coinduction

Enhancements of the bisimulation proof method 249

(syntax and operational rules), where u and v are two constants.

P ::D 0 j 1 j h(P )P

u�! h(P ) h(0)

v�! 0

.

Since h(1) cannot perform a transition labelled by v, we have h(0) 6� h(1);hence also 0 6� 1. In fact, 0 is the only process that is bisimilar to 0, andone can easily prove that h(P ) � h(Q) whenever P � Q: bisimilarity is acongruence. However, the up-to-context technique is not sound: the singletonrelation f(0, 1)g is a bisimulation up to context.

The second rule of the example, for the operatorh, does not actually adhere tothe usual criteria for rules in Plotkin’s Structured Operational Semantics (SOS):the rule looks into the syntax of the argument of h, while only the transitionsof the argument should matter in a purely semantic rule. Indeed, Exercise 6.4.5shows that, when the rules of all the operators of a given language are purelysemantic, and a few other assumptions are met, then the up-to-context techniqueis sound. Yet, the general issue of the relationship between the substitutivityproperty of a bisimilarity and the soundness of the associated up-to-contexttechnique remains largely uncovered, particularly in languages with exchangeof values or higher-order features.

6.3 A theory of enhancements

To be able to use an enhancement we first have to prove its soundness. This canbe a difficult task, and this difficulty tends to increase as the technique itself, orthe language onto which it is applied, becomes more powerful or sophisticated.For instance, the proof of soundness of the technique called ‘bisimulationup to bisimilarity and up to context’ can be non-trivial. Indeed, it is quitechallenging if the language is higher order, meaning that terms of the languagecan be communicated. Moreover, depending on the considered language, therecan be many other forms of up-to techniques, for example, in languages withtypes [BS98a], security aspects [AG98, SP07a], or store [KW06], we may wishto use up-to-environment, up-to-weakening, up-to-subtyping, and so on.

This motivates the search for a general theory of enhancements that wouldallow us to understand what an enhancement is, how enhancements can be com-posed, and how to prove their soundness. We study such a theory in this section.

6.3.1 Bisimulations and bisimilarity as coinductive objects

As there are several variants of bisimulation, including strong, weak, andbranching bisimulation [San12], it is useful to define a generic framework

Page 266: advanced topics in biosimulation and coinduction

250 Damien Pous and Davide Sangiorgi

for enhancements. For this, we move to the abstract setting of coinduction,viewing coinductive objects such as bisimilarity as the greatest fixed points ofmonotone functions on complete lattices. We recall [San12] that a completelattice is a set equipped with a partial-order relation and with all joins (leastupper bounds) and meets (greatest lower bounds). The Fixed-point Theoremassures us that any monotone function on a complete lattice has a greatest fixedpoint, which is the join of all the post-fixed points.

In this chapter, the complete lattice will always be the set of all relations onprocesses; hence we use R,S to range over elements of the lattice, � for thepartial order in the lattice, and [ and \ for the join and meet constructs.

In [San12] we studied the characterisation of bisimilarity as the greatestfixed point of a monotone function (the functional of bisimilarity) over processrelations. The only difference between the functional for bisimilarity in [San12]and the function b below is the presence of clause (3). This clause is required bya technicality explained in Section 6.4 (Remark 6.4.2); it can safely be ignoredin the remainder of this section, as it does not affect the results presented here.

Definition 6.3.1 Let b be the following function over binary relations:

b : R 7! f (P,Q) j

(1) if Pμ�! P 0, then there exists Q0 s.t. Q

μ�! Q0 and P 0 R Q0; and

(2) if Qμ�! Q0, then there exists P 0 s.t. P

μ�! P 0 and P 0 R Q0; and

(3) P R Qg. �

Exercise 6.3.2 Show that R � b(S) iffR � S and R � S (Definition 6.2.1).�

In other words, using diagrams, R � b(S) iff R � S and the followingdiagram is satisfied:

P

μ

R Q

μ

P 0 S Q0

According to the above exercise the post-fixed points of b (that is, the rela-tions R such that R � b(R)) are exactly the bisimulation relations. Moreover,the function b is monotone, so that the fixed-point theorem ensures that it hasa greatest fixed point. This greatest fixed point is bisimilarity (�).

In the sequel, we present both ‘concrete’ results about (strong) bisimilarityobtained with function b above, and ‘abstract’ results about the coinductivetheory of an arbitrary monotone function. The concrete results are given in

Page 267: advanced topics in biosimulation and coinduction

Enhancements of the bisimulation proof method 251

terms of the function b above; in contrast, b indicates a generic monotonefunction. Accordingly, to have a terminology that drives the intuitions usingthe bisimulation point of view, we introduce the following synonyms for post-fixed points and greatest fixed points.

Definition 6.3.3 Let b be a monotone function on a complete lattice.

� We call b-simulation any post-fixed point of b: any R such that R � b(R).� We call b-similarity the greatest b-simulation:

gfp (b)defD⋃fR j R � b(R)g . �

Thus, b-simulations and b-similarity are the ordinary bisimulations andbisimilarity.

The same object may be the greatest fixed point of different functions. Inparticular, bisimilarity is the greatest fixed point of the bisimilarity functionalin [San12], of the function b above, and also of the following function b0, inwhich the second clause of b is replaced by a clause for ‘symmetry’:

b0 : R 7! f (P,Q) j

(1) if Pμ�! P 0, then there exists Q0 s.t. Q

μ�! Q0 and P 0 R Q0; and

(20) Q R P g.

Functions with the same greatest fixed point may however have different setsof post-fixed points, as the exercise below shows.

Exercise 6.3.4

(1) Show that all b0-simulations are b-simulations, and that the converse doesnot hold.

(2) Show that the symmetric closure of a b-simulation is a b0-simulation;conclude that b-similarity and b0-similarity coincide. �

Post-fixed points are used to define the coinduction proof method. Hencea difference between two functions on the post-fixed points is relevant. Com-paring b and b0, for instance, one may prefer b because it has a larger setof post-fixed points (there are more b-simulations than b0-simulations, Exer-cise 6.3.4(1)). On the other hand, the proof obligations for b0 seem milder (onlyone clause involves transitions). In practice, the difference between b and b0 isirrelevant, as Exercise 6.3.4(2) reveals. We shall see however that the theoryof enhancements allows us to obtain other functions whose greatest fixed pointis still bisimilarity and whose post-fixed points are significantly easier to workwith than those of b or b0.

Page 268: advanced topics in biosimulation and coinduction

252 Damien Pous and Davide Sangiorgi

6.3.2 Enhancements as functions

Definition 6.3.5 A function f is extensive if R � f (R), for all R. �

All examples of enhancements in Section 6.2 could be expressed in termsof extensive functions f on relations for which R � f (R) entails R � �. Forinstance, ‘up-to-bisimilarity’ is the function that maps a relation R onto�R�,and ‘up-to-context’ is the functionC. To understand these functions, we examinetheir effect on the function b for bisimilarity: by Exercise 6.3.2, we haveR � f (R) iff R � b(f (R), i.e. iff R is a (b ı f )-simulation. Therefore, f

corresponds to a ‘valid’ up-to technique if all (b ı f )-simulations are containedin bisimilarity, gfp (b). Since gfp (b ı f ) is the largest (b ı f )-simulation, weobtain the following formulation of up-to techniques.

Definition 6.3.6 (Simulation up to, soundness) Let b, f be two monotonefunctions.

� A b-simulation up to f is a (b ı f )-simulation.� The function f is b-sound if gfp (b ı f ) � gfp (b). �

In other words, f is b-sound if all b-simulations up to f are contained inb-similarity, so that f can safely be used as an up-to technique for b. Moreover,in the concrete case of the function b for bisimilarity, while a b-simulation isa relation satisfying the left-hand side diagram below, a b-simulation up to f

is a relation satisfying the right-hand side diagram. If R is smaller than f (R),we may hope that the right-hand side diagram entails less work in proofs.

P

μ

R Q

μ

P 0 R Q0

P

μ

R Q

μ

P 0 f (R) Q0

According to Definition 6.3.6, Lemmas 6.2.3 and 6.2.9, respectively, assert thatthe functions R 7! �R� and C are b-sound. As outlined above, we use twoclasses of functions in the chapter:

� functions, like b, that generate an interesting greatest fixed point (e.g. bisim-ilarity);

� functions like R 7! �R� or C that are used as up to techniques so as toenhance the coinductive proof method for the functions in the first class.

We use b to range over the functions in the first class, and f, g over the functionsin the second class. The functions in the second class, unlike those in the first,are usually extensive.

Page 269: advanced topics in biosimulation and coinduction

Enhancements of the bisimulation proof method 253

6.3.3 Compositionality problems

In some of the examples from Section 6.2, we needed different up-to tech-niques at the same time. For instance, in Lemmas 6.2.14 and 6.2.17, we used acombination of up to contexts and up to bisimilarity.

A natural question is whether it is always possible to compose two up-totechniques or, equivalently, whether the composition of two b-sound functionsis still b-sound. The following exercise shows that the answer is negative. Thecounterexample in the exercise is ad hoc; a more meaningful counterexamplewill be given in Section 6.5.4.

Exercise 6.3.7 Consider the four-point lattice given by the powerset of f0, 1g,and define the following (monotone) functions:

b : x 7!

{f1g if x D f0, 1g

; otherwise

f : x 7!

{f0g if x D f1g

x otherwise

g : x 7!

{f0, 1g if x D f0g

x otherwise

f0, 1g

b

JJ:::

::::

:

f0g

gKK;

;;

;

bJJ<

<<<<

<<<<

f1gf��

b

��=========

;

Compute gfp (b) and show that f and g are b-sound. Show that g ı f is notb-sound. Notice that g [ f D g ı f (where g [ f : R 7! g(R) [ f (R)); thisshows that in general, there is no ‘largest b-sound function’. �

Thus, up-to techniques, expressed as sound functions, cannot be freelycomposed. For instance, we cannot appeal to the soundness of the up-to-context function C and of the up-to-bisimilarity function R 7! �R� to derivethe soundness of the up-to-bisimilarity-and-context function R 7! �C(R)�.We need to prove the soundness of the composite technique from scratch.The proof is tedious, as it mixes the proofs for up-to-context and for up-to-bisimilarity (the reader who carefully completed Exercise 6.2.13 would agree).

As a solution to the problem, we define a subset of sound functions that hasgood compositionality properties and that contains most up-to techniques ofinterest.

Definition 6.3.8 (Compatibility) Let b, f be two functions. The function f

is b-compatible if f ı b � b ı f . �

The compatible functions are also sound.

Page 270: advanced topics in biosimulation and coinduction

254 Damien Pous and Davide Sangiorgi

Theorem 6.3.9 Let b, f be two monotone functions. If f is b-compatible, thenf is b-sound.

Proof LetR defD gfp (b ı f ), we have to show thatR � gfp (b). We first show

that f n(R) � b(f nC1(R)), for all n, by induction on n:

� if n D 0, sinceR is a (b ı f )-simulation, we haveR � b(f (R)) by definition;� for nC 1, we have

f n(R) � b(f nC1(R)) (by induction)

f (f n(R)) � f (b(f nC1(R))) (f is monotone)

� b(f (f nC1(R))) (f is b-compatible)

Let f ω(R)defD⋃

n f n(R). Since b is monotone, we deduce f n(R) � b(f ω(R))for all n; whence f ω(R) � b(f ω(R)), that is, f ω(R) is a b-simulation. Thisallows us to conclude: we have R � f ω(R) � gfp (b). �

Remark 6.3.10 Although the terminology differs, the theorem above corre-sponds to a special case of the ‘exchange rule’ in fixed-point calculus [DP90]– it suffices to take the identity for the Galois connection, and to work in thedual lattice. �

The set of functions that are compatible with a given function is closed undercomposition and union, and contains the identity and other useful constantfunctions.

Proposition 6.3.11 Let b be a monotone function; the following functions areb-compatible:

(1) the identity function;(2) the constant-to-S function S, which maps any relationR ontoS, and where

S is any b-simulation;(3) f ı g, for any b-compatible and monotone functions f and g;(4)⋃

F , for any set F of b-compatible functions.

Proof The first two items are straightforward; for (3), we have

(f ı g) ı b D f ı (g ı b) � f ı (b ı g)

D (f ı b) ı g � (b ı f ) ı g D b ı (f ı g),

Page 271: advanced topics in biosimulation and coinduction

Enhancements of the bisimulation proof method 255

using the associativity of functional composition, and the two compatibilityhypotheses. For (4), we check that for any R,

⋃F (b(R)) D

⋃f2F

f (b(R)) �⋃f2F

b(f (R)) � b

⎛⎝⋃f2F

f (R)

⎞⎠D b(⋃

F (R))

.

In the remainder of this section, we prove that the functions underpinningthe techniques presented in Section 6.2.1 are compatible. The first three pointsof the above proposition give us the up-to-[ technique (Definition 6.2.5):the identity function is b-compatible by (1), bisimilarity is a bisimulation,so that the function R 7! � is b-compatible by (2), and the union of thesetwo functions is b-compatible by (3). For the other techniques, we give analternative characterisation of compatible functions, which is easier to workwith in concrete proofs.

Lemma 6.3.12 Let b, f be two monotone functions; f is b-compatible if andonly if for all R,S, R � b (S) entails f (R) � b (f (S)).

Proof Assume that f is b-compatible and R � b (S); we have:

f (R) � f (b(S)) (f is monotone)

f (R) � b(f (S)) (f is b-compatible)

Conversely, assume that R � b (S) entails f (R) � b (f (S)) for all R,S. Forall R, we have b(R) � b (R), whence f (b(R)) � b (f (R)) by assumption.Thus, we have obtained f ı b � b ı f , that is, f is b-compatible. �

In the concrete case of bisimilarity, using the diagrammatic representationof R � b (S), a monotone function f is b-compatible if and only if, for allrelations R,S with R � S, we have:

P

μ

R Q

μ

implies

P

μ

f (R) Q

μ

P 0 S Q0 P 0 f (S) Q0

In particular, the functions we have used as up-to techniques in the intro-duction can be shown to be b-compatible:

Lemma 6.3.13 The function R 7! �R� is b-compatible.

Page 272: advanced topics in biosimulation and coinduction

256 Damien Pous and Davide Sangiorgi

Proof Suppose that R � b (S); we have to show that �R� � b (�S�). We

consider only the left-to-right part of the game: let P,Q,P 0 such that Pμ�! P 0

and P �R� Q, i.e. P � P0 R Q0 � Q for some P0,Q0. By definition of

bisimilarity, we find P 00 such that P0μ�! P 00 and P 0 � P 00; using the assumption

R � b (S), we then find Q00 such that Q0μ�! Q00 and P 00 S Q00; and again, by

definition of bisimilarity, we find Q0 such that Qμ�! Q0 and Q00 � Q0. Putting

it all together, we have found a Q0 such that Qμ�! Q0 and P 0 �S� Q0, as

required. �

Lemma 6.3.14 The reflexive and transitive closure function R 7! R is b-compatible.

Proof Suppose that R � b (S); we have to show that R � b (S). Recallthat R D

⋃n Rn, where Rn denotes the n-th iteration of R. We prove by

induction that for all n, we have Rn � b (Sn). The case n D 0 is trivial; fornC 1 we consider only the left-to-right part of the game: let P,Q,P 0 such that

Pμ�! P 0 and P RRn Q, i.e. P R P0 Rn Q for some P0. Using the assumption

R � b (S), we find P 00 such that P0μ�! P 00 and P 0 S P 00; and by induction, we

then find Q0 such that Qμ�! Q0 and P 00 Sn Q0. Putting it all together, we have

found Q0 such that Qμ�! Q0 and P 0 SSn Q0, as required. This allows us to

conclude, by definition of reflexive and transitive closure. �

As we shall see in the sequel, the ability to combine up-to techniquesbecomes essential when we move to more complex enhancements (e.g. up-to-context techniques, or termination-based techniques for weak bisimilarity). Thefollowing corollary illustrates this possibility, anticipating Section 6.4 where weshow that the closure C under CCS contexts is b-compatible (Theorem 6.4.12).

Corollary 6.3.15 The function R 7! (C(R) [�) is b-sound.

Proof Let f1 : R 7! � and f2 : R 7! R; these functions are b-compatible byProposition 6.3.11(2) and Lemma 6.3.14, respectively. By Theorem 6.4.12, sois C. Therefore, f2 ı (C [ f1) is b-compatible by Proposition 6.3.11(3,4). Since(f2 ı (C [ f1))(R) D (C(R) [�), we conclude with Theorem 6.3.9. �

The function in Corollary 6.3.15 represents a powerful technique, whichallows one to use either the bisimulation candidate (R) or strong bisimilarity (�)to rewrite any subterm (C) of the derivatives appearing during the bisimulationgame. Moreover, such rewriting can be repeated as many times as needed,thanks to the reflexive and transitive closure.

Page 273: advanced topics in biosimulation and coinduction

Enhancements of the bisimulation proof method 257

6.3.4 Symmetry arguments

The definition of bisimilarity (or of the function b) has two symmetric clauses,which may sometimes lead to repeating the same argument twice (see forexample, Lemmas 6.3.13 and 6.3.14). This can be annoying, most notablywhen using a proof assistant to formalise the proofs on a computer.

We show in this section how to give a formal account of these symmetries:although the corresponding arguments are straightforward and intuitive in thecase of strong bisimilarity, they need to be handled properly when we moveto weak bisimilarity, where we sometimes need to work with non-symmetricfunctions.

This section can be skipped at first reading: we recall the main results andnotations when necessary in the remainder of the chapter.

6.3.4.1 Symmetric functionsWe first define the function on relations that ‘reverses’ its argument:

i : R 7! R defD f(P,Q) j Q R P g .

The function i is a monotone involution (in that i ı i D id). We use it to definetwo operations on functions: given a function f , we write f for the function

i ı f ı i, and !f for the function f \ f :

f (R)defD f (R)

!f (R)

defD f (R) \ f (R).

Exercise 6.3.16 Give simpler expressions for functions f and !f , in the case

where f is the function R 7! �R. �

Lemma 6.3.17 Let f be a monotone function; the following conditions areequivalent:

(1) f is i-compatible;(2) f D f ;(3) f ı i D i ı f .

Proof From (1) we have f D f ı i ı i � i ı f ı i � i ı i ı f D f , hencef D i ı f ı i, as required in (2), from which we deduce f ı i D i ı f ı i ı i D

i ı f , as required in (3). The entailment from (3) to (1) is straightforward. �

The functions satisfying the conditions of the above lemma are called sym-metric: they satisfy f (R) D f (R), for all R. As the following exercises show,proving the symmetry of a function is usually straightforward, and moreoversymmetry smoothly interacts with the notions of simulation, bisimilarity, andcompatibility.

Page 274: advanced topics in biosimulation and coinduction

258 Damien Pous and Davide Sangiorgi

Exercise 6.3.18 Among the following functions, which ones are symmetric?(i) R 7! �R�; (ii) R 7! �R; (iii) R 7! R [�; (iv) R 7! R; (v) R 7!(R [�). (Hint: for (v), use Lemmas 6.3.17 and 6.3.11.) �

Exercise 6.3.19 Let s, f be two monotone functions; show that

(1) a relation R is an s-simulation iff R is an s-simulation;(2) a relation R is an !s -simulation iff both R and R are s-simulations;(3) f is s-compatible iff f is s-compatible. �

6.3.4.2 Symmetric up-to techniquesTake the function b for bisimilarity (Definition 6.3.1). If we remove the secondclause, which corresponds to the right-to-left part of the bisimulation game, weobtain the function s below:

s : R 7! f (P,Q) j

(1) if Pμ�! P 0, then there exists Q0 s.t. Q

μ�! Q0 and P 0 R Q0; and

(3) P R Qg.

The function s has (strong) similarity as its greatest fixed point: only the left-to-right part of the bisimulation game is played. Symmetrically, function scorresponds to the right-to-left part of the bisimulation game. Therefore, torecover bisimulation games, it suffices to consider the function !s : we haveR � !s (S) iff R � s (S) and R � s (S).

While we managed to decompose b into simpler functions (namely s andi, from which !s is derived), an s-compatible function is not necessarily !s -compatible. Hence we cannot directly obtain up-to techniques for b from up-totechniques for s, as shown in the following exercise.

Exercise 6.3.20 By Proposition 6.3.11, the constant function R 7! gfp (s)is s-compatible. Show that this function is not b-sound and, hence, not b-compatible. �

The following proposition gives a simple solution: by restricting ourselves tosymmetric functions, one can focus on the left-to-right part of the bisimulationgames when studying up-to techniques.

Proposition 6.3.21 Let s, f be two monotone functions. If f is symmetric ands-compatible, then f is !s -compatible.

Proof By Exercise 6.3.19, f D f is s-compatible. We then have f ı (s \ s) �f ı s \ f ı s � s ı f \ s ı f D (s \ s) ı f . Hence f is !s -compatible. �

Page 275: advanced topics in biosimulation and coinduction

Enhancements of the bisimulation proof method 259

Exercise 6.3.22 Show (again) that functions R 7! �R� and R 7! R areb-compatible, by proving that they are symmetric and s-compatible. Comparethese proofs with the direct ones (Lemmas 6.3.13 and 6.3.14). �

Exercise 6.3.23 We have b D !s D s \ s. Do we have gfp (s \ s) Dgfp (s) \ gfp (s) ? (The latter relation is 2-similarity, see [San12].) �

Exercise 6.3.24

� Give a characterisation of the function b0 from Exercise 6.3.4 using s and i.� Generalise Exercise 6.3.4 by showing that for any monotone function s, we

have gfp( !s)D gfp (i \ s). �

6.3.4.3 Non-symmetric up-to techniquesFor strong bisimilarity, Proposition 6.3.21 is sufficient: all up-to techniquescan be obtained as symmetric s-compatible functions. This is no longer thecase with weak bisimilarity (�), where we need to consider non-symmetricfunctions. We briefly explain here how to deal with this situation; we refer toSection 6.5.2.4 for concrete examples, involving weak bisimilarity. We firstneed to refine the notion of soundness.

Definition 6.3.25 Let s, f, f 0 be three functions.

� f is s-sound via f 0 if f 0 is extensive (Definition 6.3.5) and for all relationsR, if R is an s-simulation up to f , then f 0(R) is an s-simulation. �

The function f 0 intuitively keeps track of the ‘witness’ of the up-to tech-nique: when f is s-sound via f 0 and R is an s-simulation up to f , then Ris contained in s-similarity because it is contained in f 0(R), which is an s-simulation. For example, the function f0 : R 7! �R is s-sound via itself: ifR is an s-simulation up to f0, then f0(R) D �R is an s-simulation. Moregenerally, by looking at the proof of Theorem 6.3.9, we obtain that compatiblefunctions are sound via their iteration (recall that f ω is

⋃n f n).

Theorem 6.3.26 Let s, f be two monotone functions. If f is s-compatible,then f is s-sound via f ω. �

The function f0 is also s-sound via the symmetric function f1 : R 7! �R�.Indeed, if R is an s-simulation up to f0, then f0(R) D �R is an s-simulation,and so is f1(R) D �R�. More generally, the following lemma allows one toextend the witness of a sound function.

Page 276: advanced topics in biosimulation and coinduction

260 Damien Pous and Davide Sangiorgi

Lemma 6.3.27 Let s, f, f 0, g be three monotone functions. If f is s-soundvia f 0, then f is s-sound via g ı f 0, provided that g is extensive and preservess-simulations. �

We finally obtain the following proposition: a function yields a sound up-totechnique for bisimilarity ( !s ), as soon as it is sound for similarity (s) via asymmetric function. In other words, it suffices that the witness of the up-totechnique be symmetric.

Proposition 6.3.28 Let s, f be two monotone functions. If f is s-sound via a

symmetric function, then gfp( �!s ı f

)� gfp

( !s)

.

Proof Assume that f is s-sound via the symmetric function f 0, and suppose

that R is an �!s ı f -simulation: R � �!s ı f (R). In particular, we have R �

s(f (R)), from which we deduce that f 0(R) is an s-simulation; and we have

R � s(f (R)), i.e. R � s(f (R)), from which we deduce that f 0(R) is an s-simulation. Then, f 0 being symmetric, we have f 0(R) D f 0(R) and f 0(R) isan s-simulation by Exercise 6.3.19. Together with f 0(R) being an s-simulation,

this entails R � gfp( !s)

. �

Equivalently, when working with symmetric candidates, we obtain the fol-lowing up-to technique:

Corollary 6.3.29 Let s, f be two monotone functions such that f is s-soundvia a symmetric function. Any symmetric s-simulation up to f is contained in !s -similarity.

Proof Let R be such a symmetric s-simulation up to f : R � s ı f (R). Since

R is symmetric, we also have R D R � s ı f (R), so that R is an �!s ı f -

simulation. We conclude with Proposition 6.3.28. �

6.4 Congruence and up to context techniques

In the previous sections we have seen how to derive up-to techniques forbisimilarity in a compositional way, via the notion of compatible function.In particular, we have seen that up-to-bisimilarity and up-to-transitivity cor-respond to compatible functions. In this section, we show that the functionfor up-to-context is also compatible. We cover the case of CCS, as defined inFigure 6.1; the methodology can be adapted to other languages.

Page 277: advanced topics in biosimulation and coinduction

Enhancements of the bisimulation proof method 261

6.4.1 Contexts

We have introduced contexts, including polyadic contexts, in Section 6.2.2.Each such context C induces a function that manipulates relations on CCSprocesses, as follows:

bCc : R 7!{(

C[P ], C[Q])j P R Q

}.

This notation is extended to sets C of contexts:

bCc : R 7!{(

C[P ], C[Q])j P R Q and C 2 C

}.

Thus, bCc(R) is the closure of R under the contexts in C. Also note that thefunction bCc is always symmetric, independently of the set C. When C is theset of all (polyadic) CCS contexts, we write C for bCc; we call this functionclosure under CCS contexts.

6.4.2 Up to context techniques

We want to show that C yields a valid up-to technique for bisimilarity, i.e. thatthe following diagram is enough to deduce that R is contained in bisimilarity.

P

μ

R Q

μ

P 0 C(R) Q0

For this, it suffices to show that C is b-sound. However, this would not allowus to combine this up-to technique with other techniques. Therefore, we provea stronger property, namely that C is b-compatible.

As proposed in the following exercise, compatibility can be proved directly,by a structural induction on contexts. The difficulty comes from the repli-cation operator, which requires us to consider polyadic contexts: the closurefunction restricted to monadic contexts is not compatible. Moreover, the dif-ficulty increases when we move to the case of weak bisimilarity where oneneeds to reason modulo unfolding of replications. We propose another proof inSection 6.4.5.

Exercise� 6.4.1 Prove that C is b-compatible, i.e. assume that R � b (S) andprove C(R) � b (C(S)) by structural induction on polyadic contexts: show that

for all CCS contexts C, if P R Q and C[P ]μ�! P0, then there exists Q0 such

that C[Q]μ�! Q0 and P0 C(S) Q0. �

Page 278: advanced topics in biosimulation and coinduction

262 Damien Pous and Davide Sangiorgi

Thanks to Proposition 6.3.11, we can combine up-to-context with other up-totechniques expressed as b-compatible functions. For example, we can composefunctions C, R 7! R [�, and R 7! R, as in the following diagram:

P

μ

R Q

μ

P 0 (C(R) [�) Q0

We have thus derived the function in Corollary 6.3.15.

Remark 6.4.2 If we omit the third clause in the definition of b (Defini-tion. 6.3.1), then the function C remains sound, but it is no longer compati-

ble. To see this, consider the relations R defD f(!a. b, !a. c)g and S def

D �f(!a. b jb, !a. c j c)g�. Without the third clause, we would have R � b (S), whileC(R) � b (C(S)) does not hold. For instance, we have d. !a. b C(R) d. !a. c,but the only derivatives of these processes, !a. b and !a. c, are not in C(S). �

6.4.3 Substitutivity

Another consequence of the compatibility of C is the substitutivity of bisimilar-ity: bisimilarity is preserved by all CCS contexts. This property is a consequenceof the following lemma: b-similarity is closed under any b-compatible function(a relation R is closed under a function f if f (R) � R).

Lemma 6.4.3 Let b be a monotone function; for all b-compatible functionsf , we have f (gfp (b)) � gfp (b).

Proof We have f (gfp (b)) D f (b(gfp (b))) � b(f (gfp (b))). Hence,f (gfp (b)) is a b-simulation, and f (gfp (b)) � gfp (b). �

Corollary 6.4.4 (Substitutivity of bisimilarity) Bisimilarity is preserved byall contexts in CCS. That is, we have C(�) � � .

Proof Lemma 6.4.3 applies to C, which is b-compatible by Exercise 6.4.1. �

As shown in Section 6.2.5, the converse of Lemma 6.4.3 does not hold:f (gfp (b)) � gfp (b) does not necessarily entail that f is b-compatible orb-sound.

Page 279: advanced topics in biosimulation and coinduction

Enhancements of the bisimulation proof method 263

6.4.4 Rule formats

It is possible to formalise results on up-to-context that are valid for classes oflanguages, rather for a single language as we have done so far with CCS. Itsuffices that the semantics of the language is given by means of rules in the styleof Structured Operational Semantics (SOS). The results then are expressed interms of the format of such rules. We refer to [San12] and references thereinfor details on rule formats; we only mention here a few simple facts.

If the LTS adheres to the de Simone rule format [dS85], then the contextclosure function is b-compatible [San98], and hence it yields a valid up-totechnique.

On the contrary, the more permissive xyft/tyft format [GV92] leads to con-text closure functions which are b-sound (see the exercise below), but notnecessarily b-compatible. Recall the simple process language at the end ofSection 6.2.5, which we used to show that the combination of up-to-context andup-to-bisimilarity is not always sound: the rules of the language are in xyft/tyftformat, but the context closure function is not b-compatible. If it were, then itcould be combined with the function R 7! �R�, which is b-compatible; butthe example showed that the up-to-context-and-bisimilarity technique is notsound, hence also not compatible.

Exercise� 6.4.5 Consider the following syntax of processes: P ::D 0 j f (P ),where f ranges over an arbitrary set of function symbols. Suppose that the LTSis given by a set of rules of the form:

X0μ0�! X1

μ1�! . . .

μn�1���! Xn

f (X0)μ�! C[Xn]

where μ and μi are arbitrary labels, the Xi’s are distinct process metavariables,f is a function symbol, and C is an arbitrary context)

Show that the corresponding context closure C is b-sound. (Hint: suppose

thatR � b (C(R)); show thatC(R) is a bisimulation, i.e. if P C(R) Q and Pμ�!

P 0, then there exists some Q0 such that Qμ�! Q0 and P 0 C(R) Q0, proceeding

by induction on the derivation.) �

The result of Exercise 6.4.5 can be generalised to tree rules [FvG96], andthus to the xyft/tyft format [Pou10].

6.4.5 An alternative method: initial contexts

In certain languages, proving compatibility of up-to context may be delicate:it requires a mix of both induction (on contexts) and coinduction (to define

Page 280: advanced topics in biosimulation and coinduction

264 Damien Pous and Davide Sangiorgi

bisimulations). Moreover, naive proof attempts are sometimes deemed to fail.For example, as seen in Section 6.4.2, in CCS with replication, one cannotwork with monadic contexts only: we are forced to generalise the techniqueto polyadic contexts, which results in more tedious case analyses. This is evenworse when working with weak bisimilarity, where we need to reason modulounfolding of replications within the inductive proof (see Section 6.5.3).

In this section, we present a method for deriving the compatibility of up-to-context. The method separates the inductive part of the proof from thecoinductive part. Thus proving the compatibility of a context-closure functionreduces to checking that each syntactic construction of the language satisfies asimple condition with respect to the function b of bisimilarity.

The crux of the method is a characterisation of the context closure functionC using a smaller set of contexts, called initial, one for each operator of thelanguage.

Definition 6.4.6 (Initial contexts) The following CCS contexts are calledinitial:

0defD 0 j

defD []1 j []2 !

defD ![]1 (νa)

defD (νa)[]1

iddefD []1 μ.

defD μ. []1 C

defD []1 C []2.

The set of initial CCS contexts is written Ci . �

Each initial context is a context, so that bCic � C; the containment is strict,however, as C(;) is the identity relation while bCic(;) D f(0, 0)g. Indeed, wehave to iterate the function bCic to recover the closure under all contexts.

Proposition 6.4.7 We have C D bCicω.

Proof Since C is idempotent, bCic � C entails bCicω � C by a simple induc-

tion. For the converse direction, we fix a relationR, and we show that for all CCScontexts C, we have bCc(R) � bCic

ω(R), proceeding by structural inductionon C. We detail the case of a parallel context C D C1 j C2. Suppose P0 bCc(R)Q0, that is, P0 D C1[P ] j C2[P ] and Q0 D C1[Q] j C2[Q], with P R Q. Byinduction, Ci[P ] bCic

ω(R) Ci[Q] for i D 1, 2, i.e. Ci[P ] bCicni (R) Ci[Q] for

some ni (i D 1, 2). By letting n D max fn0, n1g, we deduce

P0 D C[P ] bjc(bCicn(R)) C[Q] D Q0

(since the identity context belongs to Ci , we have bCicm � bCic

mCk for allm, k) whence P0 bCic

nC1(R) Q0, and P0 bCicω(R) Q0. �

The advantage of this characterisation of contextual closure in terms of initialcontexts is that we can reason on such contexts without the need of inductive

Page 281: advanced topics in biosimulation and coinduction

Enhancements of the bisimulation proof method 265

proofs. The proof of the proposition essentially captures the inductive part ofthe proof of correctness of up-to-context as formulated in Section 6.4.2, so thatwe are then left with the coinductive part alone.

Some initial contexts directly yield compatible functions. For example, thefunctions corresponding to the parallel context, bjc, and to the restriction con-texts, b(νa)c, are b-compatible (Lemma 6.4.11 below). Since compatible func-tions are stable under union and composition (Proposition 6.3.11), we deducethe validity of techniques such as ‘up-to-restriction-and-parallel-context’.

In contrast, some contexts do not yield compatible functions by themselves.Typically, the replication context spawns parallel compositions along reduc-tions, so that the correctness of ‘up-to-replication’ inherently depends on thecorrectness of ‘up-to-parallel-contexts’. Similarly, in the π -calculus, where theSOS rules for parallel composition involve also the restriction operator, wecannot prove up-to-parallel-contexts and up-to-restriction independently.

We handle these inter-dependencies using coinduction at the level of compat-ible functions. For instance, the replication-context function is not compatibleby itself; it is however compatible up to the compatibility of the parallel-contextfunction. More formally, we introduce the following technical notion, whichgeneralises the notion of compatibility (Definition 6.3.8):

Definition 6.4.8 Let b, f, g be three functions; f evolves into g through b,

written fb� g, if f ı b � b ı g. �

As we shall see below, in the concrete case of bisimilarity, we have that f

evolves into g if the left-hand side diagram below entails the right-hand sideone:

P

μ

R Q

μ

P 0 S Q0

P

μ

f (R) Q

μ

P 0 g(S) Q0

Intuitively, while a b-compatible function is a function which evolves to itself(through b), the notion of evolution allows us to consider functions that are‘almost’ compatible: they evolve to a larger function. This is reminiscent ofthe difference between bisimulations and progressions: R is a bisimulation ifR progresses to itself, but progressions allow us to consider relations that are‘almost’ bisimulations: relations that progress to some possibly larger relation.

Thus, we get a notion of ‘compatibility up to’: when fb� φ(f ), where φ is a

function from functions to functions, we say that f is b-compatible up to φ.The following lemma provides a simple characterisation of evolutions.

Page 282: advanced topics in biosimulation and coinduction

266 Damien Pous and Davide Sangiorgi

Lemma 6.4.9 Let b, f, g be three monotone functions.

(1) f is b-compatible iff fb� f ;

(2) fb� g iff for all relations R,S:

R � b (S) entails f (R) � b (g(S)).

Proof The first point is straightforward; we consider the second one.

� If fb� g and R � b (S), then we have f (R) � f (b(S)) � b(g(S)).

� Conversely, for all R, we have b(R) � b (R), from which we deducef (b(R)) � b (g(R)). �

We finally obtain the following proposition: compatible functions ‘up toiteration’ yield compatible functions. We will see another example of ‘compat-ibility up to’ in Section 6.5.3. See [Pou07, Pou08a] for more details on up-totechniques for compatibility.

Proposition 6.4.10 Let b, f be two monotone functions, and suppose that f ω

is idempotent. If fb� f ω, then f ω is b-compatible.

Proof We show that for all i, f i b� f ω by induction on i:

� if i D 0, we have f 0 ı b D b � b ı f ω, i.e., f 0 b� f ω;� for i C 1, we have:

f i ı b � b ı f ω (by induction)

f iC1 ı b � f ı b ı f ω, (f is monotone)

� b ı f ω ı f ω, (by assumption)

D b ı f ω (f ω is idempotent)

Our characterisation of contextual closure (C D bCicω) was guided by the

above proposition. Indeed, with f D bCic, proving that C is b-compatibleamounts to proving that bCic is b-compatible ‘up to iteration’, i.e. that for all

initial contexts C 2 Ci we have bCcb� C. This, expanding the notation, means

that for all initial contexts C,

R � b (S) entails bCc(R) � b (C(S)) . (�)

In other words, for the b-compatibility of C we need not analyse the effectof all contexts (as in Exercise 6.4.1): by the compositionality properties of

Page 283: advanced topics in biosimulation and coinduction

Enhancements of the bisimulation proof method 267

compatible functions, it suffices to analyse initial contexts. Moreover, theappearance of C(S) on the right-hand side indicates that we can use all contextswhen answering the challenges produced by the initial contexts (bCc(R)).

For CCS, we perform this analysis in the following technical lemma: for eachinitial context, we give the smallest contextual closure it evolves to, throughb. As mentioned above, the functions corresponding to parallel compositionand restriction are b-compatible ‘by themselves’, while the function associatedto the replication operator depends on parallel composition. The functionsassociated to dynamic operators (prefix and sum) evolve into the identity, asthese operators disappear after a single transition.

Lemma 6.4.11 The following evolutions hold:

� bμ.cb� id

� bCcb� id

� b(νa)cb� b(νa)c

� b0cb� b0c

� bjcb� bjc

� b!cb� bjcω ı (b!c [ id).

Proof Take R,S such that R � b (S); we study each context of Ci separately:for all C 2 Ci , we show bCc(R) � b (f (S)) (where f is the right-hand sidefunction in the assertion of the lemma); that is, we suppose U bCc(R) V and

Uμ�! U 0, and we find some V 0 such that V

μ�! V 0 and U 0 f (S) V 0.

bμ.c: U D μ0. Pμ�! U 0, V D μ0. Q with P R Q. Necessarily, μ D μ0 and

U 0 D P . We hence have V D μ. Qμ�! Q, with P id(S) Q (recall

that R � b (S) entails R � S – see Remark 6.4.2).

bCc: U D U1 C U2, V D V1 C V2 with Ui R Vi for i 2 1, 2, and Ui

μ�!

U 0i D U 0 for some i. We deduce that there exists some V 0i such that

Vi

μ�! V 0i , and U 0i S V 0i . Finally, V

μ�! V 0i with U 0 id(S) V 0i .

b(νa)c: U D (νa)Pμ�! U 0, V D (νa)Q with P R Q. Inference rules impose

U 0 D (νa)P 0 where Pμ�! P 0 and μ 6D a, a. Since P R Q, we obtain

Q0 such that Qμ�! Q0 and P 0 S Q0, and we check that V

μ�! V 0 D

(νa)Q0, with U 0 b(νa)c(S) V 0.b0c: straightforward.

Page 284: advanced topics in biosimulation and coinduction

268 Damien Pous and Davide Sangiorgi

bjc: U D P1 j P2μ�! U 0, V D Q1 j Q2 with P1 R Q1 and P2 R Q2.

According to the inference rules for parallel composition, there arethree cases:� U 0 D P 01 j P2 with P1

μ�! P 01. Since R � b (S), Q1

μ�! Q01 with

P 01 S Q01. We check that Vμ�! V 0 D Q01 j Q2 and U 0 bjc(S) V 0

(again we use the property that R � b (S) entails R � S).� U 0 D P1 j P

02 with P2

μ�! P 02, which is identical to the previous case.

� U 0 D P 01 j P02 with P1

a�! P 01, P2

a�! P 02, and μ D τ . We have Q1

a�!

Q01 Q2a�! Q02 with P 01 S Q01 and P 02 S Q02; so that V

τ�! V 0 D Q01 j

Q02 and U 0 bjc(S) V 0.

b!c: U D !Pμ�! U 0, V D !Q with P R Q. By induction on the derivation,

there are two cases:� U 0 D !P j P k j P 0 j P k0 with P

μ�! P 0 (we recall that P n indi-

cates the parallel composition of n copies of P ). We deduce

Qμ�! Q0 with P 0 S Q0, and V

μ�! V 0 D !Q j Qk j Q0 j Qk0 and

U 0 bjckCk0C1 ı (b!c [ id)(S) V 0.� U 0 D !P j P k j P0 j P

k0 j P1 j Pk00 with P

a�! P0, P

a�! P1 and

μ D τ . We deduce Qa�! Q0 and Q

a�! Q1 with P0 S Q0 and

P1 S Q1. We then have Vτ�! V 0 D !Q j Qk j Q0 j Q

k0 j Q1 j Qk00 ,

where U 0 bjckCk0Ck00C1 ı (b!c [ id)(S) V 0.

Note that at several places in the proof, we need the property that R �b (S) entails R � S. This holds thanks to clause (3) in the definition of b(Definition 6.3.1); as explained in Remark 6.4.2, this clause is necessary for Cto be b-compatible.

Putting it all together, since each of the the right-hand side functions inLemma 6.4.11 is contained in C, we can conclude:

Theorem 6.4.12 The contextual closure C is b-compatible.

Proof By Proposition 6.4.10, it suffices to show bCicb� C, i.e. for all C 2 Ci ,

bCcb� C. These evolutions are guaranteed by Lemma 6.4.11. �

The proof of the above lemma may seem lengthy. It is nonetheless substan-tially simpler than a direct proof (Exercise 6.4.1), where the corresponding caseanalysis is performed within a larger induction on arbitrary polyadic contexts.We will see that the approach scales to the weak case (Section 6.5.3) where, incontrast, a direct proof is even more clumsy.

Page 285: advanced topics in biosimulation and coinduction

Enhancements of the bisimulation proof method 269

Another advantage of the approach is modularity: when adding a new syn-tactic construction, it suffices to analyse its evolutions to deduce whether itcan be included in the up-to-context technique. In particular, Lemma 6.4.11makes the dependencies between the various operators explicit (e.g. parallelcomposition can be proved on its own, while replication relies on parallelcomposition).

6.5 The case of weak bisimilarity

Strong bisimilarity is often too restrictive: it does not abstract over the internalbehaviour of processes. Weak bisimilarity (�) addresses this problem by allow-ing processes to play the bisimulation game modulo silent transitions. We referto [San12, chapter 4] for more details on the motivations for weak bisimilarity.Since the process transitions are more involved and the equivalence itself iscoarser, the enhancements of the proof method for weak bisimilarity are evenmore important than those for strong bisimilarity.

The coinductive proof method for weak bisimilarity is the subject of thissection. There are other ‘weak’ notions of bisimilarity, among which coupledsimilarity and branching bisimilarity, see [San12]. The results presented herecan be adapted to handle these variations.

As we shall see, the theory of enhancements for weak bisimilarity is not assmooth as in the strong case; there are several reasons to this:

� the weak versions of some important diagram-based techniques are not sound(for example, the weak version of the up-to-bisimilarity technique – Defini-tion 6.2.2);

� there is a canonical function admitting strong bisimilarity as its greatestfixed point (b), and all enhancements can be obtained by using b-compatiblefunctions; in contrast, in the weak case we will need at least three functionsfor weak bisimilarity (wb, wb1, wt ), each of them admitting different sets ofup-to techniques;

� some enhancements of weak bisimilarity correspond to non-symmetric func-tions, so that formulating the up-to techniques and factorising the symmetryarguments require the notions we introduced in Section 6.3.4.3;

� some useful enhancements of weak bisimilarity cannot be expressed as com-patible functions.

The remainder of this section is organised as follows. We studydiagram-based techniques in Section 6.5.2; this requires defining the threeabove-mentioned functions (wb, wb1, wt ). Then we treat up-to-context

Page 286: advanced topics in biosimulation and coinduction

270 Damien Pous and Davide Sangiorgi

enhancements in Section 6.5.3, using the methodology presented in Sec-tion 6.4.5.

6.5.1 Weak bisimilarity

To define weak bisimilarity we have to introduce weak transitions, written

D) Q and Pμ

D) Q:

� PτD) P 0 holds if there are n 0 and processes P0, . . . , Pn with P D P0,

P 0 D Pn, and P0τ�! P1

τ�! . . .

τ�! Pn;

� Pμ

D) P 0 holds if there are Q,Q0 with PτD) Q

μ�! Q0

τD) P 0;

� Pμ

D) P 0, for μ 6D τ , is the same as Pμ

D) P 0.

The following function is the analogue for weak bisimilarity of the function bfor strong bisimilarity (Definition 6.3.1):

wb : R 7! f (P,Q) j

(1) if Pμ

D) P 0, then there is Q0 s.t. Qμ

D) Q0 and P 0 R Q0; and

(2) if Qμ

D) Q0, then there is P 0 s.t. Pμ

D) P 0 and P 0 R Q0g.

As expected, we have R � wb (S) if the diagram below is satisfied:

P

μ

#$

R Q

μ

#$P 0 S Q0

Weak bisimilarity (�) is the greatest fixed point of wb, and the largest wb-simulation.

6.5.2 Diagram-based techniques

The above definition of weak bisimilarity corresponds to playing strong bisimi-

larity games over the ‘weak’ LTS (μ

D)). It is however not satisfactory in proofs:when examining the challenges from a process in a pair, one has to take intoaccount all weak transitions emanating from the processes. This can be tedious,as shown in the following exercise.

Exercise 6.5.1 Describe the weak derivatives of the process !a. b j !a. Provethat !a. b j !a � !a j !b j !a using a wb-simulation. �

Page 287: advanced topics in biosimulation and coinduction

Enhancements of the bisimulation proof method 271

We saw in [San12], as a solution to this, an alternative definition of weakbisimilarity in which the challenger plays only strong transitions. We thus obtainthe two following weak-bisimulation diagrams. In these two diagrams, as wellas in the diagrams in the remainder of the section, an existential quantifierin front of a derivative indicates that the diagram should be read only in onedirection, the existential marking the responder side. For instance, the secondof the two diagrams below reads thus: whenever P R Q, for all μ and Q0 such

that Qμ�! Q0 there is P 0 with P

μD) P 0 and P 0 S Q0.

P

μ

R Q

μ

#$P 0 S 9Q0

P

μ

#$

R Q

μ

9P 0 S Q0

We define the function that corresponds to these two diagrams:

wb1 : R 7! f (P,Q) j

(1) if Pμ�! P 0, then there is Q0 s.t. Q

μ

D) Q0 and P 0 R Q0; and

(2) if Qμ�! Q0, then there is P 0 s.t. P

μ

D) P 0 and P 0 R Q0; and

(3) P R Qg.

As in the strong case, clause (3) is needed to obtain the up-to-context techniqueas a compatible function – Remark 6.4.2. The function wb1 has weak bisimilar-ity as its greatest fixed point (see the exercise below, or [San12, lemma 4.2.10]).

Exercise 6.5.2 Show that a relation is a wb1-simulation if and only if it is awb-simulation; deduce that gfp (wb1) D gfp (wb). �

While wb1-simulations and wb-simulations coincide and therefore havethe same number of pairs, establishing a wb1-simulation generally involvesfewer diagrams to prove. Moreover, the differences between wb1 and wb haveimportant consequences on up-to techniques.

6.5.2.1 The problem with weak bisimilarityThe function wb for weak bisimilarity yields a rather smooth theory of up-totechniques: it is the standard bisimulation game, just played on a different LTS

D)). In particular, functions R 7! � and R 7! R are wb-compatible, hencealso R 7! (R [�) is wb-compatible.

Page 288: advanced topics in biosimulation and coinduction

272 Damien Pous and Davide Sangiorgi

The same is not true for the function wb1, whose definition uses two differentLTSs. Indeed, the functions R 7! �R�, R 7! R, or R 7! (R [�) arenot wb1-sound [SM92]: to see this, consider the singleton relation f(τ . a, 0)g;although R 6� �, we have R � wb1 (�R�):

τ . aτ

LL>>>>>>>>

R 0

,,,,

,,,,

,,,,

,,,,

a � τ . a R 0 � 0

(To obtain a counterexample for function R 7! R, it suffices to includethe pair (a, τ . a) in the bisimulation candidate.) This situation is trouble-some, since wb1 is the function that we wish to use in practice. In the fol-lowing subsections we look at different ways of circumventing this limita-tion. The solutions in Sections 6.5.2.2–6.5.2.4 are the most basic. Those inSections 6.5.2.5 and 6.5.2.6 are more powerful, but also technically moreinvolved.

6.5.2.2 Up to strong bisimilarityLet us go back to the counterexample in Section 6.5.2.1, and consider anattempt at proving that the function R 7! �R� is wb1-compatible. AssumingR � wb1 (S), we have to show �R� � wb1 (�S�). Thus, suppose P �

P0 R Q0 � Q and Pμ�! P 0; we have to find some Q0 such that P 0 �S� Q0

and Qμ

D) Q0. Since � is a wb1-simulation, there is some P 00 with P 0 � P 00

and P0μ

D) P 00. There are now several cases, depending on the number of stepsbetween P0 and P 00:

� P0 D P 00 (and μ D τ ): we can choose Q0 D Q, and we are done, sinceR � S;

� P0μ�! P 00: since R � wb1 (S), we find some Q00 such that P 00 S Q00 and

Q0μ

D) Q00; and since� is a weak bisimulation, we find Q0 such that Q00 � Q0

and Qμ

D) Q0; thus the diagram is closed;� P0

τ�! P 000

μ

D) P 00: as in the previous case, we find Q000 , Q00 such that P 000 SQ000 � Q00, Q0

τD) Q000 , and Q

τD) Q00. The situation is summarised in the

diagram below, where we can see where we get stuck: we have not enough

Page 289: advanced topics in biosimulation and coinduction

Enhancements of the bisimulation proof method 273

conditions on S with respect to transitions, so that we are unable to close theremaining parts of the diagram.

P

μ

� P0

τ

R Q0

τ

#$

� Q

τ

#$P 000

μ

#$

S Q000 � Q00

P 0 � P 00 ? ?

A first obvious remedy consists in using strong, rather than weak, bisimilar-ity.

Exercise 6.5.3 Prove that function R 7! �R� is wb1-compatible. �

Exercise 6.5.3 tells us that a relation R satisfying the following diagrams iscontained in weak bisimilarity:

P

μ

R Q

μ

#$P 0 �R� 9Q0

P

μ

#$

R Q

μ

9P 0 �R� Q0

For example, this technique offers a simple solution to Exercise 6.5.1:

Example 6.5.4 In CCS, we have !a. b j !a � !a j !b j !a.

Proof Setting PdefD !a. b j !a and Q

defD !a j !b j !a, we can use the relation

f(P j bn, Q) j n 0g:

� for the left-to-right part of the game, we note that all transitions from P j bn

can be written as

P j bna�! � P j bnC1, P j bnC1 b

�! � P j bn,

P j bnτ�! � P j bnC1, or P j bn

a�! � P j bn ;

therefore, it suffices to check that Qμ�!� Q for μ 2 fa, a, τ, bg;

� for the right-to-left part of the game, we note that Qμ�! Q0 entails Q � Q0;

such transitions can be matched by the above transitions from P j bn, exceptwhen μ D b and n D 0 in which case we use a sequence of transitions

Pτ�!

b�!� P .

Page 290: advanced topics in biosimulation and coinduction

274 Damien Pous and Davide Sangiorgi

6.5.2.3 The expansion preorderIn the up-to-strong-bisimilarity technique of Exercise 6.5.3, the appearance ofstrong bisimilarity is sometimes too constraining. We obtain a more powerfultechnique using an asymmetric variant of weak bisimilarity called expansion,written �. In practice, it is often possible to show that processes that one expectsto be bisimilar are related by expansion. The idea underlying expansion isroughly that if Q expands P , then P and Q are weakly bisimilar, and inaddition, during the bisimulation game P never performs more τ transitionsthan Q. Expansion is not an equivalence (it is not symmetric). To define it, weneed some notation:

(1)τ�! is the reflexive closure of

τ�!; that is, P

τ�! P 0 if P

τ�! P 0 or P 0 D P .

(2)a�! is

a�!. �

Definition 6.5.5 (Expansion relation)A relation R is an expansion if whenever P R Q,

(1) Pμ�! P 0 implies Q

μ

D) Q0 and P 0 R Q0 for some Q0;

(2) Qμ�! Q0 implies P

μ�! P 0 and P 0 R Q0 for some P 0.

Q expands P , written Q � P or P Q, if P R Q for some expansion R. Wecall � the expansion relation. �

The diagrams for the expansion game are:

P

μ

Q

μ

#$P 0 9Q0

Q

μ

� P

μ

Q0 � 9P 0

The expansion preorder lies in between strong and weak bisimilarity (we have� � � � �). Like weak bisimilarity, expansion is preserved by all CCS oper-ators except choice. Expansion was investigated by Arun-Kumar and Hen-nessy [AKH92] as a preorder giving information about the ‘efficiency’ ofprocesses. Its use in up-to techniques was proposed in [SM92].

Exercise 6.5.6 Consider the following processes. Which pairs are in the expan-sion preorder?

(1) 0, τ , and τ . τ .(2) a, τ . a C a, and τ . τ . a C a.(3) a. b, τ . a. b, a. τ . b, a. b. τ , τ . τ . a. b, and τ . a. τ . b. �

Page 291: advanced topics in biosimulation and coinduction

Enhancements of the bisimulation proof method 275

Expansion leads to an up-to technique for weak bisimilarity called ‘up toexpansion’, formalised by means of the following function on relations.

Lemma 6.5.7 The function R 7! �R is wb1-compatible.

Proof Similar to the proof of Exercise 6.5.3 (since the left-to-right part of theexpansion game requires the right-hand side process to answer with at most onestep, the faulty diagram-chasing discussed in Section 6.5.2.2 does not arise).

Up-to expansion is frequently used to get rid of ‘administrative’ steps (that is,

internal transitions Pτ�! P 0 where the initial and final processes P and P 0 are

bisimilar) during weak-bisimulation games. The following exercise illustratesthe phenomenon.

Exercise 6.5.8 Prove that (νa)(a. P j a. Q) � (νa)(P j Q). Use this law toprove !(νa)(b. a j a. P ) � !b. (νa)P , using a weak bisimulation up to expan-sion. What other up-to technique would make the proof even easier? �

The expansion preorder, being coinductively defined, admits up-to tech-niques as well. We propose some of them as an exercise, below; we referto [Pou07, Pou08a] for a systematic treatment.

Exercise� 6.5.9 Define a function e on process relations for the expansiongame: the greatest fixed point of e should be the expansion preorder. Thenderive a technique of ‘expansion up to strong bisimilarity’ by showing thatthe function R 7! �R� is e-compatible. Is the ‘expansion up to transitivity’technique sound? Propose an ‘expansion up to expansion’ technique. �

6.5.2.4 Non-symmetric up-to techniquesAn inspection of the soundness proof for the ‘up-to-expansion’ techniquereveals that expansion is not required on the responder side: we can workwith the following weaker diagrams:

P

μ

R Q

μ

#$P 0 �R� 9Q0

P

μ

#$

R Q

μ

9P 0 �R Q0

These diagrams involve the non-symmetric function R 7! �R�. As weshall see in the sequel, there are other enhancements that are best expressedusing non-symmetric functions. We explained in Section 6.3.4 how to handlethese techniques: we can decompose the map wb1 for weak bisimulations, so

Page 292: advanced topics in biosimulation and coinduction

276 Damien Pous and Davide Sangiorgi

to focus on the left-to-right part of weak bisimulation games. Hence, let w bethe following function, obtained from wb1 by removing the second clause:

w : R 7! f (P,Q) j P R Q and

if Pμ�! P 0, then there exists Q0 s.t. Q

μ

D) Q0 and P 0 R Q0g.

The converse of w, namely w, corresponds to the right-to-left part of the weakbisimulation game, and one can take the conjunction of these two functions, !w , to recover the whole weak bisimulation game. Indeed, we have wb1 D

!w .Therefore, according to Proposition 6.3.28, it suffices to find functions thatare w-sound via a symmetric function to obtain up-to techniques for weakbisimilarity. As a typical example, the up-to technique corresponding to theabove two diagrams can be obtained as follows:

Lemma 6.5.10 The function R 7! �R� is w-compatible, and w-sound viathe symmetric function R 7! �R�.

Proof Let f0 : R 7! �R�. One shows that f0 is w-compatible, proceedingas in the proof of Lemma 6.5.7. By Theorem 6.3.26, we then deduce that f0

is w-sound via f ω0 , and f ω

0 D f0 since f0 is idempotent. We conclude usingLemma 6.3.27 with g : R 7! �R: we have g(f0(R)) D ��R� D �R�.

6.5.2.5 Distinguishing between silent and visible transitionsIn Section 6.5.2.1, the counterexample to the soundness of ‘weak bisimula-tion up to weak bisimilarity’ relies on the possibility of implicitly ignoring thederivatives of certain silent transitions in the ‘up-to-weak-bisimilarity’ (specif-

ically, the transition whose derivative is ignored was τ . aτ�! a). The problem,

in contrast, does not show up when the challenge is on a visible action. It isindeed possible to restrain the use of the up-to-weak-bisimilarity technique (orequivalently, up-to-transitivity) to visible actions. In the sequel, we let α rangeover visible actions (i.e. a or a).

Lemma 6.5.11 Suppose R is a relation that satisfies the diagrams below:

P

τ

R Q

τ

#$P 0 R 9Q0

P

α

R Q

α

#$P 0 RC 9Q0

Then RC is a w-simulation.

Page 293: advanced topics in biosimulation and coinduction

Enhancements of the bisimulation proof method 277

Proof (Sketch) We prove that the following diagrams hold, by three successive

inductions on the natural number n (recall thatRn andτ�!

n

, respectively, denote

the n-th iterations of R andτ�!):

P

n

τ

R Q

τ

#$P 0 R 9Q0

P

τ

#$

Rn Q

τ

#$P 0 Rn 9Q0

P

μ

#$

Rn Q

μ

#$P 0 RC 9Q0

In order to integrate the technique in Lemma 6.5.11 with previous enhance-ments, it suffices to define the following function, where, on visible actions, upto transitivity is built-in:

wt : R 7! f (P,Q) j P R Q and

if Pτ�! P 0, then there is Q0 such that Q

τD) Q0 and P 0 R Q0 ;

if Pα�! P 0, then there is Q0 such that Q

αD) Q0 and P 0 RC Q0g.

By Lemma 6.5.11, this function agrees with weak bisimilarity.

Lemma 6.5.12 We have gfp (wt ) D gfp (w), and gfp( !wt

)D gfp

( !w)

.�

Exercise 6.5.13 Show that the functions R 7! �R, R 7! R�, and R 7! RDare wt -compatible. Why did we use transitive closure rather than reflexive andtransitive closure in Lemma 6.5.11 and in the definition of wt? �

We finally obtain the following technique.

Corollary 6.5.14 Let R be a symmetric relation that satisfies these diagrams:

P

τ

R Q

τ

#$P 0 �RD� 9Q0

P

α

R Q

α

#$P 0 (R [�) 9Q0

Then R is contained in weak bisimilarity.

Proof According to Exercise 6.5.13 and Proposition 6.3.11, the functionf : R 7! �RD� is wt -compatible, and hence wt -sound via f ω D f , by The-orem 6.3.26. As in the proof of Lemma 6.5.10, this witness can be extended toa symmetric function, so that Proposition 6.3.28 applies. We finally check thatf (R)C D (R [�). �

Page 294: advanced topics in biosimulation and coinduction

278 Damien Pous and Davide Sangiorgi

6.5.2.6 Beyond expansion: termination hypothesesIn the up-to-expansion technique, for P � Q to hold, Q need to be as fast asP at every transition along the expansion game. This kind of property mayfail to hold, for example, on process optimisations whose benefits are obtainedthrough an amortised analysis, i.e. when Q is globally faster than P at the costof some bookkeeping steps at the beginning (where Q may be slower than P ).

An alternative to the expansion preorder consists in using terminationhypotheses. Recall the counterexample against weak bisimilarity up totransitivity:

R defD f(a, τ . a) , (τ . a, 0)g 0 a

a��R &&

τ . a R τ

MM 0 .

R is a weak bisimulation up to transitivity, although it is not contained in weakbisimilarity. The diagram on the right shows the transitions of the processesin R, together with the pairing given by R. If we forget the labelling of thearrows in the graph, we obtain a standard example of a relation which is locallyconfluent but not confluent: from the vertex labelled by a, one can reach inseveral steps the two vertices labelled by 0, which are not joinable (so thatthe relation is not confluent), while following two edges starting from a singlevertex always leads to joinable vertices (the relation is locally confluent). Inrewriting theory [TeR03], this problem is commonly resolved by resortingto Newman’s lemma [New42]: any locally confluent and terminating relationis confluent. By adding a similar hypothesis, we now show how to recoversoundness for weak bisimulation up to transitivity.

Looking at the above counterexample, it appears that the problem comesfrom the ability to cancel silent transitions in weak bisimilarity: when τ . a doesa silent transition to a, transitivity (or up to�) makes it possible to come backto the initial process: a � τ . a. The termination hypothesis we propose in the

following theorem prevents this situation: the relation SC τ�!C terminates if

and only if there is no infinite sequence of processes related by S orτ�! that

alternates infinitely often between S-steps andτ�!-steps. In particular, cycles

like the one from the above counterexample, between processes a and τ . a, arenot allowed.

Theorem 6.5.15 Let R,S be two relations with S � R, such that the relationSC τ�!C terminates and the following diagrams are satisfied:

P

τ

R Q

τ

#$P 0 S R 9Q0

P

α

R Q

α

#$P 0 R 9Q0

Then R is a w-simulation. �

Page 295: advanced topics in biosimulation and coinduction

Enhancements of the bisimulation proof method 279

The proof is rather involved; it can be found in [Pou07, Pou08a].This technique can be used in places where up-to-expansion is not sufficient.

We need however non-trivial process behaviours to illustrate the situation,and therefore we do not report examples here. The interested reader mayconsult [Pou08b], where the technique is used to reason about an optimisationfor a distributed abstract machine.

We conclude by showing how the above technique can be combined withother techniques, like, e.g. up-to-context. Indeed, since proving the soundnessof each technique separately is already quite involved, this is a situation wherewe need the theory of compatible functions: it would be really hard to provethe soundness of the combined technique from scratch.

First we have to formalise the technique of Theorem 6.5.15 as a function onrelations. For this, we use the following function:

t : R 7! (R \ �) R,

where � is a given transitive relation. This relation� allows us to ‘control’ thepairs that are used to rewrite the derivatives of the challenger transitions. Usingthis function, and taking S D R \ � in Theorem 6.5.15, we obtain:

Corollary 6.5.16 If �τ�!C terminates, then function t is w- and wt -sound.

Unfortunately, function t is not w- or wt -compatible, which prevents usfrom combining it freely with other compatible functions. We solve this problemwith the next theorem, which allows us to combine a sound function g anda compatible function f into a sound function, by relying on an additionalcompatibility property between f and g.

Theorem 6.5.17 Let b, f, g be three monotone functions. If g is b-sound andf is both b- and g-compatible, then g ı f is b-sound.

Proof We first prove that f is (b ı g)-compatible: we have f ı b ı g � b ı f ı

g � b ı g ı f , by the b- and g-compatibility of f , and the monotonicity of b.Therefore f is (b ı g)-sound: gfp (b ı g ı f ) � gfp (b ı g). We can now

conclude, since gfp (b ı g) � gfp (b) by b-soundness of g. �

The theorem tells us that if we wish to combine the sound function t

with some compatible functions, we have to show that these functions aret-compatible. In practice, this is easy to do, thanks to the compositionalityproperties of compatibility. An example is Corollary 6.5.19 below; the com-patibility properties needed in the corollary are summarised in the followinglemma, whose proof is straightforward.

Page 296: advanced topics in biosimulation and coinduction

280 Damien Pous and Davide Sangiorgi

Lemma 6.5.18 The following functions are t-compatible:

� R 7! RS where S is a reflexive relation;� any context closure C, provided that C(�) � �, i.e. that � is closed under

these contexts. �

We show in Section 6.5.3.1 that up-to-context is a valid up-to technique forweak bisimulation in CCS, the corresponding function C being w-compatible.We can thus combine up-to-context and other compatible techniques with thetermination-based technique, so as to obtain the following very powerful up-to technique. The result illustrates the benefits of the abstract and modulartheory of enhancements we presented: proving the soundness of the final up-totechnique from scratch (as opposed to deriving it from the soundness of itscomponent techniques) would be hard. The technique so derived correspondsto the powerful technique we had for strong bisimilarity (the function R 7!(C(R) [�) of Corollary 6.3.15); it is however constrained using a terminationhypothesis.

Corollary 6.5.19 If �τ�!C terminates and � is closed under CCS contexts,

then the function R 7! ((C(R) [�) \ �)C(R)� is w-sound.

Proof By Proposition 6.3.11 and Lemma 6.5.18, the function f : R 7! C(R)�is w- and t-compatible; and t is w-sound by Corollary 6.5.16. We canthus apply Theorem 6.5.17, and we check that t(f (R)) D ((C(R) [�) \�)C(R)� . �

Corollary 6.5.19 shows that any symmetric relation R that satisfies thefollowing diagram is contained in weak bisimilarity, provided that the rela-tion � is transitive, closed under contexts, and satisfies the terminationhypothesis.

P

μ

R Q

μ

#$P 0 ((C(R) [�) \ �) C(R)� 9Q0

In applications of the technique, one usually proceeds as follows:

(1) find a weak bisimulation up to context, up to transitivity, and up to weakbisimilarity, without worrying about the termination guarantee;

(2) collect the pairs that were used to rewrite the derivatives of each challenge,and call F such a relation;

Page 297: advanced topics in biosimulation and coinduction

Enhancements of the bisimulation proof method 281

(3) define� as the closure of F under contexts and transitivity (i.e.�defD CFC),

and check that it satisfies the termination hypothesis (i.e.�τ�!C terminates).

We shall see in Section 6.5.3.2 that in CCS with sum, we actually have torestrict the function C from Corollary 6.5.19 to non-degenerate CCS contexts,referred to with the function Cnd . Moreover, if we use replication in contexts,then the congruence requirement about the relation � is slightly stronger,since the actual w-compatible function is not Cnd itself, but an extension of it(Theorem 6.5.24).

Exercise 6.5.20 Show that the function R 7! ((R [�) \ �)RD� is wt -sound whenever �

τ�!C terminates. Draw the diagrams corresponding to the

associated up-to technique. �

Exercise� 6.5.21 Corollary 6.5.19 actually gives an up-to technique for weaksimilarity only: it still needs to be extended to weak bisimilarity, using symmetryarguments. Extend Theorem 6.5.17 and Corollary. 6.5.16 using the notion ofsoundness ‘via’ introduced in Section 6.3.4.3. Deduce that Corollary 6.5.19actually gives an up-to technique for weak bisimilarity. (A detailed answer canbe found in [Pou07, Pou08a].) �

6.5.3 Up-to context and congruence

We now move to the analysis of the up-to-context technique for weak bisimi-larity. Like in the strong case (Section 6.4), we focus on CCS with replication.

Weak bisimilarity is not a congruence in CCS: we have a � τ . a, but bC

a 6� bC τ . a. (The right-hand side process is able to silently evolve into a; thistransition cannot be matched by the left-hand side process.) As a consequence,there is no hope of proving that the function C is w-compatible, i.e. that upto context is valid for weak bisimilarity in CCS. This problem is howeverorthogonal to the theory of up-to techniques, so we shall ignore it at first, byworking in the sum-free fragment of CCS: in this fragment, weak bisimilarityis a congruence, and the up-to-context technique is valid.

6.5.3.1 The case of sum-free CCSRecall the notations from Sections 6.4.1 and 6.4.5: we use the method based oninitial contexts to obtain the up-to-context technique. Let C�i

defD Ci n fCg be

the set of initial CCS contexts (Definition 6.4.6), without the initial context for

sum. We call closure under sum-free CCS contexts the function C� defD bC�i c

ω .

Page 298: advanced topics in biosimulation and coinduction

282 Damien Pous and Davide Sangiorgi

Unfortunately, the function C� is not w-compatible: we need to slightlyextend it so that it becomes w-compatible. The problem comes from replication:

consider for example the relation R defD f(τ . a, a)gD; we have R � w (R), but,

as depicted below, C�(R) � w (C�(R)) does not hold: the right-hand sideprocess cannot answer within C�(R) since !a cannot move; we would need torewrite !a into !a j a.

!τ . a

τ

b!c(R) !a

!τ . a j a ?

However, we can still follow the methodology we presented in the strongcase (Section 6.4.5): we have to analyse the effect of each syntactic constructionon transitions. The problematic case above can be resolved by working up tounfolding of replications, which is contained in strong bisimilarity. For theother operators, we obtain the same properties we had in Lemma 6.4.11 in thestrong case.

Lemma 6.5.22 The following evolutions hold:

� bμ.cw� id

� b(νa)cw� b(νa)c

� b0cw� b0c

� bjcw� bjc

� b!cw� (R 7! �C�(R)�).

Proof We only prove the last case, for the replication operator. Consider R,Ssuch that R � w (S); we have to show b!c(R) � w (�C�(S)�) . Suppose that

P R Q and !Pμ�! P 0; there are two cases (we recall that P n denotes the

parallel composition of n copies of P ):

� P 0 D !P j P k j P0 j Pk0 with P

μ�! P0. Since R w� S, we deduce Q

μ

D) Q0

with P0 S Q0. There are two cases:

– Qμ

D) Q0, and we have !Qμ

D) Q0defD !Q j Qk j Q0 j Q

k0 , with P 0 C�(S)Q0;

– Q D Q0 (and μ D τ ); in this case, !Q cannot move. This is where we

have reason modulo� : we have !Q � Q0defD !Q j QkC1Ck0 , and P 0 C�(S)

Q0 � !Q.� P 0 D !P j P k j P0 j P

k0 j P1 j Pk00 with P

a�! P0 and P

a�! P1 (μ D τ ).

Since R w� S, we deduce QaD) Q0 and Q

aD) Q1 with P0 S Q0 and

Page 299: advanced topics in biosimulation and coinduction

Enhancements of the bisimulation proof method 283

P1 S Q1. We then have !QτD) Q0

defD !Q j Qk j Q0 j Q

k0 j Q1 j Qk00 , where

P 0 C�(S) Q0.

Due to this use of ‘up-to-strong-bisimilarity’, the compatibility up to iter-ation technique we used in the strong case (Proposition 6.4.10) is no longersufficient: the function R 7! �C�(R)� we used for the replication contextis not contained in C�. Instead, we rely on the ‘compatibility up to itera-tion and a compatible map’ technique, formalised below in Theorem 6.5.23.The main hypotheses in the theorem are the evolution f

s� g ı f ω and thes-compatibility of g: they indicate that f is s-compatible ‘up to iteration andup to the compatible function g’; the remaining hypotheses make it possibleto obtain a simple expression for the produced s-compatible map (g ı f ω). Werecall that f is extensive if R � f (R), for all R.

Theorem 6.5.23 Let s, f, g be three monotone functions such that:

(1) g is s-compatible, extensive, and idempotent;(2) f is g-compatible and f ω is idempotent.

If fs� g ı f ω, then g ı f ω is s-compatible.

Proof By Lemma 6.3.11, and with a simple induction, we obtain that f ω isg-compatible. We then show, for all i, that f i s� g ı f ω, by induction on i:

� if i D 0, we have f 0 ı s D s � s ı f ω � s ı g ı f ω, i.e., f 0 s� g ı f ω;� for i C 1, we have:

f i ı s � s ı g ı f ω (by induction)

f iC1 ı s � f ı s ı g ı f ω, (f is monotone)

� s ı g ı f ω ı g ı f ω, (by assumption)

� s ı g ı g ı f ω ı f ω, (f ω is g-compatible)

D s ı g ı f ω (f ω and g are idempotent)

From this, we deduce f ω s� g ı f ω, whence

g ı f ω ı s � g ı s ı g ı f ω

� s ı g ı g ı f ω (g is s-compatible)

� s ı g ı f ω (g is idempotent)

i.e. g ı f ω is s-compatible. �

Page 300: advanced topics in biosimulation and coinduction

284 Damien Pous and Davide Sangiorgi

The validity of up to context for weak bisimilarity follows: although theclosure C� is not w-compatible by itself, it is contained in a larger function thatis w-compatible.

Theorem 6.5.24 The symmetric function R 7! �C�(R)� is w-compatible.

Proof Take g : R 7! �R� . The function g is w-compatible, extensive, andidempotent; moreover, strong bisimilarity is a congruence in CCS, so that, inparticular, C�(�) � �, which leads to the g-compatibility of C�. Hence, byTheorem 6.5.23, it suffices to show bC�i c

w� g ı C�, i.e. that for all C 2 C�i ,

we have bCcw� g ı C�. This follows from Lemma 6.5.22. �

6.5.3.2 The sum operatorWe now briefly show how to deal with the sum operator. We have to considerguarded sums; correspondingly we use non-degenerate contexts [SW01], i.e.contexts in which each hole is underneath a prefix. In order to obtain thecorresponding closure under contexts, we introduce the following family of(initial) contexts, where R is any process, n 0, and μi is any prefix:

R C�niD1 μi . []i .

Accordingly, we denote by Cndi the set obtained from C�i by adding the above

contexts, and we define the closure under non-degenerate CCS contexts as the

function Cnd defD bCnd

i cω. Like for Theorem 6.5.24, we obtain:

Theorem 6.5.25 The closure under non-degenerate CCS contexts is containedin the w-compatible function: R 7! �Cnd (R)�.

Proof It suffices to check that bR C�niD1 μi . []ic

w� Cnd ; we can then con-clude with Lemma 6.5.22 and Theorem 6.5.23. �

As a consequence, we also obtain that weak bisimilarity is closed undernon-degenerate CCS contexts.

Corollary 6.5.26 We have Cnd (�) � � .

Proof By Lemma 6.4.3 and Theorem 6.5.25, we have �Cnd (�)� � � ,whence Cnd (�) � �, since strong bisimilarity is reflexive. �

6.5.4 Combining contexts and transitivity

Recall the function wt we introduced in Section 6.5.2.5, to obtain an up-to-transitivity technique for weak bisimulation, restricted to challenges on visibleactions. Surprisingly, C� is not wt -sound: a counterexample is depicted below,

Page 301: advanced topics in biosimulation and coinduction

Enhancements of the bisimulation proof method 285

Table 6.1.

up to b wb wb1 wst

transitivity compatible compatible with constraints on visible actionscontext compatible sound compatible unsoundboth compatible unsound with constraints unsound

where R is not contained in weak bisimilarity while R is a wt -simulation upto context:

R defD{(

a, (νb)(b. a j b)), (b. a, b) ,

((νb)(b j b), 0

), ((νb)0, 0)

}C

defD (νb)([]1 j b)

b. ab

��=========

R b

b

**���

����

��

a R C[b. a] C�(R) C[b] R 0

In comparison with the previous w-compatibility proof, the point is that theevolution bjc

wt� C� does not hold: since parallel composition is able to aggre-gate two visible actions into a silent action, up to transitivity is lifted fromvisible challenges (where it is allowed by wt ) to silent challenges (where it isnot).

This counterexample also shows that the composition of a sound func-tion with a compatible function is not necessarily sound: the above relationR is also a wb-simulation up to transitivity and up to context, so that thiscombination of techniques cannot be wb-sound. However, R 7! R is wb-compatible, and C� is wb-sound (since it is wb1-sound, and R � wb(C�(R)entails R � wb1(C�(R))). Here, the additional hypothesis of Theorem 6.5.17is not satisfied: we do not have C(R) � C(R) for all R, even for the smallpart C of C� that is required by the counterexample.

More importantly, the above discussion shows that functions with the samegreatest fixed point may yield rather different sets of up-to techniques. There-fore, one has to carefully select the function depending on the kind of coin-ductive techniques needed. In the case of weak bisimilarity, for example,there is a trade-off between the ability to use up to context or up to transi-tivity. Table 6.1 summarises the situation about these two up-to techniquesin CCS: while they can be safely combined in the strong case, this is nolonger possible in the weak case, unless one uses termination guarantees (e.g.Corollary 6.5.19).

Page 302: advanced topics in biosimulation and coinduction

286 Damien Pous and Davide Sangiorgi

6.6 A summary of up-to techniques for bisimulation

We conclude the chapter by recalling some of the most powerful up-to tech-niques examined. As hinted in the introduction, other techniques can be foundin the literature; they are usually more specific to a given setting, however, sothat they are not included in this summary.

6.6.1 Strong bisimilarity

One of the most powerful up-to techniques that we have derived for strongbisimilarity is illustrated by the following diagram, where C is the closureunder arbitrary CCS contexts:

P

μ

R Q

μ

P 0 (C(R) [�) Q0

Any relation R that satisfies this diagram is contained in strong bisimilarity.According to this technique, when answering a challenge, one can use eitherthe bisimulation candidate (R) or strong bisimilarity (�) to rewrite any subtermof the derivatives (using C to select subterms); moreover, such rewriting can berepeated as many times as needed, thanks to the reflexive and transitive closure.

6.6.2 Weak bisimilarity

The situation with weak bisimilarity is more diverse. A common techniqueis ‘up-to-expansion-and-context’: any symmetric relation R that satisfies thefollowing diagram is contained in weak bisimilarity (where Cnd is the closureunder non-degenerate CCS contexts, and � is the expansion preorder we definedin Section 6.5.2.3):

P

μ

R Q

μ

#$P 0 � Cnd (R) � 9Q0

Other techniques allow one to reason up to transitivity, with different con-straints. We summarise the main ones.

Page 303: advanced topics in biosimulation and coinduction

Enhancements of the bisimulation proof method 287

� We can employ up-to-transitivity if we play challenges on weak transitionsand renounce to up-to-context, as summarised in this diagram:

P

μ

#$

R Q

μ

#$P 0 (R [�) Q0

� We can also restrict the use of up-to-transitivity to challenges along visibletransitions, so that it suffices to consider challenges along strong transitions.One can use up-to-expansion on silent challenges, but up-to-context is notallowed:

P

τ

R Q

τ

#$P 0 � RD � 9Q0

P

α

R Q

α

#$P 0 (R [�) 9Q0

� We can finally use up-to-transitivity-and-context, under an additional termi-nation hypothesis. This is illustrated in the following diagram, where relation� must be transitive, closed under contexts, and must satisfy a termination

criterion related to silent transitions (�τ�!C has to terminate):

P

μ

R Q

μ

#$P 0

((Cnd (R) [�

)\ �) Cnd (R)� 9Q0

The termination constraint can be restricted to silent challenges; we havehowever to renounce to up-to context:

P

τ

R Q

τ

#$P 0 ((R [�) \ �) RD � 9Q0

P

α

R Q

α

#$P 0 (R [�) 9Q0

Bibliography

[AG98] M. Abadi and A.D. Gordon. A bisimulation method for cryptographicprotocols. Novdic Journal of Computing, 5(4):267, 1998.

[AKH92] S. Arun-Kumar and M. Hennessy. An efficiency preorder for processes. ActaInformatica, 29(9):737–760, 1992.

Page 304: advanced topics in biosimulation and coinduction

288 Damien Pous and Davide Sangiorgi

[BS98a] M. Boreale and D. Sangiorgi. Bisimulation in name-passing calculi withoutmatching. In Proceedings of the 13th LICS Conference IEEE ComputerSociety Press, 1998.

[BS98b] M. Boreale and D. Sangiorgi. A fully abstract semantics for causality in theπ -calculus. Acta Informatica, 35(5):353–400, 1998.

[DP90] B. Davey and H. Priestley. Introduction to Lattices and Order. CambridgeUniversity Press, 1990.

[dS85] R. de Simone. Higher-level synchronising devices in Meije-SCCS. Theoret-ical Computer Science, 37:245–267, 1985.

[FG98] C. Fournet and G. Gonthier. A hierarchy of equivalences for asynchronouscalculi. In Proceedings of the 25th ICALP, volume 1443 of LNCS, pages844–855. Springer Verlag, 1998.

[FvG96] W. Fokkink and R.J. van Glabbeek. Ntyft/ntyxt rules reduce to ntree rules.Information and Computation, 126(1):1–10, 1996.

[GV92] J.F. Groote and F.W. Vaandrager. Structured operational semantics andbisimulation as a congruence. Information and Computation, 100(2):202–260, 1992.

[JR99] A. Jeffrey and J. Rathke. Towards a theory of bisimulation for local names.In Proceedings LICS, pages 56–66, 1999.

[KW06] V. Koutavas and M. Wand. Small bisimulations for reasoning about higher-order imperative programs. In Proceedings of the 33rd POPL, pages 141–152. ACM, 2006.

[Las98] S.B. Lassen. Relational reasoning about functions and nondeterminism. PhDthesis, Department of Computer Science, University of Aarhus, 1998.

[Mil89] R. Milner. Communication and Concurrency. Prentice Hall, 1989.[MN05] M. Merro and F. Zappa Nardelli. Behavioural theory for mobile ambients.

Journal of the ACM, 52(6):961–1023, 2005.[New42] Maxwell H.A. Newman. On theories with a combinatorial definition of

‘equivalence’. Annals of Mathematics, 43(2):223–243, 1942.[Pou07] D. Pous. Complete lattices and up-to techniques. In Proceedings APLAS ’07,

volume 4807 of LNCS, pages 351–366. Springer Verlag, 2007.[Pou08a] D. Pous. Techniques modulo pour les bisimulations. PhD thesis, Ecole Nor-

male Superieure de Lyon, February 2008.[Pou08b] D. Pous. Using bisimulation proof techniques for the analysis of distributed

algorithms. Theoretical Computer Science, 402(2–3):199–220, 2008.[Pou10] D. Pous. Up-to context for the xyft/tyft format, 2010. Handwritten notes,

available on request.[San93] D. Sangiorgi. Locality and non-interleaving semantics in calculi for mobile

processes. Theoretical Computer Science, 155:39–83, 1996.[San98] D. Sangiorgi. On the bisimulation proof method. Journal of Mathematical

Structures in Computer Science, 8:447–479, 1998.[San12] D. Sangiorgi. An Introduction to Bisimulation and Coinduction. Cambridge

University Press, 2012.[SKS07] D. Sangiorgi, N. Kobayashi, and E. Sumii. Environmental bisimulations for

higher-order languages. In Proceedings LICS ’07, pages 293–302. IEEEComputer Society, 2007.

Page 305: advanced topics in biosimulation and coinduction

Enhancements of the bisimulation proof method 289

[SM92] D. Sangiorgi and R. Milner. The problem of ‘weak bisimulation up to’. InProceedings 3rd CONCUR, volume 630 of LNCS, pages 32–46. SpringerVerlag, 1992.

[SP07a] E. Sumii and B.C. Pierce. A bisimulation for dynamic sealing. TheoreticalComputer Science, 375(1–3):169–192, 2007.

[SP07b] E. Sumii and B.C. Pierce. A bisimulation for type abstraction and recursion.Journal of the ACM, 54(5), 2007.

[SW01] D. Sangiorgi and D. Walker. The π -Calculus: A Theory of Mobile Processes.Cambridge University Press, 2001.

[TeR03] TeReSe. Term Rewriting Systems. Cambridge University Press, 2003.[vG93] R.J. van Glabbeek. The linear time – branching time spectrum II: The seman-

tics of sequential systems with silent moves. In Proceedings 4th CONCUR,volume 715 of LNCS, pages 66–81. Springer Verlag, 1993.

Page 306: advanced topics in biosimulation and coinduction

7

Probabilistic bisimulation

prakash panangaden

7.1 Introduction

The history of bisimulation is well documented in earlier chapters of this book.In this chapter we will look at a major non-trivial extension of the theory oflabelled transition systems: probabilistic transition systems. There are manypossible extensions of theoretical and practical interest: real-time, quantitative,independence, spatial and many others. Probability is the best theory we havefor handling uncertainty in all of science, not just computer science. It isnot an idle extension made for the purpose of exploring what is theoreticallypossible. Non-determinism is, of course, important, and arises in computerscience because sometimes we just cannot do any better or because we lackquantitative data from which to make quantitative predictions. However, onedoes not find any use of non-determinism in a quantitative science like physics,though it appears in sciences like biology where we have not yet reached afundamental understanding of the nature of systems.

When we do have data or quantitative models, it is far preferable to analyseuncertainty probabilistically. A fundamental reason that we want to use proba-bilistic reasoning is that if we merely reported what is possible and then insistedthat no bad things were possible, we would trust very few system designs inreal life. For example, we would never trust a communication network, a car,an aeroplane, an investment bank nor would we ever take any medication! Inshort, only very few idealised systems ever meet purely logical specifications.We need to know the ‘odds’ before we trust any system.

Typically probabilistic systems come in two guises: discrete and continuous.We understand discrete systems intuitively.1 Even in school one is taught tocompute the odds of obtaining Egg Foo Yong together with Chicken Chow

1 At least, we think we understand them!

290

Page 307: advanced topics in biosimulation and coinduction

Probabilistic bisimulation 291

Mein if one orders at random in a Chinese restaurant. Even this subject hasmany tricky twists and turns2 but the overall mathematical principles are basedon elementary principles. By contrast, the theory of probability on continuousspaces is based on advanced ideas from analysis and measure theory; in fact agreat deal of analysis was invented to cater to the needs of probability.

One might take the view that any automated analysis or logical reasoningmust be inherently discrete in character. In particular, even if one is interestedin reasoning about a physical system, one has to first discretise the system.In fact, this point of view actually provides a good argument for retainingthe continuous view of the system. A given system may well be described incontinuous terms. Without formalising the continuous system – and having anotion of equivalence between discrete and continuous systems – how doesone argue that the discretised system is a faithful model of the underlyingcontinuous system? Even supposing one is willing to treat a discrete model asgiven, what if one needs to refine the model? For example, a given discretisationmay arise from some type of approximation based on a given tolerance; howdoes one refine the tolerance or discretise adaptively? Clearly the underlyingcontinuous model has to be retained and used if we want to construct differentdiscrete approximations. A systematic study of approximation is beyond thescope of the present chapter, but it is the subject of present activity and isdiscussed in the literature [Pan09].

From an immediate practical point of view, bisimulation can be used to rea-son about probabilistic, continuous-state-space discrete-time systems (hence-forth Markov processes) in the following simple way. One often ‘discretises’ acontinuous system by partitioning the state space into a few equivalence classes.Usually one has some intuition that the resulting discrete system ‘behaves like’the original continuous system. This can be made precise by our notion ofbisimulation. It is also the case that some systems cannot be discretised, andonce again, one can formalise what this means via bisimulation.

In this chapter, we cannot review all the mathematical background so thetreatment will be more detailed for the discrete case and somewhat more inthe spirit of an overview for the continuous case. There is, however, a seriousconceptual reason for looking at the continuous case even in this expositoryarticle. The powerful tools that we are forced to use establish much morepowerful results, even for the discrete case. Indeed, the first results on logi-cal characterisation of bisimulation for continuous state-space systems were

2 Consider the following puzzle: You have three cards of the same size and shape, one is red onboth sides, one is green on both sides and one is red on one side and green on the other side.One card is picked at random and one of its two sides is shown to you and it is green. What isthe probability that the other side is green?

Page 308: advanced topics in biosimulation and coinduction

292 Prakash Panangaden

treated with scepticism because they seemed to violate all the intuitions thatwe had gained from non-deterministic systems. In particular, the results showthat purely probabilistic systems are ‘almost’ as well behaved as deterministicsystems: there is a logical characterisation of simulation, two-way simula-tion is the same as bisimulation and bisimulation can be characterised bya purely positive logic. Rather than shy away from the continuous case, Iwould like to tempt the reader to learn the relevant mathematics and plungeinto it.

In the theory of probabilistic transition systems one has a precursor of theidea of bisimulation called ‘lumpability’ known since the early days of queueingtheory [KS60] and well before the study of concurrency. Lumpability is aptlynamed: it gives conditions under which the states of a transition system can beidentified, or ‘lumped’ together. What was missing was the notion of labels,but the important ideas were anticipated. Unfortunately, these ideas had to berediscovered in computer science because this literature was not known andthe definitions were given in a way that made it very hard to recognise as beingconnected to bisimulation.

The modern study of probabilistic bisimulation was initiated in a very influ-ential paper by Larsen and Skou [LS91]. In this paper they introduced reactivediscrete probabilistic labelled transition systems, defined bisimulation, relatedit to testing equivalences and proved a logical characterisation theorem forprobabilistic bisimulation.

The important idea here was to focus on reactive systems. In these systemsthe ‘internal’ non-determinism is fully probabilistic and the ‘external’ non-determinism, i.e. the choice of labels, in unquantified. There is no attemptto ascribe probabilities for what the environment might choose to do. Othermodels studied included generative probabilistic systems [vGSST90], wherethere are probabilities over environment actions, and so-called probabilisticautomata [SL94, SL95], where there is a mixture of probability and non-determinism. Bisimulation for probabilistic automata is particularly fruitfuland is being actively pursued by Segala and his collaborators and students. Inthe present article I will focus on reactive systems.

In the mid-1990s, I and my then student, Josee Desharnais began studyingprobabilistic transition systems on continuous state spaces. The intention wasto apply the theory to stochastic hybrid systems. We were quickly mired inmathematics that we did not understand well at the time and could not evenprove that bisimulation was an equivalence relation! We had tried to generaliseideas from modal logic (zig-zag morphisms); see, for example, First Stepsin Modal Logic by Sally Popkorn [Pop94]. We were also influenced by the

Page 309: advanced topics in biosimulation and coinduction

Probabilistic bisimulation 293

categorical treatment of bisimulation in terms of open maps due to Joyal,Nielsen and Winskel [JNW93]. This led to the idea of defining bisimulation asspans of zig-zags, but we could not compose them. Eventually with Edalat’shelp we were able to compose these spans [BDEP97] using a new constructioncalled a semi-pullback [Eda99]. Independently, de Vink and Rutten [dVR97,dVR99] developed a theory along coalgebraic lines but they used ultrametricspaces where they could compose spans.

The semi-pullback construction was intricate and rather ad hoc. Later it wasput on a much firmer footing by Doberkat [Dob03] who used more sophisticatedtechniques like measurable selection theorems [Sri98]. We were seeking amore tractable definition of bisimulation and eventually realised that a simplegeneralisation of the Larsen–Skou definition could be given [DGJP00]. It isthis version that I will present in this chapter.

The biggest surprise, for us at any rate, was the discovery that the logicalcharacterisation of bisimulation [DEP98] could be given with a much simplerlogic than was used for the discrete case. The logic used only binary conjunc-tion – even when the branching was uncountable – and had no negation, infact it had no negative constructs whatsoever. This turned out to hold for themodified definition of bisimulation as well [DGJP00] which showed that thetwo definitions were equivalent. The proof of logical characterisation used spe-cial properties of analytic spaces. Thus the results do not apply to all measurespaces but to a very general class that includes any that are likely to come upin applications.

If one reconsiders the problems that we faced when defining bisimulationinitially, a new point of view emerges. Instead of working with spans oneshould work with cospans. Stated less categorically, one should think of thebisimulation equivalence classes rather than of the relation per se. This leadsto a wholly new conception of bisimulation which was developed by Danos,Desharnais, Laviolette and me [DDLP06]. A very similar view emerged in thework of Bartels, Sokolova and de Vink [BSdV04] who were working in anexplicitly coalgebraic framework and who called it a ‘cocongruence’. We wereable to establish the logical characterisation theorem in general measurablespaces with this version of bisimulation, which again shows that on analyticspaces this coincides with the traditional view.

In the end one has to say that probabilistic bisimulation has a fundamentalflaw. It is unreasonable to work with an equivalence relation that requires exactmatching of real numbers. If two states are bisimilar and one were to perturbthe transition probabilities slightly the states would end up not being bisimilar.One would like to say that they are ‘close’. Jou and Smolka [JS90] arguedthat one should work with metrics rather than equivalences. There were several

Page 310: advanced topics in biosimulation and coinduction

294 Prakash Panangaden

proposed metrics on offer but they did not correspond well with the notionof bisimulation. One needed a pseudo-metric whose kernel was bisimulation.This first appeared independently in work by Desharnais, Gupta, Jagadeesanand me [DGJP99] and by Rutten [Rut98]. The theory of metric analogues ofbisimulation was pursued by van Breugel and Worrell [vBW01b, vBW01a]who gave, among other things, a polynomial-time decision procedure for themetric. These and related metrics for Markov decision processes have proveduseful in AI applications [FPP04, FPP05].

This book is focussed on bisimulation, so I have not included many topics inthe theory of labelled Markov processes. A book-length treatment is availablein my recent book, Labelled Markov Processes [Pan09] which covers approx-imation, metrics, the category of stochastic relations and other topics. It doesnot give the treatment of cocongruences given here and for a reader primarilyinterested in bisimulation this chapter contains information on this topic thatis not found in the book. The book discusses the analysis background in somedepth, whereas the present chapter is rather brief. The detailed proof of the log-ical characterisation of bisimulation (even for discrete systems) requires someof this advanced analysis and thus, a complete understanding of that proof willrequire material that is given in my book. A more advanced book which stressesthe coalgebraic point of view and the connections with logic is called StochasticCoalgebraic Logic by Doberkat [Dob10]. It gives an overview of some math-ematical topics not covered in my book, especially the use of descriptive settheory and more powerful treatments of semi-pullbacks.

The structure of this chapter is as follows. The next section deals withdiscrete systems and requires only elementary mathematics. The next sectionis a quick introduction to measure theory. The first half should be accessibleto students with no background beyond calculus but the second half is rathermore sophisticated. In that section we give the definitions of labelled Markovprocesses using the mathematics from the preceding section. The next sectiondefines a monad due to Giry which is used for the subsequent coalgebraictreatments. It can be skipped and the category theoretic parts following can beskimmed without losing the basic message. However, I believe that one shouldlearn to think coalgebraically, especially about any kind of bisimulation. Thenext section gives the definition of probabilistic bisimulation for continuous-state-space systems; it gives both categorical and relational versions. The nextsection gives the proof of the logical characterisation and shows why all theexotic mathematics is useful. The following section presents a new conceptdual to the usual notion of bisimulation. I believe that this notion will replacetraditional bisimulation; it needs the coalgebraic viewpoint in an essential way.

Page 311: advanced topics in biosimulation and coinduction

Probabilistic bisimulation 295

The next section is on Kozen’s coinduction principle. It does not require anyexplicit knowledge of category theory and extracts the useful essence of thecoalgebra viewpoint. Everyone can and should read it. The chapter ends witha brief summary.

7.2 Discrete systems

The first breakthrough in the study of probabilistic bisimulation was the paper ofLarsen and Skou [LS91] where bisimulation for discrete reactive systems wasstudied and shown to correspond to a kind of testing. A key contribution of thatpaper was a Hennessy–Milner like theorem giving a logical characterisation ofprobabilistic bisimulation. We review this here and give a very nice, hithertounpublished, proof of the logical characterisation result due to James (Ben)Worrell.

Definition 7.2.1 A labelled Markov chain is a quadruple (S, L, Cl, Pl), whereS is a countable set of states, L is a set of labels, and for each l 2 L, we have asubset Cl of S, a function, Pl , called a transition probability matrix,

Pl : Cl � S ! [0, 1]

satisfying the normalisation condition

8l 2 L, s 2 Cl . �s02SPl(s, s0) D 1.

Why the restriction to Cl rather than just defining Pl : S �X! [0, 1]? This isdone to allow some actions to be rejected in certain states. If we insisted that Pl

be defined on all states then it would turn out that every labelled Markov chainwould be bisimilar to the one-state process with a probability 1 self-loop forevery label. This is entirely analogous to the situation with a non-deterministictransition system where if every state can make a transition on every label weget a system bisimilar to the trivial one-state system. This is because we areonly distinguishing states on the basis of their ability to accept or reject actions.So, if we want some interesting structure we should have some states rejectingsome actions. A more interesting way to achieve the same effect is to allowsubprobability distributions: distributions where the sum of all the probabilitiesis bounded by 1 rather than being equal to 1. I shall follow this approach whenI discuss continuous-state systems later on.

Page 312: advanced topics in biosimulation and coinduction

296 Prakash Panangaden

Here are two simple examples

s0

a[ 14 ]

��???????

a[ 34 ]

�����

����

s1 s2

a[1]

s3

s0

a[1]

��???????

b[1]

�����

����

s1

c[ 12 ]

c[ 12 ]

77@@@@@

@@@@@@

@ s2

a[1]

s4 s3

A1 A2

The numbers in square brackets are the probabilities. The system A1 hasonly a actions. The set Ca in this case is fs0, s2g: the a action is not defined ons1 and s3. In the system A2 we have three actions a, b and c. Here Ca D fs0, s2g,Cb D fs0g and Cc D fs1g. Note that in s0 we have two different actions enabledand each one has a total probability of 1. Thus, the probabilities are conditionedon a specific action; we do not have a probability distribution measuring therelative probabilities of different actions.

In the paper of Larsen and Skou [LS91] there was a restriction called the‘minimum deviation assumption’. This said that all the probabilities appear-ing were multiples of some real number ε. This is a strong finite-branchingassumption. It was important for their proof of the logical characterisation ofbisimulation. It turns out that such restrictions are not needed and we dispensewith them. The purely probabilistic situation is better behaved than the non-deterministic situation. As we shall see later, one does not need any kind offinite branching assumption for the continuous case but one still gets a logicalcharacterisation result without infinitary connectives.

When are two states to be considered bisimilar? Consider the two systemsbelow.

t0a[ 1

3 ]

���������

a[ 23 ]

�����

����

t1 t2

b[1]

t3

s0

a[ 13 ]

��???????

a[ 13 ]

a[ 13 ]

�����

����

s1 s2

b[1]

s3

b[1]��???????

s4

P1 P2

Should we consider s0 and t0 to be equivalent? Clearly all the dead statesshould be bisimilar: t1, t3, s1, s4. Then t2, s2 and s3 should all be viewed asbisimilar: they can all do a b transition to a dead state with probability 1,

Page 313: advanced topics in biosimulation and coinduction

Probabilistic bisimulation 297

and nothing else. Now when we try to match the transitions out of s0 and t0

we see that there is nothing in system P2 that corresponds to the transitiont0

a, 23

�!t2 of system P1. On the other hand, this transition does correspond to

the transition from s0 to the states s2, s3 taken together. Thus, in order toget a reasonable notion of probabilistic bisimulation one cannot just matchtransitions as one does in the non-deterministic case: it is necessary to add thetransition probabilities to bisimilar states.

We need some basic notation pertaining to relations. If R is an equivalencerelation on a set S, we write S/R for the set of equivalence classes. If R is anybinary relation on a set S, we say that a subset A is R-closed, if a 2 A andaRb implies that b 2 R. If R is an equivalence relation an R-closed set is justa union of equivalence classes. If X is any subset of S we write R(X) for theset fy 2 S j 9x 2 X, xRyg; we call this the R-closure of X. A final notationalpoint: we write Pl(s, E) for

∑x2E Pl(s, x).

Definition 7.2.2 Given a labelled Markov chain S D (S, L, Cl, Pl) we define aprobabilistic bisimulation relation to be an equivalence relation R on S suchthat sRt implies that

(1) 8l 2 L, s 2 Cl () t 2 Cl , and(2) 8l 2 L, E 2 S/R, Pl(s, E) D Pl(t, E).

The second condition gives the addition over bisimilar states that we need.

Definition 7.2.3 We say that s is (strongly) probabilistically bisimilar to t ifthere is some probabilistic bisimulation relation R with sRt . As is commonlydone for (non-probabilistic) strong bisimulation, we write s � t for this relation.

Henceforth we will just say ‘bisimulation’ and ‘bisimilar to.’

Exercise 7.2.4 Show that if we dropped Cl and defined labelled Markov chainsto have transition probability distributions from every state for every label, thenevery system would be bisimilar to a one-state system.

The logic introduced by Larsen and Skou is the following:

L : T j φ ^ φ j φ _ φ j �a j haiqφ.

Here s jD �a means that s cannot perform the a action and s jD haiqφ meansthat from s one can perform an a action and with probability at least q theresulting state will satisfy φ. More precisely, there is a set A such that Pa(s, A) q and 8x 2 A, x jD φ.

Page 314: advanced topics in biosimulation and coinduction

298 Prakash Panangaden

There are many variations that one can imagine. Perhaps the simplest is tohave negation and dispense with � and disjunction. All the variations consid-ered by Larsen and Skou have some negative construct. The striking fact –first discovered in the context of continuous state spaces [DEP98, DEP02] – isthat one can get a logical characterisation result with purely positive formulas.The discrete case is covered by these results. Surprisingly no elementary prooffor the discrete case – i.e. one that avoids the measure theory machinery – isknown.

I now present Worrell’s proof of the logical characterisation theorem. Itis very short and perspicuous and completely avoids the use of the minimaldeviation assumption. It uses a very original idea: the extension of the notionof bisimulation to relations that are not necessarily equivalences.

Definition 7.2.5 A dynamic relation on S D (S, L, Cl, Pl) is a binary relationR on S, such that sRt implies

(1) 8l 2 L, s 2 Cl () t 2 Cl , and(2) 8l 2 L, X � S, Pl(s,X) � Pl(t, R(X)).

Note the inequality in clause (2) and the use of the R-closure.If R happens to be an equivalence relation then a dynamic relation is just a

bisimulation relation. This is not completely obvious. First, if R is an equiv-alence relation and E is an equivalence class of R then R(E) D E. ThusPl(s, E) � Pl(t, E). But the sum across all equivalences classes must be 1so in fact we get an equality. Clearly any bisimulation relation is a dynamicrelation.

Proposition 7.2.6 The composition of two dynamic relations is a dynamicrelation. The union of a family of dynamic relations is a dynamic relation. Theconverse of a dynamic relation is a dynamic relation.

Proof Only the last claim is not routine. Suppose sRct . Then for X � X

we have R(S n R�1(X)) � (S nX) from elementary set theory. We haveassumed that tRs so using the fact that R is a dynamic relation we getPl(t, S n R�1(X)) � Pl(s, R(S n R�1(X))). From the fact that Pl(s, ) is mono-tone we get

Pl(t, S n R�1(X)) � Pl(s, R(S n R�1(X))) � Pl(s, S nX).

Now, taking complements Pl(s,X) � Pl(t, R�1(X)), which shows that R�1 isa dynamic relation. �

It follows that the union of all dynamic relations is an equivalence relationand is thus the same as probabilistic bisimulation. This means that if we want

Page 315: advanced topics in biosimulation and coinduction

Probabilistic bisimulation 299

to show that s is bisimilar to t it suffices to find a dynamic relation R with sRt ;this may be easier than finding a bisimulation relation since there is only onedirection to check.

The logical characterisation of bisimulation by L has two directions.

Proposition 7.2.7 If s is bisimilar to t they obey all the same formulas of L.

This can be proved by a routine induction on the structure of formulas. Theinteresting direction is the converse. It is established by showing that logical‘simulation’ is a dynamic relation. It is usually established by showing thatlogical equivalence is a bisimulation, but this way we only have to deal withone direction.

Exercise 7.2.8 Give the ‘routine’ proof of the proposition above.

We write s � t to mean that for all formulas φ of L, s jD φ implies thatt jD φ.

Proposition 7.2.9 The relation � is a dynamic relation.

Proof Suppose that s � t and l is some fixed label with s 2 Cl . It suf-fices to show that for each finite O � S, Pl(s,O) � Pl(t,� (O)), where, asusual, � (O) D fy 2 S j 9x 2 S, x � yg; we will call this set O 0. Supposethat Pl(s,O) D λ > 0 and t makes transitions to ft1, t2, . . .g in O 0 and toft 01, t

02, . . .g in S nO 0. Now for any i 2 N we can find a formula φi such that

every state in O satisfies φi and which t 0i does not satisfy. This follows fromthe definition of O 0, in order for t 0i not to be in O 0 there must be some formulathat is satisfied by a state in O but not by t 0i . Since O is finite we can constructφi by forming a finite conjunction. Now we have

s jD hliλ

n∧iD1

φi .

Now since s � t , t must satisfy the same formula. Thus Pl(t, O 0) λ. Thisshows that � is a dynamic relation. �

Exercise 7.2.10 Consider the systems shown below.

t0

a

���������

a

�����

����

t1 t2

b

t3

s0

a

s1

b

s2

Page 316: advanced topics in biosimulation and coinduction

300 Prakash Panangaden

These are non-deterministic systems and not probabilistic systems. They areclearly not bisimilar, thus there must be a formula in Henessy–Milner logicthat distinguishes s0 from t0. Find such a formula. Prove by induction on thestructure of formulas that a purely positive formula (constructed from diamondand conjunction only) cannot distinguish s0 and t0.

Exercise 7.2.11 Consider the systems described in the previous exercise. Showthat if one assigns any probabilities to the two non-deterministic branches andany subprobability to the a-transition from s0 the systems are not bisimilarunless we assign zero probability to the transtion from t0 to t1. Show that, incontrast to the exercise above, there is a purely positive formula that distin-guishes t0 and s0.

Exercise� 7.2.12 The last exercise showed an example illustrating why theprobabilistic case does not require negation. Give an example and similaranalysis showing why we don’t need infinite conjunctions even when we haveinfinite branching. This example appears in [DEP02].

7.3 A rapid survey of measure theory

This section can be omitted if the reader is familiar with the basics of measureand probability theory on arbitrary measurable spaces. Such a background canbe obtained by reading books such as Probability and Measure by Billings-ley [Bil95] or Real Analysis and Probability by Ash [Ash72] or the book withthe same title by Dudley [Dud89] or Introduction to Measure and Probabilityby Kingman and Taylor [KT66]. I have recently written a book called LabelledMarkov Processes [Pan09] which covers this material from scratch. I have alsowritten a survey paper [Pan01] which gives the intuition behind the mathematicswithout going into proofs.

In measure theory one tries to associate a numerical notion of ‘size’ tosets. This notion is intended to generalise the familiar notion of length ofan interval to more intricate sets. The basic inspiration is geometric, but theconcept makes sense even on spaces that have no familiar geometric structure.For probability theory it is clear that such a notion is crucial if one wants totalk about probabilities of events that may be subsets of some continuum. Itis important to recognise that the cardinality concept, which is so successfulin the discrete case, is completely inappropriate in the continuous case. Forexample, there are uncountable sets of ‘length’ 0.

In formulating the notion of Markov processes, we need to refine two con-cepts that were used in the discrete case. We cannot simply define transition

Page 317: advanced topics in biosimulation and coinduction

Probabilistic bisimulation 301

probabilities between states; except in rare cases, such transition probabilitiesare zero. Accordingly, first we have to define transition probabilities between astate and a set of states. Second, we cannot define transition probabilities to anyarbitrary set of states; we need to identify a family of sets for which transitionprobabilities can be sensibly defined. These are the measurable sets.

Why cannot we define ‘sizes’ of arbitrary sets? Well of course we can ifwe want, but the notion of size will violate one basic point that we would beloath to give up. If we take a subset of the reals and ‘slide it along withoutdistortion’ its length should not change. The notion of sliding (translation)

is easily formalised. If S is a subset of the reals then we define 1C SdefD

f1C x j x 2 Sg to be the set obtained by sliding S one unit in the positivedirection. Consider the unit interval; clearly its length should be 1. It is possible– using the axiom of choice – to find a countable family of sets such that anyone is obtained by sliding any of the others, and such that they do not overlap,and together they exactly cover the unit interval. Now all these sets should havethe same size, say ε, and they must add up to 1, but that is not possible. Wehave constructed3 a set for which no reasonable notion of size that generalisesthe notion of length of an interval is possible.

What can we do? We can try to pick out a family of sets for which the theoryof size works sensibly. What do we want from such a family. We want to beable to add up the sizes of countable families of non-overlapping sets. If we tryto work with larger families everything goes wrong; for example every subsetof the reals is a union of singleton sets and these should surely have size 0, butthen every set would have size 0! This motivates the following definition.

Definition 7.3.1 A σ -algebra on a set X is a family of subsets of X whichincludes X itself and which is closed under complementation and countableunions.

A set equipped with a σ -algebra is called a measurable space.The definition of σ -algebra does not force any sets (other than X itself

and the empty set ;) to be included. We would like to say that some familiarsets must be measurable. For example, with the real numbers we would likethe intervals to be measurable. Given any family of sets we can look at thesmallest σ -algebra containing it; we call this the σ -algebra generated by thegiven family. Even with a family of easily understood sets, like the intervals,the family of measurable sets generated contains sets that are very difficult todescribe explicitly.

3 This construction uses the axiom of choice. One can argue that one should not use this axiom inmathematics and there are models of set theory without choice where all subsets of the reals aremeasurable; but then even worse things happen!

Page 318: advanced topics in biosimulation and coinduction

302 Prakash Panangaden

Most of the time we are working with Rn or a subset but it is neverthelessworth formulating the theory on an arbitrary topological space. Given a topo-logical space (X, T ), we can define the σ -algebra, often written B, generatedby the open sets (or, equivalently, by the closed sets). This is usually called theBorel algebra associated with the topology. When there is no confusion aboutthe topology, it is usually just called ‘the Borel algebra’.

Definition 7.3.2 Given a σ -algebra (X,�), a subprobability measure on X

is a [0, 1]-valued set function, μ, defined on � such that

� μ(;) D 0,� for a pairwise disjoint, countable collection of sets, fAi j i 2 Ig, in �, we

require

μ(⋃i2I

Ai) D∑i2I

μ(Ai).

In addition, for probability measures we require μ(X) D 1.

I will always be talking about subprobability measures. Any measure whichassigns a finite value to the whole space is called a finite measure. Subprobabilitymeasures are, of course, finite. Sometimes one comes across the concept of aσ -finite measure. This means that the whole space X can be expressed as thecountable union of sets of finite measure. The real line with the usual (Lebesgue)measure is σ -finite.

It is worth clarifying how the word ‘measurable’ is used in the literature.Given a σ -algebra � on a set X one says ‘measurable set’ for a member of �.Suppose that one has a measure μ. One can have the following situation. Therecan be sets of measure zero which contain non-measurable subsets. Becausethese sets are not measurable one cannot say that they have measure zero. Thishappens with Lebesgue measure on the Borel sets in the real line, for example.There is a ‘completion’ procedure4 which produces a larger σ -algebra andan extension of the original measure in such a way that all subsets of sets ofmeasure zero are measurable and have measure zero.

The completion works by adding to the σ -algebra all sets X such that thereexist measurable sets Y , Z having the same measure, with Y � X � Z. Whenapplied to the Borel subsets of the real line we get the Lebesgue measurablesets. One often uses the phrase ‘measurable set’ to mean a set which belongsto the completed σ -algebra rather than the original σ -algebra.

4 This is an unfortunate name because it gives the mistaken impression that the result cannot befurther extended.

Page 319: advanced topics in biosimulation and coinduction

Probabilistic bisimulation 303

Definition 7.3.3 A function f : (X,�X)! (Y,�Y ) between measurablespaces is said to be measurable if 8B 2 �Y . f �1(B) 2 �X.

I will not use the Lebesgue measurable sets nor the once-popular notionof measurable function as defined by, for example, Halmos [Hal74]. Thatdefinition leads to an awkward situation: the composition of two measurablefunctions is not measurable.

To take stock so far, it is worth keeping the following intuitions in mind:

� A measurable set is one that is not too ‘jagged’ so that we can sensiblymeasure its size.

� A measure on a collection of sets is a numerical measure of size of each set.� A measurable function is one that varies ‘slowly enough’ that we can compute

its integral.

The rest of this section gets increasingly technical.A very useful uniqueness result is the � lemma.

Definition 7.3.4 A � system is a family of sets closed under finite intersections.

Suppose that we have a � system P that generates a σ -algebra, �(P ). Wehave the following result.

Proposition 7.3.5 If two measures on �(P ), μ1 and μ2, agree on P , then theyagree on all of �(P ).

This allows one to work with � systems rather than with the σ -algebrasthat they generate. The sets in a � system are much simpler than the sets ina σ -algebra. For example, in the real line a nice � system is the set of closedintervals, which are much simpler sets than all the Borel sets. In this case iftwo measures agree on intervals then they must agree on all the Borel sets. Itis extremely pleasant to have such results: it would be extremely awkward toverify that two measures agree without such a result.

A key ingredient in the theory is the transition probability function.

Definition 7.3.6 A transition probability function on a measurable space(X,�) is a function τ : X �� ! [0, 1] such that for each fixed x 2 X, theset function τ (x, ) is a (sub)probability measure, and for each fixed A 2 � thefunction τ (, A) is a measurable function.

One interprets τ (x,A) as the probability of the system starting in state x

making a transition into one of the states in A. The transition probability is aconditional probability; it gives the probability of the system being in one ofthe states of the set A after the transition, given that it was in the state x before

Page 320: advanced topics in biosimulation and coinduction

304 Prakash Panangaden

the transition. In general the transition probabilities could depend on time, inthe sense that the transition probability could be different at every step (but stillindependent of past history); we will only consider the time-independent case.

How do we know that we can construct such functions? It turns out thatsuch functions always exist on certain topological spaces called Polish spaces.These, however, are not quite general enough for our purposes so we will needa broader class of spaces called analytic spaces.

The next several definitions and results pertain to analytic spaces.

Definition 7.3.7 A Polish space is the topological space underlying a complete,separable metric space; i.e. it has a countable dense subset.

Definition 7.3.8 An analytic space is the image of a Polish space under acontinuous function from one Polish space to another.

The following proposition [Dud89] gives equivalent definitions of analyticset.

Proposition 7.3.9 Suppose that X and Y are Polish spaces and f is a functionfrom X to Y . The following are equivalent:

� f is continuous and A is the image of X under f ,� f is measurable and A is the image of X under f ,� f is continuous and A is the image of a Borel subset B of X,� f is measurable and A is the image of a Borel subset B of X,� g : N1 ! Y is continuous and A is the image of N1 and� g : N1 ! Y is measurable and A is the image of N1.

Thus in this definition it turns out to be equivalent to say ‘measurable’ imageand it makes no difference if we take the image of the whole Polish space or ofa Borel subset of the Polish space.

Analytic spaces are more general than Polish spaces but they also have thebasic property that the transition probability functions that we want can bedefined on them.

It is worth noting that the space N1 captures both continuous aspects –for example, every open set in Rn is the continuous image of it – and discreteaspects since it is, for example, totally disconnected. The surprising fact is thatthere are non-Borel analytic sets. The construction is rather complicated butit does not require the axiom of choice. We say that a measurable space isan analytic space if it is measurably isomorphic to an analytic set in a Polishspace.

The next theorem states that analytic sets, though not always Borel, arealways measurable.

Page 321: advanced topics in biosimulation and coinduction

Probabilistic bisimulation 305

Theorem 7.3.10 In a Polish space any analytic set is measurable in the σ -fieldconstructed by completing any probability measure.

Such sets are called universally measurable. It is very hard to find non-analytic universally measurable sets.

The next lemmas are theorem 3.3.5 of [Arv76] and one of its corollaries.We say that two sets in a Polish space are separated if there are disjoint Borelsets which contain them. The following result is needed later.

Proposition 7.3.11 Two disjoint analytic sets in a Polish space are separated.

We say that a σ -field separates points if, whenever x 6D y, there is a mea-surable set, E, for which χE(x) 6D χE(y). The following powerful theorem andits consequences play a key role in our treatment of the logic. The first theoremis a very strong ‘rigidity’ property: it says that if one has a sub-σ -algebra, say� of an analytic space � and � separates points (so it is not too small) andcountably generated (so it is not too large) then � is all of �.

Theorem 7.3.12 Let (X,�) be an analytic space and suppose that �0 is acountably generated sub-σ -field of � that separates points in X. Then �0 D �.

It is perhaps a bit misleading to think of countably generated as being a‘size’ condition. The σ -algebra consisting of the countable and cocountablesubsets of the reals is a sub-σ -algebra distinct from the usual Borel algebra; itis not, of course, countably generated.

Analytic spaces can be quotiented by ‘nice’ equivalence relations. We knowof no such property for Polish spaces.

Proposition 7.3.13 Let X be an analytic space and let � be an equivalencerelation on X. Assume that there is a sequence f1, f2, . . . of real-valued mea-surable functions on X such that for all x, y in X we have x � y iff for all fi

we have fi(x) D fi(y). Then X/ � is an analytic space.

Doberkat calls these relations ‘smooth’ which is a nice name but I prefer toavoid it since it clashes with the notion of smoothness in geometry.

This long digression into analytic spaces would be pointless if we did nothave the following result.

Theorem 7.3.14 Regular conditional probability densities exist on analyticspaces.

This result can be found in the textbook of J. Hoffman-Jørgensen [HJ94].These regular conditional probability densities are exactly the Markov kernelsthat one needs to define labelled Markov processes.

Page 322: advanced topics in biosimulation and coinduction

306 Prakash Panangaden

7.4 Labelled Markov processes

In this section we give the formal definitions of labelled Markov processes(LMPs).

7.4.1 Some examples

We begin with a simple example, more for introducing terminology and con-cepts than for any practical interest. Consider a system with two labels fa, bg.The state space is the real plane, R2. When the system makes an a-move fromstate (x0, y0), it jumps to (x, y0), where the probability distribution for x is givenby the density Kα exp(�α(x � x0)2), where Kα D

pα/π is the normalising

factor. When it makes a b-move it jumps from state (x0, y0) to (x0, y), wherethe distribution of y is given by the density function Kβ exp(�β(y � y0)2).The meaning of these densities is as follows. The probability of jumping from(x0, y0) to a state with x-coordinate in the interval [s, t] under an a-move is∫ t

sKα exp(�α(x � x0)2)dx. Note that the probability of jumping to any given

point is, of course, 0. In this system the interaction with the environment con-trols whether the jump is along the x-axis or along the y-axis but the actualextent of the jump is governed by a probability distribution.

Interestingly, this system is indistinguishable from a one-state system thatcan make a or b moves. Thus, from the point of view of an external observer,this system has an extremely simple behaviour. The more complex internalbehaviour is not externally visible. All that an observer can see is that theprocess always accepts an a-transition or a b-transition with probability 1.The point of a theory of bisimulation that encompasses such systems is to saywhen systems are equivalent. Of course this example is already familiar fromthe non-probabilistic setting; if there is a system in which all transitions arealways enabled, it will be bisimilar (in the traditional sense) to a system withone state. Bisimulation, like most other process equivalences, abstracts fromthe structure of the internal state space and records only the interaction withthe environment. This example shows that it is possible for a system presentedas a continuum state system to be in fact reducible to a simple finite-statesystem.

Now we consider a system which cannot be reduced to a discrete system.There are three labels fa, b, cg. Suppose that the state space is R. The stategives the pressure of a gaseous mixture in a tank in a chemical plant. The envi-ronment can interact by (a) simply measuring the pressure, or (b) it can injectsome gas into the tank, or (c) it can pump some gas from the tank. The pressurefluctuates according to some thermodynamic laws depending on the reactions

Page 323: advanced topics in biosimulation and coinduction

Probabilistic bisimulation 307

taking place in the tank. With each interaction, the pressure changes accord-ing to three different probability density functions, say f (p0, p), g(p0, p)and h(p0, p) respectively, with non-trivial dependence on p0. In addition,there are two threshold values ph and pl . When the pressure rises above ph

the interaction labelled b is disabled, and when the pressure drops below pl theinteraction labelled c is disabled. It is tempting to model this as a three-statesystem, with the continuous state space partitioned by the threshold values.Unfortunately one cannot assign unique transition probabilities to these sets ofstates for arbitrary choices of f, g and h; only if very implausible uniformityconditions are obeyed can one do this. These conditions require, for example,that for any pressure value, p say, between pl and ph the probability of jumpingto a pressure value above ph is independent of the actual value of p. This isvery implausible given the intuition that if the value of p is close to ph thepressure fluctuations in the system are much more likely to carry the value ofthe pressure above ph than if the initial pressure p is far below ph.

These two examples show that systems presented as continua may or maynot be ‘equivalent’ to discrete systems. In particular if one wants to work witha discrete model one will need some precise definition of what it means for thediscrete model to be equivalent to the original system.

Here is an example from aircraft control. Imagine that there is a flyingdevice, say a drone aircraft, that has three control actions: a – turn left, b – turnright and c – straight. The response to these controls is not perfect owing towind turbulence and other random factors. The actions a and b move the craftsideways with some probability distributions on how far it moves. The craftmay ‘drift’ even with c. The aircraft must stay within a certain corridor. Theregions near the edges of the corridor are designated as dangerous and too closeto the boundary. The action a (b) must be disabled when the craft is too nearthe left (right) boundary because it has to stay within the corridor. One mightthink that one has a nice four or five state system but this is not the case. Theprobability of drifting into the dangerous border regions depends on how closethe aircraft is to the border and varies continuously with distance. Unless veryspecial (and unlikely) uniformity conditions hold, this cannot be compressedinto a finite-state system.

7.4.2 Formal definitions

When we define labelled Markov processes, instead of an arbitrary σ -algebrastructure on the set of states, I will require that the set of states be an analyticspace and the σ -algebra be the Borel algebra generated by the topology.

Page 324: advanced topics in biosimulation and coinduction

308 Prakash Panangaden

Definition 7.4.1 A labelled Markov process with label set L is a structure(S,�, fτa j a 2 Lg), where S is the set of states, which is assumed to be ananalytic space, and � is the Borel σ -algebra on S, and

8a 2 L, τa : S �� �! [0, 1]

is a transition subprobability function.

We will fix the label set to be some L once and for all. We will write (S,�, τa)for labelled Markov processes, instead of the more precise (S,�, fτa j l 2 Lg)and often refer to a process by its set of states.

In order to define a category of labelled Markov processes, we define simu-lation morphisms between processes.

Definition 7.4.2 A simulation morphism f between two labelled Markovprocesses, (S,�, τa) and (S0, �0, τ 0a), is a measurable function f : (S,�)!(S0, �0) such that

8a 2 L.8s 2 S.8A0 2 �0. τa(s, f �1(A0)) � τ 0a(f (s), A0).

Suppose that the system being simulated can make a transition from the states to the set of states A with a certain probability, say p. Then the simulatingsystem will simulate it in the following sense: the transition probability fromf (s) to any measurable set B such that f (A) � B is greater than p. This isequivalent to the statement in the definition. We cannot directly talk about thetransition probability from f (s) to f (A) since the latter may not be measurable.We require simulation to be measurable for the definition to make sense. If f

were not measurable we would not be guaranteed that f �1(A0) is measurable.

Definition 7.4.3 The objects of the category LMP are labelled Markov pro-cesses, having a fixed set L as the set of labels, with simulations as the mor-phisms.

7.5 Giry’s monad

This section is rather categorical in nature and can be omitted by those averseto this subject. It is needed to understand the section on cocongruences.

It has been recognised that coalgebras provide a sweeping universal5 pictureof ‘systems’ [Rut95]. This section sets up the categorical framework needed tounderstand LMPs coalgebraically. The nicest categorical way to look at LMPs

5 Perhaps I should say ‘couniversal?’

Page 325: advanced topics in biosimulation and coinduction

Probabilistic bisimulation 309

is as coalgebras of a suitable monad. The monad for this coalgebra was definedby Giry [Gir81] following suggestions of Lawvere.

We start with the category Mes of measurable spaces: (X,�X) where X

is a set and �X is a σ -algebra on X, with measurable functions. Recall that afunction f : (X,�X)! (Y,�Y ) is measurable if f �1(B) 2 �X for all B 2 �Y .

We define the functor � : Mes!Mes as follows. On objects

�(X) Ddf fν j ν is a subprobability measure onXg.

For any A 2 �X we get a function pA : �(X)! [0, 1] given by pA(ν) Ddf

ν(A). The σ -field structure on �(X) is the least σ -field such that all the pA

maps are measurable. A measurable function f : X! Y becomes �(f )(ν) Dν ı f �1. Clearly � is a functor.

We claim that � is a monad. We define the appropriate natural transforma-tions η : I ! � and μ : �2 ! �6 as follows:

ηX(x) D δ(x, ), μX(�) D λB 2 �X.∫

�(X)pB�.

The definition of η should be clear but the definition of μ needs to be explained.First, note that � is a measure on �(X). Recall that pB is the measurablefunction, defined on �(X), which maps a measure ν to ν(B). The σ -field on�(X) has been defined precisely to make this a measurable function. Now theintegral

∫�(X) pB� is meaningful. Of course one has to verify that μX(�) is

a subprobability measure. The only slight subtlety is checking that countableadditivity holds.

Theorem 7.5.1 [Gıry] The triple (�, η,μ) is a monad on Mes.

The Kleisli category of this monad is called SRel, for stochastic relations.Just as the category of binary relations is the Kleisli category of the powersetmonad so the stochastic relations are the Kleisli morphisms for Giry’s ‘fuzzy’powerset monad. In Giry’s paper she worked with the set of probability distri-butions rather than with subprobability distributions as I am doing here. Thisgives SRel some additional structure (partially additive structure) but it is notimportant for our purposes.

Here is the explicit description of SRel. The objects are the same as in Mes.An SRel morphism h : X! Y is a measurable function from X to �(Y ). Inother words h : X! (�Y ! [0, 1]), and applying some curry powder we geth : X ��Y ! [0, 1]. Now h(x, ) is clearly a measure on Y for each fixed x

and, for each fixed B 2 �Y , h(, B) is a measurable function. We see that an

6 Try not to confuse μ with a measure.

Page 326: advanced topics in biosimulation and coinduction

310 Prakash Panangaden

LMP is just a Kleisli morphism from X to itself. In other words, an LMP is acoalgebra of the functor �. Composition is given as follows. Suppose that h is asabove and k : (Y,�Y )! (Z,�Z). Then we define k ı h : (X,�X)! (Z,�Z)by the formula (k ı h)(x, C) D

∫Y

k(y, C)h(x, dy). Note how, in this formula,the measurability conditions on h and k are just right for the integral to makesense.

Exercise 7.5.2 Show, using the monotone convergence theorem, that compo-sition of kernels is associative.

7.6 Probabilistic bisimulation

We define probabilistic bisimulation coalgebraically but later in this section wegive a purely relational version.

7.6.1 Categorical definition

There is a standard categorical treatment of bisimulation, due to Aczel andMendler [AM89], which can be applied immediately to labelled Markov pro-cesses. If we look at the category of coalgebras of � as being the category oflabelled Markov processes we have the following notion of morphism.

Definition 7.6.1 A zig-zag morphism between two LMPs S and S0 is a mea-surable function f : S ! S0 such that

8a 2 L, x 2 S,B 2 �0 τa(x, f �1(B)) D τa(f (x), B).

The term ‘zig-zag’ comes from the modal logic literature [Pop94]. It cap-tures the ‘back-and-forth’ condition that one sees in the usual definitions ofbisimulation. A zig-zag morphism is the functional analogue of bisimulation.In order to get the relational version one needs to introduce spans.

Definition 7.6.2 A span in a category C between C-objects A and B is anobject R and a pair of morphisms f, g from R to A and B, respectively.

Rf

���������

g

�����

����

A B

Now we just define probabilistic bisimulation as a span of zig-zags.

Page 327: advanced topics in biosimulation and coinduction

Probabilistic bisimulation 311

Definition 7.6.3 A probabilistic bisimulation between (S1, �1, τ1) and(S2, �2, τ2) is a span of zig-zags f, g

(R,�, ρ)f

��������

����� g

77AAAAA

AAAAAA

(S1, �1, τ1) (S2, �2, τ2)

In order to show that one has an equivalence relation it is necessary toestablish transitivity. With spans this means that when one has

Rf

��(((((((

g

�����

����

S

h

��(((((((

k

��BBB

BBBB

A B C

there should be a way of ‘completing’ the picture in order to obtain

Tp

���������

q

��BBB

BBBB

Rf

��(((((((

g

�����

����

S

h

��(((((((

k

��BBB

BBBB

A B C

If the category in question has pullbacks then one can indeed use the pullbackconstruction to compose spans. The category of LMPs with zig-zag morphismsunfortunately does not have pullbacks. One can use a weaker construction: theweak pullback. Here – as with pullbacks – one requires that there is a way ofcompleting the square but the construction need not be universal: any otherway of completing the square must factor through the weak pullback but notuniquely. In order to get a category of coalgebras that has weak pullbacks itis sufficient that � preserve weak pullbacks. Unfortunately this does not holdand the category of LMPs with zig-zags does not have weak pullbacks.

Exercise 7.6.4 Show, with a simple discrete example, why we need spansof zig-zags. More precisely, give two simple discrte systems that are clearlybisimilar (i.e. we can find a span of zig-zags) but there is no zig-zag betweenthem in either direction.

In [dVR97, dVR99] de Vink and Rutten showed that in a related cate-gory, namely ultrametric spaces, the analogue of Giry’s monad does preserve

Page 328: advanced topics in biosimulation and coinduction

312 Prakash Panangaden

weak pullbacks. Ultrametric spaces are, however, unlike the common contin-uous spaces that one wants to work with. Thus, for example, familiar spaceslike the reals, or any manifold, are not ultrametric spaces. Indeed, one canmake the case that ultrametric spaces are closer to being discrete than beingcontinuous!

The problem of showing that spans can be composed was solved by aconstruction due to Edalat [Eda99] called the ‘semi-pullback.’ This was used inthe theory of bisimulation for LMPs developed by Desharnais et al. [BDEP97,DEP02]. Edalat’s construction was ingenious and intricate and involved movingbetween two closely related categories. A cleaner construction was given laterby Doberkat [Dob03] where powerful techniques like measurable selectiontheorems were used.

7.6.2 Relational definition

A much simpler approach was developed by Desharnais, Gupta, Jagadeesanand the present author in [DGJP00, DGJP03]. Here the categorical approachwas abandoned in favour of a return to the relational definition of Larsen andSkou [LS91].

Definition 7.6.5 If R is a binary relation we say that a set X is R-closed if

X D R(X) :D fu j 9x 2 X, xRug.

If R is an equivalence relation, then an R-closed set is just a union ofequivalence classes.

We will define a bisimulation relation on a single LMP; it is clear that wecould define it between two different LMPs by taking the disjoint union of theLMPs.

Definition 7.6.6 Given an LMP S D (S,�, τa) a probabilistic bisimulationis a binary relation R defined on the state space S, such that if sRt then, forevery measurable R-closed set C,

8a 2 L, τa(s, C) D τa(t, C).

As before, we say that two states are bisimilar if we can find a bisimulationrelation that relates them.

Exercise� 7.6.7 Show that the relational definition is equivalent to the spandefinition for discrete systems. This is worked out in [DEP02].

Page 329: advanced topics in biosimulation and coinduction

Probabilistic bisimulation 313

7.7 Logical characterisation

The proof of the logical characterisation theorem for the continuous case isfull of surprises. It is not obvious that one should expect an analogue of theHennessy–Milner theorem without a very rich logic. The reason for this isthat in the non-deterministic case one needs image-finiteness. If one does nothave image-finiteness one needs infinite conjunctions. All the studies in theliterature that consider infinite branching are restricted to the countable case.In the continuous case one has uncountable branching and one certainly doesnot have the kind of minimal deviation assumption considered by Larsen andSkou.

As it turned out, not only is there a logical characterisation theorem, itdoes not need infinite conjunctions, even when the underlying system hasuncountable branching. Furthermore, the logic that characterises bisimulationturns out to be simpler than the logics used for the discrete case, it does noteven need disjunction or any negative constructs. Of course, these results, onceestablished for the continuous case, do apply to the discrete case. As of thiswriting, no direct proof that avoids the measure-theoretic machinery is knownfor the discrete case.

As before we assume that there is a fixed set of ‘actions’ L. The logic iscalled L and has the following syntax:

T j φ1 ^ φ2 j haiqφ

where a is an action and q is a rational number. This is the basic logic withwhich we establish the logical characterisation of bisimulation.

The semantics for this logic are given in terms of a satisfaction relations jD φ between states and formulas of L:

s jD T for all s 2 S

s jD φ1 ^ φ2 if s jD φ1 and s jD φ2

s jD haiqφ if there is a measurable set A such thatτa(s, A) q and 8u 2 A, u jD φ.

We write �φ� D fs j s jD φg. The following is an easy proof by inductionon the structure of formulas.

Proposition 7.7.1 For all formulas φ of L, the set �φ� is measurable.

In view of this we can write s jD haiqφ as meaning τa(s, �φ�) q.

Exercise 7.7.2 Give the induction proof for the above proposition.

Page 330: advanced topics in biosimulation and coinduction

314 Prakash Panangaden

It is straightforward to show that bisimilar states satisfy the same formulas.

Proposition 7.7.3 Let R be a bisimulation on S. If sRs0 then s and s0 satisfythe same formulas.

Proof We proceed by induction on the structure of formulas. The cases of Tand conjunction are trivial. Now assume the implication is true for φ, i.e. forevery pair of R-related states either both satisfy φ or neither of them does. Thismeans that the set �φ� is R-closed, and by Proposition 7.7.1 is measurable.

Since R is a bisimulation transition probabilities to R-closed measurablesets must agree, τa(s, �φ�) D τa(s0, �φ�) for all a 2 L. �

We introduce a logical equivalence relation between states.

Definition 7.7.4 Let S D (S,�, τa) be an LMP and s and t be states of S. Wesay that s � t if

8φ 2 L s jD φ () t jD φ.

Our main goal is to show that� is a bisimulation relation.We first show that there is a zig-zag from any system S to its quotient under

�. If (S,�) is a measurable space, the quotient (S/, �) is defined as follows.S/ is the set of all equivalence classes. Then the function q : S ! S/ whichassigns to each point of S the equivalence class containing it maps onto S/,and thus determines a σ -algebra structure on S/: by definition a subset E ofS/ is a measurable set if q�1(E) is a measurable set in (S,�).

Proposition 7.7.5 Let (S,�, τa) be an LMP. We can define ρa so that thecanonical projection q from (S,�, τa) to (S/, �, ρa) is a zig-zag morphism.

In order to prove this proposition we need a couple of lemmas in additionto Theorem 7.3.12 and Proposition 7.3.13.

The first lemma just says that the transition probabilities to sets of the form�φ� are completely determined by the formulas.

Lemma 7.7.6 Let (S,�, τa) and (S0, �0, τ 0a) be two LMPs. Then for all formu-las φ and all pairs (s, s0) such that s � s0, we have τa(s, �φ�S) D τ 0a(s0, �φ�S0 ).

Proof Suppose that the equation does not hold. Then, say, for some φ,τa(s, �φ�S) < τ 0a(s0, �φ�S0 ). We choose a rational number q between these val-ues. Now it follows that s0 jD haiqφ but s 6jD haiqφ, which contradicts theassumption that s and s0 satisfy all the same formulas. �

The final result that we need is Proposition 7.3.5 which tells us that whentwo measures agree on a π -system they will agree on the generated σ -algebra.

Page 331: advanced topics in biosimulation and coinduction

Probabilistic bisimulation 315

This is just what we need; the formulas are closed under conjunction so thecollection of sets �φ� is a π -system.

Proof of Proposition 7.7.5: We first show that S/ is an analytic space. Letfφi j i 2 Ng be the set of all formulas. We know that �φi�S is a measurable set foreach i. Therefore the characteristic functions χφi

: S ! f0, 1g are measurablefunctions. Moreover we have

x � y iff (8i 2 N. x 2 �φi�S () y 2 �φi�S) iff (8i 2 N. χφi(x) D χφi

(y)).

It now follows by Lemma 7.3.13 that S/ is an analytic space.Let B D fq(�φi�S) : i 2 Ng. We show that σ (B) D �. We have inclusion

since B � �: indeed, for any q(�φi�S) 2 B, q�1q(�φi�S) D �φi�S which isin � by Lemma 7.7.1. Now σ (B) separates points in S/, for if x and y aredifferent states of S/, take states x0 2 q�1(x) and y0 2 q�1(y). Then sincex0 6� y0, there is a formula φ such that x0 is in �φ�S and y0 is not. This meansthat

8s 2 q�1(x), s 2 �φ�S and 8t 2 q�1(y), t 62 �φ�S

so that x is in q�φ�S , whereas y is not. Since σ (B) is countably generated, itfollows by Theorem 7.3.12, that σ (B) D �.

We are now ready to define ρa(t, ) over � for t 2 S/. We define it sothat q : S ! S/ is a zig-zag (recall that q is measurable and surjective bydefinition), i.e. for any B 2 � we put

ha(t, B) D τa(s, q�1(B)),

where s 2 q�1(t). Clearly, for a fixed state s, τa(s, q�1()) is a subprobabilitymeasure on �. We now show that the definition does not depend on the choiceof s in q�1(t) for if s, s0 2 q�1(t), we know that τa(s, q�1()) and τa(s0, q�1())agree over B, again by the fact that q�1q(�φi�S) D �φi�S and by Lemma 7.7.6.So, since B is closed under the formation of finite intersections we have, fromProposition 7.3.5, that τa(s, q�1()) and τa(s0, q�1()) agree on σ (B) D �.

It remains to prove that for a fixed Borel set B of �, ρa(, B) : S/ !

[0, 1] is a Borel measurable function. Let A be a Borel set of [0, 1]. Thenρa(, B)�1(A) D q[τa(, q�1(B))�1(A)]; we know that σ D τa(, q�1(B))�1(A)is Borel since it is the inverse image of A under a Borel measurable function.Now we have that q(σ ) 2 �, since q�1q(σ ) D σ : indeed, if s1 2 q�1q(σ ),there exists s2 2 σ such that q(s1) D q(s2), and we have just proved above thatthen the τa(si, q

�1())’s must agree, so if τa(si, q�1(B)) 2 A for i D 2, then

it is also true for i D 1, so s1 2 σ as wanted. So ρa(, B) is measurable. Thisconcludes the proof that S/ is an LMP and q a zig-zag.

Page 332: advanced topics in biosimulation and coinduction

316 Prakash Panangaden

Theorem 7.7.7 Let (S, i,�, τ ) be a labelled Markov process. Two statess, s0 2 S are bisimilar if and only if they satisfy the same formulas of L.

Proof One direction has been done already. For the other direction we willuse Proposition 7.7.5 to show that the relation � defined on the states of S isin fact a bisimulation relation. The key facts are

(1) B 2 � if and only if q�1(B) 2 �,(2) 8s 2 S,B 2 �. ρ(q(s), B) D τ (s, q�1(B)).

Let X 2 � be�-closed. Then we have X D q�1(q(X)) and hence q(X) 2 �.Now if s � s0, then q(s) D q(s0), and τa(s,X) D ρa(f (s), f (X)) D τa(s0, X),and hence � is a bisimulation. �

It is worth noting the measure theory ideas that went into the proof. We wereable to leverage the property of � systems to get a long way without negation.We did not need disjunction. The use of Theorem 7.3.12 is crucial, but it is noteasy to pinpoint what exactly it replaces in the classical case. Finally the useof the quotienting construction depends on having analytic spaces.

7.8 Probabilistic cocongruences

We have seen that the logical characterisation of bisimulation depends onproperties of analytic spaces. Though analytic spaces are general enough foralmost every conceivable application there is something troubling about the factthat these topological ideas were needed for what should have been a purelymeasure theoretic situation.

It was noted that the composition of spans in the category of coalgebrasrequired that the � functor preserve weak pullbacks; this was a major sourceof all the technical problems that were ultimately solved by using properties ofanalytic spaces. What if we worked with cospans instead of spans? Perhaps the� functor should have to preserve pushouts? In fact this is not needed at all!One can construct pushouts in the category of coalgebras for free.

Usually bisimulation is defined as a span in the coalgebra category as shownbelow.

U

γ

f

��=========

g

JJ:::

::::

::

X

α

�U�f

��======== �g

JJ:::

::::

: Y

β

�X �Y

Page 333: advanced topics in biosimulation and coinduction

Probabilistic bisimulation 317

Here α and β define �-coalgebras on X and Y , respectively; in other wordsthey define LMPs. The span of zig-zags given by f and g – with f and g

both surjective – define a bisimulation relation between (X,α) and (Y, β). Weassume that there is only one label for simplicity. We have seen how this spanconcept is the categorical generalisation of the notion of binary relation.

If we think in terms of equivalence relations then one can switch to thinkingin terms of the equivalence classes instead of the relation as a set of pairs. Thecategorical version of this is exactly the cospan.

An important observation is that with cospans one can compose usingpushouts and this does not require � to preserve anything. We consider thesituation shown below, where we have omitted labels for some of the arrows,for example �f : �X! �U , where they can be inferred by functoriality. Thearrows f, g, h and k are zig-zags.

X

α

f

JJ<<<

<<<<

<< Y

β

g

��;;;;;;;;;

h

JJ:::

::::

:: Z

γ

k

��;;;;;;;;;

�X

JJ<<<

<<<<

< U

τ

�Y

��;;;;;;;;

JJ:::

::::

: V

η

�Z

��;;;;;;;;

�U �V

One way to construct a cospan from X to Z is to construct a pushout in thecoalgebra category. In Mes we can construct a pushout for the arrows g and f

to obtain the situation shown below.

Y

��;;;;;;;;;

JJ:::

::::

::

β

g

��888888888 �Y

��;;;;;;;;

JJ:::

::::

: h

JJCCC

CCCC

CC

U

τ

**CCC

CCCC

CC�g

II88888888

�h

**CCC

CCCC

C V

η

II888888888

�U

**CCC

CCCC

C i

JJCCC

CCCC

CC j

��888888888 �V

IIDDDDDDDD

�i

JJ:::

::::

: W

ρ

�j

��;;;;;;;;

�W

Page 334: advanced topics in biosimulation and coinduction

318 Prakash Panangaden

Here W is the object constructed as the tip of the pushout in Mes. In orderto have a pushout in the category of coalgebras we need to put a coalgebrastructure on W , i.e. we need to construct a morphism ρ : W ! �W , showndotted in the diagram. This is exactly what the couniversal property of thepushout promises. Consider the following calculation:

g; τ ; �i

D β; �g; �i g is a zig-zag,D β; �(g; i) functoriality,D β; �(h; j ) pushout,D β; �h; �j functoriality,D h; η; �j h is a zig-zag.

Thus, the outer square formed by Y,U, V and �W commutes and couniver-sality implies the existence of the morphism ρ from W to �W . It is a routinecalculation that this gives a pushout in the category of coalgebras. This doesnot require any special properties of �; it holds in the most general case, i.e.in Mes. We call this dual concept a cocongruence.

This concept was independently discovered by Danos, Desharnais, Lavi-olette and the present author [DDLP06] and by Bartels, Sokolova and deVink [BSdV04]. In the paper by Danos et al. the concept being explored wasa new kind of bisimulation relation called, in that paper, ‘event bisimulation’.I do not like this terminology very much but I will stick with it. The idea is tohave a concept that does not refer to the ‘points’ of the space as much as to themeasurable sets.

Definition 7.8.1 An event bisimulation on an LMP (S,�, τ ) is a sub-σ -algebra � of � such that (S,�, τ ) is an LMP.

An almost immediate consequence of this definition is the following.

Lemma 7.8.2 If � is an event bisimulation, then the identity function on S

defines a zig-zag morphism from (S,�, τ ) to (S,�, τ ).

In fact event bisimulations fit much better with the concept of zig-zags thanordinary bisimulations do.

Lemma 7.8.3 If f : (S,�, τ )! (S0, �0, τ 0) is a zig-zag morphism, thenf �1(�0) is an event bisimulation on S.

In [DDLP06] the relation between this notion and the more traditional notionof bisimulation is discussed at length. In the discrete case the two coincide;perhaps this explains why the concept did not emerge earlier. In [DDLP06]we proved that for analytic spaces the concepts coincide. In fact this proof is

Page 335: advanced topics in biosimulation and coinduction

Probabilistic bisimulation 319

‘implicit’ in the proof of the logical characterisation of bisimulation presentedin the last section.

With event bisimulation we have logical characterisation in the most generalcontext. Given our logic L we define σ (L) to be the σ -algebra generated bysets of the form �φ� for φ 2 L. An important property of sub-σ -algebras isstability.

Definition 7.8.4 Let (S,�, τ ) be an LMP and � � �. We say that � is stablewith respect to (S,�, τ ) if for all A 2 �, r 2 [0, 1], a 2 A,

fs : τa(s, A) > rg 2 �.

Note that � is an event bisimulation if and only if it is stable and that thecondition of measurability of a kernel τ (, A) is exactly that � be stable.

Theorem 7.8.5 If S D (S,�, τ ) is an LMP with � an arbitrary σ -algebradefined on it, then σ (L) is the smallest stable σ -algebra included in �.

From this the logical characterisation result follows.

Corollary 7.8.6 The logic L characterises event bisimulation.

Proof From Theorem 7.8.5, stability tells us that σ (�L�) is an event bisim-ulation and the fact that it is the smallest implies that any event bisimulationpreserves L formulas. �

What is the connection between event bisimulation and cocongruence? Wecan redefine event bisimulation in coalgebraic terms as follows.

Definition 7.8.7 An event bisimulation on S D (S,�, τ ) is a surjection inthe category of coalgebras of � to some T .

We have already noted that such arrows are zig-zags and that a zig-zaginduces an event bisimulation on its source. For the case of an event bisimulationbetween two different LMPs we have

Definition 7.8.8 An event bisimulation between S and S 0 is a cospan ofsurjections in the category of coalgebras to some object T .

This can be viewed as ordinary event bisimulation on S C S 0.

7.9 Kozen’s coinduction principle

In order for probabilistic bisimulation – or any kind of bisimulation – to beused in practice, one needs a coinduction principle. Kozen [Koz06, Koz07] has

Page 336: advanced topics in biosimulation and coinduction

320 Prakash Panangaden

formulated a beautiful and simple coinduction principle for stochastic processesthat provides just the tool one needs. The hard analysis that goes into the studyof bisimulation is packaged inside the proof of the coinduction principle andone can use it for reasoning without needing to master the analytic arguments.

The following example is taken from Kozen’s paper [Koz07]. Consider thefollowing program that describes a stochastic process for simulating a coin thatgives heads with probability q using a coin that gives heads with probability p.It is natural to think of this as a recursive procedure. We have a procedure Q()which returntrue orfalse, which we think of as head and tails, respectively.Q(q) has to be programmed to return true with probability q. We are givenP ( ) which returns true with probability p.

Q(q) {if ( q > p) {

if (P()) then true else Q((q-p)/(1-p)) }else {

if (P()) then Q(q/p) else false }}

It is an easy calculation to see that the probability of halting is 1. Theprobability that the procedure halts and gives true on input q satisfies therecurrence.

H (q) D

{p H ( q

p) if q � p,

p C (1 � p) H ( q�p

1�p), if q > p.

The only bounded solution to this recurrence is H (q) D q which is what wewanted. Similarly, one can calculate the expected time (in terms of the numberof calls to P ) as q

pC 1�q

1�p. These arguments are elementary. However, the

following ‘optimised’ version of the program also does the right simulation.

Q(q) {if ( q >= (1-p)) then {

if (P()) then Q((q-(1-p))/p) else true }else if ( q > p) then {

if (P()) then trueelse Q((q-p)/(1-p)) }

else {if (P()) then Q(q/p) else false}}

In this case, there is no simple algebraic expression that one can write downfor the running time in order to compare it with the previous expected runningtime. One would normally expect to have to analyse the series solutions to therecurrence and use some kind of convergence argument.

Page 337: advanced topics in biosimulation and coinduction

Probabilistic bisimulation 321

Kozen’s coinduction principle allows one to avoid having to analyse seriesand their convergence properties. Roughly speaking the principle says that ifone has a ‘nice’ operator τ on a suitable linear space B and a closed subspaceφ of B then if there is some element in φ and if for every element in φ theaction of τ keeps it in φ then the fixed point of τ is also in φ. This fixed-pointprinciple can be written in the logical form:

9e 2 φ 8e, φ(e)) φ(τ (e))

φ(e�)

where e� is the fixed point of τ .Kozen shows how this coinduction principle can be used to argue that the

expected running time of the modified program is better than the expectedrunning time of the original program. The calculations are purely algebraic inthis case. This line of research is highly suggestive and should be a main focusof research in probabilistic bisimulation.

7.10 Conclusions

In this chapter I have focused on strong probabilistic bisimulation for fullyprobabilistic systems. This is a somewhat conservative view, there are manyvariants of bisimulation to consider and there are more general models. Onthe other hand, I have addressed systems with continuous state spaces. Myown belief is that the latter will become more and more important and it isworthwhile keeping the other aspects simple in order to focus on this. As therelevant mathematics is assimilated by the community I expect to see all theother variations of probabilistic bisimulation extended to the continuous case:indeed, this has already started to happen.

The first major extension of these ideas begins with a critique of the relevanceof equivalence relations in the first place [JS90]. The argument runs as follows.If one considers two bisimilar systems (or two bisimilar states in one system), asmall perturbation of the transition probabilities will render them inequivalent,even though they are still very similar. If the systems depend on real-valuedparameters then these parameters cannot be known exactly and requiring anexact match as is commonly done for bismulation is problematic. What oneneeds instead is a metric.

The first idea that one can try is to allow the probabilities to match up to somesmall real parameter ε. Unfortunately this does not give a transitive relation. Areasonable thing to shoot for is a pseudo-metric, i.e. a metric that allows twodistinct points to be at zero distance. One would then require that the states at

Page 338: advanced topics in biosimulation and coinduction

322 Prakash Panangaden

zero distance would be bisimilar. The first definition of such a pseudo-metric isdue to Desharnais, Gupta, Jagadeesan and Panangaden [DGJP99]. The subjectwas subsequently explored at length by van Breugel and Worrell [vBW01b,vBW01a] who developed polynomial-time algorithms for computing some ofthe metrics. Applications to AI and MDPs were explored by Ferns et al. [FPP04,FPP05].

A very important concept to be explored is weak bisimulation. The case offully probabilistic processes was considered by Baier and Hermann [BH97]. Ofcourse when one considers weak bisimulation it is inevitable that one will haveto consider the interplay between non-determinism and probability. The mostsatisfactory definition is the one due to Philippa, Lee and Sikorsky [PLS00].A metric analogue for this concept was developed [DGJP02a] and a logicalcharacterisation theorem was proved [DGJP02b]. This was worked out forthe alternating model, i.e. for models where the probabilistic transitions andnon-deterministic choices alternate. In effect, one is able to name probabilitydistributions. In the non-alternating model the situation is somewhat different.

This model has been introduced by Segala and Lynch [SL94] under thename of probabilistic automata and has been extensively studied by Segala andhis students ever since then. Two important recent papers are [ST05, Seg06]where these notions are compared.

Finally I would like to mention the theory of real-time systems. This isof great importance in applications to performance evaluation. Jane Hill-ston [Hil94] has developed a process algebra geared to reasoning about perfor-mance issues, and bisimulation of real-time systems plays an important role. AsI have remarked before, the queueing theory community anticipated the key ideaof bisimulation when they defined lumpability. The systems of greatest inter-est are continuous-time Markov chains. Model checking algorithms for suchsystems have been developed [BHHK00, HCHC02]. Bisimulation for such sys-tems can be defined and in fact a logical characterisation theorem for CTMCswas proved with respect to continuous stochastic logic [DP03]. When one losesthe Markov property bisimulation cannot really be defined on the states sincethe behaviour will depend on how much time the system has already spentin the state. One can define a uniformity on such systems [GJP04, GJP06], aconcept that fits somewhere between a metric and an equivalence.

The theory of probabilistic systems is undergoing active development witha rapidly increasing sophistication of the mathematical tools being used. Thereare many fruitful directions to explore: efficient algorithms to compute met-rics, logical characterisation theorems, approximation results and extension ofvarious kinds. I hope that some of the readers of this chapter will be inspiredto work on this fascinating topic.

Page 339: advanced topics in biosimulation and coinduction

Probabilistic bisimulation 323

Bibliography

[AM89] P. Aczel and N. Mendler. A final-coalgebra theorem. In Category Theoryand Computer Science, number 389 in Lecture Notes in Computer Science,pages 357–365. Springer-Verlag, 1989.

[Arv76] W. Arveson. An Invitation to C�-Algebra. Springer-Verlag, 1976.[Ash72] R.B. Ash. Real Analysis and Probability. Academic Press, 1972.

[BDEP97] R. Blute, J. Desharnais, A. Edalat, and P. Panangaden. Bisimulation forlabelled Markov processes. In Proceedings of the 12th IEEE SymposiumOn Logic In Computer Science, Warsaw, Poland, 1997.

[BH97] C. Baier and H. Hermanns. Weak bisimulation for fully probabilistic pro-cesses. In Proceedings of the 1997 International Conference on ComputerAided Verification, number 1254 in Lecture Notes in Computer Science.Springer-Verlag, 1997.

[BHHK00] C. Baier, B. Haverkort, H. Hermanns, and J.-P. Katoen. Model check-ing continuous-time Markov chains by transient analysis. In CAV 2000:Proceedings of the 12th Annual Symposium on Computer-Aided Verifica-tion, number 1855 in Lecture Notes in Computer Science, pages 358–372.Springer-Verlag, 2000.

[Bil95] P. Billingsley. Probability and Measure. Wiley-Interscience, 1995.[BSdV04] F. Bartels, A. Sokolova, and E.P. de Vink. A hierarchy of probabilistic

system types. Theoretical Computer Science, 327:3–22, 2004.[DDLP06] V. Danos, J. Desharnais, F. Laviolette, and P. Panangaden. Bisimulation

and cocongruence for probabilistic systems. Information and Computation,204(4):503–523, 2006.

[DEP98] J. Desharnais, A. Edalat, and P. Panangaden. A logical characterizationof bisimulation for labelled Markov processes. In Proceedings of the 13thIEEE Symposium on Logic in Computer Science, Indianapolis, pages 478–489. IEEE Press, June 1998.

[DEP02] J. Desharnais, A. Edalat, and P. Panangaden. Bisimulation for labeledMarkov processes. Information and Computation, 179(2):163–193, 2002.

[DGJP99] J. Desharnais, V. Gupta, R. Jagadeesan, and P. Panangaden. Metrics forlabeled Markov systems. In Proceedings of CONCUR99, number 1664 inLecture Notes in Computer Science. Springer-Verlag, 1999.

[DGJP00] J. Desharnais, V. Gupta, R. Jagadeesan, and P. Panangaden. Approximationof labeled Markov processes. In Proceedings of the 15th Annual IEEESymposium on Logic in Computer Science, pages 95–106. IEEE ComputerSociety Press, June 2000.

[DGJP02a] J. Desharnais, V. Gupta, R. Jagadeesan, and P. Panangaden. The metric ana-logue of weak bisimulation for labelled Markov processes. In Proceedingsof the 17th Annual IEEE Symposium on Logic in Computer Science, pages413–422, July 2002.

[DGJP02b] J. Desharnais, V. Gupta, R. Jagadeesan, and P. Panangaden. Weak bisimula-tion is sound and complete for pCTL�. In L. Brim, P. Jancar, M. Kretinsky,and A. Kucera, editors, Proceedings of 13th International Conference onConcurrency Theory, CONCUR02, number 2421 in Lecture Notes in Com-puter Science, pages 355–370. Springer-Verlag, 2002.

Page 340: advanced topics in biosimulation and coinduction

324 Prakash Panangaden

[DGJP03] J. Desharnais, V. Gupta, R. Jagadeesan, and P. Panangaden. Approximatinglabeled Markov processes. Information and Computation, 184(1):160–200,2003.

[Dob03] E.-E. Doberkat. Semi-pullbacks and bisimulations in categories of stochas-tic relations. In J.C.M. Baeten, J.K. Lenstra, J. Parrow, and G.J.Woeinger, editors, Proceedings of the 27th International Colloquium OnAutomata Languages And Programming, ICALP’03, number 2719 in Lec-ture Notes in Computer Science, pages 996–1007. Springer-Verlag, July2003.

[Dob10] E.-E. Doberkat. Stochastic Coalgebraic Logic. Springer-Verlag, 2010.[DP03] J. Desharnais and P. Panangaden. Continuous stochastic logic characterizes

bisimulation for continuous-time Markov processes. Journal of Logic andAlgebraic Progamming, 56:99–115, 2003. Special issue on ProbabilisticTechniques for the Design and Analysis of Systems.

[Dud89] R.M. Dudley. Real Analysis and Probability. Wadsworth and Brookes/Cole, 1989.

[dVR97] E. de Vink and J.J.M.M. Rutten. Bisimulation for probabilistic transitionsystems: A coalgebraic approach. In Proceedings of the 24th InternationalColloquium on Automata Languages and Programming, 1997.

[dVR99] E. de Vink and J.J.M.M. Rutten. Bisimulation for probabilistic transi-tion systems: A coalgebraic approach. Theoretical Computer Science,221(1/2):271–293, June 1999.

[Eda99] A. Edalat. Semi-pullbacks and bisimulation in categories of Markov pro-cesses. Mathematical Structures in Computer Science, 9(5):523–543, 1999.

[FPP04] N. Ferns, P. Panangaden, and D. Precup. Metrics for finite Markov deci-sion precesses. In Proceedings of the 20th Conference on Uncertainty inArtificial Intelligence, pages 162–169, July 2004.

[FPP05] N. Ferns, P. Panangaden, and D. Precup. Metrics for Markov decisionprocesses with infinite state spaces. In Proceedings of the 21st Conferenceon Uncertainty in Artificial Intelligence, pages 201–208, July 2005.

[Gir81] M. Giry. A categorical approach to probability theory. In B. Banaschewski,editor, Categorical Aspects of Topology and Analysis, number 915 in Lec-ture Notes in Mathematics, pages 68–85. Springer-Verlag, 1981.

[GJP04] V. Gupta, R. Jagadeesan, and P. Panangaden. Approximate reasoning forreal-time probabilistic processes. In The Quantitative Evaluation of Sys-tems, First International Conference QEST04, pages 304–313. IEEE Press,2004.

[GJP06] V. Gupta, R. Jagadeesan, and P. Panangaden. Approximate reasoning forreal-time probabilistic processes. Logical Methods in Computer Science,2(1):paper 4, 2006.

[Hal74] P. Halmos. Measure Theory. Number 18 in Graduate Texts in Mathematics.Springer-Verlag, 1974. Originally published in 1950.

[HCHC02] B.R. Haverkort, L. Cloth, H. Hermans, J.-P. Katoen, and C. Baier. Modelchecking performability properties. In Proceedings of the InternationalConference on Dependable Systems and Networks 2002, pages 102–113.IEEE Computer Society, June 2002.

Page 341: advanced topics in biosimulation and coinduction

Probabilistic bisimulation 325

[Hil94] J. Hillston. A compositional approach to performance modelling. PhDthesis, University of Edinburgh, 1994. Published as a Distinguished Dis-sertation by Cambridge University Press in 1996.

[HJ94] J. Hoffman-Jørgenson. Probability With a View Towards Applications - Twovolumes. Chapman and Hall, 1994.

[JNW93] A. Joyal, M. Nielsen, and G. Winskel. Bisimulation and open maps. InProceedings of 8th Annual IEEE Symposium on Logic in Computer Science,pages 418–427, 1993.

[JS90] C.-C. Jou and S.A. Smolka. Equivalences, congruences, and completeaxiomatizations for probabilistic processes. In J.C.M. Baeten and J.W.Klop, editors, CONCUR 90 First International Conference on Concur-rency Theory, number 458 in Lecture Notes in Computer Science. Springer-Verlag, 1990.

[Koz06] D. Kozen. Coinductive proof principles for stochastic processes. InR. Alur, editor, Proceedings of the 21st Annual IEEE Symposium on Logicin Computer Science LICS’06, pages 359–366, August 2006.

[Koz07] D. Kozen. Coinductive proof principles for stochastic processes. LogicalMethods in Computer Science, 3(4:8):1–14, 2007.

[KS60] J.G. Kemeny and J.L. Snell. Finite Markov Chains. Van Nostrand, 1960.[KT66] J.F.C. Kingman and S.J. Taylor. Introduction to Measure and Probability.

Cambridge University Press, 1966.[LS91] K.G. Larsen and A. Skou. Bisimulation through probablistic testing. Infor-

mation and Computation, 94:1–28, 1991.[Pan01] P. Panangaden. Measure and probability for concurrency theorists. Theo-

retical Computer Science, 253(2):287–309, 2001.[Pan09] P. Panangaden. Labelled Markov Processes. Imperial College Press, 2009.[PLS00] A. Philippou, I. Lee, and O. Sokolsky. Weak bisimulation for probabilistic

processes. In C. Palamidessi, editor, Proceedings of CONCUR 2000, num-ber 1877 in Lecture Notes in Computer Science, pages 334–349. Springer-Verlag, 2000.

[Pop94] S. Popkorn. First Steps in Modal Logic. Cambridge University Press, 1994.[Rut95] J.J.M.M. Rutten. A calculus of transition systems (towards universal coal-

gebra). In A. Ponse, M. de Rijke, and Y. Venema, editors, Modal Logic andProcess Algebra, A Bisimulation Perspective, number 53 in CSLI LectureNotes, 1995. Available electronically from www.cwi.nl/˜janr.

[Rut98] J.J.M.M. Rutten. Relators and metric bisimulations. In Proceedings ofCoalgebraic Methods in Computer Science, volume 11 of ENTCS, 1998.

[Seg06] R. Segala. Probability and nondeterminism in operational models of con-currency. In Proceedings of the 17th International Conference on Concur-rency Theory CONCUR ’06, number 4137 in Lecture Notes in ComputerScience, pages 64–78, 2006.

[SL94] R. Segala and N. Lynch. Probabilistic simulations for probabilistic pro-cesses. In B. Jonsson and J. Parrow, editors, Proceedings of CONCUR94,number 836 in Lecture Notes in Computer Science, pages 481–496.Springer-Verlag, 1994.

[SL95] R. Segala and N. Lynch. Probabilistic simulations for probabilistic pro-cesses. Nordic Journal of Computing, 2(2):250–273, 1995.

Page 342: advanced topics in biosimulation and coinduction

326 Prakash Panangaden

[Sri98] S.M. Srivastava. A Course on Borel Sets. Number 180 in Graduate Texts inMathematics. Springer-Verlag, 1998.

[ST05] R. Segala and A. Turrini. Comparative analysis of bisimulation relationson alternating and non-alternating probabilistic models. In Proceedingsof the Second International Conference on the Quantitative Evaluation ofSystems (QEST), pages 44–53. IEEE Press, September 2005.

[vBW01a] F. van Breugel and J. Worrell. An algorithm for quantitative verificationof probabilistic systems. In K.G. Larsen and M. Nielsen, editors, Proceed-ings of the Twelfth International Conference on Concurrency Theory –CONCUR’01, number 2154 in Lecture Notes in Computer Science, pages336–350. Springer-Verlag, 2001.

[vBW01b] F. van Breugel and J. Worrell. Towards quantitative verification of proba-bilistic systems. In Proceedings of the Twenty-eighth International Collo-quium on Automata, Languages and Programming. Springer-Verlag, 2001.

[vGSST90] R. van Glabbeek, S. Smolka, B. Steffen, and C. Tofts. Reactive generativeand stratified models for probabilistic processes. In Proceedings of the 5thAnnual IEEE Symposium on Logic in Computer Science, 1990.