Programming in the Pi-Calculus: A Tutorial Introduction to Pict

Pict is a programming language in the ML tradition, formed by adding high-level derived forms and a powerful static type system to a tiny core language. The core, Milner's pi-calculus, has been used as a theoretical foundation for a broad class of concurrent computations. The goal in Pict is to identify idioms that arise naturally when these primitives are used to build working programs | idioms such as basic data structures, protocols for returning results, higher-order programming, selective communication, and concurrent objects. The type system integrates a number of features found in recent work on theoretical foundations for typed object-oriented languages: higher-order polymorphism, simple recursive types, subtyping, and a useful partial type inference algorithm. This is a tutorial introduction to Pict, with examples and exercises. Consumer Safety Warning Pict is an evolving language design and the current implementation is experimental software. You are welcome to use Pict in any way you like, but please keep in mind that future versions may di er substantially from what you nd here. Product Feedback Hotline If you would like to be kept informed of new releases of Pict, please send your address to benjamin.pierce@cl.cam.ac.uk. Comments, suggestions, and bug reports are also welcome. (Please send these to both benjamin.pierce@cl.cam.ac.uk and dnt@dcs.gla.ac.uk.) Suggestions for improvement of the documentation are especially welcome. Copying Pict is copyright c 1993{1996 by Benjamin C. Pierce and David N. Turner. This program and its documentation are free software; you can redistribute them and/or modify them under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Pict is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or tness for a particular purpose. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Citations The best bibliographic single citation for Pict is [PT96a]. Others that may be of interest are [PT95, PT96b, Tur96] and [Pie96] (this document). 1

[1]  Luca Cardelli,et al.  Subtyping recursive types , 1991, POPL '91.

[2]  Martín Abadi,et al.  A PER model of polymorphism and recursive types , 1990, [1990] Proceedings. Fifth Annual IEEE Symposium on Logic in Computer Science.

[3]  de Ng Dick Bruijn,et al.  Lambda calculus notation with nameless dummies, a tool for automatic formula manipulation, with application to the Church-Rosser theorem , 1972 .

[4]  A. Church The calculi of lambda-conversion , 1941 .

[5]  David Walker Algebraic Proofs of Properties of Objects , 1994, ESOP.

[6]  Benjamin C. Pierce,et al.  Bounded Existentials and Minimal Typing , 1998, Theor. Comput. Sci..

[7]  John C. Mitchell,et al.  PER models of subtyping, recursive types and higher-order polymorphism , 1992, POPL '92.

[8]  John C. Mitchell Toward a typed foundation for method specialization and inheritance , 1989, POPL '90.

[9]  William R. Cook,et al.  Inheritance is not subtyping , 1989, POPL '90.

[10]  Robin Milner,et al.  Communication and concurrency , 1989, PHI Series in computer science.

[11]  Mario Tokoro,et al.  An Object Calculus for Asynchronous Communication , 1991, ECOOP.

[12]  Luca Cardelli,et al.  Operations on records , 1989, Mathematical Structures in Computer Science.

[13]  Cliff B. Jones A pi-Calculus Semantics for an Object-Based Design Notation , 1993, CONCUR.

[14]  R. Milner Action Structures , 1992 .

[15]  Luca Cardelli. Amber Combinators and Functional Programming Languages , 1985, Lecture Notes in Computer Science.

[16]  John McCarthy,et al.  History of LISP , 1978, SIGP.

[17]  Giorgio Ghelli,et al.  Divergence of F< Type Checking , 1995, Theor. Comput. Sci..

[18]  R. Milner Calculi for interaction , 1996, Acta Informatica.

[19]  John H. Reppy,et al.  CML: A Higher-Order Concurrent Language , 1991, PLDI.

[20]  Luca Cardelli,et al.  On understanding types, data abstraction, and polymorphism , 1985, CSUR.

[21]  John H. Reppy,et al.  Higher-Order Concurrency , 1992 .

[22]  Robin Milner,et al.  Functions as processes , 1990, Mathematical Structures in Computer Science.

[23]  Jens Palsbergypalsberg,et al.  Eecient Recursive Subtyping , 1993 .

