Balance Problems for Integer Circuits

We investigate the computational complexity of balance problems for {−, ·}-circuits computing finite sets of natural numbers. These problems naturally build on problems for integer expressions and integer circuits studied by Stockmeyer and Meyer (1973), McKenzie and Wagner (2007), and Glaßer et al. (2010). Our work shows that the balance problem for {−, ·}-circuits is undecidable which is the first natural problem for integer circuits or related constraint satisfaction problems that admits only one arithmetic operation and is proven to be undecidable. Starting from this result we precisely characterize the complexity of balance problems for proper subsets of {−, ·}. These problems turn out to be complete for one of the classes L, NL, and NP. 2012 ACM Subject Classification Theory of computation → Problems, reductions and completeness, Theory of computation → Computability


Introduction
In 1973, Stockmeyer and Meyer [18] defined and studied membership and equivalence problems for integer expressions.They considered expressions built up from single natural numbers by using set operations (∪, ∩, ), pairwise addition (+), and pairwise multiplication (•).For example, 1 • 1 ∩ 1 describes the set of primes P.
The membership problem for integer expressions asks whether some given number is contained in the set described by a given integer expression, whereas the equivalence problem for integer expressions asks whether two given integer expression describe the same set.Restricting the set of allowed operations results in problems of different complexities.
Wagner [20] studied a more succinct way to represent such expressions, namely circuits over sets of natural numbers, also called integer circuits.Each input gate of such a circuit is labeled with a natural number, the inner gates compute set operations and arithmetic operations (∪, ∩, , +, •).The following circuit with only 4 inner gates computes the set of primes.

5:2 Balance Problems for Integer Circuits
Sophie Germain primes can be constructed.McKenzie and Wagner [15] constructed a circuit C computing a set that contains 0 if and only if the Goldbach conjecture holds.
Wagner [20], Yang [21], and McKenzie and Wagner [15] investigated the complexity of membership problems for circuits over natural numbers: here, for a given circuit C, one has to decide whether a given number n belongs to the set described by C. Travers [19] and Breunig [2] considered membership problems for circuits over integers and positive integers, respectively.Glaßer et al. [9] studied equivalence problems for circuits over sets of natural numbers, i.e., the problem of deciding whether two given circuits compute the same set.
Satisfiability problems for circuits over sets of natural numbers, investigated by Glaßer et al. [11], are a generalization of the membership problems investigated by McKenzie and Wagner [15]: the circuits can have unassigned input gates and the question is: on input of a circuit C with gate labels from O ⊆ {∪, ∩, , +, •} and a natural number b, does there exist an assignment of the unassigned input gates with natural numbers such that b is contained in the set described by the circuit?
Barth et al. [1] investigated emptiness problems for integer circuits.Here, for both circuits with unassigned inputs and circuits without unassigned inputs, the question of whether an integer circuit computes the empty set (for some/all assignment(s) if the circuits allow unassigned inputs) is raised and investigated.
Apart from the mentioned research on circuit problems there has been work on related variants like functions computed by circuits [17] and constraint satisfaction problems (csp) over natural numbers [10,5].The constraint satisfaction problems by Glaßer, Jonsson, and Martin [10] can be considered as conjunctions of equations of integer expressions with variables standing for singleton sets of natural numbers.Here the question is whether there is an assignment of the variables such that all equations are satisfied.These constraint satisfaction problems have the peculiarity that expressions describe sets of integers whereas variables can only store singleton sets of natural numbers.Dose [5] addressed this and studied constraint satisfaction problems over finite subsets of N, consequently replaced the set complement with the set difference −, and allowed the variables to describe arbitrary finite subsets of N.

