Separability of Reachability Sets of Vector Addition Systems

Given two families of sets F and G , the F -separability problem for G asks whether for two given sets U, V ∈ G there exists a set S ∈ F , such that U is included in S and V is disjoint with S . We consider two families of sets F : modular sets S ⊆ N d , deﬁned as unions of equivalence classes modulo some natural number n ∈ N , and unary sets, which extend modular sets by requiring equality below a threshold n , and equivalence modulo n above n . Our main result is decidability of modular and unary separability for the class G of reachability sets of Vector Addition Systems, Petri Nets, Vector Addition Systems with States, and for sections thereof.


Introduction
In this paper we mainly investigate separability problems for sets of vectors from N d .We say that a set U is separated from set V by a set S if U ⊆ S and V ∩ S = ∅.For two families of sets F and G, the F -separability problem for G asks for two given sets U, V ∈ G whether U is separated from V by some set from F .Concretely, we consider F to be modular sets or unary sets, and G to be reachability set of Vector Addition Systems, or generalizations thereof.
Motivation.The separability problem is a classical problem in theoretical computer science.It was investigated most extensively in the area of formal languages, for G being the family of all regular word languages.Since regular languages are effectively closed under complement, the F -separability problem is a generalization of the F -characterization problem, which asks whether a given language belongs to F .Indeed, L ∈ F if and only if L is separated from its complement by some language from F .Separability problems for regular languages attracted recently a lot of attention, which resulted in establishing the decidability of F -separability for the family F of separators being the piecewise testable languages [2,22] (recently generalized to finite ranked trees [5]), the locally and locally threshold testable languages [21], the languages definable in first order logic [24], and the languages of certain higher levels of the first order hierarchy [23], among others.
Separability of nonregular languages attracted little attention till now.The reasons for this are twofold.First, for regular languages one can use standard algebraic tools, like syntactic monoids, and indeed most of the results have been obtained with the help of such techniques.Second, some strong intractability results have been known already since 70's, when Szymanski and Williams proved that regular separability of context-free languages is undecidable [25].Later Hunt [10] generalized this result: he showed that F -separability of context-free languages is undecidable for every class F which is closed under finite boolean combinations and contains all languages of the form wΣ * for w ∈ Σ * .This is a very weak condition, so it seemed that nothing nontrivial can be done outside regular languages with respect to separability problems.Furthermore, Kopczyński has recently shown that regular separability is undecidable even for languages of visibly pushdown automata [12], thus strengthening the result by Szymanski and Williams.On the positive side, piecewise testable separability has been shown decidable for context-free languages, languages of Vector Addition Systems (VAS languages), and some other classes of languages [3].This inspired us to start a quest for decidable cases beyond regular languages.
To the best of our knowledge, beside [3], separability problems for VAS languages have not been investigated before.
Our contribution.In this paper, we make a substantial step towards solving regular separability of VAS languages.Instead of VAS languages themselves (i.e., subsets of Σ * ), in this paper we investigate their commutative closures, or, alternatively, subsets of N d represented as reachability sets of VASes, VASes with states, or Petri nets.A VAS reachability set is just the set of configurations of a VAS which can be reached from a specified initial configurations.Towards a unified treatment, instead of considering separately VASes, VASes with states, and Petri nets, we consider sections of VAS reachability sets (abbreviated as VAS sections below), which turn out to be expressive enough to represent sections of VASes with states and Petri nets, and thus being a convenient subsuming formalism.A section of a set of vectors X ⊆ N d is the set obtained by first fixing a value for certain coordinates, and then projecting the result to the remaining coordinates.For example, if X is the set of pairs {(x, y) ∈ N 2 | x divides y}, then the section of X obtained by fixing the first coordinate to 3 is the set {0, 3, 6, . . .}.It can be easily shown that VAS sections are strictly more general than VAS reachability sets themselves, and they are equiexpressive with sections of VASes with states and Petri nets.
We study the separability problem of VAS sections by simpler classes, namely, modular and unary sets.A set X ⊆ N d is modular if there exists a modulus n ∈ N s.t.X is closed under the congruence modulo n on every coordinate, and it is unary if there exists a threshold n ∈ N s.t. it is closed under the congruence modulo n above the threshold n on every coordinate.Clearly, VAS sections are more general than both unary and modular sets, and unary sets are more general than modular sets.Moreover, unary sets are tightly connected with commutative regular languages, in the sense that the Parikh image 3 of a commutative regular language is a unary set, and vice versa, the inverse Parikh image of a unary set is a commutative regular language.As our main result, we show that the modular and unary separability problems are decidable for VAS sections (and thus for sections of VASes with states and Petri nets).Both proofs use similar techniques, and invoke two semi-decision procedures: the first one (positive) enumerates witnesses of separability, and the second one (negative) enumerates witnesses of nonseparability.A separability witness is just a modular (or unary) set, and verifying that it is indeed a separator easily reduces to the VAS reachability problem.Thus, the hard part of the proof is to invent a finite and decidable witness of nonseparability, i.e., a finite object whose existence proves that none of infinitely many modular (resp.unary) sets is a separator.Our main technical observation is that two nonseparable VAS reachability sets always admit two linear subsets thereof that are already nonseparable.
From our result, thanks to the tight connection between unary sets and commutative regular languages mentioned above, we can immediately deduce decidability of regular separability for commutative closures of VAS languages, and commutative regular separability for VAS languages.This constitutes a first step towards determining the status of regular separability for languages of VASes.
Related research.Choffrut and Grigorieff have shown decidability of separability of rational relations by recognizable relations in Σ * × N d [1].Rational subsets of N d are precisely the semilinear sets, and recognizable (by morphism into a monoid) subsets of N d are precisely the unary sets.Thus, by ignoring the Σ * component, one obtains a very special case of our result, namely decidability of the unary separability problem for semilinear sets.Moreover, since modular sets are subsets of N d which are recognizable by a morphism into a monoid which happens to be a group, we also obtain a new result, namely, decidability of separability of rational subsets of N d by subsets of N d recognized by a group.
From a quite different angle, our research seems to be closely related to the VAS reachability problem.Leroux [15] has shown a highly nontrivial result: the reachability sets of two VASes are disjoint if, and only if, they can be separated by a semilinear set.In other words, semilinear separability for VAS reachability sets is equivalent to the VAS (non-)reachability problem.This connection suggests that modular and unary separability are interesting problems in themselves, enriching our understanding of VASes.Finally, we show that VAS reachability reduces to unary separability, thus the problem does not become easier by considering the simpler class of unary sets as opposed to semilinear sets.For modular separability we have a weaker complexity lower bound, i.e.ExpSpace-hardness, by a reduction from control state reachability for VASSes.

