A Machine-checked Categorial Formalisation of Term Graph Rewriting with Semantics Preservation - Zhao, Yuhang (My University, 2018)
Term graph rewriting is important as "conceptual implementation" of the execution of functional programs, and of data-flow optimisations in compilers. Since term graphs were introduced into the literature, various flavours of term graph rewriting have been investigated mainly as implementation of term rewriting. One way to define term graph rewriting rule application is via the well-established and intuitively accessible double-pushout (DPO) approach. It uses the abstraction of category theory to define matching and replacement on a black-box level through basic categorial theoretic concepts like pushouts. However, the semantics preservation of DPO term graph rewriting, to our knowledge, has never been formalised before. In this thesis, we show the gs-monoidal categories proposed by Andrea Corradini and Fabio Gadducci serves not only as a category-theoretic interface for programming "on top of" term graphs with sequential and parallel composition, but also as the necessary link relating our formalisation of DPO term graph rewriting to the categorial description for program semantics. One achievement of our work is the representation of term graphs employed by the dependently-typed programming language Agda on a suitable level of abstraction from the concrete choice of set representation for graph nodes and edges through the novel category-theoretic abstraction of dependent objects. Another result is the formalisation of the functor from gs-monoidal category of term graphs to any gs-monoidal categories which enables us to obtain the semantics of term graphs. Finally, we present a new result proving the semantics preservation for such DPO-based term graph rewriting.