/** Do one the the 16 possible bit-wise operations of two IntNums. */ public static IntNum bitOp(int op, IntNum x, IntNum y) { switch (op) { case 0: return(IntNum.zero()); case 1: return(and(x, y)); case 3: return(x); case 5: return(y); case 15: return(IntNum.minusOne()); } IntNum result = new IntNum(); setBitOp(result, op, x, y); return(result.canonicalize()); }