May 16, 2025
Graph Neural Networks (GNNs) are machine-learning models that operate on graph-structured data. Their expressive power is intimately related to logics that are invariant under graded bisimilarity. Current proposals for recurrent GNNs either assume that the graph size is given to the model, or suffer from a lack of termination guarantees. Here, we propose a halting mechanism for recurrent GNNs. We prove that our model can express all node classifiers definable in graded modal \(\mu\)-calculus, even for the standard GNN variant that is oblivious to the graph size. To prove our main result, we develop a new approximate semantics for graded \(\mu\)-calculus, which we believe to be of independent interest. We leverage this new semantics into a new model-checking algorithm, called the counting algorithm, which is oblivious to the graph size. In a final step we show that the counting algorithm can be implemented on a halting-classifier recurrent GNN.
Graph neural networks (GNNs) represent a popular class of machine-learning models on graphs [1]. A multitude of GNN variants have been proposed [2]–[4], but in their basic form, a GNN updates a vector of numerical features in every node of a graph by combining the node’s own feature vector with the sum of those of its neighbors. The combination is usually expressed by a feedforward neural network with ReLU activation functions [5]. The parameters of this network are typically learned, but in this paper we are concerned with the intrinsic expressiveness of the GNN model, and not on how GNNs can be concretely obtained from training data.
The “message passing” [6] between neighbors in the graph, just described, starts from an initial feature map and can go on for a fixed or variable number of rounds (referred to as fixed-depth or recurrent GNNs, respectively). Ultimately, of course, we want to do something with the feature vectors computed for the nodes. We focus on the task of node classification where in the end a boolean-valued classification function is applied to the feature vector of each node. In this way, GNNs express unary (i.e., node-selecting) queries on graphs. In graph learning, unary queries on graphs are known as node classifiers.
It is natural to ask about the power of GNNs in expressing node classifiers. Interestingly, this question can be approached through logic. Initial results focused on the question of distinguishability: given two finite pointed graphs \((G,v)\) and \((H,w)\), does there exist a GNN \(\mathcal{N}\) such that \(\mathcal{N}(G,v)\) is true but \(\mathcal{N}(H,w)\) is false? Distinguishability by GNNs was found to be closely related to distinguishability by color refinement. Specifically, it is easy to see that when \((G,v)\) and \((H,w)\) are graded bisimilar (see, e.g., [7] for a definition), which is equivalent to indistinguishability by color refinement, then \((G,v)\) and \((H,w)\) are indistinguishable by GNNs. It turns out that the converse implication holds as well [8].
For distinguishing finite graphs, it does not matter whether we work with fixed-depth or recurrent GNNs. This changes when considering uniform expressiveness; that is, the question which unary graph queries are expressible by GNNs? We saw above that all expressible graph queries are invariant under graded bisimilarity. An important related logic is graded modal logic GML [9], for it can express all so-called logical classifiers (i.e., unary queries that are expressible in first-order logic) that are invariant under graded bisimulation [7]. Interestingly, it has been shown that every GML formula is expressible by a fixed-depth GNN [10].
What about recurrent GNNs? A logical step is to gauge their expressiveness through the extension of GML with recursion, i.e., the graded \(\mu\)-calculus \(\mu\)GML[11]. This logic is not only fundamental in computer-aided verification, but also lies at the basis of expressive description logics. Our main result shows that every \(\mu\textsf{GML}\) formula is expressible by a recurrent GNN. Two important remarks are in order here. First, we work with the plain-vanilla variety of GNNs: the combination function is a feedforward network employing ReLU. Second, our recurrent GNNs are halting. By this we mean that the GNN includes a boolean-valued halting function, defined on feature vectors. The GNN we construct for any \(\mu\textsf{GML}\) formula \(\varphi\) comes with the following halting guarantee: on every finite graph, there exists an iteration where the halting function is true in every node. At that point, the classification function can be applied at every node and will be correct, i.e., agree with \(\varphi\). This global halting condition will be reached in a number of iterations that is polynomial in the graph size.
Getting such a halting guarantee is quite challenging, because a GNN operating on a graph \(G\) cannot know the precise number \(N\) of nodes of \(G\). Therefore, we cannot simply iterate fixpoint formulas \(N\) times to obtain the correct result. Extensions of GNNs that know the graph size, e.g., by global readout layers [10], or simply by setting the graph size at initialisation [12], have been considered. Our contribution is to show that global readouts are not necessary for expressing \(\mu\textsf{GML}\), if one adopts a global halting condition instead. This result is not only interesting from the perspective of fundamental understanding; simpler neural network architectures also tend to be easier to train, although experimental follow-up work is necessary to confirm this.
We prove our result in several steps. We consider, for any natural number \(k\), the approximate semantics for \(\mu\textsf{GML}\) that iterates all fixpoints exactly \(k\) times. Of independent interest, we define a notion of when the \(k\)-approximation semantics is stable on a graph \(G\), and show that when a \(k\)-approximation is stable, it coincides with the true semantics of \(\mu\textsf{GML}\). The challenge is to show that a recurrent GNN can express the \(k\)-approximation semantics for increasing values of \(k\) as well as track stability of the current approximation. We overcome this in two steps. We first define an algorithm, called the counting algorithm, that incrementally computes \(k\)-approximations and their stability. The correctness of the algorithm, which is oblivious to the graph size, is nontrivial. In a second, equally crucial step, we show how to implement the counting algorithm in a halting-classifier recurrent GNN.
This paper is organized as follows. Section 2 discusses related work. Section 3 provides preliminaries. Section 4 introduces halting-classifier recurrent GNNs. Section 5 presents the translation of \(\mu\)GML into halting-classifier recurrent GNNs. Section 6 offers concluding remarks.
In comparison with related work, the innovative aspect of our recurrent GNN model is the halting aspect. We are aware of two prior works relating recurrent GNNs to \(\mu\)-calculus.
Pflueger et al. consider a very general, abstract recurrent GNN model, where the combination function can be an arbitrary function, not necessarily a feedforward network, and likewise an arbitrary aggregation function can be used instead of summing of neighbors. Such a general model is still invariant under graded bisimulation. Moreover, they do not guarantee termination. Instead, they classify a node \(n\) as true if, during the infinite sequence of iterated message passing, the classification function applied to \(n\) eventually stabilizes to true. There is no apparent way to test this effectively.
In the setting of Pflueger et al., every node classifier invariant under graded bisimilarity (in particular, every \(\mu\textsf{GML}\) formula) is expressible by a recurrent GNN. Indeed, the contribution of their work lies much more in the converse direction. Establishing a preservation theorem regarding “local” monadic fixpoint logic (LocMMFP) formulas invariant under graded bisimilarity, they obtain that every recurrent GNN that expresses a node classifier expressible in LocMMFP is actually expressible in \(\mu\textsf{GML}\).
Ahvonen et al. investigate recurrent GNNs with yet another acceptance condition, which is neither a global halting condition (as ours) nor a local stabilization condition (as in Pflueger et al.). Their notion of GNN does not employ a classification function, but instead includes a set of accepting feature vectors. A node is classified as true if, during the iteration, it obtains such an accepting feature vector. Like acceptance by stabilization a la Pflueger et al., this semantics offers no practical termination guarantee; we can see when a node has “decided to be true”, but there is no clear-cut way to know that this will eventually happen, and hence no way to know that a node will be classified as false.
The acceptance semantics of Ahvonen et al. is a double-edged sword. On the one hand, it allows the expression of node classifiers such as the centre point property [13] that are not expressible in \(\mu\textsf{GML}\). On the other hand, by the lack of a global halting condition, nested or alternating fixpoints cannot be expressed; the most we can get using accepting feature vectors are countably infinite disjunctions of GML formulas (denoted by \(\omega\)GML). Using an instantiation of their model over the real numbers, with arbitrary aggregation and combination functions, Ahvonen et al. show that recurrent GNNs capture all of \(\omega\)GML. They also propose a realistic instantiation where every GNN comes with its own finite floating-point domain, aggregation is sum, and combination functions are truncated-ReLU layers. These floating-point recurrent GNNs are shown to coincide with GMSC, a logic that iterates GML formulas. In a technical report [14], they show that this continues to hold when using acceptance by stabilization a la Pflueger et al. Interestingly, they show the real and the float instantiations to express exactly the same node classifiers in MSO.
In parallel with our own work, Rosenbluth and Grohe have studied the computational completeness of recurrent GNNs. In contrast to ours, their model provides the graph size as input to the GNN, and operates on graphs with bitstring features. Their focus then is on showing that their model is Turing-complete for feature transformers invariant under the colorings produced by color refinement.
Notation. We denote by \(\mathbb{N}\) and \(\mathbb{R}\) the sets of natural numbers and real numbers, respectively. We denote by \(\mathbb{B}= \{0,1\}\) the set of booleans, where we identify false with \(0\) and true with \(1\). We denote the cardinality of a set \(X\) by \(|X|\), the powerset of \(X\) by \(\mathcal{P}(X)\) and by \(\mathcal{M}(X)\) the set of finite multisets over \(X\), i.e., the set of functions \(M: X \to \mathbb{N}\) whose support \(\mathop{\mathrm{\textit{supp}}}(M) :=\{x \in X \mid M(x) > 0\}\) is finite. Intuitively, \(M(x)=n\) means \(M\) contains \(n\) copies of \(x\). We use doubly curly braces \(\{\!\!\{\ldots \}\!\!\}\) to denote multiset comprehension.
Graphs. We work with finite, node-labeled, directed graphs. Given a set \(X\), an \(X\)-labeled graph is a triple \(G = (N, E, g)\) where \(N\) is a finite set of nodes; \(E \subseteq N \times N\) is the edge relation, and \(g\colon N \to X\) is the node labeling function. When \(X = \mathbb{R}^d\) for some \(d \in \mathbb{N}\), we call \(g\) a feature map. To ease notation, we write \(N_{G}\) for the node set of \(G\); \(n \in G\) to indicate that \(n \in N_{G}\); \(G(n)\) instead of \(g(n)\) to denote the label of node \(n\) in \(G\); and \(E_{G}(n)\) for the set \(\{m \in N \mid (n,m) \in E\}\) of all out-neighbours of \(n\) in \(G\). Our results easily extend to graphs that also admit labels on edges as well as nodes.
Label transformers and node classifiers. We write \(\mathcal{G}[X]\) for the set of all \(X\)-labeled graphs. A label transformer is a function \(f\colon \mathcal{G}[X] \to \mathcal{G}[Y]\) such that \(G\) and \(f(G)\) have the same nodes and edges for all \(G \in \mathcal{G}[X]\), but may differ in the node labels. If \(h\colon X \to Y\) is a function, then we write \({h\!\!\uparrow}\colon \mathcal{G}[X] \to \mathcal{G}[Y]\) for the label transformer that replaces the label of each node \(n\) in the input graph \(G\) by \(h(n)\). We say that \({h\!\!\uparrow}\) is obtained by lifting \(h\). A node classifier (on \(X\)) is a label transformer \(f\colon \mathcal{G}[X] \to \mathcal{G}[\mathbb{B}]\).
Graded modal \(\mu\)-calculus. We are interested in comparing the expressive power of recurrent GNNs to that of the graded modal \(\mu\)-calculus \(\mu\)GML. To define \(\mu\)GML, we assume given a finite set of proposition symbols \(\mathbb{P}=\{p, q, \ldots\}\) and a countable set \(\mathbb{X}= \{X, Y, \dots\}\) of variables, disjoint with \(\mathbb{P}\).
The formulae of \(\mu\textsf{GML}\) have the following syntax, where \(p \in \mathbb{P}\), \(X \in \mathbb{X}\), and \(k \in \mathbb{N}\) with \(k \geq 1\). \[\begin{gather} \varphi ::= p \mid \neg p \mid X \mid \varphi \land \varphi \mid \varphi \lor \varphi \\ \mid \Diamond_{k}\, \varphi \mid \Box_{k}\, \varphi \mid \mu X. \varphi \mid \nu X. \varphi. \end{gather}\] Without loss of generality, we hence adopt formulae in negation normal form, where the negation operator \(\neg\) can only be applied to proposition symbols. The modal operator \(\Diamond_{k} \varphi\) expresses that there are at least \(k\) neighbours where \(\varphi\) holds while \(\Box_{k} \varphi\) expresses that there are strictly less than \(k\) neighbours where \(\varphi\) does not hold. We also write \(\Diamond\varphi\) and \(\Box\varphi\) for \(\Diamond_{1} \varphi\) and \(\Box_{1} \varphi\). The fixed-point operators \(\mu X. \varphi\) and \(\nu X. \varphi\) are respectively used to define least and greatest fixed points, allowing for the expression of recursive properties.
Semantically, \(\mu\)GML formulae operate on \(\mathcal{P}(\mathbb{P})\)-labeled graphs. A valuation on such a graph \(G\) is a function \(V\) assigning a subset of vertices in \(G\) to each variable. The valuation \(V[X \mapsto S]\) is defined as the function that is equal to \(V\) on all variables except \(X\), which is mapped to \(S\). Given a \(\mathcal{P}(\mathbb{P})\)-labeled graph \(G\) and a valuation \(V\), a \(\mu\)-calculus formula \(\varphi\) evaluates to a set \(\llbracket \varphi \rrbracket^{G}_{V}\) of nodes in \(G\), inductively defined as follows. \[\begin{align} \llbracket p \rrbracket^{G}_{V} & :=\left\{ n \in G \,\middle|\, p \in G(n) \right\} \\ \llbracket \neg p \rrbracket^{G}_{V} & :=\left\{ n \in G \,\middle|\, p \notin G(n) \right\} \\ \llbracket X \rrbracket^{G}_{V} & :=V(X) \\ \llbracket \varphi \land \psi \rrbracket^{G}_{V} & :=\llbracket \varphi \rrbracket^{G}_{V} \cap \llbracket \psi \rrbracket^{G}_{V} \\ \llbracket \varphi \lor \psi \rrbracket^{G}_{V} & :=\llbracket \varphi \rrbracket^{G}_{V} \cup \llbracket \psi \rrbracket^{G}_{V} \\ \llbracket \Diamond_{k}{\varphi} \rrbracket^{G}_{V} & :=\left\{ n \in G \,\middle|\, | E_{G}(n) \cap \llbracket \varphi \rrbracket^{G}_{V}| \geq k \right\} \\ \llbracket \Box_{k}{\varphi} \rrbracket^{G}_{V} & :=\left\{ n \in G \,\middle|\, | E_{G}(n) \setminus \llbracket \varphi \rrbracket^{G}_{V}| < k \right\} \\ \llbracket \mu X. \varphi \rrbracket^{G}_{V} & :=\bigcap \left\{ S \subseteq N_{G} \,\middle|\, \llbracket \varphi \rrbracket^{G}_{V[X \mapsto S]} \subseteq S \right\} \\ \llbracket \nu X. \varphi \rrbracket^{G}_{V} & :=\bigcup \left\{ S \subseteq N_{G} \,\middle|\, S \subseteq \llbracket \varphi \rrbracket^{G}_{V[X \mapsto S]} \right\} \end{align}\] The notions of free and bound variables are defined as usual: \(\mu X. \varphi\) binds \(X\) in \(\varphi\) and similarly for \(\nu X. \varphi\). We use \(\textit{free}\left(\varphi\right)\), and \(\textit{vars}\left(\varphi\right)\) to denote the sets of free and all variables occurring in \(\varphi\), respectively. A formula is well-named if its free variables are distinct from its bound variables, and every variable is bound at most once in the formula. Throughout the paper we assume that all considered formulae are well-named. This is without loss of generality since ill-named formulae may always be made well-named by suitably renaming bound variables if necessary.
A sentence is a formula without free variables. Note that to evaluate a sentence, the valuation \(V\) is actually not needed, as the semantics depends only the valuation of the free variables. We can then write \(\llbracket \varphi \rrbracket^{G}_{}\) to denote \(\llbracket \varphi \rrbracket^{G}_{V}\) for any valuation \(V\).
A node classifier \(C\) on \(\mathcal{P}(\mathbb{P})\)-graphs is definable in \(\mu\)-calculus if there exists a \(\mu\)-calculus sentence \(\varphi\) such that \(\llbracket \varphi \rrbracket^{G}_{} = \{ n \in G \mid C(G)(n) = 1\}\) for all \(\mathcal{P}(\mathbb{P})\)-graphs \(G\). We also say that \(\varphi\) defines \(C\) in this case.
In this section we introduce our recurrent GNN model and show invariance under total surjective graded bisimulations.
An aggregate-combine (AC) layer [8], [10], [15] of input dimension \(p\) and output dimension \(q\) is a pair \(L = (\mathrm{\small Agg}, \mathrm{\small Comb})\) of functions where \(\mathrm{\small Agg}\colon \mathcal{M}(\mathbb{R}^p) \to \mathbb{R}^h\) with \(h \in \mathbb{N}\) is an aggregation function and \(\mathrm{\small Comb}\colon \mathbb{R}^p \times \mathbb{R}^h \to \mathbb{R}^q\) is a combination function. Semantically, such a layer is a label transformer: when executed on \(\mathbb{R}^p\)-labeled graph \(G = (N,E, g)\), it returns the \(\mathbb{R}^q\)-labeled graph \(G' = (N, E, g')\) with \(g'\) defined by \[g'\colon n \mapsto \mathrm{\small Comb}\big( g(n), \mathrm{\small Agg}\,\{\!\!\{g(m) \mid m \in E_{G}(n) \}\!\!\} \big).\] We abuse notation, and indicate by \(L\) both the AC layer and the label transformer that it defines.
Definition 1 (Recurrent GNN). Given a finite set \(X\), a halting-classifier-based recurrent GNN over \(X\) of dimension \(d\) is a tuple \(\mathcal{N}= (\mathrm{\small In}, L, \mathrm{\small Hlt}, \mathrm{\small Out})\) where \(\mathrm{\small In}\colon X \to \mathbb{R}^d\) is the initialisation function; \(L\) is an AC layer with input and output dimension \(d\); \(\mathrm{\small Hlt}\colon \mathbb{R}^d \to \mathbb{B}\) is the halting function; and \(\mathrm{\small Out}\colon \mathbb{R}^d \to \mathbb{B}\) is the readout function.
For parsimony we simply say “recurrent GNN” instead of “halting-classifier-based recurrent GNN” in what follows.
We next define the semantics of recurrent GNNs. A run of \(\mathcal{N}\) over \(X\)-labeled graph \(G\) is a finite sequence \(H_0, H_1, \dots, H_k\) of \(\mathbb{R}^d\)-labeled graphs such that \(H_0 = {\mathrm{\small In}\!\!\uparrow}(G)\) and \(H_{i+1} = L(H_i)\) for every \(1 \leq i < k\). A run is complete if every node in \({\mathrm{\small Hlt}\!\!\uparrow}(H_k)\) is labeled \(1\), and \(k\) is the first index for which this condition holds. The output of a complete run is the \(\mathbb{B}\)-labeled graph \({\mathrm{\small Out}\!\!\uparrow}(H_k)\).
Definition 2 (Halting recurrent GNN). A recurrent GNN\(\mathcal{N}\) over \(X\) is halting if there exists a complete run for every \(X\)-labeled input graph. If \(\mathcal{N}\) is halting, then we write \(\mathcal{N}(G)\) for the output of the complete run of \(\mathcal{N}\) on \(G\).
Halting recurrent GNNs hence define node classifiers whereas arbitrary recurrent GNNs may define only partial node classifiers, as some of their computations (i.e., runs) may never terminate. For completeness sake, we note that the problem of determining whether a given recurrent GNN is halting, is undecidable. However, the GNNs that we construct in this paper are always halting.
The problem of determining whether a given recurrent GNN is halting is undecidable.
Proof. We show that for any 3-counter machine, one can construct a simple recurrent GNN that halts if and only if the machine does. Whether a 3-counter machine halts is undecidable, hence the problem of determining whether a simple recurrent GNN halts on all inputs is also undecidable [16].
A 3-counter machine \(M\) is a sequence of instructions \(I_0, \dots, I_{n-1}\) where each instruction is either an increment instruction \(\textit{inc}(r)\) for a register \(r \in \{a,b,c\}\), or a conditional jump instruction \(\text{jdz}(r, j)\) for a register \(r \in \{a,b,c\}\) and a target instruction index \(j \in \{0, \dots, n-1\}\). A configuration of the machine is a tuple \((i, v_a, v_b, v_c) \in \mathbb{N}^4\) where \(i\) is the index of the current instruction and \(v_a, v_b, v_c\) are the current values of the registers. The machine halts if the instruction pointer \(i\) goes beyond \(n-1\).
The semantics of the instructions are as follows:
If instruction \(I_i\) is \(\textit{inc}(r)\), the next configuration is \((i+1, v'_a, v'_b, v'_c)\) where \(v'_r = v_r+1\) and the other register values remain unchanged.
If instruction \(I_i\) is \(\text{jdz}(r, j)\), the next configuration is \((i+1, v_a, v_b, v_c)\) if \(v_r=0\), and if \(v_r > 0\), the next configuration is \((j, v'_a, v'_b, v'_c)\) where \(v'_r = v_r-1\) and other register values remain unchanged.
Given a 3-counter machine \(M\) with \(n\) instructions, we construct a simple recurrent GNN\(\mathcal{N}\) that simulates it. The simulation operates independently on each vertex in the graph, and the feature vector of each vertex will encode the current configuration of the machine.
Let \(m\) be the number of \(\text{jdz}\) instructions in \(M\). A configuration \((i, v_a, v_b, v_c)\) is encoded by a vector \(\mathbf{x} \in \mathbb{R}^d\) with its components corresponding to the instruction pointer \(i\), the three counters \(a, b, c\), and for each \(\text{jdz}\) instruction in \(M\), a boolean flag used to handle the jump. As such, \(\mathbf{x}\) is a feature vector of dimension \(d = 4+m\). We number the \(\text{jdz}\) instructions as \(0, 1, \dots, m-1\) in the order they appear in the program. For the \(\ell\)-th \(\text{jdz}\) instruction, we use flag \(t_\ell\). Only one of these flags can be set to 1 at a time, indicating which jump we are currently processing, if any.
Initially, all components of the vector are zero, corresponding to the initial machine configuration \((0,0,0,0)\).
The AC layer \(L\) of \(\mathcal{N}\) updates the feature vector to simulate one step of the machine. We do not care to aggregate any incoming messages. The combination function is an RFNN that takes the current feature vector \(\mathbf{x}\) and computes the next feature vector \(\mathbf{x}'\).
The key difficulty is implementing the conditional jump of \(\text{jdz}(r,j)\), which requires changing the instruction pointer to an arbitrary value \(j\). As RFNNs cannot assign arbitrary values, we implement jumps iteratively. For each instruction index \(k\), let \(\mathrm{flag}(k)\) denote the flag index corresponding to instruction \(I_k\) if \(I_k\) is a \(\text{jdz}\) instruction, and undefined otherwise. When a jump from instruction \(k\) to \(j\) is required, the flag \(t_{\mathrm{flag}(k)}\) is set to 1. While any flag is 1, normal instruction execution is paused, and the instruction pointer \(i\) is moved towards \(j\) one step at a time. When \(i=j\), the flag is reset to 0.
Let \(\mathbf{x}_{i}, \mathbf{x}_{a}, \mathbf{x}_{b}, \mathbf{x}_{c}, \mathbf{x}_{t_0}, \dots, \mathbf{x}_{t_{m-1}}\) denote the components of the feature vector \(\mathbf{x}\). Let \(\mathbf{t} = \sum_{\ell=0}^{m-1} \mathbf{x}_{t_\ell}\). The RFNN implements the following logic:
When \(\mathbf{t} = 0\), i.e. during normal execution, let \(k = \mathbf{x}_i\) be the current instruction index, so we execute instruction \(I_k\): \[\begin{align} \mathbf{x}'_i &= \begin{cases} \mathbf{x}_i+1 & \text{if } I_k \in \{\textit{inc}(a), \textit{inc}(b), \textit{inc}(c)\} \\ \mathbf{x}_i+1 & \text{if } I_k = \text{jdz}(r,j) \text{ and } \mathbf{x}_r = 0 \\ \mathbf{x}_i & \text{if } I_k = \text{jdz}(r,j) \text{ and } \mathbf{x}_r > 0 \end{cases} \\ \mathbf{x}'_a &= \begin{cases} \mathbf{x}_a+1 & \text{if } I_k = \textit{inc}(a) \\ \mathbf{x}_a-1 & \text{if } I_k = \text{jdz}(a,j) \text{ and } \mathbf{x}_a > 0 \\ \mathbf{x}_a & \text{otherwise} \end{cases} \\ \mathbf{x}'_b &= \begin{cases} \mathbf{x}_b+1 & \text{if } I_k = \textit{inc}(b) \\ \mathbf{x}_b-1 & \text{if } I_k = \text{jdz}(b,j) \text{ and } \mathbf{x}_b > 0 \\ \mathbf{x}_b & \text{otherwise} \end{cases} \\ \mathbf{x}'_c &= \begin{cases} \mathbf{x}_c+1 & \text{if } I_k = \textit{inc}(c) \\ \mathbf{x}_c-1 & \text{if } I_k = \text{jdz}(c,j) \text{ and } \mathbf{x}_c > 0 \\ \mathbf{x}_c & \text{otherwise} \end{cases} \\ \mathbf{x}'_{t_\ell} &= \begin{cases} 1 & \text{if } \ell = \mathrm{flag}(k) \text{ and } I_k = \text{jdz}(r,j) \text{ and } \mathbf{x}_r > 0 \\ \mathbf{x}_{t_\ell} & \text{otherwise} \end{cases} \end{align}\]
When \(\mathbf{t} > 0\), i.e. during the gradual execution of a jump, for the active flag \(t_\ell=1\) where the \(\ell\)-th \(\text{jdz}\) instruction is \(I_p = \text{jdz}(r,j)\) for some instruction index \(p\): \[\begin{align} \mathbf{x}'_i &= \begin{cases} \mathbf{x}_i+1 & \text{if } \mathbf{x}_i < j \\ \mathbf{x}_i-1 & \text{if } \mathbf{x}_i > j \\ \mathbf{x}_i & \text{if } \mathbf{x}_i = j \end{cases} \\ \mathbf{x}'_a &= \mathbf{x}_a \\ \mathbf{x}'_b &= \mathbf{x}_b \\ \mathbf{x}'_c &= \mathbf{x}_c \\ \mathbf{x}'_{t_\ell} &= \begin{cases} 0 & \text{if } \mathbf{x}_i = j \\ 1 & \text{otherwise} \end{cases} \\ \mathbf{x}'_{t_q} &= \mathbf{x}_{t_q} \quad \text{for all } q \neq \ell \end{align}\]
All these operations (comparisons, increments, decrements) are expressible using RFNNs, as they can represent any piecewise linear function, which is sufficient for this logic.
The halting function \(\mathrm{\small Hlt}\) is defined as \(\mathrm{\small Hlt}(\mathbf{x}) = 1\) if and only if \(\mathbf{x}_i \geq n\).
Let a machine configuration be \(C_t = (i_t, v_{a,t}, v_{b,t}, v_{c,t})\) at machine step \(t\), and let the GNN feature vector be \(\mathbf{x}^{(s)}\) at GNN step \(s\). Our construction ensures that for each machine transition from \(C_t\) to \(C_{t+1}\), there exists a sequence of GNN steps \(s_t, \dots, s_{t+1}-1\) that simulate this transition.
An \(\textit{inc}\) instruction or a non-jumping \(\text{jdz}\) instruction corresponds to a single GNN step. A jumping \(\text{jdz}\) instruction corresponds to one step to set the jump flag, followed by multiple steps to iteratively adjust the instruction pointer, and a final step to unset the flag. The GNN halts precisely when the instruction pointer component \(\mathbf{x}_i\) reaches or exceeds \(n\), which corresponds exactly to the halting condition of the machine \(M\).
Since this construction can be done for any 3-counter machine, and the halting problem for such machines is undecidable, it follows that the problem of determining whether a given recurrent GNN halts on all inputs is also undecidable. ◻
The proof is based on a reduction from the (undecidable) halting problem for 3-counter machines [16].
Simple recurrent GNNs. A simple but practically relevant choice for the aggregation and combination functions of an AC layer, which is commonly used in the literature [10], [15], [17], is to take \[\begin{align} \mathrm{\small Agg}& \colon \mathcal{M}(\mathbb{R}^p) \to \mathbb{R}^p\colon M \mapsto \sum_{\mathbf{x} \in \mathop{\mathrm{\textit{supp}}}(M)} M(\mathbf{x}) \cdot \mathbf{x} \\ \mathrm{\small Comb}& \colon \mathbb{R}^p \times \mathbb{R}^p \to \mathbb{R}^q\colon (\mathbf{x}, \mathbf{y}) \mapsto f(\mathbf{x} \mathbin{|}\mathbf{y}) \end{align}\] where \(M(\mathbf{x}) \cdot \mathbf{x}\) is the scalar multiplication of \(\mathbf{x}\) by its multiplicity in \(M\); \(\mathbf{x} \mathbin{|}\mathbf{y}\) denotes vector concatenation; and \(f\) is a -based feedforward neural network (RFNN). That is, \(f\colon \mathbb{R}^{2p} \to \mathbb{R}^q\) is of the form \[A_\ell \circ \text{ReLU}\circ A_{\ell-1} \circ \dots \circ \text{ReLU}\circ A_1\] where \(A_i\colon \mathbb{R}^{p_i} \to \mathbb{R}^{p_{i+1}}, 1 \leq i \leq \ell\) are affine transformations with \(p_1 = 2p\) and \(p_{\ell+1} = q\), and \(\text{ReLU}\) is the Rectified Linear Unit, applying \(\text{ReLU}(x_i) = \max(0,x_i)\) to each vector element \(x_i\) of its input vector \(\mathbf{x}\). If \(L\) is of this form then we call \(L\) simple.
We say that the halting function \(\mathrm{\small Hlt}\) and readout function \(\mathrm{\small Out}\) of a recurrent GNN are simple if there is some \(1 \leq i \leq d\) such that for all \(\mathbf{x} \in \mathbb{R}^d\), \(\mathrm{\small Hlt}(\mathbf{x}) =1\) (resp. \(\mathrm{\small Out}(\mathbf{x}) = 1\)) if, and only if, the \(i\)-th element of \(\mathbf{x}\) is \(> 0\).
Definition 3. A recurrent GNN is simple if \(L\), \(\mathrm{\small Hlt}\) and \(\mathrm{\small Out}\) are all simple.
Invariance under graded bisimulation. As discussed in the Introduction and Section 2, a multitude of recurrent and non-recurrent GNN variants have been proposed in the literature. An important property in all of these variants, however, is that they are invariant under a notion of graded bisimulation. Note that our halting condition is global and this needs to be reflected in the notion of bisimulation. As a sanity check, therefore, we next establish invariance of our recurrent GNNs under total surjective graded bisimulations.
Definition 4 (Graded bisimulation). Let \(G\) and \(H\) be \(X\)-labeled graphs over a set of labels \(X\). A relation \(Z \subseteq N_{G} \times N_{H}\) is a graded bisimulation (or g-bisimulation) between \(G\) and \(H\) if for every \((n, m) \in Z\) the following hold:
\(G(n) = H(m)\),
there is a bijection \(f\colon E_{G}(n) \to E_{H}(m)\) such that \((i,f(i))\in Z\), for every \(i\in E_{G}(n)\).
The g-bisimulation is total (surjective, resp.), if the domain (range, resp.) of \(Z\) is \(N_{G}\) (\(N_{H}\), resp.).
Definition 5. A label transformer \(f\colon \mathcal{G}[X] \to \mathcal{G}[Y]\) is invariant under g-bisimulation if for every pair \(G\) and \(H\) of \(X\)-labeled graphs and every graded bisimulation \(Z\) between \(G\) and \(H\), it is the case that \(Z\) is also a graded bisimulation between \(f(G)\) and \(f(H)\). (Recall that \(G\) and \(f(G)\) have the same set of nodes, and similarly for \(H\) and \(f(H)\).)
Every node classifier definable by a halting recurrent GNN is invariant under total surjective g-bisimulations.
Proof. Notice that every aggregate-combine (AC) layer is a label transformer that is g-bisimulation invariant. Likewise the lifted initialisation and lifted readout functions yield g-bisimulation invariant label transformers. Since the composition of g-bisimulation invariant label transformers is a g-bisimulation invariant label transformer, the result follows by observing that the lifted halting function can be seen as a g-bisimulation invariant label transformer as well. Totality and surjectivity of the g-bisimulation quarantees that the readout function is enacted to runs of the same length. ◻
In this section we prove the central result of our paper.
Theorem 1. Every node classifier defined by \(\mu\)GML sentence \(\varphi\) is also definable by a simple halting recurrent GNN.
Our proof is constructive, but requires us to develop several new concepts and proceeds in multiple steps. First, in Section 5.1 we show how to view the computation of \(\varphi\) as a sequence of approximations \({\varphi}^{(1)}, {\varphi}^{(2)}, {\varphi}^{(3)}, \dots\). We observe that this sequence reaches a fixpoint equaling \(\varphi\) as soon as we reach an approximation \({\varphi}^{(k)}\) that is stable (Def. 6), which is guaranteed to happen when \(k\) exceeds the graph size, but may also happen earlier (Proposition [prop:smallest-stable-uniform-approximation-terminates-and-is-correct]). In Section 5.3 we define an algorithm, called the counting algorithm, for computing the elements in the sequence of approximations and tracking their stability at the same time. The counting algorithm is expressed as a transition system on configurations. We then show in Section 5.5 that configurations can be encoded as labeled graphs, and give a simple recurrent GNN that simulates the counting algorithm’s transition system. The GNN’s halting classifier tests the stability of the current encoded configuration to decide if \(\varphi\) is fully computed.
We will require the following notation. For a \(\mu\)GML formula \(\varphi\) we write \(\textit{sub}\left(\varphi\right)\) for the set of direct subformulae of \(\varphi\). For example, if \(\varphi = \neg p \vee (X \wedge \Diamond_{} q)\), then \(\textit{sub}\left(\varphi\right)\) consists of \(\neg p\) and \(X \wedge \Diamond_{} q\). Note that \(\textit{sub}\left(p\right) = \textit{sub}\left(\neg p\right) = \textit{sub}\left(X\right) = \emptyset\). We write \(\textit{sub}^+(\varphi)\) for the set of all strict (not necessarily direct) subformulae of \(\varphi\), computed recursively. In the example above, \(\textit{sub}^+(\varphi)\) consists of \(\neg p\), \(X\), \(q\), \(\Diamond_{} q\) and \(X \wedge \Diamond_{} q\). We write \(\textit{sub}^*(\varphi)\) for \(\textit{sub}^+(\varphi)\cup\{\varphi\}\). We write \(\textit{sub}_{\mu}\left(\varphi\right)\) (resp. \(\textit{sub}_{\nu}\left(\varphi\right)\)) for the subset of \(\textit{sub}\left(\varphi\right)\) consisting of those formulae that are of the form \(\mu X. \psi\) (resp. \(\nu X. \psi\)), and let \(\textit{sub}_{\pi}\left(\varphi\right) = \textit{sub}_{\mu}\left(\varphi\right) \cup \textit{sub}_{\nu}\left(\varphi\right)\). The notations \(\textit{sub}_{\mu}^+(\varphi)\), \(\textit{sub}_{\mu}^*(\varphi)\) etc. are defined similarly as subsets of \(\textit{sub}^+(\varphi)\) and \(\textit{sub}^*(\varphi)\). We abuse notation, and use operators that are defined on formulae also on sets of formulae, unioning the pointwise results. For example, we write \(\textit{sub}_{\pi}^+(A)\) for \(\bigcup_{\varphi \in A} \textit{sub}_{\pi}^+(\varphi)\). We will use the notation \(\pi X. \psi\) to refer to any fixpoint formula, least or greatest (i.e. \(\pi \in \{\mu,\nu\}\)).
We define the syntax of approximation-adorned \(\mu\)GML (henceforth simply called adorned \(\mu\)GML) to be equal to the syntax of \(\mu\)GML, except that all fixpoint-operators are of the form \(\mu^i X. \psi\) or \(\nu^i X. \psi\), with \(i \in \mathbb{N}\) and \(\psi\) itself adorned. \[\begin{gather} \varphi ::= p \mid \neg p \mid X \mid \varphi \land \varphi \mid \varphi \lor \varphi \\ \mid \Diamond_{k} \varphi \mid \Box_{k} \varphi \mid \mu^i X. \varphi \mid \nu^i X. \varphi. \end{gather}\] The semantics of adorned formulae is defined similarly to that of normal formulae, except that \[\begin{align} \llbracket \mu^i X. \varphi \rrbracket^{G}_{V} & := \begin{cases} \emptyset & \text{if } i = 0, \\ \llbracket \varphi \rrbracket^{G}_{V[X \mapsto \llbracket \mu^{i-1} X. \varphi \rrbracket^{G}_{V}]} & \text{otherwise.} \end{cases} \\ \llbracket \nu^i X. \varphi \rrbracket^{G}_{V} & := \begin{cases} N & \text{if } i = 0, \\ \llbracket \varphi \rrbracket^{G}_{V[X \mapsto \llbracket \nu^{i-1} X. \varphi \rrbracket^{G}_{V}]} & \text{otherwise.} \end{cases} \end{align}\] Intuitively, \(\mu^i X. \varphi\) computes an under-approximation of \(\mu X. \varphi\), obtained by iterating \(\varphi\) for \(i\) iterations, while \(\nu^i X. \varphi\) similarly computes an over-approximation of \(\nu X. \varphi\).
For a normal \(\mu\)GML formula \(\varphi\) and \(i \in \mathbb{N}\), we denote by \({\varphi}^{(i)}\) the adorned \(\mu\)GML formula that is obtained by adorning every fixpoint operator of the form \(\mu X\) resp \(\nu X\) by \(\mu^i X\) resp. \(\nu^i X\). For instance: \[\begin{align} \varphi & = \mu Y. \left( \left(p \vee \;\Diamond_{} Y\right) \vee \left(\mu X. \left(q \wedge \Diamond_{} \left(Y \vee \Diamond_{} X\right)\right) \right) \right) \\ {\varphi}^{(i)} & = \mu^i Y. \left( \left(p \vee \;\Diamond_{} Y\right) \vee \left(\mu^i X. \left(q \wedge \Diamond_{} \left(Y \vee \Diamond_{} X\right)\right) \right) \right) \end{align}\] Intuitively, \({\varphi}^{(i)}\) approximates \(\varphi\) by iterating every fixpoint for \(i\) times. We also call \({\varphi}^{(i)}\) the \(i\)-th uniform approximation of \(\varphi\). Note that, because \(\varphi\) may have nested and alternating fixpoints, \({\varphi}^{(i)}\) itself is not necessarily an under-approximation, nor an over-approximation of \(\varphi\).
For a fixpoint formula \(\varphi= \pi X. \psi\) and \(i,k \in \mathbb{N}\) we write \({\varphi}^{(i,k)}\) for the adorned formula \(\pi^{i} X. {\psi}^{(k)}\) that iterates the outermost fixpoint \(i\) times, and all inner fixpoints \(k\) times. For instance: \[\begin{align} \varphi & = \mu Y. \left( \left(p \vee \;\Diamond_{} Y\right) \vee \left(\mu X. \left(q \wedge \Diamond_{} \left(Y \vee \Diamond_{} X\right)\right) \right) \right) \\ {\varphi}^{(i,k)} & = \mu^i Y. \left( \left(p \vee \;\Diamond_{} Y\right) \vee \left(\mu^k X. \left(q \wedge \Diamond_{} \left(Y \vee \Diamond_{} X\right)\right) \right) \right) \end{align}\]
Definition 6. Let \(k \in \mathbb{N}, k \geq 1\). A \(\mu\)GML formula \(\varphi\) is \(k\)-stable on input graph \(G\), valuation \(V\), and node \(n \in G\) if
\(\varphi\) is not a fixpoint formula (i.e., not of the form \(\pi X. \psi\)) and every direct subformula of \(\varphi\) is \(k\)-stable on \((G,V,n)\). In particular \(p\), \(\neg p\), and \(X\) are always \(k\)-stable on \((G,V,n)\) as they do not have direct subformulae.
Or, \(\varphi\) is a fixpoint formula \(\pi X. \psi\) and
\(n \in \llbracket {\varphi}^{(k,k)} \rrbracket^{G}_{V}\) iff \(n \in \llbracket {\varphi}^{(k-1,k)} \rrbracket^{G}_{V}\); and
for every \(0 \leq i < k\), \(\psi\) is \(k\)-stable on \((G,V_i,n)\) where \(V_i = V[X \mapsto \llbracket {\varphi}^{(i,k)} \rrbracket^{G}_{V}]\).
Formula \(\varphi\) is \(k\)-stable on \((G,V)\) if it is \(k\)-stable on \((G,V,n)\) for every \(n \in G\).
Definition 6 defines pointwise \(k\) stability, taken at a single node \(n \in G\). For the proof of Proposition [prop:smallest-stable-uniform-approximation-terminates-and-is-correct], it is convenient to also define global \(k\)-stability.
Definition 7. Let \(k \in \mathbb{N}, k \geq 1\). A \(\mu\)GML formula \(\varphi\) is globally \(k\)-stable on input graph \(G\) and valuation \(V\) if
\(\varphi\) is not a fixpoint formula and every \(\psi \in \textit{sub}\left(\varphi\right)\) is \(k\)-stable on \((G,V)\). In particular \(p\), \(\neg p\), and \(X\) are always \(k\)-stable on \((G,V)\) as they do not have strict subformulae.
Or, \(\varphi\) is a fixpoint formula \(\pi X. \psi\) and
\(\llbracket {\varphi}^{(k,k)} \rrbracket^{G}_{V} = \llbracket {\varphi}^{(k-1,k)} \rrbracket^{G}_{V}\); and
for every \(0 \leq i < k\), \(\psi\) is \(k\)-stable on \((G,V_i)\) where \(V_i = V[X \mapsto \llbracket {\varphi}^{(i,k)} \rrbracket^{G}_{V}]\).
Lemma 1. \(\varphi\) is globally \(k\)-stable on \((G,V)\) if, and only if \(\varphi\) is (pointwise) \(k\)-stable on \((G,V, n)\) for every \(n\in G\).
Proof. By straightforward induction on \(\varphi\). ◻
The following proposition implies that if a formula is globally \(k\)-stable for a given \(k\), then it is also globally \(l\)-stable for all \(l \geq k\). Moreover, the value computed by the uniform \(k\)-approximation equals that of the uniform \(l\)-approximation for \(l \geq k\).
If \(\mu\)GML formula \(\varphi\) is globally \(k\)-stable on \((G,V)\) with \(k \geq 1\) then:
\(\llbracket {\varphi}^{(k)} \rrbracket^{G}_{V} = \llbracket {\varphi}^{(k+1)} \rrbracket^{G}_{V}\); and
\(\varphi\) is globally \((k+1)\)-stable on \((G,V)\).
Proof. Assume \(k \geq 1\) and \(\varphi\) \(k\)-stable on \((G,V)\). The proof is by structural induction on \(\varphi\). For the base cases where \(\varphi\) is \(p\), \(\neg p\) or \(X\) the result is immediate. For the cases where \(\varphi\) is of the form \(\psi \vee \psi'\), \(\psi \wedge \psi'\), \(\Diamond_{\ell}\, \psi\), or \(\Box_{\ell}\, \psi\) the result follows straightforwardly from the induction hypothesis. When \(\varphi = \mu X. \psi\) we reason as follows.
For \(0 \leq i < k\), let \(V_i = V[X \mapsto \llbracket \mu^i X. {\psi}^{(k)} \rrbracket^{G}_{V}]\). Because \(\psi\) is globally \(k\)-stable on \((G,V_i)\) for each \(0 \leq i < k\), we know by induction hypothesis that \(\llbracket {\psi}^{(k)} \rrbracket^{G}_{V_i} = \llbracket {\psi}^{(k+1)} \rrbracket^{G}_{V_i}\) and that \(\psi\) is globally \((k+1)\) stable w.r.t. \((G, V_i)\).
To prove property (i), we first claim that for any \(0 \leq i \leq k\) we have \[\label{eq:stable-preservation-claim} \llbracket \mu^i X. {\psi}^{(k)} \rrbracket^{G}_{V} = \llbracket \mu^i X. {\psi}^{(k+1)} \rrbracket^{G}_{V}\tag{1}\] The proof of this claim is by an inner induction on \(i\).
When \(i = 0\) the reasoning is trivial, since both \(\llbracket \mu^i X. {\psi}^{(k)} \rrbracket^{G}_{V} = \emptyset\) and \(\llbracket \mu^i X. {\psi}^{(k+1)} \rrbracket^{G}_{V} = \emptyset\) by definition of the adorned semantics.
When \(i > 0\), first observe that, by the inner induction hypothesis, \[\begin{align} \label{eq:stable-preservation-1} V_{i-1} & = V[X \mapsto \llbracket \mu^{i-1} X. {\psi}^{(k)} \rrbracket^{G}_{V}] \nonumber \\ & = V[X \mapsto \llbracket \mu^{i-1} X. {\psi}^{(k+1)} \rrbracket^{G}_{V}]. \end{align}\tag{2}\] Therefore, \[\begin{align} \llbracket \mu^i X. {\psi}^{(k)} \rrbracket^{G}_{V} & = \llbracket {\psi}^{(k)} \rrbracket^{G}_{V_{i-1}} \\ & = \llbracket {\psi}^{(k+1)} \rrbracket^{G}_{V_{i-1}} \\ & = \llbracket {\psi}^{(k+1)} \rrbracket^{G}_{V[X \mapsto \llbracket \mu^{i-1} X. {\psi}^{(k+1)} \rrbracket^{G}_{V}]} \\ & = \llbracket \mu^i X. {\psi}^{(k+1)} \rrbracket^{G}_{V} \end{align}\] The first equality is by definition of the adorned semantics; the second by the outer induction hypothesis; the third by 2 ; and the last again by definition of approximate semantics.
Because \(\varphi\) is globally \(k\)-stable, we know that \(\llbracket \mu^k X. {\psi}^{(k)} \rrbracket^{G}_{V} = \llbracket \mu^{k-1} X. {\psi}^{(k)} \rrbracket^{G}_{V}\). Therefore, by 1 , also \[\label{eq:stable-preservation-2} \llbracket \mu^k X. {\psi}^{(k+1)} \rrbracket^{G}_{V} = \llbracket \mu^{k-1} X. {\psi}^{(k+1)} \rrbracket^{G}_{V}.\tag{3}\] Hence, \[\begin{align} \llbracket \mu^{k+1} X. {\psi}^{(k+1)} \rrbracket^{G}_{V} &= \llbracket {\psi}^{(k+1)} \rrbracket^{G}_{V[X\mapsto \llbracket \mu^k X. {\psi}^{(k+1)} \rrbracket^{G}_{V}]} \nonumber \\ & = \llbracket {\psi}^{(k+1)} \rrbracket^{G}_{V[X\mapsto \llbracket \mu^{k-1} X. {\psi}^{(k+1)} \rrbracket^{G}_{V}]} \nonumber \\ & = \llbracket \mu^{k} X. {\psi}^{(k+1)} \rrbracket^{G}_{V} \label{eq:stable-preservation-3} \end{align}\tag{4}\] We then readily obtain property (i): \[\begin{align} \llbracket {\varphi}^{(k)} \rrbracket^{G}_{V} &= \llbracket \mu^k X. {\psi}^{(k)} \rrbracket^{G}_{V} \\ & = \llbracket \mu^k X. {\psi}^{(k+1)} \rrbracket^{G}_{V} \\ & = \llbracket \mu^{k+1} X. {\psi}^{(k+1)} \rrbracket^{G}_{V} \\ & = \llbracket {\varphi}^{(k+1)} \rrbracket^{G}_{V} \end{align}\] The first equality is by definition of uniform \(k\)-approximation; the second by 1 , the third by 4 , and the final equality by definition of \(k+1\)-approximation.
It remains to prove that also property (ii) holds. We have already established 4 that \(\llbracket \mu^{k+1} X. {\psi}^{(k+1)} \rrbracket^{G}_{V} = \llbracket \mu^{k} X. {\psi}^{(k+1)} \rrbracket^{G}_{V}\). It remains to prove that for every \(0 \leq j < k+1\), \(\psi\) is globally \(k+1\)-stable on \((V,W_j)\), where \(W_j = V[X \mapsto \llbracket \mu^j X. {\psi}^{(k+1)} \rrbracket^{G}_{V}]\). To that end, first note that for \(0 \leq j < k\), \(W_j = V_j\) by 1 . Furthermore, by 3 , \(W_k = W_{k-1} = V_{k-1}\). By the outer induction hypothesis we know that \(\psi\) is globally \(k+1\)-stable w.r.t. \((G,V_i)\) for \(1 \leq i < k\). As such, \(\psi\) is \(k+1\)-stable w.r.t. \((G,W_j)\) for \(1 \leq j < k+1\), as desired.
The reasoning when \(\varphi = \nu X.\psi\) is entirely analogous. ◻
The following proposition shows that, for large enough values of \(k\), every formula becomes globally \(k\)-stable and its approximate value equals the full fixpoint result.
Let \(G\) be a graph with node set \(N\) and assume \(k \in \mathbb{N}\) with \(k > |N|\). Then, for any \(\mu\)-calculus formula \(\varphi\) and valuation \(V\) we have \(\llbracket {\varphi}^{(k)} \rrbracket^{G}_{V} = \llbracket \varphi \rrbracket^{G}_{V}\) and \(\varphi\) is globally \(k\)-stable on \((G,V)\).
Proof. Fix \(G\), \(k\), \(\varphi\) and \(V\) as stated. Observe that \(k \geq 1\).
The proof is by structural induction on \(\varphi\). For the base cases where \(\varphi\) is \(p\), \(\neg p\) or \(X\) the result is immediate. For the cases where \(\varphi\) is of the form \(\psi \vee \psi'\), \(\psi \wedge \psi'\), \(\Diamond_{\ell}\, \psi\), or \(\Box_{\ell}\, \psi\) the result follows straightforwardly from the induction hypothesis. When \(\varphi = \mu X. \psi\) we reason as follows.
For \(0 \leq i < k\), let \(V_i = V[X \mapsto \llbracket \mu^i X. {\psi}^{(k)} \rrbracket^{G}_{V}]\). By induction hypothesis we know that \(\llbracket {\psi}^{(k)} \rrbracket^{G}_{V_i} = \llbracket \psi \rrbracket^{G}_{V_i}\).
We claim that for any \(0 \leq i \leq k\) we have \[\label{eq:stable-guaranteed-claim} \llbracket \mu^i X. {\psi}^{(k)} \rrbracket^{G}_{V} = \llbracket \mu^i X. \psi \rrbracket^{G}_{V}\tag{5}\] Here, on the right-hand side, \(\llbracket \mu^i X. \psi \rrbracket^{G}_{V}\) for \(\mu\textsf{GML}\) formula \(\psi\) is inductively defined as follows, completely similar to the semantics of adorned formulae, but with the difference that any inner fixpoint formula in \(\psi\) is evaluated non-approximately. \[\llbracket \mu^i X. \psi \rrbracket^{G}_{V} = \begin{cases} \emptyset & \text{if } i = 0, \\ \llbracket \psi \rrbracket^{G}_{V[X \mapsto \llbracket \mu^{i-1} X. \psi \rrbracket^{G}_{V}]} & \text{otherwise.} \end{cases}\] The proof of the claim is by an inner induction on \(i\).
When \(i = 0\) the reasoning is trivial, since both \(\llbracket \mu^i X. {\psi}^{(k)} \rrbracket^{G}_{V} = \emptyset\) and \(\llbracket \mu^i X. \psi \rrbracket^{G}_{V} = \emptyset\) by definition.
When \(i > 0\), first observe that, by the inner induction hypothesis, \[\begin{align} \label{eq:stable-guaranteed-1} V_{i-1} & = V[X \mapsto \llbracket \mu^{i-1} X. {\psi}^{(k)} \rrbracket^{G}_{V}] \nonumber \\ & = V[X \mapsto \llbracket \mu^{i-1} X. \psi \rrbracket^{G}_{V}]. \end{align}\tag{6}\] Therefore, \[\begin{align} \llbracket \mu^i X. {\psi}^{(k)} \rrbracket^{G}_{V} & = \llbracket {\psi}^{(k)} \rrbracket^{G}_{V_{i-1}} \\ & = \llbracket \psi \rrbracket^{G}_{V_{i-1}} \\ & = \llbracket \psi \rrbracket^{G}_{V[X \mapsto \llbracket \mu^{i-1} X. \psi \rrbracket^{G}_{V}]} \\ & = \llbracket \mu^i X. \psi \rrbracket^{G}_{V} \end{align}\] The first equality is by definition of the approximate semantics; the second by the outer induction hypothesis; the third by 6 ; and the last again by definition of approximate semantics.
In particular, \(\llbracket {\varphi}^{(k)} \rrbracket^{G}_{V} = \llbracket \mu^k X. {\psi}^{(k)} \rrbracket^{G}_{V} = \llbracket \mu^k X. \psi \rrbracket^{G}_{V}\).
It remains to show that \(\llbracket \mu^k X. \psi \rrbracket^{G}_{V} = \llbracket \mu X. \psi \rrbracket^{G}_{V}\), which is a standard textbook argument concerning least fixpoints. We include it here for completeness only.
First observe that \(\llbracket \mu^k X. \psi \rrbracket^{G}_{V} \subseteq \llbracket \mu X. \psi \rrbracket^{G}_{V}\). (This is a standard argument, by induction on \(k\).)
For the other direction, remark that, because \(\mu\)-calculus formulae are monotonic in the valuation1, it holds that \[\emptyset \subseteq \llbracket \mu^1 X.\psi \rrbracket^{G}_{V} \subseteq \dots \subseteq \llbracket \mu^{k-1} X.\psi \rrbracket^{G}_{V} \subseteq \llbracket \mu^k X.\psi \rrbracket^{G}_{V}.\]
Each set in this sequence is necessarily a subset of \(N\). Since \(N\) holds strictly less than \(k\) elements, there must exist some index \(0 \leq i < k\) such that \(\llbracket \mu^i X. \psi \rrbracket^{G}_{V} = \llbracket \mu^{i+1} X. \psi \rrbracket^{G}_{V}\). Then, by definition of approximate semantics, also \(\llbracket \mu^j X. \psi \rrbracket^{G}_{V} = \llbracket \mu^{j+1} X. \psi \rrbracket^{G}_{V}\) for every \(j\) with \(i \leq j < k\). So, in particular, \(\llbracket \mu^{k-1} X. \psi \rrbracket^{G}_{V} = \llbracket \mu^{k} X. \psi \rrbracket^{G}_{V}\).
Hence, \(\llbracket \psi \rrbracket^{G}_{V[X\mapsto \llbracket \mu^{k-1}X.\psi \rrbracket^{G}_{V}]} = \llbracket \mu^{k} X. \psi \rrbracket^{G}_{V} \subseteq \llbracket \mu^{k-1} X. \psi \rrbracket^{G}_{V}\). In other words, \(\llbracket \mu^{k-1} X. \psi \rrbracket^{G}_{V} \in \left\{ S \subseteq N \,\middle|\, \llbracket \psi \rrbracket^{G}_{V[X \mapsto S]} \subseteq S \right\}\).
Therefore, \[\begin{align} \llbracket \mu X. \psi \rrbracket^{G}_{V} & = \bigcap \left\{ S \subseteq N \,\middle|\, \llbracket \alpha \rrbracket^{G}_{V[X \mapsto S]} \subseteq S \right\} \\ & \subseteq \llbracket \mu^{k-1} X. \psi \rrbracket^{G}_{V} = \llbracket \mu^{k} X. \psi \rrbracket^{G}_{V}, \end{align}\] as desired.
It remains to prove that \(\varphi\) is globally \(k\)-stable w.r.t. \((G,V)\). Note that, by our earlier reasoning, \[\begin{align} \llbracket \mu^k X. {\psi}^{(k)} \rrbracket^{G}_{V} & = \llbracket \mu^k X. \psi \rrbracket^{G}_{V} \\ & = \llbracket \mu^{k-1} X. \psi \rrbracket^{G}_{V} = \llbracket \mu^{k-1} X. {\psi}^{(k)} \rrbracket^{G}_{V} \end{align}\] Furthermore, by the outer induction hypothesis, \(\psi\) is globally \(k\)-stable w.r.t. any valuation, hence this holds in particular w.r.t. for the \(V_i\) with \(0 \leq i < k\), as desired. ◻
The following proposition shows that the sequence \({\varphi}^{(1)}, {\varphi}^{(2)}, {\varphi}^{(3)}, \dots\) of uniform approximations of \(\varphi\) reaches a fixpoint that equals \(\varphi\) as soon as we reach an approximation \({\varphi}^{(k)}\) that is \(k\)-stable. This is guaranteed to happen when \(k\) exceeds the graph size, but may also happen earlier. Hence, for any \(\mu\)GML formula \(\varphi\), graph \(G\), and valuation \(V\) we may compute \(\llbracket \varphi \rrbracket^{G}_{V}\) by means of the following simple algorithm:
(*) Compute the \(k\)-approximation \(\llbracket {\varphi}^{(k)} \rrbracket^{G}_{V}\) for increasing values of \(k\), and stop as soon as \(\varphi\) becomes \(k\)-stable on \((G,V)\). Then return \(\llbracket {\varphi}^{(k)} \rrbracket^{G}_{V}\).
For all \(k \geq 1\), \(G\) and \(V\) it holds that:
if \(\varphi\) is \(k\)-stable on \((G,V)\) then \(\llbracket {\varphi}^{(k)} \rrbracket^{G}_{V} = \llbracket \varphi \rrbracket^{G}_{V}\); and
if \(k > |N_{G}|\), then \(\varphi\) is \(k\)-stable on \((G,V)\).
Proof. Follows directly from Lemma 1, Proposition [prop:stable-preservation] and Proposition [prop:stable-guaranteed-at-number-of-nodes] ◻
We define the following notion related to \(k\)-stability.
Definition 8. Let \(j,k \in \mathbb{N}\) with \(k \geq 1\). A \(\mu\)GML fixpoint formula \(\varphi = \pi X. \psi\) is (j,k)-stable on input graph \(G\), valuation \(V\) and node \(n \in G\) if for every \(0 \leq i < j\), \(\psi\) is \(k\)-stable on \((G,V_i,n)\) where \(V_i = V[X \mapsto \llbracket {\varphi}^{(i,k)} \rrbracket^{G}_{V}]\).
Note that if \(j = 0\), then \(\varphi\) is vacuously \((0,k)\)-stable on \((G,V,n)\). Furthermore if \(\varphi\) is \(k\)-stable on \((G,V,n)\), then it is also \((k,k)\)-stable on \((G,V,n)\) but the converse does not hold since item (1) of Definition 6 is not necessarily guaranteed. In general, \((j,k)\)-stability on fixpoint formulae is hence a weaker notion than \(k\)-stability.
To prove Theorem 1 we next define an algorithm, called the counting algorithm, that implements (*). To later allow easy simulation by means of a recurrent GNNs, we define the counting algorithm as a transition system operating on configurations. We also take up the important task of proving correctness. How to simulate the counting algorithm by means of a recurrent GNN is shown in Subsection 5.5.
Throughout this section and the next, let \(\varphi\) be a fixed \(\mu\)GML sentence. Our convention that \(\mu\)GML formulae are well-named implies that for every variable \(X \in \textit{vars}\left(\varphi\right)\) there exists exactly one fixpoint formula in \(\textit{sub}_{\pi}^*(\varphi)\) that binds \(X\). We denote this binding formula by \(\varphi|_X\).
A counter on \(\varphi\) is a mapping \(C\colon \textit{sub}_{\pi}^*(\varphi) \to \mathbb{N}\). To ease notation, we write \(C\leq k\) (resp. \(C= k\)) to indicate that \(C(\alpha) \leq k\) (resp. \(C(\alpha) = k\)) for all \(\alpha \in \textit{sub}_{\pi}^*(\varphi)\).
Because the semantics of a formula only depends on its free variables, and because the free variables of \(\varphi\) and all of its subformulae are subsets of \(\textit{vars}\left(\varphi\right)\), we can treat valuations on a graph \(G\) as finite mappings \(V\colon \textit{vars}\left(\varphi\right) \to \mathcal{P}(N_{G})\). We refer to such mappings as \(\varphi\)-valuations.
Definition 9. Let \(\varphi\) be a \(\mu\)GML sentence. A configuration of \(\varphi\) is a tuple \(\kappa= (G, k, C, V, R, F, S, T)\) where \(G\) is a \(\mathcal{P}(\mathbb{P})\)-labeled graph; \(k \in \mathbb{N}\) with \(k \geq 1\) is called the bound of \(\kappa\); \(C\) is a counter on \(\varphi\) with \(C\leq k-1\); \(V\) is a \(\varphi\)-valuation on \(G\); \(R\colon \textit{sub}^*(\varphi) \to \mathcal{P}(N_{G})\); \(F\subseteq \textit{sub}^*(\varphi)\); \(S\colon \textit{sub}^*(\varphi)\to \mathcal{P}(N_{G})\); and \(T\colon \textit{sub}_{\pi}^*(\varphi) \to \mathcal{P}(N_{G})\).
Intuitively, the bound \(k\) in a configuration will indicate the uniform approximation of \({\varphi}^{(k)}\) for which we are currently computing \(\llbracket {\varphi}^{(k)} \rrbracket^{G}_{}\) while counter \(C\) will record how far we are in this computation. Moreover, \(V\) will contain the valuation under which we are currently computing the results of subformulae, while \(R\) stores subresults required to continue computation; \(F\) registers for which subformulae of \(\varphi\) the subresults stored in \(R\) can be considered valid; \(S\) is used to track, for each subformula, on which nodes the subformula is \(k\)-stable; and \(T\) is used to track, for each fixpoint subformula \(\alpha\), for which nodes \(n\) the subformula is \((C(\alpha),k)\) stable on \((G, V,n)\).
Our algorithm does not work on arbitrary configurations, but on configurations for which our intuitive description is coherent. We formalize this as follows. To simplify notation, for a counter \(C\) we write \({\alpha}^{(C,k)}\) for \({\alpha}^{(C(\alpha),k)}\) and we say that \(\alpha \in \textit{sub}_{\pi}^*(\varphi)\) is \((C,k)\)-stable on \((G,V,n)\) if \(\alpha\) is \((C(\alpha), k)\)-stable on \((G, V, n)\).
Definition 10. A configuration \(\kappa\) is coherent if the following three conditions hold.
It is sound: \(V(X) = \llbracket {\varphi|_X}^{(C,k)} \rrbracket^{G}_{V}\) for all \(X \in \textit{vars}\left(\varphi\right)\).
It is consistent: for all \(\alpha \in F\),
\(R(\alpha) = \llbracket {\alpha}^{(k)} \rrbracket^{G}_{V}\);
\(\textit{sub}\left(\alpha\right) \subseteq F\);
if \(\alpha\) is a fixpoint formula, then \(C(\alpha) = k-1\). And
It tracks stability:
\(S(\alpha) = \{ n \in G \mid \alpha \text{ is k-stable on } (G,V,n)\}\) for every \(\alpha \in F\); and
\(T(\alpha) = \{ n \in G \mid \alpha \text{ is (C,k)-stable on } (G,V,n) \}\) for every \(\alpha \in \textit{sub}_{\pi}^*(\varphi)\).
A configuration \(\kappa\) is complete if \(\varphi \in F\). It is stable if \(S(\varphi) = N_{G}\) with \(G\) the graph of \(\kappa\).
Note that from a coherent and complete configuration we can obtain \(\llbracket {\varphi}^{(k)} \rrbracket^{G}_{} = \llbracket {\varphi}^{(k)} \rrbracket^{G}_{V}\) by simply reading \(R(\varphi)\). Likewise, \(k\)-stability of \(\varphi\) on \((G,V)\) can be obtained by checking that \(\kappa\) is stable.
The goal of the counting algorithm is to compute a coherent and complete configuration for \(\varphi\) on \(G\). Computation starts at the initial configuration w.r.t \(k = 1\), defined below.
Definition 11. The initial configuration of \(\varphi\) on graph \(G\) w.r.t. \(k \geq 1\) is \(\kappa:=(G, k, C, V, R, F, S, T)\) where \(C= 0\); \[\begin{align} V(X) & = \begin{cases} \emptyset & \text{if } \varphi|_X \in \textit{sub}_{\mu}^*(\varphi)\\ N & \text{if } \varphi|_X \in \textit{sub}_{\nu}^*(\varphi); \end{cases} \end{align}\] \(R\) and \(S\) map every formula to \(\emptyset\); \(F= \emptyset\); and \(T\) maps every fixpoint formula to \(\emptyset\).
The initial configuration is trivially coherent. We complete our definition of the counting algorithm by defining three types of transitions on configurations.
Definition 12. Let \(\kappa= (G, k, C, V, R, F, S, T)\) be a configuration. A type-1 transition on \(\kappa\) yields the configuration \(\kappa' = (G, k, C, V, R', F', S', T)\) where \[\begin{align} R'(p) & :=\{ n \in G \mid p \in G(n) \} \\ R'(\neg p) & :=\{ n \in G \mid p \not \in G(n) \} \\ R'(X) & :=V(X) \\ R'(\psi \wedge \psi') & :=R(\psi) \cap R(\psi') \\ R'(\psi \vee \psi') & :=R(\psi) \cup R(\psi') \\ R'(\Diamond_{\ell}\, \psi) & :=\{ n \in G \mid |E_{G}(n) \cap R(\psi)| \geq \ell \} \\ R'(\Box_{\ell}\, \psi) & :=\{ n \in G \mid |E_{G}(n) \setminus R(\psi)| < \ell \} \\ R'(\pi X. \psi) & :=R(\psi) \\ F' & :=\{ \alpha \in \textit{sub}^*(\varphi) \mid \textit{sub}\left(\alpha\right) \subseteq F\} \\ & \qquad \setminus \{ \alpha \in \textit{sub}_{\pi}^*(\varphi) \mid C(\alpha) < k - 1\} \\ S'(\alpha) & :=N_{G} \cap \bigcap_{\beta \in \textit{sub}\left(\alpha\right)} S(\beta) \qquad \text{if } \alpha \not \in \textit{sub}_{\pi}^*(\varphi) \\ S'(\pi X. \psi) & :=S(\psi) \cap T(\pi X. \psi) \\ & \qquad \cap \{ n \in G \mid n \in V(X) \text{ iff } n \in R'(\psi) \} \end{align}\] We denote this by \(\kappa\vdash_{1} \kappa'\).
Intuitively, if \(\kappa\) is coherent then for any formula \(\beta \in F\), \(R\) already stores the value of \(\llbracket {\beta}^{(k)} \rrbracket^{G}_{V}\). Hence, for any \(\alpha\) with \(\textit{sub}\left(\alpha\right) \subseteq F\) we may read these values to compute \(\llbracket {\alpha}^{(k)} \rrbracket^{G}_{V}\), cf. the definition of \(R'\). For fixpoint formulae \(\alpha = \pi X. \psi\), this is only correct if \(C(\alpha) = k-1\), since we have then already evaluated the body \(\psi\) under valuation with \(V(X) = \llbracket \pi^{k-1} X.\psi \rrbracket^{G}_{V}\), and hence \[\begin{align} \llbracket {\alpha}^{(k)} \rrbracket^{G}_{V} = \llbracket \pi^k X. {\psi}^{(k)} \rrbracket^{G}_{V} & = \llbracket {\psi}^{(k)} \rrbracket^{G}_{V[X\mapsto \llbracket {\alpha}^{(k-1,k)} \rrbracket^{G}_{V}]}\\ & = \llbracket {\psi}^{(k)} \rrbracket^{G}_{V} = R(\psi) \end{align}\] Here, the second-to-last equality is by soundness of \(\kappa\). This reasoning is not correct when \(C(\alpha) < k-1\), which is why all fixpoint formulae with \(C(\alpha) < k-1\) are excluded from \(F'\). Note that \(F\subseteq F'\) by consistency of \(\kappa\).
The construction of \(S'\) follows the definition of \(k\)-stability. Assume that \(\alpha \in F'\). If \(\alpha\) is a non-fixpoint formula then it is \(k\)-stable on \((G,V, n)\) when every subformula is \(k\)-stable on \((G,V,n)\). If \(\alpha\) is a fixpoint formula \(\alpha = \pi X. \psi\), it is is \(k\)-stable on \((G,V, n)\) if \(\psi\) is \(k\)-stable on \((G,V, n)\); \(\alpha\) is itself \((C,k)\) stable on \((G,V,n)\), and \(n \in \llbracket {\alpha}^{(k)} \rrbracket^{G}_{V} = R'(\alpha)\) iff \(n \in \llbracket {\alpha}^{(k-1,k)} \rrbracket^{G}_{V} = V(X)\).
Lemma 2. If \(\kappa\vdash_{1} \kappa'\) and \(\kappa\) is consistent, then \(F\subseteq F'\).
Proof. Let \(\kappa= (G, k, C, V, R, F, S, T)\) and \(\kappa' = (G, k, C, V, R', F', S', T)\). Assume \(\alpha \in F\). By consistency of \(\kappa\), \(\textit{sub}\left(\alpha\right) \subseteq F\). Moreover, if \(\alpha\) is itself a fixpoint formula, \(C(\alpha) = k-1\). Therefore, \(\alpha \in F'\). ◻
Lemma 3. If \(\kappa\vdash_{1} \kappa'\) and \(\kappa\) is sound and consistent then so is \(\kappa'\).
Proof. Let \(\kappa= (G,k, C, V, R, F, S, T)\) and \(\kappa' = (G, k, C, V, R', F', S', T)\). Soundness of \(\kappa'\) is immediate, as \(\kappa'\) does not change its valuation. To prove that \(\kappa'\) is consistent, we need show that for all \(\alpha \in F'\):
\(R'(\alpha) = \llbracket {\alpha}^{(k)} \rrbracket^{G}_{V}\);
\(\textit{sub}\left(\alpha\right) \subseteq F'\);
if \(\alpha\) is a fixpoint formula, then \(C(\alpha) = k-1\).
Items (2) and (3) are immediate by definition of \(F'\). It hence remains to prove item (1).
For all non-fixpoint formulae \(\alpha\), this follows directly from the definition of \(R'\), the observation that if \(\alpha \in F'\) then all immediate subformulae \(\beta\) of \(\alpha\) must be in \(F\), and the consistency of \(\kappa\), implying that \(R(\beta) = \llbracket {\beta}^{(C)} \rrbracket^{G}_{V}\).
We next illustrate the reasoning when \(\alpha\) is a fixpoint formula \(\alpha = \mu X. \psi\). The case when \(\alpha = \nu X. \psi\) is similar. First observe that by definition of configuration, \(C(\alpha) \leq k -1\). Assume that \(\alpha \in F'\). By definition, \(\textit{sub}^*(\psi) = \textit{sub}^+(\alpha) \subseteq F\), and \(C(\alpha) \not < k - 1\). So, \(C(\alpha) = k-1\). Therefore, \({\alpha}^{(C,k)} = \mu^{k-1} X. {\psi}^{(k)}\).Then \[\begin{align} \llbracket {\alpha}^{(k)} \rrbracket^{G}_{V} & = \llbracket \mu^k X. {\psi}^{(k)} \rrbracket^{G}_{V} \\ & = \llbracket {\psi}^{(k)} \rrbracket^{G}_{V[X \mapsto \llbracket \mu^{k-1} X. {\psi}^{(k)} \rrbracket^{G}_{V}]} \\ & = \llbracket {\psi}^{(k)} \rrbracket^{G}_{V[X \mapsto \llbracket {\alpha}^{(C,k)} \rrbracket^{G}_{V}]} \\ & = \llbracket {\psi}^{(k)} \rrbracket^{G}_{V} \\ & = R(\psi) \\ & = R'(\mu X. \psi) \\ & = R'(\alpha) \end{align}\] The first equality is by assumption; the second by semantics of adorned formulae; the third by our observation that \({\alpha}^{(C,k)} = \mu^{k-1} X. \psi\); the fourth by soundness of \(\kappa\) and the fact that \(\alpha = \varphi|_X\), which imply that \(V(X) = \llbracket {\alpha}^{(C,k)} \rrbracket^{G}_{V}\); the fifth by consistency of \(\kappa\) and the fact that \(\psi \in F\); and the second-to last by definition of \(R'\). ◻
Lemma 4. If a formula \(\alpha\) is \((j,k)\)-stable on \((G, V, n)\) and \(j' \leq j\), then \(\alpha\) is \((j',k)\)-stable on \((G,V, n)\).
Proof. Trivial. ◻
In Section 5.3 we defined fixpoint formula \(\alpha\) to be \((C,k)\)-stable on \((G,V,n)\) if \(\alpha\) is \((C(\alpha), k)\)-stable on \((G, V, n)\).
With extra guarantees, \((C,k)\)-stability also implies \(k\)-stability:
Lemma 5. Let \(\alpha \in \textit{sub}_{\pi}^*(\varphi)\) be of the form \(\pi X. \psi\) and \(n \in G\). If (i) \(n \in \llbracket {\alpha}^{(k)} \rrbracket^{G}_{V} \iff n \in \llbracket {\alpha}^{(k-1,k)} \rrbracket^{G}_{V}\); (ii) \(C(\alpha) = k-1\); (iii) \(\alpha\) is \((C,k)\)-stable on \((G,V,n)\); (iv) \(V(X) = \llbracket {\alpha}^{(C,k)} \rrbracket^{G}_{V}\); and (v) \(\psi\) is \(k\)-stable on \((G,V,n)\), then \(\alpha\) is \(k\)-stable on \((G,V,n)\).
Proof. Let \(k\), \(C\), \(\alpha\), \(n\), and \(V\) be as stated and assume that (i)–(v) hold. To establish that \(\alpha\) is \(k\)-table on \((G,V,n)\). We need to show two things to establish \(k\)-stability of \(\alpha\).
\(n \in \llbracket {\alpha}^{(k,k)} \rrbracket^{G}_{V} \iff n \in \llbracket {\alpha}^{(k-1,k)} \rrbracket^{G}_{V}\), which is true by assumption (i).
for every \(0 \leq i < k\), \(\psi\) is \(k\)-stable on \((G,V_i,n)\) where \(V_i = V[X \mapsto \llbracket {\alpha}^{(i,k)} \rrbracket^{G}_{V}]\). Since \(C(\alpha) = k-1\) by assumption (ii), assumption (iii) ensures that \(\psi\) is \(k\)-stable on \((G, V_i, n)\) for \(0 \leq i < k-1\). Further, observe that \(V_{k-1} = V\) by assumption (iv). Hence, by assumption (v), \(\psi\) is also \(k\)-stable on \((G, V_{k-1}, n)\), as desired.
◻
Based on this reasoning, we can formally prove:
If \(\kappa\vdash_{1} \kappa'\) and \(\kappa\) is coherent then so is \(\kappa'\).
Proof. Let \(\kappa= (G,k, C, V, R, F, S, T)\) and \(\kappa' = (G, k, C, V, R', F', S', T)\). By Lemma 3, \(\kappa'\) is sound and consistent. It hence remains to prove that \(\kappa'\) tracks stability, for which we need to show that
\(S'(\alpha) = \{ n \in G \mid \alpha \text{ is k-stable on } (G,V,n)\}\) for all \(\alpha \in F'\); and
\(T(\alpha) = \{ n \in G \mid \alpha \text{ is (C,k)-stable on } (G,V,n)\}\) for all \(\alpha \in \textit{sub}_{\pi}^*(\varphi)\).
Item (2) follows immediately from the fact that \(\kappa\) tracks stability. It remains to show item (1). Fix \(\alpha \in F'\). Then \(\textit{sub}\left(\alpha\right) \subseteq F\). We distinguish two cases.
If \(\alpha\) is a not a fixpoint formula then by definition of \(S'(\alpha)\) we have \[\begin{align} F'(\alpha) & = N_{G} \cap \bigcap_{\beta \in \textit{sub}\left(\alpha\right)} S(\beta) \\ & = \{ n \in N_{G} \mid n \in S(\beta) \text{ for all } \beta \in \textit{sub}\left(\alpha\right)\} \\ & = \{ n \in N_{G} \mid \beta \text{ is } k\text{-stable on } (G,V,n) \\ & \phantom{= \{ n \in N_{G} \mid } \;\text{ for all } \beta \in \textit{sub}\left(\alpha\right)\} \\ & = \{ n \in N_{G} \mid \alpha \text{ is } k\text{-stable on } (G,V,n) \}. \end{align}\] The first equality is by definition of \(S'(\alpha)\), the third because \(\kappa\) tracks stability and \(\textit{sub}\left(\alpha\right) \subseteq F\); and the fourth by definition of \(k\)-stability.
If \(\alpha\) is a fixpoint formula, \(\alpha = \pi X. \psi\) then \(\alpha = \varphi|_X\). Since \(\alpha \in F'\), \(\psi \in F\) and \(C(\alpha) = k-1\). Recall that \(\kappa'\) is sound and consistent by Lemma 3. Therefore, \[\label{eq:lem:trans-1-preservation-full:eq1} V(X) = \llbracket {\varphi|_X}^{(C,k)} \rrbracket^{G}_{V} = \llbracket {\alpha}^{(C,k)} \rrbracket^{G}_{V} = \llbracket {\alpha}^{(k-1,k)} \rrbracket^{G}_{V}\tag{7}\] Moreover, \[\begin{align} \label{eq:lem:trans-1-preservation-full:eq2} R'(\psi) & = \llbracket {\psi}^{(k)} \rrbracket^{G}_{V} \nonumber\\ & = \llbracket {\psi}^{(k)} \rrbracket^{G}_{V[X \mapsto \llbracket {\alpha}^{(C,k)} \rrbracket^{G}_{V}]} \nonumber\\ & = \llbracket {\psi}^{(k)} \rrbracket^{G}_{V[X \mapsto \llbracket {\alpha}^{(k-1,k)} \rrbracket^{G}_{V}]} \nonumber\\ & = \llbracket \pi^k X. {\psi}^{(k)} \rrbracket^{G}_{V} \nonumber \\ & = \llbracket {\alpha}^{(k)} \rrbracket^{G}_{V} \end{align}\tag{8}\] The second equality is by soundness of \(\kappa\), the third by 7 , the fourth by semantics of adorned formulae, and the last by definition of uniform adornment.
Then we reason as follows. \[\begin{align} S'& (\pi X. \psi) \\ & = S(\psi) \cap T(\pi X.\psi) \\ & \qquad \cap \{ n \in G \mid n \in V(X) \text{ iff } n \in R'(\psi) \} \\ & = \{ n \in N_{G} \mid n \in S(\psi), n \in T(\pi X.\psi), \\ & \phantom{= \{ n \in N_{G} \mid\;} \;n \in V(X) \text{ iff } n \in R'(\psi) \} \\ & = \{ n \in N_{G} \mid \psi \text{ is } k\text{-stable on } (G,V,n) \\ & \phantom{= \{ n \in N_{G} \mid\;} \;\pi X.\psi \text{ is } (C,k)\text{-stable on } (G,V,n) \\ & \phantom{= \{ n \in N_{G} \mid\;} \; n \in V(X) \text{ iff } n \in R'(\psi) \} \\ & = \{ n \in N_{G} \mid \psi \text{ is } k\text{-stable on } (G,V,n) \\ & \phantom{= \{ n \in N_{G} \mid\;} \;\pi X.\psi \text{ is } (C,k)\text{-stable on } (G,V,n) \\ & \phantom{= \{ n \in N_{G} \mid\;} \; n \in \llbracket {\alpha}^{(k-1,k)} \rrbracket^{G}_{V} \text{ iff } n \in \llbracket {\alpha}^{(k)} \rrbracket^{G}_{V} \} \\ & = \{ n \in N_{G} \mid \pi X. \psi \text{ is } k\text{-stable on } (G,V,n) \} \end{align}\] The first equality is by definition; the second by straightforward rewriting; the third because \(\kappa\) tracks stability and \(\psi \in F\); the fourth by 7 and 8 ; and the last by Lemma 5.
◻
To define the second type of transition, we require the notion of a ticking fixpoint formula. We say that \(\alpha \in \textit{sub}_{\pi}^*(\varphi)\) ticks in configuration \(\kappa\) if (1) \(\textit{sub}\left(\alpha\right) \subseteq F\); (2) \(C(\alpha) < k - 1\); and (3) \(C(\beta) = k-1\) for every \(\beta \in \textit{sub}_{\pi}^+(\alpha)\). We write \(\textit{ticks}\left(\kappa\right)\) for the subset of \(\textit{sub}_{\pi}^*(\varphi)\) that tick in \(\kappa\). Note that if \(\alpha\) ticks, none of its strict fixpoint subformulae can tick. We observe:
If \(\alpha = \pi X. \psi\) ticks in coherent configuration \(\kappa\) then \(\llbracket {\alpha}^{(C(\alpha)+1,k)} \rrbracket^{G}_{V} = R(\psi)\).
Proof. Let \(\kappa= (G, k, C, V, R, F, S,T)\) be a coherent configuration in which \(\alpha = \pi X. \psi\) ticks. We want to show that \(\llbracket {\alpha}^{(C(\alpha)+1,k)} \rrbracket^{G}_{V} = R(\psi)\). We begin by expanding the left hand side of the equivalence. \[\begin{align} \llbracket {\alpha}^{(C(\alpha)+1,k)} \rrbracket^{G}_{V} &= \llbracket \pi^{C(\alpha)+1} X. {\psi}^{(k)} \rrbracket^{G}_{V} \\ &= \llbracket {\psi}^{(k)} \rrbracket^{G}_{V[X \mapsto \llbracket \pi^{C(\alpha)} X. {\psi}^{(k)} \rrbracket^{G}_{V}]} \end{align}\] Let us shorten \(V' = V[X \mapsto \llbracket \pi^{C(\alpha)} X. {\psi}^{(k)} \rrbracket^{G}_{V}]\), so we get \(\llbracket {\alpha}^{(C(\alpha)+1,k)} \rrbracket^{G}_{V} = \llbracket {\psi}^{(k)} \rrbracket^{G}_{V'}\).
Since \(\alpha \in \textit{ticks}\left(\kappa\right)\), we find \(\psi \in F\). As \(\kappa\) is coherent, this implies \(R(\psi) = \llbracket {\psi}^{(k)} \rrbracket^{G}_{V}\). Hence, we have to show that \(\llbracket {\psi}^{(k)} \rrbracket^{G}_{V'} = \llbracket {\psi}^{(k)} \rrbracket^{G}_{V}\). Since the semantics of a formula depend only on the valuation of the free variables, we can restrict our attention to the free variables of \(\psi\). In this case, \(\textit{free}\left(\psi\right) = \textit{free}\left(\alpha\right) \cup \{X\}\).
For all \(Y \in \textit{free}\left(\alpha\right)\), we find \(V(Y) = V'(Y)\) by the definition of \(V'\).
For \(X\), we find \(V'(X) = \llbracket \pi^{C(\alpha)} X. {\psi}^{(k)} \rrbracket^{G}_{V}\). Because \(\kappa\) is coherent, and thus sound, we find \(V(X) = \llbracket \pi^{C(\alpha)} X. {\psi}^{(k)} \rrbracket^{G}_{V}\). This also equals \(V'(X) = V(X)\).
Hence, we find that \(V'(Y) = V(Y)\) for all \(Y \in \textit{free}\left(\psi\right)\). This implies that \(\llbracket {\psi}^{(k)} \rrbracket^{G}_{V'} = \llbracket {\psi}^{(k)} \rrbracket^{G}_{V}\), and thus \(\llbracket {\alpha}^{(C(\alpha)+1,k)} \rrbracket^{G}_{V} = R(\psi)\). ◻
This lemma shows that if \(\alpha = \pi X. \psi\) ticks in a coherent \(\kappa\) then in \(R(\psi)\) we have already computed \(C(\alpha)+1\) iterations of \(\alpha\)’s outermost fixpoint. However, since \(C(\alpha) +1 < k\), we have not yet computed all necessary \(k\) fixpoint iterations of \({\alpha}^{(k)} = {\alpha}^{(k,k)}\). To ensure that computation can continue, a type-2 transition therefore changes the configuration such that it causes \(\llbracket {\alpha}^{(C(\alpha)+2,k)} \rrbracket^{G}_{V}\) to be computed in further transition steps. It does so by copying \(R(\psi) = \llbracket {\alpha}^{(C(\alpha)+1,k)} \rrbracket^{G}_{V}\) to \(V(X)\), increasing \(C(\alpha)\), and resetting the computation of all subformulae that depend on the value of \(X\), which has now changed.
Formally, define \(\textit{reset}\left(\kappa\right)\) to be the smallest subset of \(\textit{vars}\left(\varphi\right)\) satisfying \[\begin{gather} \textit{reset}\left(\kappa\right) = \{X \mid \varphi|_X \in \textit{ticks}\left(\kappa\right)\} \\ \cup \{ Y \mid \textit{free}\left(\varphi|_Y\right) \cap \textit{reset}\left(\kappa\right) \not = \emptyset\}. \end{gather}\] Define \(\textit{dep}(\kappa) :=\{ \varphi|_X \mid X \in \textit{reset}\left(\kappa\right)\} \setminus \textit{ticks}\left(\kappa\right)\). We say that the elements of \(\textit{dep}(\kappa)\) depend on a tick in \(\kappa\).
Definition 13. Let \(\kappa= (G, k, C, V, R, F, S,T)\) be a configuration. A type-2 transition on \(\kappa\) yields the configuration \(\kappa' = (G, k, C', V', R, F', S, T')\) where \[\begin{align} C'(\alpha) &:= \begin{cases} C(\alpha) + 1 & \text{if } \alpha \in \textit{ticks}\left(\kappa\right)\\ 0 & \text{if } \alpha \in \textit{dep}(\kappa) \\ C(\alpha) & \text{otherwise}\\ \end{cases} \\ V'(X) & := \begin{cases} R(\psi) & \text{if } \varphi|_X \in \textit{ticks}\left(\kappa\right), \varphi|_X= \pi X.\psi\\ \emptyset & \text{if } \varphi|_X \in \textit{dep}(\kappa) \cap \textit{sub}_{\mu}^*(\varphi) \\ N_{G} & \text{if } \varphi|_X \in \textit{dep}(\kappa) \cap \textit{sub}_{\nu}^*(\varphi) \\ V(X) &\text{otherwise} \end{cases} \\ F' & :=\{ \alpha \in F\mid \textit{free}\left(\alpha\right) \cap \textit{reset}\left(\kappa\right) = \emptyset \} \\ T'(\pi X. \psi) & := \begin{cases} T(\pi X. \psi) \cap S(\psi) & \text{ if } \pi X. \psi \in \textit{ticks}\left(\kappa\right) \\ N_{G} & \text{ if } \pi X. \psi \in \textit{dep}(\kappa) \\ T(\pi X. \psi) & \text{ otherwise} \end{cases} \end{align}\] We denote this by \(\kappa\vdash_{2} \kappa'\).
Note that if no fixpoint formula ticks in \(\kappa\), then \(\kappa' = \kappa\), i.e., the transition is a no-op.
The following lemma shows that a type-2 transition changes the valuation only for those variables that do not reset.
Lemma 6. If \(\kappa\vdash_{2} \kappa'\) then \(V'(X) = V(X)\) for all \(X \in \textit{vars}\left(\varphi\right) \setminus \textit{reset}\left(\kappa\right)\), where \(V\) and \(V'\) are the valuations of \(\kappa\) and \(\kappa'\), respectively.
Proof. Notation-wise, assume \((G, k, C, V, R, F, S, T) = \kappa\) and \((G, k, C', V', R, F', S, T') = \kappa'\). By definition of \(\textit{reset}\left(\kappa\right)\) we have for all variables \(X\) that \(X \in \textit{reset}\left(\kappa\right)\) iff \(\varphi|_X \in \textit{ticks}\left(\kappa\right)\) or \(\varphi|_X \in \textit{dep}(\kappa)\). Let \(X \in \textit{vars}\left(\varphi\right) \setminus \textit{reset}\left(\kappa\right)\). Then \(\varphi|_X \not \in \textit{ticks}\left(\kappa\right)\) and \(\varphi|_X \not \in \textit{dep}(\kappa)\). Hence, by definition of \(V'\), \(V'(X) = V(X)\). ◻
The following lemma shows that the only variables that can reset belong to fixpoint formulae that are (not necessarily strict) subformulae of ticking fixpoints.
Lemma 7. If \(X \in \textit{reset}\left(\kappa\right)\) then \(\varphi|_X \in \textit{sub}_{\pi}^*(\textit{ticks}\left(\kappa\right))\).
Proof. The proof is by induction on the argument that shows that \(X \in \textit{reset}\left(\kappa\right)\).
If \(\varphi|_X \in \textit{ticks}\left(\kappa\right)\) then the result follows from the fact that \(\textit{ticks}\left(\kappa\right) \subseteq \textit{sub}_{\pi}^*(\textit{ticks}\left(\kappa\right))\).
If \(\varphi|_X \not \in \textit{ticks}\left(\kappa\right)\) there is some \(Y \in \textit{free}\left(\varphi|_X\right) \cap \textit{reset}\left(\kappa\right)\). Because \(\varphi\) is a sentence and well-named, necessarily \(\varphi|_X \in \textit{sub}_{\pi}^+(\varphi|_Y)\). In particular, \(X \not = Y\). There is hence a shorter argument that shows that \(Y \in \textit{reset}\left(\kappa\right)\). By induction hypothesis, \(\varphi|_Y \in \textit{sub}_{\pi}^*(\textit{ticks}\left(\kappa\right))\). Hence \(\varphi|_X \in \textit{sub}_{\pi}^*(\textit{ticks}\left(\kappa\right))\).
◻
Lemma 8. If \(\kappa\vdash_{2} \kappa'\) then \(V'(X) = V(X)\) for all \(X \in \textit{free}\left(\textit{ticks}\left(\kappa\right)\right)\), where \(V\) and \(V'\) are the valuations of \(\kappa\) and \(\kappa'\), respectively.
Proof. Notation-wise, assume \((G, k, C, V, R, F, S, T) = \kappa\) and \((G, k, C', V', R, F', S, T') = \kappa'\). Let \(X \in \textit{free}\left(\textit{ticks}\left(\kappa\right)\right)\). By Lemma 6, it suffices to show that \(X \not \in \textit{reset}\left(\kappa\right)\), since this implies \(V'(X) = V(X)\).
We proceed as follows. Suppose, for the purpose of obtaining a contradiction that \(X \in \textit{reset}\left(\kappa\right)\). By Lemma 7, \(\varphi|_X \in \textit{sub}^*(\textit{ticks}\left(\kappa\right))\). As such, either \(\varphi|_X \in \textit{ticks}\left(\kappa\right)\) or there is some \(\beta \in \textit{ticks}\left(\kappa\right)\) with \(\varphi|_X \in \textit{sub}_{\pi}^+(\beta)\). We show that neither can hold.
Since \(X \in \textit{free}\left(\textit{ticks}\left(\kappa\right)\right)\) there exists \(\alpha \in \textit{ticks}\left(\kappa\right)\) such that \(X \in \textit{free}\left(\alpha\right)\). Since \(\varphi\) is a sentence and is well-named, \(\alpha \in \textit{sub}^*(\varphi|_X)\). Because \(\alpha\) ticks in \(\kappa\) we know that \(C(\alpha) < k-1\). As such, \(\varphi|_X\) cannot tick in \(\kappa\): if it did tick, this would require that \(C(\alpha) = k-1\) since \(\alpha\) is a strict fixpoint-subformula of \(\varphi|_X\) and every such subformula must be mapped to \(k-1\) by \(C\). By the same reasoning no \(\beta \in \textit{ticks}\left(\kappa\right)\) with \(\varphi|_X \in \textit{sub}_{\pi}^+(\beta)\) can tick, since this would also require that \(C(\alpha) = k-1\) as \(\alpha \in \textit{sub}_{\pi}^*(\varphi|_X) \subseteq \textit{sub}_{\pi}^+(\beta)\).
As such, \(X \not \in \textit{free}\left(\textit{ticks}\left(\kappa\right)\right)\). ◻
Lemma 9. If \(\kappa\vdash_{2} \kappa'\) and \(\kappa\) is sound and consistent then so is \(\kappa'\).
Proof. Notation-wise, assume \((G, k, C, V, R, F, S, T) = \kappa\) and \((G, k, C', V', R, F', S, T') = \kappa'\).
We first prove soundness. Let \(X \in \textit{vars}\left(\varphi\right)\). We need to prove that \(V'(X) = \llbracket {\varphi|_X}^{(C,k)} \rrbracket^{G}_{V'}\). Assume that \(\varphi|_X = \pi X. \psi\). We distinguish four cases.
\(\varphi|_X \in \textit{ticks}\left(\kappa\right)\). By definition of \(C'\), \(C'(\varphi|_X) = C(\varphi|_X) + 1\). By definition of tick, \(\psi \in \textit{sub}\left(\varphi|_X\right) \subseteq F\) and \(C(\varphi|_X) < k-1\). By Lemma 8, \(V'(Y) = V(Y)\) for every \(Y \in \textit{free}\left(\varphi|_X\right) = \textit{free}\left(\psi\right) \setminus \{X\}\). Then \[\begin{align} V'(X) = R(\psi) \\ & = \llbracket {\psi}^{(k)} \rrbracket^{G}_{V} \\ & = \llbracket {\psi}^{(k)} \rrbracket^{G}_{V[X \mapsto \llbracket {\varphi|_X}^{(C,k)} \rrbracket^{G}_{V}]} \\ & = \llbracket {\psi}^{(k)} \rrbracket^{G}_{V'[X \mapsto \llbracket {\varphi|_X}^{(C,k)} \rrbracket^{G}_{V}]} \\ & = \llbracket {\psi}^{(k)} \rrbracket^{G}_{V'[X \mapsto \llbracket {\varphi|_X}^{(C,k)} \rrbracket^{G}_{V'}]} \\ & = \llbracket \mu^{C(\varphi|_X)+1} X. \psi \rrbracket^{G}_{V'} \\ & = \llbracket {\varphi|_X}^{(C',k)} \rrbracket^{G}_{V'} \end{align}\] The first equality is by definition of \(V'\); the second because \(\kappa\) is consistent and \(\psi \in F\); the third because \(V(X) = \llbracket {\varphi|_X}^{(C,k)} \rrbracket^{G}_{V}\) as \(\kappa\) is sound; the fourth because \(V\) and \(V'\) agree on all \(Y \in \textit{free}\left(\psi\right) \setminus \{X\}\) and the semantics only depends on the value of free variables; the fifth because using the same reasoning we see that \(\llbracket {\varphi|_X}^{(C,k)} \rrbracket^{G}_{V} = \llbracket {\varphi|_X}^{(C,k)} \rrbracket^{G}_{V'}\); the sixth by definition of approximate semantics; and the last by definition.
\(\varphi|_X \in \textit{dep}(\kappa) \cap \textit{sub}_{\mu}^*(\textit{ticks}\left(\kappa\right))\). Then \(C'(\varphi|_X) = 0\) by definition of \(C'\). Consequently \(\llbracket {\varphi|_X}^{(C',k)} \rrbracket^{G}_{V'} = \emptyset = V'(X)\), as desired.
\(\varphi|_X \in \textit{dep}(\kappa) \cap \textit{sub}_{\nu}^*(\textit{ticks}\left(\kappa\right))\). Similar to the previous case.
None of the above hold. In this case, \(C'(\varphi|_X) = C(\varphi|_X)\) and \(V'(X) = V(X)\). Moreover, \(\varphi|_X \not \in \textit{ticks}\left(\kappa\right)\) and \(\varphi|_X \not \in \textit{dep}(\kappa) \cap \textit{sub}_{\pi}^*(\varphi)\). Since \(\varphi|_X \in \textit{sub}_{\pi}^*(\varphi)\) it follows that \(\varphi|_X \not \in \textit{dep}(\kappa)\). By definition of \(\textit{reset}\left(\kappa\right)\), it holds that \(X \in \textit{reset}\left(\kappa\right)\) iff \(X \in \textit{ticks}\left(\kappa\right)\) or \(X \in \textit{dep}(\kappa)\). Hence, \(X \not \in \textit{reset}\left(\kappa\right)\). Again by definition of reset, \(\textit{free}\left(\varphi|_X\right) \cap \textit{reset}\left(\kappa\right) = \emptyset\). (If it were non-empty, \(X\) would be in \(\textit{reset}\left(\kappa\right)\).) Hence, \(V'(Y) = V(Y)\) for every \(Y \in \textit{free}\left(\varphi|_X\right)\) by Lemma 6 Then, \[\begin{align} V'(X) & = V(X) \\ & = \llbracket {\varphi|_X}^{(C,k)} \rrbracket^{G}_{V} \\ & = \llbracket {\varphi|_X}^{(C,k)} \rrbracket^{G}_{V'} \\ & = \llbracket {\varphi|_X}^{(C',k)} \rrbracket^{G}_{V'} \end{align}\] The first equality is by definition of \(V'\); the second because \(\kappa\) is sound; and the third because the semantics only depends on the values of free variables, and \(V'\) and \(V\) agree on the free variables of \(\varphi|_X\); and the last because \(C'(\varphi|_X) = C(\varphi|_X)\).
It remains to prove consistency. We need show that for all \(\alpha \in F'\):
\(R'(\alpha) = \llbracket {\alpha}^{(k)} \rrbracket^{G}_{V'}\);
\(\textit{sub}\left(\alpha\right) \subseteq F'\);
if \(\alpha\) is a fixpoint formula, then \(C'(\alpha) = k-1\).
Let \(\alpha \in F'\). By definition of \(F'\), \(\alpha \in F\) and \(\textit{free}\left(\alpha\right) \cap \textit{reset}\left(\kappa\right) = \emptyset\).
We first show item (1). By Lemma 6, \(V'(X) = V(X)\) for every \(X \in \textit{free}\left(\alpha\right)\). Therefore, \(R(\alpha) = \llbracket {\alpha}^{(k)} \rrbracket^{G}_{V} = \llbracket {\alpha}^{(k)} \rrbracket^{G}_{V'}\), where the first equality is due to consistency of \(\kappa\) and the fact that \(\alpha \in F\), and the second due to the fact that the semantics only depends on the values of free variables, on which \(V\) and \(V'\) agree.
We next show item (2). Let \(\alpha \in F' \subseteq F\). Because \(\alpha \in F\) and \(\kappa\) is consistent, we know that \(\textit{sub}\left(\alpha\right) \subseteq F\). Assume for the purpose of obtaining a contradiction, that some \(\beta \in \textit{sub}\left(\alpha\right)\) is not in \(F'\). Then \(\beta \in F\) and there exists some \(X \in \textit{free}\left(\beta\right) \cap \textit{reset}\left(\kappa\right)\). There are two possibilities.
\(X\) is also free in \(\alpha\). But then \(X \in \textit{free}\left(\alpha\right) \cap \textit{reset}\left(\kappa\right)\), which contradicts \(\alpha \in F'\).
\(X\) is not free in \(\alpha\). The only way that this can happen is if \(\alpha = \varphi|_X\). But since \(X \in \textit{reset}\left(\kappa\right)\), this means that either \(\alpha = \varphi|_X \in \textit{ticks}\left(\kappa\right)\) or \(\alpha = \varphi|_X \in \textit{dep}(\kappa)\). We show that neither can happen.
If \(\alpha \in \textit{ticks}\left(\kappa\right)\) then \(C(\alpha) < k-1\), contradicting the fact that \(\alpha \in F\) by consistency of \(\kappa\) (property (3)).
If \(\alpha \not \in \textit{ticks}\left(\kappa\right)\) but \(\alpha \in \textit{dep}(\kappa)\), then there has to be some other variable \(Y\) in \(\textit{reset}\left(\kappa\right)\) that is free in \(\alpha\). But then \(\textit{free}\left(\alpha\right) \cap \textit{reset}\left(\kappa\right) \not = \emptyset\), contradicting that \(\alpha \in F'\).
Finally, we show item (3). Assume that additionally \(\alpha\) is a fixpoint formula, so \(\alpha = \varphi|_X\) for some variable \(X\). Because \(\kappa\) is consistent, because \(\alpha\) is a fixpoint formula, and because \(\alpha \in F' \subseteq F\) we know that \(C(\varphi|_X) = k-1\). So, \(\varphi|_X \not \in \textit{ticks}\left(\kappa\right)\). Furthermore, by definition of \(F'\), \(\textit{free}\left(\varphi|_X\right) \cap \textit{reset}\left(\kappa\right) = \emptyset\). Then, the definition of dep yields that \(\varphi|_X \not \in \textit{dep}(\kappa)\). Hence, by definition of \(C'\) we obtain that \(C'(\alpha) = C(\alpha) = k-1\). ◻
Lemma 10. If \(\alpha \in \textit{sub}^*(\varphi)\) is \(k\)-stable on \((G,V,n)\) and \(V'\) agrees with \(V\) on \(\textit{free}\left(\alpha\right)\) then \(\alpha\) is \(k\)-stable on \((G,V',n)\).
Proof. This is essentially because the approximation semantics only depends on the free variables of \(\alpha\), on which \(V\) and \(V'\) agree. The formal proof is by induction on \(\alpha\).
When \(\alpha = p, \neg p\) or \(X\), the proof is immediate.
When \(\alpha\) is another non-fixpoint formula, then all subformulae \(\psi \in \textit{sub}\left(\alpha\right)\) are \(k\)-stable on \((G,V,n)\). Since they have the same free variables as \(\alpha\), they are also \(k\)-stable on \((G, V',n)\) by induction hypothesis. Hence, \(\alpha\) is \(k\)-stable on \((G,V',n)\).
When \(\alpha\) is a fixpoint formula \(\pi X. \psi\), then
\(\llbracket {\alpha}^{(k,k)} \rrbracket^{G}_{V} = \llbracket {\alpha}^{(k-1,k)} \rrbracket^{G}_{V}\); and
for every \(0 \leq i < k\), \(\psi\) is \(k\)-stable on \((G,V_i,n)\) where \(V_i = V[X \mapsto \llbracket {\alpha}^{(i,k)} \rrbracket^{G}_{V}]\).
Therefore, from (1) and the fact that the approximate semantics only depends on the values of free variables, on which \(V\) and \(V'\) agree, we obtain that \[\begin{align} \llbracket {\alpha}^{(k,k)} \rrbracket^{G}_{V'} = \llbracket {\alpha}^{(k,k)} \rrbracket^{G}_{V} = \llbracket {\alpha}^{(k-1,k)} \rrbracket^{G}_{V} = \llbracket {\alpha}^{(k-1,k)} \rrbracket^{G}_{V'}. \end{align}\] By the same reasoning, \(\llbracket {\alpha}^{(i,k)} \rrbracket^{G}_{V'} = \llbracket {\alpha}^{(i,k)} \rrbracket^{G}_{V}\) for \(0 \leq i < k\). Hence, if we define \(V'_i = V'[X \mapsto \llbracket {\alpha}^{(i,k)} \rrbracket^{G}_{V'}]\) for \(0 \leq i < k\) then \(V_i\) and \(V'_i\) agree on \(\textit{free}\left((\right)\psi) = \textit{free}\left(\alpha\right) \cup\{X\}\). From (2) and the induction hypothesis, we then obtain that \(\psi\) is \(k\)-stable on \((G,V'_i,n)\) for \(1 \leq i < k\). We may hence conclude that \(\varphi\) is \(k\)-stable on \((G, V',n)\).
◻
Lemma 11. If \(\alpha \in \textit{sub}_{\pi}^*(\varphi)\) is \((C,k)\)-stable on \((G,V,n)\) and \(V'\) agrees with \(V\) on \(\textit{free}\left(\alpha\right)\) then \(\alpha\) is \((C,k)\)-stable on \((G,V',n)\).
Proof. Assume \(\alpha = \pi X. \psi\). Since \(\alpha\) is \((C,k)\)-stable on \((G,V,n)\), we know that \(\psi\) is \(k\)-stable on \((G,V_i,n)\) for \(0 \leq i < C(\alpha)\) with \(V_i = V[X \mapsto \llbracket {\alpha}^{(i,k)} \rrbracket^{G}_{V}]\). Because the approximate semantics only depends on the values of free variables, on which \(V\) and \(V'\) agree, it follows that \(\llbracket {\alpha}^{(i,k)} \rrbracket^{G}_{V} = \llbracket {\alpha}^{(i,k)} \rrbracket^{G}_{V'}\). Define \(V'_i = V'[X \mapsto \llbracket {\alpha}^{(i,k)} \rrbracket^{G}_{V'}]\). Then, because \(V'\) and \(V\) agree on \(\textit{free}\left(\alpha\right)\), \(V_i\) and \(V'_i\) agree on \(\textit{free}\left(\alpha\right) \cup \{X\}\), i.e., on all free variables of \(\psi\). Hence, by Lemma 10, \(\psi\) is \(k\)-stable on \((G,V'_i,n)\), for all \(0 \leq i < C(\alpha)\). As such, \(\alpha\) is \((C, k)\)-stable on \((G, V',n)\). ◻
If \(\kappa\vdash_{2} \kappa'\) and \(\kappa\) is coherent then so is \(\kappa'\).
Proof. Notation-wise, assume \((G, k, C, V, R, F, S, T) = \kappa\) and \((G, k, C', V', R, F', S, T') = \kappa'\). By Lemma 9 we obtain that \(\kappa'\) is sound and consistent. It hence remains to prove that \(\kappa'\) tracks stability, for which we need to show that
For every \(\alpha \in F'\), it holds that \(n \in S(\alpha) \iff \alpha \text{ is } k\text{-stable on } (G,V',n)\); and
For every \(\alpha \in \textit{sub}_{\pi}^*(\varphi)\), it holds that \(n \in T'(\alpha) \iff \alpha \text{ is } (C',k)\text{-stable on } (G,V',n)\).
We first prove item (1). Let \(\alpha \in F'\), and \(n\) be an arbitrary node in \(G\). Let us start with the forward direction of the equivalence. We need to show that if \(n \in S(\alpha)\) then \(\alpha\) is \(k\)-stable on \((G,V',n)\). Because \(F' \subseteq F\), we have \(\alpha \in F\). Because \(\kappa\) is coherent, it tracks stability, and thus \(\alpha\) is \(k\)-stable on \((G,V,n)\). By the definition of \(F'\), we have \(\textit{free}\left(\alpha\right) \cap \textit{reset}\left(\kappa\right) = \emptyset\). Combined with Lemma 6, \(V'(Y) = V(Y)\) for all \(Y \in \textit{free}\left(\alpha\right)\). Hence, by Lemma 10, \(\alpha\) is \(k\)-stable on \((G,V',n)\).
For the converse direction, we need to show that if \(\alpha\) is \(k\)-stable on \((G,V',n)\) then \(n \in S(\alpha)\). We have already established that \(V'(Y) = V(Y)\) for all \(Y \in \textit{free}\left(\alpha\right)\). Hence, by Lemma 10, \(\alpha\) is \(k\)-stable on \((G,V,n)\). Because \(\kappa\) is coherent, and tracks stability, we conclude that \(n \in S(\alpha)\).
We now continue with the proof of item (2). Let \(\alpha \in \textit{sub}_{\pi}^*(\varphi)\), \(\alpha = \pi X.\psi\), and \(n\) be an arbitrary node in \(G\). We start with the backward direction of the equivalence. We need to show that if \(\alpha\) is \((C',k)\)-stable on \((G,V',n)\), then \(n \in T'(\alpha)\). We distinguish three cases, aligning with the definition of \(T'\):
\(\alpha \in \textit{ticks}\left(\kappa\right)\). As \(\alpha \in \textit{ticks}\left(\kappa\right)\), we have \(C'(\alpha) = C(\alpha) + 1\). Therefore, \(\alpha\) is \((C(\alpha)+1,k)\)-stable on \((G,V',n)\). By the definition of \(\vdash_{2}\), we have \(T'(\alpha) = T(\alpha) \cap S(\psi)\). It suffices to show that \(n \in T(\alpha)\) and \(n \in S(\psi)\).
We first show that \(n \in T(\alpha)\). Since \(\alpha \in \textit{ticks}\left(\kappa\right)\), \(\textit{free}\left(\alpha\right)\) is a subset of \(\textit{free}\left(\textit{ticks}\left(\kappa\right)\right)\). By Lemma 8, \(V'(Y) = V(Y)\) for all \(Y \in \textit{free}\left(\alpha\right)\). Lemma 11 then implies that \(\alpha\) is \((C(\alpha)+1,k)\)-stable on \((G,V,n)\). By Lemma 4, it is also \((C(\alpha),k)\)-stable on \((G,V,n)\). Since \(\kappa\) is coherent and tracks stability, we conclude that \(n \in T(\alpha)\).
We next show that \(n \in S(\psi)\). By Definition 8, for any integer \(j\) so that \(0 \leq j < C(\alpha) + 1\), the body \(\psi\) is \(k\)-stable on \((G,V'_j,n)\), where \(V'_j = V'[X \mapsto \llbracket {\alpha}^{(j,k)} \rrbracket^{G}_{V'}]\). In particular, it means that \(\psi\) is \(k\)-stable on \((G,V'_{C(\alpha)},n)\). We will show that \(V'_{C(\alpha)}\) and \(V\) are effectively equal, for the purpose of evaluating \(\psi\). The free variables of \(\psi\) are \(\textit{free}\left(\alpha\right) \cup \{X\}\).
By Lemma 8, \(V'(Y) = V(Y)\) for all \(Y \in \textit{free}\left(\alpha\right)\). We know \(\llbracket {\alpha}^{(j,k)} \rrbracket^{G}_{V'}\) only depends on \(V'\) restricted to \(\textit{free}\left(\alpha\right)\), and therefore \(\llbracket {\alpha}^{(j,k)} \rrbracket^{G}_{V'}\) equals \(\llbracket {\alpha}^{(j,k)} \rrbracket^{G}_{V}\), which by definition equals \(V(X)\). Hence, \(V'_{C(\alpha)} = V'[X \mapsto V(X)]\). Let us now compare \(V'_{C(\alpha)}\) and \(V\). For \(X\) they are equal, since \(V'_{C(\alpha)}(X) = V'[X \mapsto V(X)] = V(X)\). For \(Y \in \textit{free}\left(\alpha\right)\), we already have shown that \(V'(Y) = V(Y)\). That covers all free variables of \(\psi\), thus \(V'_{C(\alpha)} = V\) for all free variables in \(\psi\).
Remember that \(\psi\) is \(k\)-stable on \((G,V'_{C(\alpha)},n)\), and together Lemma 10, it follows that \(\psi\) is \(k\)-stable on \((G,V,n)\). Since \(\kappa\) is coherent and tracks stability, we conclude that \(n \in S(\psi)\).
\(\alpha \in \textit{dep}(\kappa)\). When \(\alpha\) is in \(\textit{dep}(\kappa)\), then all vertices are in \(T'(\alpha)\), by definition of \(T'\). Hence, \(n \in T'(\alpha)\).
\(\alpha \not \in \textit{ticks}\left(\kappa\right)\) and \(\alpha \not \in \textit{dep}(\kappa)\). By definition of \(C'\) we have \(C'(\alpha) = C(\alpha)\). So, \(\alpha\) is \((C(\alpha),k)\)-stable on \((G,V,n)\). Because \(\alpha\) is neither in \(\textit{ticks}\left(\kappa\right)\) nor in \(\textit{dep}(\kappa)\), it follows that \(\textit{free}\left(\alpha\right) \cap \textit{reset}\left(\kappa\right) = \emptyset\). Then, by Lemma 6, \(V'(Y) = V(Y)\) for all \(Y \in \textit{free}\left(\alpha\right)\). Hence, by Lemma 11, is \((C,k)\)-stable on \((G,V,n)\). Since \(\kappa\) tracks stability, we conclude that \(n \in T(\alpha)\). Then, because \(T'(\alpha) = T(\alpha)\) by definition of \(T'\), \(n \in T'(\alpha)\), as desired.
We now prove the converse direction. Assume that \(n \in T'(\alpha)\). We need to show that \(\alpha\) is \((C',k)\)-stable on \((G,V',n)\). Once more, we distinguish three cases based on the definition of \(T'\):
\(\alpha \in \textit{ticks}\left(\kappa\right)\). By definition of \(T'\), we have \(n \in T(\alpha)\) and \(n \in S(\psi)\). By definition of \(C'\), \(C'(\alpha) = C(\alpha) + 1\). Furthermore, by definition of ticking, it must be the case that \(C(\alpha) = k-1\). Therefore, \(C'(\alpha) = k\). Hence, what we really need to show here is that \(\alpha\) is \((k,k)\)-stable on \((G,V',n)\). Using Lemma 8, we find that \(V'(Y) = V(Y)\) for all \(Y \in \textit{free}\left(\alpha\right)\). Therefore, by Lemma 11, \(\alpha\) is \((k,k)\)-stable on \((G,V',n)\) if, and only if, \(\alpha\) is \((k,k)\)-stable on \((G,V,n)\). It hence suffices to show that \(\alpha\) is \((k,k)\)-stable on \((G,V,n)\). By Definition 8, this means we must show that for every integer \(j\) so that \(0 \leq j < k\), the body \(\psi\) is \(k\)-stable on \((G,V_j,n)\), where \(V'_j = V[X \mapsto \llbracket {\alpha}^{(j,k)} \rrbracket^{G}_{V}]\). We do so as follows.
We know that \(n \in T(\psi)\), which since \(\kappa\) is tracks stability, implies that \(\alpha\) is \((C,k)\)-stable on \((G,V,n)\). This means, that for all integers \(j\) so that \(0 \leq j < C(\alpha) = k-1\), \(\psi\) is \(k\)-stable on \((G,V_j,n)\). It hence remains to show that \(\psi\) is \(k\)-stable on \((G,V_{k-1},n)\). Because \(\kappa\) is sound, \[V(X) = \llbracket {\varphi|_X}^{(C,k)} \rrbracket^{G}_{V} = \llbracket {\alpha}^{(C,k)} \rrbracket^{G}_{V} = \llbracket {\alpha}^{(k-1,k)} \rrbracket^{G}_{V}\] This implies that \(V = V_{k-1}\). Then because \(n \in S(\psi)\), and \(\kappa\) tracks stability, we derive that \(\psi\) is \(k\)-stable on \(V= V_{k-1}\). Hence, \(\alpha\) is \((C',k)\)-stable on \((G,V,n)\).
\(\alpha \in \textit{dep}(\kappa)\). By definition of \(T'\), we have \(n \in T(\alpha)\). As \(\alpha\) is in \(\textit{dep}(\kappa)\), we have \(C'(\alpha) = 0\). Hence, we need to show that \(\alpha\) is \((0,k)\)-stable on \((G,V',n)\). According to Definition 8, this is vacuously true, since there are no integers \(j\) such that \(0 \leq j < 0\). Hence, \(\alpha\) is \((C',k)\)-stable on \((G,V',n)\).
\(\alpha \not \in \textit{ticks}\left(\kappa\right)\) and \(\alpha \not \in \textit{dep}(\kappa)\). By definition of \(T'\), we have \(T'(\alpha) = T(\alpha)\). Similarly to before, we find that \(C'(\alpha) = C(\alpha)\), and \(\textit{free}\left(\alpha\right) \cap \textit{reset}\left(\kappa\right) = \emptyset\).
By substituting the counter, what we need to show becomes that \(\alpha\) is \((C,k)\)-stable on \((G,V',n)\). Because \(\kappa\) is coherent and \(n \in T(\alpha)\), we know that \(\alpha\) is \((C,k)\)-stable on \((G,V,n)\). Through Lemma 6 we find that \(V'(Y) = V(Y)\) for all \(Y \in \textit{free}\left(\alpha\right)\). Combined with Lemma 11, we find that \(\alpha\) is \((C,k)\)-stable on \((G,V',n)\).
◻
The third kind of transition increases the bound \(k\) when \(\kappa\) is complete.
Definition 14. Let \(\kappa\) be a configuration with graph \(G\) and bound \(k\). A type-3 transition on \(\kappa\) yields the configuration \(\kappa'\) such that \(\kappa= \kappa'\) if \(\kappa\) is not complete. Otherwise, \(\kappa'\) is the initial configuration of \(\varphi\) on \(G\) w.r.t. \(k+1\). We write \(\kappa\vdash_{3} \kappa'\) to indicate that \(\kappa'\) is the type-3 transition of \(\kappa\).
It is straightforward to show:
If \(\kappa\vdash_{3} \kappa'\) and \(\kappa\) is coherent, then so is \(\kappa'\).
Proof. Trivial, since either \(\kappa'= \kappa\), which is coherent by assumption, or \(\kappa'\) is the initial configuration w.r.t. \(k+1\), which is coherent by definition. ◻
Let us write \(\vdash_{1,2}\) for the composition of \(\vdash_{1}\) and \(\vdash_{2}\), with \(\vdash_{2}\) executing after \(\vdash_{1}\). We define \(\vdash_{3,1,2}\) similarly. We use \(\vdash_{1,2}^*\) to denote the reflexive-transitive closure of \(\vdash_{1,2}\) and similarly for \(\vdash_{3,1,2}^*\).
Lemma 12. If \(\kappa\vdash_{1} \kappa'\) and \(\kappa\) is coherent and complete then \(\kappa= \kappa'\).
Proof. If \(\kappa\) is complete, then \(F= \textit{sub}^*(\varphi)\). Since \(F\subseteq F'\) by Lemma 2, also \(F' = \textit{sub}^*(\varphi)\). Moreover, also \(\kappa'\) is coherent by Lemma [lem:trans-1-preservation-full]. Since both \(\kappa\) and \(\kappa'\) are consistent and \(F= F'\) it is necessarily the case that \(R= R'\). Also, the fact that both \(\kappa\) and \(\kappa'\) track stability and \(F= F'\) implies that necessarily \(S= S'\) and \(T= T'\). ◻
Lemma 13. If \(\kappa\vdash_{1} \kappa'\) and \(\kappa\) is consistent but not complete then either \(F\) is a strict subset of \(F'\) or \(\textit{ticks}\left(\kappa'\right)\) is non-empty.
Proof. Notation-wise, assume \((G, k, C, V, R, F, S, T) = \kappa\) and \((G, k, C', V', R, F', S', T) = \kappa'\). We first make the following observation: for every \(\alpha \in \textit{sub}^*(\varphi) \setminus F\) there exists \(\beta \in \textit{sub}^*(\varphi) \setminus F\) such that \(\textit{sub}\left(\beta\right) \subseteq F\).
The proof of this observation is by induction on \(\alpha\). For the base case when \(\alpha = p, \neg p\), or \(X\) we take \(\beta = \alpha\). This suffices since \(\alpha \not \in F\) and \(\textit{sub}\left(\beta\right) = \emptyset \subseteq F\). For the inductive case when \(\alpha\) is any other formula we check if there exists an immediate subformula \(\psi \in \textit{sub}\left(\alpha\right) \setminus F\). If so, then we take the \(\beta \in \textit{sub}^*(\psi) \setminus F\subseteq \textit{sub}^*(\alpha) \setminus F\) with \(\textit{sub}\left(\beta\right) \subseteq F\) that we obtain by applying the induction hypothesis on \(\psi\). If no such subformula \(\psi\) exists, necessarily \(\textit{sub}\left(\alpha\right) \subseteq F\), and it suffices to take \(\beta = \alpha\).
We now prove the lemma as follows. Since \(\kappa\) is not complete, \(\varphi \not \in F\). By our observation, there is some \(\beta \in \textit{sub}^*(\varphi) \setminus F\) with \(\textit{sub}\left(\beta\right) \subseteq F\). If \(\beta \not \in \textit{sub}_{\pi}^*(\varphi)\) then \(\beta \in F'\) by definition of \(F'\), hence \(F\subset F'\). If \(\beta \in \textit{sub}_{\pi}^*(\varphi)\) then there are two possibilities.
\(C(\beta) = k-1\). Then \(\beta \in F'\) by definition of \(F'\) and hence \(F\subset F'\).
\(C(\beta) < k-1\). We claim that \(\beta\) ticks in \(\kappa'\). Indeed, by Lemma 2, \(\textit{sub}\left(\beta\right) \subseteq F\subseteq F'\). Furthermore, consistency of \(\kappa\) implies that \(F\) is closed under subformulae, i.e., \(\textit{sub}^*(F) \subseteq F\). As such, \(\textit{sub}_{\pi}^+(\beta) \subseteq F\). Hence, by the third property of consistency, every \(\gamma \in \textit{sub}_{\pi}^+(\beta)\) has \(C(\gamma) = k-1\).
◻
Definition 15. We define a total order on \(\sqsubseteq\) on counters: \(C\sqsubseteq C'\) if for all \(\alpha \in \textit{sub}_{\pi}^*(\varphi)\) with \(C(\alpha) > C'(\alpha)\) there exists \(\beta \in \textit{sub}_{\pi}^*(\varphi)\) with \(\alpha \in \textit{sub}_{\pi}^+(\varphi)\) such that \(C(\beta) < C'(\beta)\). It is readily verified that \(\sqsubseteq\) is indeed a total order. We write \(C\sqsubset C'\) if \(C\sqsubseteq C'\) and \(C\not = C'\).
Definition 16. We define a strict partial order \(\prec\) on configurations: \(\kappa\prec \kappa'\) if
\(k < k'\); or
\(k = k'\) and \(C\sqsubset C'\); or
\(k = k'\) and \(C= C'\) and \(F\subset F'\).
Lemma 14. If \(\kappa\vdash_{1,2} \kappa'\) and \(\kappa\) is consistent but not complete, then \(\kappa\prec \kappa'\).
Proof. Assume \(\kappa= \kappa_1 \vdash_{1} \kappa_2 \vdash_{2} \kappa_3\). Notation-wise, assume \(\kappa_i = (k_i, C_i, V_i, R_i, F_i, S_i, T_i)\). Then \(k_1 = k_2 = k_3\) and \(C_1 = C_2\). There are two possibilities.
\(\textit{ticks}\left(\kappa_2\right) = \emptyset\). In this case, by definition of \(\vdash_{2}\), \(C_2 = C_3\) and \(F_2 = F_3\). By Lemma 13, \(F_1 \subset F_2 = F_3\). Hence \(\kappa\prec \kappa'\).
\(\textit{ticks}\left(\kappa_2\right) \not = \emptyset\). By definition of \(\vdash_{1}\), \(C_1 = C_2\). By definition of \(\vdash_{2}\), \(C_2 \sqsubset C_3\). This is because, for every fixpoint formula whose counter is set to \(0\) in \(C_3\), a ticking fixpoint ancestor has its counter incremented. Hence \(\kappa\prec \kappa'\).
◻
Lemma’s [lem:trans-1-preservation-full], [lem:trans-2-preservation-full] and [lem:trans-3-preservation] show preservation of coherence by \(\vdash_{3,1,2}\). We can also show that the three transition types make progress when executed in the order \(\vdash_{3,1,2}\): \(\vdash_{3}\) transitions to the next bound value when the input is complete and is a no-op otherwise, while \(\vdash_{1,2}\) change the configuration to become “strictly more complete”, in the following sense.
Let \(\kappa\) be the initial configuration on \(\varphi\) for \(G\) w.r.t. bound \(k\). There exists \(\kappa'\) that is coherent and complete such that \(\kappa\vdash_{1,2}^* \kappa'\).
Proof. Observe that \(\vdash_{1}\) and \(\vdash_{2}\) never change the bound. Therefore, for any \(\kappa''\) such that \(\kappa\vdash_{1,2} \kappa''\), it follows that \(\kappa''\) is coherent (Lemma’s [lem:trans-1-preservation-full] and [lem:trans-2-preservation-full]) and has the same bound \(k\). By Lemma 14, \(\kappa\prec \kappa''\). If \(\kappa''\) is complete then we are done. Otherwise, the result then follows by repeating this reasoning and observing that within the set of coherent configurations with bound value \(k\), there is only a finite number of times that one can apply \(\prec\) since in every such configuration \(F\) must be a subset of \(\textit{sub}^*(\varphi)\) and \(C\leq k-1\). ◻
Combined with Proposition [prop:smallest-stable-uniform-approximation-terminates-and-is-correct], this yields correctness of the counting algorithm:
Let \(\kappa\) be the initial configuration \(\kappa\) on \(\varphi\) for \(G\) w.r.t. bound \(1\). There exists a configuration \(\kappa'\) that is coherent, complete, and stable such that \(\kappa\vdash_{3,1,2}^* \kappa'\).
Proof. Note that \(\vdash_{3}\) is a no-op on configurations that are not complete. Since by Proposition [prop:trans-1-2-reaches-complete-within-current-bound] \(\kappa\vdash_{1,2}^* \kappa''\) with \(\kappa''\) coherent, complete and having the same bound as \(\kappa\), there is also a sequence of transitions of the form \(\kappa\vdash_{3,1,2}^* \kappa''\): before reaching completion we may vacuously introduce \(\vdash_{3}\) before \(\vdash_{1}\) since this is a no-op. Now two things may happen:
\(\kappa''\) is stable, in which case it suffices to take \(\kappa' = \kappa''\);
\(\kappa''\) is not stable. By executing \(\vdash_{3}\) on \(\kappa''\) we then obtain the initial configuration \(\kappa_2\) that has bound \(2\). By repeating our reasoning, but now starting from \(\kappa_2\) we know from Proposition [prop:smallest-stable-uniform-approximation-terminates-and-is-correct] that will eventually get the desired \(\kappa'\).
◻
We next show how to encode configurations as labeled graphs and prove that that there exists a simple recurrent GNNs that simulates \(\vdash_{3,2,1}^*\) on such encodings.
To define the encoding of a configuration \(\kappa\), we first define local versions of configurations. Intuitively, if \(G\) is the graph of \(\kappa\) then the local configuration of \(\kappa\) at \(n \in G\) will contain the information specific to \(n\) stored in \(\kappa\), as well as the information that is common to all nodes, such as \(k\) and \(F\). Formally, for a function \(M\colon A \to \mathcal{P}(N_{G})\) from some domain \(A\) to sets of nodes, we define the local version of \(M\) at node \(n\) to be the function \(m\colon A \to \mathbb{B}\) such that, for all \(a \in A\), \(m(a) = 1\) iff \(n \in M(a)\).
Definition 17. Let \(\kappa=(G, k, C, V, R, F, S, T)\) be a configuration and let \(n\) be a node in \(G\). The local version of \((\kappa,n)\) is the tuple \((G(n), k, C, v, r, F, s, t)\) where
\(G(n) \subseteq \mathbb{P}\) is the label of \(n\) in \(G\);
\(k \in \mathbb{N}\) is the bound of \(\kappa\);
\(F\) is the validity set of \(\kappa\); and
\(v\), \(r\), \(s\), and \(t\) are the local versions at \(n\) of \(V, R, S\), and \(T\), respectively.
The encoding of \(\kappa\) is the graph \(H\) that has the same nodes and edges as \(G\), such that \(H(n)\) is the local version of \((\kappa,n)\), for every node \(n \in G\).
It is clear that when \(A\) is a finite set, we may treat functions \(A \to \mathbb{B}\) and \(A \to \mathbb{N}\) as boolean resp. natural number vectors. Moreover, we may also treat subsets of a finite universe \(A\) as boolean vectors, since such subsets are isomorphic to characteristic functions \(A \to \mathbb{B}\). Since all components of local configurations are of this form, it follows that we may treat local configurations as vectors over \(\mathbb{N}\cup \mathbb{B}\), and hence also as vectors in \(\mathbb{R}^d\) for some large enough value \(d\). For example, for every \(p \in \mathbb{P}\) this vector has a component that is \(1\) if \(p \in G(n)\) and is \(0\) otherwise. In what follows, we hence treat local configurations as vectors in \(\mathbb{R}^d\), with the understanding that its components carry a value from either \(\mathbb{B}\) or \(\mathbb{N}\). To facilitate notation, we will refer to the components of local configuration vector \(\mathbf{x}\) using “field access” notation: e.g., \(\mathbf{x}[v(X)]\) is the boolean element of \(\mathbf{x}\) that stores \(v(X)\). Specifically, \(\mathbf{x}[\alpha \in F]\) is the boolean element of \(\mathbf{x}\) that is \(1\) iff \(\alpha \in F\), and we similarly write \(\mathbf{x}[p \in G(n)]\).
In the above sense, the encoding \(H\) of \(G\) is a \(\mathbb{R}^d\)-labeled graph.
Let \(f\) be a function mapping configurations to configurations. A label transformer \(g\colon \mathcal{G}[\mathbb{R}^d] \to \mathcal{G}[\mathbb{R}^d]\) simulates such a function \(f\) if for all configurations \(\kappa\), the equality \(g(\textit{enc}(\kappa)) = \textit{enc}(f(\kappa))\) holds, where \(\textit{enc}(\kappa)\) denotes the encoding of \(\kappa\) as a labeled graph.
It is relatively straightforward to show that there is an AC layer \(L_i\) simulating \(\vdash_{i}\), for every \(1 \leq i \leq 3\). Hence, their sequential composition \(L_3; L_2; L_1\) simulates \(\vdash_{3,2,1}\). It immediately follows that there exists a “multi-layer” recurrent GNN that iterates the composition \(L_3; L_2; L_1\) to simulate \(\mu\)-calculus formulae. This is not sufficient to prove Theorem 1, however, since (i) we have defined recurrent GNNs to iterate only a single AC layer and (ii) this layer must be simple for Theorem 1 to hold.
Unfortunately, we cannot simulate \(\vdash_{2}\) and \(\vdash_{3}\) by means of a simple AC layer: these transitions may cause the counter \(C(X)\) of a variable \(X\) to be reset to zero if a certain boolean condition \(b\) holds. To express this by means of a RFNN in the \(\mathrm{\small Comb}\) function of a GNN, we must essentially determine the new value of \(C(X)\) by a function of the form “if \(b = 1\) then \(C(X)\) else \(0\)”. This function is non-continuous around \(b=1\), and therefore not expressible by a RFNN, which always expresses a continuous and piecewise-linear transformation.
We hence need to work harder to obtain Theorem 1. Our approach is conceptually simple: while we cannot directly express “if \(b = 1\) then \(C(X)\) else \(0\)” in an AC layer, we may use the iteration capabilities of recurrent GNNs to repeatedly decrement \(C(X)\) until it reaches zero. We have to take care, of course, that while we are doing this the state of the other configuration components is not incorrectly altered.
Formally, an extended configuration is a pair \((\kappa, D)\) with \(\kappa\) a configuration, and \(D\subseteq \textit{vars}\left(\varphi\right)\). Intuitively, \(D\) will hold the variables whose counter value we need to keep decrementing. We also call \(D\) the residual set.
Given a configuration \(\kappa\), we define the partial transition of type \(2\) and type \(3\), denoted \(\vdash'_{2}\) and \(\vdash'_{3}\) as follows. The partial type-2 transition on \(\kappa\) yields the extended configuration \((\kappa',D')\) where
\(\kappa'\) is defined such as in Definition 13 except that \(C'(X) :=C(X)\) for all \(X\) with \(\varphi|_X \in \textit{dep}(\kappa)\), and
\(D' :=\{ X \mid \varphi|_X \in \textit{dep}(\kappa) \}\).
The partial type-3 transition on \(\kappa\) yields the extended configuration \((\kappa', D')\) where
\(\kappa'\) is defined such as in Definition 14 except that \(C'(X) :=C(X)\) for all \(X\), and
\(D' :=\textit{vars}\left(\varphi\right)\).
These partial transitions hence delay setting variable counters to zero, but record in \(D'\) for which variables this must still happen. For notational convenience, define \(\kappa\vdash'_{1} (\kappa', \emptyset)\) whenever \(\kappa\vdash_{1} \kappa'\).
For every \(1 \leq i \leq 3\) we then define the extended type-\(i\) transition on extended configurations, denoted \((\kappa, D) \leadsto_{i} (\kappa', D')\). Here, \((\kappa', D') = (\kappa, D)\) if \(D\neq \emptyset\); otherwise, \((\kappa', D')\) is the result of applying \(\vdash'_{i}\) to \(\kappa\).
Finally, we define a reset transition on extended configurations: on \((\kappa, D)\) the resetting transition \(\leadsto_{r}\) yields \((\kappa', D')\) where \(\kappa'\) equals \(\kappa\) on all components except \(C\), and \[\begin{align} C'(X) & := \begin{cases} C(X) -1 & \text{if } X \in D\text{ and } C(X) > 0 \\ C(X) & \text{otherwise} \end{cases}\\ D' & :=\{ X \in D\mid C(X) - 1 > 0\} \end{align}\] Note in particular that \((\kappa', D') = (\kappa, D)\) when \(D= \emptyset\).
We write \(\leadsto_{3,1,2,r^+}\) for the execution of \(\leadsto_{3}\) followed by \(\leadsto_{1}\), then \(\leadsto_{2}\), and then one or more executions of \(\leadsto_{r}\). \(\leadsto_{3,1,2,r}\) is defined similarly, but ends with a single execution of \(\leadsto_{r}\). We write \(\leadsto_{r^+}\) for one ore more executions of \(\leadsto_{r}\).
Lemma 15. Assume \((\kappa, \emptyset) \leadsto_{3,1,2,r^+} (\kappa', \emptyset)\).
If \(\kappa\) is complete, then \(\kappa\vdash_{3} \kappa'\).
If \(\kappa\) is not complete, then \(\kappa\vdash_{3,1,2} \kappa'\).
Proof. (1) If \(\kappa\) is complete, then \((\kappa, \emptyset) \leadsto_{3} (\kappa'', D)\) for some \(\kappa''\) and some non-empty \(D\). Because \(D\) is non-empty, \(\leadsto_{1}\) and \(\leadsto_{2}\) are the identity on \((\kappa'', D)\). Hence, the execution of \(\leadsto_{3,1,2,r^+}\) is equivalent to first executing \(\leadsto_{3}\), and then \(\leadsto_{r^+}\) until the residual set \(D\) becomes empty. Since \(\leadsto_{3}\) executes \(\vdash_{3}\) except for resetting the counter values, and \(\leadsto_{r^+}\) only decrements the counters of variables in \(D\) until zero , the net effect is the same as \(\vdash_{3}\) on \(\kappa\). Hence \(\kappa\vdash_{3} \kappa'\).
(2) If \(\kappa\) is not complete, then \(\leadsto_{3}\) is the identity on \((\kappa, \emptyset)\). Therefore, \((\kappa, \emptyset) \leadsto_{1,2,r^+} (\kappa', \emptyset)\). When \(\leadsto_{1}\) executes on \((\kappa, \emptyset)\) it returns \((\kappa'', \emptyset)\) for some \(\kappa''\) with \(\kappa\vdash_{1} \kappa''\). On \((\kappa'', \emptyset)\), \(\leadsto_{2}\) returns \((\kappa''', D)\) for some \(\kappa'''\) and \(D\). We distinguish two cases.
\(D\) is empty. This only happens when \(\textit{dep}(\kappa'') = \emptyset\), and therefore, since we defined \(\vdash'_{2}\) to equal \(\vdash_{2}\) except for the counter of variables in \(\{ X \mid \varphi|_X \in \textit{dep}(\kappa'')\}\), we see that \(\kappa''\vdash_{2} \kappa'''\). Executing \(\leadsto_{r^+}\) on \((\kappa''', \emptyset)\) is the identity, and hence \(\kappa''' = \kappa'\). We may hence conclude that \(\kappa\vdash_{3} \kappa\vdash_{1} \kappa'' \vdash_{2} \kappa'\), as desired.
Otherwise, \(D\) is non-empty. In this case, \(\leadsto_{2}\) executed the same logic as \(\vdash_{2}\) except for the resetting the counter values of variables in \(\{X \mid \varphi|_X \in \textit{dep}(\kappa'') \}\). The subsequent execution of \(\leadsto_{r^+}\) decrements the counters of those variables until zero and leaves everything else untouched. The net effect is the same as \(\vdash_{2}\) on \(\kappa''\). Therefore, \(\kappa\vdash_{3} \kappa\vdash_{1} \kappa'' \vdash_{2} \kappa'\), as desired.
◻
Lemma 16. Assume \(\kappa\vdash_{3,1,2} \kappa'\).
If \(\kappa\) is not complete, then \((\kappa, \emptyset) \leadsto_{3,1,2,r^+} (\kappa', \emptyset)\).
If \(\kappa\) is complete, then there exists for \(\kappa''\) such that \((\kappa, \emptyset) \leadsto_{3,1,2,r^+} (\kappa'', \emptyset) \leadsto_{3,1,2,r^+} (\kappa', \emptyset)\)
Proof. (1) If \(\kappa\) is not complete, then \(\kappa\vdash_{3} \kappa\vdash_{1} \kappa'' \vdash_{2} \kappa'\) for some configuration \(\kappa''\). By definition of \(\leadsto_{3}\) and \(\leadsto_{1}\), \[(\kappa,\emptyset) \leadsto_{3} (\kappa,\emptyset) \leadsto_{1} (\kappa'',\emptyset).\]
Let \((\kappa''', D)\) be the result of executing \(\leadsto_{2}\) on \((\kappa'',\emptyset)\). By definition of \(\leadsto_{2}\), \(\kappa'''\) equals \(\kappa'\) except that possibly the counter values of some variables in \(\kappa'\) are not reset to zero, and \(D\) stores the variables for which this is the case. If \(D\not = \emptyset\) then We can make the counter value of these variables zero, and leave everything else untouched, by repeatedly executing \(\leadsto_{r}\) until \(D\) becomes \(\emptyset\). If \(D= \emptyset\), then \(\kappa'''\) itself is already the result of applying \(\vdash_{2}\) on \(\kappa''\), i.e., \(\kappa''' = \kappa'\). Also observe that in this case, by definition, \(\leadsto_{r^+}\) on \((\kappa''', D)\) yields \((\kappa''', D)\) itself. Hence, in conclusion, both in the case where \(D= \emptyset\) and \(D\not = \emptyset\) we have: \[(\kappa,\emptyset) \leadsto_{3} (\kappa,\emptyset) \leadsto_{1} (\kappa'',\emptyset) \leadsto_{2} (\kappa''',D) \leadsto_{r^+} (\kappa',\emptyset).\]
(2) If \(\kappa\) is complete, then \(\vdash_{3}\) returns the initial configuration \(\kappa''\) for \(k+1\), where \(k\) is the bound in \(\kappa\), and \(\kappa''\vdash_{1,2} \kappa'\). By definition of \(\leadsto_{3}\), \((\kappa,\emptyset) \leadsto_{3} (\kappa''',D)\) with \(D\) non-empty and \(\kappa'''\) equal to \(\kappa''\), except that no variable has its counter value reset. Since \(D\) is non-empty \(\leadsto_{1,2}\) is the identity when executed on \((\kappa''', D)\). A subsequent execution of \(\leadsto_{r^+}\) on \((\kappa''', D)\) then takes care of the resetting of the counter values. As such \((\kappa, \emptyset) \leadsto_{3,1,2,r^+} (\kappa'', \emptyset)\). Because \(\kappa''\) is an initial configuration, it is not complete. Therefore, applying \(\vdash_{3}\) again to \(\kappa''\) simply yields \(\kappa''\). Hence, \(\kappa'' \vdash_{3} \kappa'' \vdash_{1,2} \kappa'\), i.e., \(\kappa'' \vdash_{3,1,2} \kappa'\). By applying point (1) to \(\kappa'' \vdash_{3,1,2} \kappa'\) it follows that \((\kappa'',\emptyset) \leadsto_{3,1,2,r^+} (\kappa',\emptyset)\). Therefore, \((\kappa',\emptyset) \leadsto_{3,1,2,r^+} (\kappa'',\emptyset) \leadsto_{3,1,2,r^+} (\kappa',\emptyset)\). ◻
Lemma 17. Let \(\kappa\) and \(\kappa'\) be configurations. Then \((\kappa, \emptyset) \leadsto_{3,1,2,r^+}^* (\kappa', \emptyset)\) if, and only if, \((\kappa, \emptyset) \leadsto_{3,1,2,r}^* (\kappa', \emptyset)\).
Proof. (\(\Rightarrow\)) Assume \((\kappa, \emptyset) \leadsto_{3,1,2,r^+}^* (\kappa, \emptyset)\). The proof is by induction on the number of times that \(\leadsto_{3,1,2,r^+}\) is executed to obtain \((\kappa', \emptyset)\). The base case, with zero executions, is trivial. Otherwise, \[(\kappa,\emptyset) \leadsto_{3,1,2,r^+} (\kappa''',\emptyset) \leadsto_{3,1,2,r^+}^* (\kappa', \emptyset)\] for some \(\kappa'''\). We can write this as \[(\kappa,\emptyset) \leadsto_{3,1,2,r} (\kappa'',D) \leadsto_{r}^* (\kappa''',\emptyset) \leadsto_{3,1,2,r^+}^* \kappa'\] for some \((\kappa'',D)\), where the \(\leadsto_{r}^*\) is executed until \(D\) becomes empty. Note that on inputs where \(D\) is non-empty, \(\leadsto_{r}^*\) is equivalent to \(\leadsto_{3,1,2,r}^*\). Therefore, \[(\kappa,\emptyset) \leadsto_{3,1,2,r} (\kappa'',D) \leadsto_{3,1,2,r}^* (\kappa''',\emptyset) \leadsto_{3,1,2,r^+}^* \kappa'\] and hence, by induction hypothesis, also \[(\kappa,\emptyset) \leadsto_{3,1,2,r} (\kappa'',D) \leadsto_{3,1,2,r}^* (\kappa''',\emptyset) \leadsto_{3,1,2,r}^* \kappa',\] as desired.
(\(\Leftarrow\)) Assume \((\kappa, \emptyset) \leadsto_{3,1,2,r}^* (\kappa', \emptyset)\). The proof is by induction on the number of times that \(\leadsto_{3,1,2,r}\) is executed to obtain \((\kappa', \emptyset)\). The base case, with zero executions, is trivial. Otherwise, \((\kappa,\emptyset) \leadsto_{3,1,2,r} (\kappa_0,D_0) \leadsto_{3,1,2,r}^* (\kappa',\emptyset)\) for some \(\kappa_0\) and \(D_0\). We distinguish two cases.
\(D_0 = \emptyset\), then \((\kappa,\emptyset) \leadsto_{3,1,2,r} (\kappa_0,\emptyset)\) hence also \((\kappa,\emptyset) \leadsto_{3,1,2,r^+} (\kappa_0,\emptyset)\). The result then follows from the induction hypothesis.
\(D_0 \not = \emptyset\). Then we must execute \(\leadsto_{3,1,2,r}\) \(\ell \geq 1\) times before \(D_0\) becomes empty. I.e., the derivation of \((\kappa'',D_0) \leadsto_{3,1,2,r}^* (\kappa',\emptyset)\) is of the form \[\begin{gather} (\kappa'',D_0) \leadsto_{3,1,2,r} (\kappa_1,D_1) \leadsto_{3,1,2,r} \dots \\ \leadsto_{3,1,2,r} (\kappa_{\ell-1},D_{\ell-1}) \leadsto_{3,1,2,r} (\kappa_{\ell}, \emptyset) \\ \leadsto_{3,1,2,r}^* (\kappa', \emptyset) \end{gather}\] It is straightforward to observe that on inputs where \(D\not =\emptyset\), \(\leadsto_{3,1,2,r}\) is equivalent to \(\leadsto_{r}\). Therefore, \[\begin{gather} (\kappa'',D_0) \leadsto_{r} (\kappa_1,D_1) \leadsto_{r} \dots \\ \leadsto_{r} (\kappa_{\ell-1},D_{\ell-1}) \leadsto_{r} (\kappa_{\ell}, \emptyset) \\ \leadsto_{3,1,2,r}^* (\kappa', \emptyset) \end{gather}\] I.e., \((\kappa'',D_0) \leadsto_{r^+} (\kappa_\ell, \emptyset)\). Therefore, \[(\kappa, \emptyset) \leadsto_{3,1,2,r^+} (\kappa_\ell,\emptyset) \leadsto_{3,1,2,r}^* (\kappa',\emptyset),\] from which the result follows by the induction hypothesis applied to \((\kappa_\ell,\emptyset) \leadsto_{3,1,2,r}^* (\kappa',\emptyset)\).
◻
Let \(\kappa, \kappa'\) be configurations with \(\kappa'\) complete. Then \(\kappa\vdash_{3,1,2}^* \kappa'\) if, and only if, \((\kappa, \emptyset) \leadsto_{3,1,2,r}^* (\kappa', \emptyset)\).
We only illustrate the \(\Rightarrow\) direction, the converse direction proceeds similarly but additionally exploits the completeness of \(\kappa'\). If \(\kappa\) is not complete, then \(\vdash_{3}\) and \(\leadsto_{3}\) are the identity on \(\kappa\) resp. \((\kappa, \emptyset)\). As such, it is not difficult to see that if \(\kappa\) is not complete we may mimic \(\vdash_{3,1,2}\) by executing \(\leadsto_{3, 1,2}\) on \((\kappa, \emptyset)\) followed by zero or more executions of \(\leadsto_{r}\) until the residual set becomes empty. Since each extended transition \(\leadsto_{i}\) with \(1 \leq i \leq 3\) acts as the identity on extended configurations for which the residual set is no-empty, we may also execute \(\leadsto_{r}\) on extended configurations with non-empty residual set by means of \(\leadsto_{3,1,2,r}\). Consequently, on incomplete configurations we may mimic \(\vdash_{3,1,2}\) by executing \(\leadsto_{3,1,2,r}^*\).
If \(\kappa\) is complete, then \(\vdash_{3}\) yields a non-complete configuration, say \(\kappa''\). Using analogous reasoning as before, we can argue that we may mimic \(\vdash_{3}\) on \(\kappa\) by means of \(\leadsto_{3,1,2,r}^*\). Because \(\kappa''\) is not-complete, the subsequent execution of \(\vdash_{1,2}\) on \(\kappa''\) is equivalent to execution of \(\vdash_{3,1,2}\) on \(\kappa''\). The latter can be mimicked by means of \(\leadsto_{3,1,2,r}^*\) by our reasoning in the previous case. Consequently, \(\vdash_{3,1,2}\) is mimicked by means of two applications of \(\leadsto_{3,1,2,r}^*\).
Proof. (\(\Rightarrow\)). Assume that \(\kappa\vdash_{3,1,2}^* \kappa'\). We need to show that \((\kappa, \emptyset) \leadsto_{3,1,2,r}^* (\kappa', \emptyset)\). The proof is by induction on number of times that \(\vdash_{3,1,2}\) is executed to obtain \(\kappa'\). The base case, with zero executions, is trivial. Otherwise, \(\kappa\vdash_{3,1,2} \kappa'' \vdash_{3,1,2}^* \kappa'\) for some \(\kappa''\). By Lemma 16 and the induction hypothesis, also \[(\kappa,\emptyset) \leadsto_{3,1,2,r^+}^* (\kappa'', \emptyset) \leadsto_{3,1,2,r}^* (\kappa',\emptyset)\] Hence, by Lemma 17, also \[(\kappa,\emptyset) \leadsto_{3,1,2,r}^* (\kappa'', \emptyset) \leadsto_{3,1,2,r}^* (\kappa', \emptyset).\]
(\(\Leftarrow\)). Assume \((\kappa,\emptyset) \leadsto_{3,1,2,r}^* (\kappa'', \emptyset)\). By Lemma 17, also \((\kappa,\emptyset) \leadsto_{3,1,2,r^+}^* (\kappa'', \emptyset)\). We show that this implies \(\kappa\vdash_{3,1,2}^* \kappa'\). The proof is by induction on the number of times \(\leadsto_{3,1,2,r^+}\) is executed. The base case, with zero executions, is trivial. Otherwise, \[(\kappa,\emptyset) \leadsto_{3,1,2,r^+} (\kappa'', \emptyset) \leadsto_{3,1,2,r^+}^* (\kappa', \emptyset).\] We distinguish two cases.
\(\kappa\) itself is complete. By Lemma 15(1), \(\kappa\vdash_{3} \kappa''\), which implies that \(\kappa''\) is not complete. As such, \(\kappa' \not = \kappa''\), and thus there exists some \(\kappa'''\) such that \[(\kappa'',\emptyset) \leadsto_{3,1,2,r^+} (\kappa''', \emptyset) \leadsto_{3,1,2,r^+}^* (\kappa', \emptyset).\] By Lemma 15(2), \(\kappa'' \vdash_{3,1,2} \kappa'''\). As such, \[\kappa\vdash_{3} \kappa'' \vdash_{3,1,2} \kappa'''\] From this and the observation that \(\vdash_{3}\) is the identity on non-complete configurations, and \(\kappa''\) is not complete, we may therefore conclude that \(\kappa\vdash_{3,1,2} \kappa'''\). Furthermore, since \((\kappa''', \emptyset) \leadsto_{3,1,2,r^+}^* (\kappa', \emptyset)\), also \(\kappa''' \vdash_{3,1,2}^* \kappa'\) by induction hypothesis. Therefore, \(\kappa\vdash_{3,1,2}^* \kappa''\), as desired.
\(\kappa\) is not complete. Then \(\kappa\vdash_{3,1,2} \kappa''\) by Lemma 15(2) and \(\kappa'' \vdash_{3,1,2}^* \kappa'\) by induction hypothesis. Hence \(\kappa\vdash_{3,1,2}^* \kappa''\).
◻
We can encode extended configurations as labeled graphs similarly to how we encode configurations as labeled graphs: in the local configuration of \((\kappa, D)\) at node \(n\) we now also include \(D\) at every node. The concept of a label transformer simulating a function on extended configurations is defined in the obvious way.
There exists a simple AC layer simulating \(\leadsto_{3,1}\), as well as RFNNs whose lifting simulate \(\leadsto_{2}\) and \(\leadsto_{r}\).
The crux is that local versions of extended configurations are vectors whose elements are all in \(\mathbb{B}\) or \(\mathbb{N}\). It is well-known that, on such vectors, RFNNs can express all functions defined by boolean combinations of (i) the \(\mathbb{B}\) input elements and (ii) comparisons on the \(\mathbb{N}\) elements. For instance, if \(a,b\in \mathbb{B}\) and \(c \in \mathbb{N}\) then then function \(\phi(a,b,c) = \neg(a \wedge \neg b) \vee (c > 1)\) is definable by an RFNN.
We will only need such functions to define output local configuration vectors of \(\leadsto_{3,1}\), \(\leadsto_{2}\), and \(\leadsto_{r}\). For \(\leadsto_{3,1}\) we also need the message passing capability of AC layers.
Let us illustrate how to simulate \(\leadsto_{3,1}\), focusing on a single output element. Assume that \((\kappa, D) \leadsto_{3,1} (\kappa', D')\). Let \(H\) and \(H'\) be the encodings of \((\kappa, D)\) and \((\kappa', D')\), respectively. Let \(n \in N_{H} = N_{H'}\). Then \(H(n)\) is the input local configuration vector at \(n\), and \(H'(n)\) the output vector. We illustrate only how to define the output element \(H'(n)[r(\Diamond_{\ell}\, \psi)]\) with \(\Diamond_{\ell}\, \psi\) a subformula of \(\varphi\).2 According to the definition of \(\leadsto_{3,1}\):
if \(D' \not = \emptyset\) then \(H'(n)[r(\Diamond_{\ell}\, \psi] = H(n)[r(\Diamond_{\ell}\, \psi]\);
if \(D' = \emptyset\) and \(\kappa\) is complete then \(H'(n)[r(\Diamond_{\ell}\, \psi] = 0\) since \(\vdash_{3}\) moves to the next initial \(k\)-configuraton;
otherwise, \(D' = \emptyset\) and \(\kappa\) is not complete, and \(\leadsto_{3}\) is the identity on \((\kappa,D)\) and hence \((\kappa', D')\) is the result of applying \(\leadsto_{1}\) on \((\kappa, D)\). Therefore, according to Definition 12, in this case, \(H'(n)[r(\Diamond_{\ell}\, \psi)] = 1\) if, and only if, \(\left(\sum_{m \in E_{H}(n)} H(m)[r(\psi)]\right) \geq \ell\). Note that in an AC layer, \(\sum_{m \in E_{H}(n)} H(m)[r(\psi)]\) is provided by the \(\mathrm{\small Agg}\) function, which aggregates the local vectors of neighboring nodes, so this remains a comparison of an input feature vector element.
In each of these three cases, \(H'(n)[r(\Diamond_{\ell}\, \psi]\) is hence determined by a boolean combination of input boolean elements and natural number comparisons. The three conditions themselves can also be expressed as boolean combinations: \(D'= \emptyset\) is equivalent to \(\bigvee_{X \in \textit{vars}\left(\varphi\right)} H(n)[X \in D]\) while completeness of \(\kappa\) is equivalent to \(H(n)[\varphi \in F]\). Therefore, the entire computation of \(H'(n)[r(\Diamond_{\ell}\, \psi]\) is definable by a simple AC layer.
Proof. The full proof follows the reasoning of the proof sketch. We here only illustrate two things that are worth mentioning explicitly.
(1) First, the simulation of \(\leadsto_{2}\) hinges on the fact that for any variable \(X\) we can express the condition \(\varphi|_X \in \textit{ticks}\left(\kappa\right)\) as well as \(\varphi|_X \in \textit{dep}(\kappa)\) as boolean formulae \(\tau_X\) resp \(\delta_X\) on local configuration vectors. Suppose that \(\mathbf{x}\) is a local configuration vector at some node of a graph encoding \((\kappa,D)\). Then \(\tau_X\) follows the definition of \(\varphi|_X\) ticking: \[\begin{align} \tau_X & = \bigwedge_{\beta \in \textit{sub}\left(\varphi|_X\right)} \mathbf{x}[F(\beta)] \\ & \quad \wedge \mathbf{x}[C(\varphi|_X)] + 1 > \mathbf{x}[k]\\ & \quad \wedge \bigwedge_{\beta \in \textit{sub}\left(\varphi|_X\right)} \mathbf{x}[C(\beta)] + 1 = k \end{align}\]
The formula \(\delta_X\) needs a little more work. For any variable \(X\), define, \(\delta_X^0\) to be true if and only if \(\varphi|_X\) has some free variable that ticks in \(\kappa\), i.e. \[\delta_X^0 = \bigvee_{Z \in \textit{free}\left(\varphi|_X\right)} \tau_Z.\] For \(i>0\), define \(\delta_X^i\) to be true if \(\delta_X^{i-1}\) is true or if \(\varphi|_X\) has a free variable for which that is in \(\delta_Z^{i-1}\) is true. \[\delta_X^i = \delta_X^{i-1} \vee \bigvee_{Z \in \textit{free}\left(\varphi|_X\right)} \delta_Z^{i-1}\] Let \(q\) be the nesting depth fixpoint formulae in \(\varphi\). Then it is not difficult to see that \(X \in \textit{dep}(\kappa)\) if, and only if, \(\delta_X^q\) is true.
The simulation of \(\leadsto_{2}\) is then rather straightforward. For example, to determine the output counter value of \(\alpha = \varphi|_X \in \textit{sub}_{\pi}^*(\varphi)\), we reason as follows. If the residual set \(D\) is non-empty, then the counter must not change. If the residual set is empty then the counter must increase by one if \(\tau_X = 1\). Observe that when simulated by a RFNN, the boolean formula \((\tau_X \wedge D= \emptyset)\) yields \(1\) exactly when the counter needs to increase by one.3 Therefore we may compute \(C'(\alpha)\) by computing \(\mathbf{x}[C(\alpha)] + (\tau_X \wedge D= \emptyset)\). The other elements follow a similar reasoning. In particular, we never need the aggregate features computed by \(\mathrm{\small Agg}\), which is why \(\leadsto_{2}\) is simulated simply by lifting an RFNN to operate on labeled graphs.
(2) For simulating \(\leadsto_{r}\) we can follow a similar reasoning. For all \(X\) \[\begin{align} C'(X) & = C(X) - \mathbf{x}[X \in D] \\ \end{align}\] and in the output we have \([X \in D'] = \mathbf{x}[X \in D] \wedge (\mathbf{x}[C(X)] > 2)\). All other vector elements are left unchanged. ◻
Corollary 1. There exists a simple AC layer simulating \(\leadsto_{3,1,2,r}\).
Proof. Observe that simple AC layers are closed under composition with lifted RFNNs: if \(L\colon \mathcal{G}[\mathbb{R}^d] \to \mathcal{G}[\mathbb{R}^d]\) is a simple AC layer and \(f\colon \mathbb{R}^d \to \mathbb{R}^d\) is a RFNN then \({f\!\!\uparrow} \circ L\) is also expressible by a simple AC layer, obtained by taking the RFNN\(g\colon \mathbb{R}^d \to \mathbb{R}^d\) in \(L\)’s \(\mathrm{\small Comb}\) function, and replacing it by \(f \circ g\). ◻
We now have all the ingredients to prove Theorem 1.
Proof of Theorem 1. Let \(\varphi\) be a \(\mu\)GML sentence and \(G\) the input to \(\varphi\). Let \(d\) be the dimension necessary to encode local versions of extended configurations as vectors in \(\mathbb{R}^d\).
Fix \(\mathcal{N}= (\mathrm{\small In}, L, \mathrm{\small Hlt}, \mathrm{\small Out})\) be the recurrent GNN over \(\mathcal{P}(\mathbb{P})\) of dimension \(d\) where
\(\mathrm{\small In}\colon \mathcal{P}(\mathbb{P}) \to \mathbb{R}^d\) maps each finite set \(P\) of proposition symbols to the initial local extended configuration of \(\varphi\) w.r.t. \(k=1\), which is \((P, 1, v, \emptyset, r, s, t, \emptyset)\) with \(v,s,t\) mapping all formulae to \(0\), and \(t\) mapping all formulae to \(1\). It is straighforward to see that \({\mathrm{\small In}\!\!\uparrow}\), when executed on \(G\), returns the encoding of \((\kappa, \emptyset)\) with \(\kappa\) the initial configuration of \(\varphi\) on \(G\) w.r.t. \(k =1\).
\(L\) is the simple AC layer simulating \(\leadsto_{3,1,2,r}\), which exists by Corollary 1.
\(\mathrm{\small Hlt}\colon \mathbb{R}^d \to \mathbb{B}\) is the RFNN that, given the local version \(\mathbf{x_n}\) of an extended configuration \((\kappa, D)\) at node \(n\) returns \(1\) if and only if \(\kappa\) is complete (i.e., \(\mathbf{x_n}[\varphi \in F] = 1\)), \(\varphi\) is \(k\)-stable at \((G,V,n)\), (i.e., \(\mathbf{x_n}[s(\varphi)] = 1\)), and \(D\) is empty (i.e., \(\neg(\vee_{X \in \textit{vars}\left(\varphi\right)} \mathbf{x_n}[X \in D]) = 1\)). On a graph \(H\) that encodes an extended configuration \((\kappa,D)\), \({\mathrm{\small Hlt}\!\!\uparrow}(H)\) has all nodes labeled \(1\) if, and only if, \(\kappa\) is complete and stable, and \(D= \emptyset\).
\(\mathrm{\small Out}\colon \mathbb{R}^d \to \mathbb{B}\) is the function that on \(\mathbf{x_n}\) which is the encoding of \((\kappa, D)\) at node \(n\), returns the element \(\mathbf{x}[r(\varphi)]\) of \(\mathbf{x}\) that stores whether \(n \in R(\varphi)\).
\(\mathcal{N}\) expresses the node classifier defined by \(\varphi\) by the combination of Proposition [prop:smallest-stable-uniform-approximation-terminates-and-is-correct], [prop:incremental-correct], [prop:extended-trans-equal-normal-trans], and Corollary 1. Strictly speaking, \(\mathcal{N}\) is not simple since \(\mathrm{\small Hlt}\) need not be simple. This is easily solved, however, by extending local configurations with an extra boolean element that is used to store the result of \(\mathrm{\small Hlt}\), and modifying \(L\) so that it also computes \(\mathrm{\small Hlt}\) and stores it in this extra element. Then, \(\mathrm{\small Hlt}\) can just read this element instead. ◻
In the proof of Proposition [prop:simulate-single-extended-trans] and Theorem 1 we have used the fact that, given input vectors where all elements are in \(\mathbb{B}\) or \(\mathbb{N}\), RFNNs can express all functions defined by boolean combinations of (i) the boolean input elements and (ii) comparisons on the \(\mathbb{N}\) elements and additions on the \(\mathbb{N}\) elements. We illustrate this here in some more detail.
Recall that \(\text{ReLU}(x)=\max(0,x)\) for \(x \in \mathbb{R}\). Define \[\begin{align} \operatorname{clip}(x)=\text{ReLU}(\text{ReLU}(x)-\text{ReLU}(x-1)), \end{align}\] Clearly, \(\operatorname{clip}\) maps integer inputs exactly onto Boolean values (0 if \(x\) is an integer with \(x \leq 0\), and 1 otherwise). We interpret logical truth as \(1\) and logical falsehood as \(0\). Using this interpretation, we define the strict greater-than relation and Boolean conjunction as: \[\begin{align} (a>b)=\operatorname{clip}(a-b),\quad\quad(a\land b)=\operatorname{clip}(a+b-1). \end{align}\] It is readily verified that the first is correct for natural numbers \(a,b \in \mathbb{N}\), and the second is correct for booleans \(a,b \in \mathbb{B}\). Furthermore, boolean negation is defined as \[\begin{align} (\neg a)=1 - a \end{align}\]
From this, and the well-known fact that RFNNs are closed under sequential composition, parallel composition, and concatenation, our claim follows. Here, the sequential composition of \(f \colon \mathbb{R}^p \to \mathbb{R}^q\) with \(g\colon \mathbb{R}^q \to \mathbb{R}^r\) is the function \(g \circ f\colon \mathbb{R}^p \to \mathbb{R}^r\) such that \((g \circ f)(\mathbf{x}) = g(f(\mathbf{x}))\) for all \(\mathbf{x} \in \mathbb{R}^p\). The parallel composition of \(f \colon \mathbb{R}^p \to \mathbb{R}^q\) with \(f' \colon \mathbb{R}^{p'} \to \mathbb{R}^{q'}\) is the function \(f \| f'\colon \mathbb{R}^{p + p'} \to \mathbb{R}^{q + q'}\) such that \((f \| f')(\mathbf{x} \mathbin{|}\mathbf{x'}) = f(\mathbf{x}) \mathbin{|}f'(\mathbf{x'})\) for all \(\mathbf{x} \in \mathbb{R}^{p}\) and \(\mathbf{x'} \in \mathbb{R}^{p'}\). (Recall that \(\mathbf{x} \mathbin{|}\mathbf{x'}\) denotes vector concatenation.) Finally, the concatenation of \(f\colon \colon \mathbb{R}^p \to \mathbb{R}^q\) with \(h \colon \mathbb{R}^p \to \mathbb{R}^{q'}\) is the function \(f \mathbin{|}h\colon \mathbb{R}^p \to \mathbb{R}^{q+q'}\) such that \((f \mathbin{|}h)(\mathbf{x}) = f(\mathbf{x}) \mathbin{|}h(\mathbf{x})\) for all \(\mathbf{x} \in \mathbb{R}^p\).
We have shown that “bare bones” recurrent GNNs, without any features that allow to determine the graph size, can express \(\mu\)-calculus, under a terminating semantics. Specifically, the GNN can be halted as soon as we see a stopping bit of one in every node. Morever, it is guaranteed that this will happen after a finite number of iterations (polynomial in the graph size). Proving this possibility result turned out to be surprisingly subtle and intricate.
An interesting question for further research is whether it is possible to make the termination fully convergent, as intended in the original recurrent GNN proposal by Scarselli et al. . Specifically, is it possible to express every \(\mu\textsf{GML}\) formula by a recurrent GNN, with stopping bits and our halting guarantee, and moreover such that the entire feature vector of all nodes will stabilize?
It is also natural to wonder about the converse direction: do recurrent GNN classifiers always fall within \(\mu\textsf{GML}\)? The unreserved statement certainly does not hold, even for fixed-depth GNNs [10]. As already mentioned, Pflueger et al. obtained a converse result relative to node classifiers expressible in “local” monadic fixpoint logic.
What if we relativize more generally to MSO (monadic second-order logic) node classifiers and strongly connected graphs? In restriction to strongly connected graphs, g-bisimilarity and total surjective g-bisimilarity coincide, and hence here recurrent GNNs are invariant under graded bisimulations (Section 4). Since unary MSO formulas invariant under graded bisimilarity are expressible in \(\mu\textsf{GML}\) [18], [19], it would then immediately follow that recurrent GNN node classifiers in MSO fall within \(\mu\textsf{GML}\) (when restricted to strongly connected graphs), were it not for the caveat that the cited Janin–Walukiewicz theorem (as well as its graded version) assumes invariance of the MSO formula over all graphs, finite or infinite. In contrast, GNNs are designed to operate on finite graphs only.
There may be a way out of this conundrum, as a breakthrough, solving the open problem of proving the finitary version of the cited Janin–Walukiewicz theorem, has recently been announced [20]. Another way to sidestep the situation is to agree on a reasonable definition of GNNs working on infinite graphs. This is an interesting line of research and promising work already exists for graphons [21]. Of course, the requirement that the recurrent GNN node classifier is expressible in MSO becomes stronger and possibly unnatural in this manner, since MSO cannot express finiteness. The general case where graphs are not necessarily strongly connected remains wide open.
This work was supported by the Bijzonder Onderzoeksfonds (BOF) of Hasselt University Grant No. BOF20ZAP02; by the Research Foundation Flanders (FWO) under research project Grant No. G019222N; and by the Flanders AI (FAIR) research program.
if \(V(X) \subseteq W(X)\) for all \(X\) then \(\llbracket \alpha \rrbracket^{G}_{V} \subseteq \llbracket \alpha \rrbracket^{G}_{W}\) for all formulae \(\alpha\).↩︎
Recall that \(H'(n)[r(\Diamond_{\ell}\, \psi)]\) stores whether \(n \in R'(\Diamond_{\ell}\, \psi)\) with \(R'\) the result assignment of \(\kappa'\).↩︎
Recall that in the proof sketch we have already argued that \(D= \emptyset\) is expressible as a boolean formula.↩︎