Picturing Resources in Concurrency: from Linear to Additive - - PowerPoint PPT Presentation

picturing resources in concurrency from linear to
SMART_READER_LITE
LIVE PREVIEW

Picturing Resources in Concurrency: from Linear to Additive - - PowerPoint PPT Presentation

Picturing Resources in Concurrency: from Linear to Additive Relations Filippo Bonchi, Joshua Holland, Robin Piedeleu, Pawe l Soboci nski and Fabio Zanasi SYCO 2 Bonchi et al. Picturing Resources in Concurrency 17 Dec 2018 1 / 27


slide-1
SLIDE 1

Picturing Resources in Concurrency: from Linear to Additive Relations

Filippo Bonchi, Joshua Holland, Robin Piedeleu, Pawe l Soboci´ nski and Fabio Zanasi SYCO 2

Bonchi et al. Picturing Resources in Concurrency 17 Dec 2018 1 / 27

slide-2
SLIDE 2

Question

Process algebras vs. Petri nets

Bonchi et al. Picturing Resources in Concurrency 17 Dec 2018 2 / 27

slide-3
SLIDE 3

In this talk

We try to bridge the gap between the two approaches. ◮ Start from a simple diagrammatic language for linear dynamical systems. ◮ Give it a resource-conscious semantics by changing the domain from a field to the semiring N. ◮ Provide a sound and complete equational theory for this new semantics. ◮ Showcase the expressiveness of the calculus by embedding Petri nets with their usual operational semantics.

Bonchi et al. Picturing Resources in Concurrency 17 Dec 2018 3 / 27

slide-4
SLIDE 4

A simple graphical language

Drawing open systems

c , d , . . .

Bonchi et al. Picturing Resources in Concurrency 17 Dec 2018 4 / 27

slide-5
SLIDE 5

A simple graphical language

Drawing open systems

c , d , . . .

c X ⊆ X × X 2, d X ⊆ X × X . . . for some fixed set X.

Bonchi et al. Picturing Resources in Concurrency 17 Dec 2018 4 / 27

slide-6
SLIDE 6

A simple graphical language

Parallel composition

c d

Bonchi et al. Picturing Resources in Concurrency 17 Dec 2018 5 / 27

slide-7
SLIDE 7

A simple graphical language

Parallel composition

c d

     x1 x2

  • ,

  y1 y2 y3    

  • x1,

y1 y2

  • ∈ c X , (x2, y3) ∈ d X

  

Bonchi et al. Picturing Resources in Concurrency 17 Dec 2018 5 / 27

slide-8
SLIDE 8

A simple graphical language

Synchronising composition

c d

Bonchi et al. Picturing Resources in Concurrency 17 Dec 2018 6 / 27

slide-9
SLIDE 9

A simple graphical language

Synchronising composition

c d

  • x,

z1 z2

  • ∃y, (x, y) ∈ d X ,
  • y,

z1 z2

  • ∈ c X
  • Bonchi et al.

Picturing Resources in Concurrency 17 Dec 2018 6 / 27

slide-10
SLIDE 10

A simple graphical language

More complex networks

g d c f e

Bonchi et al. Picturing Resources in Concurrency 17 Dec 2018 7 / 27

slide-11
SLIDE 11

A simple graphical language

Only the connectivity matters

g d c f e

Bonchi et al. Picturing Resources in Concurrency 17 Dec 2018 8 / 27

slide-12
SLIDE 12

A simple graphical language

Only the connectivity matters

g d c f e

  • X

= x y

  • ,

y x

  • x, y ∈ X
  • Bonchi et al.

Picturing Resources in Concurrency 17 Dec 2018 8 / 27

slide-13
SLIDE 13

A simple graphical language

Multiple connections

g d c f e

Bonchi et al. Picturing Resources in Concurrency 17 Dec 2018 9 / 27

slide-14
SLIDE 14

A simple graphical language

Frobenius monoids

Special boxes/systems: , , , satisfying: = = = = = = = ◮ form a special commutative Frobenius monoid.

Bonchi et al. Picturing Resources in Concurrency 17 Dec 2018 10 / 27

slide-15
SLIDE 15

A simple graphical language

Interpreted as:

  • X =
  • x,

x x

  • | x ∈ X
  • X = {(x, •) | x ∈ X}
  • X =

x x

  • , x
  • | x ∈ X
  • X = {(•, x) | x ∈ X}

Bonchi et al. Picturing Resources in Concurrency 17 Dec 2018 11 / 27

slide-16
SLIDE 16

A simple graphical language

More algebraic structure

If X = R is a semiring we buy ourselves more structure: , and

r

for r ∈ R

Bonchi et al. Picturing Resources in Concurrency 17 Dec 2018 12 / 27

slide-17
SLIDE 17

A simple graphical language

More algebraic structure

If X = R is a semiring we buy ourselves more structure: , and

r

for r ∈ R

  • R =

x y

  • , x + y
  • | (x, y) ∈ R2
  • R = {(0, •)}
  • r

