EDIT: I've rephrased the answer to keep a more compact answer. I keep the mention to the binomial coefficient for consistency with the comments.
So the question boils down to this: if I have N nodes and Y subsets of size $2^{(N-2)}$ how many of these subsets are actually distinct?
At first, I thought it was possible to use the binomial coefficient $\left(\begin{array}{c}n\\ k\end{array}\right)$, but this is clearly not the case.
As mentioned by the other answers and comments, the inclusion/exclusion principle should be used, and the general formula is: $$
\mathbf{card}(\bigcup^n_{i=1} A_i) = \sum^n_{k=1} (-1)^{k+1}
\left(\sum_{1 \leq i_1 < \cdots < i_k \leq n} \mathbf{card}(A_{i_1} \cap \cdots \cap A_{i_k}) \right)
$$
So we just need to define the $A_i$. Given a set of nodes $N$, we are interested in the subsets generated by two letters $X, Y \in N$, and we write:
$$
Z_{XY} = \{ Z \subseteq N \mid X \in Z \land Y \in Z\}
$$
In this case, the question becomes: given a set of generators
$G = \{\{X_1, Y_1\}, \cdots \{X_k, Y_k\}\}$ (note that the number $k$ stands for $Y~$ in the original question), what is the cardinality of $Z_{X_1Y_1} \cup \cdots \cup Z_{X_kY_k}$?
If we write $A_i$ for $Z_{X_iY_i}$, we have
$$
\mathbf{card}(A_{i_1} \cap \cdots \cap A_{i_n}) =
2 ^{N - \mathbf{card}(\{X_{i_1}, Y_{i_1}, \cdots, X_{i_n}, Y_{i_n}\})}
$$
because the cardinality of the intersection corresponds to the number of subsets possible without the generators. Using this formula and the general formula for inclusion/exclusion, you can calculate the cardinality of the set.
For instance, we have:
$$
\begin{align*}
\mathbf{card}(Z_{X_1Y_1} \cup Z_{X_2Y_2}) & = \mathbf{card}(Z_{X_1Y_1}) + \mathbf{card}(Z_{X_2Y_2}) - \mathbf{card}(Z_{X_1Y_1} \cap Z_{X_2Y_2}) \\
& = 2^{N-2} + 2^{N-2} - 2^{N - \mathbf{card}(\{X_1, Y_1, X_2, Y_2\})}
\end{align*}$$
Similarly:
$$
\begin{align*}
\mathbf{card}(Z_{X_1Y_1} \cup Z_{X_2Y_2} \cup Z_{X_3Y_3}) & = \mathbf{card}(Z_{X_1Y_1}) + \mathbf{card}(Z_{X_2Y_2}) + \mathbf{card}(Z_{X_3Y_3}) \\
& - ~ \mathbf{card}(Z_{X_1Y_1} \cap Z_{X_2Y_2}) - ~ \mathbf{card}(Z_{X_1Y_1} \cap Z_{X_3Y_3}) - ~ \mathbf{card}(Z_{X_2Y_2} \cap Z_{X_3Y_3}) \\
& + ~ \mathbf{card}(Z_{X_1Y_1} \cap Z_{X_2Y_2} \cap Z_{X_3Y_3}) \\
& = 2^{N-2} + 2^{N-2} + 2^{N-2} \\ & - ~2^{N - \mathbf{card}(\{X_1, Y_1, X_2, Y_2\})}
- 2^{N - \mathbf{card}(\{X_1, Y_1, X_3, Y_3\})} - 2^{N - \mathbf{card}(\{X_2, Y_2, X_3, Y_3\})}
\\ & + ~2^{N - \mathbf{card}(\{X_1, Y_1, X_2, Y_2, X_3, Y_3\})}
\end{align*}$$
With the simple example given in the original question:
$N = \{A, B, C, D\}$
$Y = Z_{AB} \cup Z_{AC} \cup Z_{BC}$
For AB, we have the subsets $\{\{A,B\},\{A,B,C\},\{A,B,D\},\{A,B,C,D\}\}$
For AC, we have the subsets (I do not include those already in AB): $\{\{A, C\},\{A,C,D\}\}$
For BC, we have the subsets (I do not include those already in AB): $\{\{B, C\},\{B,C,D\}\}$.
Using the formula, we have indeed $\mathbf{card}(Y) = 2^2 + 2^2 + 2^2 - 2 - 2 -2 + 2 =8$.
If we consider BD instead of BC, then we just add the subsets $\{\{B, C\}\}$, which gives $7$, as expected.