Preliminaries
Vectors.By N and Z we denote the set of natural and integer numbers, respectively.For a vector u = (u 1 , . . ., u d ) ∈ Z d and for a coordinate i ∈ {1, . . ., d}, we denote by u[i] its i-th component u i .The zero vector is denoted by 0. The order ≤ and the sum operation + naturally extend to vectors pointwise.Moreover, if n ∈ Z, then nu is the vector (nu 1 , . . ., nu d ).These operations extend to sets element-wise in the natural way: For two sets of vectors U, V ⊆ Z d we denote by U + V its Minkowski sum {u + v | u ∈ U, v ∈ V }.For a (possibly infinite) set of vectors S ⊆ Z d , let Lin(S) and Lin ≥0 (S) be the set of linear combinations and non-negative linear combinations of vectors from S, respectively, i.e., A set S ⊆ N d is linear if it is of the form S = {b} + Lin ≥0 (p 1 , . . ., p k ) for some base b ∈ N d and some periods p 1 , . . ., p k ∈ N d .A set is semilinear if it is a finite union of linear sets.Note that a modular set is also unary (since ∼ =n is finer than ≡ n ), and that unary set is in turn a semilinear set, which can be presented as a finite union of linear sets in which all the periods are parallel to the coordinate axes, i.e., they have exactly one non-zero entry.
Separability.For S, U, V ⊆ N d , we say that S separates U from V if U ⊆ S and V ∩ S = ∅.The set S is also called a separator of U, V .For a family F of sets, we say that U is F separable from V if U is separated from V by a set S ∈ F .In this paper, the set of separators F will be the modular sets and the unary ones.Since both classes are closed under complement, the notion of F separability is symmetric: Thus we use also a symmetric notation, in particular we say that U and V are F separable instead of saying that U is F separable from V .For two families of sets F and G, the F separability problem for G asks whether two given sets U, V ∈ G are F separable.In this paper we mainly consider two instances of F , namely modular sets and unary sets, and thus we speak of modular separability and unary separability problems, respectively.

