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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
- 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.
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.
The L of structured cospans should not be confused with the L of the rewrite rule \(L\leftarrow I \rightarrow R\).
References
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
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
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)
Braatz, B., Golas, U., Soboll, T.: How to delete categorically-two pushout complement constructions. J. Symb. Comput. 46(3), 246–271 (2011)
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
Cicala, D.: Rewriting structured cospans: A syntax for open systems. arXiv preprint arXiv:1906.05443 (2019)
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
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
Corradini, A., Montanari, U., Rossi, F.: Graph processes. Fund. Inform. 26(3, 4), 241–265 (1996)
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)
Halter, M., Patterson, E., Baas, A., Fairbanks, J.: Compositional scientific computing with Catlab and SemanticModels. arXiv preprint arXiv:2005.04831 (2020)
Harmer, R., Oshurko, E.: Reversibility and composition of rewriting in hierarchies. arXiv preprint arXiv:2012.01661 (2020)
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
Heckel, R., Lambers, L., Saadat, M.G.: Analysis of graph transformation systems: native vs translation-based techniques. arXiv preprint arXiv:1912.09607 (2019)
Kashiwara, M., Schapira, P.: Categories and Sheaves. Springer, Heidelberg (2006). https://doi.org/10.1007/3-540-27950-4
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
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
Lack, S., Sobociński, P.: Adhesive and quasiadhesive categories. RAIRO-Theor. Inform. Appl. 39(3), 511–545 (2005)
Löwe, M.: Algebraic approach to single-pushout graph transformation. Theor. Comput. Sci. 109(1–2), 181–224 (1993)
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
Patterson, E., Lynch, O., Fairbanks, J.: Categorical data structures for technical computing. arXiv preprint arXiv:2106.04703 (2021)
Peschke, G., Tholen, W.: Diagrams, fibrations, and the decomposition of colimits. arXiv preprint arXiv:2006.10890 (2020)
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)
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)
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
Russell, S., Norvig, P.: Artificial Intelligence: A Modern Approach (2010)
Schultz, P., Spivak, D.I., Vasilakopoulou, C., Wisnesky, R.: Algebraic databases. arXiv preprint arXiv:1602.03501 (2016)
Spivak, D.I.: Functorial data migration. Inf. Comput. 217, 31–51 (2012). https://doi.org/10.1016/j.ic.2012.05.001
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
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
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)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2022 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
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)