Skip to main content

Computational Category-Theoretic Rewriting

  • Conference paper
  • First Online:
Graph Transformation (ICGT 2022)

Abstract

We demonstrate how category theory provides specifications that can efficiently be implemented via imperative algorithms and apply this to the field of graph transformation. By examples, we show how this paradigm of software development makes it easy to quickly write correct and performant code. We provide a modern implementation of graph rewriting techniques at the level of abstraction of finitely-presented \(\mathcal C\)-sets and clarify the connections between \(\mathcal C\)-sets and the typed graphs supported in existing rewriting software. We emphasize that our open-source library is extensible: by taking new categorical constructions (such as slice categories, structured cospans, and distributed graphs) and relating their limits and colimits to those of their underlying categories, users inherit efficient algorithms for pushout complements and (final) pullback complements. This allows one to perform double-, single-, and sesqui-pushout rewriting over a broad class of data structures. Graph transformation researchers, scientists, and engineers can then use this library to computationally manipulate rewriting systems and apply them to their domains of interest.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 44.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 59.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

Institutional subscriptions

Notes

  1. 1.

    https://nbviewer.org/github/kris-brown/Computational-Category-Theoretic-Rewriting/blob/main/Computational_Category_Theoretic_Rewriting.ipynb.

  2. 2.

    \(\mathcal C\)-sets are also called copresheaves on \(\mathcal C\) or presheaves on \(\mathcal C\) \(^{op}\), and are what Löwe studied as graph structures or unary algebras.

  3. 3.

    When specialized to typed graphs, \(\mathcal {E} \xrightarrow {F}\mathcal {C}\) is a graph homomorphism and the graphs are regarded as their path categories.

  4. 4.

    The L of structured cospans should not be confused with the L of the rewrite rule \(L\leftarrow I \rightarrow R\).

