1
Ivan LaneseComputer Science Department
University of BolognaItaly
Concurrent and located synchronizationsin π-calculus
Roadmap
Process calculi
The standard semantics of π-calculus
A new located semantics
A new concurrent semantics
Conclusions
Roadmap
Process calculi
The standard semantics of π-calculus
A new located semantics
A new concurrent semantics
Conclusions
Process calculi
Behavioral models of concurrent interacting systems Useful to analyze the properties of systems before
building them– System satisfies some properties
– Equivalence of different implementations
– Correctness of optimizations
Systems modeled as terms in a suitable algebra– Constants for basic behaviours
– Operators of composition (parallel composition, declaration of a resource, …)
Operational semantics
Allows to describe system behaviour Two styles: reduction semantics and labelled semantics Reduction semantics
– Describes the evolution of a closed system
– Easy to use and understand
– Rules of the form
Labelled semantics– Describes the interactions between the system and the
environment
– Useful to describe open systems and analyze properties
– Rules of the form P1®¡! P2
P1 ! P2
Bisimilarity ≈
Equivalence relation– Abstracts from internal details
– Equates systems indistinguishable from the outside
– Built on top of a reduction or a labelled semantics
Two processes are bisimilar if one can simulate the other (do the same actions going to bisimilar processes) and vice versa– Using reductions requires also context closure
– More distinguishing than trace equivalence
Bisimilarity is compositional if preserved by contexts– Known as “bisimilarity is a congruence” property
– Allows to substitute bisimilar processes without changing the behaviour (e.g., optimization)
≈/a ab c b c
a
Which calculus?
Different process calculi have been proposed, focused on different aspects (locations, cryptography, wireless communication, …)
We choose the π-calculus Apt to model distributed mobile systems in an easy way Used both in academia and industry
– Basis for BPEL
Easy to extend to deal with different features (spi, dPi, stochastic pi, …)
Roadmap
Process calculi
The standard semantics of π-calculus
A new located semantics
A new concurrent semantics
Conclusions
π-calculus syntax
Names a,b,x,… represent communication channels Channel names are the only data Enough to encode booleans, integers, …P ::= ab:P1 Output pre x
a(x):P1 Input pre xP1jP2 Parallel compositionP1+P2 Nondeterministic choiceºa P1 New namedeclaration!P1 Replication0 Null process
π-calculus reductions
react-S (a(x):P +M )j(ab:Q +N ) ! S P fb=xgjQ
par-SP ! S P 0
P jQ ! S P 0jQres-S
P ! S P 0
ºa P ! S ºa P 0
congr-SP1 ´ P2 ! S P 02 ´ P
01
P1 ! S P 01
≡ is an equivalence relation stating basic properties (e.g., parallel composition is associative and commutative)
Example
ºn an:P [n] a(x):bx:Q
b(x):R[x]
a
b
Example
b(x):R[x]
b
bn:QP [n]n
Example
P [n]
n
Q
R[n]
π-calculus labelled semantics
out-s ab:P ab¡! s P
sum-s¤P ®¡! s P 0
P +Q ®¡! s P 0
com-s¤P ab¡! s P 0 Q ab¡! s Q0
P jQ ¿¡! s P 0jQ0
res-sP ®¡! s P 0 a =2 n(®)
ºaP ®¡! s ºaP 0
rep-sP j!P ®¡! s P 0
!P ®¡! s P 0
inp-s a(x):P ab¡! s P fb=xg
par-s¤P ®¡! s P 0 bn(®) \ fn(Q) = ;
P jQ ®¡! s P 0jQ
close-s¤P ab¡! s P 0 Q
a(b)¡ ¡! s Q0 b=2 fn(P )
P jQ ¿¡! s ºb(P 0jQ0)
open-sP ab¡! s P 0 a 6= b
ºbPa(b)¡ ¡ ! s P 0
Observations on the standard semantics
The semantics shows inputs, outputs, and synchronizations (τ)
All the synchronizations are equal– On a restricted or on a free channel
– All free channels are equal
At each step exactly one action is performed– Concurrency indistinguishable from interleaving
We want to change these assumptions
The ideas of our approach
Many works considered locations and concurrency in π-calculus
Locations explicitly added: l::P Concurrency using mappings to other formalisms (Petri
nets, graphs, …) or complex algebraic structures (event structures, …)
We want to analyze what can be done without changing the framework– Standard π-calculus syntax– Direct semantics using standard labelled and reduction style– Trying to preserve the good properties of the standard
framework
Roadmap
Process calculi
The standard semantics of π-calculus
A new located semantics
A new concurrent semantics
Conclusions
Located synchronizations
We want to see where a synchronization is performed Different channels can have different properties
– Accounting
– Security policies
– …
π-calculus located reductions
We need labels also for reductions Labels show which (free) channel is used
react-L (a(x):P +M )j(ab:Q +N )f ag¡¡! L P fb=xgjQ
par-LP S¡! L P 0
P jQ S¡! L P 0jQres-L
P S¡! L P 0
ºa PSnf ag¡¡ ¡ ¡! L ºa P 0
congr-LP1 ´ P2
S¡! L P 02 ´ P01
P1S¡! L P 01
Properties of the located semantics
Can be expressed also using the labelled semantics– Label aτ for a synchronization on free channel a
– Label τ for a synchronization on a hidden channel
Full correspondance between reduction and labelled semantics– Reductions correspond to labelled synchronizations
– They induce the same bisimilarity» Closure under substitutions needed for labelled semantics
Located bisimilarity
Located bisimilarity refines standard one
aja¼/ L ºb(a+b)j(a+b)
aja¼S ºb(a+b)j(a+b) but
This allows to observe which channels are used For instance we can distinguish between communication
on a local network (free, safe) from communication via Internet (under accounting, unsafe)
Roadmap
Process calculi
The standard semantics of π-calculus
A new located semantics
A new concurrent semantics
Conclusions
Concurrent synchronizations
We want to see which actions can be performed concurrently
Actions can be executed concurrently provided that:– they are performed by different sequential processes
– they are executed on different channels
One concurrent transition corresponds to one or more located transitions
π-calculus concurrent reductions
Labels contain the set of used channels
react-C (a(x):P +M )j(ab:Q +N )f ag¡¡! C P fb=xgjQ
par-CP S¡! C P 0
P jQ S¡! C P 0jQres-C
P S¡! C P 0
ºa PSnf ag¡¡ ¡ ¡! C ºa P 0
comp-CP S1¡ ! C P 0 Q S2¡ ! C Q S1 \ S2 = ;
P jQ S1[ S2¡¡ ¡ ¡! C P jQ
congr-CP1 ´ P2
S¡! C P 02 ´ P01
P1S¡! C P 01
Properties of the concurrent semantics
Can be expressed also using the labelled semantics– Labels are (essentially) multisets of located labels
Full correspondance between reduction and labelled semantics– Reductions correspond to labelled synchronizations
– They induce the same bisimilarity
Concurrent bisimilarity
Concurrent bisimilarity refines the located one
but
This allows to distinguish concurrency from nondeterminism
Actions on the same channel are sequentialized
ajb¼L a:b+b:a
ajb¼/ C a:b+b:a
aja¼C a:a
Compositionality
Concurrent bisimilarity is a congruence– This allows compositional reasoning about system behaviour
– Bisimilar subcomponents can be substituted one for the other
This property does not hold for standard or located semantics– Standard and located bisimilarity not preserved by contexts
that perform substitutions
ajb¼L a:b+b:a but
bjb¼/ L b:b+b:b
Roadmap
Process calculi
The standard semantics of π-calculus
A new located semantics
A new concurrent semantics
Conclusions
Conclusions
Two new semantics for π-calculus highlighting– where synchronizations are performed
– which synchronizations can be performed concurrently
The semantics capture these behaviours– More expressive power
Many good properties of standard semantics are preserved by the extensions– Correspondance between reduction and labelled semantics
– Bisimilarities refine standard one
Additional property: concurrent bisimilarity is compositional
Future work
Further analysis on the new semantics– Weak semantics (first results in the paper)
– Analysis techniques
– Applications
Looking for semantics in the same style for other calculi Analysing the effects of more concurrency
– What happens if many actions are allowed on the same channel?
End of talk