Diagrammatic Algebra: from Linear to Concurrent Systems Filippo - - PowerPoint PPT Presentation

diagrammatic algebra from linear to concurrent systems
SMART_READER_LITE
LIVE PREVIEW

Diagrammatic Algebra: from Linear to Concurrent Systems Filippo - - PowerPoint PPT Presentation

Diagrammatic Algebra: from Linear to Concurrent Systems Filippo Bonchi, Joshua Holland, Robin Piedeleu, Pawe l Soboci nski and Fabio Zanasi PoPL 19, Cascais, Portugal Bonchi et al. From Linear to Concurrent Systems 18 Jan 2019 1 /


slide-1
SLIDE 1

Diagrammatic Algebra: from Linear to Concurrent Systems

Filippo Bonchi, Joshua Holland, Robin Piedeleu, Pawe l Soboci´ nski and Fabio Zanasi PoPL ’19, Cascais, Portugal

Bonchi et al. From Linear to Concurrent Systems 18 Jan 2019 1 / 25

slide-2
SLIDE 2

Question

Electronic Notes in Theoretical Computer Science, 2006

Process algebras vs. Petri nets

Bonchi et al. From Linear to Concurrent Systems 18 Jan 2019 2 / 25

slide-3
SLIDE 3

In this talk

Towards bridging the gap between the two approaches: ◮ Start from a compositional 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. From Linear to Concurrent Systems 18 Jan 2019 3 / 25

slide-4
SLIDE 4

A simple graphical language

Section 1 A simple graphical language

Bonchi et al. From Linear to Concurrent Systems 18 Jan 2019 4 / 25

slide-5
SLIDE 5

A simple graphical language

Drawing open systems

c , d , . . .

Bonchi et al. From Linear to Concurrent Systems 18 Jan 2019 5 / 25

slide-6
SLIDE 6

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. From Linear to Concurrent Systems 18 Jan 2019 5 / 25

slide-7
SLIDE 7

A simple graphical language

Parallel composition

c d

Bonchi et al. From Linear to Concurrent Systems 18 Jan 2019 6 / 25

slide-8
SLIDE 8

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. From Linear to Concurrent Systems 18 Jan 2019 6 / 25

slide-9
SLIDE 9

A simple graphical language

Synchronising composition

c d

Bonchi et al. From Linear to Concurrent Systems 18 Jan 2019 7 / 25

slide-10
SLIDE 10

A simple graphical language

Synchronising composition

c d

  • x,

z1 z2

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

z1 z2

  • ∈ c X
  • Bonchi et al.

From Linear to Concurrent Systems 18 Jan 2019 7 / 25

slide-11
SLIDE 11

A simple graphical language

More complex networks

g d c f e

Bonchi et al. From Linear to Concurrent Systems 18 Jan 2019 8 / 25

slide-12
SLIDE 12

A simple graphical language

Only the connectivity matters

g d c f e

Bonchi et al. From Linear to Concurrent Systems 18 Jan 2019 9 / 25

slide-13
SLIDE 13

A simple graphical language

Only the connectivity matters

g d c f e

  • X

= x y

  • ,

y x

  • x, y ∈ X
  • Bonchi et al.

From Linear to Concurrent Systems 18 Jan 2019 9 / 25

slide-14
SLIDE 14

A simple graphical language

Multiple connections

g d c f e

Bonchi et al. From Linear to Concurrent Systems 18 Jan 2019 10 / 25

slide-15
SLIDE 15

A simple graphical language

Frobenius monoids

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

Bonchi et al. From Linear to Concurrent Systems 18 Jan 2019 11 / 25

slide-16
SLIDE 16

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. From Linear to Concurrent Systems 18 Jan 2019 12 / 25

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. From Linear to Concurrent Systems 18 Jan 2019 13 / 25

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. From Linear to Concurrent Systems 18 Jan 2019 13 / 25

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. From Linear to Concurrent Systems 18 Jan 2019 13 / 25

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. From Linear to Concurrent Systems 18 Jan 2019 13 / 25

slide-21
SLIDE 21

A simple graphical language

Adding state

◮ Introduce

x

that we interpret as a state-holding register.

Bonchi et al. From Linear to Concurrent Systems 18 Jan 2019 14 / 25

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

in c. ◮ Semantics extended inductively with

  • x

R = x y

  • ,

y x

  • x, y ∈ R
  • Bonchi et al.

From Linear to Concurrent Systems 18 Jan 2019 14 / 25

slide-23
SLIDE 23

Detour: the Linear Interpretation

Section 2 Detour: the Linear Interpretation

