An abstract view on syntax with sharing

Richard Garner
DOI: https://doi.org/10.48550/arXiv.1009.3682
2011-10-14
Abstract:The notion of term graph encodes a refinement of inductively generated syntax in which regard is paid to the the sharing and discard of subterms. Inductively generated syntax has an abstract expression in terms of initial algebras for certain endofunctors on the category of sets, which permits one to go beyond the set-based case, and speak of inductively generated syntax in other settings. In this paper we give a similar abstract expression to the notion of term graph. Aspects of the concrete theory are redeveloped in this setting, and applications beyond the realm of sets discussed.
Logic in Computer Science,Category Theory
What problem does this paper attempt to address?
The problem that this paper attempts to solve is how to provide an abstract and general mathematical expression for term graphs with shared structures. Specifically, the author hopes: 1. **Generalize traditional inductively generated syntax**: Traditional inductively generated syntax can be represented by the initial algebra of an endofunctor on a specific set category. However, this representation cannot directly handle structures with shared and discarded sub - terms. Therefore, the author aims to provide a similar abstract expression for grammars with sharing. 2. **Establish an abstract term - graph theory**: By defining a comonad on the arrow category, the author hopes to formalize the concept of term graphs and make this concept not only limited to the set category but also applicable in other mathematical structures. For example, it can be used in multi - sorted, higher - order syntax, recursive computation and other scenarios. 3. **Applications beyond the set category**: The author hopes to extend the concept of term graphs to a wider range of mathematical structures, such as the domain category, the complete metric space category, the topos category, and the category of categories. This makes the concept of term graphs more general and can be applied in different fields of mathematics and computer science. 4. **Unify different types of term graphs**: Through this abstract framework, the author hopes to uniformly handle different types of term graphs, such as acyclic term graphs and cyclic term graphs, and be able to perform conversions and operations between these different types of term graphs. ### Formula and Symbol Explanation - **Endofunctor \(F_{\Sigma}\)**: \[ F_{\Sigma}:\text{Set}\to\text{Set}, \quad X\mapsto\sum_{\sigma\in\Sigma}X^{|\sigma|} \] Here, \(|\sigma|\) represents the arity of the symbol \(\sigma\), that is, the number of parameters it accepts. - **Initial algebra \(\mu X.FX\)**: The initial algebra is the initial object in the algebra category of the endofunctor \(F\). For a given endofunctor \(F\), the initial algebra \(\mu X.FX\) is the least fixed point that satisfies certain conditions. - **Comonad \((f:A\to B, s:B\to P_{f})\)**: Here, \(P_{f}\) is the initial algebra of the endofunctor \(A + B\times F(-)\). The comonad \(s\) satisfies some axioms to ensure that it can correctly represent term graphs. ### Summary The core objective of this paper is to provide an abstract mathematical framework for term graphs with shared structures, so that it is not only applicable to the set category but also can be applied to a wider range of mathematical structures. In this way, the author hopes to uniformly handle different types of term graphs and provide a general theoretical basis for them.