introduction to algebraic graph transformation
play

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


  1. Introduction to Algebraic Graph Transformation Fernando Orejas Royal Holloway University of London on leave from Universitat Politècnica de Catalunya, Barcelona

  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

  3. 1. Introduction 2. The basic case 3. Generalizing Graph Transformation 4. Variations 5. Extensions

  4. Introduction

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

  6. Chomsky Grammars: A AA B A B B AA B

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

  8. Chomsky Grammars: Term Rewriting: A AA f(x) f(f(x)) h( f(a) ) h( f(f(a) ) B A B B AA B Graph Grammars A A A ? B B B B A A A

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

  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

  11. The basic case

  12. A graph G1 consists of: • V: nodes • E: edges • source: E → V • target: E → V

  13. A graph morphism h: G 1 → G 2 consists: • h V : V 1 → V 2 • h E : E 1 → E 2 such that 1. h V (source 1 (e 1 )) = source 2 (h E (e 1 )) 2. h V (target 1 (e 1 )) = target 2 (h E (e 1 ))

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

  15. Double Pushout Graph Transformation Rules Rules l r p = L K R

  16. A graph transformation rule:

  17. Rule Application r l R L K m G

  18. Rule Application 1. D = G \ m(L\K) is a pushout complement r l R L K (1) d m l’ D G

  19. Rule Application 2. The result is H = D + (R\K) r l R L K (1) (2) m’ d m r’ l’ H D G (1) and (2) are pushouts

  20. Gluing Conditions

  21. Gluing Conditions ?

  22. Gluing Conditions

  23. Gluing Conditions ?

  24. • Identification Condition For every x 1 ,x 2 in V L ∪ E L , if m(x 1 ) = m(x 2 ) then: x 1 ∈ K iff x 2 ∈ K. • Dangling Edge Condition For every e in E G \m(E L ) if source(e) or target(e) have a pre- image in V L then they also have it in K L

  25. Theorem: Given l L K m G There is a pushout complement if and only if the identification and the dangling edge conditions hold. Moreover, this pushout complement is unique.

  26. Generalizing Graph Transformation

  27. Adhesive Categories (Lack and Sobocinski) 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.

  28. Adhesive Categories (Lack and Sobocinski) 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: A' C' B' D' A C B D

  29. Properties of Adhesive Categories • 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

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

  31. Constructions over Adhesive Categories • 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 A2 f1 e1 m K C e2 f2 A1

  32. Constructions over Adhesive Categories • C has initial pushouts along monomorphisms if for every morphism m, there is an initial pushout BCAA' along a monomorphism r: r C B c* b* r1 H1 c D1 b c’ b' m A' A

  33. Initial Pushout r b c m

  34. Gluing Conditions for Adhesive Categories 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': b' b l B L K m' m C G

  35. Gluing Conditions for Adhesive Categories The morphisms l and m below have a pushout complement iff m is boundary consistent with respect to l. b' b l B L K m' m C G D

  36. Algebra of Subobjects Given an element Z in C we can define an algebra of its subobjects: B ∩ C C C B ∩ C pb po B B B ∪ C Z The class of subobjects of Z is a distributive lattice

  37. Variations

  38. Single pushout transformations Rules are partial monomorphisms (inclusions): p = L R

  39. 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 L R po m p' H G

  40. Rule Application Given h, h': h f B C A 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))

  41. Rule Application 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 p L R Dom(p) (po) m G D H

  42. Examples

  43. SPO and DPO Given l r p = K L R we can define p' = L R with dom(p') = K and p'(x) = r(x).

  44. SPO and DPO Given p' = L R we can define l r p = K L R with dom(p') = K and p'(x) = r(x).

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

  46. Sesqui-pushout transformations Rules are spans, like for DPO transformations: l r p = K L R

  47. Rule Application r l R L K fpb po m’ d m r’ l’ H D G

  48. Final Pullbacks K' h L K fpb D G h' D' 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

  49. 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.

  50. Extensions

  51. Typed Graphs

  52. A typed graph consists of: 1. A type graph G T .

  53. 2. A graph G

  54. 3. A morphism TG: G → G T , assigning its type to each element in G

  55. Morphisms G T TG1 TG2 G1 G2 h

  56. Typed Graphs Transformation Typed graphs over a given type graph G T are an adhesive category. A typed graph transformation rule: G T l r p = L K R

  57. Rule Application G T L K R r l m H G D G T

  58. Attributed graphs count=n count=n+1

  59. E-graphs count n

  60. Attributed (Symbolic) graphs count n with n ≥ 0

  61. Attributed (Symbolic) graphs • 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( Φ )

  62. Attributed (Symbolic) graphs • 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( Φ )

  63. Attributed (Symbolic) graphs count count count n n n' with n' = n+1

  64. count=0

  65. count=1

  66. ¡Thank You !

Recommend


More recommend