[24]  Felice Cardone,et al.  Relational Semantics for Recursive Types and Bounded Quantification , 1989, ICALP.

[25]  Mitchell Wand,et al.  Complete Type Inference for Simple Objects , 1987, LICS.

[26]  Martin Hofmann,et al.  A unifying type-theoretic framework for objects , 1994, Journal of Functional Programming.

[27]  Gul A. Agha,et al.  ACTORS - a model of concurrent computation in distributed systems , 1985, MIT Press series in artificial intelligence.

[28]  Giorgio Ghelli,et al.  Coherence of Subsumption, Minimum Typing and Type-Checking in F<= , 1992, Math. Struct. Comput. Sci..

[29]  Luca Cardelli,et al.  A Semantics of Multiple Inheritance , 1984, Inf. Comput..

[30]  Luca Cardelli An implementation of F , 1993 .

[31]  Mario Coppo,et al.  Type Inference with Recursive Types: Syntax and Semantics , 1991, Inf. Comput..

[32]  Benjamin C. Pierce,et al.  Simple type-theoretic foundations for object-oriented programming , 1994, Journal of Functional Programming.

[33]  Robin Milner,et al.  Principal type-schemes for functional programs , 1982, POPL '82.

[34]  Benjamin C. Pierce,et al.  A Typed Higher-Order Programming Language Based on the Pi-Calculus , 1993 .

[35]  Jerzy Tiuryn,et al.  Type Reconstruction with Recursive Types and Atomic Subtyping , 1993, TAPSOFT.

[36]  John C. Mitchell,et al.  Abstract types have existential type , 1988, TOPL.

[37]  Robin Milner,et al.  A Calculus of Communicating Systems , 1980, Lecture Notes in Computer Science.

[38]  Adriana B. Compagnoni,et al.  Decidability of Higher-Order Subtyping with Intersection Types , 1994, CSL.

[39]  Patrick Varone,et al.  Implementation of `Generic Synchronization Policies' in Pict , 1996 .

[40]  Robin Milner,et al.  A Theory of Type Polymorphism in Programming , 1978, J. Comput. Syst. Sci..

[41]  Giorgio Ghelli Recursive Types Are not Conservative over F , 1993, TLCA.

[42]  Oscar Nierstrasz,et al.  Formalizing Composable Software Systems — A Research Agenda , 1997 .

[43]  Benjamin C. Pierce,et al.  Decoding Choice Encodings , 1996, CONCUR.

[44]  Michael Papathomas A Unifying Framework for Process Calculus Semantics of Concurrent Object-Based Languages and Feature , 1991 .

[45]  Benjamin C. Pierce,et al.  Concurrent Objects in a Process Calculus , 1994, Theory and Practice of Parallel Programming.

[46]  Dale A. Miller,et al.  AN OVERVIEW OF PROLOG , 1988 .

[47]  Vasco Thudichum Vasconcelos,et al.  Typed Concurrent Objects , 1994, ECOOP.

[48]  John C. Mitchell,et al.  Notes on Typed Object-Oriented Programming , 1994, TACS.

[49]  G. Erard Boudol Asynchrony and the -calculus (note) , 1992 .

[50]  Benjamin C. Pierce,et al.  Programming in higher-order typed lambda-calculi , 1989 .

[51]  Oscar Nierstrasz,et al.  Towards an Object Calculus ∗ , 1991 .

[52]  Carl Hewitt,et al.  Viewing Control Structures as Patterns of Passing Messages , 1977, Artif. Intell..

[53]  Gordon D. Plotkin,et al.  An ideal model for recursive polymorphic types , 1984, Inf. Control..

[54]  P. J. Landin,et al.  The next 700 programming languages , 1966, CACM.

[55]  Robin Milner,et al.  The Polyadic π-Calculus: a Tutorial , 1993 .

[56]  Simon J. Gay,et al.  A sort inference algorithm for the polyadic π-calculus , 1993, POPL '93.

[57]  Kim B. Bruce A paradigmatic object-oriented programming language: Design, static typing and semantics , 1994, Journal of Functional Programming.

[58]  Luca Cardelli,et al.  An Extension of System F with Subtyping , 1991, TACS.