Skip to main content

Graph Rewriting and Relabeling with PBPO\(^{+}\)

  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 12741))

Abstract

We extend the powerful Pullback-Pushout (PBPO) approach for graph rewriting with strong matching. Our approach, called PBPO\(^{+}\), exerts more control over the embedding of the pattern in the host graph, which is important for a large class of graph rewrite systems. In addition, we show that PBPO\(^{+}\) is well-suited for rewriting labeled graphs and certain classes of attributed graphs. For this purpose, we employ a lattice structure on the label set and use order-preserving graph morphisms. We argue that our approach is simpler and more general than related relabeling approaches in the literature.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Notes

  1. 1.

    We use instead of \(\square \) when the proof is available in the Appendix.

  2. 2.

    The modeling of DPO and SPO rules for category Graph in PBPO\(^{+}\) is similar to the approach described in our paper on PGR [1].

References

  1. Overbeek, R., Endrullis, J.: Patch graph rewriting. In: Gadducci, F., Kehrer, T. (eds.) ICGT 2020. LNCS, vol. 12150, pp. 128–145. Springer, Cham (2020). https://doi.org/10.1007/978-3-030-51372-6_8

    Chapter  Google Scholar 

  2. Corradini, A., Duval, D., Echahed, R., Prost, F., Ribeiro, L.: The PBPO graph transformation approach. J. Log. Algebraic Methods Program. 103, 213–231 (2019)

    Article  MathSciNet  Google Scholar 

  3. Ehrig, H., Pfender, M., Schneider, H.J.: Graph-grammars: an algebraic approach. In: Proceedings of Symposium on Switching and Automata Theory (SWAT), pp. 167–180. IEEE Computer Society (1973)

    Google Scholar 

  4. Mac Lane, S.: Categories for the Working Mathematician, vol. 5. Springer, New York (1971). https://doi.org/10.1007/978-1-4612-9839-7

    Book  MATH  Google Scholar 

  5. Awodey, S.: Category Theory. Oxford University Press, Oxford (2006)

    Book  Google Scholar 

  6. Ehrig, H., Ehrig, K., Prange, U., Taentzer, G.: Fundamentals of Algebraic Graph Transformation. Springer, Heidelberg (2006). https://doi.org/10.1007/3-540-31188-2

    Book  MATH  Google Scholar 

  7. Habel, A., Müller, J., Plump, D.: Double-pushout graph transformation revisited. Math. Struct. Comput. Sci. 11(5), 637–688 (2001)

    Article  MathSciNet  Google Scholar 

  8. Corradini, A., Duval, D., Echahed, R., Prost, F., Ribeiro, L.: AGREE – algebraic graph rewriting with controlled embedding. In: Parisi-Presicce, F., Westfechtel, B. (eds.) ICGT 2015. LNCS, vol. 9151, pp. 35–51. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-21145-9_3

    Chapter  MATH  Google Scholar 

  9. Corradini, A., Heindel, T., König, B., Nolte, D., Rensink, A.: Rewriting abstract structures: materialization explained categorically. In: Bojańczyk, M., Simpson, A. (eds.) FoSSaCS 2019. LNCS, vol. 11425, pp. 169–188. Springer, Cham (2019). https://doi.org/10.1007/978-3-030-17127-8_10

    Chapter  MATH  Google Scholar 

  10. Lack, S., Sobociński, P.: Adhesive categories. In: Walukiewicz, I. (ed.) FoSSaCS 2004. LNCS, vol. 2987, pp. 273–288. Springer, Heidelberg (2004). https://doi.org/10.1007/978-3-540-24727-2_20

    Chapter  Google Scholar 

  11. Garner, R., Lack, S.: On the axioms for adhesive and quasiadhesive categories. Theory Appl. Categories 27(3), 27–46 (2012)

    MathSciNet  MATH  Google Scholar 

  12. Löwe, M.: Algebraic approach to single-pushout graph transformation. Theor. Comput. Sci. 109(1&2), 181–224 (1993)

    Article  MathSciNet  Google Scholar 

  13. Corradini, A., Heindel, T., Hermann, F., König, B.: Sesqui-pushout rewriting. In: Corradini, A., Ehrig, H., Montanari, U., Ribeiro, L., Rozenberg, G. (eds.) ICGT 2006. LNCS, vol. 4178, pp. 30–45. Springer, Heidelberg (2006). https://doi.org/10.1007/11841883_4

    Chapter  Google Scholar 

  14. Kahl, W.: Amalgamating pushout and pullback graph transformation in collagories. In: Ehrig, H., Rensink, A., Rozenberg, G., Schürr, A. (eds.) ICGT 2010. LNCS, vol. 6372, pp. 362–378. Springer, Heidelberg (2010). https://doi.org/10.1007/978-3-642-15928-2_24

    Chapter  MATH  Google Scholar 

  15. Mantz, F.: Coupled transformations of graph structures applied to model migration. Ph.D. thesis, University of Marburg (2014)

    Google Scholar 

  16. Dershowitz, N., Jouannaud, J.-P.: Drags: a compositional algebraic framework for graph rewriting. Theor. Comput. Sci. 777, 204–231 (2019)

    Article  MathSciNet  Google Scholar 

  17. Kahl, W.: Collagories: relation-algebraic reasoning for gluing constructions. J. Log. Algebraic Methods Program. 80(6), 297–338 (2011)

    Article  MathSciNet  Google Scholar 

  18. Parisi-Presicce, F., Ehrig, H., Montanari, U.: Graph rewriting with unification and composition. In: Ehrig, H., Nagl, M., Rozenberg, G., Rosenfeld, A. (eds.) Graph Grammars 1986. LNCS, vol. 291, pp. 496–514. Springer, Heidelberg (1987). https://doi.org/10.1007/3-540-18771-5_72

    Chapter  MATH  Google Scholar 

  19. Habel, A., Plump, D.: Relabelling in graph transformation. In: Corradini, A., Ehrig, H., Kreowski, H.-J., Rozenberg, G. (eds.) ICGT 2002. LNCS, vol. 2505, pp. 135–147. Springer, Heidelberg (2002). https://doi.org/10.1007/3-540-45832-8_12

    Chapter  MATH  Google Scholar 

  20. Schneider, H.J.: Changing labels in the double-pushout approach can be treated categorically. In: Kreowski, H.-J., Montanari, U., Orejas, F., Rozenberg, G., Taentzer, G. (eds.) Formal Methods in Software and Systems Modeling. LNCS, vol. 3393, pp. 134–149. Springer, Heidelberg (2005). https://doi.org/10.1007/978-3-540-31847-7_8

    Chapter  Google Scholar 

  21. Hoffmann, B.: Graph transformation with variables. In: Kreowski, H.-J., Montanari, U., Orejas, F., Rozenberg, G., Taentzer, G. (eds.) Formal Methods in Software and Systems Modeling. LNCS, vol. 3393, pp. 101–115. Springer, Heidelberg (2005). https://doi.org/10.1007/978-3-540-31847-7_6

    Chapter  Google Scholar 

  22. Habel, A., Plump, D.: \(\cal{M}, \cal{N}\)-adhesive transformation systems. In: Ehrig, H., Engels, G., Kreowski, H.-J., Rozenberg, G. (eds.) ICGT 2012. LNCS, vol. 7562, pp. 218–233. Springer, Heidelberg (2012). https://doi.org/10.1007/978-3-642-33654-6_15

    Chapter  Google Scholar 

  23. Shulman, M.: Subobject- and factorization-preserving typings. MathOverflow. https://mathoverflow.net/q/381933. Accessed 22 Jan 2021

