• No results found

7 8

N/A
N/A
Protected

Academic year: 2021

Share "7 8"

Copied!
12
0
0

Loading.... (view fulltext now)

Full text

(1)

I a m greatly h o n o r e d to receive this award, b e a r i n g the n a m e of Pdan Turing. Perhaps Turing would be pleased that it should go to someone e d u c a t e d at his old college, K i n g ' s College at C a m b r i d g e . W h i l e there in 19561 wrote m y first c o m p u t e r p r o g r a m ; it was on the E D S A C . O f course E D S A C m a d e history. But I a m a s h a m e d to say it did not lure me into c o m p u t i n g , a n d I ignored c o m p u t e r s for four years. I n 1960 I thought that computers might be m o r e peaceful to h a n d l e t h a n s c h o o l c h i l d r e n - - I was then a t e a c h e r - - s o I a p p l i e d for a j o b at Ferranti in L o n d o n , at the time of Pegasus. I was asked at the interview w h e t h e r I would like to devote m y life to computers. This d a u n t i n g notion had never crossed m y mind. Well, here I a m still, and I have h a d the lucky chance to grow alongside com- p u t e r science.

This award gives an u n u s u a l opportunity, a n d I hope a license, to reflect on a line of research from a personal point of view. I thought I should seize the opportunity, because a m o n g m y interests there is one t h r e a d which has p r e o c c u p i e d m e for 20 years. D e s c r i b i n g this kind of experience can surely yield insight, provided one r e m e m b e r s that it is a personal thread; science is woven from m a n y such threads and is all the stronger when each t h r e a d is h a r d to trace in the finished fabric.

T h e t h r e a d which I want to pick u p is the semantic basis of concur- rent computation. I shall begin by explaining how I c a m e to see that concurrency requires a fresh ap- proach, not m e r e l y an extension of the repertoire of entities and con-

structions which explain sequential computing. T h e n I shall talk about m y efforts to find basic construc- tions for concurrency, guided by experience with sequential s e m a n - tics. T h i s is the work which led to a Calculus for C o m m u n i c a t i n g Systems (CCS). At that point I shall briefly discuss the extent to which these constructions m a y be u n d e r s t o o d mathematically, in the way that sequential c o m p u t i n g m a y be u n d e r s t o o d in terms of functions.

Finally, I shall outline a new basic calculus for concurrency; it gives p r o m i n e n c e to the old i d e a of naming or reference, which has hitherto been treated as a second-class citizen by theories of computing.

I m a k e a disclaimer. I reject the idea that there can be a u n i q u e con- ceptual model, or one preferred for- malism, for all aspects of s o m e t h i n g as large as concurrent c o m p u t a t i o n , which is in a sense the whole of o u r s u b j e c t - - c o n t a i n i n g sequential com- p u t i n g as a well-behaved special area.

We need m a n y levels of explanation:

m a n y different languages, calculi, a n d theories for the different spe- cialisms. T h e applications are various: the flow of i n f o r m a t i o n in an insurance company, network com- munications, the real-time com- m u n i c a t i o n a m o n g in-flight control computers, c o n c u r r e n c y control in a database, the behavior of parallel object-oriented p r o g r a m s , the semantic analysis of variables in concurrent logic p r o g r a m m i n g . We surely do not expect the terms of discussion and analysis to be the same for all of these.

But there is a c o m p l e m e n t a r y claim to make, a n d it is this: C o m p u t e r

scientists, as all scientists, seek a com- m o n framework in which to link and to organize m a n y levels of expla- nation; moreover, this c o m m o n f r a m e w o r k m u s t be semantic, since o u r explanations (including pro- grams) are typically in formal l a n g u a g e - - a n d often in a m i x t u r e of formalisms, to deal with the large heterogeneous systems which are o u r business. For the m u c h smaller world of sequential c o m p u t a t i o n , a com- m o n semantic f r a m e w o r k is f o u n d e d on the central notion of a mathematical function a n d is formally expressed

in a functional c a l c u l u s - - o f which A l o n z o C h u r c h ' s l - c a l c u l u s is the famous prototype. F u n c t i o n s are an essential ingredient of the air we breathe, so to speak, when we discuss the semantics of sequential p r o g r a m - ming. But for c o n c u r r e n t p r o g r a m - m i n g and interactive systems in general, we have n o t h i n g c o m p a r a b l e .

So where do we find the semantic ingredients for concurrency, or how can we distill them? It is an a m b i t i o u s goal because, as I said earlier, con- currency is ubiquitous. I believe that the right ideas to explain concurrent c o m p u t i n g will only come from a dialectic between models from logic and m a t h e m a t i c s a n d a p r o p e r distil- lation of a practical experience.

I conduct a piece of the dialectic.

I try to reconcile the a n t i t h e s i s - - f o r it does seem to be o n e - - b e t w e e n two things: on the one hand, the p u r i t y a n d simplicity exemplified by the calculus of functions and, on the other hand, some very concrete ideas a b o u t c o n c u r r e n c y a n d interaction suggested by p r o g r a m m i n g a n d the realities of c o m m u n i c a t i o n .

78 .January 1993/Vol.36, No.l / ¢ O M I I I U N | ¢ A T I O N S O F T H E A C M

