Variable Binding, Symmetric Monoidal Pardon Closed Theories, and - - PowerPoint PPT Presentation

variable binding symmetric monoidal
SMART_READER_LITE
LIVE PREVIEW

Variable Binding, Symmetric Monoidal Pardon Closed Theories, and - - PowerPoint PPT Presentation

Variable Binding, Symmetric Monoidal Closed Theories, and Bigraphs Garner, Hirschowitz, Variable Binding, Symmetric Monoidal Pardon Closed Theories, and Bigraphs Motivation Signatures and free smc categories Application to Richard Garner


slide-1
SLIDE 1

Variable Binding, Symmetric Monoidal Closed Theories, and Bigraphs Garner, Hirschowitz, Pardon Motivation Signatures and free smc categories Application to bigraphs

Variable Binding, Symmetric Monoidal Closed Theories, and Bigraphs

Richard Garner1 Tom Hirschowitz2 Aur´ elien Pardon3

1Cambridge University 2CNRS, Universit´

e de Savoie

3ENS Lyon

Concur ’09

slide-2
SLIDE 2

Variable Binding, Symmetric Monoidal Closed Theories, and Bigraphs Garner, Hirschowitz, Pardon Motivation Signatures and free smc categories Application to bigraphs

Motivation

◮ In the paper: elementary, algebraic approach to variable

binding in the presence of linearity.

◮ Here: additional, longer-term motivation, hoping for

your feedback.

slide-3
SLIDE 3

Variable Binding, Symmetric Monoidal Closed Theories, and Bigraphs Garner, Hirschowitz, Pardon Motivation Signatures and free smc categories Application to bigraphs

Long term goal

Obtain

◮ algebraic, ◮ geometric, and ◮ modular

models of programming languages, with

◮ a clear separation between program and execution, e.g.,

2-dimensional. What do algebraic, geometric, and modular mean?

slide-4
SLIDE 4

Variable Binding, Symmetric Monoidal Closed Theories, and Bigraphs Garner, Hirschowitz, Pardon Motivation Signatures and free smc categories Application to bigraphs

Algebra

Universal algebra < Lawvere theories < locally presentable categories / sketches.

Paradox

How algebraic is process algebra? I here mean definition of their dynamics, not behavioural theories.

slide-5
SLIDE 5

Variable Binding, Symmetric Monoidal Closed Theories, and Bigraphs Garner, Hirschowitz, Pardon Motivation Signatures and free smc categories Application to bigraphs

Geometric

Geometric models of the chosen algebraic structure? See John Baez’ talk at LICS ’09.

slide-6
SLIDE 6

Variable Binding, Symmetric Monoidal Closed Theories, and Bigraphs Garner, Hirschowitz, Pardon Motivation Signatures and free smc categories Application to bigraphs

Modular models

Montanari and colleagues (1996) and Melli` es (2002) call for modular models of programming languages.

◮ Understanding programming languages as free double

categories.

◮ Tiles, or cells, composing vertically and horizontally:

a b c d. f u v g α

◮ f and g are programs. ◮ α is an execution or a reduction. ◮ u and v are side effects, or interactions with the

environment.

slide-7
SLIDE 7

Variable Binding, Symmetric Monoidal Closed Theories, and Bigraphs Garner, Hirschowitz, Pardon Motivation Signatures and free smc categories Application to bigraphs

Modularity

Such a double category is modular when any execution of a composed program a b′ b c d f1 u f2 v g α decomposes as a b′ b c d′ d f1 u f2 v g2 g1 α1 α2 with g2g1 = g.

slide-8
SLIDE 8

Variable Binding, Symmetric Monoidal Closed Theories, and Bigraphs Garner, Hirschowitz, Pardon Motivation Signatures and free smc categories Application to bigraphs

Expected benefits

◮ Montanari et al., Sassone-Sobocinski: bisimulation is a

automatically a congruence.

◮ Melli`

es: term tracing, rewriting.

◮ Hopefully compilation.

slide-9
SLIDE 9

Variable Binding, Symmetric Monoidal Closed Theories, and Bigraphs Garner, Hirschowitz, Pardon Motivation Signatures and free smc categories Application to bigraphs

Starting point

Question

What should the horizontal category be? Or: what should program composition be?

slide-10
SLIDE 10

Variable Binding, Symmetric Monoidal Closed Theories, and Bigraphs Garner, Hirschowitz, Pardon Motivation Signatures and free smc categories Application to bigraphs

Standard answer

Category of contexts:

◮ objects: typing contexts Γ = (x : A, y : B), ◮ morphisms ∆ → Γ: assignments

[x = e, y = f ],

◮ composition by substitution:

Θ ∆ Γ. σ [x = e[σ], y = f [σ]] [x = e, y = f ]

slide-11
SLIDE 11

Variable Binding, Symmetric Monoidal Closed Theories, and Bigraphs Garner, Hirschowitz, Pardon Motivation Signatures and free smc categories Application to bigraphs

Other answers?

Do not plan to use that, for hand-waving reasons:

Duplication belongs to the dynamics

Does not model actual plugging of program fragments. Besides:

Claim, or thesis

Duplication in composition hinders geometric intuition. Hopefully: results will provide more.

slide-12
SLIDE 12

Variable Binding, Symmetric Monoidal Closed Theories, and Bigraphs Garner, Hirschowitz, Pardon Motivation Signatures and free smc categories Application to bigraphs

Linear substitution as program composition

Proposal

Linear substitution as program composition. I.e., the horizontal category is monoidal (= finite products).

slide-13
SLIDE 13

Variable Binding, Symmetric Monoidal Closed Theories, and Bigraphs Garner, Hirschowitz, Pardon Motivation Signatures and free smc categories Application to bigraphs

Linear substitution as program composition

Who tried already?

◮ Linear programming languages.

