Abstract: The paper will introduce a very important calculus of communicating systems in which one can naturally express processes which have changing structure, called π-calculus. In the π-calculus, the component agents of a system can be arbitrarily linked and a communication between neighbors may carry information which changes that linkage. π-calculus is an extension of the process algebra CCS, following work by Engberg and Nielsen who added mobility to CCS while preserving it algebraic properties. We will present some features of theπ-calculus and give a brief introduction it in the text, compared with its ancestor. At last, some examples will be introduced to illustrate its rich and mobile features.
Keywords: π-calculus, CCS, agent, name
1 Introduction
π-calculus is a calculus of communication systems, especially fit to be applied to mobile processes due to its mobile features. In theπ-calculus, the component agents of a system can be arbitrarily linked, and a communication between neighbors may carry information which changes that linkage.
Uffe Engberg and Mogens Nielsen extended CCS to include mobility while preserving its algebraic properties. The addition of name-as-parameters to CCS provides great modeling strength and transforms the nature of these algebras So the π-calculus is more flexible and convenient than its ancestor. π-calculus aims for universality at an elementary level for concurrent computation, just as the λ-calculus is universal for functional computation. π-calculus is a labeled transition system defined by structural inference rules.
Firstly, the paper presents the constructions of the π-calculus with some notions. Secondly, we will show its important features, meanwhile , and compare the π-calculus and its ancestor, CCS ( a famous process algebra ) briefly. Lastly, we will introduce some examples to illustrate its flexible applications.
2 The construction of the π-calculus
Compared with CCS, the π-calculus removes all distinction among link names, variables and ordinary data values; we call them all names. So there will be just two essential classes of entity: names and agents. Restriction and input-prefix become name-binding operators of different nature; restriction localizes the scope of a name, while input-prefix is being a place-holder for a name which may be received as input.
The only purpose of communication is to transmit or to receive a name which will admit further communications.
We presuppose an infinite set Νof names, and let x, y, z range over names. We also
presuppose a set Κ of agent identifiers, each with an arity 0. We let A, B,
C,… range over agent identifiers and let P, Q, R,… range over the agents.
1 agents in the π-calculus
There are six kinds of agent in the π-calculus as follows:
(1). A summation , where the index set I is finite.
The agent behaves like one or other of the . We write 0 for the empty summation, and call it inaction, which can do nothing.
(2). A prefix form , y(x).P or τ.P
‘ ’ is called a negative prefix. may be thought of as an output port of an agent which contains it; outputs the name x at port and then behaves like P.
‘y(x).’is called a positive prefix. A name y name be thought of as an input port of an agent; y(x).P inputs an arbitrary name z at port y and then behaves like P{z/x}. The name x is bound by the positive prefix ‘y(x).’. A negative prefix does not bind a name.
‘τ’is called a silent prefix. τ.P performs the silent actionτ and then behaves like P.
(3). A composition |
The agent consists of and acting in parallel. and may act independently, but an output action of at any output port may synchronize with an input action of at x, to create a silent (τ) action of the composite agent | .
(4). A restriction (x).P
The agent behaves like P except that actions at and x are prohibited, but communication between components of P along the link x are not prohibited, since they have become τ actions.
(5). A match [x=y]P
The agent behaves like P if the names x and y are identical, and otherwise like 0 .
(6). A defined agent A( ,…, )
For any agent identifier A with arity n used thus, there must be a unique defining equation A( ,…, ) P, where the names ,…, are distinct and are the only names which may occur free in P. The A( ,…, ) behaves like P{ / ,…, / }. Defining equations provide recursion, since P may contain any agent identifier, even A itself.
When our attention is confined to finite agents, the agent identifiers and their definitions can be omitted, thus removing recursion.
2 further definitions
(1) The free names fn(P) of P are just those names which occur in P not bound either by a positive prefix or by a restriction. We write fn( , ,…) for fn( )∪fn( )∪….
(2) As in the λ-calculus we shall not distinguish between agents alpha-convertible, i.e. which differ only by a change of bound names. We shall write P Q if P and Q are alpha-convertible.
(3) We shall sometimes write for the vector { ,…, } of names, where n is understood from context.
(4) We write P{ / ,…, / }, or P{ / } or P{ / }, for the simultaneous substitution of for all free occurrences of in P, with change of bound names if necessary to prevent any of the new names from becoming bound in P.
(5) In the prefixes ‘ ’and ‘y(x).’we say that y is the subject, and x is the object or parameter. It is the names occurring free in subject position which determine the current communication capabilities of an agent.
(6) The precedence among the syntactic forms as follows:
3 The important features of the (compared with CCS)
Apart from the presence of parallel composition, the outstanding difference between theπ-calculus and the λ-calculus is that names may be instantiated only to names, not to agents (i.e. expressions).
The free names of an agent represent its current knowledge of, or linkage to, other agents. The free names fn(P) correspond roughly to what is called in CCS the sort of P. But there are differences. First, a sort in CCS contains both names and co-names such as ; if {a, } is the sort of a CCS agent P, it means that P may input on the link a and output on the link b, but not vice versa. But in the π-calculus, we do not yet wish to adopt this refinement. Second, in CCS a sort cannot grow throughout the history of an agent; however, the free names fn(P) can grow throughout P’s subsequent history, since P can receive names in communication. Third, a free occurrence of x in subject position in P indicates that P may communicate along the link x, while a free occurrence in object position merely indicates that P may pass x as a parameter; it is only the former type of occurrence which corresponds closely to CCS sort, since CCS did not admit the latter type.
In CCS there is no risk of confusing the binding of an ordinary data variable x, in a positive prefix form a(x).P, with the restriction of a port-name a as in Q/a. That is because port names are distinct from data variables in CCS. But in the π-calculus , they are identified. More accurately, primitive values are represented as names, while compound values are represented as processes.
In y(x).P, x is a place-holder for any name which may be received on the link y, and this may even be a name already free in P; thus the variable bound by a positive prefix is susceptible to arbitrary instantiation.
In (x)Q, x represents a name which is private to Q, and which moreover can never be identified with any other name in Q.
4 Basic examples
Example 1: Link passing
The agent P has a link x to R, and wishes to pass x along its link y to Q. Q is willing to receive it. So the transition is:
in the diagram is {x/z}.From the above diagrams, we can see the linkage , but after the transition x has been passed to Q ( )
Example 2: Scope extrusion
P has a private link x to R and wishes to pass x along link y to Q. Q is willing to receive it, and possesses no x-link. So the transition is:
in the diagram is {x/z}. x is exported to Q the scope of the restriction is extended.
5 Conclusions & Acknowledgements
Conclusions
π-calculus is a calculus of communication systems, its occurrence thanks to Uffe Engberg and Mogens Nielsen , who extended CCS to include mobility while preserving its algebraic properties. The π-calculus has many important features so that it can be applied very conveniently to communication systems, especially for mobile system.
The paper just gives a brief introduction to theπ-calculus, more information in [1],[2].
Acknowledgements
Thank teacher Meng for providing many papers, most of which are referenced by the paper.
References
[1] Robin Milner,..., “A Calculus of Mobile Processes, Part I”
[2] Hennessy, M. and Milner, R., “Algebraic laws for non-determinism and concurrency”, Journal of ACM, Vol 32, pp137-161, 1985.