With "merge" there Minato means union (algorithm) . You can also see this from an example:
4 * y = { { 2^2, y } } x = { { x } } 4 * y + x = { { 2^2, y }, { x } }
The idea is that internal sets are products, and the entire ZDD is the sum of these products, so if you are just OR (aka union or merge) in some other sets, they are effectively added.
The complete summation algorithm is actually simple (A xor B) + 2 * (A and B) (recursively), which is equivalent to the familiar bitwise addition algorithm, but xor was written as (A or B) without (A and B) .
It also makes it obvious why itβs easy to take the union in order when there are no common combinations β if A and B empty, A xor B matches A or B , and the βcarryβ is zero.
The algorithms for OR, AND, XOR, and BUTNOT are explained in detail in the section "Software Scope" 4, section 7.1.4 (the answer to question 199 matters). The general idea for everyone is that they consider two subgraphs that represent all sets with the variable v and all sets without the variable v separately (which are trivially found if v is the highest variable in one or both arguments, both low and and high, or the input itself), and then combining the result.
Union(F, G) = if (F = β
) return G if (G = β
) return F if (F = G) return F if (cache contains "F βͺ G" or "G βͺ F") return cached value if (Fv = Gv) result = MakeNode(Fv, F.lo βͺ G.lo, F.hi βͺ G.hi) if (Fv > Gv) result = MakeNode(Gv, F βͺ G.lo, G.hi) if (Fv < Gv) result = MakeNode(Fv, F.lo βͺ G, F.hi) cache result as "F βͺ G" return result Intersect(F, G) = if (F = β
or G = β
) return β
if (F = G) return F if (cache contains "F β© G" or "G β© F") return cached value if (Fv = Gv) result = MakeNode(Fv, F.lo β© G.lo, F.hi β© G.hi) if (Fv > Gv) result = F β© G.lo if (Fv < Gv) result = F.lo β© G cache result as "F β© G" return result