Introduction to Algebraic Graph Transformation Fernando Orejas - - PowerPoint PPT Presentation

introduction to algebraic graph transformation
SMART_READER_LITE
LIVE PREVIEW

Introduction to Algebraic Graph Transformation Fernando Orejas - - PowerPoint PPT Presentation

Introduction to Algebraic Graph Transformation Fernando Orejas Royal Holloway University of London on leave from Universitat Politcnica de Catalunya, Barcelona Lecture 1: Basic Notions in Graph Transformation Lecture 2: Fundamental


slide-1
SLIDE 1

Introduction to Algebraic Graph Transformation

Fernando Orejas

Royal Holloway University of London

  • n leave from Universitat Politècnica de Catalunya, Barcelona
slide-2
SLIDE 2
  • Lecture 1: Basic Notions in Graph Transformation
  • Lecture 2: Fundamental Theory of GT
  • Lecture 3: Conditional Graph Transformation
  • Lecture 4: Model Transformation by Triple Graph

Grammars

slide-3
SLIDE 3
  • 1. Introduction
  • 2. The basic case
  • 3. Generalizing Graph Transformation
  • 4. Variations
  • 5. Extensions
slide-4
SLIDE 4

Introduction

slide-5
SLIDE 5

Origins of Graph Transformation (1969): Generalization of Chomsky Grammars

slide-6
SLIDE 6

Chomsky Grammars: A AA B AA B B A B

slide-7
SLIDE 7

Term Rewriting: f(x) Chomsky Grammars: A AA B AA B B A B f(f(x)) h( f(f(a) ) h( f(a) )

slide-8
SLIDE 8

Term Rewriting: f(x) A A A A B B B B A A

?

Chomsky Grammars: A AA B AA B B A B Graph Grammars f(f(x)) h( f(f(a) ) h( f(a) )

slide-9
SLIDE 9

– What kind of graphs? – What kind of transformations – How do we describe transformations

slide-10
SLIDE 10

– What kind of graphs? Any kind (and more) – What kind of transformations Replacing subgraphs by subgraphs – How do we describe transformations Algebraic double pushout approach

slide-11
SLIDE 11

The basic case

slide-12
SLIDE 12

A graph G1 consists of:

  • V: nodes
  • E: edges
  • source: E → V
  • target: E → V
slide-13
SLIDE 13

A graph morphism h: G1 → G2 consists:

  • hV: V1 → V2
  • hE : E1 → E2

such that

  • 1. hV(source1(e1)) = source2(hE (e1))
  • 2. hV(target1(e1)) = target2(hE (e1))
slide-14
SLIDE 14

– What is a graph transformation rule? – How do we apply a rule?

slide-15
SLIDE 15

Double Pushout Graph Transformation Rules

K L R l r

p = Rules

slide-16
SLIDE 16

A graph transformation rule:

slide-17
SLIDE 17

Rule Application

m L K G l R r

slide-18
SLIDE 18

Rule Application

  • 1. D = G \ m(L\K) is a pushout complement

l’ m L D K G d l R r (1)

slide-19
SLIDE 19

Rule Application

  • 2. The result is H = D + (R\K)

l’ m L D K G d l r’ H R m’ r (1) (2)

(1) and (2) are pushouts

slide-20
SLIDE 20
slide-21
SLIDE 21
slide-22
SLIDE 22
slide-23
SLIDE 23
slide-24
SLIDE 24
slide-25
SLIDE 25

Gluing Conditions

slide-26
SLIDE 26

Gluing Conditions

?

slide-27
SLIDE 27

Gluing Conditions

slide-28
SLIDE 28

?

Gluing Conditions

slide-29
SLIDE 29
  • Identification Condition

For every x1,x2 in VL∪ EL, if m(x1) = m(x2) then: x1 ∈ K iff x2 ∈ K.

  • Dangling Edge Condition

For every e in EG\m(EL) if source(e) or target(e) have a pre- image in VL then they also have it in KL

slide-30
SLIDE 30

Theorem: Given

m L K G l

There is a pushout complement if and only if the identification and the dangling edge conditions hold. Moreover, this pushout complement is unique.

slide-31
SLIDE 31

Generalizing Graph Transformation

slide-32
SLIDE 32

A category C is adhesive if:

  • 1. C has pushouts over monomorphisms. Moreover

monomorphisms are closed by pullbacks and pushouts.

  • 2. C has pullbacks
  • 3. Pushouts over monomorphisms are Van Kampen

squares. Adhesive Categories (Lack and Sobocinski)

slide-33
SLIDE 33

A pushout is a Van Kampen Square if for every commutative cube, where we have the pushout in the bottom square and the back squares are pullbacks, we have that the top square is a pushout if and only if the front squares are pullbacks: C' A' B' D' C A B D Adhesive Categories (Lack and Sobocinski)

slide-34
SLIDE 34
  • Complements of pushout along monos are unique
  • Pushouts along monos are pullbacks
  • If C1 and C2 are adhesive so is C1xC2
  • If C is adhesive so are the slice, co-slice and functor

categories over C Properties of Adhesive Categories

slide-35
SLIDE 35

C U B' A C B D Complements of pushout along monos are unique

A C D B po A C D B' po

C

slide-36
SLIDE 36
  • C has epi-mono pair factorization if for every pair

morphisms f1 and f2, there is an object K, jointly epimorphic morphisms e1 and e2, and a monomorphism m, such that the diagram above commutes Constructions over Adhesive Categories A1 A2 C e1 f1 m f2 K e2

slide-37
SLIDE 37
  • C has initial pushouts along monomorphisms if for every

morphism m, there is an initial pushout BCAA' along a monomorphism r: Constructions over Adhesive Categories

D1 B r1 H1 C c* r A b' m A' c’ b* b c

slide-38
SLIDE 38

Initial Pushout

m b c r

slide-39
SLIDE 39

m is boundary consistent with respect to a monomorphism m below if there exists an initial pushout and a morphism b' such that b = l·b': Gluing Conditions for Adhesive Categories

m L K G l m' B C b b'

slide-40
SLIDE 40

Gluing Conditions for Adhesive Categories

m L K G l m' B C b b' D

The morphisms l and m below have a pushout complement iff m is boundary consistent with respect to l.

slide-41
SLIDE 41

Given an element Z in C we can define an algebra of its subobjects: Algebra of Subobjects

B B∩C po Z C B B∪C C B∩C pb

The class of subobjects of Z is a distributive lattice

slide-42
SLIDE 42

Variations

slide-43
SLIDE 43

L R

p = Single pushout transformations Rules are partial monomorphisms (inclusions):

slide-44
SLIDE 44

Rule Application Roughly, single pushout graph transformation removes from G the elements that are in m(L\dom(p)) and adds to G the elements in R\p(L) but, in case of conflict, removes the conflicting elements

p' m L H R G p po

slide-45
SLIDE 45

Rule Application Given h, h': the co-equalizer (C,f) is constructed in the category of graphs with partial morphisms as follows: C is the largest subgraph of B and of (h(A) ∩h'(A)) ∪ (h(A) ∩ h'(A))

A B h h' C f

slide-46
SLIDE 46

Rule Application

G L m D R p (po) Dom(p) H

  • 1. Build D as the pushout of Dom(p) → G and Dom(p) → R
  • 2. Build H as the co-equalizer of LRD and LGD
slide-47
SLIDE 47

Examples

slide-48
SLIDE 48

Given

K L R l r

p =

we can define

L R

p' =

with dom(p') = K and p'(x) = r(x).

SPO and DPO

slide-49
SLIDE 49

Given

K L R l r

p =

we can define

L R

p' =

with dom(p') = K and p'(x) = r(x).

SPO and DPO

slide-50
SLIDE 50

SPO and DPO If m: L → G satisfies the gluing conditions then DPO and SPO transformations coincide.

slide-51
SLIDE 51
slide-52
SLIDE 52

Sesqui-pushout transformations Rules are spans, like for DPO transformations:

K L R l r

p =

slide-53
SLIDE 53

Rule Application

l’ m L D K G d l r’ H R m’ r fpb po

slide-54
SLIDE 54

Final Pullbacks

L D K G K' fpb h' h

KLDG is a final pullback if for every other pullback K'LD'G and every morphism h there is a unique h such that the diagram commutes

D'

slide-55
SLIDE 55

Properties of Final Pullbacks

  • 1. Final pullback complements are unique when they exist,

even if the morphisms in the pullback are not monos.

  • 2. Final pullbacks along monos are pushouts.
  • 3. Final pullback complements exist if and only if the

identification condition holds.

  • 4. When the morphism K → L is not a mono, the rules

clone the identified elements.

slide-56
SLIDE 56

Extensions

slide-57
SLIDE 57

Typed Graphs

slide-58
SLIDE 58

A typed graph consists of:

  • 1. A type graph GT.
slide-59
SLIDE 59
  • 2. A graph G
slide-60
SLIDE 60
  • 3. A morphism TG: G → GT, assigning its type to each

element in G

slide-61
SLIDE 61
slide-62
SLIDE 62
slide-63
SLIDE 63

Morphisms G1 GT G2 TG1 TG2 h

slide-64
SLIDE 64

Typed graphs over a given type graph GT are an adhesive category. A typed graph transformation rule:

K L R l r

p =

GT

Typed Graphs Transformation

slide-65
SLIDE 65

Rule Application

m L D K G l H R r GT GT

slide-66
SLIDE 66

count=n count=n+1

Attributed graphs

slide-67
SLIDE 67

E-graphs

count n

slide-68
SLIDE 68

count n with n ≥ 0

Attributed (Symbolic) graphs

slide-69
SLIDE 69
  • Symbolic graphs are pairs (G,Φ), where G is an E-

graph over a set of variables X and Φ is a set of formulas over X and the operations, predicates and data of the given data algebra D.

  • A symbolic graph morphism h: (G,Φ) → (G',Φ') is an E-

graph morphism h: G → G' such that D |= Φ' ⇒ h(Φ) Attributed (Symbolic) graphs

slide-70
SLIDE 70
  • The category of symbolic graphs is not adhesive, but it

is M-adhesive, where an M-morphism (G,Φ) → (G',Φ') is a monomorphism such that D |= Φ' ≡ h(Φ) Attributed (Symbolic) graphs

slide-71
SLIDE 71

Attributed (Symbolic) graphs

count n count n count n' with n' = n+1

slide-72
SLIDE 72

count=0

slide-73
SLIDE 73

count=1

slide-74
SLIDE 74

¡Thank You!