Professional Documents
Culture Documents
Computer Science
Edited by G. Goos and J. Hartmanis
92
I I I I
Robin Milner
A Calculus of
Communicating Systems
Springer-Verlag
Berlin Heidelberg New York 1980
Editorial Board
W. Brauer P. Brinch Hansen D. Gries C. Moler G. SeegmiJIler
J..q;toer N. Wirth
Author
Robin Milner
University of Edinburgh
Dept. of Computer Science
James Clerk Maxwell Building
The King's Buildings
Mayfield Road
Edinburgh EH9 3JZ
Great Britain
AMS Subject Classifications (1979): 68-02
CR Subject Classifications (1974): 4.30, 5.20, 5.22, 5.24
ISBN 3-540-10235-3 Springer-Verlag Berlin Heidelberg New York
ISBN 0-38?-10235-3 Springer-Verlag NewYork Heidelberg Berlin
Library of Congress Cat al ogi ng in Publ i cati on Data. Milner, Robin. A cal cul us of
communi cat i ng systems. (Lecture notes in comput er sci ence; 92) Bi bl i ography: p.
Includes index, t. Machi ne theory. 2. Formal languages. I. Title. 11. Series.
CIA26?.M53. 511.3 80-21068
Thi s wor k i s subj ect t o copyri ght. Al l ri ghts are reserved, whet her t he whol e or part
of t he material i s concerned, speci f i cal l y t hose of transl ati on, reprinting, re-use of
illustrations, broadcasti ng, reproduct i on by phot ocopyi ng machi ne or si mi l ar means,
and st orage i n dat a banks. Under 54 of t he German Copyr i ght Law wher e copi es
are made f or ot her t han pri vate use, a f ee i s payabl e t o t he publ i sher, t he amount of
t he f ee t o be det ermi ned by agreement wi t h t he publisher.
by Spri nger-Verl ag Berl i n Hei del berg 1980
Pri nted in Germany
Printing and bi ndi ng: Bel tz Offsetdruck, Hemsbach/Bergstr.
9145/ 3140-543210
work was mainly done during m y six-month appo_ i n - - t , frcm
~ t 1979 to January 1980, at the Ommouter Science deoalb~ent in
Aarhus University, ~ k . Although much of the ground work had been
done previously it was mainly in response to their encouragement (to
make the theory more accessible and related to practice), and to their
informed criticism, that the material reached a scmewhat coherent form.
I an deeply grateful to them and their students for allowing me to
lecture once a week on what was, at first, a loosely connected set of
ideas, and for the welccming enviromnent in which I was able to put
the ideas in order. I also thank Edinburgh University for awarding me
five months sabbatical leave subsequently, which helped me to cc~plete
the task in a reasonable time.
The calculus presented here 9~ew out of work which was inspired
by Dana Scott's theory of computation, though it has since diverged
in some respects. At every stage I have been influenced b y Gordon
Plotkin; even where I cannot trace particular ideas to him I have
been greatly illtmlinated b y our discussions and b y his chance remarks,
and without them the outccme would certainly be less than it is. I
would also like to thank others with whom I have worked: George Milne,
with whom I worked out the Laws of Flow Algebra; Matthew Hennessy, with
whcm the notion of observation equivalence developed; and Tony Hoare,
whose parallel work cn different but strongly related ideas, expressed
in his "Ccamtmicating Sequential Processes", has been a strong stimulus.
Many people have given detailed and helpful criticisms of the manu-
script, and thus improved its final form. In particular I thank Michael
Gordon and David MacQueem, who went through it all in detail in a Seminar
at the Information Sciences Institute, University of California; this
not only exposed same mistakes and obscurities but gave m e more csnfidence
in the parts they didn't criticise.
Finally, I am very thank~=ul to Dorothy McKie and Gina Temple for
their patience and skill in the long and involved task of typing.
O.
!.
2 .
3.
I n t r o d u c t i o n
P u r p o s e - C h a r a c t e r - R e l a t e d ~ r k - E v o l u t i o n - O u t l i n e .
E m p e r i m e n t i n 9 o n N o n d e t e r m i n i s t i c M a c h i n e s
T r a d i t i o n a l e q u i v a l e n c e o f f i n i t e s t a t e a c c e p t o r s - E x p e r ~ t i n g
u p o n a c c e p t o r s - B e h a v i o u r as a t r e e - A l g e b r a o f R S T s -
U n o b s e r v a b l e a c t i c n s .
S [ n c h r o n i z a t i c n
M u t u a l e x p e r i m e n t a t i o n - C o m p o s i t i o n , r e s t r i c t i o n a n d r e l a b e l l i n g -
E x t e n d i n g t h e A l g e b r a o f S T s - A s i n p l e ~ l e : b i n a r y s e m a p h o r e s -
T h e S T E x p a n s i o n T h e o r e m .
A c a s e s t u d y i n s y n c h r o n i z a t i c n a n d p r o o f t e ~ i q u e s
A s c h e d u l i n g p r o b l e m - B u i l d i n g t h e s c h e d u l e r as a P e t r i N e t -
O b s e r v a t i o n e q u i v a l e n c e - P r o v i n g t h e s c h e d u l e r .
4. C a s e s t u d i e s i n value-cc~6~1~dnication
5.
6.
7.
R e v i e w - P a s s i n g v a l u e s - A n exanple:
A n example: Z e r o s e a r c h i n g .
D a t a F l o w - D e r i v a t i o n s -
S y n t a x a n d S e m a n t i c s o f C C S
I n t r o d u c t i o n - S y n t a x - S e m a n t i c s b y d e r i v a t i o n s - D e f i n i n g b e h a v i o u r
i d e n t i f i e r s - S o r t s a n d p r o g r a m s - D i r e c t e q u i v a l e n c e o f b e h a v i o u r
p r o g r a m s - C o n g r u e n c e o f b e h a v i o u r p r o g r a m s - C o n g r u e n c e o f b e h a v i o u r
e x p r e s s i o n s a n d t h e E x p a n s i o n ~ n e o r e m .
C u , , ~ ! ~ c a t i o n T r e e s (CTs) as a m o d e l o f C C S
C T s a n d t h e d y n a m i c o p e r a t i c n s - C'fs a n d t h e s t a t i c o p e r a t i o n s -
C T s d e f i n e d b y r e c u r s i o n - A ~ c a c t i o n s a n d d e r i v a t i o n s o f C T s -
S t r o n g e q u i v a l e n c e o f C T s - E q u a l i t y i n t h e C T m o d e l - S ~ .
C b ~ t i c n ~ _ i i v a l e n c e a n d its p r o p e r t i e s
R e v i e w - O b s e r v a t i o n equi%ralence i n C C S - O b s e r v a t i o n o o n g r u e n c e -
L a w s o f o b s e r v a t i o n c o n g r u e n c e - P r o o f t e d % n i q u e s - P r o o f o f T h e o r ~ n
7.7 - F u r t h e r e x e r c i s e s .
1 9
3 3
4 7
6 5
8 4
9 8
8 .
9 .
i0.
II.
VJ
S o m e p r o o f s a b o u t D a t a S t r u c t u r e s
I n t r o d u c t i o n - R e g i s t e r s a n d m a m o r i e s - C h a i n i n g o p e r a t i o n s -
P u s h d c ~ s a n d q u e u e s .
T r a n s l a t i c n i n t o C C S
D i s c u s s i o n - T h e l a n g u a g e P - S o r t s a n d a u x i l i a r y d e f i n i t i c n s -
T r a n s l a t i o n o f P - A d d i n g p z o c e d u r e s t o P - P r o t e c t i o n o f r e s o u r c e s .
~ t e z m i n a c y a n d C o n f l u e n c e
D i s c u s s i o n - S t r o n g c o n f l u e n c e - ~ i t e g u a r d s a n d t h e u s e o f
c c n f l u e n c e - S t r c n g d e t e r m i n a c y : C o n f l u e n t d e t e z m i n a t e C C S -
P r o o f i n DCCS: t h e s c h e d u l e r a g a i n - a b s e r v a t i c n c o n f l u e n c e a n d
d e t e z m i n a c y .
C o n c l u s i o n
W h a t h a s b e e n a c h i e v e d ? - Is O C S a p r o g r a m m i n g l a n g u a g e ? -
T h e q u e s t i o n o f f a i r n e s s - T h e n o t i o n o f b e h a v i o u r - D i r e c t i o n s
f o r f u r t h e r w o r k .
~ : P r o p e r t i e s o f c c ~ g r u e n c e a n d e q u i v a l e n c e .
111
1 2 6
1 3 8
1 5 8
1 6 6
R e f e r e n c e s 16 9
CHAPTER 0
Introduction
O.i P u ~ s e
These notes present a calculus of concurrent systems. The presentation
is partly infozrflal, and aimed at practice; w e unfold the calculus through
the medium of examples each of which illustrates first its expressive power,
and second the techniques which it offers for verifying properties of a
system.
A useful calculus, of cGmputing systems as of anything else, must have
a high level of articulacy in a full sense of the word implying not only
rid%ness in expression but also flexibility in manipulation. It should b e
possible to describe existing systems, to specify and progr~n new systems,
and to argue mathematically about them, all without leaving the notational
frame%~rk of the calculus.
These are demanding criteria, and it may be impossible to meet them
even for the full range of concurrent syst~ns which are the proper concern
of a ccmputer scientist, let alone for syste~ns in general. But the attempt
n~st be made. W e believe that our calculus succeeds at least to this extent:
the sane notations are used both in defining and in reasoning about systems,
a n d - as our examples will show - it appears to be applicable not only to
prograns (e.g. operating systems or parts of them) but also to data struc-
tures and, at a certain level of abstraction, to hardware systems. For
the latter however, w e do not claim to reach the detailed level at which
the correct functicr/ng of a s y s t ~ depends on timing considerations.
Apart from artioulacy, w e aim at an underlying, theory whose basis is
a small well-knit collection of ideas and which justifies the manipulations
of the calculus. ~nis is as important as generality - perhaps even mere
in~portant. Any theory will b e superseded sooner or latem; during its life,
understanding it and assessing it are only possible and worthwhile if it
is seen as a logical 9~owth frcm rather f e w b a s i c assumptions and concepts.
We take this further in the next section, where w e introduce our chosen
conoeptual basis.
One purpose of these notes is to provide material for a graduate course.
With this in mind (indeed, the notes grew as a graduate course at Aarhus
University in A u t ~ 1979) w e have tried to find a good expository sequence,
a n d h a v e c m i t t e d s c m e p a r t s o f t h e t h e o r y - w h i c h w i l l a p p e a r i n t e c h n i c a l
p u b l i c a t i o n s - i n f a v o u r o f c a s e studies. T h e r e a r e p l e n t y o f e x e r c i s e s ,
a n d a n y o n e w h o b a s e s a c o u r s e o n t h e n o t e s s h o u l d b e a b l e t o t h i n k o f others;
o n e p l e a s a n t f e a t u r e o f c o n c u r r e n t s y s t e m s is t h e w e a l t h a n d v a r i e t y o f
s m a l l b u t n o n - t r i v i a l e~maples' W e c o u l d h a v e i n c l u d e d m a n y m o r e e x a m p l e s
i n t h e text, a n d t h e r e b y g i v e n g r e a t e r e v i d e n c e f o r t h e f a i r l y w i d e
a p p l i c a b i l i t y o f t h e calculus; but, s i n c e o u r m a i n a i m is t o p r e s e n t
i t a s a calculus, i t s e e m e d a g o o d r u l e t h a t e v e r y e x a m p l e p r o g r a m o r
s y s t e ~ s h o u l d b e s u b j e c t e d t o scrne p r o o f o r t o s a m e m a n i p u l a t i o n .
O . 2 C h a r a c t e r
O u r c a l c u l u s i f f o u n d e d o n t w o c e n t r a l ideas. T h e f i r s t is O b s e r v a t i o n ;
w e a i m t o d e s c r i b e a o o n c u r r e n t s y s t e m f u l l y e n o u g h t o d e t e r m i n e e ~ m c t l y
w h a t b e h a v i o u r w i l l b e s e e n o r e x p e r i e n c e d b y a n e x t e r n a l o b s e r v e r . T h u s
t h e a p p r o a c h is t h o ~ o u g h l y e x t e n s i o n a l ; t w o s y s t e m s a r e i n d i s t i n g u i s h a b l e
i f w e c a n n o t t e l l t h e ~ a p a r t w i t h o u t p u l l i n g thegn apart. W e t h e r e f o r e
g i v e a f o m a a l d e f i n i t i o n o f o b s e r v a t i o n e q u i v a l e n c e (in C h a p t e r 7) a n d
i n v e s t i g a t e its properties.
T h i s b y n o m e a D ~ p r e v e n t s u s f r c m s t u d y i n g t h e s t r u c t u r e o f systems.
E v e r y i n t e r e s t i n g c o n c u r r e n t s y s t e m is b u i l t frcrn i n d e p e n d e n t agents w h i c h
c c m m u n i c a t e , a n d s ~ n c h r o n i z e d c o m m u n i c a t i o n is o u r s e c o n d c e n t r a l idea.
W e r e g a r d a cut~t~nication b e t w e e n t w o c o m p o n e n t a g e n t s as a n i n d i v i s i b l e
a c t i o n o f t h e ccr~0osite system, a n d t h e h e a r t o f o u r a l g e b r a o f s y s t e m s
is c o n c u r r e n t c c ~ s i t i o n , a b i n a r y o p e r a t i o n w h i c h c c ~ e s t w o i n d e -
p e n d e n t agents, a l l o w i n g thegn t o coma~anicate. I t is a s e e n t r a l f o r u s
as s e q u e n t i a l ccmioosition is f o r s e q u e n t i a l p r o g r a m m i n g , a n d i n d e e d s u b s u m e s
t h e l a t t e r as a s p e c i a l case. S i n c e f o r u s a p r o g r a m o r s y s t e m d e s c r i p t i o n
is j u s t a tel~n o f t h e calculus, t h e s t r u c t u r e o f t h e p r o g r a m o r s y s t e m
(its intension) i s r e f l e c t e d i n t h e s t r u c t u r e o f t h e term. O u r ~nanipulations
o f t e n c o n s i s t o f t r a n s f o z n d n g a tezm, y i e l d i n g a t e r m w i t h d i f f e r e n t i n t e n -
s i o n b u t i d e n t i c a l b e h a v i o u r (extension). S u c h t r a n s f o z m a t i o n s a z ~ f a n i l i a r
i n s e q u e n t i a l progranmiing, w h e r e t h e e x t e n s i o n m a y j u s t b e a m a t h e m a t i c a l
f u n c t i o n (the " i n p u t / o u t p u t be/qaviour"); f o r c o n c u r r e n t s y s t e m s h o w e v e r ,
i t seer, s c l e a r t h a t f u n c t i o n s a r e i n a d e q u a t e as extensions.
T h e s e t w o c e n t r a l ideas a r e r e a l l y one. F o r w e s u p p o s e t h a t t h e o n l y
w a y t o o b s e r v e a s y s t e m is t o o.xL'municate w i t h it, w h i c h r0akes t h e o b s e r v e r
a n d s y s t e m t o g e t h e r a l a r g e r system. T h e o t h e r s i d e o f t h i s o o i n is
t h a t t o p l a c e t w o ccr~ponents i n ~ c a t i o n ( i . e . t o c c ~ p o s e them)
is j u s t t o l e t t h e m o b s e r v e e a c h other. I f o b s e r v i n g a n d c u t ~ u ~ c a t i n g
a r e t h e s~ne, i t f o l l o w s t h a t o n e c a n n o t O b s e r v e a s y s t e ~ w i t h o u t its
p a r t i c i p a t i o n . T h e a n a l o g y w i t h q u a n t u m p h y s i c s m a y o r m a y n o t b e s u p e r -
ficial, b u t t h e a p p r o a c h is u n i f y i n g a n d a p p e a r s n a t u r a l .
W e c a l l t h e c a l c u l u s C C S (Calculus o f C ~ m . ~ n i c a t i n g Systems). T h e
t e m p s o f C C S s t a n d f o r b e h a v i o u r s (extensions)of s y s t e m s a n d a r e s u b j e c t
t o e q u a t i o n a l laws. T h i s g i v e s us a n a l g e b r a , a n d w e a r e i n a g r e e m e n t
w i t h v a n Erode B o a s a n d J a n s s e n [EHJ] w h o a r g u e t h a t ~ r e g e ' s p r i n c i p l e
o f o c m p o s i t i o n a l i t y o f m e a n i n g r e q u i r e s a n a l g e b r a i c framework. B u t C C S
is s ~ a t m o r e t h a n algebra; f o r e x a m p l e , d e r i v a t i v e s a n d d e r i v a t i o n s
o f t e r m s p l a y a n i n p o r t a n t p a r t in d e s c r i b i n g t h e d y n a m i c s o f b e h a v i o u r s .
T h e v a r i e t y o f s y s t e m s w h i c h c a n b e e x p r e s s e d a n d d i s c u s s e d i n C C S
is i l l u s t r a t e d b y t h e e x a n p l e s i n the text: a n a g e n t f o r s c h e d u l i n g
t a s k p e r f o m a a n c e b y s e v e r a l o t h e r a g e n t s (Chapter 3); 'data flow'
c c ~ p u t a t i o n s a n d a c o n c u r r e n t n%~rerical a l g o r i t h m (Chapter 4); n~mnory
d e v i c e s a n d d a t a s t r u c t u r e s (Chapter 8); s e m a n t i c d e s c r i p t i o n o f a
p a r a l l e l progranlming l a n g u a g e (Chapter 9). I n addition, G. M i l n e [ M l n 33
m o d e l l e d a n d v e r i f i e d a p e r i p h e r a l h a r d w a r e d e v i c e - a c a r d r e a d e r - u s i n g
a n e a r l i e r v e r s i o n o f t h e p r e s e n t ideas.
A f t e r t h e s e remarks, t h e c h a r a c t e r o f t h e c a l c u l u s is b e s t d i s c o v e r e d
b y a q u i c k l o o k t h r o u g h C h a p t e r s 1-4, i g n o r i n g t e d a n i c a l d e t a i l s . O.5
(Outline) m a y a l s o help, b u t t h e n e x t t w o s e c t i o n s a r e n o t e s s e n t i a l f o r
a q u i c k appraisal.
O. 3 R e l a t e d W o r k
A t p r e s e n t , t h e m o s t f u l l y d e v e l o p e d t h e o r y o f c o n c u r r e n c y i s t h a t
o f P e t r i a n d h i s c o l l e a g u e s . (See f o r e x a m p l e C.A. Petri, " I n t r o d u c t i o n
t o G e n e r a l N e t ~ h e o r y " [Pet3, a n d H.J. Genrich, K. L a u t e n b a c h , P.S.
T h i a g a r a j a n , "An O v e r v i e w o f N e t Y~leory" [GLT].) I t is i ~ p o r t a n t t o
c o n t r a s t o u r c a l c u l u s w i t h N e t T h e o r y , i n tez~as o f u n d e r l y i n g concepts.
F o r N e t Theory, a (perhaps the) b a s i c n o t i o n is t h e c o n c u r r e n c ~
r e l a t i o n o v e r t h e p l a c e s (conditions) a n d t r a n s i t i o n s (events) o f a
system; i f t w o e v e n t s ( s a y ) a r e i n t h i s relation, i t i n d i c a t e s t h a t
t h e y a ~ e c a u s a l l y i n d e p e n d e n t a n d m a y o c c u r i n e i t h e r o r d e r o r s i m u l -
taneously. T h i s r e l a t i o n is c o n s p i c u o u s l y a b s e n t i n o u r theory, a t
l e a s t a s a b a s i c n o t i o n . H e n w e o ~ p o s e t w o a g e n t s i t is t h e s y n c h r o n i -
z a t i o n o f t h e i r m u t u a l cc~amlnications w h i c h d e t ~ e s t h e cc~oosite; w e
t r e a t t h e i r i n d e p e n d e n t a c t i o n s as o c c u r r i n g i n a r b i t r a r y o r d e r b u t n o t
s i m u l t a n e o u s l y . T h e r e a s o n is t h a t w e assLlre o f o u r e x t e r n a l o b s e r v e r
t h a t h e c a n m a k e o n l y o n e o b s e r v a t i o n a t a time; this i ~ p l i e s t h a t h e
is b l i n d t o t h e p o s s i b i l i t y t h a t t h e s y s t ~ n c a n s u p p o r t t w o o b s e r v a t i o n s
s i m u l t a n e o u s l y , s o t h i s p o s s i b i l i t y is i r r e l e v a n t t o t h e e x t e n s i o n o f
t h e s y s t e a i n o u r sense. T h i s a s s u m p t i o n is c e r t a i n l y o p e n t o (extensive')
debate, b u t g i v e s o u r c a l c u l u s a s i n p l i c i t y w h i c h w o u l d b e a b s e n t o t h e r -
wise. T o a n s w e r t h e n a t u r a l o b j e c t i o n t h a t i t is u n w i e l d y t o c o n s i d e r a l l
p o s s i b l e s e q u e n c e s (interleavings) o f a s e t o f c a u s a l l y i n d e p e n d e n t events,
w e r e f e r t h e r e a d e r t o o u r c a s e studies, f o r e x a n p l e i n C h a p t e r s 3 a n d 8,
t o s a t i s f y h i m s e l f t h a t o u r m e t h o d s c a n a v o i d t h i s u n w i e l d i n e s s a l m o s t
~Zetely.
C n t h e o t h e r hand, N e t T h e o r y p r o v i d e s m a n y s t r o n g a n a l y t i c techniques;
w e m u s t j u s t i f y t h e p r o p o s a l o f a n o t h e r theory. T h e e m p h a s i s i n o u r c a l c u l u s
is u p o n s y n t h e s i s a n d u p o n extension; a l g e b r a a p p e a r s t o b e a n a t u r a l t o o l
f o r e x p r e s s i n g h o w s y s t e m s a r e built, a n d i n s h o w i n g t h a t a s y s t e m m e e t s its
s p e c i f i c a t i o n w e a r e d e m a n d i n g p r o p e r t i e s o f its e x t e n s i o n . ~ a c t i v i t y
o f p r o g r a m m i n g - m o r e g e n e r a l l y , o f s y s t e m s y n t h e s i s - falls n a t u r a l l y
i n t o CCS, a n d w e b e l i e v e o u r a p p r o a c h t o b e m o r e a r t i c u l a t e i n t h i s r e s p e c t
t h a n N e t Theory, a t lea_st o n p r e s e n t evidence. I t r e m a i n s f o r u s t o
d e v e l o p a n a l y t i c t e c h n i q u e s t o m a t c h t h e s e o f ~Net Theory, w h o s e a c h i e v e -
m e n t s w i l l b e a v a l u a b l e guide.
A s a b r i d g e b e t w e e n N e t T h e o r y a n d p r o g r a m m i n g l a n g u a g e s f o r c o n c u r -
rency, w e s h o u l d m e n t i o n t h e e a r l y w o r k o f K a r p a n d M i l l e r [KM] o n p a r a l l e l
p r o g r a m schemata. T h i s w o r k b e a r s a r e l a t i o n t o N e t T h e o r y i n y i e l d i n g a n
a n a l y s i s o f p r o p e r t i e s o f c o n c u r r e n t systems, s u c h as d e a d l o c k a n d liveness;
i t a l s o e s m e s c l o s e r t o p r o g r a m m i n g (in t h e c c n v e n t i o n a l sense), b e i n g a
g e n e r a l i s a t i c n o f t h e f a m i l i a r n o t i o n o f a s e q u e n t i a l f l o w chart.
I n r e c e n t p r o p o s a l s f o r c o n c u r r e n t p r o g r a m m i n g l a n g u a g e s t h e r e is a
t r e n d t o w a r d s d i r e c t c c r m ~ n i c a t i o n b e t w e e n cc~i0onents o r m o d u l e s , a n d a w a y
f r o m c ~ i ~ u n i c a t i o n t h r o u g h s h a r e d r e g i s t e r s o r variables. E x a m p l e s are:
N. Wirth "MCDUIA: A language for modular multiprogramling", [Wir];
P. Brinch Hansen "Distributed Processes; a concurrent programming ccnoept",
[Bri 2]; C.A.R. Hoare "C~ti~nicating Sequential Processes", [Hoa 3].
Hoare's "monitors" [Hoa 2] gave a discipline for the administration of
shared resources in concurrent programming. These papers have helped
towards understanding the art of concurrent programming. Our calculus
differs frcm all of them in two ways: first, it is not in the accepted
sense an imperative language - there are no commands, only expressions;
second, it has evolved as part of a mathematical study. In the author's
v i ~ it is hard to do mathematics with imperative languages, though one
may add mathematics (or logic) to them to get a proof methodology, as in
the well-known "assertion" method or Hoare's axicmatic method.
One of the main encumbrances to proof in imperative languages is the
presence of a more-or-less global m~mory (the assignable variables). ~his
was recognized by Hoare in "Communicating Sequential Processes"; although
CSP is imperative Hoare avoids one aspect of global m~nory which makes
concarrent programs hard to analyse, by forbidding any member of a set of
concurrent programs to alter the value of a variable mentioned by another
m ~ . This significant step brings CSP quite close to our calculus, the
more so because the treatment of eutmunication is similar and expressed in
similar notation. Indeed, algorithms can often be translated easily from
one to the other, and it is reasonable to hope that a semantics and proof
theory for CSP can b e developed frGm CCS. Hoare, in his paper and more
recently, gives encouraging evidencs for the expressiveness of CSP.
We now turn to two models based on non-synchronized o~t,manication.
One, with strong expressive power, is Hewitt's Actor Systems; a recent
reference is [HAL]. Here the ~ c a t i o n discipline is that each
message sent b y an actor will, after finite time, arrive at its destination
actor ; no structure over waiting messages (e.g. ordering by send-time)
is imposed. This, together with the dynamic creation of actors, yields
an interesting programming method. Hc~ever, it see~ns to the author that
the fluidity of structure in the model, and the need to handle the
collection of waiting messages, poses difficulties for a tractable
extensional theory.
Another non-synchronized model, deliberately less expressive, was
first studied by Kahn and relx)rted b y him and MacQueen [KMQ]. Here the
interc~Li~t.~nication of agents is via unbounded buffers and queues, the
w h o l e b e i n g determinate. P r o b l e m s h a v e a r i s e n i n e x t e n d i n g i t t o n o n -
d e t e r m i n a t e systems, b u t m a n y n o n - t r i v i a l a l g o r i t h m s f i n d t h e i r b e s t
e x p r e s s i o n i n this medit~n, a n d i t is a n e x a m p l e o f a p p l i c a t i v e (i.e.
non-imperative) prograrmling w h i c h y i e l d s t o e x t e n s i o n a l t r e a t m e n t b y
t h e s e m a n t i c t e c h n i q u e s o f Scott. M o r e o v e r , W a d g e [Wad] h a s r e c e n t l y
s h o w n h o w s i m p l e c a l c u l a t i o n s c a n d e m o n s t r a t e the l i v e m e s s o f s u c h
systems.
A l u c i d o c ~ p a r a t i v e a c c o u n t o f t h r e e a p p r o a c h e s - Hewitt, K a h n /
M a c Q u e e n a n d M i l n e r - is g i v e n i n [MQ].
I n C h a p t e r 9 o f t h e s e n o t e s w e s h o w h o w o n e t y p e o f c o n c u r r e n t
l a n g u a g e - w h e r e c c m m m n i c a t i o n is v i a s h a r e d v a r i a b l e s - m a y b e d e r i v e d
f r c ~ o r e x p r e s s e d i n t e r m s o f CCS. This p r o v i d e s s a n e e v i d e n c e t h a t o u r
c a l c u l u s is r i c h i n expression, b u t w e c e r t a i n l y d o n o t c l a i m t o b e a b l e
t o d e r i v e e v e r y l a n g u a g e f o r concurrency.
A r a t h e r d i f f e r e n t s t y l e o f p r e s e n t i n g a c o n c u r r e n t s y s t e m is
exer~olified b y t h e p a t h e x p r e s s i o n s o f C a m p b e l l a n d H a b e r m a n n [CaH].
H e r e t h e a c t i v e p a r t s o f the s y s t e m a r e d e f i n e d s e p a r a t e l y f r o m t h e
c o n s t r a i n t s ( e . g . t h e p a t h expressions) w h i c h d i c t a t e h o w t h e y m u s t
synchronize. M o r e r e c e n t w o r k b y Lauer, S h i e l d s a n d o t h e r s - m a i n l y
a t N e w c a s t l e - shows t h a t t h i s m o d e l i n d e e d y i e l d s t o m a t h e m a t i c a l
analysis. A v e r y d i f f e r e n t e x a m p l e o f this s e p a r a t i o n is t h e e l e g a n t
w o r k o f M a g g i o l o - S c h e t t i n i e t a l [ ~ ] ; h e r e t h e c o n s t r a i n t s a r e
p r e s e n t e d n e g a t i v e l y , b y s t a t i n g w h a t c o n j u n c t i o n s o f s t a t e s (of s e p a r a t e
c c n p o n e n t agents) m a y n o t occur. T h i s a p p r o a c h h a s a n a d v a n t a g e f o r
s y s t e m s w h o s e c r m p o n e n t s a r e l a r g e l y i n d e p e n d e n t (the a u t h o r s c a l l i t
"loose c o u p l i n g " ) , s i n c e t h e n o n l y f e w c o n s t r a i n t s n e e d t o b e e x p r e s s e d .
This s e c t i o n h a s s h o w n t h e s u r p r i s i n g v a r i e t y o f p o s s i b l e t r e a t m e n t s
o f c o n c u r r e n t systems. I t is n o t h i n g like a c c ~ p r e h e n s i v e survey, a n d
t h e a u t h o r is a w a r e t h a t i m p o r t a n t w o r k h a s n o t b e e n m e n t i o n e d , b u t i t
w i l l s e r v e t o p r o v i d e s c ~ e p e r s p e c t i v e o n t h e w o r k p r e s e n t e d here.
O. 4 E v o l u t i o n
%Tuis w o r k e v o l v e d frc~n a n atter~ot t o t r e a t c ~ L ~ n i c a t i o n m a t h e m a t i -
cally. I n M i l n e r : "Processes: a m a t h e m a t i c a l m o d e l o f ~ t i n 9 a g e n t s "
[Mil 11 a m o d e l o f i n t e r a c t i n g agents w a s c o n s t r u c t e d , u s i n g S c o t t ' s
t h e o r y o f dcrm~ms. ~ h i s w a s r e f i n e d a n d g r e w m o r e a l g e b r a i c i n G. M i l n e
a n d Milner: " C o n c u r r e n t P r o o e s s e s a n d t h e i r syntax" E M M 3 . A t this
p o i n t w e p r o p o s e d n o p r o g r a m m i n g language, b u t w e r e a b l e t o p r o v e
p r o p e r t i e s o f d e f i n e d c o n ~ n t b e h a v i o u r s . F o r example, M i l n e i n h i s
Ph.D. T h e s i s "A m a t h e m a t i c a l m o d e l o f c o n c u r r e n t c o m p u t a t i o n " [Mln]
p r o v e d p a r t i a l c o r r e c t n e s s o f a p i e c e o f h a r d w a r e , a card-reader, b u i l t
f r o m f o u r s e p a r a t e c c ~ p o n e n t s as d e t a i l e d i n i t s h a r d w a r e d e s c r i p t i o n .
O u r m o d e l a t t h i s s t a g e d r e w u p o n P l o t k i n ' s a n d Sa~yth's P ~ e r ~
c o n s t r u c t i o n s , [ P I o i, Sa~y]. w h i c h e x t e n d e d S c o t t ' s t h e o r y t o a d m i t
n o n - d e t e n m i n i s m . P a r t o f o u r a l g e b r a is s t u d i e d i n d e p t h i n [ M i l 2].
A t t h i s p o i n t t h e r e w e r e t w o c r u c i a l d e v e l o ~ a e n t s . F i r s t - as w e
h a d h o p e d - o u r b e h a v i o u r d e f i n i t i o n s l o o k e d c o n s i d e r a b l y like programs,
a n d t h e rescm%blance w a s i n c r e a s e d b y m e r e l y i m p r o v i n g notation. T h e
result, e s s e n t i a l l y t h e l a n g u a g e o f CCS, is r e p o r t e d i n [Mii 3] a n d
w a s p a r t l y p ~ t e d b y d i s c u s s i o n s w i t h H o a r e a n d Scott. (For completeness,
t w o o t h e r p a p e r s [Mil 4,5] b y t h e a u t h o r a r e i n c l u d e d i n t h e r e f e r e n c e
list. E a c h g i v e s a s l i g h t l y d i f f e r e n t p e r s p e c t i v e f r o m [Mil 3], a n d
d i f f e r e n t examples. ) T h e s e c o n d d e v e l o l m ~ n t w a s t o r e a l i s e t h a t t h e
r e s u l t i n g l a n g u a g e h a s m a n y i n t e r p r e t a t i o n s ; a n d t h a t t h e P c ~ r ~
m o d e l , a n d v a r i a n t s o f it, m a y n o t b e t h e c o r r e c t ones. A c r i t e r i o n w a s
n e e d e d , t o r e j e c t t h e w r o n g i n t e r p r e t a t i o n s . F o r this p u r p o s e , w e t u r n e d
t o o b s e r v a t i o n e q u i v a l e n c e ; t w o b e h a v i o u r e x p r e s s i o n s s h o u l d h a v e t h e
s a n e i n t e r p r e t a t i o n i n t h e m o d e l i f f i n a l l c o n t e x t s t h e y a r e i n d i s t i n g u i s h -
a b l e b y o b s e r v a t i o n .
I t n o w t u r n s o u t t h a t a d e f i n i t i o n o f o b s e r v a t i o n e q u i v a l e n c e (for
w h i c h a d m i t t e d l y t h e r e a r e a f e w alternatives) d e t e m n i n e s a m o d e l , u p
t o i s c ~ o r p h i s m , a n d m o r e o v e r y i e l d s a l g e b r a i c laws w h i c h a r e o f p r a c t i c a l
u s e i n a r g u i n g a b o u t be2~iriours. W e h a v e s t r o n g h o p e f o r a s e t o f laws
w h i c h a r e i n s o m e s e n s e complete; i n f a c t t h e laws g i v e n i n C h a p t e r s 5
a n d 7 h a v e b e e n s h o w n cc~!olete f o r a s i n p l i f i e d c l a s s o f f i n i t e (ten~inating)
b e h a v i o u r s . I n t h i s case, "complete" m e a n s t h a t i f t w o b e h a v i o u r e x p r e s s i o n s
a r e o b s e r v a t i o n - e q u i v a l e n t i n a l l c o n t e x t s t h e n t h e y m a y b e p r o v e d e q u a l
b y t h e laws; this c o m p l e t e n e s s is s h o w n i n [HM].
0 . 5 O u t l i n e
I n C h a p t e r 1 w e d i s c u s s i n f o r m a l l y t h e i d e a o f e x p e r i m e n t i n g on, o r
o b s e r v i n g , a non-dete2xninistic agent; this leads t o t h e n o t i o n o f
s y n d 0 m o n i s a t i o n t r e e (ST) a s t h e b e h a v i o u r o f a n agent. C h a p t e r 2 d i s -
c t ~ s e s m t u a l e x p e r i m e n t , o r c ~ m L ~ n i c a t i c n , b e t w e e n agents, a n d d e v e l o p s
a n a l g e b r a o f STs. I n C h a p t e r 3 w e d o a s m a l l c a s e - s t u d y (a s c h e d u l i n g
system) a n d p r o v e scxnething a b o u t it, a n t i c i p a t i n g t h e formal d e f i n i t i o n
o f o b s e r v a t i o n e q u i v a l e n c e a n d its p r o p e r t i e s t o b e d e a l t w i t h f u l l y i n
C h a p t e r 7.
C h a p t e r 4 e n r i c h e s o u r cul,udnications - u p t o n o w t h e y h a v e b e e n j u s t
s y n d l r o n i z a t i o n s - t o a l l o w t h e p a s s i n g o f v a l u e s f r c m o n e a g e n t t o another,
a n d i l l u s t r a t e s t h e g r e a t e r e x p r e s s i v e p ~ e r i n t w o m o r e exar~les; c n e is
a k i n t o D a t a Flow, a n d t h e o t h e r is a c o n c u r r e n t a l g o r i t h m f o r f i n d i n g a
zero o f a c o n t i n u o u s function. T h e n o t i o n o f d e r i v a t i v e o f a b e h a v i o u r
is introduced, a n d u s e d i n t h e s e c c n d example.
I n C h a p t e r 5 w e d e f i n e C C S formally, g i v i n g i t s d y n a m i c s i n t e r m s
o f d e r i v a t i o n s (derivative sequences). ~ h i s y i e l d s o u r s t r o n g c o n g r u e n c e
r e l a t i o n , u n d e r w h i c h t w o p r o g r a m s a r e c c n g r u e n t i f f t h e y h a v e e s s e n t i a l l y
t h e s a m e d e r i v a t i o n s , a n d w e e s t a b l i s h s e v e r a l laws o b e y e d b y t h e c o n g r u e n c e .
I n C h a p t e r 6 w e p r e s e n t c ~ m l u n i c a t i c n t r e e s (CTs, a g e n e r a l i s a t i o n o f STs)
as a m o d e l w h i c h o b e y s t h e s e laws; t h i s m o d e l is n o t n e c e s s a r y f o r t h e
f u r t h e r d e v e l o p m e n t , b u t m e a n t as a n a i d t o u n d e r s t a n d i n g .
C h a p t e r 7 is t h e c o r e o f t h e theory; o b s e r v a t i o n e q u i v a l e n c e is
t r e a t e d i n depth, a n d f r o m i t w e g a i n o u r m a i n c o n g r u e n c e relation,
o b s e r v a t i o n congruence, u n d e r w h i c h t w o p r o g r a n s a r e c o n g r u e n t ~iff t h e y
c a n n o t b e d i s t i n g u i s h e d b y o b s e r v a t i o n i n a n y context. H a v i n g d e r i v e d
s c m e p r o p e r t i e s o f t h e congruence, w e u s e t h e m i n C h a p t e r 8 t o p r o v e t h e
c o r r e c t b e h a v i o u r o f t w o f u r t h e r systems, b o t h t o d o w i t h d a t a structures.
I n C h a p t e r s 9 a n d I O w e l o o k a t s a n e d e r i v e d A l g e b r a s . O n e t a k e s t h e
f o r m o f a n i m p e r a t i v e c o n c u r r e n t p r o g r a m m i n g language, w i t h a s s i s t
statements, " c o b e g i n - c o e n d " statements, a n d p r o c e d u r e s . I n e f f e c t , w e
s h o w h o w t o t r a n s l a t e t h i s l a n g u a g e d i r e c t l y i n t o CCS. T h e o t h e r is a
r e s t r i c t i o n o f C C S i n w h i c h d e t e r m i n a c y is guaranteed, a n d w e i n d i c a t e
h o w p r o o f s a b o u t s u c h p r o g r a m s c a n b e s i r ~ l e r t h a n i n the g e n e r a l case.
F i n a l l y , i n C h a p t e r ii w e t r y t o e v a l u a t e w h a t h a s b e e n achieved,
a n d i n d i c a t e d i r e c t i o n s f o r f u t u r e research.
CHAPTER 1
E x p e r i m e n t i n g o n n o n d e t e n n i n i s t i c m a c h i n e s
i o i
T a k e a p a i r
= { a , b , c , d } :
T r a d i t i o n a l e q u i v a l e n c e o f f i n i t e s t a t e a c c e p t o r s
S , T o f n o n d e t e z a d n i s t i c a c c e p t o r s o v e r t h e a l p h a b e t
T
T h e a c c e p t i n g s t a t e s o f S a n d T a r e s 2 a n d t 2 r e s p e c t i v e l y ; i n n o n -
d e t e r m i n i s t i c a c c e p t o r s w e c a n a l w a y s m a k e do, as h e r e , w i t h a s i n g l e 'dead'
a c c e p t i n g state.
A s t a n d a r d ~ t t h a t S a n d T a r e e q u i v a l e n t , m e a n i n g t h a t t h e y
a c c e p t t h e s a m e l a n g u a g e (set o f s t r i n g s ) , r u n ~ as f o l l o w s .
t i) t o r e p r e s e n t t h e l a n g u a g e a c c e p t e d s t a r t i n g f r c m s t a t e s i (resp t i) , w e
g e t a s e t o f e q u a t i o n s f o r S , a n d f o r T :
s O = as I t O = a t 1
s I = b s 2 + cs 3 t I = b t 2
!
S 2 = ~ t I = c t 3
S 3 = ds 0 t 2 =
t 3 = d t 0
+ at~
H e r e as u s u a l + s t a n d s f o r u n i o n o f l a n g u a g e s , e f o r t h e l a n g u a g e
c o n t a i n i n g ~ n l y t h e 6 ~ p t y string, a n d w e c a n t h i n k o f t h e s y m b o l a
f o r a f u n c t i o n o v e r l a n g u a g e s : as = a(s) = {a~; ~ E s} .
N o w b y sinlole s u b s t i t u t i o n w e d e d u c e
s O = a ( b c + cds0) .
B y a p p l y i n g t h e d i s t r i b u t i v e l a w a ( s + s') = as + as' w e d e d u c e
s O = ab~ + a c d s 0
T a k i n g s i (resp
s t a n d i n g
1 0
and w e can go further, using a standard rule for solving such equations known
as Arden' s rule, to get
s O = (acd)*abe .
For T it is even simpler; w e get directly (without using distributivity)
t O = ab~ + acdt 0
and the unique solvability of such equations tells us that s O = t O , so S
and T are equivalent acceptors.
But are they equivalent, in all useful senses?
1.2 Experimentin 9 upon acceptors
Think differently about an acceptor over {a,b,c,d> . It is a black
box, whose behaviour y o u w a n t to investigate b y asking it to accept symbols
one at a time. So each b o x has four buttons, one for each symbol:
S b
a a
i I
w
s O d T b t O
t
There are four atomic e x p e r ~ t s y o u can do, cne for each symbol. Doing an
a-experiment on S (secretly in state s O , b u t you don't know that) con-
sists in trying to press the a-button, with two possible outccmes in general:
(i) Failure - the button is locked;
(ii) Success - the button is unlocked, and goes down (and
secretly a state transiticn occurs).
In fact w e cannot distinguish between S and T , in their initial states,
by any single atcndc experiment; the a-experiment succeeds in each case, and
the other three fail.
After a successful a-experiment on each machine, which m a y y i e l d
a
S b l s 1 ~ d T b
t . t
t
a
# i
d
w e m a y try another atc~tic experiment, in our aim to see if the machines are
equivalent or not. Clearly a b-experiment now succeeds for S and fails
11
for T , though the other three e x p e r ~ t s fail to distinguish the~. A f t e r
trying the b-experiment, then, can w e conclude that S and T are not
equivalent?
No, because S's response to the a-experiment could have been different
(for all w e know) and locked the b-button, w h i l e T's response could have
been different (for all w e know - and it could indeed') a n d unlocked the
b-button. Following this argLm~nt further, w e m a y feel forced to admit that
no finite amount of experiment could prove to us that S and T are, or are
not, equivalent'.
B u t suppose
(i) It is the weather at any mcn~nt w h i c h determines the choice of
transition (in case of ambiguity, e.g. T at t O under an
a-experiment) ;
(ii) The weather has only finitely many states - at least as far
as choice-resolution is concerned ;
(iii) We can control the weather .
For sane machines these assunptions are not so outrageous; for example, one
of two pulses m a y always arrive first w i t h i n a certain temperature range, a n d
outside this range the other m a y always arrive first. (At the boundary of
the range w e have the well-known glitch problem, w h i c h w e shall ignore here.)
Nc~, b y conducting an a-experiment an S and T under all weather con-
ditions (always in their start states, which w e have to assume are recover-
able), w e can find that S's b-button is always unlocked, b u t that T's
b-button is sc~etimes locked, and we can conclude that the machines are not
equivalent.
Is this sense of equivalence, in which S and T are not equivalent,
a meaningful one? W e shall find that w e can m a k e it precise and shall adopt
it - partly because it yields a nice theory, partly because it is a finer
(s~aller) equivalence relation than the standard cne (which w e can always
recover b y introducing the distributive law used in i.i), b u t m o r e for the
following reason. Imagine that the b-buttons on S and T are hidden.
Then in all weathers every successful e x p e r ~ t upon S unlocks same
visible button:
S (with b hidden) is not deadlockable
12
while in sc~e weathers, and after same experiments, all of T's visible
buttons will be lo~ked:
T (with b hidden) is deadlockable.
We wish to think of a nondeterministic choice in such machines as being
resolved irreversibly, at a particular manent, by information flowing into
the system from an unseen source; if a deadlock can thus arise in one machine
but not in another, we do not regard them as behaviourally equivalent.
1.3 Behaviour as a tree
Because we reject the distributive law a(x + y) = ax + ay , we can no
longer take languages (sets of strings) as the behaviours of our machines.
We proceed to an alternative. Frcm now on we will use NIL instead of e
to stand for a behaviour which can do nothing (= admits no experiment) ; we
shall also use Greek letters for our ~ i s - i.e. names of buttons - so you
should consider ~,~,y ,5 as replace~_nts for a,b,c,d in our sinple example.
First, take the transition graph for S and unfold it into a tree with
states as node labels and symbols as arc labels:
B
Because state na~es are present we have lost no information; the state trans-
ition graph can be recovered frcm such a tree. But the experimenter cannot
see the state - he can only see the transitions. This leads us to drop the
node labels, and take the infinite tree
U
as the behaviour of S . a - -
I Definition A label is a n~mber of a given (fixed) label set A .
We are using ~,B,Y,.. to stand for labels. (The use of the word 'label' in
place of 'symbol' will be further motivated later.)
13
I Definition A sort is a subset of A g
W e shall usually use L,M,N, .. to stand for sorts. We shall also often use
the word a~ent in place of 'madline' or 'acceptor', so
'S is an acceptor over the alphabet Z'
becomes
'S is an agent of sort L'
Definition A Rigid Synchronization Tree (RST) of sort L is a rooted,
unordered, finitely b r a n ~ tree each of whose arcs is labelled b y a
member of L .
Thus the tree in the last diagran is an RST of sort {~, B, ~, 8} . (It is also
an RST of any larger sort.)
Why 'rigid'? Because it is the behaviour of a rigid agent - one which
can make no transition except that corresponding to an atomic experiment. We
shall soon meet other transitions.
Why 'synchronizaticn'? Because we shall later see how the oammunication
of two agents can be represented in fozrcing their joint tree frcm their
separate trees. Then the joint tree will not be rigid, in general, since
intercuf, udnication between cc~ponent agents is not observable.
Notice that finite RSTs can be represented as expressions:
B / / ~ is (BNIL + ~NIL)
~ ~ is ~BNIL + ~ N I L
and usually there is more than one natural expression:
(~NIL 7NIL) , or is ~rIn
+ +
(c~LL + BNIL) + yNIL .
Indeed, + is both oactuutative and associative, since w e declared RSTs to
be unordered trees - and NIL is easily seen to be a zero for summation.
To justify these remarks w e nc~ define the algebra of RSTs.
14
i. 4 A l g e b r a o f R S T s
I g n o r i n g s o r t s f o r a m c n ~ n t , w e h a v e a n e l e m e n t a r y a l g e b r a o v e r RSTs,
w h o s e o p e r a t i o n s are:
N I L (nullary operation)
N I L is t h e t r e e ;
+ (binary operation)
+ A is t h e t r e e ~ (identify roots) ~
(unary o p e r a t i o n , f o r e a c h ), ~ A)
T h e y o b e y t h e f o l l c ~ i n g laws, as y o u c a n e a s i l y see:
A s s o c i a t i v i t y x + (y + z) = (x + y) + z
Ccurnutativity x + y = y + x
N u l l i t y x + N I L = x
I n fact, t h e s e laws a r e ccalolete: a n y t r u e e q u a t i c n b e t w e e n R S T e x p r e s s i o n s
c a n b e d e d u c e d f r c m them.
If w e c o n s i d e r sorts, a n d l e t R S T L b e t h e s e t o f R S T s o f s o r t L ,
t h e n N I L is o f s o r t L f o r a n y L :
N I L ~ R S T L .
F u r t h e r , + t a k e s t r e e s o f s o r t L , M r e s p e c t i v e l y t o a t r e e o f s o r t L u M :
+ E R S T L R S T M R S T L u M ,
a n d ~ t a k e s a t r e e o f s o r t L t o a t r e e o f s o r t L u { l } :
W e s h a l l u s u a l l y f o r g e t a b o u t s o r t s f o r t h e p r e s e n t , b u t t h e r e a r e t i m e s
l a t e r w h e n t h e y w i l l b e e s s e n t i a l .
C o n s i d e r n o w s o l v i n g r e c u r s i v e e q u a t i o n s o v e r RSTs. W e w i s h t h e e q u -
a t i o n s f o r o u r a g e n t S o f l.1
s O = ~ s I s I = ~s 2 + y s 3
s 2 = N I L s 3 = 6s 0
t o d e f i n e t h e (infinite) b e h a v i o u r o f S as a n R S T o f s o r t {~,8,Y,8} -
15
This set of equations has a unique, solution for the variables s0 ' " " s 3 ;
you can see this b y the fact that the entire tree can be developed top-down
to any depth:
s O
Exercise i. 1
= = = ... and so on.
Not every set of recursive equations has a unique solution;
consider the simple equation
s = s
which is satisfied by any RST (or anything else, for that matter) .
Again, scrne sets of equatioD~ define no R S T at all. Consider the equation
s = s + ~ N I L ;
a solution w o u l d have to be infinitely branching at the root. Even if w e
allowed infinitely branching RSTs, so that
w o u l d b e a solution, it w o u l d not b e unique since s O + t would also
be a solution for any t . W e defer this problem to Chapter 5.
C a n y o u find a condition on a set of equations
Q
O i O
s O =
s i =
o o o
S n =
(with RST expressions involving s O ,.. ,s n
on the right-hand sides)
which ensures that it possesses a unique solution in RSTs?
(Hint: consider cycles of c-transitions in transition graphs.)
1.5 Unobservable actions
Under the conventional definition, a nondeterministic acceptor m a y
have transitions labelled b y ~ ~ the null string. Consider R , a modi-
fication of our S of i.I (reverting briefly to Rcn~ml alphabet):
R a ~ ~ d ~ ~
1 6
(The loop fomaed by the d-transition is irrelevant to our ccrnparison.)
In the conventional sense, R and S are equivalent. But what does the
c-transition mean, in our more mechanistic interpretation? It means that
R in state r i (i.e. after the a-button has been pressed) may at any time
' and that if a b-experiment is never attesloted move silently to state r I ,
it will do so.
Thus, if we attespt a b-experiment on R , after the successful a-
experiment, there are sc~e weather conditions in which we find the b-
button peamanently locked; if on the other hand we a t t ~ a c-experiment
(after the a-experiment) we shall in all weather conditions find the
c-button eventually unlocked (eventually, because although R may take a
little t ~ to decide on its e-transition, it will do so since no b-
experiment is attespted).
Exercise 1.2 Use this as the basis of an ~ t that no pair of R, S
and T are equivalent. A rigorous basis for the a r ~ t will be given
later.
Let us return to our Greek alphabet, and ask how we should write the
equations specifying R's behaviour. We choose the symbol T in place of
e (to avoid confusion with the null string), and use it as a new unary
operation uponbehaviours.
r0,..,r 3 are:
r 0 = ~r I
r 2 = NIL
We are ass~aing that
The equations dete_~mining the behaviours
r i = 8r 2 + xr~
r 3 = ~r 0
T % A (the fixed label set).
!
r I = yr 3
Definition A Synchronization Tree (ST) of sort L is a rooted, unordered,
finitely branching tree eac~ of whose arcs is labelled by a ~ r of
L u { ~ } .
Thus a rigid ST (an RST) is just an ST with no arcs labelled T ;
the behaviour of an agent which can make no silent transitions.
Since we are taking the unary operation
we can of course deduce the ST-behaviour of R . It is
it is
T over STs to be given by
17
Y
y -
STs are a sinlole and useful notion of behaviour. They are just the
unfoldings of behaviour equations, which in turn follow directly fran
transition graphs. Of course in this way different transition graphs can
yield the sane ST, frcrn which w e can be certain that they are i n d i s ~ s h -
able b y experiment.
Exercise 1.3 Convince yourse1_f that the transition graphs
have the same unfolding.
However, different STs (or transition graphs yielding different STs)
may be indistinguishable by experiment. This is true even for RSTs;
consider the simple pair
each of which adaits a single ~-experiment and then nothing else.
But it is even more true in the case of unobservable actions. Later
w e shall study an equivalence relation, c~servation equivalence, over STs,
which can (for finite STs) be axicmatized by a finite set of equations
added to those given in 1.4 above. To get a foretaste of the equivalence
consider the following exercise.
Exercise 1.4 ExamiD~ each of the following pairs of s ~ p l e STs and try to
decide by infozmal ~ t , as in Exercise 1.2 above, which are observation
equivalent (i.e. indistinguishable b y experiment). You may reasonably
conclude that four pairs are equivalent, or that six pairs are equivalent,
b u t you should also find that the notion of equivalence is not yet precise.
Ehe point of this exercise is that it is not trivial to capture our infozmal
arguments b y a precise notion.
o
H
~
o
H
~
c
~
o
~
v
f
~
O
~
o
Chapter 2
Synchronization
2.1 Mutual experimentation
~he success of an s-experiment enables the machine to proceed (to
offer further experiments); it also allows the observer to proceed (to
attempt further experiments). This suggests an ~bvious symmetry; w e
w o u l d like to represent the observer as a machine, then to represent the
ccmposite observer/machine as a machine, then to understand h o w this
m c h i n e behaves for a new observer.
H o w should two machines interact?
S ~ T 0
W e m u s t say w h i c h experiments offered by S m a y combine w i t h o r (ccraplement)
w h i c h experiments of T to y i e l d an interaction. Rather than set u p a
label correspondence (e.g. a ++~, ~++ n) for each machine ccmbination,
w e introduce a little structure on o u r label set A.
We ass~ne a fixed set A of names. W e use ~, B, y, ... to stand for
names
W e assume a set ~ of co-names, disjoint frc~ A and in bijection
with it; the bijection is (-):
o~(~A) ~ <~(cA)
and w e call ~ the co-name of
w e have ~ = ~.
N C ~ w e assume A = A u
to range over A. W e call l
of
to be our set of labels. W e shall use X
and [ cc~plementary_ labels.
The function (-) is n o w a bijection over A. W e extend it to subsets
A; in particular for any sort L, ~, = {~; X~L}.
W e shall scmetimes need the function
name(a) = name (~) =
~. Using ( ) also for the inverse bijection,
which w e extend to sorts b y defining
20
n a ~ e s (L) = {n~ne(l) ; 16L} .
N O W c o n s i d e r t h e p a i r o f m a c h i n e s
Y
S: {~,S,~}
Y
T h e n a t u r a l candidate, perhaps, for t h e ccr~bined m a c h i n e
p i c t u r e d thus:
/
I
S l i t
m a y b e
or:
ST 1_
\ ........ _/
T h e i n t u i t i o n is t h a t c c ~ o l e m e n t a r y ports, o n e i n e a c h m a c h i n e , a r e
l i n k e d a n d h i d d e n (labels removed), s i n o e t h e s e links r e p r e s e n t m u t u a l
o b s e r v a t i o n , w h i l e o t h e r p o r t s s t i l l s u p p o r t e x t e r n a l o b s e r v a t i o n .
B u t u n d e r this s c h e m e t h e r e a r e t w o d i s a d v a n t a g e s . First, c o n s i d e r
r
R: {8,~}
21
We can form RII[SIIT) and (RIiS)!IT:
1
r [
[
I i
..... j
1
each of sort {~,~} but clearly different. S's offers of 8-experiments
are observed by T in the first case, but by R in the second case. So
II is not associative.
Second, it is useful to allow that S's 8-experiment-offers
(or 8-capabilities as w e shall sometimes call them) may be observed b y
either R or T (that is, each 8-experiment cn S may be done by either
R or T, but not both) ; this makes S into a resource shared by R
and T.
The solution is to factor cc~biD~tion into two separate operations:
one to link ports, the other to hi__~ them. We shall use the %Drd
.composition for the first of these operations, and the second w e shall
call restriction.
2.2 Cc~0osition, restricticn and relabelling
The ccsposite RIS of our two machines R and S may be pictured
i s
i
r.
while for (RIS) IT we get
22
8
~ h a t is, f o r e a c h I, i n foi~r/ng U I V w e l i n k e v e r y p o r t l a b e l l e d
i n U t o e v e r y p o r t l a b e l l e d [ i n V.
E x e r c i s e 2.1 F r c m R 1 (SIT) as a picture, a n d c c n v i n c e y o u r s e l f b y o t h e r
~examples t h a t - o n p i c t u r e s - c o m p o s i t i o n is a n a s s o c i a t i v e a n d cc~sau-
t a t i v e operation.
B e f o r e d e f i n i n g c c ~ p o s i t i c n o f b e h a v i o u r s , let u s l o o k a t t w o o t h e r
o p e r a t i o n s o n p i c t u r e s .
F o r e a c h ~ , w e d e f i n e a p o s t f i x e d r e s t r i c t i o n o p e r a t i o n \5,
w h i c h o n p i c t u r e s j u s t m e a n s "hide t h e p o r t s l a b e l l e d ~ o r ~", i.e.
i t d r o p s t h e l a b e l s
( R J S ) \ ~
I - i
a n d ~ f r c m p i c t u r e s , t h u s r e d u c i n g t h e i r sort.
( = R N S )
((RIS) IT)\8\Y\~
s T ........ i t
\ _ J
23
E x e r c i s e 2.2 W h i c h o f t h e f o l l o w i n g a r e i d e n t i c a l as p i c t u r e s ?
(i) ( ( R I S ) IT)\B\\~ (v) (RI (SlT)\6)\Bky
( i i ) ((RIS)kSIT)ky\: (vi) (RI (SlT)\x)\B\~
( i i i ) ( ( R I S ) \yIT) \B\~ (vii) ((RIT) \6 IS) \B\y
(iv) ((RXyIS) IT)XB\6 (viii) ( ( R I T ) k 6 1 S \ 6 ) \ B \ y
Note: \a b i n d s t i g h t e r t h a n I , s o t h a t U : V ~ m e a n s
uI ( v ~ ) .
B e s i d e s i t s u s e w i t h c c ~ i t i c ~ , t h e r e s t r i c t i o n o p e r a t i o n b y i t s e l f
c o r r e s p o n d s t o a sinple, r a t h e r concrete, a c t i o n : - t h a t o f h i d i n g o r
'internal\sing' c e r t a i n p o r t s o f a m a c h i n e . C o m p a r e t h e r e ~ a r k s o n h i d i n g
t h e b - b u t t o n s o f t w o m a c h i n e s , a t t h e e n d o f 1.2.
N o t e t h a t w e c a n d e f i n e S liT, w h e r e S : L a n d T:M, b y
Sll T = (SIT)\~I...\~ n w h e r e {~l,..O,an} = n a m e s ( L ~ ) .
W e s h a l l h e n c e f o r t h a b a n d o n t h e u s e o f u p p e r c a s e l e t t e r s f o r m a c h i n e s .
T h e r e is a f i n e d i s t i n c t i o n b e t w e e n t h e i d e a s o f (i) a m a c h i n e w h i c h m a y
m o v e t h r o u g h states b u t ~ +_he s a m e m a c h i n e (a p h y s i c a l notion) a n d
(ii) a m a c h i n e - s t a t e pair, i.e. a w a y o f s p e c i f y i n g a b e h a v i o u r w i t h a
d e f i n i t e s t a r t (a m o r e m t h e m a t i c a l n o t i o n , e x e m p l i f i e d b y the n o n n a l
d e f i n i t i o n o f F i n i t e - s t a t e A c c e p t o r as c o n s i s t i n g o f a s t a t e set, a t r a n s i -
t i o n r e l a t i o n , a s e t o f a c c e p t i n g s t a t e s a n d a s t a r t state)o O u r l o w e r
c a s e l e t t e r s c o r r e s p o n d t o t h e l a t t e r i d e a - indeed, t h e y d e n o t e t h e s p e c i -
f i e d b e h a v i o u r s (here as STs), a n d i t is t h e s e w h i c h a r e t h e d c ~ a i n o f o u r
algebra; w e s h a l l s o o n s e e w h a t r l s etc. m e a n as b e h a v i o u r s o
W e a l s o h a v e a n o t h e r u s e f o r u p p e r c a s e letters; w e s a y t h a t S : L + M
(where L , M a r e sorts) i s a r e ! a b e l l i n g f r c m L t o M i f
(i) i t is a b i j e c t i o n ;
(ii) i t r e s p e c t s c c ~ l e m e n t s
( i . e o S(~) = S(~) f o r ~,~eL)o
W e d e f i n e t h e p o s t f i x e d r e l a b e l l i n ~ o p e r a t i o n IS ], o v e r (pictures of)
m a c h i n e s o f s o r t L, a s s i m p l y r e p l a c i n g e a c h l a b e l l e L b y S(1).
T h u s f o r r , t a s a b o v e w e h a v e
~ I t = I
, -
Y
24
a n d S: {fl,y,8,~} { S t y , e , [ } , g i v e n b y
s ( ~ ) = 6 , s ( ~ ) = y , s ( ~ ) = ~ , s ( ~ ) = s
i s a r e l a b e l l i n g ; w e t h e n h a v e
( r I t ) [ s ] =
W e s h a l l u s e c o n v e n i e n t a b b r e v i a t i o n s i n w r i t i n g r e l a b e l l i n g s e x p l i c i t l y .
T h u s
i i / ~ I , . . . , i n / ~ n o r 1 1 1 2 " " " i n / ~ l S 2 " " " ~ n
( w h e r e e l , . O . , a n a r e d i s t i n c t n a n e s , a n d I i , . . . , I n a r e l a b e l s w i t h
d i s t i n c t n a r e s ) s t a n d s f o r t h e r e l a b e l l i n g S : L M g i v e n b y
(i) S ( ~ i ) = I i i f e i ~ L
( i i ) S(~i) = I i i f m i ~ L
( i i i ) S(1) = I i f n a m e ( 1 ) ~ { e l , . . . , a n }
p r o v i d e d t h a t t h e f u n c t i o n s o d e f i n e d i s a r e l a b e l l i n g . S o i n p l a c e o f
( r l t ) [ ~ a b o v e , w e w r i t e
(rlt)[~/8, ~ / 8 ] o r ( r ] ) [ ~ e / 8 ~ ] .
W h e n w e s e e t h e l a w s o f t h e F l o w A l g e b r a (laws f o r t h e C ~ i t i o n ,
R e s t r i c t i o n a n d R e l a b e l l i n g o p e r a t i o n s ) i n T h e o r e m 5 . 5 , w e s h a l l s e e t h a t
r e l a b e l l i n g d i s t r i b u t e s o v e r oc~i0osition, s o t h a t w e h a v e
( r I t ) [ ~ / ~ , ~ / 8 ] = r [ ~ / B , e / 6 ] ] t [ ~ / ~ , c / 8 ]
(as y o u c a n r e a d i l y check) - e v e n t h o u g h i n s t r i c t f o z m a l i t y ~ / B , e / 8
s t a n d s f o r a d i f f e r e n t m e l a b e l l i n g i n e a c h c a s e , b e c a u s e r , t a n d r ] t
p o s s e s s d i f f e r e n t s o r t s .
2 . 3 E x t e m f ~ n @ t h e A l g e b r a o f S y n c h r o n i z a t i o n T r e e s
W e m u s t n o w a d d o u r t h r e e n e w o p e r a t i o n s t o t h e a l g e b r a o f S T s , u s i n g
i n t u i t i o n a b o u t t h e o p e r a t i o n a l m e a n i n g o f t h e s e t r e e s . I n f u t u r e w e
c o n t i n u e t o u s e I t o r a n g e o v e r A, a n d u s e ~,~ t o r a n g e o v e r Au{T}.
25
Cc~oosition I : ST L x ST M STLu M
Consider two STs
t = ~ u =
For their ~ i t e , four actions are possible, tlu
(because t does), so one branch of tlu will b e
/
This branch represents independent action b y one ccrsponent, and similar
branches exist for a 8-experiment o n t and a n m-experiment o n u. None
of these three branches represents interaction between t and u; but
there i s a possible interaction, sinoe u's m-offer ccmpl~ments t's
e-offer. Since this action is internal (not observable) w e use T and
represent it in the composite tree b y a branch
Putting all the branches together yields
admits a n e-experiment
N o w cc~position of t and u has been defined in tezms of cc~position
of their sons; clearly this amounts to a recursive definition of 1
More precisely, since every tree m a y b e written in the fozm
t = ~ ~iti , ~i~Au{~}
l_<i<_m
(with m = O if t = NIL), w e m a y define ~ i t i o n as follws:
Definition If t = [~iti and u = [~ .u., then
i j 3 3
tlu = [~i(tilu) + ~ j ( t l u j) + [_ Y(tilu j)
3 ~i =~ j
26
E x e r c i s e 2 . 3 (Consider o n l y f i n i t e STs).
(i) P r o v e b y ~ d u c t i o n o n the d e p t h o f t t h a t t l N I L = t.
(ii) W o r k o u t t l u f o r t = a / ~ 8 a n d u = I~; c h o o s e s a n e
o t h e r examples.
(iii) P r o v e b y i n d u c t i o n o n t h e stwn o f t h e d e p t h s o f t r e e s t h a t
t l u = u l t a n d t I(ulv) = (tlu) Iv.
W e s h o u l d c r i t i c i z e t w o a s p e c t s (at l e a s ~ ) o f o u r definition.
C o n s i d e r i n g o u r f i r s t e x a m p l e o f S T ~ s i t i o n , i t c a n w e l l b e a r g u e d
t h a t t h e f o r m w e g a v e f o r t l u fails t o r e p r e s e n t t h e p o s s i b l e c o n -
c u r r e n t a c t i v i t y o f t a n d u - f o r example, w e m a y t h i n k t h a t a
g - e x p e r i m e n t o n t c a n b e p e r f o r m e d s ~ t a n e o u s l y w i t h a n W - e x p e r i m e n t
o n u, w h i l e (looking a t y o u r r e s u l t f o r E x e r c i s e 2.3(ii) also) t h e S T
f o r t l u m e r e l y i n d i c a t e s t h a t the t w o e x p e r i m e n t s m a y b e p e r f o r m e d i n
e i t h e r order. Indeed, S T s i n n o w a y r e p r e s e n t t r u e concurrency.
T w o n o t c o m p l e t e l y c o n v i n c i n g d e f e n c e s c a n b e given. First, S T s
a r e simple, a n d t r a c t a b i l i t y i n a m o d e l h a s g r e a t advantages; second,
i n s o f a r as w e w i s h a 'behaviour-object' t o t e l l u s h o w a s y s t e m m a y
a p p e a r t o a n o b s e r v e r w h o is o n l y c a p a b l e o f o n e e x p e r i m e n t a t a time,
w e f i n d i t p o s s i b l e t o i g n o r e t r u e c o n c u r r e n c y . Y o u a r e u r g e d t o
c o n s i d e r this q u e s t i o n i n g r e a t e r depth.
T h e s e c o n d a s p e c t f o r c r i t i c i s ~ is t h e i n t r o d u c t i o n o f T t o r e p r e s e n t
s u c c e s s f u l 'mutual o b s e r v a t i o n s ' . I f w e h a d n o n e e d f o r i t i n d e f i n i n g I,
w e c o u l d l e a v e i t o u t o f o u r t h e o r y a l t o g e t h e r .
A g a i n , t h e r e a r e t w o defences, b u t t h i s t i m e c o n v i n c i n g ones. First,
c o n s i d e r r e p l a c i n g t h e t h i r d t e r m i n t h e r e c u r s i v e d e f i n i t i o n o f t l u -
n a m e l y t h e t e a m [ T ( t i l u j) - b y j u s t [ ( t i I % ) ;
intuitively, a n i n t e r n a l a c t i o n j u s t v a n i s h e s . I t t u r n s o u t t h a t 1
is n o l o n g e r a n a s s o c i a t i v e o p e r a t i o n , w h i c h c o n f l i c t s s t r o n g l y w i t h o u r
a s s u m p t i o n t h a t t h e j o i n t b e h a v i o u r o f t/kree a g e n t s s h o u l d i n n o w a y
d e p e n d u p o n t h e o r d e r i n w h i c h w e w i r e t h e m t o g e t h e r b e f o r e t h e y d o a n y -
thing'
E x e r c i s e 2.4 W i t h this n e w d e f i n i t i o n w o r k o u t t I ( u l v ) a n d (tlu) Iv
f o r t = e , u = a , v = 8 t o j u s t i f y t h e a b o v e assertion.
27
T h e s e c o n d d e f e n c e is t h a t w e m u s t s c ~ e h o w express, i n t h e S T (tlu)\~
w h e n t = a A B , u = I~, t h e p o s s i b i l i t y t h a t c c m a u n i c a t i o n b e t w e e n t
a n d u c a n p r e v e n t a n y B-experiment.
E x e r c i s e 2.5 U n d e r t h e n o n a a l d e f i n i t i o n o f
w o r k o u t t h a t
( t l u ) \ ~ = T ~ B
i n this case.
I, a n d o f \~ (see below) ,
T h i s S T does i n d e e d r e p r e s e n t p o s s i b l e p r e v e n t i o n o f a 8-experiment,
a n d u n l e s s w e l e a v e S T s (and d e r i v e d models) a l t o g e t h e r i t is h a r d t o
s e e h o w s u c h d e a d l o c k p h e ~ c a n h e r e p r e s e n t e d w i t h o u t z.
R e s t r i c t i o n \ ~ : S T L S T L _ { ~ , ~ } (~cA)
W e w i s h t o d e n y a l l ~- a n d m - e x p e r i m e n t s , s o t h a t t\~ is f o r m e d
b y p r u n i n g a w a y a l l b r a n c h e s a n d slAb-branches l a b e l l e d ~ o r e. C o n s i d e r i n g
t =
again, w e s e e t h a t
(tlu) \ ~ =
M o r e formally, f o r t = ~. i t i w e h a v e
D e f i n i t i o n t\~ = ~ - ~i (ti \~)
A n o b v i o u s a l t e r n a t i v e t o t h e r e s t r i c t i o n o p e r a t i o n w o u l d b e t o d e f i n e
\l f o r e a c h m e ~ b e r i o f A b y
t\l u i ~ l ~ i (ti\l) ;
i n o t h e r w o r d s , w e m i g h t c h o o s e t o r e s t r i c t n a ~ e s a n d o o - n a m e s i n d e p e n d e n t l y ,
i n s t e a d o f b o t h a t once. ~ n i s w o u l d , o f course, h a v e a c o r r e s p o n d i n g l y
28
d i f f e r e n t e f f e c t o n pictures. T h e r e a s o n f o r o u r c h o i c e is i n f a c t t o
d o w i t h t h e a l g e b r a o f p i c t u r e s (Flow Algebra) u n d e r I, \e a n d [S];
i t h a s a p a r t i c u l a r l y s i m p l e a l g e b r a i c t h e o r y [~M, M i l 2], w h i c h w e
h a v e n o t f o u n d f o r t h e s u g g e s t e d alternative.
R e ! a b e l l i n ~ IS]: S T L + S T M (S:L M a relabelling)
This o p e r a t i o n is as s i m p l e o n STs as it is o n p i c t u r e s ; i t j u s t
a p p l i e s t h e r e l a b e l l i n g S t o a l l labels i n t h e tree. M o r e formally,
f o r t = _ [ u i t i w e h a v e
1
D e f i n i t i o n t[S] = _~S(~ i)
(ti[S])
1
w h e r e w e n o w a d o p t t h e c o n v e n t i o n t h a t S ( T ) = f o r a n y r e l a b e l l i n g S.
A n i m F ~ r t a n t (though n o t t h e only) u s e o f r e l a b e l l i n g is i n c a s e s
w h e r e w e h a v e s e v e r a l i n s t a n c e s o f a s i n g l e a g e n t r i n a system, b u t
e a c h w i t h d i f f e r e n t labelling, s o t h a t u n d e r e c ~ p o s i t i o n t h e y a r e p r o p e r l y
linked. W e h a v e o n l y t o d e f i n e s e v e r a l ' copies'
r i = r [ S i]
o f t h e g e n e r i c a g e n t r, a n d t h e n c c ~ p o s e t h e r i.
O n e m i g h t h a v e a l l o w e d m o r e g e n e r a l relabellings, u s i n g m a n y - o n e
functions o v e r A (so t h a t d i f f e r e n t l y l a b e l l e d p o r t s c c m e t o b e a r t h e
s a n e label) o r e v e n r e l a t i o n s i n p l a c e o f f u n c t i o n s (so t h a t o n e p o r t
c o u l d 'split' i n t o t w o d i f f e r e n t l y l a b e l l e d ports). S u f f i c e i t t o s a y
t h a t this c r e a t e s p r o b l e m s i n t h e a x i c m a t i z a t i o n o f F l o w A l g e b r a . T h e
p r e s e n t c h o i c e a l l o w s p l e n t y o f scope.
2 . 4 A s i m p l e exar~ole: b i n a r y S ~ n a p h o r e s
A b i n a r y s e m a p h o r e s , o f s o r t {~,~}, m a y b e p i c t u r e d
1[
r -
TO g a i n t h e s~, at : t ~or e ( Di j k s t r a ' s P Op e r a t i o n ) we mus t p e r f o r m a
ext : exi ment ; we r e l e a s e i t ( t he V ope r a t i on) by a ~- e x~r ~me nt .
s = ~ s
1[-
C l e a r l y
29
expresses the appropriate behaviour (a long thin ST'). Imagine a
generic agent p, whose critical section w e represent b y a sequence
<~,8> of atomic actions (experiments upon a resource, say), and whose
non-cri%ical section w e ignore:
p = ~ 6 ~ p .
W e wish to place several instances of p
P i = P[Si] = ~ i 6 i ~ P i (where S i = ~i8i/~6)
in ~ c a t i o n with s, and derive the ocmposite ST. Consider just
two copies of p (i = 1 , 2 ) and form
q = (pllP21S)\~\ ~
which m a y be pictured as shown:
~1 a, 2
p s p
61 62
q
We e a s i l y der i v e an equat i on f o r t he az~posi t e ST q, usi ng t he Expansi on
Theorem - gi ven i n 2.5 - r epeat edl y. You shoul d r ead t h a t s ec t i on wi t h
r ef er ence t o t he expansi on whi ah f ol l ows :
q = (~a 181~pl I ~ 2 6 2 P 2 !~S) \~,\
= T ( ( ~ I s ~ p l i P 2 1 S s ) \ ~ \ ) + T ( ( p ~ I ~ 2 6 2 ~ P 2 i ~ s ) \ ~ \ ~
= re161( (#Pl IP2 I~s) \~\~) + ~ 2 8 2 ((Pll#P2 lSs) \~\~)
= T~161T ( (Pl IP2 Is) \~\~) + T~262~ ( (Pl I P2 Is) \~\# )
= ~e181Tq + T~262T q
SO q is the ST given recursively by
~I ~2
30
a n d e x a c t l y e x p r e s s e s t h e f a c t t h a t t h e c r i t i c a l s e c t i o n s o f Pl a n d
P2 c a n n e v e r o v e r l a p i n time, i.e. a s e q u e n c e like ~I~2BI... is n o t
possible.
I n fact, a n n - b o u n d e d s ~ m a p h o r e (n_> i) c a n b e c o n s t r u c t e d as
s = s l s l . . . I s
n
n t i m e s
t h i s is a n e x a n p l e o f cc~Iocsition w h i c h e f f e c t s n o linkage, b u t w i l l y i e l d
a m u l t i - w a y linkage w i t h ' u s e r ' agents.
T h e 2 - b o u n d e d s e m a p h o r e s 2 ,
B 2
/ /
c~ 3
P B 3 P
w i t h 3 users, c a n b e p i c t u r e d
I I I I
1 1 i
D i a g r a m f o r (piIp21P31S2)\~\~
s 2
(s2's border, a n d its t w o c o l l e c t o r nodes, a r e fictitious; t h e y a r e j u s t
u s e d h e r e t o a v o i d d r a w i n g 12 links i n t h e picture).
E x e r c i s e 2.6 A s p r a c t i c e i n u s i n g t h e E x p a n s i o n T h e o r ~ n , d e v e l o p t h e
e x p r e s s i o n q = (pl[p21P31SlS)\~\~, a n d d r a w p a r t o f t h e S T t o o o n v i n o e
y o u r s e l f t h a t a t m o s t t w o c r i t i c a l s e c t i o n s c a n b e s i m u l t a n e o u s l y active.
C a n y o u e v e n d e r i v e a s e t o f m u t u a l l y r e c u r s i v e b e h a v i o u r e q u a t i o n s , f o r
w h i c h q is t h e s o l u t i o n ? It's a b i t lengthy, b u t possible. T h e
d e v e l o p m e n t is s h o r t e r i f y o u t a k e ~i=~2=~3=~, B1=~2=B3=8; i.e. d e a l
w i t h (plplplsls)\~\~ instead; t h e n t h e S T w i l l n o t d i s t i n g u i s h t h e
c r i t i c a l sections o f e a c h c o p y o f p, b u t y o u s h o u l d b e a b l e t o s h o w
t h a t a t a n y p o i n t i n t i m e t h e e x c e s s o f e ' s o v e r B's p e r f o r m e d
lies i n t h e r a n g e [0,23.
31
2.5 T h e S T ~ p a n s i o n T h e o r e m
W e c o n s i d e r t r e e s e x p r e s s e d i n t h e f o r m
t = [ ~ i t i .
l ~ i ~ n
F o r a s e t {~l,...,ek} = A o f names, w e a b b r e v i a t e
\ ~ 1 \ ~ 2 . . . \ ~ k b y \A.
T h e o r e m 2 . 1 (The E x p a n s i o n Theorem_)
L e t t = (t I I t 2 1 . . . . I t m ) \A, w h e r e e a c h t i is a s ~ n as above.
T h e n t = ~ { ~ ( ( t l l ' " I t " l l " ' I t m ) \ A ) ; l_<i_<m, ~t.'l a stl~mand o f
t i ,
na r ~ (V) ~A}
+ ~{T((tlI...It.' l...It.' l...Itm)\A); 1 < i < j _ < m ,
i 3
It i' a su~Inand o f ti, ~tj' a sun, hand o f tj }
P r o o f Omitted; i t u s e s p r o p e r t i e s o f t h e F l o w o p e r a t i o n s $, \~ a n d
[S], a n d c a n b e d o n e b y i n d u c t i o n o n m.
T h e t h e o r e ~ s t a t e s t h a t e a c h b r a n c h o f t c o r r e s p o n d s e i t h e r t o a n
u n r e s t r i c t e d a c t i o n o f s c ~ e t i , o r to a n i n t e r n a l c c ~ m u n i c a t i o n b e t w e e n
t. a n d t. (i < j). F o r e x a m p l e c o n s i d e r
l 3
( ( a t + ~ t ' ) I ( ~ u + y u ' ) I ( ~ v + ~ v ' ) ) \ ~ \ ~ ;
t h e t h e o r e m g i v e s u s
( u n r e s t r i c t e d actions)
+ ~ ( ( ( ~ t + s t ' ) i ( ~ u + ~ u ' ) I v ' ) \ ~ \ ~ )
+ T ( (tlu ] (~v + yV')) \~\B) ( ~ - c u t ~ , e n i c a t i o n )
+ T ( (t' I (~u + yu') Iv) \~\8) ( 8 - o a l m ~ i c a t i o n )
+ T ( ( (at + St') I u' Iv') \~\8) (y-cc~munication)
32
E x e r c i s e 2.7
C ~ c l e r
D i s ~ o i n e r
A l o t c a n b e d o n e u s i n g c c ~ p o s i t i o n s o f t w o k i n d s o f element:
B y
(i) W r i t e t h e b e h a v i o u r o f
c = e B y c
d = e ( B d + yd)
!
e ~ 8
I I
as a r e s t r i c t e d e c ~ D s i t i o n o f r e l a b e l l i n g s o f c. (The l i t t l e a r r o w s
r e p r e s e n t t h e p o r t a t w h i c h e a c h c o p y o f c o f f e r s its f i r s t e x p e r i -
r~_nt; t h e p r o g r e s s o f t h e s y s t e m c a n b e s i m u l a t e d b y " s w i n g i n g arrows":
t r y it). E x p a n d t h e b e h a v i o u r , t o g e t a r e c u r s i v e d e f i n i t i o n o f a n S T
w h i c h d o e s n ' t i n v o l v e c o m p o s i t i o n , r e s t r i c t i o n o r relabelling.
(ii) D e s i g n a s y s t e m (using c only) t o b e h a v e as t h e S T
s = ~ ( t B t s + tXts).
I S t h i s e q u i v a l e n t t o d?
C H A P T E R 3
A c a s e s t u ~ i n s y n c h r o n i z a t i o n , a n d p r o o f t e d l n i q u e s
3.1 A s c h e d u l i n 9 p r o b l e m
S u p p o s e t h a t a s e t {Pi ; I -<i-<n} o f a g e n t s a l l w i s h t o p e r f o z m
a c e r t a i n t a s k r e p e a t e d l y , a n d w e w i s h t o d e s i g n a s d u e d u l e r t o e n s u r e
t h a t t h e y p e r f o r m i t i n r o t a t i o n ~ s t a r t i n g w i t h P l (~his exan~ple
w a s u s e d i n [Mil 5 ]. )
M o r e p r e c i s e l y , t h e P i a r e t o s t a r t t h e i r p e r f o n u a n c e o f t h e
t a s k i n rotaticn; w e d o n o t ir~0ose t h e r e s t r i c t i o n t h a t t h e i r p e r f o z m -
ances s h o u l d e x c l u d e e a c h o t h e r i n t i m e (this c o u l d b e d o n e u s i n g a
s~ma~hore) b u t w e d o i m p o s e t h e r e s t r i c t i o n t b ~ t e a c h P i s h o u l d b e
p r e v e n t e d f r c m i n i t i a t i n g t h e t a s k t w i o e w i t h o u t ccrapleting h i s f i r s t
initiation. (Pi m a y t r y t h i s u n i n t e n t i o n a l l y , b e c a u s e o f b a d p r o g r a m m i n g
f o r example. )
S u p p o s e t h a t P i r e q u e s t s i n i t i a t i o n a t l a b e l a i ' a n d s i g n a l s
ccnpletion a t 8i (I -< i -< n). ~ h e n o u r s c h e d u l e r S c h o f s o r t A u B ,
w h e r e A = {~. ; l _ < i < n } a n d B = {8. ; 1 < i_<n} , m u s t ir~pose t w o
l 1
c o n s t r a i n t s o n a n y s i g n a l s e q u e n c e e (A u B ~ :
(i) ~ h e n a l l o c c u r r e n c e s o f ~i (l-<i-<n) a r e deleted, i t b e c o m e s
(al~ 2 .... ~ n ) ;
(ii) F o r e a c h i , w h e n a l ! o c c u r r e n c e s o f a j , S j ( j ~ i ) a r e d e l e t e d ,
i t beccr0es
W e c o u l d w r i t e a b e h a v i o u r d e s c r i p t i o n f o r S c h directly, b u t p r e f e r t o b u i l d
i t a s a r i n g o f e l e m e n t a r y i d e n t i c a l czmponents, c a l l e d cyclers.
G e n e r i c c y c l e r c :
34
S c h e d u l e r S c h :
8 2 ~ 3
u s i n g a l s o a ' s t a r t b u t t o n ' ,
S t a r t e r s :
I n b u i l d i n g t h e n e t w e h a v e i n s t a n t i a t e d c b y
I e i = e [ ~ i / ~ ' ~i/B' Y i / Y ' ~ i + 1 / ~ 3 1
f o r 1 < i _< n , w h e r e a d d i t i o n o n s u b s c r i p t s i s m o d u l e n , s o t h a t
I S c h = ( s ' e l ' "'" ' C n ) \ ~ l ' " \ Y n I
W h a t a r e t h e b e h a v i o u r s s a n d
e n a b l e c I a t Y 1 a n d d i e , s o
c ? T h e s t a r t e r i s t h e r e j u s t t o
A S for the c y c l e r , i t a p p e a r s t h a t h e s h o u l d c y c l e e n d l e s s l y a s f o l l o w s :
(i) B e e n a b l e d b y p r e d e c e s s o r a t y ;
(ii) R e c e i v e i n i t i a t i o n r e q u e s t a t ~ ;
(iii) R e c e i v e teITnination s i g n a l a t ~ a n d e n a b l e s u c c e s s o r a t 6 ,
i n e i t h e r o r d e r .
35
S o w e d e f i n e
a n d t h i s d e t e r m i n e s S c h cc~pletely. B u t d o e s it w o r k ? I n f o ~ m a l l y
w e c a n c o n v i n c e o u r s e l v e s t h a t i t does, b y arrow-swinging. M o r e
formally, t h e r e a r e t w o p o s s i b i l i t i e s :
M e t h o d 1 S h o w as d i r e c t l y as p o s s i b l e t h a t c o n s t r a i n t s (i) a n d (ii)
a r e met. F o r t h e f i r s t ccnstraint, t h i s m a y b e e ~ p r e s s e d as a b s o r b i n g
(i.e. permitting) a l l ~ i ccrsaunications, a n d s h o w i n g t h a t t h e r e s u l t
is o b s e r v a t i o n a l l y e q u i v a l e n t t o
(~1;2"" "~n ) ~
L e t u s m a k e t h i s p r e c i s e b y a d o p t i n g t h e c o n v e n t i o n t h a t i f s is a n y
n o n - ~ m p t y l a b e l sequence, t h e n s ~ is t h e b e h a v i o u r g i v e n b y
s = s ( s ~ ) .
T h e n w h a t w e w a n t t o prove, f o r t h e f i r s t constraint, is
- - - - - - L 0
(i) S c h l l ( 8 1 1 .... 18n ~) ~ (~1~2.--~n)
(where ~ is o b s e r v a t i o n a l e q u i v a l e n c e , w h i c h w e d e f i n e f o m a a l l y i n 3.3).
U s i n g t h e n o t a t i o n
{qi ; i ~ I } o r ~ q i
i~I
f o r m u l t i p l e ccn~cxgsition, w e c a n r e w r i t e (i) as
0 ~ --
S C h II F[ 8j ~ (~l'''an) '
l_<j~n
T h e r e q u i r e d e q u i v a l e n c e f o r t h e s e c c n d c c n s t r a i n t is
(~i~i) f o r e a c h i , l _ < i _ < n .
3~x 3~i
M e t h o d 2 W e c a n s p e c i f y t h e b e h a v i o u r o f t h e c o n p l e t e s c h e d u l e r b y a
s i n g l e p a r a m e t e r i z e d b e h a v i o u r e q u a t i o n , i n t h e f o l l o w i n g way. O b s e r v e
t h a t the s c h e d u l e r h a s t o k e e p t w o p i e c e s o f infomaation:
(a) A n i n t e g e r i (l_<i_<n) i n d i c a t i n g w h o s e t u r n i t is
t o i n i t i a t e next.
(b) A s u b s e t X o f [1,n] i n d i c a t i n g w h i c h a g e n t s are
c u r r e n t l y p e r f o r m i n g t h e task.
36
If
p a r a m e t e r v a l u e s i a n d X , t h e n w e c a n s p e c i f y t h e s c h e d u l e r b y
Spec(i,X) = Z ~j S p e e ( i , X - {j})
j ~ x
m
Spec(i,X) = ~i S p e c ( i + l , X u { i } ) +
Spec(i,X) r e p r e s e n t s t h e r e q u i r e d b e h a v i o u r o f t h e s c h e d u l e r f o r
(i e X)
~j S p e c ( i , X - {j}) ( i # X )
j c x
T h e s e e q u a t i o n s s a y t h a t i f P i is n o t p e r f o z m i n g h e c a n initiate, a n d in
a n y c a s e a n y p j ( j e X) c a n s i g n a l cc~oleticn. F o r this m e t h o d w e o n l y
h a v e t o p r o v e o n e o b s e r v a t i o n equivalence:
S c h ~ Spec(i,~)
In 3.4 w e g i v e p a r t o f a p r o o f u s i n g M e t h o d i, w h i c h m a y b e p r e f e r r e d
s i n c e i t d i r e c t l y r e p r e s e n t s t h e c o n s t r a i n t s as specified. M e t h o d 2 is
p o s s i b l e , b u t a little harder.
~
3.1 C a n y o u 'build' t h e c y c l e r d e f i n e d here, u s i n g s i x c o p i e s
II o f t h e c y c l e r c o f E x e r c i s e 2.7? I t is n o t h a r d , b u t t h e s e n s e i n
II w h i c h t h e c c n s t r u c t i o n b e h a v e s like t h e p r e s e n t c y c l e r n e e d s c a r e f u l
I I
U study. T h i s is d e a l t w i t h i n 3.3.
- E x e r c i s e 3.2 B u i l d a s c h e d u l e r w h i c h ini0oses a t h i r d c o n s t r a i n t o n a
s i g n a l s e q u e n c e E (A u B) ~ :
(iii) W h e n a l l o c c u r r e n c e s o f e i (i ~ i < n) are deleted, i t
b e o a n e s ( ~182..- 8n) a
T h i s c o D ~ t r a i n t s a y s t h a t t h e P i m u s t a l s o t e r m i n a t e t h e i r t a s k s
in c y c l i c order.
Note: T h e s e e x e r c i s e s a r e plaiting t o sc~e extent, b u t t h e y m a y h a v e
s a m e s i g n i f i c a n c e f o r b u i l d i n g a s y n c h r o n o u s h a r d w a r e f r o m cc~ponents.
T h i s r e m a i n s t o b e seen.
W e s h a l l n o w d i v e r t t o c c ~ p a r e o u r b e b a v i o u r s w i t h P a t t i Nets,
informally, u s i n g t h e s c h e d u l e r as a n example. R e a d e r s u n f a m i l i a r w i t h
N e t T h e o r y m a y s k i p t h e n e x t section.
37
3.2 B u i l d i n 9 t h e s c h e d u l e r as a P e t r i N e t
W e w i l l u s e P e t r i n e t s i n w h i c h t h e e v e n t s o r t r a n s i t i o n s a r e
l a b e l l e d b y m e m b e r s o f A u {T} . In fact, w e s h a l l j u s t c m i t t h e
T labels.
A n e t c , f o r o u r cycler, is as follows, w h e r e c i r c l e s s t a n d f o r
p l a c e s a n d b a r s f o r t r a n s i t i o n s :
Y
W i t h t h e i n i t i a l m a r k i n g as shown, t h e n e t is c l e a r l y live in t h e u s u a l
sense. B u t i n o u r i n t e r p r e t a t i o n a l - l a h ~ l l e d e v e n t is m e r e l y p o t e n t i a l ;
i t n e e d s c o o p e r a t i o n w i t h a n e v e n t w h i c h b e a r s a c c ~ p l e m e n t a r y label, o r
w i t h a n o b s e r v e r p e r f o r m i n g a ~ - e x p e m i n ~ t .
T h e f l o w o p e r a t i o n s I , \ ~ a n d [S] c a n b e s a t i s f a c t o r i l y d e f i n e d
over a c l a s s o f n e t s (as b ~ g e n s N i e l s e n h a s shown) i n s u c h a w a y a s t o
y i e l d a F l o w A l g e b r a . H e r e , h o w e v e r , i t %will b e e n o u g h t o u s e o n l y IS]
- t h e o b v i o u s r e l a b e l l i n g o p e r a t i o n - a n d t h e d e r i v e d o p e r a t i o n II ; if
n I a n d n 2 are n e t s o f s o r t L a n d M a n d if { e l " ' ' ' ~ k } = n a m e s ( L n M ) ,
t h e n
n III n 2 = (nlIn2)\a i .... \ a k
m a y b e d e s c r i b e d as follc~s:
I d e n t i f y t h e e v e n t l a b e l l e d ~ i (resp ~ i ) i n n I w i t h t h e
e v e n t l a b e l l e d a i (resp e i ) i n n 2 , f o r e a c h i , a n d
t h e n d r o p t h e l a b e l s a l'""" '~k a n d t h e i r ccr~plements.
[Note: T h i s n e e d s m o r e c a r e f u l p h r a s i n g i f w e a l l o w t h a t n I m a y n o t h a v e
a l - e v e n t e v e n t h o u g h ~ e L . A l s o , i n g e n e r a l w e m u s t t a k e c a r e o f t h e
p o s s i b i l i t y t h a t n I - f o r e x a m p l e - m a y h a v e t w o o r m o r e l-events.
38
However, if we start with nets n of sort L having exactly one event
labelled l e L , and confine the use of c ~ p o s i t i o n to pairs n : L , n : M
1 2
for which L and M are disjoint, then all nets built with [S] and II
will have exactly one event for each label in their sort].
To illustrate with cyclers, we have, for c i = c[~i/~,Si/B,yi/7,?i+i/~]:___
Yi ~ ~ ?i+1
and for c I I Ic2 :
Y1
~3
2
Finally w e give the diagram for a scheduler of size 5 cn which
you can play the token game:
39
~ 4
~ 4
~ 3
~ 3
a2
The Petri Net for the scheduler
40
~ o t i c e t h e s l i g h t cheat: c I h a s b e e n g i v e n a d i f f e r e n t i n i t i a l m a r k i n g .
T h i s w o u l d n o t h a v e b e e n n e e d e d if w e h a d i n c l u d e d a p a r t o f t h e n e t f o r
o u r s t a r t button, a n d i n b u i l d i n g t h e n e t w e w o u l d t h e n f i n d t h e n e e d f o r
m o r e t h a n o n e e v e n t l a b e l l e d 71 - w h i c h c o r r e s p o n d s t o t h e s h a r e d p o r t
o f c in t h e p i c t u r e o f Sch, 3.1.
T h e r e is a g r o w i n g b o d y o f t e c h n i q u e s f o r a n a l y s i s o f P e t r i Nets.
F o r e x a n p l e , t h e b e h a v i o u r o f ~ n / k e d G r a F h s i s w e l l la%derstcod [Coil];
a m a r k e d g r a p h is a P e t r i n e t i n w h i c h e a c h p l a c e h a s i n d e g r e e a n d o u t d e g r e e
e q u a l t o I, a n d o u r s c h e d u l e r is i n d e e d a m a r k e d graph. F u r t h e r , m u c h
c a n b e d i s c o v e r e d o f t h e b e h a v i o u r o f a r b i t r a r y n e t s u s i n g t e c h n i q u e s f r c m
L i n e a r A l g e b r a d u e t o K u r t L a u t e n b a c h ( f ~ 9 , Bonn) t o d i s c o v e r I n v a r i a n t s
(properties w h i c h h o l d s f o r a l l a c c e s s i b l e m a r k i n g s , o r t o k e n d i s t r i b u t i o n s ) .
K u r t J e n s e n h a s p o i n t e d o u t t h a t t h e s e t e c h n i q u e s a r e s t r o n g e n o u g h t o t e l l
u s t h a t o u r s c h e d u l e r n e t i n d e e d s a t i s f i e s t h e t w o c o n s t r a i n t s specified.
N e v e r t h e l e s s w e s h a l l t a c k l e t h e p r o o f o f c o r r e c t n e s s o f t h e s c h e d u l e r
b y o u r o w n m e t h o d s , s i n c e w e s h a l l s e e l a t e r t h a t t h e y a p p l y a l s o t o s y s t e m s
w h i c h a r e n o t so r e a d i l y r e p r e s e n t e d as P e t r i N e t s ( e . g . S y s t e m s w h o s e
c c ~ m u n i c a t i o n s t r u c t u r e d o e s n o t r e m a i n fixed).
3.3 O b s e r v a t i o n e q u i v a l e n c e
I t is n o w t i m e t o b e ~ l e t e l y p r e c i s e a b o u t t h e f o r m o f e q u i v a l e n c e
o f agents t h a t ~ w i s h t o adopt. T h e d i s c u s s i o n i n C h a p t e r 1 w a s ~ p r e c i s e ,
d e l i b e r a t e l y so; b u t n o w t h a t w e h a v e a c a s e s t u d y in h a n d w h e r e c o r r e c t n e s s
o f a n a g e n t h a s b e e n e x p r e s s e d as e q u i v a l e n c e b e t w e e n t h e a g e n t a n d its
specification, w e h a v e e n o u g h m o t i v a t i o n t o s t u d y e q u i v a l e n c e seriously.
W e m a y f o r g e t o u r a l g e b r a t e m p o r a r i l y , a n d i m a g i n e s i m p l y t h a t w e
h a v e a s e t P o f a g e n t s (or behaviours) t o g e t h e r w i t h a f a m i l y
{ ~--~ ; ~ A u {z} } o f b i n a r y r e l a t i o n s o v e r P . A is o u r l a b e l set, b u t
w e c a n a l s o f o r g e t t e m p o r a r i l y t h a t A = A U ~ . W e s h a l l c o n s i s t e n t l y u s e X
41
t o r a n g e o v e r A , a n d ~,v t o r a n g e o v e r A u { T } .
P I_~ p, m e a n s "p a d m i t s a k - e x p e r i m e n t , a n d c a n
t r a n s f o r m i n t o p' as a r e s u l t "
p - ~ p' m e a n s "p c a n t r a n s f o r m t o p' u n o b s e r v e d "
S p ! o
W e s h a l l w r i t e p---> , f o r s = ~i" "~n (A u { T } ) * , t o m e a n t h a t
f o r s c m e P o .... 'Pn (n _> O)
~ ~2 ~n = p,
P = P0 - - ~ P l ---~ P 2 . . . . . > P n "
N o w c o n s i d e r t h e result(s) o f p e r f o r m i n g a s e q u e n c e ~ l , . . . , I n o f atcmzic
e x p e r i m e n t s o n p (n ~ 0 ) . T h e r e s u l t m a y b e a n y p' f o r w h i c h
k 0 k i k n
P lIT 12...I T
n > (k i > O) ;
...... p'
t h a t is, a n a r b i t r a r y n u m b e r o f s i l e n t m o v e s m a y o c c u r b e f o r e , a m o n g a n d
a f t e r t h e I . .
1
s
D e f i n i t i o n f o r s ~ A* , d e f i n e t h e r e l a t i o n ~ by: if s = I I " " % n ' t h e n
P s___>p, i f f f o r s c ~ e k 0 ..... k n _ > O
T k 0 1 s T k 1 1 2 . . i n ~ k n
p > p '
s p ,
W e m a y t a l k o f a n s - e x p e r i m e n t (se h*), a n d t h e n p ~ m e a n s
" p a d m i t s a n s-experLme/~t a n d c a n t r a n s f o r m t o p' as a r e s u l t " ; w e m a y
a l s o s a y m o r e b r i e f l y " p can p r o d u c e p' u n d e r s ".
N o t e t h a t f o r t h e e m p t y s e q u e n c e E A * , a n e - e x p e r i m e n t c c n s i s t s o f
lettJ_ng t h e a g e n t p r o c e e d s i l e n t l y as i t w i s h e s , w h i l e o b s e r v i n g n o t h i n g ;
f o r ~.~ h a v e
k
p ~ p' i f f f o r s c m e k > - O p ,,,~, ~ p' .
N o t e a l s o t h e s p e c i a l c a s e p ~ p w h e n k = 0 .
N o w w e c a n s t a t e i n w o r d s w h a t w e s h a l l m e a n b y e q u i v a l e n t agents.
p a n d q a r e e q u i v a l e n t i f f f o r e v e r y s e A *
(i) F o r e v e r y r e s u l t p' o f a n s - e x p e r i m e n t o n p , t h e r e
is a n e q u i v a l e n t r e s u l t q' o f a s - e x p e r i m e n t o n q .
(ii) F o r e v e r y r e s u l t q' o f a n s - e x p e r i m e n t o n q , t h e r e is a n
e q u i v a l e n t r e s u l t p' of a s - e x p e r i m e n t o n p .
42
q h i s a p p e a r s t o b e a c i r c u l a r d e f i n i t i o n (the f o r m a l d e f i n i t i o n w i l l
t a k e c a r e o f t h i s point) b u t n o t e f i r s t t h a t i t i m p l i e s that, for
e a c h s ,
p a d m i t s a n s - e x p e r i m e n t i f f q does.
B u t i t implies m u c h more; f o r example, t h e t w o S T ' s
a d m i t e x a c t l y t h e s a m e s - e x p e r ~ t s , b u t n e i t h e r o f t h e t w o p o s s i b l e
r e s u l t s o f an s - e x p e r i m e n t o n t h e f i r s t t r e e is e q u i v a l e n t t o t h e r e s u l t
o f a n s - e x p e r i m e n t o n the seccnd.
T h e m o t i v a t i o n f o r o u r d e f i n i t i o n is this: w e i m a g i n e s w i t c h i n g p
on, p e r f o m T / n g an e x p e r ~ t , a n d s w i t c h i n g i t o f f again. F o r q t o b e
equivalent, it m u s t b e p o s s i b l e t o s w i t c h q on, d o t h e s a n e e x p e r ~ t ,
a n d s w i t c h i t o f f i n a s t a t e e q u i v a l e n t t o t h e s t a t e i n w h i c h p w a s
s w i t c h e d o f f (and t h e same, i n t e r c h a n g i n g p a n d q ).
O u r f o m n a l d e f i n i t i o n is i n terms o f a d e c r e a s i n g s e q u e n c e
~0' ~ i . . . . . = k . . . . o f (finer a n d finer) e q u i v a l e n c e relations:
D e f i n i t i o n (Observation equivalence) P ~0 q is always true;
P ~ k + i q
i f f V S e A*
S p , s q , p , q ,
( i ) i f p => t h e n f o r s c m e q', q ~ a n d ~ k ;
s q,
(ii) if q ~ t h e n f o r same p', p ~ p' a n d P' ~ k q' ;
p m q i f f V k - > O . P ~ k q ( i . e . ~ = ~ = k )
k
E x e r c i s e 3.3 (a) P r o v e t h a t e a c h ~ k is a n e q u i v a l e n c e relation, b y
i n d u c t i o n o n k . (b) P r o v e b y i n d u c t i o n t h a t ~ k + l c_ ~ k ' i.e.
t h a t p ~ k + l q inilies p ~ q "
43
T h i s e q u i v a l e n c e r e l a t i o n h a s m a n y i n t e r e s t i n g p r o p e r t i e s , w h i c h
w e n e e d n o t e x m n i n e u n t i l C h a p t e r 7 - e x c e p t o n e o r two.
First, i t is n o t n e c e s s a r i l y t r u e t h a t ~ i t s e l f s a t i s f i e s t h e
r e c u r r e n c e r e l a t i o n d e f i n i n g ~ k + l i n t e r m s o f ~ k ' t h a t is, t h e p r o p e r t y
p ~ q iff V s e A* (*)
s p~
(i) if p = > t h e n 3 q ' . q S > q , & p , ~ q ,
~ > q, s > p, p,
(ii) i f q t h e n 3 p ' . p & ~ q '
(which is a formal v e r s i o n O f o u r v e r b a l r e c u r s i v e d e f i n i t i o n o f e q u i v a l e n c e
g i v e n e a r l i e r i n t h i s section). I t i s t r u e if p a n d q a r e f i n i t e STs,
b u t n o t in general. H o w e v e r , o u r d e f i n i t i o n h a s n i o e r p r o p e r t i e s t h a n
o n e w h i c h s a t i s f i e s (*).
F o r STs, o u r b i n a r y r e l a t i o n s )'> a n d T . a r e obvious;
t _ ~ I t' (resp. t T > t') i f f t h a s a b r a n c h It' (resp. T t ' ) . I n t h i s
c a s e w e s h a l l call t' a l-son ( r e s p . - s o n ) o f t .
~ c i s e 3.4 P r o v e t h a t t ~ T t f o r STs. (You n e e d a s i m p l e veiny
~[ i n d u c t i v e p r o o f t h a t t ~ k ~Z t).
L e t u s c o n s i d e r o n e e x a n p l e o f e q u i v a l e n t STs:
t
T o c h e c k e q u i v a l e n c e , i.e. t ~ u f o r a l l k , w e m u s t p r o v e t h e i n d u c t i v e
step: t ~ u i m p l i e s t ~ k + l U . N o w f o r e v e r y s ~ c, t a n d u p r o d u c e
i d e n t i c a l t r e e s u n d e r s ; ~ l d e r e , t p r o d u c e s o n l y t a n d u c n l y u ,
a n d t ~ k u b y induction.
44
D e f i n i t i o n I f P s p, (o e A*) t h e n p' is a n s - d e r i v a t i v e o f p.
(Note t h a t
r e p h r a s e t h e d e f i n i t i o n o f Z k + l in t e ~ o f
" P ~k+l q iff, f o r a l l s ( A * ,
p a n d q h a v e t h e s a m e
u p t o ~ k equivalence. "
p is always a n s - d e r i v a t i v e o f itself). W e c a n t h u s
~ k :
s - d e r i v a t i v e s
E x e r c i s e 3.5 R e - e x a m i n e E x e r c i s e 1.4, a n d v e r i f y p r e c i s e l y w h i c h p a i r s a r e
o b s e r v a t i o n equivalent. Y o u s h o u l d f i n d e x a c t l y f o u r pairs.
E x e r c i s e 3.6 (Deadlock) P r o v e t h a t if p ~ q t h e n t h e f o l l o w i n g s t a t e m e n t
is t r u e o f b o t h o r o f neither, f o r g i v e n 11,. .. ,ln,ln+ 1 :
"It is p o s s i b l e t o d o a 11 . .. I n e x p e r i m e n t a n d
r e a c h a s t a t e w h e r e a k n + i - e x p e r i m e n t is i m p o s s i b l e "
O n e p r o p e r t y o f agents is n o t r e s p e c t e d b y o u r equivalence. It is
p o s s i b l e f o r p a n d q t o b e e q u i v a l e n t e v e n t h o u g h p p o s s e s s e s a n
i n f i n i t e s i l e n t cc~mputation
P J-~ Pl - ~ P2 - ~ . . . . P k ~ P k + l ~-~ "'"
{diver~enoe) w h i l e q c a n n o t d i v e r g e in t h i s way. T h e e q u i v a l e n c e c a n
b e r e f i n e d t o e x c l u d e t h i s p o s s i b i l i t y . S e e t h e r e m a r k s i n 7.3.
3.4 P r o v i n g t h e s c h e d u l e r
I t is ~ s o m e t o u s e t h e d i r e c t d e f i n i t i o n o f ~ ; w e s h a l l i n s t e a d
u s e a f e w o f i t s k e y p r o p e r t i e s , ~ h i c h a r e d e r i v e d f o m a a l l y i n C h a p t e r 7.
W e b e g i n b y l i s t i n g them, s o t h a t C h a p t e r 7 n e e d n o t b e r e a d first.
(~ 1 ) t ~ Tt (see E x e r c i s e 3.4)
N o W w e c a n s e e t h a t ~ is n o t a c c n g r u e n c e relation; t h a t is, r e p l a c i n g
t b y t' (when t ~ t ') in u t o g e t u' does n o t e n s u r e u ~ u ' . F o r
exanlole , N I L ~ T N I L , b u t ~ N I L + N I L ~ ~ N I L + T N I L
4 5
I Exe_r_cise 3 . 7 V e r i f y t h i s f a c t .
S o i n g e n e r a l t ~ t' d o e s n o t i m p l y
o t h e r o p e r a t i o n s d o p r e s e r v e =
t + u ~ t' + u .
(~ 2) t ~ t' i m p l i e s ~ ) p t ~ ut' (.see b e l o w f o r
t l u ~ t ' l u a n d u l t ~ u ' I t
t \ ~ ~ t ' \ ~
t [ S ] = t ' [ S ]
B u t a l l o u r
F o r t u n a t e l y , t o o , w h e n w e a p p l y a g u a r d p t o e q u i v a l e n t S T s t,t' w e
g e t n o t c n l y p t ~ t ' , b u t u t ~ pt' , w h e r e ~ i s a s t r Q n g e r r e l a t i o n t h a n
w h i c h i s p r e s e r v e d b y a l l o u r o p e r a t i c n s .
(~ 3) ~ i s a oongrue.nce r e l a t i c n , a n d
t c t' i n p l i e s t ~ t'
B e y o n d t h e s e , w e n e e d o n e m o r e p r o p e r t y ~ i c h m a y l o o k a l i t t l e s u r p r i s i n g ;
w e l e a v e i t s d i s c u s s i o n t o C h a p t e r 7 .
(~ 4) t + T t c T t
A p a r t f r a n t h i s , t h e p r o o f b e l o w w i l l u s e o n l y r a t h e r n a t u r a l p r o p e r t i e s o f
o u r o p e r a t i o n s , i n c l u d i n g t h e E x p a n s i o n ~ h e o r e m , a l l j u s t i f i e d b y Q h a p t e r 5.
~ t r e a t o n l y t h e f i r s t c o n s t r a i n t , n a m e l y
I I B n ) ~ - . . ~ n )~ (I) S ~ h [ I ( ~ i " ' " '~ ( % "
De f i n e t h e l e f t hand s i d e t o be Sch' . We s h a l l a c t u a l l y show t h a t Sch'
s a t i s f i e s t h e d e f i n i n g e q u a t i o n o f (~i o . . ~ n )~ , n a m e l y
S c h ' ~ ~ l " " ~ n S c h ' . (2)
f r c ~ w h i c h (i) f o l l o w s , b y g e n e r a l p r i n c i p l e s w h i c h w e s h a l l n o t t r e a t h e r e
(but s e e E x e r c i s e 7.7).
W e m a y w r i t e Sch' a s
SCh' = (s f e l l ... I C'n ) \ 7 1 " ' ' \ Y n (3)
( u s i n g g e n e r a l p r o p e r t i e s o f I a n d \ e ), w h e r e
C'l = (ci I B~m)\~il (4)
r e p r e s e n t s t h e i t h c y c l e r w i t h ~ i p e ~ n i t t e d . N o w w e s h a l l d i s c o v e r
46
b e l o w t h a t
w C - - - -
c , ' ( 5 )
Ci Yi~iYi+l l
s o ~ c a n u s e t h e s e e x p r e s s i c n s i n t e r c h a n g a b l y , b y (~ 3), t o a s s i s t o u r
e x p a n s i o n o f Sch', w h i c h r u n s as follows:
s c h l c ( ? : [ N I L I Y I ~ I ? 2 c ; I . . . . t ~ n % ? l C n , ) \ 1 . . . \ n
C - - - -
(the s t a r t b u t t c n h a s worked)
c ~ h ~ 2 " . ~ n < N ~ L i c ~ i c ~ I IT c l ) \ h " \ ~ n
(leaving c' t o b e reenabled)
1
. . . . . ! ! Q .
C ~ : ~ 1 T c ~ 2 . . . . T~nT (NIL i slY2CliC2 [. i c ~ ) \ y l , . X Y n
= ~1~2 . . . % Sch' as required, b y (~ 1) a n d (~ 2).
L e t us n o w s h o w (5) , f o r i = 1 say.
c ~ = ( Y 1 c ~ 1 ( 6 1 Y 2 c I + Y 2 8 1 C l ) I B 1 ~ ) \ 6 1
= h h ( ~ 2 c ~ + i 2 c~) b y ~ s i o n .
B u t
I c - , b y (= I) a n d (~ 2), s o
Y2 T c I ~ Y2Cl
~ 7 2 c , + i 2 ci' c ~ 7 2 c ~ + -y2ci, ~ (_- 3)
C ~ 7 2 C ~ b y ( = 4),
a n d b y s u b s t i t u t i n g in t h e e x p a n s i o n o f c~
I C - - - -
' as required.
c I Y l ~ l Y 2 C l
w e g e t b y (~ i), (~ 2)
W e l e a v e t h e v e r i f i c a t i o n o f t h e s e c o n d c o n s t r a i n t o n t h e s c h e d u l e r as a n
e x e r c i s e i n C h a p t e r 8. It is n o t hard, b u t u s e s a s l i g h t l y m o r e g e n e r a l
p r o p e r t y t h a n (-- 4).
C H A P T E R 4
C a s e s t u d i e s i n v a l u e - c c m m m / c a t i o n
4.1 R e v i e w
S o far, w e h a v e s e e n h o w b e b a v i o u r s (STs) m a y b e b u i l t u s i n g s i x
k i n d s o f operation, t o g e t h e r w i t h t h e a l l - i n p o r t a n t u s e o f recursion.
T h e o p e r a t i o n s f a l l i n t o t w o classes:
(i) D y n a m i c o p e r a t i o n s (Chapter i)
I n a c t i o n N I L
S u ~ n a t i o n +
Axztion ~ c A u {T}
T h e d y n a m i c q p e r a t i o n s b u i l d n o n d e t e r m i n i s t i c s e q u e n t i a l b e h a v i o u r s .
(2) S t a t i c o p e r a t i o n s (Chapter 2)
Cc~mposition I
R e s t r i c t i o n \~ (~ ~ A)
R e l a b e l l i n g IS]
T h e s t a t i c o p e r a t i o n s e s t a b l i s h a f i x e d l i n k a g e s t r u c t u r e a m o n g
c o n c u r r e n t l y a c t i v e b e h a v i o u r s .
T h e e x a m p l e s g i ~ _ n w e r e s t a t i c c o m b i n a t i o n s o f s e q u e n t i a l b e h a v i o u r s ,
y i e l d i n g s y s t e m s w i t h f i x e d l i n k a g e structure. B u t d y n a m i c a l l y - e v o l v i n g
s t r u c t u r e s c a n b e g a i n e d b y d e f i n i n g r e c u r s i v e b e h a v i o u r s i n v o l v i n g
composition. T h e p o s s i b i l i t i e s a r e q u i t e rich; w e g i v e a n example, n o t
f o r i t s u s e f u l n e s s (whid~ i s doubtful) b u t t o i l l u s t r a t e t h e p o w e r o f OCS.
First, l e t u s d e f i n e a n o p e r a t i o n ~ahich h a s w i d e application. I f
x : L, y : M a n d L n M = ~, w i t h ~ e L a n d ~ E M , t h e cJlainimz 7 o p e r a t i o n
*-~ is g i v e n b y
x " ~ y = (x[~/B] I y [ 6 / ~ ] ) \ 6
w h e r e ~ { ~ ( L u M ) . I n pictures:
(See 8.3 f o r a p r o o f t h a t f-~ is a s s o c i a t i v e ; t h i s e v e n h o l d s if L n M ~ . )
48
N o w c o n s i d e r i n p a r t i c u l a r p:{~,8,y} a n d q:{~} g i v e n b y
p = a ~ y ( P ~ P ) , q = ~ q
a n d c o n s i d e r t h e f o l l o w i n g derivation:
2
~_~_> pf-~ p, " , p , ~ p-~, q
4
c~y > p..-., p,--, p r ~ p , ~ p,"~ p,"~ p r , p~-, q
.etc .....
A f t e r n u's, 2 n - I 7 ' s (and n o more) c a n h a v e occurred.
E x e r c i s e 4 . 1 (For fun). D e s c r i b e t h e b e h a v i o u r o f p ~ q a b i t m o r e
p r e c i s e l y - e.g. h o w m a n y y ' s m u s t h a v e o c c u r r e d a f t e r n ~ ' s ?
E x e r c i s e 4.2 B u i l d a c o u n t e r o f s o r t {i ,6 ,~}
w h i c h (i) C a n a l w a y s b e i n c r e m e n t e d b y a n 1-experJ/nent;
(ii) C a n b e d e c r e m e n t e d b y a f - e x p e r i m e n t if non-zero;
(iii) C a n a d m i t a ~ - e x p e r i m e n t o n l y w h e n i t is zero.
Hint: i n s t a t e n, i t w i l l b e s G m e t h i n g like a c h a i n o f
a b o u t n cells. I n c r e m e n t i n g m u s t i n c r e a s e t h e c e l l - c o u n t
b y one; d ~ t i n g m u s t d e c r e a s e t h e c e l l - c o u n t b y o n e b y
c a u s i n g o n e c e l l t o d i e - i.e. b e c a m e NIL. Y o u m y n e e d a
d o u b l y l i n k e d dnain, b u i l t b y a s u i t a b l y g e n e r a l i s e d c h a i n i n g
operator, a n d l o o k i n g l i k e
"0: 0:
B u t o u r c a l c u l u s s o f a r h a s a n irmportant r e s t r i c t i o n w h i c h m a k e s
i t i n a d e q u a t e f o r p r o g r a m m i n g ; a l l ccm,I~mication is p u r e s y n d q r o n i z a t i o n ,
a n d n o d a t a - v a l u e s a r e p a s s e d f r a m o n e a g e n t t o a n o t h e r . T r u e , w e c o u l d
i n p r i n c i p l e ' r e a d ' t h e c o n t e n t s o f t h e c o u n t e r o f E x e r c i s e 4 . 2 by. s e e i n g
h o w m a n y d e c r e m e n t s (6) a r e n e e d e d b e f o r e a ~ (test f o r zero) is o f f e r r e d .
T n i s w o u l d b e ~ c m e , t o s a y t h e least, a n d f o r t h e c o u n t e r as s p e c i f i e d
i t w o u l d d e s t r o y t h e c o u n t s t o r e d i n it:
49
So w e n o w proceed to a generalisation of the algebra. In doing
so w e are forced to abandon our ST interpretation. W h a t takes its
place m u s t w a i t till Chapters 5 a n d 6; meanwhile the reader m u s t
realise that - for example - the equality symbol between o u r m o r e
general behaviour expressions is n o t explained in this chapter.
4.2 Pass in~ values
Consider the simple behaviour
% _
P = ~ 8 ~ p S ~ p ~ 8
It's no more than the cycler of Exercise 2.7, ?
b u t if w e think of positive labels (e,8) as accepting input pulses,
and negative labels (~) as giving output pulses, then p beccmes
a behaviour w h i c h "gi~_s an output whenever it has received two inputs"
(the inputs being demanded in a particular order).
Suppose that an input at ~ consists of m o r e than a pulse; it is
a value (an integer, say). qhat is, attempting an a-experiment o n p
consists of offerrin9 a v a l u e to p at s . W e m a y then wish to represent
p ' s behaviour as
p = e x . - - -
where x is a variable (supposed to become bound to the value received
in an s-experiment), and - - - is sc~e behaviour expression _dependent
upon x , i.e. containing x as a free variable. W e say that the variable
x is bound b y a, a n d its sco~e is - - - .
(This is very f~niliar to anyone who knows the l-calculus; the difference
here is that any positive label e m a y b i n d a variable, w h i l e in the
l-calculus there is only one binder - the symbol "I".)
W e can go further, in our aim to transfo~n p into a behaviour whose
output values depend o n its input values, and w r i t e
p = ~x.Sy. - - -
Here 8 binds the variable y . Note that the scope of x is B y . - - - ,
w h i l e the scope o f y is just - - - . (It w o u l d b e stupid to w r i t e a x . S x . - - -
since then any occurence o f x in - - - w o u l d refer to the value bound b y
to x ; the value bound b y a to x is inaccessible.)
50
S u p p o s e w e w a n t t h e s ~ n o f x a n d y t o b e o u t p u t a t ~ .
T h a t is, i n g e n e r a l f o r n e g a t i v e labels, a t t e s p t i n g a ~-experi1nemt
o n p c c ~ s i s t s o f ~ d i n ~ a v a l u e f r a m p a t ~ . T h u s n e g a t i v e
labels d o n o t b i n d v a r i a b l e s - i n s t e a d t h e y q u a l i f y v a l u e e x p r e s s i o n s
(which m a y c o n t a i n v a r i a b l e s ) . S O w e w r i t e
p = ~x. 8y.~ (x+y) .p
i t is n o w p r o p e r t o t a l k o f a n " ~ v - e x p e r i m e n t " r a t h e r t h a n a n
" ~ - e x p ~ _ r ~ t " , w h e r e v is t h e v a l u e s u b m i t t e d b y t h e c ~ s e r v e r , a n d
s i m i l a r l y o f a "~ v - e x p e r i m e n t " w h e r e v is t h e v a l u e r e c e i v e d b y t h e
l
observer. So, g e n e r a l i s i n g t h e r e l a t i o n - - ~ o f 3.3, w e s a y
X_~V p, ,,p I v - e x p e r ~ t , a n d c a n
p m e a n s a d m i t s a
t r a n s f o z m t o p' as result".
(Note t h e d i f f e r e n t sense, a c c o r d i n g t o t h e s i g n o f I .)
A s a g e n e r a l r u l e then, w e c a n s t a t e
~ x . B e V ~ B{v/x}
w h e r e v is a n y value, B i s a b e h a v i o u r e x p r e s s i o n , a n d
t h e r e s u l t o f r e p l a c i n g a l l u n b o u n d o c c u r r e n c e s o f x i n
A n d s i m i l a r l y (more sin!sly)
~ v . B ~ V ; B
f o r t h e 2 a r t i c u l a r v a l u e v o
o n p :
p = ~ x . B y . ~ (x+y) .p
~ 3 ~ By.~(3+y) .p
84
~ (3+4) .p
~ 7 ~ p
B { v / x } m e a n s
B b y v.
S o t h e f o l l o w i n g d e r i v a t i o n is p o s s i b l e
(See 4.4 f o r m o r e a b o u t derivations.)
N o w w e h a v e h a r d l y a n y t h i n g m o r e t o a d d t o o u r l a n g u a g e b e f o r e f i n d i n g
t h a t i t c a n b e u s e d c o n v e n i e n t l y f o r p r o g r a n m i n g . A s f o r its i n t e r -
p r e t a t i o n , w e c a n i n t r o d u c e a g e n e r a l i s e d f o n a o f S T w h i c h w e c a l l
Cxa~,t~nication T r e e s (C~), b u t f o r t h e p r e s e n t w e w i s h t o r e l y o n i n t u i t i v e
u n d e r s t a n d i n g .
51
W e s h a l l u s u a l l y b e h a n d i n g e x p r e s s i o n s o f t h e f o ~ m
[ ~ i x i . B i + [ ~ j E j . B i + [ T . B ~
i j k
! I t
w h e r e Bi,Bj, ~ a r e b e h a v i o u r expressions, t h e x i a r e v a r i a b l e s ,
a n d t h e E a r e v a l u e expressions. A s f o r e x p r e s s i o n s i n v o l v i n g
3
c c ~ p o s i t i o n (I) a n d t h e o t h e r o p e r a t i o n s , i t w i l l b e e n o u g h t o l o o k
a t a s i m p l e e x a m p l e a n d t h e n g i v e a g e n e r a l i s e d E x p a n s i o n T h e o r e m (2.5).
C o n s i d e r
B = (~x.B I + BY.B2) i ~ v . B 3
W e e x p e c t a s ~ n o f 4 temas, o n e i n v o l v i n g ~ :
B = ~ x . ( B I I ~ v . B 3) + 8 y . ( H 2 1 ~ v . B 3)
+ ~ v . ( ( e x . B 1 + S y . B 2) I B 3) + Y - ( H I { v / x } I H 3)
N o t e t h a t t h e "label" d o e s n o t b i n d a v a r i a b l e o r q u a l i f y a v a l u e
e x p r e s s i o n . W e s h a l l a l s o reselcve t h e r i g h t t o u s e o t h e r l a b e l s i n
this s i m p l e w a y w h e n t h e y o n l y r e p r e s e n t synchronization. I n f a c t w e
s h a l l a l l o w a p o s i t i v e l a b e l t o b i n d a t u p l e x = X l , . . . , x n o f (distinct)
variables, a n d a n e g a t i v e label, t o q u a l i f y a t u p l e E = El,... ,E n o f
v a l u e expressions; t h e n f o r p u r e s y n c h r o n i z a t i o n w e j u s t u s e O - t u p l e s .
W e s h a l l u s e t h e t e r m g u a r d to ccr~prise t h e p r e f i x e s ~ , 6 ~ a n d T,
a n d u s e g t o s t a n d for a guard. D i j k s t r a [Dij] i n v e n t e d t h e n o t i o n
o f guard, t o s t a n d f o r s a m e c o n d i t i o n t o b e m e t b e f o r e t h e e x e c u t i o n o f
a p r o g r a m part. I t is n a t u r a l to a d a p t it t o t h e c a s e w h e r e t h e c o n d i t i o n
is t h e a c c e p t a n c e o f a n o f f e r r e d c ~ L u n i c a t i o n , as H o a r e [ H o a 3] h a s
a l s o d o n e i n h i s CSP. W e t h e n f i n d t h a t t h e a n a l o g u e o f D i j k s t r a ' s
g u a r d e d c c n ~ a n d s i s p r o v i d e d b y st~mation; w e r e f e r t o a n e x p r e s s i o n
Egk. ~ as a s u m o f 9~ards, a n d c a l l e a c h g k ' ~ a s ~ n a n d o f t h e
e x p r e s s i o n . W e d e n o t e t h e n a n ~ o f g ' s label b y name(g).
E x p a n s i o n T h e o r e m (stated a n d p r o v e d as T h e o r e m 5.8).
L e t B = (Bll...IBm) k A , w h e r e e a c h B i is a s ~ n o f guards. T h e n
B = [{g.((BIO...IBII...IBm)\A) ; g . B l a s u m m a n d o f Bi, name(g)% A }
+ ~ { T . ( ( B I I . . . I B ~ { ~ / ~ } I . . . I B ~ I . . . I B m ) A); ~.B'.l a simTnand o f
i ~ j }
Hi, e E . B 3 a s u m m a n d o f B 3 ,
p r o v i d e d that, i n t h e f i r s t tena, n o f r e e v a r i a b l e i n B k ( k ~ i) is b o u n d
b y g .
52
T h e m e a n i n g o f t h e T h e o r e m is t h a t a l l u n r e s t r i c t e d a c t i o n s a n d a l l
i n t e r n a l c~,~Lunications i n B m a y occur.
N o t e t h a t o u r l a n g u a g e c o n t a i n s t w o d i s t i n c t k i n d s o f e x p r e s s i o n -
v a l u e e x p r e s s i o n s a n d b e h a v i o u r e x p r e s s i o n s . C o n s i d e r ~ E . B ; E is
t h e f i r s t kind, B t h e second. W e a l l o w t h e f o l l o w i n g s i m p l e b u t
i m p o r t a n t c o n s t r u c t s i n o u r language:
(i) C o n d i t i o n a l b e h a v i o u r e x p r e s s i o n s .
i f E t h e n B 1 e l s e B 2
w h e r e E is b o o l e a n - v a l u e d . C o n s i d e r f o r e x a m p l e
e x . ( i f x - > O t h e n ~ x . B e l s e {x.B)
(ii) P a r a n e t e r i s e d b e h a v i o u r d e f i n i t i o n s . F o r example:
a(y) = a x . ( i f x - > y t h e n ~ x . a ( y ) e l s e { x a(y))
(iii) L o c a l v a r i a b l e d e c l a r a t i o n s . W e s h a l l a l l o w c o n s t r u c t s l i k e
l e t x = 6 a n d y = l O i n B
a n d
B w h e r e x = 6 a n d y = i 0 .
T h e y m e a n e x a c t l y t h e s a m e - namely, t h e s a m e as s u b s t i t u t i n g
6 f o r x a n d i 0 f o r y t h r o u g h o u t B.
W e h o p e t h a t t h e l a n g u a g e is s i m p l e e n o u g h t o b e u n d e r s t o c ~ intuitively,
w i t h o u t f o n m a l syntax. E x a c t f o ~ a t i o n c o m e s later'
4 . 3 A n e x a m p l e - D a t a F l o w
W e w i l l n o w s h o w h o w t o b u i l d a n d v e r i f y a s i m p l e s y s t e m w h i c h b e a r s
a s t r o n g r e l a t i o n t o t h e D a t a F l o w S c h e m a t a o f D e n n i s e t a l [DFL] o
T h e t a s k i s t o b u i l d a n e t w h i c h w i l l c c m p u t e 2 x f o r a r b i t r a r y n o n - n e g a t i v e
i n t e g e r x , g i v e n c o m p o n e n t s f o r c c ~ p u t i n g m o r e p r i m i t i v e f u n c t i o n s a n d
p r e d i c a t e s , a n d s a m e s t a n d a r d g a t i n g a n d s w i t c h i n g ~ x m l 0 o ~ t s . T h a t is,
w e w a n t a n e t w h o s e b e h a v i o u r is o b s e r v a t i o n e q u i v a l e n t t o
a = i x . o 2 x. a (i)
(We s h a l l o f t e n u s e ~ f o r input, o f o r o u t p u t ) . First, w e d e f i n e s a m e
s t a n d a r d c c m ~ n e n t s .
53
(i) U n a r y f u n c t i c ~ a g e n t
F o r a r b i t r a r y u n a r y f u n c t i o n f , w e d e f i n e t h e a g e n t
D O f = i x . o ( f ( x ) ) . ( D O f) ~ D O f /
0
w e s h a l l o n l y u s e s i n p l e f's ; w e a r e a c t u a l l y t r y i n g t o b u i l d
t h e b e h a ~ o ~
~ b ~ p
w h e r e b e x p (x) 2 x = , as y o u c a n s e e b y oanloaring (I) a n d (2).
(ii) U n a r y p r e d i c a t e a g e n t
F o r a r b i t r a r y u n a r y p r e d i c a t e p , w e d e f i n e
A S K p = ~x. i_~f p(x) t h e n olx. (ASKp) 4
~2x. (ASK p) ol o2
e l s e
N o t e t h a t t h e v a l u e x is p a s s e d u n c h a n g e d o u t o f o n e o f t h e
o u t p u t ports.
(iii) A ~ a t e 4~ I
C ~ T E = ~ x . o x . y . G A T E ~ G ~ /
% ~ e g a t e t r a n s m i t s a v a l u e u n c h a n g e d , b u t n ~ s t
b e r e - ~ e d a t y t o repeat.
T R I G = i x . y . o x . T R I G y ~ T ~ G /
O
L i k e a g a t e , b u t m u s t b e t r i g g e r e d (or t r i g g e r sc~neone
else') a f t e r r e c e i p t a n d b e f o r e t r a n s m i s s i o n .
(v) A s o u r c e
F o r a r b i t r a r y c o n s t a n t v a l u e v , a ~ e n t s o u r c e o f v ' s
i s g i v e n b y
D O v = ~ . o v . ( D O v )
O
W e u s e D O , b e c a u s e t h e u n a r y f u n c t i o n a g e n t is e a s i l y
g e n e r a l i s e d t o n - a r y f u n c t i o n agents, a n d c o n s t a n t s a r e
j u s t o - a z y functions.
(2)
54
(vi) A s i n k
S I N K = Ix.SINK ~ S ' I N K y
F o r d i s c a r d i n g u r ~ a n t e d values.
1
(vii) A s w i t c h t
Y 1 ~ - ~ T I ~ y
S W I T C H = Ix. (YI.OlX.SWITCH + Y2.o2x.SWITCH) 2
o/ 0 2
A g e n e r a l i s a t i o n o f a trigger;
t r i g g e r i n g Yi s e l e c t s o u t p u t p o r t o i "
T h i s is a l l w e n e e d f o r o u r example; it is n o t a c c ~ p l e t e (or n e c e s s a r i l y
best) set, a n d i t w o u l d b e i n t e r e s t i n g t o d e s i g n a g o o d s e t o f c c ~ p o n e n t s
w h i c h c o u l d b e s h o w n a d e q u a t e f o r a w i d e c l a s s o f d a t a - f l o w computations.
W e w o u l d l i k e t o f a c t o r o u r d e s i g n i n t o a c o n t r o l p a r t a n d a
c o n t r o l l e d part. F o r t h e c o n t r o l part, i t w i l l b e c o n v e n i e n t to b u i l d
a n a g e n t o b s e r v a t i o n - e q u i v a l e n t t o
x t i m e s
C O N T R O L = ix:y. .y.'~.CONTROL (3)
i.e. f o r i n p u t x i t w i l l a d m i t x y - e x p e r i m e n t s f o l l o w e d b y a 6-experinent,
a n d r e t u r n t o its o r i g i n a l 'state'. W e s h o w t h e n e t f o r r e a l i s i n g CONTROL;
i t c a n b e s h o w n b y E x p a n s i o n t o s a t i s f y a n e q u a t i o n like (3) w i t h m a n y
i n t e r v e n i n g w's, a n d t h i s is o b s e r v a t i o n e q u i v a l e n t t o C C N T R O L , as w e s h a l l
s e e i n C h a p t e r 7.
55
Y
6
C O N T R O L
!
!
!
b
i
I
# #
I
i
I
!
I
t
I
\ i
\ i
\
: I
t
\
\
\
%
%
#
!
I
I
I
|
|
I
I
I
!
O n e c a n c h e c k f o r t h e r i g h t b ~ h a v i o u r i n f o z m a l l y , b y " a r r o w - s w i n g i n g " .
N o t e t h a t t h e i n i t i a l s t a t e is r e s t o r e d , a n d t h a t i f e i t h e r t r i g g e r is
r e p l a c e d b y a g a t e t h e n 'overtaking' c a n occur, y i e l d i n g t h e w r o n g
b e h a v i o u r .
56
The oontrolled part, or body, is to admit a value v at ~ ' ,
then after n y-experiments follow~d by a ~-experiment it w i l l emit
v at o and restore itself. That is, w e w a n t to realise
BODY = 1'y. b(y) where (4)
b(y) = ~.b(2y) + ~.oy.BODY
I '
BODY ~
i
s
j r
s I
( k " I r r ~
I
!
i
Exercise 4.3 Put this n e t together, as a restricted ~ i t i o n of
relabelled standard components, and show that it satisfies an
equation like (4) (but with intervening T's), using the Expansion
Theorem.
57
Having established the behaviour of BODY and C ~ L , it is a simple
matter to put them together in sud% a way that an input x to the
whole system first gates a i into BODY, then enters C O N S U L itself.
~ e outer pair of gates (present also in BODY and CONTROL) is to
prevent overlappin 9 of successive ccmputations.
I
I I
t
!
|
1
I
t
I
1
I t
! 1
D O bexp
-7
k ~
BODY
%
L
T
! - -
O
!
I
58
Exercise 4.4 T r e a t i n g B O D Y a n d C O N T R O L as g i v e n b y (3) a n d (4)~ p u t
t h e n e t t o g e t h e r as i n t h e l a s t e x e r c i s e , a n d s h o w t h a t i t b e h a v e s
like D O be~xp, b u t w i t h i n t e r v e n i n g T's. S e e (i) a n d (2).
T h e e x a ~ o l e s h o w s h o w n e t s m a y b e b u i l t i n m o d u l e s w h i c h a r e
v e r i f i e d separately. T h e r e a r e t w o remarks:
(i) T h e u s e o f t h e E x p a n s i o n T h e o r e m is tedious, b u t as w e
m e n t i o n e d e a r l i e r i t c a n b e m e c h a n i s e d .
(ii) W e h a v e i m p l i c i t l y assigned t h a t if t w o b e h a v i o u r s a r e
o b s e r v a t i o n equivalent, t h e n r e p l a c i n g o n e b y a n o t h e r i n
a n y s y s t e m c o n t e x t w i l l y i e l d a n o b s e r v a t i o n e q u i v a l e n t
system. (This is w h a t j u s t i f i e d o u r t r e a t m e n t o f B O D Y
a n d C O N T R O L - r e p l a c i n g t h e m b y t h e i r s ~ c i f i e d b e h a v i o u r s ) .
T h i s a s s t m p t i o n is j u s t i f i e d f o r t h e c o n t e x t s w e h a v e
considered, b u t i t is n o t t r i v i a l to p r o v e t h a t t h i s is so.
E x e r c i s e 4 . 5 C o n s t r u c t d a t a f l o w n e t s t o c c ~ p u t e t h e v a l u e o f y
i n p u t v a l u e s x a n d y , f o r e a c h o f t h e f o l l o w i n g prograns:
(i) w h i l e p(x) d o (y:= f(x,y) ; x: = g(x))
(ii) w h i l e p(y) d o (y:= if q(x,y) t h e n f(x,y) e l s e f(y,x) ;
x : = g(x) )
Y o u w i l l a l m o s t o e r t a i n l y n e e d s a m e o t h e r 'standard' agents, a n d a
d i f f e r e n t w a y o f h a n d l i n g p r e d i c a t e s - s i n c e t h e c o n s t r u c t 'ASK q'
d o e s n ' t g e n e r a l i s e v e r y w e l l f o r n o n - u n a r y p r e d i c a t e s .
f r c m
4.4 D e r i v a t i o n s
I n 4.2 w e g a v e a n exarmple o f a d e r i v a t i o n o f p = ~ x . S y . y ( x + y ) . p :
S i m i l a r l y , B = ((~x.B 1 + 8y.B 2) I ~ v o y z - B 3 ) \ S h a s d e r i v a t i o n s
B ~ (B1{5/x} t ~v-~z.B3)\S ;
B ~--> (B2{v/y} I Y z - B 3 ) \ 8 ~ (B2{v/Y} I B 3 { 7 / z } ) \ 8 -
59
A general derivation takes the form
B P l V l ) ~2v2 p v
B I _ _ _ _ ~ B 2 __.>... n n
(which has length n) o r m a y b e infinite.
derivation of length n as
UlVl ~2v2 Pn v
n
we can abbreviate B -J--~B' by B ~ B'
m n
a n d abbreviate B ~ . ~ V . T B' k57 B ~ > B '
(see also 3.3).
B
n
W e shall often ~a~ite a
~ 1 v l . ~ 2 v 2 . . . . . . ~ v
, o r B n n , B
n
(n -> O)
(m,n >_ O).
A cc~01ete derivation is either an infinite derivation, or a finite
derivation w h i c h cannot be extended (this means B = NIL).
n
I
Exercis____~e 4.__66 Using equations (3) and (4) in 4.3, write sc~e of the
derivations o f BODY, ~ L and (BODY I CONTROL)\y\6 . W h a t ccr~piete
derivations are there?
A ccrmplete finite derivation of B represents a possibility that B
can reach a point where no further action is Ix)ssible; it m a y deadlock.
4.5 A n example - Zero s ~ c h i n ~
W e w a n t to set two agents p and q to w o r k together in finding
a root for the equation f(X) = 0 in the range [A,B] , for a continuous
function f , knowing that such a root exists - i.e. f(A) f(B) -<0.
It is natural to make p and q calculate f(A') and f(B') respectively,
and concurrently, for two internal F~ints A' and B'.
If p finishes first, and finds that f(A') differs in sign frcm
he can leave a message for q to cane and help h i m in the n e w interval
[A,A'], a n d begin to w o r k within this interval himself.
f (A) ,
60
I f h e f i n d s f(A') t o h a v e t h e s a n e s i g n a s f(A), t h e n h e
s h o u l d g o t o h e l p q i n t h e i n t e r v a l [A',B3.
+ +
A A' B' :-A" B
H e c o u l d c h o o s e a p o i n t A " i n [A',B'] o r i n [B',B]. K u n g [Kun,
S e c t i o n 3] m a d e t h e e l e g a n t s u g g e s t i o n t h a t t h e p o i n t s A',B' s h o u l d
n o t t r i s e c t [A,B], b u t r a t h e r d i v i d e i t s o t h a t t h e r a t i o s A A ' : A B ,
B ' B : A B a n d A ' B ' : A ' B a r e equal; t h e n i n t h e case a b o v e A m a y p i c k
t h e n e w p o i n t A " s o t h a t t h e n e w i n t e r v a l [A' ,B] is s u b d i v i d e d b y t h e
~ r k i n g p o i n t s i n t h e s a m e r a t i o as [A,B] w a s subdivided.
T h i s d e t e r m i n e s A' ,B' as t h e g o l ~ s e c t i o n s o f A,B;
O2
. ~ + 8 - - 1 ;
A A' B I " B
. . . . . ' ~ 0 = ~ - 1 -~" .618
e2 03~ ~ -
e~
A t any n~ment t h e n , t h e r e a r e t wo p o s s i b i l i t i e s :
(i) p a n d q a r e b o t h ~ r k i n g o n g o l d e n s e c t i o n s o f [A,B];
(ii) O n e o f t h e m is w o r k i n g o n a g o l d e n s e c t i o n point, a n d
t h e o t h e r o n a p o i n t o u t s i d e t h e i n t e r v a l (because t h e
o t h e r a g e n t h a s s h r u n k t h e interval).
T h e o c ~ p u t a t i o n s t o p s w h e n t h e i n t e r v a l h a s b e e n r e d u c e d t o l e s s t h a n
s a m e p r e d e t e x m i n e d v a l u e ' e p s '.
A s K u n g o b s e r v e d , t h e a l g o r i t h m c a n b e i m p l e m e n t e d b y g i v i n g p
a l o c a l v a r i a b l e X (his w o r k i n g p o i n t ) , q a l o c a l v a r i a b l e Y similarly,
a n d r e p r e s e n t i n g t h e i n t e r v a l b y a f e w g l o b a l v a r i a b l e s w h i c h e i t h e r p o r
q m a y i n s p e c t a n d update, u s i n g
T h u s a n o u t l i n e p r o g r a m f o r P ,
p = w h i l e i n t e r v a l >_ e p s d o
~ u ~
s i m i l a r l y f o r q , a n d t h e w h o l e
p I
a c r i t i c a l s e c t i c n f o r t h e p u r p o s e .
u s i n g c o n v e n t i o n a l a n d o b v i o u s n o t a t i o n , is:
cP TIe SECT
f (X) ; u p d a t e g l o b a l s e n d ;
p r o g r a n is
I q o 0 e n d .
61
T. M~idner has given the ac~plete algorithm [Mtil]. I a m grateful to
A. Salwicki for drawing rmy attention to this ~ l e , which is a good
one to illustrate different concurrent programfing disciplines.
Now in a sense p and q are sharing a resource, i.e. the
interval, represented by global variables. Hoare and others have
made the point that code and data associated with shared resources are
better located at xle site, rather than distributed over the sharing
agents; Hoare proposed Monitors as a device to achieve this modularity
[Hoa 23.
Here we propose to represent the interval as a separate agent,
without the need for any extra progranmdng construct for the purpose.
The idea is that p or q submits the result of his evaluation
to the interval agent, which then hands him a new evaluation point.
p, working on X , is represented by
p(X) = ~i (X,f (X)) .e2 x' . p (X') ~p(X)~ ~i
~2
and q , working on Y, by ~I
q(Y) = ~l(Y'f(X) )'82Y''q(Y') B2 ~
Notice that each s u k ~ t s a pair, a r ~ t and function-value, to the
interval.
The interval Int is parameterised on A,B,a,b where initially
(and always later) a = f(A), b = f(B) and a b - < O .
By carefully reversing the direction of the interval when necessary,
Int ensures that at any time
p is working either at [A~B] (left section) o r outside the interval;
q " ' . . . . . r[A,B] (right section) " " " "
The interval agent has sort {~i '~2'81 '82 '~} ' and delivers the root
finally at ~ . It is defined as follows:
62
I n t (A,B,a,b) =
i f I A - B I < e p s t h e n ~ A . N I L e l s e
(~1 (X,x). i_~f X = A ' t h e n
i f x a _ < O
the/~ ~ [ 2 % [ A , A ' ] . I n t (A,A' ,a,x)
e l s e e 2 [ B , A ' ] . I n t ( B , A ' , b , x )
e l s e ~ 2 A ' . I n t (A,B,a,b)
+ 8 1 ( Y ' Y ) " i f Y = B ' t h e n
i f y b _ < O
t h e n ~ 2 r [ B ',B].Int(B' ,B,y,b)
e ! s e ~ 2 r [ B ' , A ] . I n t ( B ' , A , y , a )
e l s e ~2B' . I n t (A,B,a,b)
) w h e r e A ' , B ' = [ A , B ] , r [ A , B ]
: > - . )
g A ' B ' B
, ( p ) ( q )
t
+ _
"
{
j t I i
{ i
+ ~ _ ~
( q ) ( p )
+
( . P) ( [ q )
T h e c c r n p l e t e s y s t e m i s S y s ( A , B , a , b , X , Y ) =
(p(X) I I n t ( A , B , a , b ) { q ( Y ) ) \ ~ l \ ~ 2 \ ~ l \ ~ 2
(The a r r o w s a r e m a r k e d a s s u m i n g t h e c a s e I A - B I -> eps.)
~ a t d o w e w a n t t o p r o v e a b o u t S y s ? S J - ~ p l y t h a t e v e r y p o s s i b l e
d e r i v a t i o n c o m p u t e s a n e a r - r o o t o f f i n [ A , B ] . (By a n e a r - r o o t Z o f f ,
w e m e a n a Z s u c h t h a t [ Z - e p s , Z + e p s ] c o n t a i n s a root.) M o r e p r e c i s e l y ,
w e r e q u i r e
63
if (i) a = f(A), b = f(B), a b < O ,
a n d (ii) X = ~[A,B] o r Y = r[A,B],
t h e n e v e r y c c m p l e t e d e r i v a t i o n o f
Sys(A,B,a,b,X,Y) t a k e s t h e f o r m
S y s (A,B,a,b,X,Y) ~ N I L
w h e r e Z [A,B] is a n e a r - r o o t o f f.
I t ' s c o n v e n i e n t t o p r o v e this b y i n d u c t i o n o n t h e s i z e o f [A,B], d e f i n e d
as t h e l e a s t n s u c h t h a t O n I A - B I < eps. F o r s i z e = 0 w e h a v e
S y s (A,B,a,b,X,Y) .[A> N I L
as t h e o n l y c o m p l e t e d e r i ~ a t i o n ~ a n d w e a r e done. F o r s i z e > O, w e c a n
u s e t h e E x p a n s i o n ~ q e o r e ~ t o s h o w t h e f o l l o w i n g , w h i c h is e n o u c ~ t o cfm_~_lete
t h e proof:
c o n d i t i o n s (i) a n d (ii) , e v e r y c o m p l e t e d e r i v a t i o n o f
Sys(A,B,a,b,X,Y) e x t e n d s a d e r i v a t i o n
T,T
' ~ S y s ( A ' , B ' , a ' , b ' , X ' , Y ' )
w h e r e t h e p a r a m e t e r s a g a i n s a t i s f y (i) a n d (ii), a n d
(a) if X = [A,B] a n d Y = r[A,B] t h e n [A',B'] h a s ~ n a l l e r size;
(b) o t h e r w i s e e i t h e r [A',B'] h a s s m a l l e r s i z e o r [A',B'] = [A,B],
X' = [A,B] a n d Y' = r [ A , B ] .
~
E x e r c i s e 4 . 7 V e r i f y t h e
N o t e t h a t t h e i n t e r v a l
n o t a l w a y s a f t e r one.
a b o v e s t a t e m e n t b y e x p a n d i n g S y s ( A , B , a , b , X , Y ) .
d e c r e a s e s i n s i z e a f t e r ~ c c ~ o u t a t i o n s , t h o u g h
t 4 . 8 I t i s n ' t f o r a n d q I n t t h r o u g h _Exercise n e c e s s a r y
P
I d i s t i n c t ports. R e d e s i g n I n t s o t h a t p o r t s e I , 81 a r e identified,
a n d s i m i l a r l y e2' 8 2 ; it's e a s y b u t n o t c c ~ p l e t e l y trivial.
E ~ e r c i s e 4.9 K u n g r e m a r k s t h a t a r c o t - s e a r d l i ~ a l g o r i t h m f o r t h r e e
c o o p e r a t i n g a g e n t s c a n b e d e s i g n e d s o t h a t t h e i n t e r v a l s u b d i v i s i o n
a d o p t S o n e o f t h e t w o p a t t e r n s
~ / 4 ~./4 ~/ 4 ~ / 4 ~ / 3 ~ / 6 ~/ 6 9./3
. P r o g r a m t h i s algorithm.
64
I Exercis____~e 4.1___OO Suffuse p (q pause that similarly) can during its
evaluation of f (X) at certain times, to ask the interval
"should I continue or start on a new point?" A d j u s t the
i n ~ agent to respond to these interrupts.
C H A P T E R 5
S y n t a x a n d S e m a n t i c s o f C C S
5 . 1 I n t r o d u c t i o n
W e h a v e s e e n s o m e e x a m p l e s o f e x p r e s s i o n s o f OCS, r e p r e s e n t i n g b o t h
p r o g r a m s a n d t h e i r s p e c i f i c a t i o n s . W e s m ~ that, w i t h t h e i n t r o d u c t i o n
o f v a l u e - p a s s i n g , w e h a d t o a b a n d o n t h e s i m p l e i n t e r p r e t a t i o n o f b e h a v i o u r
e x p r e s s i o n s as s y n d q r o n i z a t i c n trees, b u t i n 4.2 w e t a l k e d o f a t a m i c
e ~ p e r i m e n t s o n b e h a v i o u r e x p r e s s i o n s (or o n t h e b e h a v i o u r s f o r w h i c h t h e y
stand), a n d t h i s w a s d e v e l o p e d f u r t h e r i n 4.4 o n d e r i v a t i o n s .
W e a r e n o w reaahy t o p r e s e n t C C S p r e c i s e l y , a n d t o d e f i n e p r e c i s e l y
t h e a t n m i c a c t i o n s (and h e n c e t h e derivaticns) o f e v e r y O C S program. O n
t h i s basis, w e p r o c e e d i n t h i s c h a p t e r a n d i n C h a p t e r 7 t o d e v e l o p o u r
c e n t r a l n o t i o n , o b s e r v a t i o n e q u i v a l e n c e o f p r o g r a m s . F r c m t h i s i t is a
s h o r t s t e p t o a c o n g r u e n c e relation; t w o p r o g r a n s a r e o b s e r v a t i c n c o n g T u e n t
i f f t h e y a r e o b s e r v a t i o n e q u i v a l e n t ( i . e . i n d i s t i n g u i s h a b l e b y observation)
i n e v e r y context. O u r p r o p o s a l is t h a t a n o b s e r v a t i o n c o n g r u e n c e c l a s s i s
a b e h a v i o u r , s o t h a t 0 C S is i n d e e d a n a l g e b r a o f b e h a v i o u r s , i n w h i c h e a c h
p r o g r a n s t a n d s f o r i t s c o n g r u e n c e class.
T h i s m a i n d e v e l o p m e n t is i n d e p e n d e n t o f t h e n o t i o n o f ST. S T s m a y
n o w b e r e g a r d e d as a f i r s t a p p r o x i m a t i o n (not s u f f i c i e n t l y abstract) t o a
m o d e l o f C C S w i t h o u t v a l u e - p a s s i n g , a n d i n C h a p t e r 6 w e s h o w h o w t h e y m a y
b e g e n e r a l i s e d to C T s (cca~m~ication trees) t o g i v e a f i r s t a p p r o x i m a t i o n
t o a m o d e l o f O C S w i t h v a l u e - p a s s i n g ; again, t h e m a i n d e v e l o p m e n t is in-
d e p e n d e n t o f CTs, w h i c h a r e o n l y d i s c u s s e d t o a i d u n d e r s t a n d i n g . ~ h e n w e
e v e n t u a l l y d e f i n e o b s e r v a t i o n e q u i v a l e n c e o v e r p r o g r a n s i n C h a p t e r 7, i t w i l l
l o o k j u s t l i k e t h e c o r r e s p o n d i n g d e f i n i t i o n i n 3.3 o v e r STs, w h i c h g e n e r a l -
ises t o C T s i n a n o b v i o u s w a y . Indeed, w e e x p e c t t o f i n d t h a t t w o p r o g r a m s
a r e e q u i v a l e n t i f f t h e correslxlnding C T s a r e so; i n t h a t c a s e CTs, t h o u g h
n o t t e c h n i c a l l y e s s e n t i a l , f i t n a t u r a l l y i n t o o u r p i c t u r e .
~ h i s c h a p t e r is d e v o t e d t o a o c m g r u e n c e o v e r p r o g r a m s w h i c h w e c a l l
s t r o n ~ c o n g r u e n c e , s i n c e i t is s t r o n g e r t h a n t h e o b s e r v a t i o n o 0 n g r u e n c e
s t u d i e d i n C h a p t e r 7. B y a p p r o a c h i n g o u r p r o p o s a l i n t w o s t a g e s w e i n t r o -
d u c e t h e p r o p e r t i e s o f b e h a v i o u r g r a d u a l l y , a n d w i t h g r e a t e r i n s i g h t t h a n i f
w e t a c k l e d o b s e r v a t i o n c c n g r u e n c e immediately. I n f a c t w e e v e n s u b d i v i d e
t h e f i r s t s t a g e i n t h i s chapter, a p p r o a c h i n g s t r o n g c o n g r u e n c e v i a a n e v e n
66
stronger relation called d i ~ c t equivalence.
The CCS language was introduced in the author's "Synthesis of
C ~ , ~ n i c a t i n g Behaviour" [Mil 3]. However, the semantic sToecificaticn
b y derivations was not given there in detail.
Value e ~ 0 ~ s s i c n s E
Value expressions are built frGm
(i) Variables x,y,...
(ii) Constant s y ~ I s , and functicn symbols standing
for knc~n total functicns over values
using conventional notation. W e also allow tuples (E l .... ,E n) of
value expressions. ThUS each value expressicn without variables stands
for a uniquely defined value; w e shall n o t worry about the distinction
between such expressions and their values.
W e shall also avoid details about the types of values and value express-
ions, though w e shall have to mention sane syntactic constraints depending
cn such details (which are standard).
Labels, sorts and relabellin@
A s in Chapter 2, our labels are A = A u A , together w i t h ~.
W e use e,8,., to range over ~, I over A, and u,v,.., to range over
A u { % } . A sort L is a subset of A ; to each behaviour expression
B will be assigned a sort L(B). %
A relabelling S : L M between sorts L and M is as in 2.2.
However, scme positive labels ~ will b e used to b i n d (tuples of) variables,
and the~ ~ will qualify (tuples of) value expressic~s; w e m u s t ensure
that S preserves the sign of such labels (i.e. S (e) e A ). Moreover, in
a ccr~plete treatment w e should have to assign types to value variables and
value e~pressions, hence also to labels, and to ensure that relabellings
respect the types of labels. W e will avoid these details; they need care,
but w o u l d only obscure the m o r e important aspects of semantics w h i c h w e w a n t
to discuss here.
% W e shall only m e e t finite sorts in examples. However, all w e need to
ass~ne - for technical reasons - is that A is never exhausted. Infinite
sorts m a y be of use; see the end of Chapter 6.
67
B e h a v i o u r i d e n t i f i e r s b
~ p r e s u p p o s e a c o l l e c t i o n o f s u c h identifiers, e a c h h a v i n g
p r e a s s i g n e d
(i) a n a r i t ~ n(b) - t h e n~m%ber o f v a l u e p a r a m e t e r s .
(ii) a s o r t L(b).
W e a s s u m e t h a t t h e m e a n i n g o f s u c h i d e n t i f i e r s is given, o f t e n r ~ s i v e l y ,
b y a b e h a v i o u r e x p r e s s i o n . F o r e x a m p l e , i n 4.5 w e g a v e m e a n i n g t o t h e
b e h a v i o u r i d e n t i f i e r p b y
p(x) = ~ i ( x , f ( x ) ) . ~ g x ' . p(x')
w h e r e n(p) = i, L(p) = {~i,~2}
o
A g a i n , a c G m p l e t e t r e a t m e n t w o u l d s p e c i f y n o t j u s t a n ~ b u t a
t y p e ( i . e . l i s t o f p a r a m e t e r types) f o r e a c h b .
B e h a v i o u r e x p r e s s i o n s B
B e h a v i o u r e x p r e s s i o n s a r e f o r m e d b y o u r s i x k i n d s o f b e h a v i o u r o p e r a t o r
(4.1), b y p a r a m e t e r i s i n g b e h a v i o u r i d e n t i f i e r s , a n d b y c o n d i t i o n a l s .
I t ' s c o n v e n i e n t t o p r e s e n t t h e forma~ t i o n r u l e s as a t a b l e (see below),
g i v i n g f o r e a c h e x p r e s s i o n B i t s s o r t L(B) a n d its f r e e v a r i a b l e s e t
FV(B).
W e s h o u l d r e g a r d t h e l a n g u a g e g i v e n b y t h e t a b l e as a c o r e language,
w h i c h w e a r e free t o e x t e n d b y d e f i n i n g d e r i v e d b e h a v i o u r o p e r a t o r s (the
c h a i n i n g c c m b i n a t o r ~ o f 4.1 f o r example) a n d b y a l t e r n a t i v e s y n t a x
f o r c c ~ m o n l y o c c u r r i n g p a t t e r n s .
I n w h a t follows, w e s h a l l u s e
. . . . }
t o d e n o t e t h e r e s u l t o f s u b s t i t u t i n g e x p r e s s i o n E i f o r v a r i a b l e
x i (i s i-<n) a t a l l i t s f r e e o c ~ ] r r e n c e s w i t h i n B . S c ~ e t i m e s w e s h a l l
a b b r e v i a t e v e c t o r s (tuples) o f v a r i a b l e s a n d e x p r e s s i o n s as ~ a n d E ,
a n d w r i t e a s u b s t i t u t i o n a s
(As usual, suc/h s u b s t i t u t i c n s m a y r e q u i r e d l a n g e o f b o u n d v a r i a b l e s , t o
a v o i d clashes. )
68
S Y N T A X T A B L E F O R B~]~AVIOL~ E X P R E S S I O N S
F o r m B " L (B") F V (B")
~ a c t i ~
S u m m a t i o n
A c t i o n
C o m p o s i t i o n
R e s t r i c t i o n
R e l a b e l l i n g
I d e n t i f i e r
C o n d i t i o n a l
N I L
B + B '
a x I~ .... ,x n . B
~ E I . . . . , E n B
T . B
BIB'
B\ c~
B [ S ]
b ( E 1 ..... En(b) )
i f E t h e n B e l s e B'
L(B) u L(B')
L(B) u {e}
L(B) u {~}
L(B)
L(B) U L(B')
L(B) - {a,~}
S (L (B))
L(b)
L(B) u L(B')
FV(B) U FV(B')
FV(B) - {x i ..... X n }
FV(B) u U. F V ( E i)
F V ( B )
FV(B) u FV(B')
FVCB)
FV(B)
~ F V ( E i )
1
FV(E) u FV(B) u FV(B')
T h e t a b l e s h o w s h o w B " o f s o r t L(B") m a y b e b u i l t f r o m B,B'
o f s o r t s L(B) ,L(B'). P a r e n t h e s e s a r e t o b e u s e d t o m a k e p a r s i n g
u n a m b i g u o u s , o r t o e ~ p h a s i z e s t r u c t u r e ; t o a v o i d e x c e s s i v e u s e o f
p a r e n t h e s e s w e asst~ne t h e o p e r a t o r p r e c e d e n c e s
{ R e s t r i c t i n } > A c t i o n > O D m ~ o s i t i o n > S t ~ m a t i o n .
R e l a b e l l i n g
~ q u s f o r e x a m p l e
B I ~ . B ' \ ~ + B " [ S ] means ( B I ( T . ( B ' \ ~ ) ) ) + ( m " [ s ] ) .
6g
5.3 S e m a n t i c s b y d e r i v a t i c n s
W e p r o c e e d t o d e f i n e a b i n a r y r e l a t i c n ~ o v e r b e h a v i o u r e x p r e s s i o n s ,
f o r e a c h u cAu{T} a n d v a l u e v (of t y p e a p p r o p r i a t e t o ~ ). B ~--~VB'
m a y b e r e a d "B p r o d u c e s (or c a n produce) B' u n d e r ~ v " ; t h u s i f B,B'
a r e i n t h e r e l a t i o n ~ v , a p a r t i c u l a r atcrnic a c t i o n o f B - r e s u l t i n g
i n B' - is indicated.
R e f e r r i n g b a c k t o 3.3, w e a r e t a k i n g b e h a v i o u [ e x p r e s s i o n s t o b e
o u r agents; t o w a r d s t h e e n d o f 3.3 w e c h o s e S T s as agents, a n d w e s h a l l
s e e i n t h e n e x t c h a p t e r h o w t o r e g a r d C T s as agents.
T
N o t e t h a t - ~ is a p a r t i c u l a r c a s e o f o u r relations, s i n c e t h e o n l y
v a l u e o f t y p e a p p r o p r i a t e t o T is t h e O-tuple.
~ h e r e l a t i o n s ~ a r e d e f i n e d b y i n d u c t i o n o n t h e s t r u c t u r e o f
b e h a v i o u r e x p r e s s i o n s . T h i s m e a n s t h a t a l l t h e a t a n i c a c t i c n s o f a
p o u n d e x p r e s s i o n c a n b e i n f e r r e d f r Q m t h e a t a m i c a c t i o n s of i t s ec~qx)nent (s).
S u c h a r e l a t i o n , t h o u g h n o t i n d e x e d a s h e r e b y ~ v , p r o b a b l y f i r s t
a p p e a r e d i n c o n n e c t i o n w i t h t h e l-calculus. I t w a s c a l l e d a r e d u c t i o n
relation, a n d t h e c l a u s e s o f its d e f i n i t i o n ~ c a l l e d r e d u c t i o n rules.
G o r d o n P l o t k i n f i r s t m a d e m e a w a r e o f t h e p o w e r a n d f l e x i b i l i t y o f s u c h
r e l a t i o n s in g i v i n g m e a n i n g - b y - e v a l u a t i o n t o progranluing languages. (In
p a s s i n g w e m a y n o t e t h a t t h e o r i g i n a l d e f i n i t i o n o f ALC/3L 68, t h o u g h s t r o n g l y
v e r b a l , is i n e s s e n c e a s e t o f r e d u c t i o n rules.)
I ~ c ~ o n
N I L h a s n o a t o m i c acticns.
Suranation
F r ~ BI--~--~B ~ i n f e r B I + B 2 ~ B 1
B 2 ~ B ~ i n f e r B I + B 2 ~ B ~
T n u s t h e a t c m i c a c t i c n s o f a stun a r e e x a c t l y t h o s e o f its summands.
W e a d o p t t h e f o l l o w i n g p r e s e n t a t i c n o f s u c h i n f e r e n c e rules:
S u m --) (i) B 1 ~ B { (2) B2 ~-~vB~
B 1 + B2 ~ B1 , B1 + B 2 ____>B 2 ~ v ,
A c t i o n
70
A c t
(1) = x I . . . . . x . B ~ ( v l . . . . . V n ~ B { v l / x I . . . . . v / x n }
(2) ~ V 1 ..... V n . B ~ (Vl' .... Vn)- B
(3) T . B ~-~B
N o t e s : (i) T h e s e a r e n o t i n f e r e n c e r u l e s , b u t axicrns.
(ii) A c t (i) h o l d s f o r a l l t u p l e s (v 1 ..... v n) (of a p p r o p r i a t e
t y p e f o r ~ ) , w h i l e A c t + (2) h o l d s j u s t f o r t h e t u p l e
q u a l i f i e d b y ~ .
(iii) S e e 5 . 5 b e l o w f o r w h y w e c o n s i d e r o n l y v a l u e s
v 1 ..... v n ( n o t e x p r e s s i o n s E 1 ..... En) i n A c t (2)
C c ~ p o s i t i o n
C a m
B I I B 2 ~ B ~ I B 2
(2) B 2 ~ v B ~
B~JB2~--%vBIIB~
(3) ~ i - - ~ S l B 2
B~ IB 2 ~ B~ IB~
t ~ t e s :
(i) C a n ( i ) a n d (2) e x p r e s s t h e i d e a t h a t a n a c t i o n
o f B I o r o f B 2 i n t h e c c r ~ p o s i t i o n B l I B 2 y i e l d s a n
a c t i o n o f t h e ccr~0osite i n w h i c h t h e o t h e r c c r ~ o n e n t
i s u n a f f e c t e d .
(ii) C a m (3) e x p r e s s e s t h a t c Q m m u n i c a t i o n o f ~ n e n t s
y i e l d s a T - a c t i o n o f t h e ~ s i t e .
Restriction
71
Res
B ~--~VB ' , ~ { e , ~ }
B\~ ~--~VB,\~
Note: the side condition ensures that B\~ has no ~ v or e v
actions.
R e l ~ i L i n S ,
Rel
B ~_~v B ,
B[S] (Su)v B'[S]
Note: recall our convention that ST = T
Identifier. Suppose that identifier b is defined by the (.possibly
recursive) clause
b(x I ..... X n ( b ) ) ~ ~ (FV(~) E {x I ..... Xn(b)})
W e shall discuss such definitions shortly. Our rule is
Ide
~ { v l / x I . . . . , V n ( b ) / X ( b ) } ~ - ~ B '
b ( v I ..... V n (b)) - ~ B'
Note: the rule says, in effect, that each parameterized identifier
has exactly the s~ne actions as the appropriate instance o f
the right-hand side of its definition.
Conditional
Con -> ( i )
BI~-R~VB' B2~-P~VB ~
i (2)
i f true t b ~ n B 1 else B2 ~-~VB 1 i f false then B I else B2 ~--~VB ~
Note:
As with all value expressions without variables, w e assume
that boolean-valued expressicns evaluate 'autcmatically' to
their boolean values. See 5.5 bel(x~ for w h y w e need not
consider value-expressions containing variables in these rules.
72
5.4 ~ f i n i n 9 behaviour identifiers
We shall now assume that every behaviour identifier b is defined
by a clause
b(x I .... ,Xn(b)) ~ B b
where x I ..... Xn(b) are distinctvariables, a n d w h e r e F V ( ~ ) c { x I .... ,Xn(b)}"
The symbol ' ~ ' is preferred to ' = ' since w e are not yet talking of the
behaviours denoted by behaviour expressions (so ' = ', in the sense of
equality of meaning, would be out of place), and also because w e will
later in this chapter use ' =' to mean identity between expressions.
W e thus have a collection of clauses defining our b's, and they may be
mutually recursive. Although not actually essential, we shall ini0ose a
slight constraint on the collection, which will forbid such definitions as
b(x) ~ ~x.NIL + b ( x + l )
O~ ~b I ~ b2 + ~.b3
[
b 2 b l I B. b 4
i n which a behavi our may ' c a l l i t s e l f r e c u r s i v e l y wi t hout pas s i ng a gua r d' .
Thus t he f ol l owi ng a r e per mi t t ed:
b(x) ~ ~x.NIL + T.b(x+l)
and ~ b I ~ b2 + c~.b 3
t
b 2 ~ ~.bllS"b 4
More precisely, we say that b
without an enclosing guard. The restriction on our defining clauses for
the b's is that there must be no infinite sequence bi(1) ,bi(2) ,... such
that, for each j , bi(j+l) is unguarded in bi(j) (In the forbidden
examples above there are such sequences: b,b,b, .... and bl,b2,bl,b2,...
respectively.) Further, for correctness of sorts, w e require
L ( ~ ) _c L(b)
When the above constraints are met, we shall say that the behaviour
identifiers are guardedly well-defined.
is tm$~arded i n B if it occurs in B
73
5. 5 s o~ and p~r ~
Our f ox. on r ul e s a s c r i be a uni que s or t L(B) each ~ha vi our
expression B ; w e w r i t e
B : L(B)
to mean 'B possesses sort L(B) ' F o r m a n y reasons, it is convenient
to allow B to possess all larger sorts as well; so w e declare
B : L & L _c M implies B : M
For example, this allows us to m a k e sense of an expression like
NIL[ 8/= ]
since 8/~ : {~} + {8} is a relabelling, and N I L : {~} since N I L : @.
A n ~ o o r t a n t property of at/mdc actions as defined in 5.3 is the
following:
Proposition 5.1 If B ~-~VB ' ~ and B : L , then
~ L u {T} and B' : L
Proof By induction on the length of the inference which ensures B ~ B' ,
using the ascription of sorts b y the fox,nation rules.
Although our rules for atcrnic actions apply to arbitrary behaviour
expressions, they fail to describe fully the meaning of expressions with
free variables. F o r example, the rule A c t gives n o action for
~ ( x + I) . N I L
and C o n says nothing for
i_ff x->O then ~ x . N I L e l s e fl(-x).NIL
Clearly they could n o t determine the actions of these e~oressions, since
actions involve values, n o t variables, and in the second exanple even the
label of the possible action depends upon the 'value' of x .
W e choose to regard the m ~ i n g of a be~aviour expression B with
free variables ~ as dete/~nined b y the meanings of B{~/~} for all
value-vectors q .
Definition W e define a program to b e a closed behaviour expression,
i.e. one with n o free variables.
74
N o w the fact that our rules describe the meanings of programs
satisfactorily is due to the following:
prc~ositi0n 5.2 If B is a program and B ~ B ' , then B' is also
a progran.
Proof By induction on the length of the inference which ensures
B ~ v B' . ~ e cendition c n the free variables of each ~ , and
the substitution involved in A c t + (i) , are critical.
5.6 Direct equivalence of behaviour programs
(In 5.6 and 5.7 w e are concerned only with programs).
W e n o w take ~o the question, posed in 55.1, of w h i c h behaviour
programs possess the same derivations; this will yield an equivalence
relation, w h i c h will also be a ccngruence - that is, any program m a y b e
replaced b y an equivalent one in any context, without affecting the
behaviour (derivations) of the whole. F o r example,
B + B ' and B' + B
are different prograns, but w e clearly expect them to be interchangeable
in this sense.
A first approximation to w h a t ~ want m a y be called direct e~uivalence ;
w e denote it b y - , a n d define it as follows:
Definition B 1 _-- B 2 (B 1 and B 2 are directly equivalent) iff for every
~,v and B
(Warning: -- is n o t a congruenoe relation. For example, w e m a y have
B I - B 2 , but in general
I B I B 2 . For le,
I % I I
n o t identical:
.NILI B 2 a ~ N I L I B 2
But the congruence relation w e want w i l l be ~nplied b y ~ , and so the
following laws for - will hold for the congruence also. )
75
I n w h a t f o l l o ~ i t is o f t e n c o n v e n i e n t t o l e t g s t a n d f o r a n
a r b i t r a r y g u a r d e X , ~ E o r T. T h e r e s u l t S g o f r e l a b e l l i n g a
g u a r d is g i v e n b y S(ax) = (S~)x , S ( ~ ) = (S~)E a n d ST = T .
T h e n a m e o f t h e l a b e l i n g is d e n o t e d b y name(g)
T h e o r e m 5.3 (Direct ~ u i v a l e n c ~ _ s ) . T h e f o l l o w i n g d i r e c t e q u i v a l e n o e s
h o l d (classified b y t h e l e a d i n g o p e r a t o r o n t h e l e f t side):
S u m -
(I) B I + B 2- B 2 + B I
(3) B + N I L - B
(2) B I + ( B 2 + B 3) -- ( B I + B 2 ) + ~
(4) B + B - = B
A c t - e x . B =- ~ y . B { y / x } (change o f b o u n d variables)
w h e r e y a r e d i s t i n c t v a r i a b l e s n o t i n B
R e s -
(i) N I L \ 8 - N I L (2) (B 1 + B 2 ) \6 - B I \ 8 + B 2 \ ~
(3) (g.B)\8--- I N I L if 8 = n a m e ( g )
!
g . B \ ~ o t h e r w i s e
R e l - (i) N I L [ S ] - N I L (2) (B 1 + B 2 ) [S] - B I [ S ] + B 2 [ S ]
(3) (g.B) [S] -- Sg.B[S]
N o w in v i e w o f S~-m - t h e f o l l o w i n g n o t a t i o n s a r e u n a m b i g u o u s :
[ S i m e a n i n g B I + . . . + B n ( N I L , if n = O )
l < i < n
[ { B i ; i e I} m o r e g e n e r a l l y , w ~ _ r e I is finite.
If e a c h B i is o f f o z m g i . B i , w e c a l l s u c h a s u m a s ~ n o f ~ ,
a n d e a c h B. a sL~mand.
l
C c [ n - L e t B a n d C b e s t ~ s o f guards. T h e n
- [{g.(B'IC) ; g.B' a s i m m a n d o f B}
+ [{g. (BIC') ; g.C' a s ~ a n a n d o f C }
+ [ { ~ . ( B ' { ~ / x } I C ' ) ; s x . B ' a s u m m a n d o f B
a n d ~ C ' a s u m m a n d o f C }
+ ~{T. (B'[C'{~/~}) ; ~ . B ' a s u m m a n d o f B
a n d ~ x . C ' a s u m m a n d o f C }
7 6
I d e - L e t i d e n t i f i e r b b e d e f i n e d b y b ( x ) ~ ~ ; t h e n
b(~) _-- B b { - ~ / ' x }
Con_-- (I) i f t r u e t h e n B i e l s e B 2 _-- B I
(2) i f f a l s e t h e n B I els___ee B 2 = B 2
P r o o f T o p r o v e e a c h l a w is a r o u t i n e a p p l i c a t i o n o f t h e d e f i n i t i o n
o f t h e r e l a t i o n s ~v> . W e c o n s i d e r t h r e e laws:
(i) Stun---(2): B I + ( B 2 + B 3) - (B 1 + B 2 ) + B 3
l e t B I + ( B 2 + B 3 ) ~ B. T h i s c a n o n l y b e d u e t o
e i t h e r r u l e Su~n + (i), b e c a u s e B 1 ~V>B
o r r u l e S u m 4(2) , b e c a u s e B 2 + B 3 ~ V ~ B ,
a n d i n t h e l a t t e r case, similarly, e i t h e r B 2 ~ - ~ B o r B 3 U ~ B .
I n e a c h o f t h e t h r e e cases, r u l e s S u m 4(1) a n d S u m 4(2) y i e l d
( B I + B ~ ) + B 3 ~ - X v B .
T h e r e v e r s e i n p l i c a t i c n is similar.
(ii) R e s - (3) : ( ~ x . B ) \ ~ - = { N I L ( ~ = a )
e X . ( B \ 6 ) ( 8 : * : ~ )
B y A c t (i) , t h e o n l y a c t i o n s o f ~ x . B a r e o f f o m n
N
~ X . B ~V~B{~/X} (for a r b i t r a r y v ).
Thus (~x.B) \~ h a s n o a c t i o n s (since R e s + y i e l d s none} ;
n e i t h e r h a s NIL, w h i c h s e t t l e s t h e c a s e 8 = a.
F o r ( 8 ~ ) , b y R e s t h e c n l y a c t i o n s o f (~x.B)\8 a r e
(ex.B)\8 a ~ , B { ~ / x } \ B = (B\8) {~/x}
a n d t h e s e a r e e x a c t l y t h e a c t i o n s o f ~x. (B\B).
T h e p r o o f f o r g u a r d s ~-5 a n d T is similar.
c~iii~ c ~ - : < c =- I ' " + l - - - + I - - - + I ' " .
(We u s e X t o a b b r e v i a t e t h e r i g h t - h a n d side.)
l e t B I C ~--~VD . T h e r e a r e s e v e r a l cases.
(a) B ~ B " , a n d D = B " I C (by Corn+(1) ).
T b e n B h a s a slmlnand g.B' f o r w h i c h g.B' ~V~B"
(by S u m + ) . T h i s a c t i o n m u s t b e a n i n s t a n c e o f A c t +
77
( b )
( c )
frc~ w h i c h w e can also find that g. (B' I C) ~v> B,,I C
(considering the three types of guard).
Hence also X ~ B " I C = D .
C ~-~v C " , a n d D = BIC" (by Ccrn(2))
The ~ t that X ~--~D is similar.
B ~-gu B '' , C ~-~u C ' a n a ~ v = , D = B " I C '
(by C a n (3) ; there is a similar case w i t h = ,~ exchanged)
Then by S ~ + and A c t , B has a stm~and ~x.B'
and B" = B ' { ~ x } , while C has a s%mm~nnd ~u.C'
Hence, since X has a summand ~ . ( B ' { u ~ } I C ' ) , w e have
X - ~ B " I C ' = D , as required .
W e have n o w shown by (a),(b) & (c) that for all u , v
B l C ~--%VD ~ X ~ V ~ D
and the reverse implication can be argued similarly.
and D
Exercise 5.1 Prove sane m o r e equivalences claimed; of the
e.g. S u m - ( 1 ) , Re s - ( 2 ) , R e l ~(2) a n d C o n - (I) . They are all as
easy as S ~ -(2) .
5.7 Congruence of behaviour programs
W e now propose to extend or widen our direct equivalence relation to a
congruence relation. Apart frc[fl the w i s h to get a congruence relaticn
(so that equivalence is preserved b y substitution of equivalent programs)
there is another motivation; ' -' requires that the results of actions of
equivalent programs should b e identical, and it is reasonable to ask only
that the results should b e equivalent again.
W e therefore define the relation ' ~ ' over programs, which w e call
strong equivalence (we define it analogously to the observation _equiv-
alence of 3.3, b u t it is stronger because w e do n o t allow arbitrary
T-actions to interleave the observable actions). W e define it in terms of
a decreasing sequence ~0' ~1 . . . . . ~k .... of equivalence relations:
78
D e f i n i t i o n B N o C i s a l w a y s t r u e ;
B ~ k + l C i f f f o r a l l ~, v
(i) i f B ~V-~B' t h e n f o r s a m e C' C u--~Vc' a n d B' C '
' ~ k '
(ii) i f C ~--~Vc' t h e n f o r s o m e B ; , B ~--~VB ' a n d B ' ~ k C ' ;
B ~ C i f f k/k>-O. B ~ k C (i.e. ~ = ~ ~ k ) .
k
W e l e a v e o u t t h e sir~ple p r o o f s t h a t e a c h ~ k i s a n e q u i v a l e n c e
r e l a t i o n , a n d t h a t B ~ k + l C i m p l i e s B ~ k C ( i . e . t h e s e q u e n c e o f
e q u i v a l e n c e s i s d e c r e a s i n g ) .
~ E x ~ s e 5 . 2 S h o w t h a t B C B C f o r e a c h k a n d
E
~ l i e s
~ k
f
c e in,plies B ~ C .
T h e o r e ~ 5 . 4 ~ i s a o o n g r u e n c e r e l a t i o n .
M o r e p r e c i s e l y , B I ~ B 2 i m p l i e s
B I + C ~ B 2 + C , C + B I ~ C + B 2
~ . B I ~ ~ v . B 2 , T . B I ~ ~ - B 2
B I I C ~ B 2 1 C , C I B I ~ C I B 2
B I \ ~ ~ B 2 \ ~ , B I [ S ] ~ B 2 [ S ]
a n d B I { ~ / ~ } ~ B 2 { ~ / x } (for a l l ~ ) i m p l i e s
~ . B 1 ~ ~ . B 2
P r o o f W e g i v e t h e p r o o f o n l y f o r ccr~position. W e p r o v e b y i n d u c t i o n
o n k t h a t
B 1 ~ k B 2 i m p l i e s B 1 1 C ~ k B 2 I C
F o r k = O i t i s t r i v i a l . N o w a s s ~ n e B 1 ~ k + l B 2 "
l e t B I l C ~ - ~ D I " W e w a n t D 2 s u c h t h a t
B 2 1 C ~-~Y~v D 2 ~ k D 1
T h e r e a r e t h r e e c a s e s :
(a) B 1 ~--~VB ~ , a n d D 1 = B ~ I C (by C a m + _ ( 1 ) )
T h e n B ~ B ~ ~ k B ' . f o r s c m e B ~ ,
2 v 1
w h e n c e B 2 1 C ~-~v B ~ I C b y C c ~ ( 1 )
~ k D 1 (= B 1 I C) b y i n d u c t i v e h y p o t h e s i s
(b) C U I C " a n d D = B I l C ' (by C c m ( 2 ) )
qPnen B21C~--~VB2~C' b y C c x n ( 2 )
B u t B 1 ~ k B 2 ( s i n c e B I ~ k + l B2) " h e n c e B I I C ' ~ k B 2 1 C '
b y i n d u c t i v e h y p o t h e s i s .
79
(c) Bi l--~UB'l lu' C !~C', a n d .~v = T, D i' = B i'IC' ( b y C c m ( 3 ) )
T h e n B 2 ~ B 2 ' ~'k i ' B f o r sc~ne B 2
~ k D1 b y i n d u c t i v e h y p o t h e s i s .
B y symmetry, o f course, if B 2 1 C ~ D 2 t h e n w e f i n d D 1 s u c h t h a t
B I I C ~ D 1 ~ k D
e
E x e r c i s e 5 . 3 (i) P r o v e t h a t B1 ~ k B 2 i m p l i e s ~ v . B 1 ~ k + i ~ v . B 2 ;
this s h o w s t h a t B I ~ B 2 i m p l i e s ~ v . B 1 ~ a ~ . B 2, a n d a l s o t h a t
g u a r d i n g i n c r e a s e s t h e i n d e x o f N k b y one.
(ii) P r o v e t h e l a s t p a r t o f t h e Theorem, i n v o l v i n g t h e
p o s i t i v e l a b e l guard.
W e e n d t h i s s e c t i o n b y g i v i n g s a m e u s e f u l p r o p e r t i e s o f ~ , in
t h e f o r m o f e q u a t i o n a l laws. N o t e t h a t T h e o r e m 5.3 a l r e a d y g i v e s m a n y
o f its p r o p e r t i e s , s i n c e - is c o n t a i n e d in ~ S i n c e w e r u n t h e
r i s k o f b e w i l d e r i n g t h e r e a d e r w i t h a c o n f u s e d m a s s o f p r o p e r t i e s , l e t
u s e ~ p h a s i z e s o m e structure.
I n T h e o r e m 5.3, S ~ n _= s t a t e s t h a t + a n d N I L f o ~ a cc~rm/tative
s e m i g r o u p w i t h absorption, a n d R e s _=, R e l -_-, C a m _= e a c h d e s c r i b e h o w
o n e o f t h e s t a t i c b e h a v i o u r o p e r a t i o n s \~, [S] , I i n t e r a c t s w i t h t h e
d y n a m i c o p e r a t i o n s +, ~ v a n d NIL. I n t h e f o l l o w i n g t h e o r e m Ccrn~ s t a t e s
t h a t J a n d N I L f o l m a c c ~ m u t a t i v e semigroup, w h i l e R e s ~ a n d R e l ~ s t a t e
h o w t h e s t a t i c o p e r a t i o n s i n t e r a c t w i t h e a c h other. T h e laws o f T h e o r e m
5.5 a r e o n l y c o n c e r n e d w i t h t h e s t a t i c o p e r a t i c n s - t h e y a r e e s s e n t i a l l y
t h e L a w s o f F l o w i n [M~, M i l 2] .
T h e o r e m 5.5 (Stron 9 congruences) T h e f o l l o w i n g s t r o n g c o n g r u e n c e s hold:
( i ) B llB 2~B 21B 1
(3) B1NIL~B
(2) Blt(B2IB3)~ (BlJB2) IB 3
R e s N
(i) B \ ~ ~ B (B:L, a ~ n ~ s ( L ) )
(2) B \ a \ 8 ~ B \ B \ a
(3) ( B I I B 2 ) \ a ~ B I \ a I B 2 \ ~ ( B I : L I , B 2 : L 2 , ~ ~ ns~r~s ( L l n L2) )
8 0
R e I N
(i) B [ I ] ~ B ( I : L L i s t h e i d e n t i t y r e l a b e l l i n g )
(2) B [ S ] ~ B [ S ' ] ( B : L , a n d S [ L = S'~L)
(3) B [ S 3 [ S ' ] ~ B [ S ' o S ]
(4) B [ S ] \ B ~ B \ ~ [ S ] (8 = n a n e ( S ( ~ ) ) )
(5) ( B 1 ] B 2 ) [ s ] ~ B I [ S ] [ B 2 [ S ]
P r o o f ~ g i v e t h e p r o o f o f C c m ~ ( 2 ) . I t i s t h e h a r d e s t - b u t a l l t h e
p r o o f s a r e r o u t i n e i n d u c t i o n s .
W e p r o v e ~ B I B 2 B 3 . BI[(B21 B3) ~ k ( B I [ B 2 ) I B 3 b y i n d u c t i o n o n k.
F o r k = O i t ' s t r i v i a l .
N o w f o r k + l , l e t B I I ( B 2 1 B 3 ) ~--~VD ; w e r e q u i r e D ' s u c h t h a t
( ~ 1 ~ ) [ ~ ~-Z,v ~ ' - k ~ "
T h e r e a r e s e v e r a l c a s e s :
(a) ~ p v B ~ , a n d D = B~[ ( B 2 [ B 3) b y C ~ n + ( 1 ) .
T h e n ( B I ] B 2 ) [ B 3 ~ _ .v , ( B ~ I B 2 ) I B 3 b y C ~ + ( 1 ) t w i c e
~ k D b y induc+_ion.
(b) B 2 1 B 3 ~--~Vc , a n d D = B 1 ] C b y Ccra+(2).
S u b c a s e s
(~1% --*~ B[,
(iii) B 2 ~ B ~ ,
~ e n B 1 I % ~ B~ [B~ b y C a ~ + ( 2 ) ,
s o ( B I [ B 2 ) [ B 3 Z - ~ ( B I l B ~ ) IB Z by C . ~ ( 3 ) ,
~ k D b y i n d u c t i o n .
( ~ ) ~ X U B I , % [ B 3 ~ c , D = % ' I c a n d ~ v =
S u b c a s e s
(i) B 2 ~ B ~ , a n a c = B ~ [ B 3 b y C ~ + ( i )
~ B I IB 2 ~+ B ~ IB~ bY c ~ ( 3 ) ,
(i) B 2 ~ - Z v ' , a n d C = B '
B 2 2 [ B 3 b y C.(m~(1) ; i . e . D = B I ( B 2 1 B ) .
I 3
~ B II B 2 ~ B~l B~ b y C a n + ( 2 ) ,
D b y i n d u c t i o n .
~ k
a n a c = B2[ B' 3 b y C a ~ ( 2 ) ; s=~J_ar.
(B' IB') b y C c m + ( 3 ) .
s o D = B I [ . 2' 3- '"
b y Ccgn(3) .
; i . e . D : B ~ _ [ ( B ~ ] B 3 )
s o (B I [B 2) [ B 3 - ~ (B[ I B m ) J B 3 b y Corn+(1),
~ k D b y i n d u c t i o n .
(ii) B 3 ~ B ~ , a n d C = B 2 IB~ b Y ~ ( 2 ) : s ~ a r .
81
T h u s w e h a v e f o u n d t h e r e q u i r e d
S i m i l a r l y g i v e n ( B I l B 2 ) IB3P-~V D , w e f i n d
BII(B21B 3) 0 ' ~ k D
% T ~ s o m p l e t e s t h e i n d u c t i v e step, s h o w i n g
BII(B21B3) ~ k + l (BIlB2) IB3
~ E x e r c i s e 5 . 4 P r o v e C G m ~ ( 3 ) a n d Res~(3) .
H n e e d t o a p p e a l t o P r o p o s i t i o n 5 .i.
D' ~ D i n e a c h case;
D' s u c h t h a t
F o r t h e second, y o u
W e n o w s t a t e a n d p r o v e a t~heorem w h i c h w e n e e d later. I t d e p e n d s
c r i t i c a l l y o n t h e a s s u n p t i o n t h a t a l l b e h a v i o u r i d e n t i f i e r s a r e g u a r d e d l y
w e l l d e f i n e d (5.4).
T h e o r e m 5.6
f o l l o w i n g sense:
B ~ C i f f f o r a l l p , v
(i) if B - ~ B' t h e n f o r s a n e
(ii) if C ~--~Vc ' t h e n f o r s a m e
S t r o n g c c n g r u e n c e 'satisfies its definition' in t h e
C' C ~ C ' a n d B '~ C'
F
B', B - ~ B' a n d B '~ C' .
P r o o f ( ~ ) B ' ~ C' i n , lies B' ~ k C' f o r a n y k ; h e n c e f r c m (i)
a n d (ii) w e d e d u c e B ~ k + l C f o r a l l k , b y d e f i n i t i o n , w h e n c e B ~ C .
( 3 ) S i n c e B ~ k + l C f o r a l l k , w e h a v e b y d e f i n i t i o n t h a t i f
B ~ B ' then, f o r e a c h k, 3 ~ . C ~ & B ' ~ k C k . B u t f r c m o u r
a s s u m p t i o n t h a t a l l b ~ a v i o u r i d e n t i f i e r s a r e g u a r d e d l y w e l l - d e f i n e d
i t f o l l o w s t h a t {C' ;C ~ C' } is f i n i t e (we c m i t t h e d e t a i l s o f t h i s
argument). H e n c e f o r s c m e C' ,
~ k a r e
C ~ C' a n d B' ~ k C' f o r i n f i n i t e l y m a n y k
a n d this i m p l i e s B' ~ k C' f o r a l l k , s i n c e t h e r e l a t i o n s
d e c r e a s i n g in k , h e n c e B ' ~ C ' .
T h u s (i) is p r o v e d , a n d (ii) is similar.
5.8 C o n @ r u e n c e o f B e h a v i o u r e x p r e s s i o n s a n d t h e E x p a n s i o n T h e o r e m
H a v i n g e s t a b l i s h e d d e f i n i t i o n s a n d p r o p e r t i e s o f d i r e c t e q u i v a l e n c e
a n d c o n g r u e n c e o f p r o g r a m s - b e h a v i o u r e x p r e s s i o n s w i t h o u t f r e e v a r i a b l e s -
w e a r e n o w i n a p o s i t i c n t o l i f t t h e r e s u l t s t o a r b i t r a r y b e h a v i o u r expressicns.
A l l t h a t is n e e d e d is t o d e f i n e - a n d ~ o v e r e x p r e s s i o n s a s follows:
82
D e f i n i t i o n
L e t ~ b e t h e f r e e v a r i a b l e s o c c u r r i n g i n B I o r B 2 o r both.
T h e n
B I - B 2 iff, f o r a l l v , Bi{~/x}---B2{~/~}
B i ~ B 2 iff, f o r a l l ~ , B 1 { v / x } ~ S 2 { v / ~ }
N o w w e c l e a r l y w a n t t o e x t e n d t h e r e s u l t s o f T n e o r e ~ 5.3, 5.5 t o
a r b i t r a r y expressions; f o r example, w e w o u l d l i k e t o a p p l y C c ~ ( 3 )
o f T h e o r e m 5.5 t o r e p l a c e
~ ( x + l ) . N I L I N I L b y ~ ( x + I ) . N I L
a n y w h e r e i n a n y expression, b u t t h e l a w o n l y a p p l i e s a t p r e s e n t t o programs,
a n d t h e e x p r e s s i c n s s h o w n h a v e a f r e e v a r i a b l e x.
W e s t a t e w i t h o u t p r o o f t h e d e s i r e d generalisation.
T h e o r e m 5 . 7 T h e r e l a t i o n ~ is a c o n g r u e n c e o v e r b e h a v i o u r expressions.
~ D r e o v e r , t h e r e s u l t s o f T h e o r e m s 5.3, 5.5 h o l d o v e r arbitral~y expressions,
w i t h t h e f o l l ~ i n g adjustments:
(i) I n C c m - a n d I d e - o f T h e o r e m 5.3, r e p l a c e v (a v a l u e tuple)
e v e r y w h e r e b y ~ (a t u p l e o f v a l u e e x p r e s s i o n s ) .
(ii) A d d in Coin = t h e c o n d i t i o n that, in t h e f i r s t (resp.seoond) s ~
o n t h e r i g h t - h a n d side, n o f r e e v a r i a b l e o f C(resp. B) i s b o u n d b y g.
W e n o w h a v e e n o u g h t o p r o v e t h e E x p a n s i o n Theorem, w h i c h w e
u s e d i n C h a p t e r 4.
T h e o r e m 5 . 8 (The E x p a n s i o n Theorem).
L e t B = (Bll... IBm )\A, w h e r e e a c h B i is a s ~ o f ~/ards. T h e n
c cBiI I B i I B m \ A ; g . B i
a s ~ m m a n d o f B i, name(g) { A }
+ [{~" ((BII " " I B I { ~ } I --- IB~I "-" IBm)\A) ;
~ . B i a s u m m a n d o f Bi, % E . B 3 a sLmlmand o f
B. , i ~ j }
]
p r o v i d e d t h a t i n t h e f i r s t t e a m n o f r e e v a r i a b l e i n ~ (k # i) is
bound by g .
83
Proof. W e f i r s t show, b y i n d u c t i o n o n m, t h a t
B I I . . . I B m ~ ~ { g . ( B I I . . . I B ~ I . . . I B m) ; g . B 1 a
s u n l ~ o f B. , l-<i-<In}
1
+ ( B I I - . . I B I . - . f B m ) ;
e~.B: a s u n m a n d o f B. , ~E.B'. a
l i 3
s ~ a a n d o f B. , i , j ~ { l , .... m } , i ; j }
]
u n d e r t h e p r o v i s o o f t h e T h e o r e m . N o t e f i r s t t h a t f o r m = 1 t h e
s e c o n d t e m n is v a c u o u s a n d t h e r e s u l t f o l l o w s s i m p l y b y r e f l e x i v i t y
o f ~ . N o w a s s ~ n e t h e p r o p e r t y f o r m - 1 , w i t h r i g h t - h a n d s i d e C.
T h e n w e h a v e (by congruence)
B i l - - - I B m _ l i B m ~ C l B m
and we may a p p l y Cam = , g e n e r a l i s e d as i n Theor em 5 . 7 , s i n c e each o f
C and B i s a s ~ o f g u a r d s - and mo r e o v e r t h e s i d e - c o n d i t i o n f o r
m
Can ~ ( s t a t e d as ( i i ) i n Theor em 5. 7) f o l l o ws f r c m t h e p r o v i s o o f t h e
p r e s e n t theorem. T h e p r o p e r t y f o r m t h e n f o l l o w s b y r o u t i n e , t h o u g h
s l i g h t l y tedious, m a n i p u l a t i o n s ; o f c o u r s e w e r e l y s t r o n g l y o n C c m ~ (2).
Finally, t h e t h e o r e m f o l l c ~ s e a s i l y b y r e p e a t e d u s e o f R e s - ( 3 ) a n d
S u n -(3).
E x e r c i s e 5 . 5 C c m p l e t e t h e d e t a i l s o f t h e i n d u c t i v e s t e p i n t h e proof,
a n d s e e e x a c t l y w h e r e t h e p r o v i s o o f t h e t h e o r e m is necessary.
I n sim~nazy : w e n c ~ h a v e a p o w e r f u l s e t o f laws f o r transfoz~ting
p r o g r a m s a n d b e h a v i o u r e x p r e s s i o n s w h i l e p r e s e r v i n g t h e i r d e r i v a t i o n p a t t e r n .
(These laws a r e e n o u g h t o p r o v e t h e E x p a n s i o n T h e o r e m , T h e o r e m 5.8, f o r
example. )
W e h a v e p r e p a r e d t h e w a y f o r i n t r o d u c i n g CTs, a n a l g e b r a w h i c h s a t i s f i e s
t h e s e laws a n d so m a y b e r e g a r d e d as a m o d e l o f O C S w h i c h is f a i t h f u l t o its
d e r i v a t i o n p a t t e r n s .
B u t w e s h o u l d m e n t i o n t h a t o ~ e r v a t i o n e q u i v a l e n c e (~) (generalised
f r o m 33 t o a d m i t value-passing) is a w i d e r r e l a t i o n t h a t o u r ~ , a n d
s a t i s f i e s s t i l l m o r e e q u a t i o n a l laws.
C H A P T E R 6
C~,~lunication T r e e s (CTs) as a m o d e l o f C C S %
6 . 1 C T S a n d t h e D ~ n a m i c O p e r a t i o n s
L e t u s r e v i e w t h e d e f i n i t i o n o f STs. A n S T o f s o r t L e A is
a rooted, f i n i t e l y b r a n c h i n g , u n o r d e r e d t r e e w h o s e a r c s a r e l a b e l l e d
b y m e m b e r s o f L u { T } .
A n o t h e r w a y o f s a y i n g t h i s is t h a t a n S T o f s o r t L is a f i n i t e
c o l l e c t i o n (multiset) o f p a i r s o f f o r m <~,t> (~eLu{~}) w h e r e e a c h
t is a g a i n a n S T o f s o r t L.
(We a l l o w this d e f i n i t i o n t o i n c l u d e t h e p o s s i b l i t y o f i n f i n i t e
p a t h s i n a n ST, t h o u g h t o s t a t e this f o z m a l l y r e q u i r e s same m a t h e m a t i c a l
so!~qistication w h i c h w e d o n o t w a n t t o b e b o t h e r e d w i t h - t h e i d e a o f
i n f i n i t e p a t h s is c l e a r enough.)
H e r e is a t y p i c a l ST:
N o w i n t h e l a n g u a g e o f C h a p t e r 5, p o s i t i v e labels a r e a l l o w e d t o
b i n d variables, a n d n e g a t i v e o n e s a r e a l l o w e d t o q u a l i f y v a l u e s (or
v a l u e e x p r e s s i o n s ) . Thus, w h a t 'happens next' a f t e r p a s s i n g a p o s i t i v e
l a b e l (= i n p u t guard) d e p e n d s u p o n t h e v a l u e input; less crit~cally, a
v a l u e i s o u t p u t w h i l e p a s s i n g a n e g a t i v e l a b e l (= o u t p u t guard). S u p p o s i n g
t h a t {v0,vl,...} a r e t h e v a l u e s o f t y p e a p p r o p r i a t e t o ~, a n d v is a
v a l u e o f t y p e a p p r o p r i a t e t o ~, t h e n a t y p i c a l C T w i l l l o o k like this:
v
2,
T h i s c h a p t e r is n o t e s s e n t i a l t o t h e t e c h n i c a l d e v e l o p m e n t , a n d c a n b e
cmitted. I t s p ~ e is t o a s s i s t u n d e r s t a n d i n g b y g i v i n g t h e n a t u r a l
g e n e r a l i s a t i a n o f S T s t o a d m i t v a l u e - p a s s i n g .
85
i n d i c a t i n g (i) t h a t o n p a s s i n g g u a r d ~, t h e i n p u t v i s e l e c t s t i
t o 'happen next'
(ii) t h a t v is o u t p u t o n p a s s i n g 8.
W e e x p e c t t h i s C T t o b e t h e i n t e r p r e t a t i o n o f a b e h a v i o u r p r o g r ~ n
a x . B + ~ V . B ' + T . B "
w h e r e (i) t h e p r o g r a m s B { v i / x ) s t a n d f o r C T s t i ;
(ii) t h e p r o g r a m s B' a n d B" s t a n d f o r t' a n d t".
N o t i c e t h a t t h e v a r i a b l e x a p p e a r s n o w h e r e i n t h e CT; its p u r p o s e
i n t h e p r o g r a m is t o s h o w h o w B d e p e n d s u p o n t h e v a l u e input, a n d t h i s
d e p e n d e n o e is e x p l i c i t i n t h e CT; e a c h t i d e p e n d s , literally, f r o m
t h e v a l u e v.. (Of course, v ~ c a n n e v e r d r a w a w h o l e CT, i n g e n e r a l -
1
e v e n t o f i n i t e d e p t h - b e c a u s e o f i n f i n i t e v a l u e dcmains).
M o r e fozmally, then:
D e f i n i t i o n A C T o f s o r t
e a c h o f fo~xn
L is a f i n i t e c o l l e c t i o n (multiset) o f pairs,
<~,f> (~L), w h e r e f is a f a m i l y o f C T s o f s o r t L i n d e x e d
b y the v a l u e s e t a p p r o p r i a t e t o
o r <~,<v,t>> (SeL), w h e r e v is a v a l u e a p [ m o p r i a t e t o ~ a n d t
is a C T o f s o r t L
o r <T,t> w h e r e t is a C T o f s o r t L.
L e t us d e n o t e b y C ~ L t h e C T s o f s o r t L, a n d b y ~ t h e s e t o f
v a l u e s a p p r o p r i a t e f o r s. W e have, as w i t h STs, a n a l g e b r a o f C T s as
follows:
N I L (nullary operation)
N I L is t h e C T
N I L E C T ~ .
+ ( b i n a r ~ operation)
is t h e C T
86
(a '~f-ary" operation)
v 0 v I v 2 v 0 v I
takes a set o f ~ of C T L indexed by V ,
f:_ V~ + CTL, and gives a member o f CTLu{e } ; so
~ ( v ~ c T L ) C T L u { ~ }.
~%is is w h y we called ~ a V -ary operation.
which is just a function
(a family o f unary operaticns)
~v , for each v e V , is the C f
For each v, ~ v e CT L + CTLu{~}; ~ e Ve (CT L CTLu{~}).
T (unary operation)
2
T ~ C T L C T L.
Clearly there is a very close relaticn between CCS programs (involving
only the dynamic operations) and expressions for CTs in this algebra.
~his is no accident'
Corresponding to programs NIL, ~v.B, T.B, B + B' w e have CTs
NIL, ~vt, ~t, t + t'. Corresponding to t h e program ~x.B w e have a
C T ~f; if w e wrote t h e C ~ family f as v ~+ t(v) then w e w o u l d
express ~f as
~(v ~ t(v))
Of oourse there are many CTs whiQh w e cannot write down as expressions,
because arbitrary V - i n d e x e d families of CTs cannot be written down
finitely.
87
B u t w e can, u s i n g t h e s e n o t a t i o n s , b e g i n t o d e f i n e the i n t e r p r e t a -
t i o n o f C C S i n t h e a l g e b r a o f CTs. W e s h a l l w r i t e t h e C T w h i c h B s t a n d s
f o r as ~ B ]. T h e n w e h a v e
D e f i n i t i o n
~ N ~ L ~ = NIL
~ X . B ~ = ~ (V ~ { I ~ V / X } ~ )
~ j v . B ~ = j ~ B ~
[~ .B~ = T~B~
[ B + B'~ = [B] + [B']
6.2 C T s a n d t h e s t a t i c o p e r a t i o n s
W e n o w s h o w t h a t t h e s t a t i c o p e r a t i o n s ] , \~, [ S] c a n b e d e f i n e d
r e c u r s i v e l y o v e r CTs. R e c a l l t h a t a C T is, fom~ally, a m u l t i s e t o f
e l e m e n t s l i k e <~,f>, <6,<v,t>> o r <x,t> ; w e s h a l l c a l l s u c h
e l e m e n t s b r a n c h e s o f t h e CT. W e s h a l l o o n t e n t o u r s e l v e s w i t h a r a t h e r
infoxm~%l d e f i n i t i o n o f I , \~, [S] u s i n g p i c t u r e s o f b r a n c h e s , r a t h e r
t h a n d e f i n i n g t h e m f o r m a l l y i n temas o f m u l t i s e t s .
, I . . . . . . .
(binary operation)
I~CT L x C ~ f M CTLu M
L e t tcCTL, u e C T M. T h e n t l u
v 0
(i) F o r e a c h b r a n c h
v o v I T~
(ii) For each branch ~
/ - X
(iii) For each branch ~T
h a s t h e f o l l o w i n g brandles:
T
v I c~
" o f t, a b r a n c h
o f t, a b r a n c h
o f t, a b r a n c h
i
88
and similarly for the branches of u.
(iv) For each pair of branches
[
a branch
of t, and of u,
and similarly for brandles <~,<vj,t'>> of t and <~,vi~+ ui> of
(~nus an output branch of u selects a nm~ber of t's cempla~ntary
input branch. You should c c ~ r e this definition with crmpcsition of
STs in 2.3.)
u.
\a (unar~ operation)
\ ~ CT L c ~ { ~ , ~ }
We could give the recursive definition, but it's enough to say that t\a
is gained by pruning away all e- and ~-branches occurring anywhere
i n t .
[ S ] (unary operatic)
[S]ECT L + % , where S:L M is a relabelling.
Again it's enough to say that t[S] is gained by replacing k by Sl
everywhere in t (IEL).
If_Exercise 6.1 Give the recursive defintions of \s, IS] in the same
ii
H style as w e defined I
Now of course, w e can continue our definition of the interpretation
of behaviour programs, as follows:
Definition EBIB'~ = EB]I~B'~
~BES]] = EB][S]
Ei_~f true then B else B'] = [B~
[i_~f false then B else B'~ = [B'~
89
S i n c e o u r d e f i n i t i o n s o f ~ f o r p r o g r a m s l o o k v e r y trivial, as t h e y
should, w e m u s t r e m i n d o u r s e l v e s o f t h e p u r p o s e . W e a r e a i m i n g t o s h o w
t h a t w h e n w e a r e w o r k i n g w i t h s t r o n g e q u i v a l e n c e o f p r o g r a m s (the con-
g r u e n c e r e l a t i o n ~ d e f i n e d i n 5.7), a n d u s i n g i t s p r o p e r t i e s as
l i s t e d i n t h e o r e m s 5.3, 5.5 (but c m i t t i n g S%~n =(4), t h e a b s o r p t i o n law),
t h e n w e a r e j u s t i f i e d i n t h i n k i n ~ o f t h e p r o ~ r a r s as t h e C T s t h a t t h e y
denote; C T s a r e m e a n t p r i n c i p a l l y t o b e a h e l p f u l m e n t a l p i c t u r e , o r
v i s u a l aid.
T h e r e s t o f t h i s c h a p t e r g i v e s t h e a p p r o p r i a t e justification. B u t
f i r s t w e m u s t d e a l w i t h r e c u r s i v e l y d e f i n e d CTs.
6 3 C T s d e f i n e d b y r e c u r s i o n
A s s ~ n e as i n 5.4 t h a t o u r b e h a v i o u r i d e n t i f i e s b a r e d e f i n e d b y
c l a u s e s
b (xi,... ,x n (b)) ~ ~ '
o n e f o r e a c h b. H e r e i t w i l l b e c o n v e n i e n t t o s u p p o s e t h a t b0, bl,...
a r e t h e s e t o f identifiers, w i t h a ~ i t i e s no, nl,... , a n d w r i t e B i f o r
, s o t h a t t h e c l a u s e s a r e
i
b i ( x i , - - . , X n i ) ~ B i .
N e w w e i n t e n d t o s h c ~ t h a t t h e s e c l a u s e s define, f o r e a c h i a n d v e c t o r
= v I, ... , V n o f v a l u e s a p p r o p r i a t e f o r b i, a u n i q u e C T as t h e
1
i n t e r p r e t a t i o n o f
b i
~ h a t a r e t h e s e C T s t o b e ? W e w i l l c a l l t h e m ~ b i(9) ]. ~ h e n w e k n o w
them, w e a l s o k n e w t h e m e a n i n g o f B i { v / ~ } f o r e a c h i a n d v; this
is so b e c a u s e , b y o u r d e f i n i t i o n s [] s o far, e a d l ~Bi{v/x}~ c a n b e
r e w r i t t e n as a C T e x p r e s s i o n i n t e r m s o f ~bj ( u ) ~ f o r v a r i o u s j a n d
u. A n ~ l e w i l l m a k e t h i s clear. C o n s i d e r t h e d e f i n i n g c l a u s e
b(x) ~ = i_ff x = 0 t h e n ~ x . N I L e l s e ~y.b(y)
a n d c a l l t h e r i g h t - h a n d s i d e B o T h e n
~B{0/x}~ = ~ 0 o N I L ~ = T0 (NIL) (a C T expression)
w h i l e f o r a n y v ~ 0
~B{v/x}] = ~ y . b ( y ) ~ = ~ ( u ~ b ( y ) { u / y } ~ ) = e ( u ~ b ( u ) ~ ) ,
90
N o w w e w i s h o u r C T s b. ( v ) , f o r e a c h i a n d V , t o b e s o l u t i o n s
l
o f t h e e q u a t i o n s o v e r C T s
~bi(v) ~ = [ B i { ~ / x } ~
( t h e r e a r e v e r y m a n y s u c h e q u a t i o n s , o n e f o r e a c h p a i r i, 5 . )
L u c k i l y , w e c a n p r o v e t h e f o l l o w i n g :
Pro~x)sition 6 . 1 I f t h e h e h a v i o u r i d e n t i f i e r s b i a r e g u a r d e d l y w e l l - d e f i n e d
(see 5.4) t h e n t h e e q u a t i o n s
~bi(v) ~ = ~ B i { ~ / ~ } ]
d e f i n e a u n i q u e C T ~b. (~) ~ f o r e a d l p a i r (i,v).
1
~ f O m i t t e d .
W e c a n s e e w h y t h i s i s so, f o r o u r e x a r ~ p l e a b o v e , a s f o l l o w s .
C l e a r l y ~ b ( 0 ) ~ = 8 0 ( N I L ) = [ ~ i s u n i q u e l y d e f i n e d .
0
F o r a n y v ~ 0 w e h a v e
[ b ( v ) ] = ~ ( u ~ [ b ( u ) ] ) = [ ~
|
A ........
2
S O t h a t b y u s i n g t h e t w o e q u a t i o n s r e p e a t e d l y t h e C T ~b(v) ] f o r a n y
v c a n b e d e v e l o p e d u n a m b i g u o u s l y t o a n y d e s i r e d d e p t h .
O n t h e o t h e r h a n d , c o n s i d e r a g a i n t h e f o r b i d d e n e x a m p l e i n 5 . 4
b(x) ~ ~ x . N I L + b ( x + l ) .
F o r a n y v (a n o n - n e g a t i v e integer) w e w o u l d h a v e
~b(v) I = ~ v ( N I L ) ~b(v+l)
9 1
and if w e develop this, w e obtain the infinitely branching (forbidden')
CT for b(0) :
~b(0)~
Moreover, even if we allowed infinite branching in Cgs this w o u l d not be
a unique soluticn.
Exercise 6.2 Find another solution. (Hint: consider, if y o u k n o w
the theory of regular expressions, w h y the equation R = S R + T -
for given sets of strings S and T - does not have a unique
soluticn for R as a set of strings unless c~S, where e is the
null string. )
TO stun up; we crxsplete our interpretation of behaviour programs
as CTs b y defining unambiguously for each b
Definition ~ ( ~ ) ~ = ~ { ~ / X } ~
Remark There is a more general interpretation than CTs whidn makes sense
of unguarded recursions, but w e decided not to use it here.
6.4 Atcmic acticns and derivaticns of CTs
If we w i s h to think of behaviour programs as the CTs which they
stand for, then - for one ~ g - w e m u s t b e able to understand the
action relations ~ v over CTs in such a w a y that they hazmonize
w i t h the correslx)nding relations over programs.
W e therefore start with an independent defintion of the relations
~ v over CTs. (We c~tld use a different symbol frc~ --~ for these
relations, but it will in fact always be clear whether w e are talking
about atcmic actions of CTs or o f prograns. )
g2
Definition Let t be a CT, i.e. a multiset of pairs (as defined in
6.1). Then t has the atcmic actions
(i) t ~v) f(v) for e a c h ~ r <u,f> of t and each v of
type appropriate for u;
(ii) t ~ v t' for ead~ member <~,<v,t'>> of t;
(iii) t T ~ t' for each member <T,t'> of t.
~ i s states, for every t, exactly w h i c h pairs <t,t'> are in the
relation ..... pv ~ for every ~ and v.
II F xercise 6.3 List the atomic actions of the typical CT diagrammed in
I 6 . 1 .
IF~ercise 6.4 Prove that + ~ v t' iff either ~ v > t'
t I t 2 t 1
o r t2 ~ v t'.
Exercise 6.4 gives a hint of the h ~ y we expect between the
action relations ~ v over CTs and over prograns. For if w e recall
the rules Sum+ of 5.3, w e can rephrase them as follows:
~v B'
B I + B 2 > iff either B1 ~ V ~ B , or B 2 ~ > B '
(the 'iff' being justified by the fact that S~n+ is the only rule b y
which actions of B i + B 2 can be inferred).
Similarly, the CT ~f, which is the multiset whose only member is
<~,f>, has only the actions
ef e v > f(v) , for each v,
which we can cc~pare with the fact, frcm Act+ (1) in 5.3, that the
program ax.B has only the actions
~x.B ~ v > B{v/x}, for each v.
Exercise 6.5 Using the definition of I over CTs in 6.2, show that
the CT tllt 2 has exactly the actions
(i) t. It^ -~v t' It^ when t~ ~v t' ;
_fLY_ , ~ ,
(ii) tllt 2 tllt 2 when t 2 ' t2;
(iii) tllt 2 T t~it ~ when tl lv t~
Cc~pare Corn+ in 5.3.
~ v
!
a n d t 2 t 2 .
93
S u r e l y t h e n t h e a t o m i c a c t i o n s o f B a n d its C T [B ~ a r e c l o s e l y
related. W e s t a t e t h e r e l a t i o n in a theorem:
T h e o r e m 6.2
(i) I f B W V > B , t h e n ~ U v > ~ , ~ ;
(2) If [B~ W v > t , , t h e n f o r s a m e B', B ~ v > B , a n d [B'~ = t I.
P r o o f M a i n l y b y i n d u c t i o n o n t h e s t r u c t u r e o f B; b u t p a r t i c u l a r c a r e
is n e e d e d w h e n B = b ( 9 ) , a n d t h e asstmlotion t h a t t h e b ' s a r e g u a r d e d l y
w e l l d e f i n e d is important.
I n o t h e r w o r d s , t h e a t c m i c a c t i o n s o f [B~ a r e e x a c t l y ~B~ Wv > [B'
w h e r e B ~v >B' is a n a t o m i c a c t i o n o f B; t h i s m e a n s t h a t in c o n -
s i d e r i n g a t r m ~ c a c t i c n s , i t m a k e s n o d i f f e r e n c e w h e t h e r w e t h i n k o f
p r o g r a m s o r o f t h e C T s t h a t t h e y s t a n d for.
T h e n e x t s t e p is t o s h o w t h a t t h i s h o l d s t o o i n c o n s i d e r i n g s t r o n g
e q u i v a l e n c e .
6.5 S t r o n g e q u i v a l e n c e o f C T s
W e p r o c e e d i n t h e s a n e style; t h a t is, w e d e f i n e s t r o n g e q u i v a l e n c e
(~) o v e r C T s i n d e p e n d e n t l y , a n d t h e n s h o w h o w it h a n m o n i s e s w i t h s t r o n g
e q u i v a l e n c e o f p r o g r a m s . O u r d e f i n i t i o n is e n t i r e l y a n a l o g o u s t o t h a t o f
~ f o r p r o g r a m s (5.8) ; w e u s e a d e c r e a s i n g s e q u e n c e ~0' ~I '"" "' ~ k'""
o f e q u i v a l e n c e s :
D e f i n i t i o n t ~ 0 u is a l w a y s true;
t ~ k + l U i f f f o r a l l u , v
~ v u' t'
(i) if t ~ v . t' t h e n f o r s a m e u', u ~ a n d ~ k u';
(ii) i f u B v u' t h e n f o r s o m e t', t B v t' a n d t' ~ k u'.
t ~ u i f f V k >0.t~ku.
A l t h o u g h w e d o n ' t n e e d i t a t p r e s e n t , w e m a y as w e l l s t a t e t h e a n a ! ~
o f T h e o r e m 5.4.
T h e o r e m 6 . 3 ~ is a c o n g r u e n c e r e l a t i c n in t h e a l g e b r a o f C~s. M o r e
p r e c i s e l y , t l ~ t 2 inlolies
94
t I + u ~ t 2 + u , u + t i ~ u + t 2
~ v < t ~ ~ ~v<t21, ~ < t p ~ ~ It2~
t l I u ~ t21u, U l % ~ ult 9
t l \ ~ ~ t 2 \ ~ , t l [ S ] ~ t 2 [ S ]
and for fl (v) ~ f2 (v) ( f o r all v) i~plies ~fl ~ ~f2"
Proof Analogous to Theorem 5.4, and cmitted.
What w e do need, to ccmlolete our justification of thinking of
programs as CTs, is the following:
Theorem 6.4 B I ~ B 2 iff [ B I ~ ~ [B2].
Proof We tin/st prove separately, by induction on k, that
(i) B I ~ k B 2 implies ~BI~~k[B2];
(2) [B 1] ~ k~B2] inlolies B 1 ~ kB2 -
W e do only (i), leaving (2) as an ez~ercise. The case k=0 is trivial.
_z_rcise 6.6 9~y?
N o w asst~me (i) at k, and assl~ne B I ~ k + I B 2 , and prove [ B I ~ ~k+l[B2~.
!
Suppose ~BI] ~ v tl" Then by Theorem 6.2(2)
BI--Z~B'I for some BI,' with ~ B ~ = t'l '
So b y ass~mlotion
B 2 ~ v ~ for ~ B~, w i t h B l i p 2 ,
and by Theorem 6.2 (!)
~B 2~ ~Y- B' =
~ 2~, with t I ~B'~~~.[B'~I ~ z by inductive hypothesis.
This verifies the first clause in ~k+l's definition; the second clause
follows b y symmetry, so the inductive step for (i) is ec~iolete.
Exercise 6.7 Prove (2) by inducticm on k. Y o u will again need both
parts of Theorem 6.2; if y o u think you need only one part, then your
proof is lJ_kely to b e wrong.
95
6.6 Equality in the CT model
Can w e h a v e B I ~ B 2 but [BI~ 9 [B2~? That is, if two progr~ns are
strcngly equivalent, are their CDs perhaps always the same?
No, because for example
T.NIL + T.NIL ~ ~.NIL;
but the two ~ are T and T respectively.
But then perhaps the only difference between the CTs ~ B I ~ and [B2~,
when B I ~ B 2, is due to the fact that t + t = t is false for CTs, because
we allow the presence of identical branches.
In fact, we first thought that if we adjusted our definition of CTs
to be in terms of sets rather than multisets, then all our results so far
~Duld hold, and also we would have
B I ~ B 2 iff ~BI~ = [B2~ (?)
However, Brian Mayoh showed this to be false, with the following simple
counter-example. Suppose x is a Boolean variable, and consider the two
programs
B 1 = e.x.C 1 + ~x.C 2
B 2 = ~x (i_ff x then C 1 el__~ C2)+ ax. (if x then C 2 else C1)
where C 1 and C 2 do not ccntain x. Clearly w e have only the following
four actions for B :
BI~-~Y~Vc i , ve{true,false} and ie{1,2}
and B 2 has exactly the same four actions. So B 1
[ B ~ are different CTs:
~ B 2. But [ B I ~ and
true ~ false true ~ false
AAAAA AA
in which t i = [Ci~, it{l,2}. So in general [BI~ # [B2~ , though of course
~BI~ ~ ~B2~ b y Theorem 6.4.
We dnose to define CTs as multisets rather than sets of branches,
because it seemed that multisets are a more eoncrete intuitive model;
96
a f t e r all, t o c h e c k w h e t h e r t w o b r a n c h e s a r e i d e n t i c a l r e q u i r e s a n i n f i n i t e
a ~ o u n t o f work' B u t i t is v e r y m u c h a m a t t e r o f taste.
E v e n in t h e p r e s e n t m o d e l , m a n y e q u a l i t i e s hold. I n fact, if w e a l l o w
o u r s e l v e s t o d r o p t h e s e m a n t i c b r a c k e t s [ ~ , a n d t a k e a b e h a v i o u r p r o g r a m
t o d e n o t e a C T w i t h o u t t h i s e x t r a formality, t h e n w e s t a t e t h e following:
T h e o r e m 6 . 5 A l l t h e o o n g r u e n c e s o f T h e o r e m s 5.3, 5.5 a r e i d e n t i t i e s in
t h e C T model, e x c e p t Sty---(4) (absorption).
P r o o f Omitted. I t is a m a t t e r o f p r o v i n g t h a t t h e t w o C T s i n q u e s t i o n -
f o r e x a u p l e (BIIB 2) \~ a n d ( B l \ a ) ~ ( B 2 \ a ) ( R e s ~ (3) in T h e o r e m 5.5) -
a r e i d e n t i c a l t o d e p t h k, f o r a r b i t r a r y k (using i n d u c t i o n o n k).
I n fact, t h e i d e n t i t i e s o f T h e o r e m 5 . 3 c a n b e p r o v e d w i t h o u t a n y induction.
E x e r c i s e 6 . 8 P r o v e s o m e o f t h e i d e n t i t i e s o f T h e o r e m 5.3. A l s o p r o v e
C c m ~ (1) o f T h e o r e m 5.5 - B 1 IB 2 = B 2 1 B 1 - b y i n d u c t i o n o n depth.
T h a t is, asst~me t h a t C I l C 2 a n d C 2 1 C 1 a r e i d e n t i c a l t o d e p t h k
f o r a l l C 1,C2, t h e n s h o w t h a t t h e b r a n c h e s o f B lIB2, B 21B 1 a r e
in 1-1 c o r r e s p o n d e n c e , w i t h o o ~ d i n g b r a n c h e s i d e n t i c a l t o
d e p t h k+l.
6.7 S ~ r ~ % r y
I n t h i s c h a p t e r w e h a v e
(i) C o n s t r u c t e d C T s as a n i n t u i t i v e m o d e l o f CCS;
(ii) S h o w n that, i n c c n s i d e r i n g a t c ~ i c a c t i o n s a n d s t r c n g e q u i v a l e n c e o f
programs, w e a r e j u s t i f i e d in c c n s i d e r i n g t h e s e n o t i o n s a s t h e y a p p l y
t o t h e d e n o t e d CTs;
(iii) S h o w n t h a t m a n y u s e f u l p r o g r a m e q u i v a l e n c e laws a r e a c t u a l l y i d e n t i t i e s
f o r CTs.
W e h a v e n o t s t u d i e d t h e w i d e r r e l a t i o n o f o b s e r v a t i o n - e q u i v a l e n c e o v e r
programs. B u t it t u r n s o u t that, f o r a n y e q u i v a l e n c e r e l a t i o n whirl% is
d e f i n e d i n t e r m s o f ~ v a n d / o r ~, w e c a n t h i n k o f t h i s a l s o as as
e q u i v a l e n c e r e l a t i o n o v e r CTs.
g7
Exercise 6.9 After reading ~7.1 and 7.2 on observation equivalence
(~), define the analogous relation z over CTs. Then investigate
whether the analogue of Tneorem 6.4
B I = B 2 iff [B I ~ B 2
is true, as suggested in 5. !.
One further point should be mentioned. The syntax of CCS is such
that only a small subclass of CTs are expressible as prograns. In parti-
cular, a C T of fozm {<~,f>} can cnly be expressed by a program ~ . B
for which B, ocnsidered as a function of its free variables ~, expresses
the fanily f schematically. Now there are effectively indexed CT-families
f which cannot be represented b y CCS expressions; ccnsider for example
the family f = { ~ [ ; ioN}, and let s bind an integer variable, so
that {<~,f>} is the-e CT
I
0 i 2
whose (infinite) sort is {a,~0,yi,y2,...}. To express it in CCS we may
wish to allow labels to be parametically dependent upon values, and write
~X.~x.NIL. In more (xmplex cases ~x could also qualify a value expressicnt
or be replaced by a positive parametric label binding a variable. Such
extensions of CCS may be of real practical value. If we wish to ccnsider
them, then the theory of CTs increases in importance since it does not
co,nit us to any particular expressible subclass of CTs.
CHAPTER 7