long dontcare = 0L; for (i=domain_n_varnum-1; i>=0; i--) { dontcare <<= 1;
int maxSkip = -1; boolean hasDontCare = false; for (i=0; i<domain_n_varnum; ++i) { int val = set[var[i]]; if (val == 0) { hasDontCare = true; if (maxSkip == i-1) maxSkip = i; } } for (i=domain_n_varnum-1; i>=0; --i) {
    static void fdd_printset_rec(BDDFactory bdd, StringBuffer sb, BDDToString ts, BDD r, int[] set) {        int fdvarnum = bdd.numberOfDomains();                int n, m, i;        boolean used = false;        int[] var;        boolean[] binval;        boolean ok, first;                if (r.isZero())            return;        else if (r.isOne()) {            sb.append('<');            first = true;                        for (n=0 ; n<fdvarnum ; n++) {                boolean firstval = true;                used = false;                                BDDDomain domain_n = bdd.getDomain(n);                                int[] domain_n_ivar = domain_n.vars();                int domain_n_varnum = domain_n_ivar.length;                for (m=0 ; m<domain_n_varnum ; m++)                    if (set[domain_n_ivar[m]] != 0)                        used = true;                                if (used) {                    if (!first)                        sb.append(", ");                    first = false;                    sb.append(ts.domainName(n));                    sb.append(':');                                        var = domain_n_ivar;                                        long pos = 0L;                    long dontcare = 0L;                    for (i=domain_n_varnum-1; i>=0; i--) {                        dontcare <<= 1;                        pos <<= 1;                        int val = set[var[i]];                        if (val == 0) dontcare |= 1L;                        else if (val == 2) pos |= 1L;                    }                    if (dontcare == 0L) {                        sb.append(ts.elementName(n, pos));                    } else {                        sb.append(ts.elementNames(n, pos, pos | dontcare));                    }                }            }                        sb.append('>');        } else {            set[r.var()] = 1;            fdd_printset_rec(bdd, sb, ts, r.low(), set);                        set[r.var()] = 2;            fdd_printset_rec(bdd, sb, ts, r.high(), set);                        set[r.var()] = 0;        }    }