public static boolean compareIntervalBoundsP(Surrogate relation, Stella_Object x, Stella_Object y) {
    if (PlKernelKb.nullLiteralWrapperP(x) ||
        PlKernelKb.nullLiteralWrapperP(y)) {
      return (false);
    }
    if (relation == PlKernelKb.SGT_PL_KERNEL_KB_e) {
      return (Stella_Object.eqlP(x, y));
    }
    { Surrogate testValue000 = Stella_Object.safePrimaryType(x);

      if (Surrogate.subtypeOfP(testValue000, Logic.SGT_STELLA_NUMBER_WRAPPER)) {
        { NumberWrapper x000 = ((NumberWrapper)(x));

          { Surrogate testValue001 = Stella_Object.safePrimaryType(y);

            if (Surrogate.subtypeOfP(testValue001, Logic.SGT_STELLA_NUMBER_WRAPPER)) {
              { NumberWrapper y000 = ((NumberWrapper)(y));

                { double floatX = x000.numberWrapperToFloat();
                  double floatY = y000.numberWrapperToFloat();

                  if (relation == PlKernelKb.SGT_PL_KERNEL_KB_el) {
                    return (floatX <= floatY);
                  }
                  else if (relation == PlKernelKb.SGT_PL_KERNEL_KB_l) {
                    return (floatX < floatY);
                  }
                  else if (relation == Logic.SGT_PL_KERNEL_KB_ge) {
                    return (floatX >= floatY);
                  }
                  else if (relation == PlKernelKb.SGT_PL_KERNEL_KB_g) {
                    return (floatX > floatY);
                  }
                  else {
                    { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

                      stream000.nativeStream.print("`" + relation + "' is not a valid case option");
                      throw ((StellaException)(StellaException.newStellaException(stream000.theStringReader()).fillInStackTrace()));
                    }
                  }
                }
              }
            }
            else if (Surrogate.subtypeOfP(testValue001, Logic.SGT_LOGIC_QUANTITY_LOGIC_WRAPPER)) {
              { QuantityLogicWrapper y000 = ((QuantityLogicWrapper)(y));

                { Quantity quantityY = y000.wrapperValue;
                  Quantity quantityX = quantityY.coerceTo(x000);

                  if (relation == PlKernelKb.SGT_PL_KERNEL_KB_el) {
                    return (quantityX.lessEqualP(quantityY));
                  }
                  else if (relation == PlKernelKb.SGT_PL_KERNEL_KB_l) {
                    return (quantityX.lessP(quantityY));
                  }
                  else if (relation == Logic.SGT_PL_KERNEL_KB_ge) {
                    return (quantityX.greaterEqualP(quantityY));
                  }
                  else if (relation == PlKernelKb.SGT_PL_KERNEL_KB_g) {
                    return (quantityX.greaterP(quantityY));
                  }
                  else {
                    { OutputStringStream stream001 = OutputStringStream.newOutputStringStream();

                      stream001.nativeStream.print("`" + relation + "' is not a valid case option");
                      throw ((StellaException)(StellaException.newStellaException(stream001.theStringReader()).fillInStackTrace()));
                    }
                  }
                }
              }
            }
            else {
              { OutputStringStream stream002 = OutputStringStream.newOutputStringStream();

                stream002.nativeStream.print("`" + testValue001 + "' is not a valid case option");
                throw ((StellaException)(StellaException.newStellaException(stream002.theStringReader()).fillInStackTrace()));
              }
            }
          }
        }
      }
      else if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_QUANTITY_LOGIC_WRAPPER)) {
        { QuantityLogicWrapper x000 = ((QuantityLogicWrapper)(x));

          { Surrogate testValue002 = Stella_Object.safePrimaryType(y);

            if (Surrogate.subtypeOfP(testValue002, Logic.SGT_STELLA_NUMBER_WRAPPER)) {
              { NumberWrapper y000 = ((NumberWrapper)(y));

                { Quantity quantityX = x000.wrapperValue;
                  Quantity quantityY = quantityX.coerceTo(y000);

                  if (relation == PlKernelKb.SGT_PL_KERNEL_KB_el) {
                    return (quantityX.lessEqualP(quantityY));
                  }
                  else if (relation == PlKernelKb.SGT_PL_KERNEL_KB_l) {
                    return (quantityX.lessP(quantityY));
                  }
                  else if (relation == Logic.SGT_PL_KERNEL_KB_ge) {
                    return (quantityX.greaterEqualP(quantityY));
                  }
                  else if (relation == PlKernelKb.SGT_PL_KERNEL_KB_g) {
                    return (quantityX.greaterP(quantityY));
                  }
                  else {
                    { OutputStringStream stream003 = OutputStringStream.newOutputStringStream();

                      stream003.nativeStream.print("`" + relation + "' is not a valid case option");
                      throw ((StellaException)(StellaException.newStellaException(stream003.theStringReader()).fillInStackTrace()));
                    }
                  }
                }
              }
            }
            else if (Surrogate.subtypeOfP(testValue002, Logic.SGT_LOGIC_QUANTITY_LOGIC_WRAPPER)) {
              { QuantityLogicWrapper y000 = ((QuantityLogicWrapper)(y));

                if (relation == PlKernelKb.SGT_PL_KERNEL_KB_el) {
                  return (x000.wrapperValue.lessEqualP(y000.wrapperValue));
                }
                else if (relation == PlKernelKb.SGT_PL_KERNEL_KB_l) {
                  return (x000.wrapperValue.lessP(y000.wrapperValue));
                }
                else if (relation == Logic.SGT_PL_KERNEL_KB_ge) {
                  return (x000.wrapperValue.greaterEqualP(y000.wrapperValue));
                }
                else if (relation == PlKernelKb.SGT_PL_KERNEL_KB_g) {
                  return (x000.wrapperValue.greaterP(y000.wrapperValue));
                }
                else {
                  { OutputStringStream stream004 = OutputStringStream.newOutputStringStream();

                    stream004.nativeStream.print("`" + relation + "' is not a valid case option");
                    throw ((StellaException)(StellaException.newStellaException(stream004.theStringReader()).fillInStackTrace()));
                  }
                }
              }
            }
            else {
              { OutputStringStream stream005 = OutputStringStream.newOutputStringStream();

                stream005.nativeStream.print("`" + testValue002 + "' is not a valid case option");
                throw ((StellaException)(StellaException.newStellaException(stream005.theStringReader()).fillInStackTrace()));
              }
            }
          }
        }
      }
      else {
        { OutputStringStream stream006 = OutputStringStream.newOutputStringStream();

          stream006.nativeStream.print("`" + testValue000 + "' is not a valid case option");
          throw ((StellaException)(StellaException.newStellaException(stream006.theStringReader()).fillInStackTrace()));
        }
      }
    }
  }