References

  1. Azzi, G.G., Bezerra, J.S., Ribeiro, L., Costa, A., Rodrigues, L.M., Machado, R.: The verigraph system for graph transformation. In: Heckel, R., Taentzer, G. (eds.) Graph Transformation, Specifications, and Nets. LNCS, vol. 10800, pp. 160–178. Springer, Cham (2018). https://doi.org/10.1007/978-3-319-75396-6_9

    Chapter  MATH  Google Scholar 

  2. Behr, N., Harmer, R., Krivine, J.: Concurrency theorems for non-linear rewriting theories. In: Gadducci, F., Kehrer, T. (eds.) ICGT 2021. LNCS, vol. 12741, pp. 3–21. Springer, Cham (2021). https://doi.org/10.1007/978-3-030-78946-6_1

    Chapter  Google Scholar 

  3. Bonchi, F., Gadducci, F., Kissinger, A., Sobocinski, P., Zanasi, F.: String diagram rewrite theory I: rewriting with Frobenius structure. arXiv preprint arXiv:2012.01847 (2020)

  4. Braatz, B., Golas, U., Soboll, T.: How to delete categorically-two pushout complement constructions. J. Symb. Comput. 46(3), 246–271 (2011)

    Article  MathSciNet  Google Scholar 

  5. Cheng, Y., Ding, P., Wang, T., Lu, W., Du, X.: Which category is better: benchmarking relational and graph database management systems. Data Sci. Eng. 4(4), 309–322 (2019). https://doi.org/10.1007/s41019-019-00110-3

    Article  Google Scholar 

  6. Cicala, D.: Rewriting structured cospans: A syntax for open systems. arXiv preprint arXiv:1906.05443 (2019)

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

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

  9. Corradini, A., Montanari, U., Rossi, F.: Graph processes. Fund. Inform. 26(3, 4), 241–265 (1996)

    MathSciNet  MATH  Google Scholar 

  10. Ehrig, H., Pfender, M., Schneider, H.J.: Graph-grammars: an algebraic approach. In: 14th Annual Symposium on Switching and Automata Theory (SWAT 1973), pp. 167–180. IEEE (1973)

    Google Scholar 

  11. Halter, M., Patterson, E., Baas, A., Fairbanks, J.: Compositional scientific computing with Catlab and SemanticModels. arXiv preprint arXiv:2005.04831 (2020)

  12. Harmer, R., Oshurko, E.: Reversibility and composition of rewriting in hierarchies. arXiv preprint arXiv:2012.01661 (2020)

  13. Hayman, J., Heindel, T.: Pattern graphs and rule-based models: the semantics of kappa. In: Pfenning, F. (ed.) FoSSaCS 2013. LNCS, vol. 7794, pp. 1–16. Springer, Heidelberg (2013). https://doi.org/10.1007/978-3-642-37075-5_1

    Chapter  MATH  Google Scholar 

  14. Heckel, R., Lambers, L., Saadat, M.G.: Analysis of graph transformation systems: native vs translation-based techniques. arXiv preprint arXiv:1912.09607 (2019)

  15. Kashiwara, M., Schapira, P.: Categories and Sheaves. Springer, Heidelberg (2006). https://doi.org/10.1007/3-540-27950-4

    Book  MATH  Google Scholar 

  16. Kennaway, R.: Graph rewriting in some categories of partial morphisms. In: Ehrig, H., Kreowski, H.-J., Rozenberg, G. (eds.) Graph Grammars 1990. LNCS, vol. 532, pp. 490–504. Springer, Heidelberg (1991). https://doi.org/10.1007/BFb0017408

    Chapter  MATH  Google Scholar 

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

  18. Lack, S., Sobociński, P.: Adhesive and quasiadhesive categories. RAIRO-Theor. Inform. Appl. 39(3), 511–545 (2005)

    Article  MathSciNet  Google Scholar 

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

    Article  MathSciNet  Google Scholar 

  20. Minas, M., Schneider, H.J.: Graph transformation by computational category theory. In: Engels, G., Lewerentz, C., Schäfer, W., Schürr, A., Westfechtel, B. (eds.) Graph Transformations and Model-Driven Engineering. LNCS, vol. 5765, pp. 33–58. Springer, Heidelberg (2010). https://doi.org/10.1007/978-3-642-17322-6_3

    Chapter  MATH  Google Scholar 

  21. Patterson, E., Lynch, O., Fairbanks, J.: Categorical data structures for technical computing. arXiv preprint arXiv:2106.04703 (2021)

  22. Peschke, G., Tholen, W.: Diagrams, fibrations, and the decomposition of colimits. arXiv preprint arXiv:2006.10890 (2020)

  23. Rensink, A., Boneva, I., Kastenberg, H., Staijen, T.: User manual for the groove tool set. University of Twente, The Netherlands, Department of Computer Science (2010)

    Google Scholar 

  24. Ringer, T., Palmskog, K., Sergey, I., Gligoric, M., Tatlock, Z.: QED at large: a survey of engineering of formally verified software. arXiv preprint arXiv:2003.06458 (2020)

  25. Rushby, J.: Automated test generation and verified software. In: Meyer, B., Woodcock, J. (eds.) VSTTE 2005. LNCS, vol. 4171, pp. 161–172. Springer, Heidelberg (2008). https://doi.org/10.1007/978-3-540-69149-5_18

    Chapter  Google Scholar 

  26. Russell, S., Norvig, P.: Artificial Intelligence: A Modern Approach (2010)

    Google Scholar 

  27. Schultz, P., Spivak, D.I., Vasilakopoulou, C., Wisnesky, R.: Algebraic databases. arXiv preprint arXiv:1602.03501 (2016)

  28. Spivak, D.I.: Functorial data migration. Inf. Comput. 217, 31–51 (2012). https://doi.org/10.1016/j.ic.2012.05.001

    Article  MathSciNet  MATH  Google Scholar 

  29. Taentzer, G.: AGG: a graph transformation environment for modeling and validation of software. In: Pfaltz, J.L., Nagl, M., Böhlen, B. (eds.) AGTIVE 2003. LNCS, vol. 3062, pp. 446–453. Springer, Heidelberg (2004). https://doi.org/10.1007/978-3-540-25959-6_35

    Chapter  Google Scholar 

  30. Vardi, M.Y.: Constraint satisfaction and database theory: a tutorial. In: Proceedings of the Nineteenth ACM SIGMOD-SIGACT-SIGART Symposium on Principles of Database Systems, pp. 76–85 (2000). https://doi.org/10.1145/335168.335209

  31. Willsey, M., Nandi, C., Wang, Y.R., Flatt, O., Tatlock, Z., Panchekha, P.: EGG: fast and extensible equality saturation. Proc. ACM Program. Lang. 5(POPL), 1–29 (2021)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Kristopher Brown .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2022 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Brown, K., Patterson, E., Hanks, T., Fairbanks, J. (2022). Computational Category-Theoretic Rewriting. In: Behr, N., Strüber, D. (eds) Graph Transformation. ICGT 2022. Lecture Notes in Computer Science, vol 13349. Springer, Cham. https://doi.org/10.1007/978-3-031-09843-7_9

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-09843-7_9

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-09842-0

  • Online ISBN: 978-3-031-09843-7

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics