throw new IllegalStateException ("cardinality mismatch\nleft: " + lvals + "\nrvals: " + rvals + "\nleft: " + lexpr + "\nright: " + rexpr);
if (lvals.size() == 1 && lnull.containsAll(lvals)) { lvals = repeat(lvals.get(0), rvals.size()); } else if (rvals.size() == 1 && rnull.containsAll(rvals)) { rvals = repeat(rvals.get(0), lvals.size()); } else { throw new IllegalStateException ("cardinality mismatch\nlvals: " + lvals + "\nrvals: " + rvals + "\nleft: " + lexpr + "\nright: " + rexpr); }
    static void equate(Generator gen, Expression expr, QFrame left,                       QFrame right) {        Expression lexpr = left.getExpression();        Expression rexpr = right.getExpression();        List lvals = left.getValues();        List rvals = right.getValues();        if (lvals.size() != rvals.size()) {            throw new IllegalStateException                ("cardinality mismatch\nleft: " + lvals +                 "\nrvals: " + rvals +                 "\nleft: " + lexpr +                 "\nright: " + rexpr);        }        List lnull = gen.getNull(lexpr);        List rnull = gen.getNull(rexpr);        List lnonnull = gen.getNonNull(lexpr);        List rnonnull = gen.getNonNull(rexpr);        for (int i = 0; i < lvals.size(); i++) {            QValue lval = (QValue) lvals.get(i);            QValue rval = (QValue) rvals.get(i);            gen.addEquality(expr, lval, rval);            if (lnull.contains(lval)) {                gen.addNull(expr, rval);            }            if (lnonnull.contains(lval)) {                gen.addNonNull(expr, rval);            }            if (rnull.contains(rval)) {                gen.addNull(expr, lval);            }            if (rnonnull.contains(rval)) {                gen.addNonNull(expr, lval);            }        }        gen.addSufficient(expr);    }