---
title: Non-Termination Witnesses
url: https://www.emergentmind.com/topics/non-termination-witnesses
type: topic
---

# Non-Termination Witnesses

Searching arXiv for recent and foundational papers on non-termination witnesses, recurrent sets, GNTA, dynamic and practical detection.
I’m retrieving arXiv records relevant to non-termination witnesses and related proof techniques.
Non-termination witnesses are constructive certificates that establish the existence of an infinite execution. In the literature they appear in multiple mathematically distinct but conceptually related forms: recurrence sets and closed recurrence sets for transition systems, geometric non-termination arguments for affine loops, lasso-shaped recurrent-state witnesses for bounded exploration, regular languages closed under rewriting for term rewriting systems, repulsing-supermartingale certificates for probabilistic programs, and invariant subspaces or fixpoint-game witnesses in quantum and lattice-theoretic settings [2509.06752]. For non-linear programs, dynamic analysis has been proposed to learn recurrent sets from executions and to integrate non-termination search with ranking-function synthesis, bringing static and dynamic reasoning closer together [2010.05747].

## 1. Formal meaning of a non-termination witness

At the most general level, a non-termination witness is an object that certifies the existence of an infinite computation in a transition system. A standard state-based formalization models a loop or program by a state space $X$, a set of initial states $I \subseteq X$, and a transition relation $T \subseteq X \times X$. In that setting, a set $R \subseteq X$ is a recurrent set if it is both reachable and self-perpetuating:
- Reachability: $I \cap \mathrm{Pre}^*(R) \neq \emptyset$.
- Recurrence/existence closure: $\forall x \in R.\ \exists x' \in X.\ T(x,x') \land x' \in R$.

If both conditions hold, there exists an infinite execution starting from some initial state that visits $R$ and never leaves it. A strengthened notion, often used for nondeterministic programs, is the closed recurrent set:
- $\forall x \in R.\ \forall x' \in X.\ T(x,x') \Rightarrow x' \in R$.

This implies forward invariance under the transition relation and eliminates nondeterministic escapes. In loop settings, one further requires that $R$ lie within the loop guard, typically by $\forall x \in R.\ G(x)$, so that control remains in the loop [2010.05747].