Vector Addition Systems
such that for all i ∈ {0, . . ., n−1} we have v i +t i = v i+1 .The source of this partial run is the configuration v 0 and the target of this partial run is the configuration v n , we write source(ρ) = v 0 , target(ρ) = v n .The labeling of ρ is the sequence t 0 . . .t n−1 ∈ T * , we write label(ρ) = t 0 . . .t n−1 .For a sequence α ∈ T * and a partial run ρ such that label(ρ) = α, source(ρ) = u and target(ρ) = v we write u α −→ v to denote this unique partial run.A partial run ρ of (s, T ) with source(ρ) = s is called a run.The set of all runs of a VAS V is denoted as Runs(V ).The reachability set Reach(V ) of a VAS V is the set of targets of all its runs; the sets Reach(V ) we call VAS reachability sets in the sequel.The family of all VAS reachability sets we denote as Reach(VAS).

Vector Addition Systems with states
The family of all such reachability sets of all VASSes we denote as Reach(VASS).

Sections
VAS reachability sets are central for this paper.However, in order to make this family of sets more robust, we prefer to consider the slightly larger family of sections of VAS reachability sets.The intuition about a section is that we fix values on a subset of coordinates in vectors, and collect all the values that can occur on the other coordinates.For a vector u ∈ N d and a subset I ⊆ {1, . . ., d} of coordinates, by π I (u) ∈ N |I| we denote the I-projection of u, i.e., the vector obtained from u by removing coordinates not belonging to I. The projection extends element-wise to sets of vectors S ⊆ N d , denoted π I (S).For a set of vectors S ⊆ N d , a subset I ⊆ {1, . . ., d}, and a vector u ∈ N d−|I| , the section of S w.r.t.I and u is the set We denote by SecReach(VAS) the family of all sections of VAS reachability sets, which we abbreviate as VAS sections below.Similarly, the family of all sections of VASS-reachability sets we denote by SecReach(VASS).Note that in a special case of I = {1, . . ., d}, when u is necessarily the empty vector, sec I,u (S) = S. Thus Reach(VAS) is a subfamily of SecReach(VAS), and likewise for VASSes.We argue that VAS sections are a more robust class than VAS reachability sets.Indeed, as shown below VAS sections are closed under positive boolean combinations, which is not the case for VAS reachability sets.
Reachability sets of VASes are a strict subfamily of reachability sets of VASes with states, which in turn are a strict subfamily of sections of reachability sets of VASes.However, when sections of reachability set are compared, there is no difference between VASes and VASes with states, which motivates considering sections in this paper.These observations are summarized in the following propositions: Proof.In order to prove strictness of the first inclusion, consider the VASS V from Example 2. The reachability set Reach p (V ) is not semilinear; on the other hand the reachability sets of of 3-dimensional VASes are always semilinear [8].Now we turn to the second inclusion.It is folklore that for a d-dimensional VASS V with n states and m transitions one can construct a (d + n + m)dimensional VAS V ′ simulating V .Among the new coordinates, n correspond to states and m to transitions.For a transition t = (q, v, q ′ ) of V there are two transitions in V ′ : the first one subtracts 1 on the coordinate corresponding to state q and adds 1 on the coordinate corresponding to t; the second one subtracts 1 on the coordinate corresponding to t, adds 1 on the coordinate corresponding to q ′ , and adds v on the original d coordinates.Finally, if (q 0 , v 0 ) is the initial configuration of V , then the initial configuration of V ′ is a copy of v 0 on the original d dimensions, equals 1 on the coordinate corresponding to q 0 , and equals 0 on the rest of the new coordinates.Then the reachability set Reach q (V ) equals the section of Reach(V ′ ) obtained by fixing the coordinate corresponding to q to 1 and all other new coordinates to 0.
For strictness of the second inclusion, apply the above-mentioned transformation to the VASS V from Example 2, in order to obtain a 9-dimensional VAS V ′ .The section of Reach(V ′ ) that fixes the second original coordinate to 0, the coordinate corresponding to state p to 1, and all the other new coordinates to . This 2-dimensional set is not semilinear, while reachability sets of 2-dimensional VASSes are always semilinear [8].Thus S is not a 2-dimensional VAS reachability set.Proof.One inclusion is obvious, since VASSes are more general than VASes, and the same holds when taking sections.For the other directions, consider a VASS V and a section thereof S := sec I,v (Reach q (V )).Reconsider the folklore construction of a VAS V ′ that simulates V (cf. the proof of the previous Proposition 5).The section of the reachability set of Reach(V ′ ) that fixes the coordinate corresponding to q to 1, all the other new coordinates to 0, and all the original coordinates not belonging to the set I as in vector v, equals S. ⊓ ⊔ Remark 6.In the similar vein one shows that reachability sets of Petri nets include Reach(VAS) and are included in Reach(VASS).Therefore, as long as sections are considered, there is no difference between VASes, Petri nets, and VASSes.In consequence, our results apply not only to VASes, but to all the three models.
We conclude this section by proving a closure property of VAS sections.

