STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09....

62
STRING DIAGRAMS AND WIRE CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09

Transcript of STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09....

Page 1: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

STRING DIAGRAMS AND WIRE CALCULUS

Pawel SobocinskiCCS ’09, Grenoble 26/11/09

Page 2: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

PLAN OF TALK

• String diagrams at work• Process calculi• Wire calculus

Page 3: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

EQUIVALENCES IN 2-CATEGORIES

• Equivalences in 2-cats

• Adjoint equivalences in 2-cats, additionally

f : X ! Yg : Y ! X ! : f g! idY

! : idX ! g f

!

!

!

!

!

!

!

!!!

!

!

!

Xf

!!

"

!

!

!

!

!

!

!!!

!

!

!

Y

X

idX""

f!! Y

g

##

idY

$$

= 1 f

Y

idY !!

g"" X

!!!!!!!

!! !!!! f

##

idX

$$

"!!!!!!

!! !!!!

Y g"" X

= 1g

Page 4: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

ADJOINT EQUIVALENCE LEMMA

• Folklore: If f : X→Y is part of an equivalence then it is part of an adjoint equivalence

• Proof:

• Need to check:

f : X ! Yg : Y ! X ! : f g! idY

! : idX ! g f

!!= f g

!"1 f g

!! f g f gf""1g

!! f g !!! idY

! f • f"!1g f • !!1 f g f • f" = 1 fg! • g f"!1g • g!!1 f g • "g = 1g

three pages of 3-dimensional diagram

chases?

Page 5: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

PASTING DIAGRAMSY

!!1!

!!!!!

!! !!!! id

"!

g

#"X

!

"""""

"

$#""""

f %$

id &% X

f'&

id &% X

"

#####

#

('####

)( "!1$$$$$$$$

f%%

%

*)%%%

%

Y id&%

g

+*

Y

Page 6: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

PASTING DIAGRAMS

• Are not always helpful:

Y

!!1!

!!!!!

!! !!!! id

"!

g

#"X

!

"""""

"

$#""""

f %$

id &% X

f'&

id &% X

"

#####

#

('####

)( "!1$$$$$$$$

f%%

%

*)%%%

%

Y id&%

g

+*

Y

Page 7: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

PASTING DIAGRAMS

• Are not always helpful:

Y

!!1!

!!!!!

!! !!!! id

"!

g

#"X

!

"""""

"

$#""""

f %$

id &% X

f'&

id &% X

"

#####

#

('####

)( "!1$$$$$$$$

f%%

%

*)%%%

%

Y id&%

g

+*

Y

! : f ! idX ! : idX ! g

XidX

!!

g""

!!

!!

## ! Xf

!!

idX""

!!

!!

## " X Xf

!!

idX""

!!

!!

## ! XidX

!!

g""

!!

!!

## " XX

f

!!!!

!!

"" !

##

g

!!

!!

"" "idX

$$ X= =

Page 8: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

STRING DIAGRAMS(Joyal & Street ‘91)

! : f ! idX ! : idX ! g

f

!"#$%&'(!

g

!"#$%&'("

XidX

!!

g""

!!

!!

## ! Xf

!!

idX""

!!

!!

## " X

f

!"#$%&'(!

!"#$%&'("g

X

f

!!!!

!!

"" !

##

g

!!

!!

"" "idX

$$ X

f

!"#$%&'(! !"#$%&'("

g

Xf

!!

idX""

!!

!!

## ! XidX

!!

g""

!!

!!

## " X

Page 9: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

ADJOINT EQ WITH STRINGS

!"#$%&'(!g!

!

!

!

!

!

ff

!"#$%&'("

f=g

!"#$%&'(!

f!!!!!!

g!"#$%&'("

g=

Page 10: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

ADJOINT EQ WITH STRINGS

!"#$%&'(!g!

!

!

!

!

!

ff

!"#$%&'("

f=g

!"#$%&'(!

f!!!!!!

g!"#$%&'("

g=

g

f!"#$%&'(!!1

g

!!!!!!

f

!"#$%&'("!1

!"#$%&'(!

!!= f g

!"1 f g

!! f g f gf""1g

!! f g !!! idY

Page 11: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

g f

!"#$%&'(!!1

g f

Page 12: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

g f

!"#$%&'(!!1

g f

