arXiv:2610.23495cs.FLOct 2026

Manuscript Offprint

arXiv:2610.23495

Symmetric two-counter machines

Krzysztof Jaros, Łukasz Kamiński, Maja Kądziołka, Sławomir Lasota

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

Abstract

Counter machines are a particularly simple, Turing-complete model of computation. We study the expressive power of nondeterministic 2-counter machines which are symmetric, in that their set of update transitions is invariant under swapping of counters. Our model is an extension of symmetric 2-VASS, in that we allow modifying both counters within a single transition. As the main result we demonstrate a dramatic impact of symmetry: we show that symmetric 2-counter machines are not Turing-complete, by proving decidability of their reachability problem. We conjecture that the decidability extends to machines with 3 or more counters that are symmetric, meaning the set of update transitions is invariant under any permutation of counters. We leave this problem open for machines with 3 and more counters, while identifying a frontier of the impact of symmetry: we prove undecidability for 3-counter machines invariant under the cyclic permutation group of order 3.

2012 ACM Subject Classification Theory of computation → Computability

Keywords and phrases Counter machines, vector addition systems, halting problem, reachability problem

Funding Krzysztof Jaros: Supported by the NCN grant 2024/55/B/ST6/01674.

Łukasz Kamiński: Supported by the NCN grant 2024/55/B/ST6/01674.

Maja Kdzioka: Supported by the NCN grant 2024/55/B/ST6/01674.

Ślawomir Lasota: Partially supported by ERC grant INFSYS, agreement no. 950398, and by the NCN grant 2024/55/B/ST6/01674.

Acknowledgements We thank Roland Guttenberg and Vaios Michalakis for insightful discussions on the topic of this research, as well as Samira Bertsch and Violet Promeuschel for their helpful remarks which helped shape the exposition in this paper.

Disclosure. Large language models have been used to assist with proofreading and checking the correctness of the text. The authors remain fully responsible for the content of the paper, and are confident that its quality was not negatively impacted by the inherent shortcomings of the technology.

Symmetric two-counter machines

1 Introduction

Counter machines (CMs) are a particularly simple model of computation [23]. A counter machine has a number of registers, called counters, each register storing a natural number. Although the instruction set may vary, a common one consists of: counter increment, counter decrement, and counter zero-test. Many variants of the model have been introduced and studied, and both deterministic and nondeterministic machines are widely studied in the literature (often under different names, for instance counter automata). Numerous syntactic restrictions of the model are also widely studied [12, 14, 13, 10] since, as shown already by Minsky in the early 1960s [22], in its full generality the model is Turing-complete: deterministic 2-counter machines can faithfully simulate Turing machines and have an undecidable halting problem.

The purpose of this paper is to understand the impact of symmetry on the expressive power of CMSs. We investigate the nondeterministic model, where a machine may choose between different instructions executable in the same state.