(2)

m

T u r | n g

L e c t u r e i

i I

¢OMMUNICATIONSOFTHEACil/J~NuaFy 1993/Vol.36, No.l 7 9

(3)

l e m e n t s o f I n t e r a c t i o n

Entitles

T h r o u g h the seventies, I became convinced that a t h e o r y o f concur- rency and interaction requires a new conceptual framework, not j u s t a re- f i n e m e n t o f what we find n a t u r a l for sequential c o m p u t i n g .

Often, the experiences which give one conviction are not p l a n n e d a n d not p r o f o u n d . But I want to recall one o f mine, because it serves the t h e m e h e r e in m o r e than one way.

It arose when I was trying to e x t e n d the S c o t t - S t r a c h e y a p p r o a c h to p r o g r a m m i n g - l a n g u a g e semantics, which deals beautifully with the most sophisticated sequential languages, to h a n d l e c o n c u r r e n t languages as well. T h e a t t e m p t had to be made, a n d I was optimistic a b o u t success.

I n that a p p r o a c h a sequential p r o - gram, assuming no i n t e r m e d i a t e i n p u t / o u t p u t , is perfectly r e p r e - sented by a function f r o m m e m o r i e s to memories. (I use the t e r m "mem- ory" to m e a n a m e m o r y state, con- taining values for all the p r o g r a m variables.) But Dana Scott d e v e l o p e d a t h e o r y o f domains--partially or- d e r e d sets o f a special n a t u r e - - w h i c h provides m e a n i n g for the A-calculus, the p r i m e functional calculus. So in the S c o t t - S t r a c h e y a p p r o a c h , the m e a n i n g o f an imperative p r o g r a m lies in the d o m a i n given by the equa- tion

P r o g r a m Meanings =

Memories ~ Memories.

Everything works well with this do- main, a n d the reason is: that to every syntactic construction in any sequen- tial language, t h e r e c o r r e s p o n d s an abstract o p e r a t i o n which builds the m e a n i n g o f a composite p r o g r a m f r o m the meanings o f its c o m p o n e n t p r o g r a m s . T h a t is, the semantics is

compositional--an essential p r o p e r t y . Now, one o f the things that con- c u r r e n c y introduces is n o n d e t e r - minism. (Of course you can also have n o n d e t e r m i n i s m without concur- rency, but in my o p i n i o n it is concur- rency which inflicts n o n d e t e r m i n i s m on you.) Plotkin dealt with n o n d e t e r - minism by means o f his power- d o m a i n construction, a tour de force o f d o m a i n theory. It provides, for any suitable d o m a i n D, the p o w e r d o m a i n T(D) whose elements are subsets o f D.

So with n o n d e t e r m i n i s m in m i n d we can r e d e f i n e the meanings o f pro- g r a m s as

P r o g r a m Meanings =

Memories --> P(Memories) - - e s s e n t i a l l y relations over m e m o - ries. This semantics is perfectly com- positional for the kind o f n o n d e t e r - ministic l a n g u a g e which you get by a d d i n g " d o n ' t care" b r a n c h i n g to a sequential language.

But c o n c u r r e n c y has a shock in store; the compositionality /s lost if you can combine s u b p r o g r a m s to r u n in parallel, because they can i n t e r f e r e with one another. To be precise, t h e r e are p r o g r a m s P1 a n d P2 which have the same relational meaning, but which behave differently when each runs in parallel with a third pro- g r a m Q. A simple e x a m p l e is this:

P r o g r a m P ~ : x : = 1 ; x : = x + 1 P r o g r a m P2 : x := 2

I n the absence o f interference, P l a n d P2 both t r a n s f o r m the initial m e m o r y by replacing the value o f x by 2, so they have the same meaning.

But if you take the p r o g r a m P r o g r a m Q : x := 3

a n d r u n it in parallel with P l a n d P2 in turn:

P r o g r a m R1 : P1 p a r Q P r o g r a m R2 : P2 p a r Q

then the p r o g r a m s Rl a n d Rz have d i f f e r e n t meaning. (Even if an as- s i g n m e n t statement is executed indi- visibly, R1 can end u p with x equal to 2, 3, o r 4, while R2 can only e n d u p with x equal to 2 o r 3.) So a composi- tional semantics must be m o r e re- fined; it has to take account o f the way that a p r o g r a m interacts with the m e m o r y .

This p h e n o m e n o n is h a r d l y a sur-

prise, with hindsight. But if we cannot use functions o r relations over m e m o r i e s to i n t e r p r e t concur- r e n t p r o g r a m s , then what can we use? Well, one can quite naturally give the relational m e a n i n g a finer granularity, so that it records every step which a p r o g r a m makes f r o m one m e m o r y access to the n e x t - - a n d this can be d o n e without leaving d o m a i n theory. But the p h e n o m e - non t a u g h t m e a m o r e radical lesson:

Once the m e m o r y is no l o n g e r at the behest o f a single master, t h e n the master-to-slave (or: function-to- value) view o f the p r o g r a m - t o - m e m o r y relationship becomes a bit o f a fiction. A n old p r o v e r b states:

H e who serves two masters serves none. It is better to d e v e l o p a general m o d e l o f interactive systems in which the p r o g r a m - t o - m e m o r y interaction is j u s t a special case o f interaction a m o n g peers.

It helps to visualize. F i g u r e l shows the s h a r e d - m e m o r y model, very informally. It j u s t r e p r e s e n t s the active/passive distinction between c o m p o n e n t s , by using d i f f e r e n t l y s h a p e d nodes. (I shall consistently use squares for active processes in my pictures a n d circles for passive things.) O f course, in g e n e r a l the p r o g r a m s use several variables, all s t o r e d in M.

To r e m o v e the active/passive dis- tinction, we shall elevate M to the sta- tus o f a process; then we r e g a r d p r o - g r a m variables x, y , . . . as the names o f channels of interaction between pro- g r a m a n d m e m o r y , as shown in Fig- ure 2.

Now, thinking m o r e generally, let us use m e m o r i e s to illustrate the idea that p r o c e s s e s - - o f any k i n d - - c a n be c o m p o s e d to m a k e l a r g e r ones.

I n the sequential world one can maintain the convenient fiction that a m e m o r y is monolithic; but this is quite unrealistic in c o n c u r r e n t p r o - g r a m m i n g , because d i f f e r e n t parts o f m e m o r y may be accessed simultane- ously. So we go one step f u r t h e r , as shown in F i g u r e 3, a n d r e g a r d each cell o f m e m o r y as a process, X say, linked to one o r m o r e p r o g r a m s (themselves processes) by an a p p r o - priately n a m e d channel.

Software engineers may well resist this h o m o g e n e o u s t r e a t m e n t a n d firmly a d h e r e to the s h a r e d - m e m o r y

8 0 January 1993/Vol.36, No.1 /¢OMMUHICATIONS OF T I l E ACM

(4)

model; it is i m p o r t a n t for them, be- cause it admits a m e t h o d o l o g y which can help in writing correct p r o g r a m s . Theoreticians may reply that to tol- erate two kinds o f entity in a basic model, where one kind will do, is sci- entific a n a t h e m a ; they may also point out that the active/passive distinction o f the s h a r e d - m e m o r y m o d e l does not easily a c c o m m o d a t e hybrids, such as a database which reorganizes itself while you are not using it. A n d both these attitudes are right.

So let us recall the need for m a n y levels o f explanation. William o f Occam o p p o s e d the proliferation o f entities, but only when carried be- y o n d what is n e e d e d --procter neces- sitatem! C o m p u t e r systems engineers have a pressing n e e d for a rich ontol- ogy; they welcome the ability to use d i f f e r e n t concepts and models for d i f f e r e n t purposes. For example, the s h a r e d - m e m o r y m o d e l is a n a t u r a l p a r t o f their r e p e r t o i r e . But com- p u t e r scientists must also look for s o m e t h i n g basic which underlies the various models; they are interested not only in individual designs and systems, but also in a unified t h e o r y o f their ingredients. T o attain unity in a basic model o f concurrency, all i n t e r a c t i o n s - - a n d t h e r e f o r e all inter- a c t o r s - - m u s t be treated alike; that is why I have called this work "Ele- ments o f Interaction."

To avoid the impression that the only interactors I am thinking o f are p r o g r a m s , o r memories, o r c o m p u t e r systems, I show in F i g u r e 4 a mobile t e l e p h o n e network in which the channels are r a d i o channels. T h e c o m m u n i c a t i o n protocol allows a car to switch channels to whichever base station is nearest, the whole system being m o n i t o r e d a n d controlled cen- trally. Now, we want o u r construc- tions to describe such systems per- fectly well, at a discrete level; the elements o f interaction must not be specific to c o m p u t e r systems.

Much o f what I have been saying was a l r e a d y well u n d e r s t o o d in the sixties by C a r l - A d a m Petri, who pio- n e e r e d the scientific m o d e l i n g o f dis- crete c o n c u r r e n t systems. Petri's work has a secure place at the r o o t o f c o n c u r r e n c y theory. H e declared the aim that his t h e o r y o f nets s h o u l d - - at its lowest l e v e l s - - s e r v e impartially as a m o d e l o f the physical world a n d

as a m o d e l o f computation. Already, for him, a m e m o r y register and a p r o g r a m are m o d e l e d by the same kind of object--namely a n e t - - a n d this breaks down the active/passive di- chotomy. T h e conceptual f r a m e w o r k o f net t h e o r y is as spare as one can imagine. This has i n d e e d p a i d o f f in clarity a n d d e p t h , both for the analy- sis o f individual systems a n d for the classification o f systems.

Static C o n s t r u c t i o n s

Besides calling the question the ac- tive/passive d i c h o t o m y for the entities o f which a system is composed, con- currency d e m a n d s a fresh a p p r o a c h

F i g u r e I . T h e s h a r e d m e m o r y m o d e l

F i g u r e 2. M e m o r y a s a n

Interactive p r o c e s s F i g u r e 3. M e m o r y a s a

distributed p r o c e s s F i g u r e 4. A m o b i l e

telephone network

D Y x rq J

D x ... .... i

M

Fq J

STATION STATION . . . I STATION I "'"

