SLIDE 1 1/26
Transformation of Petri Nets into Context-Dependent Fusion Grammars
Hans-J¨
- rg Kreowski 1, Sabine Kuske 1 and Aaron Lye 2
University of Bremen
1 Department of Computer Science, 2 Department of Mathematics
P.O.Box 33 04 40, 28334 Bremen, Germany {kreo,kuske,lye}@informatik.uni-bremen.de
27.03.2019 13th International Conference on Language and Automata Theory and Applications (LATA)
SLIDE 2
2/26
Motivation
We introduced fusion grammars generating hypergraphs at ICGT17. Formal framework for fusion processes in: ◮ DNA computing ◮ chemistry ◮ tiling ◮ fractal geometry ◮ visual modeling ◮ etc.
SLIDE 3
3/26
Hypergraph
We consider hypergraphs over Σ with hyperedges like vk1 . . . v1 A wk2 . . . w1 k1 1 k2 1 where v1 · · · vk1 is a sequence of source nodes w1 · · · wk2 is a sequence of target nodes A ∈ Σ is a label. The class of all hypergraphs over Σ is denoted by HΣ.
SLIDE 4 4/26
Fusion rule
Let F ⊆ Σ be a fusion alphabet. Let type : F → N × N. Each A ∈ F has a complement A ∈ F where type(A) = type(A). fr(A) = vk1 . . . v1 v′
1 . . .
v′
k1
A A wk2 . . . w1 w′
1
. . . w′
k2
k1 1 k2 1 k1 1 k2 1 type(A) = (k1, k2) Examples: fr(t4) = t4 t4 type(t4) = (2, 1) fr(◦) = ◦
SLIDE 5 5/26
Rule application
- 1. find a matching morphism g of fr(A) in the hypergraph H
H vk1 . . . v1 v′
1 . . .
v′
k1
A A wk2 . . . w1 w′
1
. . . w′
k2
k1 1 k2 1 k1 1 k2 1
SLIDE 6 5/26
Rule application
- 1. find a matching morphism g of fr(A) in the hypergraph H
- 2. remove the images of the two hyperedges of fr(A)
I vk1 . . . v1 v′
1 . . .
v′
k1
wk2 . . . w1 w′
1
. . . w′
k2
SLIDE 7 5/26
Rule application
- 1. find a matching morphism g of fr(A) in the hypergraph H
- 2. remove the images of the two hyperedges of fr(A)
- 3. identify corresponding source and target vertices of the
removed edges H′ vk1 = v′
k1
. . . v1 = v′
1
wk2 = w′
k2
. . . w1 = w′
1
SLIDE 8 5/26
Rule application
- 1. find a matching morphism g of fr(A) in the hypergraph H
- 2. remove the images of the two hyperedges of fr(A)
- 3. identify corresponding source and target vertices of the
removed edges H′ vk1 = v′
k1
. . . v1 = v′
1
wk2 = w′
k2
. . . w1 = w′
1
SLIDE 9 5/26
Rule application
- 1. find a matching morphism g of fr(A) in the hypergraph H
- 2. remove the images of the two hyperedges of fr(A)
- 3. identify corresponding source and target vertices of the
removed edges H′ vk1 = v′
k1
. . . v1 = v′
1
wk2 = w′
k2
. . . w1 = w′
1
Rule application is denoted by H = ⇒
fr(A) H′.
SLIDE 10 6/26
Example
fr(t4) = t4 t4 H = t4
t4
SLIDE 11 6/26
Example
fr(t4) = t4 t4 H = t4
t4
SLIDE 12 6/26
Example
fr(t4) = t4 t4 H = t4
t4
v2 v1 w1
2
v′
1
w′
1
t4
SLIDE 13 6/26
Example
fr(t4) = t4 t4 H = t4
t4
v2 v1 w1
2
v′
1
w′
1
t4
v2 = v′
2
v1 = v′
1
w1 = w′
1
t4
SLIDE 14 7/26
Context-dependent fusion rule and its application
PC, NC: sets of morphisms with domain fr(A) (fr(A), PC, NC) applicable to hypergraph H via a matching morphism g : fr(A) → H if
C fr(A) H = c g ∃h and h is injective on the set
C fr(A) H = c g ∃h
SLIDE 15 8/26
Multiplication
Generalization of dublication used in DNA computing. Let C(H) be the set of all connected components of H. Define multiplicity m: C(H) → N. H = ⇒
m m · H =
m(C) · C
SLIDE 16 8/26
Multiplication
Generalization of dublication used in DNA computing. Let C(H) be the set of all connected components of H. Define multiplicity m: C(H) → N. H = ⇒
m m · H =
m(C) · C Example: H =
t4
t4
C1 + C2 = ⇒
m
2 · C1 + 3 · C2 for m(C1) = 2, m(C2) = 3 =
t4
t4
t4
t4
SLIDE 17
9/26
Context-dependent fusion grammar CDFG = (Z, F, M, T, P)
◮ Z ∈ HF∪F∪M∪T finite start hypergraph F, M, T ⊆ Σ, fusion, marker, terminal alphabet (all finite) M ∩ (F ∪ F) = ∅, T ∩ (F ∪ F) = ∅ = T ∩ M P finite set of context-dependent fusion rules
SLIDE 18
9/26
Context-dependent fusion grammar CDFG = (Z, F, M, T, P)
◮ Z ∈ HF∪F∪M∪T finite start hypergraph F, M, T ⊆ Σ, fusion, marker, terminal alphabet (all finite) M ∩ (F ∪ F) = ∅, T ∩ (F ∪ F) = ∅ = T ∩ M P finite set of context-dependent fusion rules ◮ A direct derivation is either H = ⇒
cdfr H′
for some cdfr ∈ P or H = ⇒
m m · H = C∈C(H)
m(C) · C for some multiplicity m: C(H) → N. ◮ Derivations are defined by the reflexive and transitive closure.
SLIDE 19
9/26
Context-dependent fusion grammar CDFG = (Z, F, M, T, P)
◮ Z ∈ HF∪F∪M∪T finite start hypergraph F, M, T ⊆ Σ, fusion, marker, terminal alphabet (all finite) M ∩ (F ∪ F) = ∅, T ∩ (F ∪ F) = ∅ = T ∩ M P finite set of context-dependent fusion rules ◮ A direct derivation is either H = ⇒
cdfr H′
for some cdfr ∈ P or H = ⇒
m m · H = C∈C(H)
m(C) · C for some multiplicity m: C(H) → N. ◮ Derivations are defined by the reflexive and transitive closure. ◮ The generated language L(CDFG) = {remM(Y ) | Z
∗
= ⇒ H, Y ∈ C(H)∩(HT∪M−HT)}, where remM(Y ) removes all marker hyperedges from Y .
SLIDE 20
10/26
Petri Net PN = (P, T, F, W, M0)
◮ disjoint finite sets P and T ◮ flow relation F ⊆ (P × T) ∪ (T × P) ◮ weight function W: F → N>0 ◮ marking M: P → N
p1 p2 p3 p4 p5 t1 t3 t2 t4 2
◮ •t and t• denote the set of pre- and post-places of t ∈ T.
SLIDE 21
10/26
Petri Net PN = (P, T, F, W, M0)
◮ disjoint finite sets P and T ◮ flow relation F ⊆ (P × T) ∪ (T × P) ◮ weight function W: F → N>0 ◮ marking M: P → N
p1 p2 p3 p4 p5 t1 t3 t2 t4 2
◮ •t and t• denote the set of pre- and post-places of t ∈ T. ◮ t is enabled in M if M(p) ≥ W(p, t) for each p ∈ •t. ◮ M[tM′: in each p ∈ •t W(p, t) tokens are consumed M[tM′: and to each p ∈ t• W(t, p) tokens are added.
SLIDE 22
10/26
Petri Net PN = (P, T, F, W, M0)
◮ disjoint finite sets P and T ◮ flow relation F ⊆ (P × T) ∪ (T × P) ◮ weight function W: F → N>0 ◮ marking M: P → N
p1 p2 p3 p4 p5 t1 t3 t2 t4 2
◮ •t and t• denote the set of pre- and post-places of t ∈ T. ◮ t is enabled in M if M(p) ≥ W(p, t) for each p ∈ •t. ◮ M[tM′: in each p ∈ •t W(p, t) tokens are consumed M[tM′: and to each p ∈ t• W(t, p) tokens are added. ◮ Reach(PN) = {M′′ | M0[∗M′′} is the set of markings reachable from M0.
SLIDE 23
11/26
Transformation of Petri Nets into Context-Dependent Fusion Grammars
PN = (P, T, F, W, M0) ❀ CDFG(PN) = (ZPN, FPN, MPN, TPN, PPN)
SLIDE 24
11/26
Transformation of Petri Nets into Context-Dependent Fusion Grammars
PN = (P, T, F, W, M0) ❀ CDFG(PN) = (ZPN, FPN, MPN, TPN, PPN) ◮ FPN = {◦} ∪ T, MPN = {µ}, TPN = {•} type(◦) = (0, 1), type(t) = (|•t|, |t•|) for each t ∈ T
SLIDE 25
11/26
Transformation of Petri Nets into Context-Dependent Fusion Grammars
PN = (P, T, F, W, M0) ❀ CDFG(PN) = (ZPN, FPN, MPN, TPN, PPN) ◮ FPN = {◦} ∪ T, MPN = {µ}, TPN = {•} type(◦) = (0, 1), type(t) = (|•t|, |t•|) for each t ∈ T Both ◦ and • represent token, because F ∩ T = ∅
SLIDE 26
11/26
Transformation of Petri Nets into Context-Dependent Fusion Grammars
PN = (P, T, F, W, M0) ❀ CDFG(PN) = (ZPN, FPN, MPN, TPN, PPN) ◮ FPN = {◦} ∪ T, MPN = {µ}, TPN = {•} type(◦) = (0, 1), type(t) = (|•t|, |t•|) for each t ∈ T Both ◦ and • represent token, because F ∩ T = ∅ ◮ ZPN = hg(P, T, M0) +
t∈T
Ct + C• +
t∈T
Dt
SLIDE 27
11/26
Transformation of Petri Nets into Context-Dependent Fusion Grammars
PN = (P, T, F, W, M0) ❀ CDFG(PN) = (ZPN, FPN, MPN, TPN, PPN) ◮ FPN = {◦} ∪ T, MPN = {µ}, TPN = {•} type(◦) = (0, 1), type(t) = (|•t|, |t•|) for each t ∈ T Both ◦ and • represent token, because F ∩ T = ∅ ◮ ZPN = hg(P, T, M0) +
t∈T
Ct + C• +
t∈T
Dt
◮ hg(P, T, M0) represents the initial Petri net ◮ Ct is used for firing transitions t according to W
SLIDE 28
11/26
Transformation of Petri Nets into Context-Dependent Fusion Grammars
PN = (P, T, F, W, M0) ❀ CDFG(PN) = (ZPN, FPN, MPN, TPN, PPN) ◮ FPN = {◦} ∪ T, MPN = {µ}, TPN = {•} type(◦) = (0, 1), type(t) = (|•t|, |t•|) for each t ∈ T Both ◦ and • represent token, because F ∩ T = ∅ ◮ ZPN = hg(P, T, M0) +
t∈T
Ct + C• +
t∈T
Dt
◮ hg(P, T, M0) represents the initial Petri net ◮ Ct is used for firing transitions t according to W
◮ PPN = {consume, replace} ∪ {fire(t), delete(t) | t ∈ T}
SLIDE 29
11/26
Transformation of Petri Nets into Context-Dependent Fusion Grammars
PN = (P, T, F, W, M0) ❀ CDFG(PN) = (ZPN, FPN, MPN, TPN, PPN) ◮ FPN = {◦} ∪ T, MPN = {µ}, TPN = {•} type(◦) = (0, 1), type(t) = (|•t|, |t•|) for each t ∈ T Both ◦ and • represent token, because F ∩ T = ∅ ◮ ZPN = hg(P, T, M0) +
t∈T
Ct + C• +
t∈T
Dt
◮ hg(P, T, M0) represents the initial Petri net ◮ Ct is used for firing transitions t according to W
◮ PPN = {consume, replace} ∪ {fire(t), delete(t) | t ∈ T}
◮ consume is used for consuming tokens ◮ fire(t) is used for simulating a firing of t
SLIDE 30 12/26
Example hg(P, T, M0)
p1 p2 p3 p4 p5 t1 t3 t2 t4 2
❀
µ 1 2 3 4 5
t3 t2 t4
SLIDE 31 12/26
Example hg(P, T, M0)
p1 p2 p3 p4 p5 t1 t3 t2 t4 2
❀
2 3 4 5 t1 t3 t2 t4
SLIDE 32 13/26
Example ZPN
hg(P, T, M0) =
2 3 4 5 t1 t3 t2 t4
SLIDE 33 13/26
Example ZPN
hg(P, T, M0) =
2 3 4 5 t1 t3 t2 t4
Ct1 = Ct2 = Ct3 = Ct4 =
t1
t2
t3
t4
SLIDE 34 14/26
Example fire(t4) = (fr(t4), PC, NC)
where fr(t4) = t4 t4 Positive context according to W: PC = { fr(t4) → t4
} Negative context: NC = { fr(t4) → t4
, fr(t4) → t4
}
SLIDE 35 15/26
consume = (fr(◦), PC, NC)
fr(◦) =
{ fr(◦) → ◦
NC = ∅
SLIDE 36 16/26
Example derivation (fire and consume)
2 3 4 5 t1 t3 t2 t4
t4
SLIDE 37 16/26
Example derivation (fire and consume)
2 3 4 5 t1 t3 t2 t4
t4
= ⇒
fire(t4)
t3 t2 t4
SLIDE 38 16/26
Example derivation (fire and consume)
2 3 4 5 t1 t3 t2 t4
t4
= ⇒
fire(t4)
t3 t2 t4
2
= ⇒
consume
t1 t3 t2 t4
SLIDE 39 17/26
Derivation schema
Z = ⇒
m hg(P, T, M0) + C• +
m(Ct) · Ct +
Dt = ⇒
fire(t1) X1 b1
= ⇒
consume hg(P, T, M1) + C• +
mt2...tk(Ct) · Ct +
Dt = ⇒
fire(t2) X2 b2
= ⇒
consume . . .
= ⇒
fire(tn) Xn bn
= ⇒
consume hg(P, T, Mn) + C• +
Ct +
Dt
SLIDE 40
18/26
Transformation of Petri Nets into Context-Dependent Fusion Grammars
PN = (P, T, F, W, M0) ❀ CDFG(PN) = (ZPN, FPN, MPN, TPN, PPN) ◮ FPN = {◦} ∪ T, MPN = {µ}, TPN = {•} type(◦) = (0, 1), type(t) = (|•t|, |t•|) for each t ∈ T Both ◦ and • represent token, because F ∩ T = ∅ ◮ ZPN = hg(P, T, M0) +
t∈T
Ct + C• +
t∈T
Dt
◮ hg(P, T, M0) represents the initial Petri net ◮ Ct is used for firing transitions t according to W
SLIDE 41 18/26
Transformation of Petri Nets into Context-Dependent Fusion Grammars
PN = (P, T, F, W, M0) ❀ CDFG(PN) = (ZPN, FPN, MPN, TPN, PPN) ◮ FPN = {◦} ∪ T, MPN = {µ}, TPN = {•} type(◦) = (0, 1), type(t) = (|•t|, |t•|) for each t ∈ T Both ◦ and • represent token, because F ∩ T = ∅ ◮ ZPN = hg(P, T, M0) +
t∈T
Ct + C• +
t∈T
Dt
◮ hg(P, T, M0) represents the initial Petri net ◮ Ct is used for firing transitions t according to W ◮ C• =
- is used for terminating tokens
SLIDE 42 18/26
Transformation of Petri Nets into Context-Dependent Fusion Grammars
PN = (P, T, F, W, M0) ❀ CDFG(PN) = (ZPN, FPN, MPN, TPN, PPN) ◮ FPN = {◦} ∪ T, MPN = {µ}, TPN = {•} type(◦) = (0, 1), type(t) = (|•t|, |t•|) for each t ∈ T Both ◦ and • represent token, because F ∩ T = ∅ ◮ ZPN = hg(P, T, M0) +
t∈T
Ct + C• +
t∈T
Dt
◮ hg(P, T, M0) represents the initial Petri net ◮ Ct is used for firing transitions t according to W ◮ C• =
- is used for terminating tokens
◮ Dt is used for deleting transition t
SLIDE 43 19/26
Example ZPN
hg(P, T, M0) =
2 3 4 5 t1 t3 t2 t4
C• =
Ct2 = Ct3 = Ct4 =
t1
t2
t3
t4
SLIDE 44 19/26
Example ZPN
hg(P, T, M0) =
2 3 4 5 t1 t3 t2 t4
C• =
Ct2 = Ct3 = Ct4 =
t1
t2
t3
t4
Dt1 = Dt2 = Dt3 = Dt4 =
t1 t2 t3 t4
SLIDE 45 20/26
Transformation of Petri Nets into Context-Dependent Fusion Grammars
PN = (P, T, F, W, M0) ❀ CDFG(PN) = (ZPN, FPN, MPN, TPN, PPN) ◮ FPN = {◦} ∪ T, MPN = {µ}, TPN = {•} type(◦) = (0, 1), type(t) = (|•t|, |t•|) for each t ∈ T Both ◦ and • represent token, because F ∩ T = ∅ ◮ ZPN = hg(P, T, M0) +
t∈T
Ct + C• +
t∈T
Dt
◮ hg(P, T, M0) represents the initial Petri net ◮ Ct is used for firing transitions t according to W ◮ C• =
- is used for terminating tokens
◮ Dt is used for deleting transition t
◮ PPN = {consume, replace} ∪ {fire(t), delete(t) | t ∈ T}
◮ consume is used for consuming tokens ◮ fire(t) is used for simulating a firing of t
SLIDE 46 20/26
Transformation of Petri Nets into Context-Dependent Fusion Grammars
PN = (P, T, F, W, M0) ❀ CDFG(PN) = (ZPN, FPN, MPN, TPN, PPN) ◮ FPN = {◦} ∪ T, MPN = {µ}, TPN = {•} type(◦) = (0, 1), type(t) = (|•t|, |t•|) for each t ∈ T Both ◦ and • represent token, because F ∩ T = ∅ ◮ ZPN = hg(P, T, M0) +
t∈T
Ct + C• +
t∈T
Dt
◮ hg(P, T, M0) represents the initial Petri net ◮ Ct is used for firing transitions t according to W ◮ C• =
- is used for terminating tokens
◮ Dt is used for deleting transition t
◮ PPN = {consume, replace} ∪ {fire(t), delete(t) | t ∈ T}
◮ consume is used for consuming tokens ◮ fire(t) is used for simulating a firing of t ◮ replace is used for termination
SLIDE 47 20/26
Transformation of Petri Nets into Context-Dependent Fusion Grammars
PN = (P, T, F, W, M0) ❀ CDFG(PN) = (ZPN, FPN, MPN, TPN, PPN) ◮ FPN = {◦} ∪ T, MPN = {µ}, TPN = {•} type(◦) = (0, 1), type(t) = (|•t|, |t•|) for each t ∈ T Both ◦ and • represent token, because F ∩ T = ∅ ◮ ZPN = hg(P, T, M0) +
t∈T
Ct + C• +
t∈T
Dt
◮ hg(P, T, M0) represents the initial Petri net ◮ Ct is used for firing transitions t according to W ◮ C• =
- is used for terminating tokens
◮ Dt is used for deleting transition t
◮ PPN = {consume, replace} ∪ {fire(t), delete(t) | t ∈ T}
◮ consume is used for consuming tokens ◮ fire(t) is used for simulating a firing of t ◮ replace is used for termination ◮ delete(t) is used for deleting transition t
SLIDE 48
21/26
Example delete(t4) = (fr(t4), PC, NC)
fr(t4) = t4 t4 PC = ∅ NC = { fr(t4) → t4 t4 t4 } where t4 maps into the left connected component. Matching morphism g cannot map the t4-hyperedge into Ct4.
SLIDE 49 22/26
replace = (fr(◦), PC, NC)
fr(◦) =
+ •
NC = { fr(◦) → ◦
, fr(◦) → ◦ + ◦
where ◦ maps into the left connected component
- maps into the right connected component.
Can only be applied to ◦ and C• =
attached to the target of the ◦-hyperedge.
SLIDE 50 23/26
Example derivation (delete and replace)
t1 t3 t2 t4 t1 t2 t3 t4
SLIDE 51 23/26
Example derivation (delete and replace)
t1 t3 t2 t4 t1 t2 t3 t4
= ⇒
delete(t)
SLIDE 52 23/26
Example derivation (delete and replace)
t1 t3 t2 t4 t1 t2 t3 t4
= ⇒
delete(t)
= ⇒
replace
SLIDE 53 24/26
Derivation schema
Z = ⇒
m hg(P, T, M0) + C• +
m(Ct) · Ct +
Dt = ⇒
fire(t1) X1 b1
= ⇒
consume hg(P, T, M1) + C• +
mt2...tk(Ct) · Ct +
Dt = ⇒
fire(t2) X2 b2
= ⇒
consume . . .
= ⇒
fire(tn) Xn bn
= ⇒
consume hg(P, T, Mn) + C• +
Ct +
Dt = ⇒
m′ hg(P, T, Mn) + k · C• +
Dt with k =
Mn(p) = ⇒
delete(t1) · · ·
= ⇒
delete(t|T|) X k
= ⇒
replace H
SLIDE 54 24/26
Derivation schema
Z = ⇒
m hg(P, T, M0) + C• +
m(Ct) · Ct +
Dt = ⇒
fire(t1) X1 b1
= ⇒
consume hg(P, T, M1) + C• +
mt2...tk(Ct) · Ct +
Dt = ⇒
fire(t2) X2 b2
= ⇒
consume . . .
= ⇒
fire(tn) Xn bn
= ⇒
consume hg(P, T, Mn) + C• +
Ct +
Dt = ⇒
m′ hg(P, T, Mn) + k · C• +
Dt with k =
Mn(p) = ⇒
delete(t1) · · ·
= ⇒
delete(t|T|) X k
= ⇒
replace H
remM(H) is a hypergraph representation of a marking
SLIDE 55
25/26
Main result
Theorem
Let PN = (P, T, F, W, M0) be a Petri net. Let CDFG(PN) be the corresponding context-dependent fusion grammar. Then L(CDFG(PN)) = gr(Reach(PN)).
SLIDE 56
25/26
Main result
Theorem
Let PN = (P, T, F, W, M0) be a Petri net. Let CDFG(PN) be the corresponding context-dependent fusion grammar. Then L(CDFG(PN)) = gr(Reach(PN)).
Lemma
M1[tM2 if and only if hg(P, T, M1)+Ct = ⇒
fire(t) X b
= ⇒
consume hg(P, T, M2)
with b =
p∈•t
W(p, t).
SLIDE 57
26/26
Conclusion
Contributions: ◮ We have introduced context-dependent fusion grammars. ◮ We have transformed Petri nets into these grammars.
SLIDE 58
26/26
Conclusion
Contributions: ◮ We have introduced context-dependent fusion grammars. ◮ We have transformed Petri nets into these grammars. Future work: ◮ Can Petri nets be transformed into fusion grammars without context conditions? Are only positive or only negative context conditions powerful enough to cover Petri nets? ◮ At ICGT18 we introduced splicing/fusion grammars enhancing fusion grammars by the inversion of fusions. How does a natural transformation of context-dependent fusion grammars into splicing/fusion grammars look like?
SLIDE 59
26/26
Conclusion
Contributions: ◮ We have introduced context-dependent fusion grammars. ◮ We have transformed Petri nets into these grammars. Future work: ◮ Can Petri nets be transformed into fusion grammars without context conditions? Are only positive or only negative context conditions powerful enough to cover Petri nets? ◮ At ICGT18 we introduced splicing/fusion grammars enhancing fusion grammars by the inversion of fusions. How does a natural transformation of context-dependent fusion grammars into splicing/fusion grammars look like? Thank you! Questions?