!"#$%&'(!g f

!"#$%&'(!!1

g f

!"#$%&'(!!1

g f

=

Page 13: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

g f

!"#$%&'(!!1

g f

!"#$%&'(!g f

!"#$%&'(!!1

g f

!"#$%&'(!!1

g f

=

!"#$%&'(!g f

!"#$%&'(!!1

g f

!"#$%&'(!!1

g f

=

Page 14: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

g f

!"#$%&'(!!1

g f

!"#$%&'(!g f

!"#$%&'(!!1

g f

!"#$%&'(!!1

g f

=

!"#$%&'(!g f

!"#$%&'(!!1

g f

!"#$%&'(!!1

g f

=

!"#$%&'(!!1

g f g f=

Page 15: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

g f

!"#$%&'(!!1

g f

!"#$%&'(!g f

!"#$%&'(!!1

g f

!"#$%&'(!!1

g f

=

!"#$%&'(!g f

!"#$%&'(!!1

g f

!"#$%&'(!!1

g f

=

!"#$%&'(!!1

g f g f=

g

f!"#$%&'(!!1

g

!!!!!!

f

!"#$%&'("!1

!"#$%&'(!

!"#$%&'(!!1

f!

!

!

!

!

!

g

g

f!"#$%&'("!1

!"#$%&'(!

=

Page 16: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

!"#$%&'(!

fg

f

!"#$%&'("!1

g

!!!!!!

f

!"#$%&'(!!1

!"#$%&'("

Page 17: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

!"#$%&'(!

fg

f

!"#$%&'("!1

g

!!!!!!

f

!"#$%&'(!!1

!"#$%&'("

f!"#$%&'(!!1

g

!!!!!!

f

!"#$%&'("!1

!"#$%&'("

g """"

"""

f !"#$%&'(!

=

Page 18: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

!"#$%&'(!

fg

f

!"#$%&'("!1

g

!!!!!!

f

!"#$%&'(!!1

!"#$%&'("

f!"#$%&'(!!1

g

!!!!!!

f

!"#$%&'("!1

!"#$%&'("

g """"

"""

f !"#$%&'(!

= = f

Page 19: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

g

!"#$%&'(!

g

f

!"#$%&'("!1

f!

!

!

!

!

!

g!"#$%&'(!!1

!"#$%&'("

Page 20: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

g

!"#$%&'(!

g

f

!"#$%&'("!1

f!

!

!

!

!

!

g!"#$%&'(!!1

!"#$%&'("

=

!"#$%&'(!!1

f!!

!!!!

g

g

!"#$%&'("!1

!"#$%&'("

f""""

"""

g!"#$%&'(!

Page 21: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

g

!"#$%&'(!

g

f

!"#$%&'("!1

f!

!

!

!

!

!

g!"#$%&'(!!1

!"#$%&'("

=

!"#$%&'(!!1

f!!

!!!!

g

g

!"#$%&'("!1

!"#$%&'("

f""""

"""

g!"#$%&'(!

g=

Page 22: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

STRING DIAGRAMS

• apparently, a categorical trade secret for several years...

• used also to reason about arrows in monoidal categories • one object bicategory = monoidal category• one object 2-category = monoidal category with tensor

associative “on the nose”

Page 23: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

PLAN OF TALK

• String diagrams at work• Process calculi• Wire calculus

Page 24: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

PROCESS CALCULI

• CCS 80s, Pi 90s, ambients, ...• common features:

• syntactic expressions represent “processes”• dynamics a first class entity (eg prefix, + & rec in CCS)

• (structural) operational semantics• observational equivalence, (weak) bisimulation• (weak) bisimulation induces an algebra on syntactic terms

• Dijkstra-Hoare-Milner parallel composition | |

Page 25: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

ALGEBRA OF PROCESSES

• Milner’s SOS:

• what is the algebra induces by (weak) bisimilarity?• the operation | | is a commutative monoid

• ie. processes live in a “chemical soup”• is it always the case that concurrent universe = chemical soup?

• interleaving gives concurrency = nondeterminism, always reasonable?• implementation issues: | | is a very powerful scheduler

Pa−→P �

(�L)P�Q

a−→P ��Q

Qa−→Q�

(�R)P�Q

a−→P�Q�

Pa−→P � Q

a−→Q�

(Par)P�Q τ−→P ��Q�

Page 26: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

OTHER “CALCULI”

• Milner’s bigraphs• Gadducci and Montanari’s tile systems• RFC Walters’ Span(Graph)

• none of these is a process calculus in this traditional sense, ie• syntax + SOS + bisimulation congruence

Page 27: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

SHORTCOMINGS

F0 F0F1

How to model a network as below in a process calculus?

Page 28: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

SHORTCOMINGS

d ; I ⊗ (F0 ; F1 ; F0) ; e

F0 F0F1

How to model a network as below in a process calculus?

Page 29: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

PLAN OF TALK

• String diagrams at work• Process calculi• Wire calculus

Page 30: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

COMPONENTS

• Let Σ be a set of signals + silent action for int. computation • for a -transition is a labelled transition of the

form

• any process is the wire calculus has a sort and its semantics will be an LTS of -transitions

k, l ∈ N

{ }k l......P

(k, l)

P�a−→�b

Q, #(�a) = k, #(�b) = l

(k, l)(k, l)

ι

Page 31: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

ANOTHER PARALLEL COMPOSITION

• processes are boxes with left and right boundary• operators of the calculus allow us to specify & connect boxes• labels have a monoidal structure (juxtaposition)

• neither commutative nor interleaving

Pa−→b Q R

c−→d S(Ten)

P⊗Rac−→bd Q⊗S

......P

......R

Page 32: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

SYNCHRONISING ON BOUNDARY

• non commutative• don’t confuse with seq composition in imperative prog langs

Pa−→c Q R

c−→b S(Cut)

P ;Ra−→b Q;S

......R... P

Page 33: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

• CSP-like ( ) external choice

DYNAMICS - CHOICE

Pa−→b Q (ab �=ι)

(+L)P+R

a−→b Q

Pa−→b Q (ab �=ι)

(+R)R+P

a−→b Q

Pι−→ι Q R

ι−→ι S(+ι)

P+Rι−→ι Q+S

Page 34: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

DYNAMICS - RECURSION

P [µY. P/Y ]a−→b Q

(Rec)µY. P

a−→b Q

Page 35: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

DYNAMICS - PREFIX

• signals live in some set • prefix strings: • prefixes: • with in or binds free occurrences of in • substitution:

(Pref)uv P

u|σ−−→v|σP |σ

σ : bd(uv )→ Σ + {ι}

Σ

M ::= � | x | λx | ι | σ ∈ Σ | MM

λx xuv P u v P

P ::= . . . | MM P

Example: λxaλy P αa−−→β P [α/x,β/y] for all α, β ∈ Σ

Page 36: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

EXAMPLE - BASIC WIRES

(Id)I

a−→a I

(d)d−→aa d

(e)e

aa−→ e

Idef= µY. λx

λxY

edef= µY. λxλxY

ddef= µY. λxλxY

Picture Expression Behaviour

Page 37: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

CONCURRENCY RULES 1

(Refl)P

ι−→ι P

F0 F1

F0 F0 F1

Intuition: unconnected components cannotblock each other

Page 38: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

CONCURRENCY RULES 2

F0 F1

F0 F0 F1

Pι−→ι R R

a−→b Q(ιL)

Pa−→b Q

Pa−→b R R

ι−→ι Q(ιR)

Pa−→b Q

Intuition: components not assumed to run at the same speed

Page 39: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

WEAK VS STRONG ISSUES

• rules imply that ordinary (strong) bisimilarity = weak bisimilarity

(Refl)P

ι−→ι P

Pι−→ι R R

a−→b Q(ιL)

Pa−→b Q

Pa−→b R R

ι−→ι Q(ιR)

Pa−→b Q

Page 40: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

SUMMARY - THE WIRE CALCULUSP ::= Y | P ; P | P ⊗ P | M

M P | P + P | µY : τ . P

M ::= � | x | λx | ι | σ ∈ Σ

(Refl)P

ι−→ι P

Pι−→ι R R

a−→b Q(ιL)

Pa−→b Q

Pa−→b R R

ι−→ι Q(ιR)

Pa−→b Q

Pa−→c Q R

c−→b S(Cut)

P ;Ra−→b Q;S

Pa−→b Q R

c−→d S(Ten)

P⊗Rac−→bd Q⊗S

(Pref)uv P

u|σ−−→v|σP |σ

P [µY. P/Y ]a−→b Q

(Rec)µY. P

a−→b Q

Pι−→ι Q R

ι−→ι S(+ι)

P+Rι−→ι Q+S

Pa−→b Q (ab �=ι)

(+L)P+R

a−→b Q

Pa−→b Q (ab �=ι)

(+R)R+P

a−→b Q

Page 41: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

SIMPLE BISIMULATIONS

(P ; Q) ; R ∼ P ; (Q ; R)∀P : (m,n), P ; (

�n I) ∼ P ∼ (

�m I) ; P

......P...

...P......P ∼ ∼

So terms up to bisim are the arrows of a category

objects: natural numbersarrows: terms up to bisimulation

Page 42: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

SIMPLE BISIMULATIONS

(P ; Q) ; R ∼ P ; (Q ; R)∀P : (m,n), P ; (

�n I) ∼ P ∼ (

�m I) ; P

......P...

...P......P ∼ ∼

So terms up to bisim are the arrows of a category

objects: natural numbersarrows: terms up to bisimulation

(P ⊗Q)⊗R ∼ P ⊗ (Q⊗R)(P ⊗R) ; (Q⊗ S) ∼ (P ; Q)⊗ (R ; S)

......

...P Q

......

...R S

... and the category is monoidal

Page 43: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

BISIMILARITY

• is a congruence wrt all operations in the syntax

P, P � : (k, l) Q : (m, n) R : (l, l�) S : (k�, k)

P ∼ P �

......P ∼ ...

...P �

P ⊗Q ∼ P � ⊗Q...

...P

......Q

......P �

......Q

Q⊗ P ∼ Q⊗ P �

......Q

......P

......Q

......P �

P ; R ∼ P � ; R

......R... P ...

...R... P �∼

S ; P ∼ S ; P �

......

... PS ......

... P �S∼

then

Page 44: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

EXAMPLE

F0def= µY. 0

0Y + 10µZ. ( 1

1Z + 01Y ) F1

def= µZ. 11Z + 0

1µY. ( 00Y + 1

0Z)

(0set0)F0

0−→0

F0

(0set1)F0

1−→0

F1

(0Refl)F0

ι−→ι

F0

(1set1)F1

1−→1

F1

(1set0)F1

0−→1

F0

(1Refl)F1

ι−→ι

F1

d ; I ⊗ (F0 ; F1 ; F0) ; e

F0 F0F1

Expressions

Page 45: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

EXAMPLE CTD

y = 1z = 0

F0x−→z X F1

z−→y Y(Cut)

F0;F1x−→y X;Y

F0 F0F1

Y = F0

Page 46: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

EXAMPLE CTD

y = 1z = 0

F0x−→z X F1

z−→y Y(Cut)

F0;F1x−→y X;Y

F0x−→0 X F1

0−→1 F0(Cut)

F0;F1x−→1 X;F0

F0 F0F1

Y = F0

Page 47: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

EXAMPLE CTD

y = 1z = 0

F0x−→z X F1

z−→y Y(Cut)

F0;F1x−→y X;Y

F0x−→0 X F1

0−→1 F0(Cut)

F0;F1x−→1 X;F0

F0;F1x−→1 X;F0 F0

1−→0 F1(Cut)

F0;F1;F0x−→0 X;F0;F1

F0 F0F1

Y = F0

Page 48: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

EXAMPLE CTD

y = 1z = 0

F0x−→z X F1

z−→y Y(Cut)

F0;F1x−→y X;Y

F0x−→0 X F1

0−→1 F0(Cut)

F0;F1x−→1 X;F0

F0;F1x−→1 X;F0 F0

1−→0 F1(Cut)

F0;F1;F0x−→0 X;F0;F1

(⊗)I⊗(F0;F1;F0)

wx−−→w0 I⊗(X;F0;F1)

F0 F0F1

Y = F0

Page 49: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

EXAMPLE CTD

y = 1z = 0

F0x−→z X F1

z−→y Y(Cut)

F0;F1x−→y X;Y

F0x−→0 X F1

0−→1 F0(Cut)

F0;F1x−→1 X;F0

F0;F1x−→1 X;F0 F0

1−→0 F1(Cut)

F0;F1;F0x−→0 X;F0;F1

(⊗)I⊗(F0;F1;F0)

wx−−→w0 I⊗(X;F0;F1)

(Cut)(I⊗(F0;F1;F0));e

0x−→ I⊗(X;F0;F1);e

F0 F0F1

Y = F0

Page 50: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

EXAMPLE CTD

y = 1z = 0

F0x−→z X F1

z−→y Y(Cut)

F0;F1x−→y X;Y

F0x−→0 X F1

0−→1 F0(Cut)

F0;F1x−→1 X;F0

F0;F1x−→1 X;F0 F0

1−→0 F1(Cut)

F0;F1;F0x−→0 X;F0;F1

(⊗)I⊗(F0;F1;F0)

wx−−→w0 I⊗(X;F0;F1)

(Cut)(I⊗(F0;F1;F0));e

0x−→ I⊗(X;F0;F1);e

(Cut)d;(I⊗(F0;F1;F0));e−→ d;I⊗(F0;F0;F1);e

F0 F0F1

Y = F0

Page 51: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

ALGEBRA

• what is the resulting algebra?• objects = natural numbers; arrows = equivalence classes

wrt bisimilarity• a strictly associative monoidal category• and yield compact closed structure

• easy to define a directed variant of calculus• See “A non-interleaving process calculus for multi-party

synchronisation” in Proc. ICE ’09

d e

Page 52: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

RELATED WORK• related work (incomplete!):

• RFC Walters et al:• Span(Graph) - similar algebra, no SOS, dynamics not first class members of

language• Gadducci Montanari et al:

• tiles - similar algebra, same SOS for tensor and composition, dynamics not first class, less structure (more general) wrt weak issues

• Abramsky et al:• interaction categories - similar SOS for tensor and composition, much more

involved type structure• Arbab

• Reo, etc: similar modelling style but has semantic issues, “user-defined” dynamics• Stefanescu

• network algebra - monolithic, hard to tell what is primitive

Page 53: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

CONCLUSION

• Wire-calculus: a process calculus that is fundamentally different from existing calculi yet shares many of their features

• mathematically interesting algebra

• future work• expressivity issues wrt to traditional calculi• categorical structure?• continue Selinger’s work on axioms for asynchrony

Page 54: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

OTHER WIRES

(∆)∆

a−→aa ∆

(

)∆aa−→a

(���)���−→a ���

(⊥⊥⊥)⊥⊥⊥

a−→ ⊥⊥⊥

∆def= µY. λx

λxλxY

� def= µY. λxλxλx Y

⊥⊥⊥ def= µY. λxY

��� def= µY. λxY

Page 55: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

TRIVIAL BISIMULATIONS

Page 56: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

PETRI NET PLACES

� def= µY. •ι

ι•Y �• def= ι

•�

�•�

Page 57: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

ENCODING A TRANSITION

��

�•

Page 58: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

OTHER WIRES

(ΛL)Λ

a−→aι Λ

(VL)V

aι−→a V

(↓↓↓)↓↓↓

ι−→ ↓↓↓

(↑↑↑)↑↑↑−→ι ↑↑↑

↓↓↓ def= µY : (1, 0). Y

Λdef= µY. λx

λxιY + λxιλxY

Vdef= µY. λxι

λx Y + ιλxλx Y

↑↑↑ def= µY : (0, 1). Y

Page 59: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

TRIVIAL BISIMULATIONS

Page 60: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

TRANSLATING NETS

Page 61: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

FULL ABSTRACTION

Me−→M � �M� −→ �M ��

�M� −→ P

∃M �. �M �� = P & (M � = M ∨ ∃e1, . . . , em.e1−→ · · · em−−→ M �)

Page 62: STRING DIAGRAMS AND WIRE CALCULUS€¦ · CALCULUS Pawel Sobocinski CCS ’09, Grenoble 26/11/09. PLAN OF TALK • String diagrams at work • Process calculi • Wire calculus. EQUIVALENCES

BUFFERS & QUEUES (inspired by Selinger’s Axioms for Asynchrony)

def=B def= µY.B1 | Y

BB1

B

C[X]ι−→ι C[X]

σ∈Σ

C[X]σ−→ι C[X+σ] C[X+σ]

ι−→σ C[X]

Unbounded buffer

Queue

B1def= λx

ιι

λx0

Q def= µY. λxι (Y ; ι

λxI)