Our Model and Contributions
The definition of the circuits investigated in this paper follows the definition of previous papers such as [15,9,11,1].Yet there are some differences: Our circuit problems are about balanced sets where a finite and non-empty set S ⊆ That means, the maximum of a set marks the relevant area and then we ask whether there are as many elements inside the set as outside of it.As the notion of balanced sets only makes sense for finite sets, our circuits should solely compute finite sets.
Due to that we replace the commonly used set complement with the set difference −.Now, as the circuits only work over the domain of finite subsets of N, it suggests itself to also allow the input gates of a circuit to compute arbitrary finite subsets of N and not only singleton sets (cf.Dose [5] where the analogous step was made for constraint satisfaction problems).
For such circuits we ask: is there an assignment of the unassigned inputs with arbitrary finite subsets of N under which the circuit computes a balanced set?This problem is denoted by BC(O), where O ⊆ {∪, ∩, −, +, •} is the set of allowed operations.
The notion of balance is important in computational complexity.It occurs when considering counting classes [12] like C = L or C = P for instance.There, the question is whether for some problem A there is a non-deterministic logarithmic space or polynomial-time machine T. Dose

5:3
M accepting A, where M accepts some input x if and only if the number of accepting paths equals the number of rejecting paths.
Balance problems for integer circuits are interesting for another reason.To our knowledge, there is no natural decision problem for integer circuits or constraint satisfaction problems over sets of natural numbers that allows only one arithmetic operation and is known to be undecidable.In this paper, however, it is shown that BC(−, •) is undecidable.
Starting from this undecidable problem BC(−, •), we also investigate BC(O) for arbitrary proper subsets of {−, •} and precisely characterize the complexity of each such problem.It turns out that all these problems are in NP.In detail, we show that BC(•) is NL-complete, BC(−) is NP-complete, and BC(∅) ∈ L.