Proposition 7. The family of VAS sections is closed under positive boolean combinations.
Proof.We only sketch the proof.For closure under union, we just use nondeterminism to guess which VAS to run.Dealing with sections is straightforward since 1) we can assume w.l.o.g. that sections are done w.r.t. the 0 vector, 2) by padding coordinates we can assume that the two input VASes have the same dimension, and 3) by reordering coordinates we can guarantee that the coordinates that are projected away appear all together on the right (the same simplifying assumptions will be made in Sections 6 and 7; cf. the details just before Lemma 27).For closure under intersection, we proceed under similar assumptions, and the intuition is to run the first VAS forward in two identical copies, and then to run backward the second VAS only in the second copy, using a section to make sure that the second VAS is accepting, and then project away the second copy.

Results
As our main technical contribution, we prove decidability of the modular and unary separability problems for the class of sections of VAS reachability sets.
Theorem 8.The modular separability problem for VAS sections is decidable.
Theorem 9.The unary separability problem for VAS sections is decidable.
The proofs are postponed to Sections 5-7.Furthermore, as a corollary of Theorem 9 we derive decidability of two commutative variants of the regular separability of VAS languages (formulated in Theorems 10 and 11 below).
To consider languages instead of reachability sets, we need to assume that transitions of a VAS are labeled by elements of an alphabet Σ, and thus every run is labeled by a word over Σ obtained by concatenating labels of consecutive transitions of a run.We allow for silent transitions labeled by ε, i.e., transitions that do not contribute to the labeling of a run.The language L(V ) of a VAS V contains labels of those runs of V that end in an accepting configuration.Our results work for several variants of acceptance; for instance, for a given fixed configuration v 0 , -we may consider a configuration v accepting if v ≥ v 0 (this choice yields so called coverability languages); or we may consider a configuration v accepting if v = v 0 (this choice yields reachability languages).
The Parikh image of a word w ∈ Σ * , for a fixed total ordering a 1 < . . .< a d of Σ, is a vector in N d whose ith coordinate stores the number of occurrences of a i in w.We lift the operation element-wise to languages, thus the Parikh image of a language L, denoted pi(L), is a subset of N d .Two words w, v over Σ are commutative equivalent if their Parikh images are equal.The commutative closure of a language L ⊆ Σ * , denoted cc(L), is the language containing all words w ∈ Σ * commutative equivalent to some word v ∈ L. A language L is commutative if it is invariant under commutative equivalence, i.e., L = cc(L).Unary sets of vectors are exactly the Parikh images of commutative regular languages; reciprocally, commutative regular languages are exactly the inverse Parikh images of unary sets.Note that a commutative language is uniquely determined by its Parikh image.
As a corollary of Theorem 9 we deduce decidability of the following two commutative variants of the regular separability of VAS languages: commutative regular separability of VAS languages: given two VASes V, V ′ , decide whether there is a commutative regular language R that includes L(V ) and is disjoint from L(V ′ ); -regular separability for commutative closures of VAS languages: given two VASes V, V ′ , decide whether there is a regular language R that includes cc(L(V )) and is disjoint from cc(L(V ′ )).
Theorem 10.Commutative regular separability is decidable for VAS languages.
Indeed, given two VASes V, W one easy constructs another two VASes V ′ , W ′ s.t.pi(L(V )) is a section of Reach(V ′ ), and similarly for W ′ .By the tight correspondence between commutative regular languages and unary sets, we observe that L(V ) and L(W ) are separated by a commutative regular language if, and only if, their Parikh images pi(L(V )) and pi(L(W )) are separated by a unary set, which is is decidable by Theorem 9.
Theorem 11.Regular separability is decidable for commutative closures of VAS languages.
Similarly as above, we reduce to unary separability of VAS reachability sets (which is decidable once again by Theorem 9), which is immediate once one proves the following crucial observation.
Lemma 12. Two commutative languages L, K ⊆ Σ * are regular separable if, and only if, their Parikh images are unary separable.
Proof.We start with the "if" direction.Let pi(K) and pi(L) be separable by some unary set It is easy to see that S is (commutative) regular since U is unary, and that S separates K and L. Now we turn to the "only if" direction.Let K and L be separable by a regular language S, say K ⊆ S and S ∩ L = ∅.Let M be the syntactic monoid of S and ω be its idempotent power, i.e., a number such that for every m ∈ M it holds m ω = m 2ω .In particular, for every word u ∈ Σ * we have in other words, one can substitute v ω by v 2ω and vice versa in every context.Let For every u, v ∈ N d such that u ∼ =ω v, by repetitive application of (1) we get w u ∈ S iff w v ∈ S. As K is commutative and K ⊆ S, we have w u ∈ S for all u ∈ pi(K); similarly, we have w v ∈ S for all v ∈ pi(L).Therefore for all u ∈ pi(K), v ∈ pi(L) x ∼ =ω y}.The set U separates pi(K) and pi(L) and, being a union of ∼ =ω equivalence classes, it is unary.