Symmetric counter machines. Imposing a symmetry condition on the transitions of a counter machine is inherently sensitive to what can be expressed within a single instruction. As such, we specifically choose the set of machine instructions: counter updates that simultaneously modify all counters by corresponding deltas, and counter zero-tests, which are executable only if a given counter has value zero. Every transition (q,i,q′)(q, i, q') of a machine changes its state from qq to q′q', and executes an attached instruction ii. Executing a transition in a given configuration constitutes a step of a machine. The model we investigate is thus essentially VASS (vector addition systems with states) [13] extended with zero-tests, and is clearly equivalent to standard CMSs. In this paper we mostly focus on CMSs that are symmetric, by which we mean that the set of update transitions is invariant under all permutations σ\sigma of counters: for every update transition (q,i,q′)(q, i, q'), the machine has also a transition (q,σ(i),q′)(q, \sigma(i), q'), where σ\sigma acts on an update instruction ii by permuting the roles of the counters (see Figure 1 for an example). To stress this point, we choose to impose the invariance only on update transitions, but not on zero-test transitions — imposing the invariance (symmetry) also on zero-tests is not needed for our main decidability proof.

Figure

Figure 1 An example symmetric 2-counter machine with two control states and six transitions, including five symmetric update transitions (invariant under the swap of counters) and one zero-test transition. Due to the symmetry condition, e.g. the (p,update(−1,3),p)(p, \text{update}(-1,3), p) transition also forces (p,update(3,−1),p)(p, \text{update}(3,-1), p) to exist. In contrast, we permit zero-test(1) without a corresponding zero-test(2) transition. Also notice the update(1,1)\text{update}(1,1) transition, which is self-symmetric.

Contribution. The initial motivation of this study is the immense impact of symmetry on the complexity of the VASS reachability problem: while the problem is ACKERMANN-complete in general [20, 5, 19], the complexity drops to only PSPACE-complete for symmetric VASS [15]. As our main result, we confirm the immense drop in case of 2-CMs (in this case, symmetry amounts to invariance under all swaps of counters). We prove decidability of the configuration-to-configuration reachability problem, where one asks if a given machine has a sequence of steps starting in a given source configuration and ending in a given target one:

▶ Theorem 1. The reachability problem is decidable for symmetric 2-counter machines.

Symmetric two-counter machines are thus not Turing-complete. We find this result quite surprising, as it applies to a model with restricted update instructions but unrestricted zero-test instructions. Interestingly, the converse restriction, namely imposing symmetry on zero-test transitions but not on update transitions, remains undecidable.

It is natural to consider invariance under subgroups of permutations: for every subgroup G≤SdG \leq S_d one can consider the class of G-counter machines (G-CMs), namely d-counter machines invariant under all permutations from G. On one end, when G=SdG = S_d, the general definition instantiates to symmetric d-CMs. On the opposite end, when G is the trivial group one gets classical counter machines. Between the two extremes there is a landscape of models, whose expressive power is related according to the permutation subgroup relation: whenever G≤HG \leq H, every H-CM is automatically a G-CM. For instance, every S3S_3-CM is automatically a Z3Z_3-CM, for the cyclic permutation group Z3≤S3Z_3 \leq S_3. As an additional result, we identify a bound on the impact of symmetry, already for 3-counter machines, namely we prove undecidability for Z3Z_3-counter machines (even under an additional assumption that zero-tests are symmetric):

▶ Theorem 2. The reachability problem is undecidable for ZdZ_d-counter machines, for all d≥3d \geq 3.

Both the above results hold in the hardest case: decidability with unrestricted zero-tests, and undecidability with symmetric ones. This is unsurprising, as in Section 8 we show that assuming symmetry of zero-tests does not weaken the model.

Open questions. A fundamental question is whether Theorem 1 extends to larger numbers of counters. In particular, is the reachability problem still decidable for symmetric 3-counter machines, whose update transitions are invariant under all 6 permutations of the 3 counters? Our decidability proof does not extend to 3 counters, as the argument relies on a number of low-dimensional properties of reachable sets and reachability relations. We thus leave this intriguing question for further research, conjecturing decidability for any number of counters:

▶ Conjecture 3. The reachability problem is decidable for symmetric counter machines.

We focus on decidability, thus leaving open the exact complexity of the problem for symmetric 2-CMs. While we obtain an elementary upper bound for our decision procedure, the only lower bound is PSPACE-hardness inherited from symmetric 2-VASS [15]. It is possible that the reachability problem is PSPACE-complete in symmetric d-CMs for every d≥2d \geq 2.

Symmetric CMS where the only update instructions are increments or decrements of a single counter, constitute a syntactic fragment of our setting. It remains to be established the expressive power of the fragment, and the complexity of its reachability problem.

Outline. Once we define the model in Section 2, the subsequent Sections 3–6 are devoted to the proof of Theorem 1. We proceed in a top-down manner, by consecutive reductions to more and more basic properties. In Section 3 we provide the proof of Theorem 1, building on effective semilinearity of certain reachability sets and relations in a symmetric 2-CM. Then, in Sections 4 and 5, we prove the effective semilinearity, building on the central property of target (resp. source) pumping in symmetric 2-VASS, that is subsequently shown in Section 6. Technically, Section 6 is probably the most intricate part of the paper, and the only one directly exploiting the symmetry of 2-CMs. In Section 7, we turn to the proof of Theorem 2,

Symmetric two-counter machines

followed by Section 8 where we discuss how syntactic restrictions of our model affect its expressive power. Finally, in Section 9, we provide an elementary upper bound on the complexity of our decision procedure for symmetric 2-CMs.

Related research. Identifying decidable restrictions of CMS is a very active line of research since the 1960s, for instance 1-counter, reversal-bounded, or restricted 2-counter machines [12, 14, 10]. A prominent example is CMS without zero-tests, that is vector addition systems with states (VASS), shown to have decidable reachability in the early 1980s [21, 17, 18]. The decidability extends to CMS with only one zero-tested counter [3], or with nested zero-tests [27, 11]. On the other hand, most natural restrictions preserve Turing-completeness, as long as no constraint is imposed on zero-tests. For instance, considering deterministic CMS, the reachability problem is still undecidable in the subclass of reversible CMS, where the step relation is reverse deterministic, and hence every step may be uniquely undone [24].

In the special case of 1 counter the symmetry requirement is void, and the reachability problem is NP-complete if transition updates are encoded in binary, and NL-complete in unary encoding [12]. The known complexity bounds separate symmetric 2-CMs from 1-CMs, the former being PSPACE-hard while the latter NP-complete, thus proving that symmetric 2-CMs are not (easily) simulated by 1-CMs.

Restricting the use of zero-tests in 2-CMs often leads not only to decidability, but even to PSPACE-completeness. Assuming binary encoding, the PSPACE-completeness has been obtained for 2-VASS [2, 1] (assuming unary encoding, we have NL-completeness [7]), but also for the further restriction to symmetric 2-VASS [15], and for a relaxation of 2-VASS to 2-CMs with just one zero-tested counter [9]. In all these cases the reachability relation is effectively semilinear, which is the key for obtaining a PSPACE upper bound, but which fails already for 3-VASS [13]. We do not know the exact complexity of symmetric 2-CMs. Neither do we know if the reachability relation of a symmetric 2-CM is semilinear, but we believe it is so.

Contrary to the above-mentioned restrictions of zero-tests, our model leaves the zero-tests unrestricted, which rarely results in a decidable model — the primary example being a result of Dudenhefner [6], showing that for certain choice of instruction set, the reversible 2-CMs become decidable, in contrast with [24].

References (22)