public CompoundBitVectorInterval binaryXor(
      CompoundBitVectorInterval pState,
      boolean pAllowSignedWrapAround,
      final OverflowEventHandler pOverflowEventHandler) {
    checkBitVectorCompatibilityWith(pState.info);
    if (isBottom() || pState.isBottom()) {
      return bottom(info);
    }
    if (isSingleton() && pState.isSingleton()) {
      return of(
          BitVectorInterval.cast(
              info,
              getValue().xor(pState.getValue()),
              pAllowSignedWrapAround,
              pOverflowEventHandler));
    }
    if (pState.isSingleton() && pState.containsZero()) {
      return this;
    }
    if (isSingleton() && containsZero()) {
      return pState;
    }
    // [0,1] ^ 1 = [0,1]
    if (pState.isSingleton() && pState.contains(1) && equals(getZeroToOne(info))) {
      return this;
    }
    // 1 ^ [0,1] = [0,1]
    if (isSingleton() && contains(1) && pState.equals(getZeroToOne(info))) {
      return getZeroToOne(info);
    }
    if (pState.isSingleton()) {
      CompoundBitVectorInterval result = bottom(info);
      for (BitVectorInterval interval : intervals) {
        if (!interval.isSingleton()) {
          return getInternal(info.getRange());
        }
        result =
            result.unionWith(
                BitVectorInterval.cast(
                    info,
                    interval.getLowerBound().xor(pState.getValue()),
                    pAllowSignedWrapAround,
                    pOverflowEventHandler));
      }
      return result;
    } else if (isSingleton()) {
      return pState.binaryXor(this, pAllowSignedWrapAround, pOverflowEventHandler);
    }
    // TODO maybe a more exact implementation is possible?
    return getInternal(info.getRange());
  }
public CompoundBitVectorInterval binaryXor(
      CompoundBitVectorInterval pState,
      boolean pAllowSignedWrapAround,
      final OverflowEventHandler pOverflowEventHandler) {
    checkBitVectorCompatibilityWith(pState.info);
    if (isBottom() || pState.isBottom()) {
      return bottom(info);
    }
    if (isSingleton() && pState.isSingleton()) {
      return of(
          BitVectorInterval.cast(
              info,
              getValue().xor(pState.getValue()),
              pAllowSignedWrapAround,
              pOverflowEventHandler));
    }
    if (pState.isSingleton() && pState.containsZero()) {
      return this;
    }
    if (isSingleton() && containsZero()) {
      return pState;
    }
   
    if (pState.isSingleton() && pState.contains(1) && equals(getZeroToOne(info))) {
      return this;
    }
   
    if (isSingleton() && contains(1) && pState.equals(getZeroToOne(info))) {
      return getZeroToOne(info);
    }
    if (pState.isSingleton()) {
      CompoundBitVectorInterval result = bottom(info);
      for (BitVectorInterval interval : intervals) {
        if (!interval.isSingleton()) {
          return getInternal(info.getRange());
        }
        result =
            result.unionWith(
                BitVectorInterval.cast(
                    info,
                    interval.getLowerBound().xor(pState.getValue()),
                    pAllowSignedWrapAround,
                    pOverflowEventHandler));
      }
      return result;
    } else if (isSingleton()) {
      return pState.binaryXor(this, pAllowSignedWrapAround, pOverflowEventHandler);
    }
   
    return getInternal(info.getRange());
  }
public compoundbitvectorinterval binaryxor( compoundbitvectorinterval pstate, boolean pallowsignedwraparound, final overfloweventhandler poverfloweventhandler) { checkbitvectorcompatibilitywith(pstate.info); if (isbottom() || pstate.isbottom()) { return bottom(info); } if (issingleton() && pstate.issingleton()) { return of( bitvectorinterval.cast( info, getvalue().xor(pstate.getvalue()), pallowsignedwraparound, poverfloweventhandler)); } if (pstate.issingleton() && pstate.containszero()) { return this; } if (issingleton() && containszero()) { return pstate; } if (pstate.issingleton() && pstate.contains(1) && equals(getzerotoone(info))) { return this; } if (issingleton() && contains(1) && pstate.equals(getzerotoone(info))) { return getzerotoone(info); } if (pstate.issingleton()) { compoundbitvectorinterval result = bottom(info); for (bitvectorinterval interval : intervals) { if (!interval.issingleton()) { return getinternal(info.getrange()); } result = result.unionwith( bitvectorinterval.cast( info, interval.getlowerbound().xor(pstate.getvalue()), pallowsignedwraparound, poverfloweventhandler)); } return result; } else if (issingleton()) { return pstate.binaryxor(this, pallowsignedwraparound, poverfloweventhandler); } return getinternal(info.getrange()); }