Modular and unary separability of linear sets
The rest of the paper is devoted to the proofs of Theorems 8 and 9.In this section we prove that modular separability of linear sets is decidable 4 , and provide a condition on linear sets that makes modular separability equivalent to unary separability.The two results, stated in Lemmas 16 and 19 below, respectively, are used in Sections 6 and 7, where the proofs of Theorems 8 and 9 are completed.
Linear combinations modulo n.We start with some preliminary results from linear algebra.For n ∈ N, let Lin ≥0 n (v 1 , . . ., v k ) be the closure of Lin ≥0 (v 1 , . . ., v k ) modulo n, i.e., Similarly one defines Lin n (v 1 , . . ., v k ) be the closure of Lin(v 1 , . . ., v k ) modulo n.Observe however that Lin Proof.The left-to-right inclusion is immediate: for any n ∈ N we have For the right-to-left inclusion we take an algebraic perspective, and treat S := Lin(v 1 , . . ., v k ) as a subgroup of Z d generated by F = {v 1 , . . ., v k }.Let I be the set of all d unit vectors in Z d .For every n ∈ N ≥0 , let nZ d denote the subgroup of Z d generated by nI, and let S n be the subgroup of Z d generated by F ∪ (nI).In algebraic terms, our obligation is to show that ( Let G := Z d /S be the quotient group and consider the quotient group homomorphism h : Z d → G.It is legal, as every subgroup of an abelian group is normal, thus we can consider a quotient with respect to it.We have thus ker which will immediately follow, once we manage to show Observe that h(S n ) = h(nZ d ), for every n ∈ N ≥0 , and hence we may equally well demonstrate: The group G, being a finitely generated abelian group, is isomorphic to the direct product of a finite group G 1 (let l be its order, i.e., the number of its elements) and G 2 = Z k , for some k ∈ N (see for instance Theorem 2.2, p. 76, in [9]).For showing (3), consider an element g ∈ G which belongs to h(nZ d ) for all n ∈ N ≥0 , and its two projections g 1 and g 2 in G 1 and G 2 , respectively.As g ∈ h(lZ d ), then necessarily g 1 = l • g ′ for some g ′ ∈ G 1 , and since the order of every element divides the order of the group l, we have g 1 = 0 G1 .Similarly, we deduce that g 2 = 0 G2 ; indeed, this is implied by the fact that for every n ∈ N ≥0 , g 2 = ng ′ for some g ′ ∈ G 2 .Thus g = 0 G as required.⊓ ⊔ Modular separability.In the rest of the paper, we heavily rely on the following straightforward characterization of modular separability: For the "only if" direction, assume that L and M as above are not modular separable.By Proposition 14, for every n ≥ 0 there exist vectors u n ∈ L and Since n was arbitrary, by Lemma 13 we have b − c ∈ Lin(P ∪ Q), as required.

⊓ ⊔
Since the condition in the lemma above is effectively testable being an instance of solvability of systems of linear Diophantine equations, we get the following corollary: Corollary 16.Modular separability of linear sets is decidable.
Remark 17.Since linear Diophantine equations are solvable in polynomial time, we obtain the same complexity for modular separability of linear sets.This observation however will not be useful in the sequel.
Unary separability.We start with a characterization of unary separability, which is the same as Proposition 14, with unary equivalence ∼ =n in place of modular equivalence ≡ n .(Recall that unary equivalence is modular equivalence "above a threshold", i.e., u ∼ =n v holds for two vectors u, v ∈ N d if, for every component Proposition 18.Two sets U, V ⊆ N d are unary separable if, and only if, there exists n ∈ N such that, for all u ∈ U and v ∈ V , we have u ∼ =n v. We say that a set of vectors U ⊆ N d is diagonal if, for every threshold x ∈ N, there exists a vector u ∈ U which is strictly larger than x in every component.Let I ⊆ {1, . . ., d} be a set of coordinates.Two set of vectors U, V ⊆ N d are I-linked if there exists a sectioning vector u ∈ N d−|I| s.t.π {1,...,d}\I (U ) = π {1,...,d}\I (V ) = {u} and π I (U ), π I (V ) are diagonal.The sets U, V are linked if they are I-linked for some I ⊆ {1, . . ., d}.
Lemma 19.Let U, V ⊆ N d be two linked linear sets.Then, U and V are unary separable if, and only if, they are modular separable.
Proof.Let U and V be two linked linear sets.One direction is obvious since modular separability implies unary separability.For the other direction, let U and V be modular nonseparable, and we show that they are unary nonseparable either.By Lemma 14, there exists a sequence of vectors u n ∈ U and n , which will then show that U and V are not unary separable by Lemma 18.Since U and V are linked, there exist a set of coordinates I ⊆ {1, . . ., d} and a sectioning vector for the remaining coordinates u ∈ N d−|I| s.t. 1) π {1,...,d}\I (U ) = π {1,...,d}\I (V ) = {u} and 2) π I (U ), π I (V ) are diagonal.In particular, by 1) the two sequences u n and v n project to u on the complement of I, i.e., π {1,...,d}\I (u n ) = π {1,...,d}\I (v n ) = {u}.Moreover, for any n ∈ N, since π I (u n ) ∈ π I (U ), and the latter set is diagonal by 2), there exists an increment Moreover, since U is a linear set, δ n can be chosen to have its components multiple of n.Let u ′ n be π I (u n ) + δ n on coordinates I, and u on the remaining ones.By the choice of δ n , u ′ n ≡ n u n , and, moreover, u ′ n is larger than n on coordinates I.The vector v ′ n can be constructed similarly from v n .We thus have u ′ n ∼ =n v ′ n , since on coordinates I both u ′ n and v ′ n are above n, and on the remaining coordinates they are equal to u.
⊓ ⊔ Remark 20.The unary separability problem is decidable for linear sets, as shown in [1], but we will not need this fact in the sequel.Moreover, it will follow from our stronger decidability result about the more general VAS reachability sets stated in Theorem 9 (since linear sets are included in VAS reachability sets).

