SLIDE 1
Graph rewriting with cloning Dominique Duval based on work with - - PowerPoint PPT Presentation
Graph rewriting with cloning Dominique Duval based on work with - - PowerPoint PPT Presentation
Graph rewriting with cloning Dominique Duval based on work with Rachid Echahed and Fr ed eric Prost LJK-LIG, University of Grenoble February 28., 2012 Grenoble ANR CLIMT Outline Graph transformation Algebraic graph
SLIDE 2
SLIDE 3
Graph rewriting
L, R, G, H are graphs. For each rewrite rule: L
- R
and each matching: L
⊆
- G
a rewrite step builds H by replacing the occurrence of L in G by some occurrence of R in H: R
⊆
- H
SLIDE 4
Example: term rewriting
f
- a
- g
- b
c
- r
- f
- f
- a
a
- r
- g
- f
- b
c a
SLIDE 5
Some questions:
- 1. What is a graph?
- 2. What is a rule?
- 3. What does replacing mean?
- 4. Is there a rule G H?
In this talk:
- 1. A graph is a directed multigraph.
- 2. A rule is a span L ← K → R.
- 3. Several answers for replacing: DPO, SqPO, PSqPO.
- 4. G H is a rule G ← D → H.
SLIDE 6
Subgraph classifier: What does replacing mean?
L, R are graphs. L = nL
eL
R = nR
eR
L ⊆ G. G = nL
- eL
n′
e′
- R ⊆ H, after rewriting.
H = nR
??
- eR
??
n′
e′
- ??
SLIDE 7
Example: What does replacing mean?
f
- a
- g
- b
c
- r
- f
- a
- r
- g
- b
c
- r
r
- g
- b
c a
- r. . . ?
SLIDE 8
Outline
Graph transformation Algebraic graph transformation Double-pushout (DPO) Sesqui-pushout (SqPO) Polarized sesqui-pushout (PSqPO)
SLIDE 9
Algebraic graph transformation
Algebraic graph rewriting is based on category theory especially on pushouts:
◮ Single-pushout: SPO ◮ Double-pushout: DPO ◮ Sesqui-pushout: SqPO
By: H. Ehrig, U. Montanari, M. L¨
- we,
- A. Corradini, B. K¨
- nig, L. Ribeiro,
- S. Lack, T. Heindel, P. Sobocinski, . . .
SLIDE 10
Pushouts
Union X ∩ Y
⊆
- ⊆
Y
⊆
- X
⊆
- X ∪ Y
Pushout: a kind of generalized union (“amalgamated sum”) W
- Y
- X
- Z
◮ When a pushout exists, it is unique (up to iso). ◮ Categories Set and Graph have pushouts.
SLIDE 11
PO of graphs
There is a GRAPH OF GRAPHS: V E
s
- t
- ◮ Pushouts of graphs exist
and they can be computed pointwise.
SLIDE 12
Example: a PO of graphs
f a
- f
- b
a c
- r
- f
a
- r
- f
- b
a c
SLIDE 13
DPO, SqPO, PSqPO
In this talk, every ??PO of graphs looks like: L
- K
l
- r
R
- G
??
D
l1 r1
H
SLIDE 14
Outline
Graph transformation Algebraic graph transformation Double-pushout (DPO) Sesqui-pushout (SqPO) Polarized sesqui-pushout (PSqPO)
SLIDE 15
Double-pushout (DPO)
The LHS square is a pushout complement (POC) L
- K
l
- r
R
- G
D
l1 r1
H
+ Easy to understand: symmetric + Easy to define + Sound categorical base: adhesive categories
SLIDE 16
Example: DPO
f
- a
- f
a
- f
- b
a c
- r
- f
- a
- r
- f
a
- r
- f
- b
a c
SLIDE 17
Adhesive categories
◮ Definition of adhesive categories
involves Van Kampen squares. . .
◮ Categories Set and Graph are adhesive.
In an adhesive category:
◮ pushouts of monos are monos ◮ pushouts along monos are pullbacks ◮ pushout complements of monos are unique (if they exist)
SLIDE 18
Example: no POC
f
- a
- f
- r
- f
- a
- no POC
SLIDE 19
Outline
Graph transformation Algebraic graph transformation Double-pushout (DPO) Sesqui-pushout (SqPO) Polarized sesqui-pushout (PSqPO)
SLIDE 20
Sesqui-pushout (SqPO)
The LHS square is a final pullback complement (FPBC) L
- K
l
- r
- R
- G
D
l1 r1
H
+ FPBC of graphs exist and are unique (up to iso) + PBCs are more general than POCs
SLIDE 21
Pullbacks
Intersection X ∩ Y
⊆
- ⊆
- Y
⊆
- X
⊆
Z
Pullback: a kind of generalized intersection (“fibered product”) W
- Y
- X
Z
◮ When a pullback exists, it is unique (up to iso). ◮ Categories Set and Graph have pullbacks.
SLIDE 22
Example: a FPBC
f
- a
- f
- r
- f
- a
- r
- f
SLIDE 23
Example: a SqPO
f
- a
- f
- f
- b
c
- r
- f
- a
- r
- f
- r
- f
- b
c
SLIDE 24
Example: cloning and deleting nodes with a SqPO
Goal: cloning and deleting some nodes and their incident edges. Node f is clone twice. Node a is deleted. f
- a
- f1
f2
- f1
- f2
- b
c
- r
- f
- a
- r
- f1
f2
- r
- f1
- f2
- b
c
SLIDE 25
Outline
Graph transformation Algebraic graph transformation Double-pushout (DPO) Sesqui-pushout (SqPO) Polarized sesqui-pushout (PSqPO)
SLIDE 26
Polarized graphs
There is a “GRAPH” OF POLARIZED GRAPHS: V +
- V
E
s+
- t−
- V −
- ◮ Pushouts of polarized graphs exist.
Graph → PolGraph n → n± PolGraph → Graph n±, n+, n−, n → n Graph is a reflective subcategory of PolGraph.
SLIDE 27
L, K are polarized graphs. L = nL±
eL
- K =
nK,1+
eK
nK,2− L ⊆ G. G = nL±
- eL
- n′±
e′
- K ⊆ D.
D = nK,1+
- eK
n′±
e′
- nK,2−
SLIDE 28
Polarized sesqui-pushout (PSqPO)
The LHS square is a final pullback complement of polarized graphs L
- K
l
- r
- R
- G
D
l1 r1
H
+ FPBC of polarized graphs exist and are unique (up to iso) + polarization allows more flexible cloning !!! In fact, only the interface is polarized!
SLIDE 29
Example: PSqPO
f
- a
- f1+
f2− a±
- f1
- f2
- b
a c
- r
- f
- a
- r±
- f1+
- f2−
a±
- r
- f1
- f2
- b
a
- c
SLIDE 30
“if ...then...else...”
“Destructive” rules: m : if
- n : true
p q
- m−
p±
- p = m
“Non-destructive” rules: m:if
- n:true p q
- m−
n± :true p± q±
- p = m
n:true q
SLIDE 31
Conclusion
+ SqPO and PSqPO exist and are unique (up to iso) + SqPO and PSqPO are more general than DPO
- SqPO is not easy to define
- PSqPO is still less easy to define