I I

COtAIWUM|¢A'IrlONSOP'IrI41EA¢Im/January 1993/Vol.36, No.l Bin

(5)

l e m e n t s o f I n t e r a c t i o n

in terms o f its primitive constructions.

W h a t I always w a n t e d to advance, to c o m p l e m e n t Petri net theory, is the synthetic o r compositional view o f systems which is familiar f r o m p r o - g r a m m i n g . T h i s is essentially an al- gebraic view, for a l g e b r a is about constructions a n d their meaning. F o r sequential c o m p u t a t i o n this view is manifest in the A-calculus, in contrast w i t h - - s a y - - t h e classical t h e o r y o f automata.

To h a n d l e concurrency, we should not m e r e l y add extra material to the languages a n d theories o f sequential c o m p u t i n g - - i n particular, e x t r a con- structions for b u i l d i n g b i g g e r sys- tems f r o m smaller ones. I f we do, t h e n o f course we get a l a r g e r r e p e r - toire o f primitive constructions t h a n we h a d before. This is a fine way to fulfill the p r o p h e c y that c o n c u r r e n c y is m o r e c o m p l e x than sequentiality.

A n d it h a s often been done. Well, c o n c u r r e n c y may be m o r e complex, but we should not give in so easily.

We should limit ourselves to con- structions which are essential for c o n c u r r e n c y in its own terms; t h e n i n d e e d we can see sequential com- p u t i n g as a higher, a n d m o r e spe- cific, level o f explanation.

C o n s i d e r sequential composition P; Q

- - t h e familiar semicolon, the essen- tial glue o f sequential imperative p r o g r a m m i n g . To get concurrency, s h o u l d we k e e p sequential composi- tion a n d j u s t add parallel composi- tion? Well, we might want to d o that for a p r o g r a m m i n g language, be- cause we m u s t give p r o g r a m m e r s their familiar tools as well as newer things. But should we do it in a basic calculus? I believe not; for sequential composition is i n d e e d a special case

o f parallel composition

PIQ

when this construction is p r o p e r l y u n d e r s t o o d . I u n d e r s t a n d it to m e a n that P a n d Q are acting side by side, interacting in whatever way we have d e s i g n e d t h e m to interact. So se- quential composition is the special case in which the only interaction occurs when P finishes a n d Q begins.

T o allow a special kind o f interaction h e r e would violate o u r principle that, in the basic model, all interactions are o f the same kind.

It was this sort o f m u n d a n e obser- vation which p r e v e n t e d m e f r o m try- ing to extrapolate f r o m sequentiality a n d led me to try to capture, in a new calculus, a set o f constructions basic to concurrency. This is what I un- d e r s t a n d C h u r c h to have d o n e for sequential c o m p u t i n g , with the A- calculus. We wish to match the func- tional calculus not by c o p y i n g its con- structions, but by e m u l a t i n g two o f its attributes: It is synthetic--we build systems in it, because the structure o f terms r e p r e s e n t s the structure o f processes; a n d it is computational--its basic semantic notion is a step o f c o m p u t a t i o n . Its f u r t h e r attribute, that it has an a g r e e d mathematical i n t e r p r e t a t i o n , we cannot yet match ( t h o u g h g o o d progress is being made). But C h u r c h himself u n d e r - stood his A-calculus terms as func- tions in a c o m p u t a t i o n a l sense o f that word; he did not yet have Scott's denotations.

T o summarize: F o r me, the func- tional calculus was a paradigm--but not a platform--for b u i l d i n g a calcu- lus for c o m m u n i c a t i n g systems.

I p o i n t e d o u t j u s t now that se- quential composition o f processes is a special case o f parallel composition.

I n d e e d , in designing CCS I insisted that t h e r e be only a single c o m b i n a t o r for c o m b i n i n g processes which inter- act o r which coexist. This may seem a tall o r d e r , for I also insisted that m e m o r y registers be m o d e l e d as p r o - cesses, so this same c o m b i n a t o r must be able to assemble t h e m into a m e m - ory, to c o m p o s e the processes which use them, a n d to combine processes with m e m o r y . But one c o m b i n a t o r does i n d e e d suffice, a n d this is be- cause all interactions can i n d e e d be t r e a t e d in the same way. F o r exam-

ple, we can write the system o f F i g u r e 3 as

PIMIQ where M--XIYIZ

o r a s

vlxBYiZlQ

T h e very same expression will be used even when the p r o g r a m s P a n d Q interact in some o t h e r way, over a n d above their interaction via m e m - ory, o r when X, Y, a n d Z a r e not simply storage registers, b u t p e r h a p s processes that are i n t e r m e d i a r y be- tween the p r o g r a m s a n d a r e m o t e m e m o r y . T h e f o r m o f the expression is i n d e p e n d e n t o f the n a t u r e o f these five processes.

T h e algebraic n a t u r e o f the calcu- lus is b e g i n n i n g to e m e r g e , with this single c o m b i n a t o r at its heart. T h e intuition b e h i n d parallel composition is that we a r e simply assembling the c o m p o n e n t s o f a system t o g e t h e r - - so we expect the c o m b i n a t o r to be associative a n d commutative. This is why we have no brackets in o u r ex- pressions. Each d i f f e r e n t o r d e r i n g a n d bracketing o f the m e m b e r s would r e p r e s e n t a d i f f e r e n t partition o f a system into subsystems.