Bonchi et al. From Linear to Concurrent Systems 18 Jan 2019 15 / 25

slide-24
SLIDE 24

Detour: the Linear Interpretation

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. From Linear to Concurrent Systems 18 Jan 2019 16 / 25

slide-25
SLIDE 25

Detour: 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. From Linear to Concurrent Systems 18 Jan 2019 17 / 25

slide-26
SLIDE 26

Detour: 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). ◮ Models linear dynamical systems (e.g., filters, amplifiers) ◮ Generalisation of Shannon’s signal flow graphs. ◮ Reformulates control-theory in diagrammatic terms (e.g., controllability, observability).

Bonchi et al. From Linear to Concurrent Systems 18 Jan 2019 18 / 25

slide-27
SLIDE 27

The Resource Interpretation

Section 3 The Resource Interpretation

Bonchi et al. From Linear to Concurrent Systems 18 Jan 2019 19 / 25

slide-28
SLIDE 28

The Resource Interpretation

Motivating example

x

Bonchi et al. From Linear to Concurrent Systems 18 Jan 2019 20 / 25

slide-29
SLIDE 29

The Resource Interpretation

Motivating example

x

s l r t → s l

  • ,

s′ r

  • ∃t

s = t + r, s′ = t + l

  • Bonchi et al.

From Linear to Concurrent Systems 18 Jan 2019 20 / 25

slide-30
SLIDE 30

The Resource Interpretation

Motivating example

x

s l r t → s l

  • ,

s′ r

  • ∃t

s = t + r, s′ = t + l

  • Over a field K, we can relate any two l and r:
  • x
  • K

= K

Bonchi et al. From Linear to Concurrent Systems 18 Jan 2019 20 / 25

slide-31
SLIDE 31

The Resource Interpretation

Motivating example

x

s l r t → s l

  • ,

s′ r

  • ∃t

s = t + r, s′ = t + l

  • Over N, we must have r ≤ s so:
  • x
  • N

= N

Bonchi et al. From Linear to Concurrent Systems 18 Jan 2019 20 / 25

slide-32
SLIDE 32

The Resource Interpretation

Motivating example

x

s l r t → s l

  • ,

s′ r

  • ∃t

s = t + r, s′ = t + l

  • Over N, we must have r ≤ s so:
  • x
  • N

= N

Intuition

Without additive inverses, we cannot borrow arbitrary quantities.

Bonchi et al. From Linear to Concurrent Systems 18 Jan 2019 20 / 25

slide-33
SLIDE 33

The Resource Interpretation

Motivating example

x

s l r t → s l

  • ,

s′ r

  • ∃t

s = t + r, s′ = t + l

  • Over N, we must have r ≤ s so:
  • x
  • N

= N ◮ This diagram behaves like the place of a Petri net!

Bonchi et al. From Linear to Concurrent Systems 18 Jan 2019 20 / 25

slide-34
SLIDE 34

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 symmetric monoidal category, AddRel. ◮ The proof that they compose is non-trivial and relies on Dickson’s lemma.

Bonchi et al. From Linear to Concurrent Systems 18 Jan 2019 21 / 25

slide-35
SLIDE 35

The Resource Interpretation

Complete equational theory

The Resource Calculus (RC) := every equation in Section I + ◮ , and , form an idempotent bimonoid: = = = = = ◮ And = =

n n

= for n = 0

Bonchi et al. From Linear to Concurrent Systems 18 Jan 2019 22 / 25

slide-36
SLIDE 36

The Resource Interpretation

Embedding Petri nets

→ With new syntactic sugar: :=

x

Bonchi et al. From Linear to Concurrent Systems 18 Jan 2019 23 / 25

slide-37
SLIDE 37

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 (de)compose Petri nets and reason equationally about their behaviour.

Bonchi et al. From Linear to Concurrent Systems 18 Jan 2019 23 / 25

slide-38
SLIDE 38

The Resource Interpretation

Moral of the story

Seemingly diverse computational models can be studied within the same algebraic/categorical framework. This is not just another process algebra, with pictures.

Bonchi et al. From Linear to Concurrent Systems 18 Jan 2019 24 / 25

slide-39
SLIDE 39

The Resource Interpretation

More coming: a graphical assembly language

◮ Affine extension (done): discrete polyhedral relations to capture non-additive phenomena like mutual exclusion. ◮ RC is strictly more expressive than Petri nets: compile other process algebras into it. ◮ Coarser semantics:

◮ trace equivalence ◮ bisimulation

◮ Compositional reachability checking.

Bonchi et al. From Linear to Concurrent Systems 18 Jan 2019 25 / 25