What algorithm do i need to solve my problem? unfortunately I even don't know what kind of problem I deal with. But I'll try to explain as good as I can and maybe you can tell what kind of problem this is and how to solve it.
I want to find sets, that potentially can be decomposed into smaller sets by combining overlaying sets, so that a single element can be calculated.
The following chart on the left side shows the most simple example. Subtraction of the sum of all elements ob B from A yields to the value of X4. I've found already an algorithm to search for those sets.
Problem is on the right side: Even though it's obvious that the sum of the A sets minus the sum of the B sets yields also to X4, I'm totally stuck with finding an algorithm for nested structures.

p.s.: i've thousands of sets in a SQL database
 A: Create lists for each element, in which it is present(this can be done while assigning elements to "your" sets), for e.g.:
$$list\_x_1={A_1,B_1}\\list\_x_2=A_1,B_2\\list\_x_3=A_1,B_3\\\color{red}{list\_x_4=A_1}\\list\_x_5=A_2,B_1\\\cdots\\list\_x_{16}=A_4,B_4$$ 
Notice the elemnts you require has only one corresponding element int the list, So linearly search for lists with only one element.
A: after our phone discussion, I guess that your problem can be formalized like this. Please feel free to correct the problem formulation. All other members, feel free to correct or improve the solution idea.
Problem. 
Given index sets $A_1,A_2,\dots,A_m \subseteq \{1,\dots,n\}$ and real numbers $s_1,\dots,s_m \in \mathbb{R}$, try to recover as many entries of an unknown real vector $x = (x_1,\dots,x_n) \in \mathbb{R}^n$ as possible, given the information that
$$ \sum_{j \in A_i} x_j = s_i  \mbox{ for all } i = 1,\dots, m. $$
Solution Idea. 
Compute the general solution to the following system of linear equations: 
$$ \sum_{j \in A_i} x_j = s_i  \mbox{ for all } i = 1,\dots, m. $$
Let the solution be denoted by
$$x^* = a _0 + \sum_{i=1}^k \lambda_i a_i $$
for vectors $a_i \in \mathbb{R}^n$ and scalars $\lambda_i \in \mathbb{R}$. 
The entry $x_i$ of the unknown vector $x$ is reconstructable if and only if the i-th entries of the vectors $a_1,\dots,a_k$ are all zero. Then, the value of $x_i$ is the i-th entry of $a_0$.