How can o u r algebra reflect m o r e explicitly the structure i n d u c e d by the linkage a m o n g system c o m p o - nents? We note first that the c o m p o - nents P, Q, x . . . . in F i g u r e 3 will themselves be process expressions;

m o r e o v e r , the channel y links only the m e m b e r s P a n d Y, since those will be the only expressions in which the channel n a m e y appears. We d o not give h e r e the process expression for a register like Y; suffice it to say that each such expression will d e t e r m i n e its location as a channel name. T h u s we can say that f r o m P's viewpoint, the n a m e y locates the cell Y. Now Fig- u r e 3 exhibits this i d e a o f location very clearly; we also want o u r algebra to c a p t u r e the idea. F o r this p u r p o s e , we i n t r o d u c e a f u r t h e r c o m b i n a t o r to e n s u r e that the register Y is accessible only to P - - i . e . , that the channel y is local to them. We call this new com- b i n a t o r restriction; for e x a m p l e , in the expression

vy(Y[P)

the channel y is restricted for use be- tween Y a n d P. T h e g r e e k letter v is used partly for the p u n on "new"; in

8 mjP January 1993/Vol.36, No.l / C O N N U N I C A T I O H | O I I T I I I I A C M

(6)

S o u r c e s a n d R e l a t e d W o r k

S ome of the important sources and relevant papers are cited here, sec- tion by section.

£ntltle$. Tennent [361 is a classic exposition of the Scott-Strachey approach to semantics. Gunter and Scott [131 is a recent exposition of Scott's domain theory. It contains a section on powerdomains, which were originally published in [32]. Petri's Ph.D. dissertation [31] is the first publicatlon on Petri net theory, and Reisig [33] is an introductory textbook.

• l~tlc constructions. Church [9l is the first publication on the A-calculus;

Barendregt [5] gives a recent and complete exposition of the ~.-calculus. MiIner [21] gives the first exposition of CCS and brings It uP to date In a later text- book [22]. MIIner in [20] gives the algebra of flow graphs, a static algeDra of processes.

Dynamic constntctlons. Hoare [16] introduces the programming language CSP and In a t e x t b o o k [17] gives its algebraic theory. Baeten and Weljland [4] ex- POUnd the process algebra ACP due originally t o Bergstra and Klop. The speci- fication language Lotos was designed by Brinksma [7].

Meaning. Some important domain-theoretic models for concurrency are the failures model of Brookes et al. [81, Hennessy's acceptance trees [14], and Abramsky's domain for bislmulation [1]. The observation equivalence of pro- cesses was introduced by MIIner [21]; Park [30] placed it on a firmer mathemat- Ical footing with the notion of bislmulation. Tile event structures of Nielsen et al. [28] combine domain theory with the causality structure of Petrl nets.

Values. B0hm and Berarduccl [61 show how to encode data structures into the h-CalCUlUS. The second-order (polymorphic) A-calculus was discovered in the early seventies independently by Girard [111 and Reynolds [341. An early presentation of Hewitt's ACtors model is by Hewltt et al. [15]; a recent book on Actors Is by Agha [2]. Smalltalk [12] is probably the first programming language to treat values--even the simplest, like numbers--as objects which receive messages.

Names. Astesiano and Zucca [3] studied a version of CCS in which channels (i.e., names, in the terms of this article) could be parametrized on values, thus allowing some mobility. Kennaway and Sleep [19] built the Idea Of transmitting names as messages into a language for distributed operating systems. In 1980, at Arhus, Mogens Nielsen and I had tried t o treat mobility algebraically In CCS, but failed. Engberg and Nielsen [101 later succeeded, giving the first algebraic treatment of a process calculus with dynamic reconflguration (their report is unpublished). These ideas were refined and strengthened by MIIner et al. lead- Ing to the at-calculus [251. Milner [231 gives a recent tutorial exposition of a more general form, also treating type structure.

As an accessible Illustration of how to apply the ~r-calCulUS, Orava and Parrow [29] made a rigorous study Of a simplified mobile telephone network, which I have used here. A translation of the A-calculus into the ~r-calculus iS given by MIIner [24]. Walker [381 explored first the use of the a-calculus to give seman- tics t o concurrent object-oriented programming. Honda and Tokoro [18] give an interesting variant of the ~r-calculus suitable for asynchronous communica- tion, which brings It closer t o Actors and to object-oriented programming.

Another way to achieve mobility Is t o allow processes themselves to be trans- mitted in Interaction. Nlelson [271 and Thomsen [371 have studied these so- called seconcl-order processes. Thomsen also gave a translation of second- order processes into the 7r-calculus and showed that It preserves operational behavior. Sanglorgl generalizes this translation to oo-order processes and has proved that a suitable behavioral equivalence Is preserved in both directions by the translation. His results are summarized by MIIner [231 and will appear in Sanglorgi's Ph.D. dissertation [35]. This work on higher order reinforces the claim of exPressive completeness for the st-calculus.

COnclusion. The Turlng award lecture of Newell and Simon I261 examines the nature of empirical enquiry in computer science.

fact, restriction is j u s t a distillation of the notion of local variable declaration in p r o g r a m m i n g . T h u s for the whole system o f Figure 3 we may more ac- curately write

vx(xl y(YIP)l z(zl ) ( ,

This kind o f expression well repre- sents the spatial or static structure of interactive systems in general, t h o u g h we have only illustrated it for programs a n d memory. Diagrams like Figure 3, which we may call flow graphs, are quite formal objects. In- deed, restriction a n d composition obey certain equations which define the algebraic theory of flow graphs.

D y n a m i c C o n s t r u c t i o n s

Now let us t u r n to the dynamic aspect of such systems: their behavior. It is in the dynamics, in fact, that we can contrast the sequential, hierarchical control of the X-calculus with the c o n c u r r e n t , heterarchical control of CCS. I n the X-calculus, all computa- tion comes down to j u s t one thing, called reduction--the act of passing an a r g u m e n t to a function; we may call this the atom of behavior of the X- calculus. I n j u s t the same way, an in- teraction-the passage o f a single d a t u m between processes--is the atom of behavior in CCS. We shall now see how this allows symmetry between partners a n d how it reflects the idea that each process in a com- m u n i t y has persistent identity.

We shall look at this contrast in terms o f the basic computational rule of each calculus. I n each calculus, systems are built using a binary com- binator. I n the X-calculus the com- binator is called application a n d is nei- ther commutative n o r associative.

W h e n one term M is applied to an- other, N,

M(N)

t h e n the first term M - - t h e operator-- holds control. T h e operator is com- mitted to receive N, the operand; if a n d when the operator takes the form of a n abstraction Ax.M[x] (where the square brackets indicate that M may contain the b o u n d variable x), then the symbol A represents the operator's locus of control, a n d the following reduction will occur:

(Xx.M[x])(N) ~ M[N]

C O M M U N I C A T I O N S O F T H I I aCM/January 1993/Vol.36, No.1 8 3

(7)

l e m e n t s o f I n t e r a c t i o n

(where the brackets on the right indi- cate that N has r e p l a c e d x in M). This is the basic c o m p u t a t i o n a l rule o f the A-calculus, the dynamics o f function application; for m a n y p e o p l e it is m o r e familiar as the copy rule o f Algol60, which was d e r i v e d f r o m it.

F i g u r e 5 r e p r e s e n t s this o p e r a t i o n pictorially; note that the o p e r a n d N is r e p r e s e n t e d by a circle, being a pas- sive d a t u m in the r e d u c t i o n - - i t will only later assume control, as an o p e r - ator, when M allows it to d o so.

I n CCS on the o t h e r h a n d , when two terms P a n d Q are c o m p o s e d in parallel,

PIQ

then both hold control. P may receive a message f r o m Q, j u s t as Q may re- ceive one f r o m P. T h e r e a r e two so- called actions which a t e r m may take,

allowing it to interact with another.

W h e n one p a r t n e r takes the input f o r m Ax.P[x] while the o t h e r takes the output f o r m ~V.Q, then we have the composition

Ax.PLxJlXV.Q

in which the p a r t n e r s have what may be called complementary loci o f control A a n d A - - t h a t is, the positive a n d negative ends o f a channel n a m e d A.

T h e n the following interaction may

O c c u r :

Xx.P[x]lXV.Q---, P[V]lQ

It is a synchronization o f the part- ners' actions.

But crucially, in c o n c u r r e n c y t h e r e

a r e many channels, not j u s t one; so

the symbol A, which r e p r e s e n t e d the single locus o f control in the A- calculus, now becomes j u s t one o f m a n y channels, p e r h a p s concur- rently active. CCS uses the simple names a, b, c . . . . for such channels.

T h u s we arrive at the basic c o m p u t a - tion rule o f CCS, shown pictorially in F i g u r e 6. C o m p u t a t i o n j u s t consists in the iteration o f this single rule, r e p e a t e d l y t r a n s f o r m i n g an expres- sion; at any stage the structure o f the expression r e p r e s e n t s the spatial c o n f i g u r a t i o n o f the system. T h e dia- g r a m in F i g u r e 6 shows the dynamic b e h a v i o r - - t h e passage o f a passive d a t u m - - s u p e r p o s e d on the flow

- ®

BEFORE

®

AFTER

BEFORE

a .

AFTER Q

F i g u r e S. T h e x-calCulUS r e c l u c t l o n ( . ~ x . M [ x ] ) N ~ M [ N ] F i g u r e 6 . T h e CCS I n t e r a c t i o n a x . P [x] l a V . Q ~ P [ v ] I Q

g r a p h which r e p r e s e n t s the spatial configuration.

Let us look m o r e closely at the dif- ferences here. First, in the A-calculus case the second p a r t n e r was merely a passive d a t u m , but in the CCS case it yields u p its d a t u m V a n d continues an i n d e p e n d e n t existence. It is ex- actly this which admits continual interaction a m o n g c o n c u r r e n t p r o - cesses, each r e t a i n i n g its identity.

Second, parallel composition is com- mutative; PIQ means the same as QIP.

In CCS, in contrast to the A-calculus, e i t h e r p a r t n e r may act as the re- c e i v e r - a n d i n d e e d that p a r t n e r may later b e c o m e the transmitter.

Third, parallel composition is also associative; t o g e t h e r with c o m m u t a - tivity, this frees the interaction disci- pline f r o m the t e r m structure, which r e p r e s e n t s hierarchical control in the A-calculus. As we saw in the e x a m p l e o f p r o g r a m - m e m o r y interaction, the control discipline is now d e t e r m i n e d by which channels a, b . . . . link which processes.

T h e s e details are somewhat tech- nical. But the focal p o i n t is this: T h e d i f f e r e n c e between c o n c u r r e n t a n d sequential c o m p u t a t i o n can be con- c e n t r a t e d in the single basic computa- tion rule o f the respective calculi. By m o d i f y i n g the notion o f reduction f r o m the A-calculus, we attain a rule o f interaction for c o n c u r r e n t pro- cesses, a n d this is the first stage in o u r synthesis between the p u r i t y o f the functional m o d e l a n d the d y n a m - ics o f real c o n c u r r e n t systems.

T h e idea o f synchronized interac- tion as a p r o g r a m m i n g primitive was known to T o n y H o a r e b e f o r e I ex- pressed it in algebraic form. T h e fact that these steps were taken i n d e p e n - dently, with d i f f e r e n t motives, is some evidence that the idea is a natu- ral one. H o a r e i n c o r p o r a t e d the idea in his p r o g r a m m i n g l a n g u a g e CSP a n d later with colleagues d e v e l o p e d a t h e o r y a r o u n d it. It p r o v i d e d the basis for the r e n d e z v o u s mechanism o f Ada, as well as b e c o m i n g the a t o m o f interaction in the p r o g r a m m i n g l a n g u a g e Occam. My c o n t r i b u t i o n was to m a k e interaction the c o r n e r - stone o f an algebraic calculus. T h e process algebras d e v e l o p e d in the eighties, such as CCS, CSP, a n d the ACP o f Bergstra a n d Klop, have b e e n the subject o f m u c h semantic

8 4 January 1993/Vo1.36, No.1 / C O M M U N I C A T I O N S O F T H E A I l l M

(8)

research. T h e y have also become, o r have grown into, actively used design tools; in particular, the specification language Lotos has been widely ap- plied to c o m m u n i c a t i o n protocols.

Meaning

I would like to allay the fear that con- currency, at least in the way I am treating it, is d e s p e r a t e l y concrete a n d mechanistic. Are there not ab- stract mathematical things underly- ing it all, for which we should reserve the t e r m " p r o c e s s " - - r a t h e r than dig- nifying o u r algebraic expressions with that name? A f t e r all, we have come to use the t e r m "function" in an abstract sense, so that when we p o i n t to an expression in the A-calculus a n d say "that function," p e o p l e usually take us to m e a n "the mathematical function denoted by that expression." I f

an expression has no a g r e e d denota- tion we may feel uncomfortable.

T h e semantics o f processes has a large a n d growing literature. It is not simple; b u t some exciting progress has been made. I spoke earlier about the possible use o f Scott's domains for c o n c u r r e n t p r o g r a m s , a n d i n d e e d a variety o f interesting d o m a i n s are studied for process algebra. T h e r e has also been m u c h research on the m e a n i n g o f a process as d e t e r m i n e d by its observable behavior. T h e idea is this: To observe a process is exactly to interact with it, and two s y s t e m s - - say two process terms in C C S - - should have the same d e n o t a t i o n if a n d only if we cannot distinguish t h e m by observation. This research is largely d e v o t e d to classifying the s t r o n g e r a n d weaker kinds o f obser- vational distinction which can be m a d e a n d to a mathematical charac- terization in each case. Much has been achieved; much remains to be done.

T h e s e r e m a r k s about observation, so far, apply equally to sequential processes; b u t - - a s might be ex- p e c t e d - c o n c u r r e n c y raises prob- lems all o f its own. O n e i m p o r t a n t topic is the concept o f causal indepen- dence, which is central in Petri net theory. Now, two p r o c e s s e s - - e a c h having c o n c u r r e n t c o m p o n e n t s - - may be indistinguishable to an exter- nal observer, and yet d i f f e r in the causal relationship a m o n g their ob- served actions. I may observe you

falling out o f the tree a n d t h e n ob- serve the a m b u l a n c e arriving, but I still d o not know if one caused the other. H e n c e observational semantics ignores causality. But there are also g o o d reasons for semantic models which respect causal c o n n e c t i o n - - such as the event structures o f Nielsen et al. This topic is too c o m p l e x to tackle here; I m e n t i o n it only to show that c o n c u r r e n c y does i n d e e d raise new semantic questions.

W h a t e v e r mathematical models are studied, I believe that process cal- culi p r o v i d e an essential perspective for the study. Many p e o p l e will only be satisfied with the semantic t h e o r y o f c o n c u r r e n t systems w h e n - - e v e n t u a l l y - - i t becomes an abstract t h e o r y as well as a formal one. But to attain this goal we must first distill the essence o f the dynamics o f inter- action; this is what a f o r m a l process calculus like CCS tries to do.

values

We now e m b a r k on the second stage in a synthesis between the functional p a r a d i g m a n d the realities o f interac- tion. This time I am c o n c e r n e d with m a k i n g a c o n c u r r e n t calculus fully expressive, within its own conceptual frame. First, I need to explain how the A-calculus succeeds in this re- spect, while CCS a n d similar concur- rency calculi fall short. Later we shall find a r e m e d y .

Often p e o p l e use the A-calculus informally, simply to derive new op- erators over familiar data. W h e n dis- cussing arithmetic, they will write f = Ax (x 2 + l)

o r p e r h a p s

F = AfAx (f(x) + 1)

- - i . e . , they mix the constructions o f the A-calculus with those o f arithme- tic, not wishing to code one into the other. T r e a t e d thus, the A-calculus is like some c o m p u t a t i o n a l scaffolding, u p a n d down which the real workers climb: d a t a such as numbers, a n d o p e r a t o r s such as squaring, adding, o r differentiating.

This auxiliary use o f the A-calculus is very natural, but h a r d l y makes for a self-contained m o d e l o f c o m p u t i n g within the functional framework.

Each time we a d d new types o f d a t a s t r u c t u r e - - l i k e arrays, lists, t r e e s - - we are in effect e x t e n d i n g the calcu-

lus. But it is i m p o r t a n t for the u n d e r - standing o f p r o g r a m m i n g languages, for e x a m p l e , that the basic model which we use to explain t h e m should be as h o m o g e n e o u s and complete as possible, r e q u i r i n g no ad hoc exten- sion.

Quite r e m a r k a b l y , the A-calculus does achieve this h o m o g e n e i t y a n d completeness. I n its p u r e form, it does i n d e e d have full p o w e r to rep- resent d a t a structures and c o m p u t e with them; we can d o everything with the scaffolding alone. C h u r c h showed this for arithmetic; B6hm and others have e x t e n d e d it to o t h e r forms o f d a t a structure. Moreover, t h e r e are type disciplines--notably the G i r a r d - R e y n o l d s s e c o n d - o r d e r A- c a l c u l u s - - w h i c h allow this to be d o n e in a controlled way, b u i l d i n g a uni- f o r m f r a m e w o r k for analyzing se- quential p r o g r a m m i n g l a n g u a g e s - - a n d their respective type disciplines.

Now, what about concurrency?

Most c o n c u r r e n c y formalisms also p r o v i d e a scaffolding, o f a d i f f e r e n t kind, on which values a n d o p e r a t o r s can move a r o u n d ; these values a n d o p e r a t o r s are quite distinct from the scaffolding itself. Look again at CCS (Figure 6); in that interaction, the d a t u m V is actually an expression standing for s o m e t h i n g like a number--quite a d i f f e r e n t type o f animal f r o m the process expression P.

To u n d e r l i n e the point, F i g u r e 7 shows a CCS definition for a process Double, which r e p e a t e d l y inputs a n u m b e r along the a channel a n d out- puts twice that n u m b e r on the b channel. R e g a r d i n g the short defini- tion, it contains no less than five dif- f e r e n t kinds o f thing: processes (e.g., Double), channels (a, b), variables (x), operators ( x ) , a n d value expressions (2 × x). A n d f o u r o f these (all except operators) a l r e a d y occur in the basic c o m p u t a t i o n rule o f C C S - - s e e Fig- ure 6. Is not this promiscuity exces- sive?

Well, it is perfectly admissible in a high-level p r o g r a m m i n g language or specification l a n g u a g e such as Lotos, where a user expects a rich and re- d u n d a n t tool kit. But for a truly basic calculus the situation is less comfort- able. A basic calculus should impose as little t a x o n o m y as it can, because d i f f e r e n t h i g h e r levels o f explanation will impose d i f f e r e n t taxonomies.

¢OMMUNICATIONSOFTHEACIR/January 1993/Vo1.36, No.1 8 S

References

Related documents

(C) Frequency distribution of the number of secondary cases per index case, again using colours from figure 1A : red is all secondary cases; grey and orange are those that are not

The Effects of Dietary Antioxidants on the Arginase Activity and Nitric Oxide Level of Narrow-Clawed Turkish Crayfish ( Astacus leptodactylus , Esch1. leptodactylus is

Probiotic supplemen- tation for the first 6 months of life fails to reduce the risk of atopic dermatitis and increases the risk of allergen sen- sitization in high-risk children:

Probability Density Functions (PDFs) in model-based pressure residuals are calibrated off-line for all the possible leak scenarios by using a hydraulic simulator.. and being leak

[1] Batten, P., “Covers and multipliers of Lie algebras, ” Dissertation, North Carolina State University, 1993.. [2] Batten, P.,

De medewerkers die niet intrinsiek gemotiveerd zijn om bepaalde taken binnen een zelfsturend team, kunnen in de toekomst de verantwoordelijkheid bij de

6- Lecturer, Department of Occupational Health Engineering, School of Public Health, Social Determinants of Health Research Center, Gonabad University of Medical Sciences,

Granular Network Inventory (Device and Data) Network Policy Management and Remediation. Orion Application