Basic Notions
Let N denote the set of natural numbers.N + = N − {0} is the set of positive naturals.Moreover, the set of primes is denoted by P.
We extend the arithmetical operations + and • to sets of naturals: for A, B ⊆ N define In contrast to previous papers, in this paper the multiplication of sets is not denoted by × but by •.Instead, × denotes the cartesian product.Furthermore, for arbitrary sets, the operations ∪, ∩, and − define the union, intersection, and set difference, respectively.The power set of a set M is denoted by P(M ) whereas P fin (M ) = {A ∈ P(M ) | A finite}.For a finite and non-empty set S let max(S) (resp., min(S)) denote the maximum (resp., minimum) number of S. L, NL, and NP denote standard complexity classes [16] and RE is the set of computably enumerable problems.
For problems A and B we say that A is (logarithmic-space) many-one reducible to B if there is some (logarithmic-space) computable function f with c A (x) = c B (f (x)), where c X for a set X is the characteristic function of X.We denote this by A ≤ m B (resp., A ≤ log m B).For pairs (A, B) and (C, D) with A ∩ B = C ∩ D = ∅ we say that (A, B) is many-one reducible to (C, D) (denoted as (A, B) ≤ m (C, D)) if there is a computable function f with x ∈ A ⇒ f (x) ∈ C and x ∈ B ⇒ f (x) ∈ D. Note that if B = A and D = C this coincides with the usual many-one reducibility, i.e., (A, CSAT is the circuit satisfiability problem, i.e., the problem of determining whether a given Boolean circuit has an assignment of the unassigned inputs that makes the output gate true.The problem is ≤ log m -complete for NP via a trivial reduction from SAT which itself can be shown to be ≤ log m -complete for NP via a construction by Cook [3].

Balanced Sets
A

Circuits and Balance Problems for Circuits
In previous papers such as [1] it was differentiated between completely and partially assigned circuits.As we restrict on partially assigned circuits in this paper, we define circuits in general as partially assigned circuits.
A circuit C is a triple (V, E, g C ) where (V, E) is a finite, non-empty, directed, acyclic graph with a designated vertex g C ∈ V and a topologically ordered vertex set V ⊆ N, i.e., if u, v ∈ V are vertices with u < v, then there is no edge from v to u.Here, graphs may contain multi-edges and are not necessarily connected.But we require that C is topologically ordered.Note that the test of whether a graph is topologically ordered or not is possible in deterministic logarithmic space.Consequently, we are able to check in deterministic logarithmic space whether an input graph is acyclic.Hence there is a deterministic logarithmic-space algorithm that on input of a graph tests whether the input is a circuit.Therefore, when presenting algorithms for circuits we may always assume that the input is a valid circuit. Let where (V, E, g C ) is a circuit whose nodes are labeled by the labeling function α : V → O ∪ P fin (N) ∪ { } such that each node has indegree 0 or 2, nodes with indegree 0 have a label from P fin (N) (encoded as a list of all the numbers in the set) or from { }, and nodes with indegree 2 have labels from O.Moreover, β is a function E → {l, r} and we require that for each node u with predecessors u 1 and u 2 it holds {β(u 1 ), β(u 2 )} = {l, r}.Thus, β marks whether an edge starts in the left or right predecessor of the node it points to.
In the context of circuits, nodes are also called gates.A gate with indegree 0 is called input gate, all other nodes are inner gates, the designated gate g C is also called output gate.Input gates with a label from P fin (N) are assigned input gates whereas input gates with label are unassigned input gates.O-circuits are also called integer circuits.If g is some gate of C with α(g) = ⊗ ∈ O and with predecessors g and g satisfying β(g ) = l and β(g ) = r, then we also write g = g ⊗ g .
For an O-circuit C with unassigned input gates For a circuit C = (V, E, g C , α) without unassigned input gates we inductively define the set I(g; C) computed by a gate g ∈ V for g = 1, . . ., |V | by The set computed by the circuit is denoted by I(C) and defined to be the set computed by the output gate I(g C ; C).

5:5
It is convenient to introduce notations for basic constructions of circuits.For X ∈ P fin (N) we use X as an abbreviation for the circuit ({1}, ∅, {1}, 1 → X).For O-circuits C, C for some O and ⊗ ∈ {∪, ∩, , −+, •} let C ⊗ C be the circuit obtained from C and C by feeding their output gates to the new output gate ⊗.This is possible in logarithmic space.
As an example, for an unassigned input gate g = 0, consider the circuit where each node is given by its number and its label.The node 5 is the output gate and it computes the set {1} if and only if Now we define the problems this paper focuses on.
We use the following abbreviations if confusions are impossible: we write g or I(g) for I(g; C), where C is a circuit and g is a gate of C; we write C for I(C), where C is a circuit; we write BC(−, •) for BC({−, •}) and the like.

Set Difference and Multiplication Lead to Undecidability
This section contains our main result: the undecidability of BC(−, •) which is achieved by a reduction from a famously known RE-complete problem.According to the Matiyasevich-Robinson-Davis-Putnam theorem [14,4] the problem of determining whether there is a solution for a given Diophantine equation is RE-complete.It can be derived by standard arguments that also the following problem is RE-complete (with regard to ≤ m ).
for multivariate polynomials p and q with coefficients from N + }.
Let for the remainder of this section O = {−, •} unless stated differently.For the sake of brevity, we make use of intersection gates but note that A ∩ B is just an abbreviation for In order to prove Theorem 4 we define a slightly different version of the problem BC(−, •) which can be reduced to the original version in logarithmic space.
and there exist X 1 , . . ., X n ∈ P fin (N + ) such that I(C(X 1 , . . ., X n )) is balanced and For the sake of simplicity, we call instances of BC (O) O-circuits as well.

5:6
Balance Problems for Integer Circuits Lemma 6. 1.For K ∈ P fin (N) with κ : We only sketch the proof of statement 2. Let C be a partially assigned O-circuit with output node g C and let Q be a subset of the nodes of C. Starting with this circuit, we build a new circuit and denote this modified circuit by C : For each assigned or unassigned input node g, add a node g of type − which computes the set g − {0}, replace all edges (g, h) with (g , h), and in case g ∈ Q, remove g from Q and add g .Then add a new output node Before proving Theorem 4 we introduce some O-circuits which will be used extensively as components of circuits expressing Diophantine equations.For each p ∈ P insert an input gate X p and gates

