String diagrams from control to concurrency and beyond Pawel - - PowerPoint PPT Presentation

string diagrams
SMART_READER_LITE
LIVE PREVIEW

String diagrams from control to concurrency and beyond Pawel - - PowerPoint PPT Presentation

String diagrams from control to concurrency and beyond Pawel Sobocinski Tallinn University of Technology IFIP WG 2.2 Vienna 24/09/19 Joint work with Filippo Bonchi, Fabio Zanasi and Robin Piedeleu Compositionality Syntax Semantics homomorphic


slide-1
SLIDE 1

String diagrams

from control to concurrency and beyond

Pawel Sobocinski Tallinn University of Technology IFIP WG 2.2 Vienna 24/09/19

Joint work with Filippo Bonchi, Fabio Zanasi and Robin Piedeleu

slide-2
SLIDE 2

Compositionality

  • for “nice” homomorphic translation
  • syntactic operations correspond to natural operations on

the semantic domain

  • syntax expressive enough to capture enough of the

semantic domain

  • natural notions of semantic equivalence find an

axiomatisation in the syntax

Syntax Semantics

homomorphic translation

slide-3
SLIDE 3

Our approach

  • in computer science, the tradition is to start with some

syntax and study formal semantics as a separate subject

  • we think that it is useful to reverse the process
  • start with the the algebra of the semantic domain (in

CS, control, engineering, science, mathematics, …)

  • engineer an appropriate syntax to support that algebra
slide-4
SLIDE 4

Behavioural control theory

  • J. C. Willems, The behavioural approach to open and interconnected systems: modeling by tearing, zooming, and linking,

IEEE Control Systems Magazine, 2007.

(b) (a) Tearing Linking Zooming

“Thinking of a dynamical system as a behavior, and of inter-connection as variable sharing, gets the physics right.”

  • Willems’ thesis: abandon causality and functionality (paraphrasing mine)
  • causal thinking is a disease of the brain (Russell, 1912)
  • laws of physics are seldom functional
  • functional modelling is seldom compositional
  • Willems’ tearing procedure produces relational, not functional, behaviours
slide-5
SLIDE 5

Compositionality

  • What kind of algebra?
  • first order logic, regular logic, relational algebra, datalog, allegories, …
  • What kind of relations?
  • vanilla, additive, linear, affine, …

Syntax Semantics = Relations

homomorphic translation

slide-6
SLIDE 6

Rel×

  • For Willems’ intuitions, an appropriate universe seems to be the

categorical algebra of the symmetric monoidal category Rel×

  • objects: sets X, Y, Z, ….
  • arrows: (typed) relations, R: X → Y, S: Y → Z
  • composition: relational composition

R ; S = { (x,z) | ∃y. xRy ∧ ySz}

  • monoidal product: R×R’: X×X’ → Y×Y’

R × R’ = { ((x,x’),(y,y’)) | xRy ∧ x’R’y’ }

slide-7
SLIDE 7

String diagrams

  • diagrammatic syntax for symmetric monoidal categories
  • diagrammatic reasoning: the laws of symmetric monoidal

categories are baked in to the diagrams

slide-8
SLIDE 8

Compositionality

  • syntax expressive enough?
  • axiomatisations?

String diagrams Relations

monoidal functor

slide-9
SLIDE 9

Graphical Linear Algebra

  • String diagrams generated by the following syntax

c ,

d

::= | | | | | | | | | | c

d

| c

d

The intended interpretation is that is addition, the constant zero, copy, discar

String diagrams LinRelQ

monoidal functor Sound and fully complete axiomatisation - the theory of IH (Interacting Hopf algebras)

(Bonchi, S., Zanasi, Interacting Hopf Algebras, 2014)

slide-10
SLIDE 10

Signal flow graphs

  • The IH construction is parametric wrt any PID
  • Starting with R[x] we get linear relations over its field of

fractions R(x)

  • This is yields a sound and complete equational system for

