//==============================================================================================================//
/** Allocate relations for SubsetSig top-down. */
private Expression allocateSubsetSig(SubsetSig sig) throws Err {
// We must not visit the same SubsetSig more than once, so if we've been here already, then return the old value right away
Expression sum = sol.a2k(sig);
if (sum!=null && sum!=Expression.NONE) return sum;
// Recursively form the union of all parent expressions
TupleSet ts = factory.noneOf(1);
for(Sig parent:sig.parents) {
Expression p = (parent instanceof PrimSig) ? sol.a2k(parent) : allocateSubsetSig((SubsetSig)parent);
ts.addAll(sol.query(true, p, false));
if (sum==null) sum=p; else sum=sum.union(p);
}
// If subset is exact, then just use the "sum" as is
if (sig.exact) { sol.addSig(sig, sum); return sum; }