Download references

Acknowledgments

We thank Andrea Corradini and anonymous reviewers for useful discussions, suggestions and corrections. We would also like to thank Michael Shulman, who identified the sufficient conditions for amendability for us [23]. The authors received funding from the Netherlands Organization for Scientific Research (NWO) under the Innovational Research Incentives Scheme Vidi (project. No. VI.Vidi.192.004).

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Roy Overbeek .

Editor information

Editors and Affiliations

Appendices

Appendix

A PBPO\(^{+}\)

We will need both directions of the well known pullback lemma.

Lemma 45

(Pullback Lemma). Consider the diagram on the right. Suppose the right square is a pullback square and the left square commutes. Then the outer square is a pullback square iff the left square is a pullback square.    \(\square \)

figure w

Lemma 10

(Top-Left Pullback). In the rewrite step diagram of Definition 9, there exists a morphism \(u : K \rightarrow G_K\) such that \(L \xleftarrow {l} K \xrightarrow {u} G_K\) is a pullback for \(L \xrightarrow {m} G_L \xleftarrow {g_L} G_K\), \(t_K = u' \circ u\), and u is monic.

Proof

In the following diagram, u satisfying \(t_K = u' \circ u\) and \(m \circ l = g_L \circ u\) is inferred by using that \(G_K\) is a pullback and commutation of the outer square.

figure x

By direction \(\Longrightarrow \) of the pullback lemma (Lemma 45), the created square is a pullback square, and so by stability of monos under pullbacks, u is monic.    \(\square \)

Lemma 11

(Uniqueness of u). In the rewrite step diagram of Definition 9 (and in any category), there is a unique \(v : K \rightarrow G_K\) such that \(t_K = u' \circ v\).

Proof

In the following diagram, the top-right pullback is obtained using Lemma 10, and the top-left pullback is a rotation of the match diagram:

figure y

By direction \(\Longleftarrow \) of the pullback lemma, \(L \xleftarrow {1_L \circ l} K \xrightarrow {u} G_K\) is a pullback for the topmost outer square.

Now suppose that for a morphism \(v : K \rightarrow G_K\), \(t_K = u' \circ v\). Then \( \alpha \circ g_L \circ u = l' \circ u' \circ u = l' \circ t_K = l' \circ u' \circ v = \alpha \circ g_L \circ v\). Hence both v and u make the topmost outer square commute. Hence there exists a unique x such that (simplifying) \(l \circ x = l\) and \(u \circ x = v\). From known equalities and monicity of \(t_K\) we then derive

$$ \begin{array}{rcl} u \circ x &{} = &{} v \\ u' \circ u \circ x &{} = &{} u' \circ v \\ t_K \circ x &{} = &{} t_K \\ t_K \circ x &{} = &{} t_K \circ 1_K \\ x &{} = &{} 1_K\text {.} \end{array} $$

Hence \(u = v\).    \(\square \)

Lemma 12

(Bottom-Right Pushout). Let \(K' \xrightarrow {r'} R' \xleftarrow {t_R} R\) be a pushout for cospan \(R \xleftarrow {r} K \xrightarrow {t_K} K'\) of rule \(\rho \) in Definition 9. Then in the rewrite step diagram, there exists a morphism \(w' : G_R \rightarrow R'\) such that \(t_R = w' \circ w\), and \(K' \xrightarrow {r'} R' \xleftarrow {w'} G_R\) is a pushout for \(K' \xleftarrow {u'} G_K \xrightarrow {g_R} G_R\).

Proof

The argument is similar to the proof of Lemma 10, but now uses the dual statement of the pullback lemma.    \(\square \)

B Expressiveness of PBPO\(^{+}\)

Lemma 27

Let \(\rho \) be a canonical PBPO rule, \(G_L\) an object, and \(m' \circ e : L \rightarrow G_L\) a match morphism for a mono \(m'\) and epi e. We have:

$$\begin{aligned} G_{L} \Rightarrow _{\rho }^{(m' \mathop {\circ } e),\alpha } G_{R} \quad \iff \quad G_{L} \Rightarrow _{\rho _e}^{m',\alpha } G_{R}\;\text {.} \end{aligned}$$

Proof

By using the following commuting diagram:

figure z

   \(\square \)

Theorem 33

In locally small, strongly amendable categories in which every morphism f can be factored into an epi e followed by a mono m, any PBPO rule \(\rho \) can be modeled by a set of PBPO\(^{+}\) rules.

Proof

From Corollary 28 we obtain a set of PBPO rules S that collectively model \(\rho \) using monic matching, and by Lemma 32 each \(\sigma \in S\) can be modeled by a monic rule \(\tau _\sigma \) with a strong matching rewrite policy. By Proposition 24, the set \(\{ \tau _\sigma \mid \sigma \in S \}\) corresponds to a set of PBPO\(^{+}\) rules.    \(\square \)

C Category Graph \(^{(\mathcal {L},\le )}\)

Lemma 38

Graph \(^{(\mathcal {L},\le )}\) is strongly amendable.

Proof

Let UGraph refer to the category of unlabeled graphs.

Given a \(t_L : L \rightarrow L'\) in Graph \(^{(\mathcal {L},\le )}\), momentarily forget about the labels and consider the unlabeled version (overloading names) in UGraph. Because UGraph is a topos, it is strongly amendable. Thus we can obtain a factorization \(L {\mathop {\rightarrowtail }\limits ^{t_L'}} L'' {\mathop {\rightarrow }\limits ^{\beta }} L'\) on the level of UGraph that witnesses strong amendability, i.e., for any factorization of \(L {\mathop {\rightarrowtail }\limits ^{m}} G {\mathop {\rightarrow }\limits ^{\alpha }} L'\) of \(t_L\) in UGraph, there exists an \(\alpha '\) such that

figure aa

commutes and the left square is a pullback square.

The idea now is to lift the bottom unlabeled factorization into Graph \(^{(\mathcal {L},\le )}\). As far as graph structure is concerned, we know that it is a suitable factorization candidate. Then all that needs to be verified are the order requirements \(\le \) on the labels.

For the lifting of \(L''\), choose the graph in which every element has the same label as its image under \(\beta \). Then clearly the lifting of \(\beta \) of UGraph into Graph \(^{(\mathcal {L},\le )}\) is well-defined, and so is the lifting of \(t_L'\) (using that \(t_L\) is well-defined in Graph \(^{(\mathcal {L},\le )}\)).

Now given any factorization \(L {\mathop {\rightarrowtail }\limits ^{m}} G {\mathop {\rightarrow }\limits ^{\alpha }} L'\) in Graph \(^{(\mathcal {L},\le )}\), lift the \(\alpha '\) that is obtained by considering the factorization on the level of UGraph. Then the lifting of \(\alpha '\) is well-defined by \(\alpha = {\beta \circ \alpha '}\) and well-definedness of \(\alpha \) and \(\beta \) in Graph \(^{(\mathcal {L},\le )}\). All that remains to be checked is that the left square is a pullback as far as the labels are concerned, i.e., whether for every \(x \in V_L \cup E_L\), \(\ell _L(x) = {\ell _L(1_L(x)) \wedge \ell _G(m(x))}\). This follows using \(\ell _L(x) \le \ell _G(m(x))\) and the complete lattice law \(\forall a \ b . a \le b \implies a \wedge b = a\).    \(\square \)

Rights and permissions

Reprints and permissions

Copyright information

© 2021 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Overbeek, R., Endrullis, J., Rosset, A. (2021). Graph Rewriting and Relabeling with PBPO\(^{+}\). In: Gadducci, F., Kehrer, T. (eds) Graph Transformation. ICGT 2021. Lecture Notes in Computer Science(), vol 12741. Springer, Cham. https://doi.org/10.1007/978-3-030-78946-6_4

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-78946-6_4

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-78945-9

  • Online ISBN: 978-3-030-78946-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics