arXiv:2608.12096cs.LOAug 2026

Manuscript Offprint

arXiv:2608.12096

Structural Morphisms for Nested Conditions - Full Version

Arend Rensink, Andrea Corradini

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Nested conditions are used, among other things, as a graphical way to express first order formulas ruling the applicability of a graph transformation rule to a given match. In this paper, we first introduce several operators on conditions mimicking logical connectives. Next we propose an original notion of structural morphism among nested conditions, and we identify circumstances under which morphisms are consistent with the entailment of the corresponding conditions. Finally we frame the results in a categorical context, proving functoriality and universality properties of the various operations.

This is the full version (including proofs) of the paper published as Rensink and Corradini (2026).

1 Introduction

Representing formulas of First-Order Logic (FOL) by graphs or more general graphical structures was explored in various areas of Theoretical Computer Science and Logics along the decades. A canonical example is represented by edge-labelled graphs, which can be regarded as an alternative syntax for formulas of a fragment of FOL including just basic (binary) predicates, equality, conjunction and existential quantification: we call this briefly the ∃\exists-fragment.

Let L={a,b,c,…}\mathsf{L}=\{\mathsf{a},\mathsf{b},\mathsf{c},\ldots\} be a set of binary relation symbols, which we shall use also as edge labels. As an example, let AA be the graph x$$y$$z$$\scriptstyle{\mathsf{a}}$$\scriptstyle{\mathsf{b}}h. We consider this graph as a sound representation of the formula ϕA=∃x,y,z. a(x,y)∧b(y,z)\phi_{A}=\exists x,y,z.\,\mathsf{a}(x,y)\land\mathsf{b}(y,z), in the following sense: a graph GG satisfies ϕA\phi_{A} (or is a model of ϕA\phi_{A}) if and only if there is a graph morphism hh from AA to GG. Now consider B=\framebox{\hbox to41.27pt{\vbox to10.89pt{\pgfpicture\makeatletter\hbox{\hskip 9.36922pt\lower-5.09721pt\hbox to0.0pt{\lxSVG@begingroup@{_scopebegin=1} \lxSVG@begingroup@{stroke=#000000} \lxSVG@begingroup@{fill=#000000} \lxSVG@setlinewidth{\the\pgflinewidth}\lxSVG@begingroup@{stroke-width=0.4pt} \lx@inpgf@ignorespaces\nullfont\lxSVG@begingroup@{_scopebegin=1} \lxSVG@closescope \lxSVG@begingroup@{_scopebegin=1} \lxSVG@closescope \lxSVG@begingroup@{_scopebegin=1} \lxSVG@closescope \hbox to0.0pt{\lxSVG@begingroup@{_scopebegin=1} {{\lx@inpgf@ignorespaces}} \lxSVG@begingroup@{_scopebegin=1} {{}}\lx@inpgf@ignorespaces\hbox{\hbox{{\lxSVG@begingroup@{_scopebegin=1} {{}{}{{ {}{}}}{ {}{}} {{}{{\lx@inpgf@ignorespaces}}}{{}{\lx@inpgf@ignorespaces}}{}{{}{\lx@inpgf@ignorespaces}} {\lx@inpgf@ignorespaces }{{{{\lx@inpgf@ignorespaces}}\lxSVG@begingroup@{_scopebegin=1} \lxSVG@transformcm{1.0}{0.0}{0.0}{1.0}{-8.36922pt}{-2.15277pt}\lxSVG@begingroup@{transform=matrix(1.0 0.0 0.0 1.0 -11.58 -2.98)} \pgfsys@hbox{61}\lxSVG@closescope }}} \lxSVG@closescope }}} { {}{}{}}{{{ {}{}{}}}}{{}}\lx@inpgf@ignorespaces\hbox{\hbox{{\lxSVG@begingroup@{_scopebegin=1} {{}{}{{ {}{}}}{ {}{}} {{}{{\lx@inpgf@ignorespaces}}}{{}{\lx@inpgf@ignorespaces}}{}{{}{\lx@inpgf@ignorespaces}} {\lx@inpgf@ignorespaces }{{{{\lx@inpgf@ignorespaces}}\lxSVG@begingroup@{_scopebegin=1} \lxSVG@transformcm{1.0}{0.0}{0.0}{1.0}{14.61983pt}{-2.15277pt}\lxSVG@begingroup@{transform=matrix(1.0 0.0 0.0 1.0 20.23 -2.98)} \pgfsys@hbox{61}\lxSVG@closescope }}} \lxSVG@closescope }}} { {}{}{}}{}\lx@inpgf@ignorespaces\hbox{\hbox{{\lxSVG@begingroup@{_scopebegin=1} { {}{}{}}{}{ {}{}{}} {{{{{}}{ {}{}}{}{}{{}{}}}}}{}{{{{{}}{ {}{}}{}{}{{}{}}}}}{{}}{}{}{}{}{}{{{}{}}}{}{}{}{}{{}}\lxSVG@stroke\lxSVG@drawpath@unclipped{M 13.24 0.48 L 13.59 0.48}{fill:none} {{}{{}}{}{}{{}}{{{\lx@inpgf@ignorespaces}}{{{\lx@inpgf@ignorespaces}}{\lxSVG@begingroup@{_scopebegin=1} \lxSVG@transformcm{1.0}{0.0}{0.0}{1.0}{9.81989pt}{0.34723pt}\lxSVG@begingroup@{transform=matrix(1.0 0.0 0.0 1.0 13.59 0.48)} \lxSVG@begingroup@{_scopebegin=1} \lxSVG@drawpath@unclipped{M 4.98 0 C 3.51 0.28 1.11 1.11 -0.55 2.08 L -0.55 -2.08 C 1.11 -1.11 3.51 -0.28 4.98 0}{stroke:none} \lxSVG@closescope \lxSVG@closescope }}{{\lx@inpgf@ignorespaces}}}}\lx@inpgf@ignorespaces\hbox{\hbox{{\lxSVG@begingroup@{_scopebegin=1} {{}{}{{ {}{}}}{ {}{}} {{}{{\lx@inpgf@ignorespaces}}}{{}{\lx@inpgf@ignorespaces}}{}{{}{\lx@inpgf@ignorespaces}} {\lx@inpgf@ignorespaces }{{{{\lx@inpgf@ignorespaces}}\lxSVG@begingroup@{_scopebegin=1} \lxSVG@transformcm{1.0}{0.0}{0.0}{1.0}{9.42749pt}{1.54723pt}\lxSVG@begingroup@{transform=matrix(1.0 0.0 0.0 1.0 13.04 2.14)} \pgfsys@hbox{61}\lxSVG@closescope }}} \lxSVG@closescope }}} \lxSVG@closescope }}} \lxSVG@closescope \lxSVG@closescope {{ {}{}{}}}{\lx@inpgf@ignorespaces}{\lx@inpgf@ignorespaces}\hss}\lxSVG@discardpath\lxSVG@closescope \hss}}\lxSVG@closescope\endpgfpicture}}\vphantom{h}}, representing formula ϕB=∃x,y. a(x,y)\phi_{B}=\exists x,y.\,\mathsf{a}(x,y). Graph BB has an obvious inclusion morphism into AA, viz. i ⁣:B→Ai\colon B\rightarrow A. Therefore every morphism h ⁣:A→Gh\colon A\rightarrow G gives rise to a composed morphism i;h ⁣:B→Gi;h\colon B\rightarrow G, implying that every graph that satisfies ϕA\phi_{A} also satisfies ϕB\phi_{B}, thus ϕA\phi_{A} entails ϕB\phi_{B} (written ϕA⊨ϕB\phi_{A}\mathrel{\vDash}\phi_{B}). It is worth noting that, in this elementary framework, graph morphisms can represent both a satisfaction relation (between formulas and models) and an entailment relation among formulas.

These concepts were exploited for example by Chandra and Merlin in Chandra and Merlin (1977) in the framework of relational database queries. They show there that every conjunctive query (a formula of the ∃\exists-fragment, but with relations of any arity) has a natural model, viz. a graph, and query inclusion is equivalent to the existence of a graph homomorphism between those natural models. Therefore morphisms are not only sound, but also complete with respect to entailment, and it follows that query inclusion is decidable, even if NP-complete: an interesting logical result obtained with graph theoretical techniques.

In the realm of Graph Transformation Systems (GTSs) Ehrig et al. (2006); Heckel and Taentzer (2020), the need of representing formulas by graphs arose in a natural way. Indeed, in any approach a rule consists of at least two graphs, L⇝RL\leadsto R, and to apply it to a graph GG, first a morphism m:L→Gm:L\rightarrow G has to be found. By the above discussion, we can consider LL as a formula of the ∃\exists-fragment that has to be satisfied by GG, as an application condition of the rule.

It soon turned out that in order to use GTSs for even simple specifications, more expressive application conditions were needed. In Habel et al. (1996) the authors introduced Negative Application Conditions (NACs), allowing to express (to some extent) negation and disjunction. A NAC N\mathcal{N} is a finite set of morphisms from LL, N={ni:L→Qi}i∈[1,k]\mathcal{N}=\{n_{i}:L\rightarrow Q_{i}\}_{i\in[1,k]}, and a morphism m:L→Gm:L\rightarrow G satisfies N\mathcal{N} if for all i∈[1,k]i\in[1,k] there is no morphism mi:Qi→Gm_{i}:Q_{i}\rightarrow G such that ni;mi=mn_{i};m_{i}=m. It follows that such a NAC represents a formula of the shape ∃xˉ. ϕL∧¬(∃yˉ1. ϕQ1∨…∨∃yˉn. ϕQn)\exists\bar{x}.\,\phi_{L}\wedge\neg(\exists\bar{y}_{1}.\,\phi_{Q_{1}}\vee\ldots\vee\exists\bar{y}_{n}.\,\phi_{Q_{n}}): as in Rensink (2004), we call this the ∃¬∃\exists\neg\exists-fragment (of FOL).

Note that differently from the ∃\exists-fragment, the structures representing the ∃¬∃\exists\neg\exists-fragment are no longer graphs, but diagrams (“stars”) in Graph\mathbf{Graph}, the category of graphs; and satisfaction does not require just the existence of a matching morphism from LL, but also the non-existence of certain other morphisms. NACs were generalized in Rensink (2004); Habel and Pennemann (2009) to Nested (Application) Conditions, where the structure of a condition is a finite tree of arbitrary depth rooted at LL, and satisfaction is defined like for NACs, but iterating further at each level of the tree. Interestingly, nested conditions were proved to have the same expressive power of full FOL.

Since nested conditions denote formulas, they are the objects of an obvious category (actually, a preorder) where arrows represent entailment: paper Bruggink et al. (2011) includes a comprehensive presentation of this preorder and of the categorical properties of logical operators on conditions. But differently from the case of the ∃\exists-fragment, where entailment can be “explained” by the existence of a graph morphism, we are not aware of similar results for the larger ∃¬∃\exists\neg\exists-fragment nor for FOL. More explicitly, despite the fact that NACs first and Nested Conditions next were defined as suitable diagrams in a category of graphs (or of similar structures), we are not aware of definitions of structural morphisms among such application conditions, providing evidence for (some cases of) entailment like simple graph morphisms do for the ∃\exists-fragment. We addressed this issue for the first time in Rensink and Corradini (2024) by considering two classes of nested conditions, the arrow-based ones (those of Rensink (2004)) and the more refined span-based ones, introducing various kinds of morphisms for them. In this paper we stick to the first kind of conditions, but we propose a more systematic and general approach, which is the main contribution of this paper. In particular, the morphisms we define here at the same time are simpler than and subsume those of Rensink and Corradini (2024) for arrow-based conditions. Their generalization to span-based conditions is ongoing work.

We start by recalling in Sec. 2 the main definitions related to nested conditions and their satisfaction from Rensink (2004), and we present several constructions on them aimed at capturing logical operators in a categorical setting. The section is concluded by a completeness result showing that every condition can be built in a canonical way using the proposed operators. Section 3 presents the main original contribution, i.e. a very general and weak notion of structural morphisms among conditions, which satisfies the desired properties of being composable and having identities. Such morphisms include collection of arrows between the source and target condition, flipping direction at each nesting level, and forming certain (possibly not commuting) squares with the arrows of the conditions themselves. By imposing suitable conditions on such squares, we identify two subclasses of morphisms, reflective and the preservative ones, which are shown to reflect and preserve satisfaction, respectively, and thus witness entailment between the formulas associated with the related conditions. We also show that the composition of morphisms of the same kind is again a morphism of that kind, and that identities are morphisms of both kinds. Finally we show that under mild assumptions for each preservative morphism there is a reflective one in the opposite direction. In Sec. 4 we first frame the definitions of the various kind of morphisms of Sec. 3 and their relations in a categorical context, introducing several categories of conditions and identity-on-object functors among them. Next, this allows us to state and prove some functoriality and universality properties of the constructions on conditions of Sec. 2. Section 5 summarizes the contributions of the paper, discusses some related work and hints at future developments.