Professional Documents
Culture Documents
Linearity and The Pi-Calculus: ACM Transactions On Programming Languages and Systems December 1999
Linearity and The Pi-Calculus: ACM Transactions On Programming Languages and Systems December 1999
net/publication/234779166
CITATIONS READS
289 101
3 authors, including:
Some of the authors of this publication are also working on these related projects:
All content following this page was uploaded by Benjamin C. Pierce on 20 August 2014.
5.1.1 Denition: We say that P exhibits the barb a under 2. 1P ` P 0! P 0 a 10P implies 1Q ` Q 0! Q0 a 10Q
type environment 0, written P +0a , if P has the immediate and ((10P ; P 0 ); (10Q ; Q0 )) 2 R for some Q0 ; and
possibility of performing an input or output action on the
channel a and if the type of a in 0 is such that the observer 3. 1Q ` Q 0! Q0 a 10Q implies 1P ` P 0! P 0 a 10P
can supply the other side of the communication | i.e., if it and ((10P ; P 0 ); (10Q ; Q0 )) 2 R for some P 0 .
is not the case that a is linear and both its input and output
capabilities are used by P . Formally, P +a0;a : T i one of the Two 1-remnant processes P and Q are 1-bisimilar, written
following holds P 1 Q, if ((1P ; P ); (1Q ; Q)) 2 R for some 1P ; 1Q 2
Rems (1) and some 1-bisimulation R.
1. P ( x~ :U~ ) (a![~y]f j Qg) and either T = p! [T~] or T =
!1 [T~]; or By itself, barbed bisimulation is a rather weak relation.
In order to make it interesting, we need to close it under
2. P ( x~ :U~ ) ((a?[~y]: R)f j Qg) and either T = p! [T~] or substitution and parallel composition. The resulting rela-
T = ?1 [T~]; or tion, called barbed congruence, will later be seen to be a
full congruence for all of the other process constructors.
3. P ( x~:U~ ) ((a?3 [~y]: R)f j Qg).
5.1.3 Denition: Given two type environments 1 and 0,
In each case, our assumption that all bound variables have a 1-0-substitution is a function from dom(1) to dom(0)
distinct names ensures that the channel a cannot be one of such that, for each y 2 dom(0), the type 0(y) can be written
the x~ . as (6x2dom(1)^(x)=y 1(x)) + U for some unlimited U .
Experts should note that this denition of barbs agrees
with the standard one for the full pi-calculus. Since we are Intuitively, a 1-0 substitution is one that, whenever it maps
working with an asynchronous fragment here, with output some channels x1 ; : : : ; xn 2 dom(1) to the same channel
atoms instead of output prexes, we do not actually need to y 2 dom(0), ensures that y has at least the combination of
allow observation of inputs: we could drop clauses 2 and 3 the capabilities of the x~.
of the denition and obtain a notion of observation closer to
\what processes can see about each other." We conjecture
that the theory developed in the rest of the paper would not 5.2 Congruence
be aected by this change.
5.2.1 Denition: P and Q are 1-precongruent, written
Next, we say that two processes are bisimilar if they have P p1 Q, if, for any 1-0 substitution and 2 ` R such
the same sets of observable actions and if, for each step that that 2 + 0 is well-dened, R j P 2+0 R j Q. That is, p1
one can make, the other can make a step and reach a state is the largest bisimulation closed under well-typed substi-
that is again bisimilar. tutions and parallel composition. Two 1-processes P and
The only slight complication is that we cannot require Q are 1-congruent, written P 1 Q, if P p1 Q. That is,
that the two processes be well typed in exactly the same two processes are congruent if they are precongruent and
type environment, since each linear communication removes are well typed in the same type environment.
capabilities from the type environment and we want to allow
the possibility that two processes are bisimilar even though As a simple example, it is easy to check that the pro-
they may use up their linear resources in dierent orders. cesses x![] j y ![] j x?[]:y ?[]:0 and x![] j y ![] j y?[]:x?[]:0 are con-
We deal with this by allowing the two to be typed in dif-
ferent environments, provided that both environments can gruent under the environment 1 = x : l1 []; y : l1 []. (And
be obtained by removing capabilities from some common that they are not congruent under the environment 1 =
environment. x : l! []; y : l! [].)
Formally, we rst dene what it means for an arbitrary Fortunately, closing under parallel composition and sub-
relation on pairs of processes (and associated type environ- stitution is enough: if two processes are congruent, then
ments) to be a bisimulation. Two processes are then said to placing them in any process context again yields congruent
be bisimilar if they are related by some bisimulation. Re- processes.
call that Rems (1) is the set of environments obtained from
1 by changing some bindings in 1 of the form x : p1 [T~] to 5.2.2 Theorem [Congruence]: The relation 1 is pre-
x : j1 [T~]. served by all the process constructors.
6 Weak Bisimilarity 2. 1P ` P 0! P 0 a 10P implies 1Q ` Q 0!3 Q0 a 10Q ,
with P 0 P 00 , Q0 Q00 , and ((10P ; P 00 ); (10Q ; Q00 )) 2
As usual, the denitions of strong barbed bisimulation and R for some P 00; Q0 ; Q00; and
congruence have a more useful, but somewhat more com-
plex, counterpart, called weak bisimulation, where we drop 3. 1Q ` Q 0! Q0 a 10Q implies 1P ` P 0!3 P 0 a 10P ,
the requirement that the two processes being compared must with P 0 P 00 , Q0 Q00 , and ((10P ; P 00 ); (10Q ; Q00 )) 2
proceed in lock-step and instead allow each to take zero or R for some P 0 ; P 00; Q00 .
many steps to match a single step of the other. The main
result in this section is Example 6.2.3, which formalizes the Two 1-remnant processes P and Q are weak 1-bisimilar
claim in the introduction that the two versions of the plus- up to , if 1P ; 1Q 2 Rems (1) and ((1P ; P ); (1Q ; Q)) 2 R
two process are behaviorally equivalent. where R is a weak 1-bisimulation up to .
6.1.4 Lemma: P and Q are weakly 1-bisimilar i they are
6.1 Denitions weakly 1-bisimilar up to .
The denitions of weak barbs, weak bisimulation, and weak When we prove that the given two processes are weakly
congruence are obtained from the strong ones in the stan-
dard way. The weak barbs of a process are the strong barbs barbed bisimilar, it is often hard to compare weak barbs
since we need to consider all the possible reduction sequences.
of all of its derivatives. Weak bisimulation (P 1 Q) is The following theorem allows us to compare strong barbs in-
obtained by replacing the second 0! in clauses (2) and (3) stead of weak barbs, which substantially simplies proofs of
of Denition 5.1.1 with its re
exive, transitive closure, 0!3 . weak barbed bisimilarity. Let Barbs1(P ) be the set of strong
Weak precongruence (P p1 Q) and congruence (P 1 Q) barbs of P , andWBarbs1 (P ) the set of weak barbs of P .
are formed by closing under substitution and parallel com-
position. The rened denitions read as follows: 6.1.5 Theorem: A relation
6.1.1 Denition [Weak barbed bisimulation]: A rela- R f ((1P ; P ); (1Q ; Q))
tion j 1P ; 1Q 2 Rems (1)
R f ((1P ; P ); (1Q ; Q)) ^ 1P ` P
j 1P ; 1Q 2 Rems (1) ^ 1Q ` Q g
^ 1P ` P
^ 1Q ` Q g is a weak 1-bisimulation if, whenever ((1P ; P ); (1Q ; Q)) 2
is a weak 1-bisimulation if, whenever ((1P ; P ); (1Q ; Q)) 2 R,
R, 1. Barbs1(P ) WBarbs1 (Q) and
1. 1P ` P 0!3 P 0 +1 Barbs1(Q) WBarbs1 (P )
a i 1Q ` Q 0! Q +a ;
3 0 1