An Algebra of Hierarchical Graphs Roberto Bruni (joint-work with - - PowerPoint PPT Presentation

an algebra of hierarchical graphs
SMART_READER_LITE
LIVE PREVIEW

An Algebra of Hierarchical Graphs Roberto Bruni (joint-work with - - PowerPoint PPT Presentation

An Algebra of Hierarchical Graphs Roberto Bruni (joint-work with Fabio Gadducci and Alberto Lluch) Department of Computer Science, University of Pisa Software Engineering for Service-Oriented Overlay Computers TGC 2010 5th Symposium on


slide-1
SLIDE 1

An Algebra of Hierarchical Graphs

Roberto Bruni

(joint-work with Fabio Gadducci and Alberto Lluch)

Department of Computer Science, University of Pisa Software Engineering for Service-Oriented Overlay Computers

TGC 2010 5th Symposium on Trustworthy Global Computing Munich (Germany), February 24-26, 2010.

slide-2
SLIDE 2

Outline

Introduction A Running Example Hierarchical Graphs An Algebra of Hierarchical Graphs Conclusion

slide-3
SLIDE 3

Graphs are pervasive to Computer Science

Some advantages of graphs (up to isomorphism):

◮ names are helpful but inessential; ◮ element placement is helpful but inessential; ◮ connections between elements are essential

slide-4
SLIDE 4

Algebras vs Graphs in distributed systems

Goal Flexible Graph-based representation of Service oriented systems Mobile systems (names in π-calculus vs nodes in graphs) Service oriented systems sessions, transactions, ambients: which graphs for containment?

slide-5
SLIDE 5

Calculi vs Graphs

Algebraic

◮ Terms

a | b elements Graph-based

◮ Graphs (diagrams)

flat, hierarchical, etc.

slide-6
SLIDE 6

Calculi vs Graphs

Algebraic

◮ Terms

a | b

◮ Operations

·|· : W × W → W elements vocabulary Graph-based

◮ Graphs (diagrams)

flat, hierarchical, etc.

◮ Graph compositions

Union, tensor, etc.

slide-7
SLIDE 7

Calculi vs Graphs

Algebraic

◮ Terms

a | b

◮ Operations

·|· : W × W → W

◮ Axioms

x | y ≡ y | x elements vocabulary equivalence Graph-based

◮ Graphs (diagrams)

flat, hierarchical, etc.

◮ Graph compositions

Union, tensor, etc.

◮ Homomorphisms

isomorphism, etc.

slide-8
SLIDE 8

Calculi vs Graphs

Algebraic

◮ Terms

a | b

◮ Operations

·|· : W × W → W

◮ Axioms

x | y ≡ y | x

◮ Rewrite rules

a − → b elements vocabulary equivalence dynamics Graph-based

◮ Graphs (diagrams)

flat, hierarchical, etc.

◮ Graph compositions

Union, tensor, etc.

◮ Homomorphisms

isomorphism, etc.

◮ Transformation rules

slide-9
SLIDE 9

Which graphs?

slide-10
SLIDE 10

Which graphs?

slide-11
SLIDE 11

Which graphs?

slide-12
SLIDE 12

Which graphs?

slide-13
SLIDE 13

Main technical problem: representation distance

grammar, structural congruence, etc. adjacency matrix, tuples, sets, morphisms

slide-14
SLIDE 14

Main technical problem: representation distance

solution: graph algebras

slide-15
SLIDE 15

Main result: a flexible, general intermediate language

workflow language process calculus architecture description language etc. nested graphs gs-graphs bigraphs etc.

slide-16
SLIDE 16

Main result: a flexible, general intermediate language

workflow language process calculus architecture description language etc. suitable graph algebra nested graphs gs-graphs bigraphs etc.

slide-17
SLIDE 17

Outline

Introduction A Running Example Hierarchical Graphs An Algebra of Hierarchical Graphs Conclusion

slide-18
SLIDE 18

Running Example: Long running transactions

We shall consider a simple language for transactions with

◮ sequential composition; ◮ parallel (split-join) composition; ◮ compensating activity; ◮ scope of compensation.

Analogous to the Nested Sagas of [BMM05].

slide-19
SLIDE 19

Process terms and their graphical representations

task1 ; task2 ; task3

slide-20
SLIDE 20

Process terms and their graphical representations

task1 ; task2 ; task3 task1 | task2 | task3

slide-21
SLIDE 21

Process terms and their graphical representations

task1 ; task2 ; task3 task1 | task2 | task3

  • rdinary flow %

compensation flow

slide-22
SLIDE 22

Process terms and their graphical representations

task1 ; task2 ; task3 task1 | task2 | task3

  • rdinary flow %

compensation flow [ nested flow ]

slide-23
SLIDE 23

Main technical goal: mapping coherent wrt. equivalence

flow1

a | b | [ c % d ]

graph1

slide-24
SLIDE 24

Main technical goal: mapping coherent wrt. equivalence

flow1

a | b | [ c % d ]

flow2

b | [ c % d ] | a

graph1

slide-25
SLIDE 25

Main technical goal: mapping coherent wrt. equivalence

flow1

a | b | [ c % d ]

flow2

b | [ c % d ] | a

graph1 graph2

slide-26
SLIDE 26

Outline

Introduction A Running Example Hierarchical Graphs An Algebra of Hierarchical Graphs Conclusion

slide-27
SLIDE 27

Graph layers

N universe of nodes A = AE ⊎ AD universe of edges The set L of graph layers is the set of tuples G = NG, EG, tG, FG where

  • 1. EG ⊆ A is a (finite) set of edges,
  • 2. NG ⊆ N a (finite) set of nodes,
  • 3. tG : EG → N∗

G a tentacle function, and

  • 4. FG ⊆ NG a set of free nodes.

The set P ⊆ L of plain graphs contains those graph layers G such that EG ⊆ AE. (standard notion of hypergraph plus a chosen set of free nodes)

slide-28
SLIDE 28

Hierarchical graphs

The set H of hierarchical graphs is the least set containing all the tuples G = NG, EG, tG, iG, xG, rG, FG where

  • 1. NG, EG, tG, FG is a graph layer;
  • 2. iG : EG ∩ AD → H (embedding function);
  • 3. xG : EG ∩ AD → N ∗ (exposure function), s.t. for all

e ∈ EG ∩ AD

3.1 ⌊xG(e)⌋ ⊆ NiG (e) \ FiG (e), (free nodes of inner graphs not exposed) 3.2 |xG(e)| = |tG(e)|, (same arity for exposure and tentacle func.) 3.3 ∀n, m ∈ N, xG(e)[n] = xG(e)[m] iff tG(e)[n] = tG(e)[m];

  • 4. rG : EG ∩ AD → (NG ֒

→ N) is a renaming function, s.t. for all e ∈ EG ∩ AD, rG(e)(NG) = FiG (e). (for this talk, we can assume rG(e) is the ordinary inclusion)

slide-29
SLIDE 29

A hierarchical graph and its simplified representation

a graph layer (free nodes x and y)

slide-30
SLIDE 30

A hierarchical graph and its simplified representation

embedding function iG

slide-31
SLIDE 31

A hierarchical graph and its simplified representation

exposure function xG

slide-32
SLIDE 32

A hierarchical graph and its simplified representation

renaming function rG

slide-33
SLIDE 33

A hierarchical graph and its simplified representation

informal notation (free nodes x and y)

slide-34
SLIDE 34

Hierarchical graph isomorphism

The actual model of hierarchical graphs has a suitable notion of isomorphism.

slide-35
SLIDE 35

Hierarchical graph isomorphism

The actual model of hierarchical graphs has a suitable notion of isomorphism.

slide-36
SLIDE 36

Hierarchical graph morphism (formally)

Let G, H be graphs such that FG ⊆ FH. A graph morphism φ : G −

→H is a tuple φN, φE, φI where

  • 1. φN : NG → NH is a node morphism,
  • 2. φE : EG → EH an edge morphism, and
  • 3. φI = {φe | e ∈ EG ∩ AD} a family of graph morphisms

φe : iG(e)−

→iH(φE(e)) such that

3.1 ∀e ∈ EG, φN(tG(e)) = tH(φE(e)), i.e. the tentacle function is respected; 3.2 ∀e ∈ EG ∩ AD, φe

N(xG(e)) = xH(φE(e)), i.e. the exposure

function is respected; 3.3 ∀e ∈ EG ∩ AD, ∀n ∈ NG, φe

N(rG(e)(n)) = rH(φE(e))(φN(n)),

i.e. the renaming function is respected; 3.4 ∀n ∈ FG, φN(n) = n, i.e. the free nodes are preserved.

slide-37
SLIDE 37

Outline

Introduction A Running Example Hierarchical Graphs An Algebra of Hierarchical Graphs Conclusion

slide-38
SLIDE 38

The syntax of the graph algebra

G, H ::= the empty graph

slide-39
SLIDE 39

The syntax of the graph algebra

G, H ::= 0 | x a node called x

slide-40
SLIDE 40

The syntax of the graph algebra

G, H ::= 0 | x | lx an (hyper)edge labelled with l attached to x for instance, ap,q,r

slide-41
SLIDE 41

The syntax of the graph algebra

G, H ::= 0 | x | lx | G|H parallel composition: disjoint union up to common nodes for instance, ap,q,r | ap,q,r

slide-42
SLIDE 42

The syntax of the graph algebra

G, H ::= 0 | x | lx | G|H parallel composition: disjoint union up to common nodes for instance, ap,q,r | ap,q,r

slide-43
SLIDE 43

The syntax of the graph algebra

G, H ::= 0 | x | lx | G|H | (νx)G declaration of a new node x for instance, (νs) (ap,s,r | bs,q,r)

slide-44
SLIDE 44

The syntax of the graph algebra

D ::= Lx[G] G, H ::= 0 | x | lx | G|H | (νx)G graph G with interface of type L exposing x for instance, Sp,q,s[(νr)flowp, q, r, q, s]

slide-45
SLIDE 45

The syntax of the graph algebra

D ::= Lx[G] G, H ::= 0 | x | lx | G|H | (νx)G | Dy a nested graph attached to y for instance, Da,b,c

slide-46
SLIDE 46

The syntax of the graph algebra

D ::= Lx[G] G, H ::= 0 | x | lx | G|H | (νx)G | Dy a nested graph attached to y for instance, Da,b,c, with D=Sp,q,s[(νr)flowp, q, r, q, s]

slide-47
SLIDE 47

Structural congruence axioms

Isomorphism is elegantly captured by structural axioms.

G | H ≡ H | G (DA1) G | (H | I) ≡ (G | H) | I (DA2) G | 0 ≡ G (DA3)

slide-48
SLIDE 48

Structural congruence axioms

Isomorphism is elegantly captured by structural axioms.

G | H ≡ H | G (DA1) G | (H | I) ≡ (G | H) | I (DA2) G | 0 ≡ G (DA3) (νx)(νy)G ≡ (νy)(νx)G (DA4) (νx)0 ≡ (DA5) G | (νx)H ≡ (νx)(G | H) if x ∈ fn(G) (DA6)

slide-49
SLIDE 49

Structural congruence axioms

Isomorphism is elegantly captured by structural axioms.

G | H ≡ H | G (DA1) G | (H | I) ≡ (G | H) | I (DA2) G | 0 ≡ G (DA3) (νx)(νy)G ≡ (νy)(νx)G (DA4) (νx)0 ≡ (DA5) G | (νx)H ≡ (νx)(G | H) if x ∈ fn(G) (DA6) Lx[G] ≡ Ly[G{y/x}] if ⌊y⌋ ∩ fn(G) = ∅ (DA7) (νx)G ≡ (νy)G{y/x} if y ∈ fn(G) (DA8)

slide-50
SLIDE 50

Structural congruence axioms

Isomorphism is elegantly captured by structural axioms.

G | H ≡ H | G (DA1) G | (H | I) ≡ (G | H) | I (DA2) G | 0 ≡ G (DA3) (νx)(νy)G ≡ (νy)(νx)G (DA4) (νx)0 ≡ (DA5) G | (νx)H ≡ (νx)(G | H) if x ∈ fn(G) (DA6) Lx[G] ≡ Ly[G{y/x}] if ⌊y⌋ ∩ fn(G) = ∅ (DA7) (νx)G ≡ (νy)G{y/x} if y ∈ fn(G) (DA8) x | G ≡ G if x ∈ fn(G) (DA9) Lx[z | G]y ≡ z | Lx[G]y if z ∈ ⌊x⌋ (DA10)

slide-51
SLIDE 51

Structural congruence axioms

Isomorphism is elegantly captured by structural axioms.

G | H ≡ H | G (DA1) G | (H | I) ≡ (G | H) | I (DA2) G | 0 ≡ G (DA3) (νx)(νy)G ≡ (νy)(νx)G (DA4) (νx)0 ≡ (DA5) G | (νx)H ≡ (νx)(G | H) if x ∈ fn(G) (DA6) Lx[G] ≡ Ly[G{y/x}] if ⌊y⌋ ∩ fn(G) = ∅ (DA7) (νx)G ≡ (νy)G{y/x} if y ∈ fn(G) (DA8) x | G ≡ G if x ∈ fn(G) (DA9) Lx[z | G]y ≡ z | Lx[G]y if z ∈ ⌊x⌋ (DA10)

Axioms DA1–DA8 are rather standard and thus intuitive to those familiar with (nominal) process calculi.

slide-52
SLIDE 52

Encoding

The encoding ·, mapping (well-formed) terms into graphs, is the function inductively defined as (letting G = NG, EG, tG, iG, xG, rG, FG)

= ∅, ∅, ⊥, ⊥, ⊥, ⊥, ∅ x = {x}, ∅, ⊥, ⊥, ⊥, ⊥, {x} lx = ⌊x⌋, {e}, e → x, ⊥, ⊥, ⊥, ⌊x⌋ G | H = G ⊕ H (νx)G = NG, EG, tG, iG, xG, rG, FG \ x Lx[G]y = NG, {e′}, e′ → y, e′ → G ⊕ ⌊y⌋, e′ → x, e′ → idNG, (FG \ ⌊x⌋) ∪ ⌊y⌋

where e ∈ Al and e′ ∈ AL.

slide-53
SLIDE 53

Main Result

It is worth to remark that the encoding is surjective, i.e. every graph can be denoted by a term of the algebra.

Theorem

Let G be a graph. Then, there exists a well-formed term G generated by the design algebra such that G is isomorphic to G. Moreover, our encoding is sound and complete, meaning that equivalent terms are mapped to isomorphic graphs and vice versa.

Theorem

Let G1, G2 be well-formed terms generated by the design algebra. Then, G1 ≡ G2 if and only if G1 is isomorphic to G2.

slide-54
SLIDE 54

Outline

Introduction A Running Example Hierarchical Graphs An Algebra of Hierarchical Graphs Conclusion

slide-55
SLIDE 55

Concluding remarks

The approach. . .

◮ Grounds on widely-accepted models; ◮ Simplifies the graphical representation of complex systems; ◮ Hides the complexity of hierarchical graphs; ◮ Enables proofs by structural induction; ◮ Has been evaluated on various kinds of languages; ◮ Nesting and sharing features suitable for modelling SOC

features such as transactions or sessions;

◮ Experimental implementation in RL/Maude (support for

theorem proving, model checking, simulation, etc.);

◮ Offers a technique for complementing textual and visual

notations in formal tools.

slide-56
SLIDE 56

Visualizer: adr2graphs

slide-57
SLIDE 57

Related work

GS-Graphs [CG99, FM00]

◮ syntactical structure, algebraic

presentation

◮ flat (hierarchy-as-tree)

slide-58
SLIDE 58

Related work

GS-Graphs [CG99, FM00]

◮ syntactical structure, algebraic

presentation

◮ flat (hierarchy-as-tree)

Ranked Graphs [Gad03]

◮ node sharing, calculi encoding ◮ no composition interface, flat

slide-59
SLIDE 59

Related work

GS-Graphs [CG99, FM00]

◮ syntactical structure, algebraic

presentation

◮ flat (hierarchy-as-tree)

Ranked Graphs [Gad03]

◮ node sharing, calculi encoding ◮ no composition interface, flat

Hierarchical Graphs [DHP02]

◮ basic model, composition

interface

◮ no node sharing, no algebraic

syntax

slide-60
SLIDE 60

Related Work

Bigraphs [JM03]

◮ nesting + linking ◮ 2 overlapping structures,

complex syntax, no composition interface, flat

slide-61
SLIDE 61

Related Work

Bigraphs [JM03]

◮ nesting + linking ◮ 2 overlapping structures,

complex syntax, no composition interface, flat Graph Algebra, SHR [CMR94]

◮ basic algebra ◮ flat, no composition interface

slide-62
SLIDE 62

Credits and references I

[BMM05] Roberto Bruni, Hern´ an C. Melgratti, and Ugo Montanari. Theoretical foundations for compensations in flow composition languages. In Jens Palsberg and Mart´ ın Abadi, editors, POPL, pages 209–220. ACM, 2005. [CG99] Andrea Corradini and Fabio Gadducci. An algebraic presentation of term graphs, via gs-monoidal categories. applied categorical structures. Applied Categorical Structures, 7:7–299, 1999. [CMR94] Andrea Corradini, Ugo Montanari, and Francesca Rossi. An abstract machine for concurrent modular systems: CHARM. Theoretical Compututer Science, 122(1&2):165–200, 1994. [DHP02] Frank Drewes, Berthold Hoffmann, and Detlef Plump. Hierarchical graph transformation. Journal on Computer and System Sciences, 64(2):249–283, 2002. [FM00] G.L. Ferrari and U. Montanari. Tile formats for located and mobile systems.

  • Inform. and Comput., 156(1-2):173–235, 2000.

[Gad03] Fabio Gadducci. Term graph rewriting for the pi-calculus. In Atsushi Ohori, editor, Proceedings of the 1st Asian Symposium on Programming Languages and Systems, volume 2895 of Lecture Notes in Computer Science, pages 37–54. Springer, 2003. [JM03]

  • O. H. Jensen and R. Milner.

Bigraphs and mobile processes. Technical Report 570, Computer Laboratory, University of Cambridge, 2003. Note: Some figures have been borrowed from the referred papers.