Lemma 7. For every finite
and let Q P contain all these nodes.Denote g i P = X pi .It can be shown that (C P , Q P ) satisfies the requirements of the lemma.
By adding nodes of the form i j=1 g j P for some i we receive the following.Lemma 8.For every finite P = {p 1 , . . ., p n } ⊆ P with n = |P | ≥ 1 there is an O-circuit (D P , Q P ) with gates g 0 P , g 1 P , . . ., g n P satisfying the following properties: 1.For an arbitrary assignment with values from P fin (N + ) it holds and the prime divisors of numbers in g i P are all in P .2. For each m ∈ N + there is an assignment with values from P fin (N + ) under which |g i P | = m i and 1 ∈ g i P for all i, the prime divisors of numbers in g i P are all in P , and K = {1} for all K ∈ Q P .T. Dose

5:7
Moreover, define for all assignments with values from P fin (N + ) satisfying ∀ K∈Q K = {1} it holds that s ≥ t and s and t only contain numbers whose prime divisors are > 3}, i.e., for all circuits in C each relevant assignment maps s to a set with higher or equal cardinality than the set it maps t to and each relevant assignment maps s and t to sets that do not contain any numbers with prime divisors ≤ 3.For the sake of simplicity, we also call tuples (C, Q, s, t) {−, •}-circuits.The proof will be given in the two steps Thus the function composition of the two reduction functions shows DE ≤ m BC (−, •).
1. Roughly speaking, the first of the two reductions generates a circuit computing two sets whose cardinalities express the results of two multivariate polynomials.
Let q and q be multivariate polynomials with variables x 1 , . . ., x n .Then for any assignment with positive natural numbers a 1 , . . ., a n it holds q(a 1 , . . ., a n ) = q (a 1 , . . ., a n ) if and only if q(a 1 , . . ., a n ) 2 + q (a 1 , . . ., a n ) 2 = 2 • q(a 1 , . . ., a n ) • q (a 1 , . . ., a n ).Observe that here because of (q(a 1 , . . ., a n ) − q (a 1 , . . ., a n )) 2 ≥ 0 we have q(a 1 , . . ., a n ) 2 + q (a 1 , . . ., a n ) 2 ≥ 2 • q(a 1 , . . ., a n ) • q (a 1 , . . ., a n ) for any assignment.Due to that we may assume that we are given multivariate polynomials q and q with variables x 1 , . . ., x n such that q ≥ q for all assignments of the variables with values from N + .Let for positive numbers m, m , a i , and a i and natural numbers d i,j and d i,j .Moreover, for each variable x j define e j = max({d 1,j , . . ., d m,j , d 1,j , . . ., d m ,j }), i.e., e j denotes the maximum exponent of the variable x j occurring in a monomial of q or q .
We now successively build the output circuit (C, Q, s, t).For the single steps we give intuition which is written italic.1.For each variable x j select a set P j = {p j,1 , . . ., p j,ej } of primes greater than 3 such that |P j | = e j and P j ∩ P j = ∅ for j = j .Then insert a circuit (C Pj , Q Pj ) according to Lemma 8 and for all P j , insert the nodes of Q Pj into Q.
We will make use of the notation of Lemma 8, in particular of the nodes g 0 Pj , . . ., g ej Pj .That means, for any assignment which satisfies and for all i ≤ e j .Moreover, in that case all primes dividing some number of g i Pj are in P j .For intuition, think of the node g i Pj as a set whose cardinality describes x i j .

a. Choose a prime p > 3 not used before and insert gates h
Loosely speaking, the cardinality of h i describes the value of the i-th monomial of q. b.For each node h i choose a prime p i > 3 not used before and insert a node As addition is supposed to be simulated by union, we need to make sure that the sets standing for distinct monomials are disjoint.Still, for a technical reason we have to keep 1 in each set.So the idea is to let h i consist of 1 and a copy of h i multiplied with an additional prime factor.