reasoning about signal flow graphs: models of computation that compute solutions of rational functions

  • F. Bonchi, P. Sobociński and F. Zanasi, "Full Abstraction for Signal Flow Graphs", In Principles of Programming Languages, POPL`15
  • F. Bonchi, P. Sobociński and F. Zanasi, "The Calculus of Signal Flow Diagrams I: Linear Relations on Streams", Inf Comput
  • B. Fong, P. Rapisarda and P. Sobociński, "A categorical approach to open and interconnected dynamical systems", LICS `16
  • F. Bonchi, J. Holland, D. Pavlovic and P. Sobociński, "Refinement for signal flow graphs", CONCUR `17
slide-11
SLIDE 11

The operational view

  • The work on signal flow graphs emphasises the

importance of the operational view

  • For signal flow graphs, the signals come from a field,

typically R or Q

n

  • !

ε

n

  • !

n n n m

  • !

n+m

ε

  • !

ε

  • !

n n n

  • !

n

ε

  • !

ε n

  • !

n n m

  • !

m n

c

a

  • !

b c0

d

b

  • !

c d0

c ; d

a

  • !

c c0 ; d0

s

a1

  • !

b1 c0

d

a2

  • !

b2 d0

c d

a1 a2

  • !

b1 b2

d0 d0 (6)

(

x

,m)

n

  • !

m (

x

,n)

Bonchi, Piedeleu, Sobocinski and Zanasi. Bialgebraic Semantics for String Diagrams. CONCUR 2019

slide-12
SLIDE 12

Example: computing Fibonacci

1-x-x2 x

=

x x x x x x x x

=

x x

=

x

=

x

=

x x x x x x

=

x x

slide-13
SLIDE 13

Graphical Diophantine Algebra

String diagrams f.g. additive relations

monoidal functor

  • Definition. An additive relation of type k->l is a subset R⊆Nk×Nl s.t. (0,0) ∈ R and, if (a,b),

(a’,b’) ∈ R then (a+a’,b+b’) ∈ R

  • An additive relation is f.g. if we can find a finite basis: i.e. every element can be

expressed as a sum of basis elements

  • These form a prop AddRel as a subprop of Rel×
  • proving f.g. additive relations are closed under composition is a cute application of

Dickson’s Lemma

Bonchi, Holland, Piedeleu, S, Zanasi. Diagrammatic algebra: from Linear to Concurrent Systems. PoPL 2019

Same syntax as before, and…. sound and fully complete axiomatisation

slide-14
SLIDE 14

From control to concurrency

  • For linear relations, adding state yielded a compositional

account of signal flow graphs

  • For additive relations, adding state yields a compositional

account of Petri nets

2 := x

  • f these diagrams, which can be compute
slide-15
SLIDE 15

Graphical Affine Algebra

  • The usual syntax extended with that “outputs 1”

String diagrams affine relations

monoidal functor Two sound and complete axiomatisations.

Bonchi, Piedeleu, Sobocinski, Zanasi. Graphical Affine Algebra. LiCS 2019

slide-16
SLIDE 16

Fun application: electrical circuits

  • Let’s go back to the R world. We will use Graphical Affine Algebra as a

sound and complete diagrammatic proof system for open circuits like:

+ – 12V 8Ω 4Ω 6Ω

1 1 2

slide-17
SLIDE 17

Compiling to string diagrams

I

k

! =

k

7 I

+ – k !

=

k

I

k

! =

k

I ✓ ◆ = I ✓ ◆ =

I ( ) =

> > : B @ C A I ( ) =

I

  • k
  • =

k x

I

  • k
  • =

k x

We can then show that

slide-18
SLIDE 18

I B @

a b

1 C A =

a b

=

a b

=

b a

=

b a

=

a+b

= I

a+b !

Current sources in parallel are additive

slide-19
SLIDE 19

Voltage sources in parallel are “illegal”

a b

=

a b

=

a b

=

a b

= =

slide-20
SLIDE 20
  • inspired by process algebra - operational playing around leads

to equations leads to denotations

  • unlike process algebra, we are not reinventing the algebraic

wheel: the basic operations for composing process are those

  • f monoidal categories
  • what most surprises me is robustness.
  • on the semantic side, the mathematics changes drastically
  • equationally, in terms of the string diagrams, we change

some basic interaction of GLA primitives

Fong, Rapisarda and Sobocinski, "A categorical approach to open and interconnected dynamical systems", LICS `16

slide-21
SLIDE 21

Compositional systems and methods

  • new compositionality group at Taltech: applications of

category theory to concurrency, control, game theory, engineering, machine learning, …

  • come and visit!!
  • SYCO 7 in Tallinn - March 30-31, 2020 - save the date!
slide-22
SLIDE 22