R = {(x, rx) | x ∈ R}

Bonchi et al. Picturing Resources in Concurrency 17 Dec 2018 12 / 27

slide-18
SLIDE 18

A simple graphical language

More algebraic structure

If X = R is a semiring we buy ourselves more structure: , and

r

for r ∈ R and tranposes for free: := and :=

r

:=

r

Bonchi et al. Picturing Resources in Concurrency 17 Dec 2018 12 / 27

slide-19
SLIDE 19

A simple graphical language

More algebraic structure

If X = R is a semiring we buy ourselves more structure: , and

r

for r ∈ R satisfying: = = = = ◮ , , , form a bimonoid.

Bonchi et al. Picturing Resources in Concurrency 17 Dec 2018 12 / 27

slide-20
SLIDE 20

A simple graphical language

More algebraic structure

If X = R is a semiring we buy ourselves more structure: , and

r

for r ∈ R satisfying:

r r

=

r

=

r r

=

r r r

=

r s

=

rs s r

=

r + s

= ◮ Encode the additive and multiplicative operations of R.

Bonchi et al. Picturing Resources in Concurrency 17 Dec 2018 12 / 27

slide-21
SLIDE 21

A simple graphical language

Adding state

◮ Introduce

x

that we interpret as a state-holding register.

Bonchi et al. Picturing Resources in Concurrency 17 Dec 2018 13 / 27

slide-22
SLIDE 22

A simple graphical language

Adding state

◮ Introduce

x

that we interpret as a state-holding register. ◮ A stateful diagram c : k → l is interpreted as a relation c ⊆ Rs+k × Rs+l where s is the number of

x

. ◮ Semantics extended inductively with

  • x

R = x y

  • ,

y x

  • x, y ∈ R
  • Bonchi et al.

Picturing Resources in Concurrency 17 Dec 2018 13 / 27

slide-23
SLIDE 23

A simple graphical language

The register is canonical

Isomorphism of props (if they are traced monoidal): Stateful diagrams c l k

=    Stateless diagrams with state-passing wires d l k s s   

Bonchi et al. Picturing Resources in Concurrency 17 Dec 2018 14 / 27

slide-24
SLIDE 24

A simple graphical language

The register is canonical

Isomorphism of props (if they are traced monoidal): Stateful diagrams c l k

=    Stateless diagrams with state-passing wires d l k s s   

x

Bonchi et al. Picturing Resources in Concurrency 17 Dec 2018 14 / 27

slide-25
SLIDE 25

A simple graphical language

The register is canonical

Isomorphism of props (if they are traced monoidal): Stateful diagrams c l k

=    Stateless diagrams with state-passing wires d l k s s    d l k

x

s → d l k s s = d l k s s

Bonchi et al. Picturing Resources in Concurrency 17 Dec 2018 14 / 27

slide-26
SLIDE 26

The Linear Interpretation

Section 2 The Linear Interpretation

Bonchi et al. Picturing Resources in Concurrency 17 Dec 2018 15 / 27

slide-27
SLIDE 27

The Linear Interpretation

The prop of linear relations

As relations over a field K:

  • K =
  • x,

x x

  • | x ∈ K
  • K = {(x, •) | x ∈ K}
  • K =

x y

  • , x + y
  • | (x, y) ∈ K2
  • K = {(0, •)}
  • r

K = {(x, rx) | x ∈ K} ◮ For a diagram c : k → l, c K is a linear subspace of Kk × Kl, i.e., a relation closed under K-linear combinations.

Bonchi et al. Picturing Resources in Concurrency 17 Dec 2018 16 / 27

slide-28
SLIDE 28

The Linear Interpretation

Complete equational theory

◮ Addition is also a special commutative Frobenius monoid: = = = = ◮ Scalars are invertible:

r r

= =

r r

for r = 0

Bonchi et al. Picturing Resources in Concurrency 17 Dec 2018 17 / 27

slide-29
SLIDE 29

The Linear Interpretation

Linear dynamical systems

For the stateful linear case: ◮ K = R[x] susbumes the notion of state we introduced. ◮ Semantics in terms of generalised streams (Laurent series). ◮ Model linear discrete-time dynamical systems (e.g., digital filters, amplifiers) ◮ Generalisation of Shannon’s signal flow graphs. ◮ Control-theory in diagrammatic terms (e.g., controllability,

  • bservability).

Bonchi et al. Picturing Resources in Concurrency 17 Dec 2018 18 / 27

slide-30
SLIDE 30

The Resource Interpretation

Section 3 The Resource Interpretation

Bonchi et al. Picturing Resources in Concurrency 17 Dec 2018 19 / 27

slide-31
SLIDE 31

The Resource Interpretation

Motivating example

x

Bonchi et al. Picturing Resources in Concurrency 17 Dec 2018 20 / 27

slide-32
SLIDE 32

The Resource Interpretation

Motivating example

x

v r s t for v = t + s