5:8
Balance Problems for Integer Circuits c.For i = 1, . . ., m add an unassigned input node z q .Finally add nodes z q − m i=1 h i − {1} and h i − (z q − {1}) (for i = 1, . . ., m) and insert these nodes into Q.Roughly speaking, z q describes the value of q + 1 as it is the union of all the h i .3. Do the same as in step 2 but for q .In particular a node z q is added.4. Define s = z q and t = z q .
First, observe that the function (q, q ) → (C, Q, s, t) is computable.In order to show we make the following central observation.
Proof of Claim 9. 1.Let y 1 , . . ., y n ∈ N + .Then according to Lemma 8 the inputs of the circuits (C Pj , Q Pj ) can be chosen such that K = {1} for all K ∈ Q Pj , |g i Pj | = y i j and 1 ∈ g i Pj for i = 1, . . ., e j , and all prime divisors of numbers in g i Pj are in P j and greater than 3.As the set of primes chosen for two different variables are disjoint and in step 2b we select primes not used before, the gate h i associated with the monomial elements that only have prime divisors greater than 3. Furthermore, as 1 ∈ h i for all i, we have For the node z q choose the assignment m i=1 h i .Consequently, 1 ∈ z q and Since we do the same for the nodes associated with the polynomial q we have |z q | = 1 + q (y 1 , . . ., y n ) and 1 ∈ z q .Observe that the prime divisors of numbers in z q and z q are greater than 3.It remains to observe that all nodes added into Q in step 2c compute the set {1}.This holds since z q was chosen to be m i=1 h i .2. Consider an assignment with K = {1} for all K ∈ Q.Then according to Lemma 8 for each variable x j we have |g i Pj | = y i j for some y j ∈ N + and i = 0, . . ., e j and all numbers in these gates solely have prime divisors in P j .As the P j are pairwise disjoint and in step 2b we select primes not used before, we obtain Similarly we obtain |z q | = 1 + q (y 1 , . . ., y n ).It remains to argue that under the given assignment s and t do not contain any numbers with prime divisors ≤ 3. Obviously, the assigned inputs only compute sets whose elements solely have prime divisors greater than 3.By our construction and Lemma 8 the same T. Dose

5:9
holds for all nodes g i Pj .As a consequence, all nodes h i and h i have the same property and due to z q − m i=1 h i − {1} = {1} (cf.Step 2c) this also holds for z q = s.An analogous argumentation shows that also t does not contain any numbers with prime divisors ≤ 3.
As it has been argued above that |q| ≥ |q |, Claim 9 implies the following two statements: 2. Now we show (CC, CC ∩ C) ≤ m (BC (−, •), BC (−, •)).The following algorithm computes the reduction function.The italic comments are supposed to give some intuition.
1. Let a circuit (C, Q, s, t) be given.We construct a circuit (C , Q ) by successively updating the given circuit.2. Add new unassigned input gates X and X .Insert the following nodes into Q : The basic idea is as follows: X is supposed to be an interval containing s and t and X basically encodes the set X − s where this set is made disjoint to t by multiplying it with {2}.As |s| ≥ |t|, the set X ∪ t is subbalanced.But if |s| = |t|, then X ∪ t is almost balanced.Adding the element max(X )+1 would make the set balanced.This element is generated in the next step. (5) Thus, roughly speaking, the output set O equals X ∪ t ∪ g and is only balanced if |t| ≥ |s|.

5.
Let O be the output node of the circuit (C , Q ).
Proof of Claim 10.Let (C, Q, s, t) ∈ CC.Then there is some assignment with |s| = |t|, 1 ∈ s ∩ t, K = {1} for all K ∈ Q, and s and t only contain numbers whose prime divisors are all greater than 3.We now consider the circuit (C , Q ) under an assignment satisfying the four conditions just mentioned.Moreover, we choose the input of C {p1,p2} , X, X , and O such that g = {1, 3 m } for m minimal with 4 • (max(s ∪ t) + 1) < 3 m and 4 | 3 m − 1 and all nodes in Q {p1,p2} compute {1} (such an assignment exists by Lemma 7), M F C S 2 0 1 8

