@Override
    public Expression filter (long output) {
        if (!hasWildcard)
            return super.filter(output);
        switch (op) {
            case not:
                Expression e_ = e.filter(~output);
                if (e_ == null)
                    return null;
                else
                    return Language.not(e_);
            case shl1: {
                if ((output & 1L) != 0)
                    return null;

                Expression e1 = e.filter(output >>> 1);
                Expression e2 = e.filter((output >>> 1) | (1L << 63));

                return Language.shl1(Language.alt(e1, e2));
            }
            case shr1: {
                if ((output & (1L << 63)) != 0)
                    return null;

                Expression e1 = e.filter(output << 1);
                Expression e2 = e.filter((output << 1) | 1L);

                return Language.shr1(Language.alt(e1, e2));
            }
            case shr4:
                return null; // TODO
            case shr16:
                return null; // TODO
            default:
                return null;
        }
    }