connectors and concurrency joint work with ugo montanari roberto bruni dipartimento di informatica...
TRANSCRIPT
Connectors and Concurrency
joint work withUgo Montanari
Roberto BruniDipartimento di Informatica Università di Pisa
Dagstuhl Seminar #04241, September 2003
CommUnity, Tiles and Connectors
Connectors and Concurrency
Connectors modeling various kind of distributed systems and
causal histories Tile Logic
combining the use of connectors in space and time Connectors + Tiles = Dynamic Connectors
Concurrent Causal Semantics Case study:
Basic process algebra for which tile bisimilarity coincides with causal weak bisimilarity of Darondeau & Degano
Dynamic connectors for concurrency, TCS 281(1-2):131-176, 2002
CommUnity, Tiles and Connectors
joint work withJosé Luiz FiadeiroIvan LaneseAntónia LopesUgo Montanari
Roberto BruniDipartimento di Informatica Università di Pisa
Dagstuhl Seminar #04241, 6-11 June 2004
Ongoing
Work
!
CommUnity, Tiles and Connectors
Roadmap
Motivation Background
CommUnity Tiles
From CommUnity to Tiles Connectors Concluding remarks
CommUnity, Tiles and Connectors
Roadmap
Motivation Background
CommUnity Tiles
From CommUnity to Tiles Connectors Concluding remarks
CommUnity, Tiles and Connectors
Motivation I Categorical Approach
objects are system components (architectural elements)
morphisms express simulation, refinement, … complex systems are modeled as diagrams composition via universal construction (colimit) suited for systems with shared resources
memory, action, channels
CommUnity, Tiles and Connectors
Motivation II Categorical Approach Algebraic Approach
initial algebra where constants are basic processes operations compose smaller processes into larger ones structural axioms collapse structurally equivalent
processes operational semantics (SOS style) abstract semantics (bisimilarity) suited for message passing calculi
communication encoded in the labels of the LTS
CommUnity, Tiles and Connectors
Motivation III Categorical Approach Algebraic Approach Reconcile two selected representatives
CommUnity categorical approach applied to program design
Tile Model co-existence of horizontal (space) and vertical (time)
dimensions Advantages
transfer of concepts and techniques
CommUnity, Tiles and Connectors
Roadmap
Motivation Background
CommUnity Tiles
From CommUnity to Tiles Connectors Concluding remarks
CommUnity, Tiles and Connectors
CommUnity Prototype architectural description
language conceptual distinction between
computation coordination
(in communicating distributed systems) System configurations as diagrams
Components compute locally Interactions as architectural connectors
CommUnity, Tiles and Connectors
CommUnity, graphically
Program Colimit
Morphisms“Denotational Semantics”
s
CommUnity, Tiles and Connectors
CommUnity Programs
design foo isin x, zout v, ndo a: true v:= x+z | n:=v+x[] b: n>MIN n:=n-x[] c: v<MAX v:=n+z
input/output channels
actionsguards concurrent assignments
a special actions always present: : true skip
CommUnity, Tiles and Connectors
Morphsims
channels of P1 to channels of P2
actions of P2 to actions of P1
P1
P2
actions of P1
correspond todisjoint sets of actions of P2
output channels cannot be merged
(actions names are not important)
we shall focus on actions coordination
CommUnity, Tiles and Connectors
Exampledesign P1 isin … out …do a …[] b …
design P2 isin … out …do f …[] g …[] h …
design P3 isin … out …do p …[] q …[] r …[] s …
f,g a p,q,r
h b s
design P isin … out …do f|a|p …[] f|a|q …[] f|a|r …
[] g|a|p …[] g|a|q …[] g|a|r …
[] h|b|s …
CommUnity, Tiles and Connectors
Star-Shaped Diagrams
roles
cablesno output channels
actions are true skip
glue
CommUnity, Tiles and Connectors
Tile Model Operational and Abstract Semantics of
Open Concurrent Systems Compositional in Space and Time Specification Formats
Depend on chosen connectors Congruence results
Category based
CommUnity, Tiles and Connectors
parallelcomposition
Configurations
inputinterface
outputinterface
sequentialcomposition
(interfaces can be typed)
CommUnity, Tiles and Connectors
Configurations
inputinterface
outputinterface
parallelcomposition
sequentialcomposition
functoriality
CommUnity, Tiles and Connectors
Configurations
inputinterface
outputinterface
parallelcomposition
sequentialcomposition
functoriality+
symmetries=
symmetric monoidal cat
CommUnity, Tiles and Connectors
Observationsinitial
interface
finalinterface
concurrent
computation
CommUnity, Tiles and Connectors
Tiles Combine horizontal and vertical
structures through interfaces
initial configuration
final configuration
trigger effect
CommUnity, Tiles and Connectors
Tiles Compose tiles
horizontally
CommUnity, Tiles and Connectors
Tiles Compose tiles
horizontally (also vertically and in parallel)
symmetric monoidal double cat
CommUnity, Tiles and Connectors
Operational and Abstract Semantics
Structural equivalence Axioms on configurations (e.g. symmetries)
LTS states = configurations transitions = tiles labels = (trigger,effect) pairs
Abstract semantics tile bisimilarity (congruence results for suitable formats)
CommUnity, Tiles and Connectors
Roadmap
Motivation Background
CommUnity Tiles
From CommUnity to Tiles Connectors Concluding remarks
CommUnity, Tiles and Connectors
Notation Since:
Initial and Final configuration are always equal We shall consider only two kinds of observations
We use a “flat” notation for tiles1 0
CommUnity, Tiles and Connectors
From CommUnity to Tiles Aim:
To define the operational and abstract semantics of CommUnity diagrams by translating them to tiles
First step Standard decomposition of programs and diagrams
identify basic building blocks make the translation easier
Second step From standard diagrams to tiles
basic programs to basic boxes cables, glues and morphisms modeled as connectors
CommUnity, Tiles and Connectors
Results The translation of a diagram is tile bisimilar to
the translation of its colimit [IFIP-TCS 2004] Corollary: Diagrams with the same colimit are
mapped to tile bisimilar configurations Colimit axiomatization [Ongoing Work!]
add suitable axioms for connectors axioms bisimulate existence of normal forms … hopefully!
the translation of a diagram is equal up-to-axioms to the translation of its colimit
CommUnity, Tiles and Connectors
Why Standard Decomposition
Decomposition is part of the translation The translation becomes easier It is necessary to achieve Colimit
Axiomatization in the colimit, conditional assignments are
synchronized according to the diagram the axiomatization of connectors cannot change
the number of computational entities decomposition is necessary to guarantee that the
number of computational entities in the diagram is the same as the number of computational entities in the colimit
CommUnity, Tiles and Connectors
Standard Decomposition Illustrated•n output channels•m actions
•n channel managers•m guard managers•n+m cables•1 glue
P
CommUnity, Tiles and Connectors
Channel Manager
channelmanager
for x
i
i
i
i
i
i
o
one channel manager for each output variable x of P
actions
one actiontrue x:= …
for eachassignement
input channels
variables neededin assignments
output channelchannel for x
CommUnity, Tiles and Connectors
Guard Manager
guardmanager
for a
i
i
i
i
i
i
no output channel
one guard manager for each action a of P
one action
Q skip
input channels
variables neededin the guard
CommUnity, Tiles and Connectors
Glue
i
i
i
i
i
i
no output channel
input channels
all channels of P
actions
one actiontrue skip
for eachaction of P
one glue
CommUnity, Tiles and Connectors
Cables (morphisms are obvious)
one cable for each manager
i
i
i
i
i
i
no output channel
input channels
one input channelfor each
channel of the role
actions
one actiontrue skip
for eachaction of the role
CommUnity, Tiles and Connectors
Scheme of translation
channel manager
channel manager
guard manager
guard manager
……
actionsynchronization
throughconnectors
channelfusion
state
CommUnity, Tiles and Connectors
Tiles for components
channelmanager
for x
i
i
i
i
i
i
o
channelmanager
for x
i
i
i
i
i
i
o
channelmanager
for x
i
i
i
i
i
i
o
…
actions of managers are mutually exclusive, butat least one action (e.g. ) must be executed
CommUnity, Tiles and Connectors
Roadmap
Motivation Background
CommUnity Tiles
From CommUnity to Tiles Connectors Concluding remarks
CommUnity, Tiles and Connectors
Connectors Connectors are used to model diagram
morphisms, cables and glues they express constraints on local choices
Connectors with the same abstract semantics should be identified different ways of modeling the same
constraint How?
Axioms + reduction to normal form
CommUnity, Tiles and Connectors
Abstract semantics Connectors can be seen as black boxes
input interface output interface admissible signals on interfaces
12
3
4
12
3
12
3
12
3
4
CommUnity, Tiles and Connectors
Connectors can be seen as black boxes input interface output interface admissible signals on interfaces
Abstract semantics is just a matrix n inputs 2n rows m outputs 2m columns (not all matrix are interesting) sequential composition is matrix multiplication parallel composition is matrix expansion
cells are filled with empty/id copies of matrices
…
0101
0010
…
…111001…
Abstract semantics
12
3
4
12
3
12
3
12
3
4
domain is{input 3, outputs 1,2,3}
CommUnity, Tiles and Connectors
An example: Symmetries
11
10
01
00
11100100 (also identities should be considered)
=
connectors boxes are immaterial
CommUnity, Tiles and Connectors
AND-Connectors
00 01 10 11
0
1
=
=
CommUnity, Tiles and Connectors
AND-Tables andNormal Form
n = m = 0 or 0 < n m entry with empty domain is enabled
only one entry with empty input/outputs entries are closed under (domains)
union intersection difference complementation
at most one entry enabled for every row/column exactly one entry for every row
… …
CommUnity, Tiles and Connectors
co-AND-Connectors
01
00
10
=
11
10
=
(as AND-table, but transposed)
CommUnity, Tiles and Connectors
Mixed-AND-Connectors
=
=
CommUnity, Tiles and Connectors
Mixed-AND-Connectors
=
=
CommUnity, Tiles and Connectors
Mixed-AND-Connectors
=
=
=
CommUnity, Tiles and Connectors
Mixed-AND-Connectors
=
=
=
CommUnity, Tiles and Connectors
Mixed-AND-Connectors
=
=
=
CommUnity, Tiles and Connectors
n = m = 0 or 0 < n,m entry with empty domain is enabled
only one entry with empty input/outputs entries are closed under (domains)
union intersection difference complementation
at most one entry enabled for every row/column exactly one entry for every row
Mixed-AND-Tables andNormal Form
… ……
CommUnity, Tiles and Connectors
(co-)HIDE-Connectors!
!
1
0
.
.
10
!
!
=!
=
!!
=!! .
CommUnity, Tiles and Connectors
A Relevant Difference
!
!
!01
00
.
11
10
01
00
.
11
10
!
!
!
CommUnity, Tiles and Connectors
A Sample Proof!
!
!
!
!
=
=
=
CommUnity, Tiles and Connectors
SYNC-Tables and Normal Form
n = m = 0 or 0 < n,m entry with empty domain is enabled
only one entry with empty input/outputs entries are closed under (domains)
union intersection difference complementation
at most one entry enabled for every row/column exactly one entry for every row
!
!
… ……
…
CommUnity, Tiles and Connectors
(co-)MEX-Connectors
00 01 10 11
0
1
=
=
CommUnity, Tiles and Connectors
Mixed-MEX-Connectors
=
CommUnity, Tiles and Connectors
Mixed-MEX-Connectors
=
CommUnity, Tiles and Connectors
Mixed-MEX-Connectors
=
CommUnity, Tiles and Connectors
Mixed-MEX-Connectors
=
CommUnity, Tiles and Connectors
Mixed-MEX-Connectors
=
CommUnity, Tiles and Connectors
(co-)ZERO-Connectors
=
1
0
10
1
0
11100100
01
00
10
11
10
=x
= !0def
.
10
0
CommUnity, Tiles and Connectors
Some Axioms About ZERO
=
0
0
= =0
0=0
0
=0
!0! 0 = . =
0
CommUnity, Tiles and Connectors
A Sample Proof
00 = ! 0
= !
0
0
= .
!=0
CommUnity, Tiles and Connectors
Some Axioms About MEX-AND
=
=
CommUnity, Tiles and Connectors
Key Axioms
CommUnity, Tiles and Connectors
Key Axioms
= !
! = !
!
!
CommUnity, Tiles and Connectors
An Axiom Scheme
!
! !
!
… …
CommUnity, Tiles and Connectors
An Axiom Scheme
! !
! !
… …
CommUnity, Tiles and Connectors
n = m = 0 or 0 < n,m entry with empty domain is enabled
only one entry with empty input/outputs entries are closed under (domains)
union intersection difference complementation
at most one entry enabled for every row/column exactly one entry for every row
FULL-Tables and Normal Form
!
……
……
!
…
…
…!
CommUnity, Tiles and Connectors
(co-)ONE-Connector
.
10
1
All tables can now be defined, but “negation” is introduced… … and “inconsistent” connectors with it!
ONE is not needed for CommUnity
!
1
=def
CommUnity, Tiles and Connectors
Roadmap
Motivation Background
CommUnity Tiles
From CommUnity to Tiles Connectors Concluding remarks
CommUnity, Tiles and Connectors
Concluding Remarks We have learned that reconciling the
categorical and algebraic approach is not an easy task…
We got some insights on further extensions more labels, weights
Related to constraint solving flownomials (Cazanescu, Stefanescu), bicategories
of relations (Carboni, Walters), gs-monoidal cats (Corradini, Gadducci), sharing graphs (Hasegawa), action structures and named calculi (Milner, Gardner)