Modular separability of VAS sections
In this section we prove Theorem 8, and thus provide an algorithm to decide modular separability for VAS reachability sets.Given two VAS sections U and V , the algorithm runs in parallel two semi-decision procedures: one (positive) which looks for a witness of separability, and another one (negative) which looks for a witness of nonseparability.Directly from the characterization of Proposition 14, the positive semi-decision procedure simply enumerates all candidate moduli n ∈ N and checks whether u ≡ n v for all u ∈ U and v ∈ V .The latter condition can be decided by reduction to the VAS (non)reachability problem [20,17].
Lemma 21. two VAS sections U and V and a modulus n ∈ N, it is decidable whether there exist u ∈ U and v ∈ V s.t.u ≡ n v.
Proof.Recall that U is obtained from the reachability set of a VAS by fixing values ū on some coordinates, and projecting to the remaining coordinates; and likewise V is obtained, by fixing values v on some coordinates.We modify the two VASes by allowing each non-fixed coordinate to be decremented by n, and we check whether the two thus modified VASes admit a pair of reachable vectors u, v that agree on fixed coordinates with ū and v, respectively, and on all the non-fixed coordinates are equal and smaller than n.

⊓ ⊔
It remains to design the negative semi-decision procedure, which is the nontrivial part.In Lemma 27, we show that if two VAS reachability sets are not modular separable, then in fact they already contain two linear subsets which are not modular separable.In order to construct such linear witnesses of nonseparablity, we use the theory of well quasi orders and some elementary results in algebra, which we present next.
The order on runs.A quasi order (X, ) is a well quasi order (wqo) if for every infinite sequence x 0 , x 1 , . . .∈ X there exist indices i, j ∈ N, i < j, such that x i x j .It is folklore that if (X, ) is a wqo, then in every infinite sequence x 0 , x 1 , . . .∈ X there even exists an infinite monotonically non-decreasing subsequence x i1 x i2 . ... We will use Dickson's and Higman's Lemmas to define new wqo's on pairs and sequences.For two quasi orders (X, ≤ X ) and (Y, ≤ Y ), let the product (X × Y, ≤ X×Y ) be ordered componentwise by (x, y) ≤ X×Y (x ′ , y ′ ) if x ≤ X x ′ and y ≤ Y y ′ .By Dickson's Lemma [4], if both (X, ≤ X ) and (Y, ≤ Y ) are wqos, then (X × Y, ≤ X×Y ) is a wqo too.As a corollary of Dickson's Lemma, if two quasi orders (X, ≤ 1 ) and (X, ≤ 2 ) on the same domain are wqos, then the quasi order defined as the conjunction of ≤ 1 and ≤ 2 is a wqo too.For a quasi order (X, ≤), let (X * , ≤ * ) be quasi ordered by the subsequence order ≤ * , defined as . .y m if there exist 1 ≤ i 1 < . . .< i k ≤ m such that x j ≤ y ij for all j ∈ {1, . . ., k}.By Higman's Lemma [7], if (X, ≤) is a wqo then (X * , ≤ * ) is a wqo too.
By considering the finite set of transitions T well quasi ordered by equality, we define the order ≤ 1 on triples which is a wqo by Dickson's Lemma.We further extend ≤ 1 to an order on runs by defining, for two runs ρ and σ in ( * σ and target(ρ) ≤ target(σ). 5Here, ≤ 1 * is the extension of ≤ 1 to sequences, and thus a wqo by Higman's Lemma, which implies that is itself a wqo by the corollary of Dickson's Lemma.