The survey on linear-constraint programs presents the same core idea in polyhedral form. For a transition relation $Q(x,x')$, a nonempty set $S$ is a recurrence set if
$$\forall x \in S\; \exists x' \in S:\; R(x,x').$$
A closed recurrence set strengthens this to
$$\exists x\; G(x)\quad\text{and}\quad \forall x\; [G(x) \Rightarrow B(x)]\quad\text{and}\quad \forall x,x'\; [G(x)\land Q(x,x') \Rightarrow G(x')],$$
where $B(x)$ denotes enabled states. The distinction is operationally significant: basic recurrence sets require an existential successor, whereas closed recurrence sets require all successors to remain in the witness region [2509.06752].

A different but equivalent witness shape is the lasso. In practical loop analysis, a lasso consists of a finite stem followed by a cycle that can be repeated indefinitely. EndWatch states this as a revisit condition at the same program location: if there exist $i<j$ such that $l_i=l_j \land s_i=s_j$, then under determinism the loop does not terminate. In the paper’s formulation, a lasso is non-terminating if there exist $s_0,s_1$ with $(s_0,s_1)=P_{\mathrm{stem}}$ and $(s_1,s_1)=P_{\mathrm{loop}}$; under determinism of $P_{\mathrm{loop}}$, $\{s_1\}$ is a reachable recurrent set [2312.03335]. This identifies a singleton recurrent set as a degenerate but highly practical witness.

## 2. Canonical witness forms for numerical programs

For linear-constraint programs, the survey identifies three central witness families: recurrence sets, closed recurrence sets, and geometric non-termination arguments [2509.06752]. Recurrence sets are the broadest state-space certificates; closed recurrence sets are their nondeterminism-robust specialization; geometric non-termination arguments provide a structured symbolic description of an infinite run for affine loops.

For affine single-path loops of the form $\text{while }(B x \le b)\ \text{do } x' = A x + c$, a geometric non-termination argument of size $k$ consists of data $(x_0,y_1,\ldots,y_k,\lambda_1,\ldots,\lambda_k,\mu_1,\ldots,\mu_k)$ satisfying a base transition and ray constraints:
$$A''\begin{pmatrix}x_0\\ x_0 + \sum_i y_i\end{pmatrix} \le c,$$
$$A''\begin{pmatrix}y_1\\ \lambda_1 y_1\end{pmatrix} \le 0,$$
$$A''\begin{pmatrix}y_i\\ \lambda_i y_i + \mu_{i-1} y_{i-1}\end{pmatrix} \le 0 \quad (1 < i \le k).$$
When such data exist, there is an infinite execution of the form
$$x_t = x_0 + \sum_{j=0}^{t-1} Y U^j \mathbf{1},\quad Y=[y_1\;\cdots\; y_k],$$
with $U$ upper-bidiagonal. The survey states that, for affine loops whose update matrix has only nonnegative real eigenvalues, non-termination implies existence of a geometric non-termination argument of size at most $n$ [2509.06752].

The lasso-program literature operationalizes two additional witness schemes. PaSTTeL implements direct fixpoint witnesses, defined by the existence of a loop state $x^*$ such that
$$\exists x^*. (B x^* \le b) \land (x^* = A x^* + a).$$
This yields a trivial infinite execution repeating $x^*$. PaSTTeL also implements geometric non-termination arguments, both in a one-dimensional form $(x,y,\lambda,\mu)$ satisfying
$$B x \le b,\quad B y \le 0,\quad A y = \lambda y,\ \lambda \ge 1,\quad A x + a = x + \mu y,\ \mu \ge 0,$$
and in a matrix form with $A Y = Y U$, $B x \le b$, $B Y \le 0$, and $A x + a = x + Y \alpha$ [2606.18977]. These witnesses are synthesized by SMT and returned as proof certificates.

A more global witness notion is the non-termination set of a loop. For a simple linear loop with update $x_{k+1}=A x_k+b$ and guard $Gx_k \ge 0$, the non-termination set is
$$\mathrm{NT} = \{ x_0 \in \mathbb{R}^n \mid \forall k \ge 0,\; G x_k \ge 0 \}.$$
Every $x_0 \in \mathrm{NT}$ witnesses an infinite execution. In the homogeneous two-variable case with a single guard, the set has a complete geometric characterization: it is either $\emptyset$, a ray from the origin, or a sector bounded by two rays [1206.0232]. That result is exact in dimension two, but it does not generalize algebraically: for $n \ge 3$, the paper shows that the non-termination set cannot be described by Tarski formulae in general [1206.0232].

## 3. Constructive witnesses beyond standard transition systems

In term rewriting, non-termination witnesses are not state sets but languages. The finite-automata approach constructs a non-empty regular language $L$ of ground terms such that
$$L \neq \emptyset,\quad R(L) \subseteq L,\quad L \cap \mathrm{NF}(R) = \emptyset.$$
Any such language is a witness for failure of weak normalization, because every term in $L$ rewrites to another term in $L$ and no term in $L$ is a normal form. The language is represented by a finite tree automaton, and the required properties are encoded as a SAT formula over transition variables and accepting-state variables [1505.00478]. This witness form is notable because it handles both looping and non-looping non-termination; it does not require an ultimately periodic reduction.

In Constraint Handling Rules, the witness can be an executable adversarial program fragment. A “devil’s rule” is automatically generated from a self-recursive simplification rule by overlapping the recursive body with a disjoint variant of the rule head. The resulting malicious rule reintroduces exactly the CHR constraints needed to trigger the recursion again. The paper proves a “maximally vicious” property: for any program containing the self-recursive rule and for any infinite computation through that rule, there is a corresponding infinite computation with the recursive rule and the devil’s rules alone. In that sense, the devil’s rules form a finite witness for non-termination [1701.02682].

Fixpoint-game witnesses provide another abstraction layer. In a complete lattice with a logic universe $L$, a behaviour universe $B$, and a Galois connection $(\alpha \dashv \gamma)$ satisfying $\alpha \circ \mathcal{L} = \mathcal{B} \circ \alpha$, the paper defines two witness types for least-fixpoint reasoning:
- a primal witness $\#a \in L$ such that $\#a \ll \mu \mathcal{L}$ and $b \ll \alpha(\#a)$;
- a dual witness $a \in L$ such that $a \ll \mu \mathcal{L}$ and $\alpha(a) \not\sqsubseteq b$.

The paper then emphasizes that non-termination arises by dualization as a greatest-fixpoint property, so witnesses can certify strict lower bounds on greatest fixpoints such as non-termination probabilities or the existence of infinite behaviour [2603.11908]. This shifts witness construction from concrete execution structure to order-theoretic proof objects.

## 4. Dynamic, testing-based, and bounded-model witnesses

Dynamic and testing-based work treats non-termination witnesses as concrete artifacts: inputs plus traces that exhibit cyclic behaviour. DynamiTe proposes to exploit dynamic analysis so that termination and non-termination, and static and dynamic strategies, can inform one another. According to the abstract, termination is handled by inferring ranking functions from concrete transitive closures, while non-termination is handled by iteratively collecting executions and dynamically learning conditions to refine recurrent sets [2010.05747]. The available technical material does not provide the paper’s full internal definitions, but it clearly places recurrent-set learning at the center of dynamic non-termination reasoning.

EndWatch turns revisit detection into a practical oracle for large programs. For linear loops, it symbolically infers State Revisit Conditions and instruments them at loop headers; for non-linear loops, it checks concrete state revisits during execution. A revisit is defined by the existence of $i<j$ with $l_i=l_j \land s_i=s_j$. The method is sound under explicit assumptions: the loop body’s transition relation is deterministic, no external nondeterminism affects loop variables in the revisit slice, and no hidden side-effects alter semantics across iterations without being captured in the sliced state [2312.03335]. Under those assumptions, a repeated state at the same location is a non-termination witness.

The same witness style is encoded statically in bounded model checking for C. Bounty instruments each loop with a recurrent-state assertion and uses two helper variables, `pStored` and `flag`, to store one loop-head state and later assert inequality against future loop-head states. Negating the assertion yields the lasso constraint
$$\exists\ 0 \le i < j \le k:\ H(i)\ \wedge\ H(j)\ \wedge\ x_i = x_j.$$
A counterexample to the assertion is therefore a concrete stem-plus-cycle witness. The paper stresses that the method is sound under CBMC’s bit-precise machine semantics and does not assume absence of overflows [2409.12985].

Portfolio systems use these witness schemes as interchangeable back ends. PaSTTeL runs registered non-termination strategies concurrently, notably fixpoint checking and GNTA synthesis, and returns as soon as one strategy produces a conclusive non-termination proof certificate [2606.18977]. A key practical point, emphasized both there and in testing-based work, is that failure to find a witness yields `UNKNOWN`, not a proof of termination [2606.18977].

## 5. Quantitative and probabilistic witness schemes

In probabilistic programs, non-termination witnesses often certify positive probability of divergence rather than existence of a single infinite path. The central objects in the stochastic-invariants framework are stochastic invariants and repulsing supermartingales. A stochastic invariant is a pair $(PI,p)$ such that, for all schedulers,
$$\mathbb{P}^\sigma(\mathrm{Fail}_{PI}) \le p,$$
where $\mathrm{Fail}_{PI}$ is the set of runs that ever violate the predicate map $PI$. A linear $\epsilon$-RepSM for a set $C$ is a linear expression map $\eta$ that is nonnegative on $C$, decreases in expectation by at least $\epsilon$ outside $C$, and has bounded differences [1611.01063].

These objects serve two witness roles. First, repulsing supermartingales give quantitative bounds on the probability of reaching an undesirable set. Second, they directly refute almost-sure termination. The paper proves: if there is a linear $\epsilon$-RepSM $\eta$ for $C$ supported by a pure invariant $I$, with bounded differences and $\eta(\ell_{\mathrm{in}},x_0)<0$, then for every scheduler $\sigma$,
$$\mathbb{P}^\sigma(T_C < \infty) < 1.$$
This makes the RepSM a witness for non-termination with positive probability. Under the same hypotheses with $\epsilon \ge 0$, the paper also proves $\mathbb{E}^\sigma[T_C] = \infty$ for all schedulers [1611.01063].

Greatest-fixpoint perspectives subsume these quantitative witnesses. The lattice/game paper explicitly treats non-termination as a greatest fixpoint $\nu N$, with the Markov-chain instance given by
- $N(n)(x)=0$ if $x \in T$,
- $N(n)(x)=\sum_y \delta(x)(y)n(y)$ otherwise,
so that $\mathrm{nonTerm}=\nu N$ and, equivalently, $\mathrm{nonTerm}(x)=1-\mathrm{term}(x)$ [2603.11908]. Witnesses in the logic universe then certify lower bounds on non-termination probabilities, or dually refute upper bounds on them.

Quantum programs require yet another quantitative generalization. For nondeterministic quantum programs, the paper defines the divergent set
$$D = \{ \rho \in D(H) \mid \exists s:\ \Pr_{\mathrm{term}}(\rho,s)=0 \},$$
together with pure divergent sets $PD^\varsigma$ that are spheres of linear subspaces. Termination of an input under all schedulers is characterized by a disjointness condition:
$$\mathcal{R}(\rho)\cap PD = \emptyset,$$
where $\mathcal{R}(\rho)$ is the reachable subspace. If the intersection is non-empty, the paper synthesizes a scheduler witnessing non-termination; for universal non-termination, it uses a nonzero invariant subspace obtained from a stationary equation $\bar{\Psi}(\gamma)=\gamma$ [2402.15827]. Here the witness is neither a numeric set nor a lasso, but an algebraic subspace of a Hilbert space.

## 6. Scope, limitations, and recurring misconceptions

A persistent misconception is that inability to synthesize a witness implies termination. The portfolio and dynamic literature explicitly rejects that implication: PaSTTeL returns `UNKNOWN` when neither fixpoint nor GNTA synthesis succeeds [2606.18977], and bounded or testing-based revisit methods are incomplete because the relevant cycle may lie beyond the explored bound or outside the observed traces [2409.12985]. This suggests that witness search is fundamentally semi-decisive: it is highly effective when a certificate exists in the chosen witness class, but silence is not a proof.

A second misconception is that non-termination witnesses are always algebraically simple. The exact opposite is documented for linear loops. In dimension two, the non-termination set of a simple homogeneous linear loop with one guard has an exact conic description [1206.0232]. For more than two variables, however, the same paper proves that the non-termination set is not semi-algebraic in general, which marks a sharp expressive boundary for exact witness synthesis [1206.0232].

A third misconception is that revisit-based witnesses are semantics-free. EndWatch states explicit assumptions under which state revisit implies non-termination, notably determinism of the loop body and absence of external nondeterminism in the revisit slice [2312.03335]. Bounty correspondingly grounds its soundness in bit-precise machine semantics rather than in idealized arithmetic [2409.12985]. These methods are practical precisely because they restrict the witness relation to a well-specified semantic model.

Across the literature, the main methodological divide is not between termination and non-termination, but between witness classes. Recurrence sets and closed recurrence sets are invariant-style certificates; geometric non-termination arguments are spectral certificates; revisit traces are concrete execution certificates; regular languages and devil’s rules are syntactic certificates; repulsing supermartingales and greatest-fixpoint witnesses are quantitative certificates; invariant subspaces are algebraic certificates. DynamiTe’s integrated perspective suggests that these forms need not be isolated: counterexamples from failed termination proofs can seed non-termination search, and failed non-termination validation can feed back into ranking-function inference [2010.05747].

The most stable conclusion across these works is therefore structural rather than algorithmic. Non-termination witnesses are not a single formalism but a family of certificates adapted to the semantics of the underlying system. What unifies them is the same proof obligation: to exhibit a reachable object that can perpetuate computation indefinitely, whether that object is a set, a cycle, a language, a martingale, a fixpoint witness, or an invariant subspace [2509.06752].

Source: https://www.emergentmind.com/topics/non-termination-witnesses