5:10 Balance Problems for Integer Circuits
In order to see K = {1} for all K ∈ Q it remains to consider the nodes added in the steps 2 and 4. Due to the choice of g and X it holds max(X) > 2•max(s∪t) and thus the nodes defined in (1) and (2) compute {1}.The choice of X immediately implies that the node defined in (4) computes {1}.Now we argue for the node defined in (3): The nodes defined in ( 5), ( 6), (7), and (8) compute {1} by the choice of g, X, X , and O.
As s and t only contain numbers whose prime divisors are > 3, the sets {2} • (X − s), t, and {3 m } are disjoint.Hence, |O| = max(X) and thus O is balanced.
Proof of Claim 11.For a contradiction, assume that (C, Q, s, t) As the second circuit is an extended version of the first circuit, both circuits can now be considered under the same assignment.Choose an assignment with values from As in particular the nodes defined in ( 1) and ( 2) compute {1}, we obtain 1 ∈ s ∩ t, X ⊇ {1, 2} • s ∪ {1, 2} • t, and in particular s ⊆ X and max(X) > max(s The fact that the nodes defined in ( 5), ( 6), (7), and (8 As O is balanced, max(O) is odd by Lemma 1.Since X ⊇ t and max(X ) = 2 • max(X) is even, max(O) = 3 m > max(X ).Due to (C, Q, s, t) ∈ C, under the given assignment |s| ≥ |t| and s and t do not contain any numbers with prime divisors ≤ 3. Due to that, since we have seen 1 ∈ s ∩ t, and as by assumption (C, Q, s, t) / ∈ CC, it even holds |s| > |t|.Putting things together, as we have proven (9) , which contradicts the fact that O is balanced.This completes the proof of (CC, CC ∩ C) ≤ m (BC (−, •), BC (−, •)) and thus BC (−, •) and BC(−, •) are ≤ m -complete for RE.

Smaller Sets of Operations Lead to Problems in NP
In this section it is shown that all problems BC(O) for O {−, •} are in NP.Each of these problems is proven to be ≤ log m -complete for one of the classes L, NL, and NP.

The Complexity of the Problem Solely Admitting Multiplication
This section's purpose is to argue for the NL-completeness of BC(•).Special cases of strong results from the literature [7,8,13] essentially yield the following theorem.
Theorem 12.There exists µ ∈ N such that for all non-empty sets A, B ∈ P fin (N) with max(A) ≥ µ and max(B) ≥ µ the set A • B is subbalanced.

5:12
Balance Problems for Integer Circuits v i is an unassigned input with at least three paths to g C .v i is an unassigned input with precisely one path to g C , such that there are at least µ unassigned inputs < v i with precisely one path to g C .v i is an unassigned input with precisely two paths to g C , such that there are at least µ unassigned inputs < v i with precisely two paths to g C .g 1 is the only input with a path to v i . is satisfied, then delete v i and let all outgoing edges of v i start in g 1 .This step can be implemented as a non-deterministic logarithmic-space subroutine.
Test whether g ∈ Bal M and accept in case the answer is "yes".ii.Reject.By Proposition 2 this step can be executed in logarithmic space.
In the following we observe that each step of the algorithm P accepts (resp., rejects) if and only if the circuit at the beginning of the execution of the respective step has a (resp., no) balancing assignment with values from P fin (N + ).It suffices to argue for the following steps.• max(M ).Thus, the set is subbalanced.2. If there are ≥ µ sets with maximum greater 2 connected to the output, then we can interpret these sets as two sets with maxima ≥ µ and argue in the same way as in the step before.

3.
If the algorithm rejects in this step, then there are sets A and M with max(A) ≥ 2 and then Lemma 1 states that the output set is not balanced.Otherwise, max(A) ≥ 3 and according to Statement 2 of Lemma 6 the set A • A • A contains less than max(A) 3 /2 elements.Hence g C contains less than max(A) 3 • max(M )/2 elements and the maximum of this set is max(A) 3 • max(M ).Thus g C is subbalanced.5.At the beginning of the execution of this step we have the following situation: Due to the steps 1, 2, and 3 and because of the assumption we made on the input circuit there is at most one assigned input containing an element > µ and this has at most one path to the output gate.are at most µ assigned inputs with maximum ≥ 2 and all these inputs have at most two paths to the output gate. is one assigned input with maximum < 2, namely g 1 = {1}.Moreover, as observed above, because of Step 4 it holds max(n 1 , n 2 ) ≤ µ and there are no unassigned inputs with more than 2 paths to the output.
Thus we have to consider two cases.Either there is no assigned input with maximum > µ or there is one.In the first case the circuit has a balancing assignment with values from P fin (N + ) if and only if there are This is what the algorithm tests.In the second case, assigning one of the unassigned inputs with a set with maximum > µ would lead to a subbalanced output with the same argument as was used for Step 1.Thus, only assignments with values from P({1, . . ., µ}) have to be considered.Hence, there is a balancing assignment with values from P fin (N + ) if and only if there are sets E 1 , . . ., E n1 , F 1 , . . ., F n2 ∈ P({1, . . ., µ}) such that This is what the algorithm tests.
It remains to observe that the circuit has a balancing assignment with values from P fin (N + ) before the execution of Step 4 if and only if it has afterwards: In case there are more than µ unassigned inputs with one path (resp., two paths) to the output and more than µ of them are mapped to sets containing elements ≥ 2, then the same arguments as for Step 2 yield that the output is subbalanced.Therefore, all but µ of these nodes can be replaced with g 1 .Let g be an unassigned input with at least three paths to the output (if such a node exists).Assigning this node with a set with maximum ≥ 2 leads to a subbalanced output set with the same arguments as were used for Step 3. Therefore, g can be replaced with g 1 .For each node v i there exists an input that has a path to v i .Hence, if no input different from g 1 has a path to v i , then v i computes {1} and can be replaced with g 1 .
By a straightforward reduction from a problem investigated by McKenzie and Wagner [15] one receives the NL-hardness of BC(•).

The Complexity of the Problems Not Admitting Multiplication
We consider the two remaining problems and prove that BC(−) is ≤ log m -complete for NP and BC(∅) is in L. The NP-hardness of BC(−) can be obtained by a straightforward reduction from CSAT.Hence, for the following theorem it suffices to argue for the membership in NP.Proof.We sketch an NP-algorithm that accepts BC(−).
1. Input: a circuit C with output node g C and labeling function α. 2. Go from g C upwards always taking the left predecessor.Denote the input gate finally reached by g.

3.
If g is assigned, then: guess an assignment with values from P(α(g)) and accept if the output set is balanced for this assignment, otherwise reject.If the algorithm rejects, then C / ∈ BC(−): If the algorithm rejects, then this happens in step 3 or step 5.We argue for the first case.Here g is an assigned input gate.As the output set is a subset of α(g), it holds g c ⊆ α(g) for any assignment and hence it suffices to consider assignments that map all unassigned inputs to subsets of α(g).As the algorithm rejects, g C is not balanced under any of these assignments and thus C / ∈ BC(−).It remains to argue for the case where the algorithm rejects in step 5.In this case, g is an unassigned input and as step 4 did not accept, there is no assignment putting elements outside of M into the circuit's output set.Hence, it is sufficient to consider assignments that solely map to subsets of M .As the algorithm rejects, none of these assignments yields a balanced output set and hence there is no assignment at all under which the output set is balanced.Therefore, C / ∈ BC(−).
The following theorem basically follows from Proposition 2.

Conclusion and Open Questions
The following table summarizes our results, namely the lower and upper complexity bounds To our knowledge, in contrast to all results from previous papers on complexty issues concerning decision problems for integer circuits (e.g., [15,19,2,9,11,1]) or related constraint satisfaction problems ( [10,5]), a problem admitting only one arithmetic operation is shown to be undecidable.Beginning with this problem, namely BC(−, •), the problems BC(O) for O ⊆ {−, •} are systematically investigated and for each of these problems the complexity is precisely characterized.It turns out that decreasing the size of the set of allowed operations yields problems that are in NP.In particular, all these problems are ≤ log m -complete for one of the classes L, NL, and NP.
Hence, in some sense the questions of this paper are completely answered.Nevertheless, there arise new questions from our results: Is there a set O ⊆ {−, ∪, ∩} such that BC(O∪{+}) is undecidable?And if so, for which of the sets this is the case and for which it is not?
Finite intervals {x | a ≤ x ≤ b} for a, b ∈ Z are denoted by [a, b].

Theorem 4 .
Due to Lemma 6 it suffices to show DE ≤ m BC (−, •).Instead of showing this reduction directly we define an intermediate problem, the cardinality circuit problem CC given by and there exists an assignment with values from P fin (N + ) under which 1. |I(s)| = |I(t)| 2. 1 ∈ I(s) ∩ I(t) 3. I(K) = {1} for all K ∈ Q 4. I(s) and I(t) only contain numbers whose prime divisors are all > 3}.

1 .
If the algorithm rejects in this step, then there are sets A and B with max(A) ≥ µ ≤ max(B) and a set M such that gC = A • B • M .Then according to Theorem 12 it holds |(A ∪ {0}) • B| ≤ max(A) • max(B)/2.Hence for each set M ∈ P fin (N) the set M •A•B ⊆ (A∪{0})•B •(M −{0}) contains at most max(A)•max(B)•max(M )/2 elements and its greatest element is max(A) • max(B)

4 . 5 .
Here g is unassigned.Let M be the union of all sets computed by assigned inputs.Let m = max(M ) + 1. Guess an assignment such that I(g) = {m} and each unassigned input either computes {m} or ∅.If under this assignment g C contains m, then accept.Guess an assignment of the unassigned inputs such that each of them computes a subset of M .In case g C is balanced, accept.Otherwise reject.Ifthe algorithm accepts, then C ∈ BC(−): It suffices to consider the 4-th step.If the algorithm accepts in this step, then there is an assignment that maps each unassigned input either to {m} or to ∅ such that m is in the output set.Now change this assignment such that the sets mapped to {m} are now mapped to {m + 1, m + 2, . . ., 2m + 1}.Then I(C) = {m + 1, m + 2, . . ., 2m + 1} is balanced and C ∈ BC(−).Trivially, in case C is accepted in the 5-th step, C ∈ BC(−).

C S 2 0 1 8 5:4 Balance Problems for Integer Circuits
Lemma 1.Let S ∈ P fin (N) be balanced.Then S = ∅ and max(S) is odd.M F gates g 1 P , . . ., g n P satisfying the following properties: 1.For an arbitrary assignment with values from P fin (N For each m ∈ N there is an assignment with values from P fin (N + ) under which g i P = {1, p i , . . ., p m + ) it holds: if K = {1} for all K ∈ Q P , then ∃ m∈N ∀ i=1,...,n g i P = {1, p i , . .., p m i }. 2. i } and K = {1} for all K ∈ Q P .Proof sketch.Construct the O-circuit (C P , Q P ) as follows.

5 .
Let n 1 (resp., n 2 ) be the number of unassigned inputs with 1 path (resp., 2 paths) to g C .Due to Step 4 we have max(n 1 , n 2 ) ≤ µ.Moreover, let A be a set consisting of all pairs (h, i h ) where h is a set computed by an assigned input with 1 < max(h) ≤ µ and i h ∈ {1, 2} is the number of paths from h to g C .Due to Step 2 it holds |A| ≤ µ.We have the following cases.a.

In case there is no assigned input gate with an element ≥ µ:
If (A, n 1 , n 2 ) ∈ Θ, then accept.Otherwise reject.Computing the triple (A, n 1 , n 2 ) is possible in non-deterministic logarithmic space whereas the subsequent test only requires constant time.b.

In case there is one assigned input gate g with an element ≥ µ:
Due toStep 1 the node g only has one path to the output.i.For all E 1 , . . ., E n1 , F 1 , . . ., F n2 ∈ P({1, . . ., µ}) do the following Compute the constant-size set