Proposition 22.
is a well quasi order.
Proof.The proof is almost identical to the proof of Proposition 5.1.in [18].Let the VAS be (s, T ), and where for all i ∈ {1, 2} and j ∈ {0, . . ., n} we have δ i j ≥ 0. Thus by letting ρ This finishes the proof of Lemma 23.
We conclude this part by showing that any (possibly infinite) subset of Z d can be overapproximated by taking linear combinations of a finite subset thereof.This will be important below in order to construct linear sets as witnesses of nonseparability.
Proof.Treat Z d as a freely finitely generated abelian group, and consider the subgroup Lin(S) of Z d generated by S, i.e., the subgroup containing all linear combinations of finitely many elements of S. We use the following result in algebra: every subgroup of a finitely generated abelian group is finitely generated (see for instance Corollary 1.7, p. 74, in [9]).By this result applied to Lin(S) we get a finite set of generators F ⊆ Lin(S) s.t.Lin(F ) = Lin(S).Every element of F is a linear combination of finitely many elements of S. Thus let v 1 , . . ., v k be all the elements of S appearing as a linear combination of some element from F .Then clearly F ⊆ Lin(v 1 , . . ., v k ), and thus S ⊆ Lin(S) = Lin(F ) ⊆ Lin(Lin(v 1 , . . ., v k )) = Lin(v 1 , . . ., v k ), as required.
⊓ ⊔ Remark 26.In fact one can show that the generating set F has at most d elements.However, no upper bound on k follows, and even for d = 1 the number of vectors k can be arbitrarily large.Indeed, let p 1 , . . ., p k be different prime numbers, let u i = (p 1 •. ..•p k )/p i and S = {u 1 , . . ., u k }.Then for every i ∈ {1, . . ., k}, the number u i is not a linear combination of numbers u j , j = i, as u i is not divisible by p i , while all the others are.Therefore we need all the elements of S in the set {v 1 , . . ., v k }.
Using the characterization of Lemma 27, the negative semi-decision procedure enumerates all pairs L, M , where L is a U -witness and M is a V -witness and checks whether L and M are modular separable, which is decidable due to Lemma 15.Note that enumerating U -witnesses (and V -witnesses) amounts of enumerating finite sets of runs {ρ, ρ 1 , . . ., ρ k } satisfying (4).
Remark 29.It is also possible to design another negative semi-decision procedure using Lemma 27.This one enumerates all linear sets L and M (not necessarily only those in the special form of U -or V -witnesses) and checks whether they are modular separable and included in U and V , respectively.While this procedure is conceptually simpler than the one we presented, we now need the two extra inclusion checks L ⊆ U and M ⊆ V .Indeed, U -and V -witnesses were designed in such a way that the two inclusions above hold by construction and do not have to be checked.The problem whether a given linear set is included in a given VAS reachability is decidable [14], however we chose to present the previous semi-decision procedure in order to be self contained.