Bonchi et al. Picturing Resources in Concurrency 17 Dec 2018 20 / 27

slide-33
SLIDE 33

The Resource Interpretation

Motivating example

x

v r s t for v = t + s Over a field K, we can relate any two r and s:

  • x
  • K

= K

Bonchi et al. Picturing Resources in Concurrency 17 Dec 2018 20 / 27

slide-34
SLIDE 34

The Resource Interpretation

Motivating example

x

v r s t for v = t + s Over N, we must have s ≤ v so:

  • x
  • N

= N

Bonchi et al. Picturing Resources in Concurrency 17 Dec 2018 20 / 27

slide-35
SLIDE 35

The Resource Interpretation

Motivating example

x

v r s t for v = t + s Over N, we must have s ≤ v so:

  • x
  • N

= N

Intuition

Without additive inverses, we cannot borrow arbitrary quantities.

Bonchi et al. Picturing Resources in Concurrency 17 Dec 2018 20 / 27

slide-36
SLIDE 36

The Resource Interpretation

Motivating example

x

Over N, this diagram behaves like the place of a Petri net!

Bonchi et al. Picturing Resources in Concurrency 17 Dec 2018 21 / 27

slide-37
SLIDE 37

The Resource Interpretation

Motivating example

x

3 1 Over N, this diagram behaves like the place of a Petri net!

Bonchi et al. Picturing Resources in Concurrency 17 Dec 2018 21 / 27

slide-38
SLIDE 38

The Resource Interpretation

Motivating example

x

1 2 1 Over N, this diagram behaves like the place of a Petri net!

Bonchi et al. Picturing Resources in Concurrency 17 Dec 2018 21 / 27

slide-39
SLIDE 39

The Resource Interpretation

Motivating example

x

1 2 1 1 Over N, this diagram behaves like the place of a Petri net!

Bonchi et al. Picturing Resources in Concurrency 17 Dec 2018 21 / 27

slide-40
SLIDE 40

The Resource Interpretation

Motivating example

x

t′ 2 s′ Over N, this diagram behaves like the place of a Petri net!

Bonchi et al. Picturing Resources in Concurrency 17 Dec 2018 21 / 27

slide-41
SLIDE 41

The Resource Interpretation

Additive relations

For a diagram c : k → l, c N is an additive relation: a finitely-generated submonoid of Nk × Nl, i.e., a relation closed under addition and containing (0, 0).

Proposition

Finitely-generated additive relations form a prop, AddRel. ◮ The proof that they compose is non-trivial and relies on Dickson’s lemma.

Bonchi et al. Picturing Resources in Concurrency 17 Dec 2018 22 / 27

slide-42
SLIDE 42

The Resource Interpretation

Complete equational theory

The Resource Calculus (RC) ∼ = AddRel = = = =

Bonchi et al. Picturing Resources in Concurrency 17 Dec 2018 23 / 27

slide-43
SLIDE 43

The Resource Interpretation

Complete equational theory

The Resource Calculus (RC) ∼ = AddRel = = = = = = n n = for n = 0

Bonchi et al. Picturing Resources in Concurrency 17 Dec 2018 23 / 27

slide-44
SLIDE 44

The Resource Interpretation

Embedding Petri nets

→ With new syntactic sugar: :=

x

Bonchi et al. Picturing Resources in Concurrency 17 Dec 2018 24 / 27

slide-45
SLIDE 45

The Resource Interpretation

Embedding Petri nets

→ With new syntactic sugar: :=

x

Theorem

Firing semantics of Petri nets = semantics of corresponding diagram ◮ We can use RC to reason equationally about Petri nets.

Bonchi et al. Picturing Resources in Concurrency 17 Dec 2018 24 / 27

slide-46
SLIDE 46

The Resource Interpretation

An assembly language

We can change the usual operational semantics of Petri nets using RC. Consider, e.g,

x

→ n i

  • ,

m

  • | i + n = m + o
  • ◮ Banking semantics

Bonchi et al. Picturing Resources in Concurrency 17 Dec 2018 25 / 27

slide-47
SLIDE 47

The Resource Interpretation

In summary

◮ Started from a generic diagrammatic language. ◮ Provided a resource-conscious semantics to model concurrent phenomena, e.g., Petri nets. ◮ Axiomatised this interpretation by giving a sound and complete equational theory. ◮ Seemingly diverse computational models can be studied within the same algebraic/categorical framework.

Bonchi et al. Picturing Resources in Concurrency 17 Dec 2018 26 / 27

slide-48
SLIDE 48

The Resource Interpretation

Much more to be done

◮ Affine extension (done): discrete polyhedral relations to capture mutual exclusion and more. ◮ Coarser semantics:

◮ streams for trace equivalence, ◮ more behavioural equivalence, like bisimulation.

◮ Compositional reachability checking. ◮ Beyond Petri nets: compile process algebras into RC.

Bonchi et al. Picturing Resources in Concurrency 17 Dec 2018 27 / 27