We use cookies to distinguish you from other users and to provide you with a better experience on our websites. Close this message to accept cookies or find out how to manage your cookie settings.
To save content items to your account,
please confirm that you agree to abide by our usage policies.
If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account.
Find out more about saving content to .
To save content items to your Kindle, first ensure no-reply@cambridge.org
is added to your Approved Personal Document E-mail List under your Personal Document Settings
on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part
of your Kindle email address below.
Find out more about saving to your Kindle.
Note you can select to save to either the @free.kindle.com or @kindle.com variations.
‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi.
‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.
Petri nets are one of the most popular tools for modeling distributed systems. This book provides a modern look at the theory behind them, by studying three classes of nets that model (i) sequential systems, (ii) non-communicating parallel systems, and (iii) communicating parallel systems. A decidable and causality respecting behavioral equivalence is presented for each class, followed by a modal logic characterization for each equivalence. The author then introduces a suitable process algebra for the corresponding class of nets and proves that the behavioral equivalence proposed for each class is a congruence for the operator of the corresponding process algebra. Finally, an axiomatization of the behavioral congruence is proposed. The theory is introduced step by step, with ordinary-language explanations and examples provided throughout, to remain accessible to readers without specialized training in concurrency theory or formal logic. Exercises with solutions solidify understanding, and the final chapter hints at extensions of the theory.
Session types are type-theoretic specifications of communication protocols in concurrent or distributed systems. By codifying the structure of communication, they make software more reliable and easier to construct. Over recent decades, the topic has become a large and active research area within the field of programming language theory and implementation. Written by leading researchers in the field, this is the first text to provide a comprehensive introduction to the key concepts of session types. The thorough theoretical treatment is complemented by examples and exercises, suitable for use in a lecture course or for self-study. It serves as an entry point to the topic for graduate students and researchers.
Mobile systems, whose components communicate and change their structure, now pervade the informational world and the wider world of which it is a part. The science of mobile systems is as yet immature, however. This book presents the pi-calculus, a theory of mobile systems. The pi-calculus provides a conceptual framework for understanding mobility, and mathematical tools for expressing systems and reasoning about their behaviours. The book serves both as a reference for the theory and as an extended demonstration of how to use pi-calculus to describe systems and analyse their properties. It covers the basic theory of pi-calculus, typed pi-calculi, higher-order processes, the relationship between pi-calculus and lambda-calculus, and applications of pi-calculus to object-oriented design and programming. The book is written at the graduate level, assuming no prior acquaintance with the subject, and is intended for computer scientists interested in mobile systems.
The theoretical foundation of functional programming is the Curry-Howard correspondence, also known as the propositions as types paradigm. Types in simply typed lambda calculus correspond to propositions in intuitionistic logic: function types correspond to logical implications, and product types correspond to logical conjunctions. Not only that, programs correspond to proofs and computation corresponds to a procedure of cut elimination or proof normalisation in which proofs are progressively simplified. The Curry-Howard view has proved to be robust and general and has been extended to varied and more powerful type systems and logics. In one of these extensions the language is a form of pi calculus and the logic is linear logic, with its propositions interpreted as session types. In this chapter we present this system and its key results.
This chapter introduces a variant of the pi calculus defined in Chapter 2. We drop choice and channel closing, retaining only message passing. To compensate, messages may now carry values other than channel endpoints: we introduce record and variant values, both of which are standard in functional languages. We further introduce new processes to eliminate the new values. We play the same game at the type level: from input/output, external/internal choice and the two end types, we retain only input/output types. In return we incorporate record and variant types, again standard from functional languages. Unlike the input and output types in all preceding chapters, those in this chapter have no continuation. These changes lead to a linear pi calculus with record and variant types. The interesting characteristic of this calculus is that it allows us to faithfully encode the pi calculus with session types, even though it has no specific support for session types. We present an encoding based on work by Dardha, Giachino and Sangiorgi.
The previous chapters present a linear world in which each channel endpoint is possessed by exactly one thread. Linearity allows precise control of interference and that can be useful. If two processes engage in a series of consecutive message exchanges then we can be sure that messages are not sent to or received from foreign processes. Although linearity is often convenient, it can also be detrimental in concurrent systems. Purely linear systems cannot describe e-commerce interactions where a server (or a pool of servers) is expected to serve a much larger number of clients. Linear systems also fail to describe an auction, where at the end, only one bidder is to get the item for sale. This chapter introduces a type discipline that provides for channels that can be shared and consequently for processes that compete for resources, thus creating race conditions and nondeterminism. We do this in such a way that we do not need to revisit process formation or process reduction, and process typing only requires mild changes. We define the language and type system as extensions of those in Chapter 3.
Up to now, we have presented session type systems for the pi calculus. If session types are to be used for practical software development, they need to be applied to standard programming language paradigms rather than a foundational calculus. This chapter takes a step in that direction by defining a session type system for a concurrent lambda calculus, which can be regarded as a core concurrent programming language. After presenting some examples, we introduce a syntax for functional programs with concurrency and channel-based communication. We include infinite types from the beginning (based on Chapter 3) and include sharing (Chapter 4) and subtyping (Chapter 5). We then introduce a type system for the functional language, develop its operational semantics and prove type safety.
This chapter presents the basic concepts of session types, using the pi calculus as a core concurrent programming language for which a type system is defined. It assumes some familiarity with the pi calculus and the concepts of operational semantics and type systems. References to background reading are included at the end of the chapter.
Many type systems include the concept of subtyping, allowing a value of one type (the subtype) to be used as if it is a value of another type (the supertype). The aim is to allow greater flexibility in programming, while maintaining safety. In this chapter, we see how subtyping can be included in our system of session types. We build on the language in Chapter 4, using replicated input, rather than recursive process definitions, to express repetitive behaviour.
This chapter describes the evolution of computing systems, from data processing to an emphasis on communication, and motivates a corresponding evolution of the concept of typing. Data types codify the structure of data, and go back to the early days of programming languages. This book is about session types, which codify the structure of communication – they are type-theoretic specifications of communication protocols. The chapter summarises the assumptions about communication that are necessary for the theory of session types, and describes the behavioural safety properties that are guaranteed by checking session types.
The earlier chapters present session type systems declaratively, focusing on how typing judgements describe the way in which processes use channels. In order to apply session types to programming languages, it is essential to be able to implement an efficient typechecking algorithm which answers the question: given a candidate typing judgement, is it derivable? The declarative typing rules, however, are not immediately suitable for implementation. In this chapter we explain the problem and how to overcome it.
This chapter develops a theory of infinite session types in order to describe communication protocols that allow unbounded behaviour. The theory is based on the technical machinery of recursive types, coalgebras and coinduction, which the chapter introduces at an elementary level. Recursive process definitions are introduced so that unbounded behaviour can be implemented. The type safety results of Chapter 2 are extended to the new setting.
Communication in the languages presented so far is synchronous: a sending action blocks the sender until it can interact with a compatible receiving action at the intended receiver. In this chapter, we consider an alternative semantics for interactions: asynchronous communication. Asynchronous communication allows for a sending action to be executed without waiting for the receiver to be ready by storing the sent message in a message queue that the intended receiver can later read.
We introduce our first choreography language, Simple Choreographies, which allows for writing sequences of interactions between processes. The key aspect of the language is that interactions are syntactically manifest in choreographies. A semantics of choreographies is obtained in terms of a labelled transition system.