Unary separability of VAS sections
We now embark on the proof of Theorem 9.It goes along the lines of the proof of Theorem 8, but with some details more complicated, thus we only concentrate on explaining the necessary adjustments.As before, the positive semi-decision procedure enumerates all n ∈ N and checks whether the ∼ =n-closures of the two reachability sets are disjoint, which is effective thanks to the following fact: Lemma 30.two VAS sections U and V and n ∈ N, it is decidable whether there exist u ∈ U and v ∈ V such that u ∼ =n v.
This can be proved in a way similar to Lemma 21, with the adjustment that we allow on every coordinate a decrement by n only if the value is above 2n.
The negative semi-decision procedure enumerates nonseparability witnesses, along the same lines as in the case of modular separability.The following crucial lemma is an exact copy of Lemma 27, except that "modular" is replaced by "unary": Lemma 31.two VAS sections U, V ⊆ N d , the following conditions are equivalent: to unary separability of VAS reachability sets, and to regular separability of commutative closures of VAS languages.Indeed, for unary separability, it suffices to notice that a configuration u cannot reach a configuration v if, and only if, the set reachable from u can be unary separated from the singleton set {v}, also a VAS reachability set.When the separator exists, it can be taken to be the complement of {v} itself, which is unary.
While the problem of modular separability is ExpSpace-hard, we do not know whether it is as hard as the VAS reachability problem.The hardness can be shown by reduction from the control state reachability problem in VASSes, which is ExpSpace-hard [19].For a VASS V and a target control state q thereof, we construct two new VASSes V 0 and V 1 , which are copies of V with one additional coordinate, which at the beginning is zero for V 0 and one for V 1 .We also add one new transition from control state q, which allows V 1 to decrease the additional coordinate by one.One can easily verify that the two VASS reachability sets definable by V 0 and V 1 are modular separable if, and only if, the control state q is not reachable in V , which finishes the proof of ExpSpace-hardness.
The unarity and modularity characterization problems.Closely related problems to separability are the modularity and unarity characterization problems: is a given section of a VAS reachability set modular, resp., unary?We focus here on the unarity problem, but the other one can be dealt in the same way.Decidability of the unarity problem would follow immediately from Theorem 9, if sections of VAS reachability sets were (effectively) closed under complement.This is however not the case.Indeed, if the complement of a VAS reachability set is a section of another VAS reachability set, then both sets are necessarily a section of a Presburger invariant [15], hence semilinear.But we know that VAS reachability sets can be non-semilinear, and thus they are not closed under complement.However, the unarity problem can be shown to be decidable directly, at least for VAS reachability sets, by using the following two facts: first, it is decidable if a given VAS reachability set U is semilinear (see the unpublished works [6,13]); second, when a VAS reachability set is semilinar, a concrete representation thereof as a semilinear set is effectively computable [16].Indeed, if a given U is not semilinear, it is not unary either; otherwise, compute a semilinear representation, and check if it is unary.The latter can be checked directly, or can be reduced to unary separability of semilinear sets (since semilinear sets are closed under complement, as discussed above).

Proposition 14 .Lemma 15 .
Two sets U, V ⊆ N d are modular separable if, and only if, there exists n ∈ N such that for all u ∈ U , v ∈ V we have u ≡ n v.Proof.If U, V are separable by some n-modular set, then for all u ∈ U, v ∈ V we have u ≡ n v. On the other hand, if for all u ∈ U, v ∈ V we have u ≡ n v, then the modular set S = {s ∈ N d | ∃ u∈U s ≡ n u} separates U and V .⊓⊔ Two linear sets {b} + Lin ≥0 (P ) and {c} + Lin ≥0 (Q) are not modular separable if, and only if, b − c ∈ Lin(P ∪ Q).Proof.Let L = {b}+Lin ≥0 (P ) and M = {c}+Lin ≥0 (Q), with P = {p 1 , . . ., p m } and Q = {q 1 , . . ., q n }.First we show the "if" direction.By Proposition 14, it is enough to show that, for every n ∈ N, there exist two vectors u ∈ L and v ∈ M s.t.u ≡ n v. Fix an n ∈ N. By assumption, we have b − c ∈ Lin(P ∪ Q), and thus c − b ∈ Lin(P ∪ Q) = Lin(P ∪ −Q).By Lemma 13, c − b ∈ Lin ≥0 n (P ∪ −Q), i.e., there exist δ ∈ Lin ≥0 (P ) and γ ∈ Lin ≥0 (Q) such that c − b ≡ n δ − γ.Thus, if we take u = b + δ and v = c + γ we clearly have u − v = (b − c) + (δ − γ) ≡ n (b − c) + (c − b) = 0, and thus u ≡ n v.