◮ No dynamic duplication either. ◮ But a nice modular model by Melli`

es, a hint that linearity favours geometric intuition.

◮ Bigraphs (Jensen, Milner, . . . ).

◮ No categorical semantics, esp. for the dynamics.

◮ Premonoidal or precartesian categories (Power,

Robinson, Schuermann, . . . ).

◮ No clear separation between program and execution. ◮ Rather models program equivalence.

slide-14
SLIDE 14

Variable Binding, Symmetric Monoidal Closed Theories, and Bigraphs Garner, Hirschowitz, Pardon Motivation Signatures and free smc categories Application to bigraphs

Linear substitution as program composition: issues

◮ First issue: can we still handle languages with

duplication? Hopefully yes: bound variables may be used several times, e.g., λx.xx.

◮ Second issue: linearity is not stable under reduction.

(λx.xx)y − → yy.

slide-15
SLIDE 15

Variable Binding, Symmetric Monoidal Closed Theories, and Bigraphs Garner, Hirschowitz, Pardon Motivation Signatures and free smc categories Application to bigraphs

Linear substitution as program composition: issues

Problem: (λx.xx)y − → yy.

Proposal

Give up reductions, use tiles: 1 1 2 1. (λx.xx)y c τ y1y2 β The map c says that y is duplicated as y1 and y2.

slide-16
SLIDE 16

Variable Binding, Symmetric Monoidal Closed Theories, and Bigraphs Garner, Hirschowitz, Pardon Motivation Signatures and free smc categories Application to bigraphs

Linear substitution as program composition: issues

Problem: (λx.xx)y − → yy.

Proposal

Give up reductions, use tiles: n 1 1 2n 2 1. (λx.xx)y c τ y1y2 f cn (f , f ) β cf The map c says that y is duplicated as y1 and y2.

slide-17
SLIDE 17

Variable Binding, Symmetric Monoidal Closed Theories, and Bigraphs Garner, Hirschowitz, Pardon Motivation Signatures and free smc categories Application to bigraphs

Contents

Sounds reasonable? Now, this paper:

◮ Linear substitution, in the horizontal category only (no

dynamics).

◮ Algebraic structure: symmetric monoidal closed (smc)

categories.

◮ Follow-up on Gadducci’s GS·Λ-theories, with:

◮ Use of recent, geometric presentation of the free smc

category (Hughes).

◮ Application to bigraphs.

slide-18
SLIDE 18

Variable Binding, Symmetric Monoidal Closed Theories, and Bigraphs Garner, Hirschowitz, Pardon Motivation Signatures and free smc categories Application to bigraphs

Signatures

Formulae from intuitionistic multiplicative linear logic (imll): A, B, . . . ∈ F(X) ::= x | I | A ⊗ B | A ⊸ B x ∈ X.

Definition

A (smc) signature is given by:

◮ a set X of sorts, and ◮ a graph Σ

s, t → → F(X).

slide-19
SLIDE 19

Variable Binding, Symmetric Monoidal Closed Theories, and Bigraphs Garner, Hirschowitz, Pardon Motivation Signatures and free smc categories Application to bigraphs

Example 1: λ-calculus, first take

◮ One sort t. ◮ Two operations (edges):

(t ⊸ t) λ → t and (t ⊗ t) · → t.

◮ Remember hoas. ◮ Here internal to some smc category.

slide-20
SLIDE 20

Variable Binding, Symmetric Monoidal Closed Theories, and Bigraphs Garner, Hirschowitz, Pardon Motivation Signatures and free smc categories Application to bigraphs

The generated smc category

◮ Any Σ freely generates an smc category S(Σ).

◮ Objects: formulae. ◮ Morphisms: imll proof nets, modulo Trimble rewiring.

◮ Example, two interpretations for λx.(12):

(t ⊸ t )⊗ t t λ · t ⊗(t ⊸ t ) t λ · .

◮ Combinatorial scoping condition generalising the

Danos-Regnier criterion for imll.

slide-21
SLIDE 21

Variable Binding, Symmetric Monoidal Closed Theories, and Bigraphs Garner, Hirschowitz, Pardon Motivation Signatures and free smc categories Application to bigraphs

Back to Example 1

◮ Linearity: cannot model λx.xx. ◮ Still:

Proposition

Morphisms I → t are in bijection with closed linear λ-terms.

slide-22
SLIDE 22

Variable Binding, Symmetric Monoidal Closed Theories, and Bigraphs Garner, Hirschowitz, Pardon Motivation Signatures and free smc categories Application to bigraphs

Example 2: λ-calculus, second take

Two sorts:

◮ t for terms, and ◮ v for variables.

Operations: (v ⊸ t) λ → t (t ⊗ t) · → t v d → t v c → v ⊗ v v w → I. Reminiscent from weak hoas and Montanari et al. (independently). This signature uses the unit I!

slide-23
SLIDE 23

Variable Binding, Symmetric Monoidal Closed Theories, and Bigraphs Garner, Hirschowitz, Pardon Motivation Signatures and free smc categories Application to bigraphs

Introducing Trimble rewiring

Identify the proof nets t λ λ d w I t λ λ d w t λ λ d w . A weakened variable is linked to anywhere inside its scope, indifferently.

slide-24
SLIDE 24

Variable Binding, Symmetric Monoidal Closed Theories, and Bigraphs Garner, Hirschowitz, Pardon Motivation Signatures and free smc categories Application to bigraphs

The need for equations

No bijection with λ-terms, e.g., λx.xxx: t λ · · c c t λ · · c c .

slide-25
SLIDE 25

Variable Binding, Symmetric Monoidal Closed Theories, and Bigraphs Garner, Hirschowitz, Pardon Motivation Signatures and free smc categories Application to bigraphs

smc theories

◮ Specify equations between morphisms of S(Σ). ◮ For the λ-calculus: equations making (v, c, w) into a

commutative comonoid object yield:

Theorem

Morphisms I → t are in bijection with closed λ-terms. Not modulo β, η, or any equation apart from α-equivalence.

slide-26
SLIDE 26

Variable Binding, Symmetric Monoidal Closed Theories, and Bigraphs Garner, Hirschowitz, Pardon Motivation Signatures and free smc categories Application to bigraphs

Higher-order

◮ Theory for Mobile Ambients. ◮ Ex 1: (a, P) → in a.P becomes in: v ⊗ t → t. ◮ Ex 2: a[P | Q]: v ⊗ t ⊗ t → t. ◮ Second-order transition: label λQ.(a[Q] | ). ◮ Expressible as:

(v ⊗ t ) ⊸ t (v ⊗ t ⊗ t ) ⊸ t [·] .

slide-27
SLIDE 27

Variable Binding, Symmetric Monoidal Closed Theories, and Bigraphs Garner, Hirschowitz, Pardon Motivation Signatures and free smc categories Application to bigraphs

A curiosity: factorisation

Proposition

For any (representative of a) proof net A

f✲ B in S(T )

with a set C of cells, and any partition of C into C1 and C2, f decomposes as f2 ◦ f1, where each fi contains exactly the cells in Ci. Example: t ⊗ t ⊗ t t · · = t ⊗ t ⊗ t ((t ⊗ t ) ⊸ t )⊗ t ⊗ t ⊗ t t · · .

slide-28
SLIDE 28

Variable Binding, Symmetric Monoidal Closed Theories, and Bigraphs Garner, Hirschowitz, Pardon Motivation Signatures and free smc categories Application to bigraphs

Bigraphs in one slide

◮ A bigraphical signature is an smc signature Σ

containing at least:

◮ two sorts t and v, ◮ operations

t ⊗ t | → t I → t v c → v ⊗ v v w → I I ν → v.

◮ The corresponding category of abstract bigraphs is

S(TΣ), where TΣ extends Σ with

◮ equations making t into a commutative monoid, ◮ equations making v into a commutative comonoid, and ◮ an equation for νa.0 ∼

= 0.

slide-29
SLIDE 29

Variable Binding, Symmetric Monoidal Closed Theories, and Bigraphs Garner, Hirschowitz, Pardon Motivation Signatures and free smc categories Application to bigraphs

Optimising the representation

E.g., with g : v ⊗ (v ⊸ t) → t and s : v ⊗ v ⊗ t → t: v ⊸ ((v ⊸ t ) ⊗ (v ⊸ t )) v ⊸ t s g s ν .

slide-30
SLIDE 30

Variable Binding, Symmetric Monoidal Closed Theories, and Bigraphs Garner, Hirschowitz, Pardon Motivation Signatures and free smc categories Application to bigraphs

Corrections

Of course, that is not exactly true nor fair, we:

◮ Forget the precategory stuff. ◮ Relax from 2nd order signatures. ◮ Add objects (t ⊸ t), but identify others (names vs.

indices).

◮ Relax the scoping discipline.

slide-31
SLIDE 31

Variable Binding, Symmetric Monoidal Closed Theories, and Bigraphs Garner, Hirschowitz, Pardon Motivation Signatures and free smc categories Application to bigraphs

Result 1

But:

◮ for any bigraphical signature Σ, ◮ letting M(Σ) denote Jensen-Milner’s category of

bigraphs:

Theorem

There is a faithful, essentially injective on objects functor T: M(Σ) → S(TΣ).

◮ Which is neither full, nor surjective on objects (see

corrections above).

slide-32
SLIDE 32

Variable Binding, Symmetric Monoidal Closed Theories, and Bigraphs Garner, Hirschowitz, Pardon Motivation Signatures and free smc categories Application to bigraphs

Result 2

And the overall scoping discipline is maintained:

Theorem

T is full on whole programs, i.e., ground bigraphs. Technically, for any object U ∈ M(Σ), we have S(TΣ)(I, T(U)) ∼ = M(Σ)(I, U).

slide-33
SLIDE 33

Variable Binding, Symmetric Monoidal Closed Theories, and Bigraphs Garner, Hirschowitz, Pardon Motivation Signatures and free smc categories Application to bigraphs

Illustration

g s s 1 b a a′ x .

slide-34
SLIDE 34

Variable Binding, Symmetric Monoidal Closed Theories, and Bigraphs Garner, Hirschowitz, Pardon Motivation Signatures and free smc categories Application to bigraphs

Illustration

v ⊸ ((v ⊸ t ) ⊗ (v ⊸ t )) v ⊸ t s g s ν (place graph vs. link graph).

slide-35
SLIDE 35

Variable Binding, Symmetric Monoidal Closed Theories, and Bigraphs Garner, Hirschowitz, Pardon Motivation Signatures and free smc categories Application to bigraphs

Conclusion

◮ smc theories adequately model syntax with variable

binding.

◮ Let’s move on to the dynamics.

Thanks for your attention.