34
Coalgebraic Symbolic Semantics Filippo Bonchi Ugo Montanari

Coalgebraic Symbolic Semantics Filippo Bonchi Ugo Montanari

Embed Size (px)

Citation preview

Coalgebraic Symbolic Semantics

Filippo Bonchi Ugo Montanari

Many formalisms modelling Interactive Systems

Algebras - SyntaxCoalgebras - Semantics

Bialgebras – Semantics of the composite system in terms of the semantics of the components

(compositionality of final semantics)CCS [Turi, Plotkin – LICS 97]

Pi-calculus [Fiore, Turi – LICS 01] [Ferrari, Montanari, Tuosto – TCS 05]

Fusion Calculus [Ferrari et al. – CALCO 05][Miculan – MFPS 08]

… in many interesting cases, this does not work…

Mobile Ambient [Hausmann, Mossakowski, Schröder – TCS 2006]

Formalisms with asynchronous message passingPetri Nets…

Plan of the Talk

• Compositionality• Saturated Semantics• Symbolic Semantics• Saturated Coalgebras• Normalized Coalgebras

As running example, we will use Petri nets

Bonchi, Montanari – FOSSACS 08

Petri Nets

p

q

B

c

d

P is a set of placesT is a set of transitionsPre:TP

Post:TP

l:T is a labelling

Given a set A, A is the set of all multisets over A,e.g., for A={a,b} ,then A={,{a},{b},{aa},{bb},{ab} ,{aab}…}

2

a marking is a multiset over P

The semantics is quite intuitive pc qcB

Open Petri NetsPetri net + interface

a b

$

interface

Input PlacesInput Places

Output Place

ClosedPlace

Interface=(Input Places, Output Places)

Petri Nets Contexts

Petri nets + Inner interfaces + Outer Interface

a

$

c

c

c c

c c

InnerInterface

OuterInterface

a b

$

a b

$

a b

$

x3

$

Bisimilarity is not a congruence

c d

$

5

c e

x3

$

cx exC$$$

e$$$

f

They are bisimilar

They are not

x3

$

e f

$

3

Plan of the Talk

• Compositionality• Saturated Semantics• Symbolic Semantics• Saturated Coalgebras• Normalized Coalgebras

As running example, we will use Petri nets

Saturated Bisimilarity

A relation R is a saturated bisimulationiff whenever pRq, then C[-]

• If C[p]→p’ then q’ s.t. C[q]→q’ and p’Rq’• If C[q]→q’ then p’ s.t. C[p]→p’ and p’Rq’

THM: it is always the largest bisimulation congruence

Saturated Transition System

p qC[-]

C[p] q

C[-] is a context is a label

Saturated Semantics for Open NetsAt any moment of their execution a token

can be inserted into an input place and one can be removed from an output place

b

$

a

$ $$ $$$

+$ +$ +$ +$

a

aa

+a

+a

-$ -$ -$

b

b$ +$ b$$

+$

a$ a$$

a$$$

+$ +$ +$ +$

+a +a +a$

a

Running Examples

a b

$

e f

$

3

g

i

h

c d

$

5

The activation is free.The service costs 1$.

The activation costs 5$.

The service is free.

The activation costs 3$. The service is free for 3

times and then it costs 1$.

THEY ARE ALL DIFFERENT

I have 1$ and

I need 1

I have 5$ and

I need 6

Running Examples

l

q

m

$

3

n

p

o

This behaves as a or e: either the activation is free and

the service costs 1$.Or the activation costs 3$ and then for 3 times the service is

free and then it costs 1$.

IS IT DIFFERENT

FROM ALL THE PREVIOUS???

a b

$

The activation is free.The service costs 1$.

$

$

a b

$

e f

$

3

g

i

h

Plan of the Talk

• Compositionality• Saturated Semantics• Symbolic Semantics• Saturated Coalgebras• Normalized Coalgebras

As running example, we will use Petri nets

Symbolic Transition System

p qC[-]

C[p] q

C[-] is a context is a label

intuitively C[-] is “the smallest context” that allows such transition

Symbolic Transition System

a b

$

c d

$

5

e f

$

3

g

i

h

a b $

c d5$

e

f

g

h

i

3$

$

Symbolic Semanticsa symbolic LTS + a set of deduction rules

In our running example

m nm$ n$

p qD[p] ’ E[q]

p,q

Inference relation

Given a symbolic transition system and a set of deduction rules, we can infer other transitions

p qC[-] p ’ q’C’[-]

Inference relation

a b

b$$$

$$$

b$n

$n

m n

m$ n$

a b

$

Bisimilarity over the Symbolic TS is too strict

l

q

m

$

3

n

p

o

l m n o

p

3$

$

q $

a b

$

a b $

Plan of the Talk

• Compositionality• Saturated Semantics• Symbolic Semantics• Saturated Coalgebras• Normalized Coalgebras

As running example, we will use Petri nets

Category of interfaces and contexts

• Objects are interfaces• Arrows are contexts

Functors from C to Set are algebras for Г(C)SetC AlgГ(C)

One object: {$}

Arrows: -$n: {$}{$}

for our nets

Saturated Transition System as a coalgebra

Ordinary LTS having as labels ||C|| and ΛF:SetSet F(X)=(||C||ΛX)

We lift F to F: AlgГ(C) AlgГ(C)

(saturated transition system as a bialgebra)

p qC[-]

Adding the Inference Relation

An F-Coalgebra is a pair (X, :XF(X))

The set of deduction rules induces an ordering on||C||ΛX

X

a b

b$$$

$$$

b$n

$n

Saturated Coalgebras

• A set in(||C||ΛX) is saturated in X if it is closed wrt

S: AlgГ(C) AlgГ(C)

the carrier set of S(X) is the set of all saturated sets of transitions

• E.g: the saturated transition system is always an S-coalgebra

X

Saturated CoalgebrasCoalgF

CoalgS

THM: CoalgS

is a covariety of CoalgF

THM: Saturated Coalgebras are not bialgebras

1F

1S

Redundant Transitions

… … … … … …

partial order ||C||ΛX,

X

Saturated Set

Given a set A in(||C||ΛX), a transition is redundant

if it is not minimal

Normalized Set

… … … … … …

partial order ||C||ΛX,

X

Saturated Set

A set in(||C||ΛX) is normalizedif it contains only NOT redundant

transitions

Normalized Set

SaturationNormalization

Normalized Coalgebras

N: AlgГ(C) AlgГ(C)

the carrier set of N(X) is the set of all normalized sets of transitions For h:XY, the definition of N(h) is peculiar

… … … … … … … …… …

||C||ΛX, X

||C||ΛY, y

This is redundant

Running Example

l m n o

p

3$

$

q $

a b $ b$

$$b$$b$

3$

lq m

$

3

n

p

o

a b

$

Isomorphism Theorem

Proof: Saturation

and Normalization

are two natural isomorphisms

between S and N

CoalgF

CoalgS

CoalgN

Saturation Normalization

Conclusions

• Bisimilarity of Normalized Colagebras coincides with Saturated Bisimilarity

• Minimal Symbolic Automata• Symbolic Minimization Algorithm

[Bonchi, Montanari - ESOP 09]

• Coalgebraic Semantics for several formalisms (asynchronous PC, Ambients, Open nets …)

• Normalized Coalgebras are not Bialgebras

Questions?