public static Keyword lessSpecialistHelper(ControlFrame frame, Surrogate relation, Stella_Object xarg, Stella_Object yarg) {
    { Stella_Object x = Logic.argumentBoundTo(xarg);
      Stella_Object y = Logic.argumentBoundTo(yarg);
      Stella_Object xbound = null;
      boolean strictxP = false;
      Stella_Object ybound = null;
      boolean strictyP = false;
      boolean successP = false;

      if (y == null) {
        if (x == null) {
          return (Logic.KWD_TERMINAL_FAILURE);
        }
        { Object [] caller_MV_returnarray = new Object[1];

          xbound = PlKernelKb.accessIntervalBounds(x, PlKernelKb.KWD_UPPER_BOUND, caller_MV_returnarray);
          strictxP = ((boolean)(((BooleanWrapper)(caller_MV_returnarray[0])).wrapperValue));
        }
        if ((!PlKernelKb.nullLiteralWrapperP(xbound)) &&
            ((relation == PlKernelKb.SGT_PL_KERNEL_KB_el) ||
             Stella_Object.isaP(xbound, Logic.SGT_STELLA_INTEGER_WRAPPER))) {
          if (relation == PlKernelKb.SGT_PL_KERNEL_KB_l) {
            xbound = IntegerWrapper.wrapInteger(((IntegerWrapper)(xbound)).wrapperValue + 1);
          }
          successP = PatternVariable.bindVariableToValueP(((PatternVariable)(yarg)), xbound, true);
        }
        return (Logic.selectProofResult(successP, false, false));
      }
      if (x == null) {
        { Object [] caller_MV_returnarray = new Object[1];

          ybound = PlKernelKb.accessIntervalBounds(y, PlKernelKb.KWD_LOWER_BOUND, caller_MV_returnarray);
          strictyP = ((boolean)(((BooleanWrapper)(caller_MV_returnarray[0])).wrapperValue));
        }
        if ((!PlKernelKb.nullNumberP(((NumberWrapper)(ybound)))) &&
            ((relation == PlKernelKb.SGT_PL_KERNEL_KB_el) ||
             Stella_Object.isaP(ybound, Logic.SGT_STELLA_INTEGER_WRAPPER))) {
          if (relation == PlKernelKb.SGT_PL_KERNEL_KB_l) {
            ybound = IntegerWrapper.wrapInteger(((IntegerWrapper)(ybound)).wrapperValue - 1);
          }
          successP = PatternVariable.bindVariableToValueP(((PatternVariable)(xarg)), ybound, true);
        }
        return (Logic.selectProofResult(successP, false, false));
      }
      { boolean successP000 = false;

        { Object [] caller_MV_returnarray = new Object[1];

          xbound = PlKernelKb.accessIntervalBounds(x, PlKernelKb.KWD_UPPER_BOUND, caller_MV_returnarray);
          strictxP = ((boolean)(((BooleanWrapper)(caller_MV_returnarray[0])).wrapperValue));
        }
        { Object [] caller_MV_returnarray = new Object[1];

          ybound = PlKernelKb.accessIntervalBounds(y, PlKernelKb.KWD_LOWER_BOUND, caller_MV_returnarray);
          strictyP = ((boolean)(((BooleanWrapper)(caller_MV_returnarray[0])).wrapperValue));
        }
        try {
          if (relation == PlKernelKb.SGT_PL_KERNEL_KB_l) {
            successP000 = ((strictxP ||
                strictyP) &&
                PlKernelKb.compareIntervalBoundsP(PlKernelKb.SGT_PL_KERNEL_KB_el, xbound, ybound)) ||
                PlKernelKb.compareIntervalBoundsP(PlKernelKb.SGT_PL_KERNEL_KB_l, xbound, ybound);
          }
          else if (relation == PlKernelKb.SGT_PL_KERNEL_KB_el) {
            successP000 = PlKernelKb.compareIntervalBoundsP(relation, xbound, ybound);
          }
          else {
            { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

              stream000.nativeStream.print("`" + relation + "' is not a valid case option");
              throw ((StellaException)(StellaException.newStellaException(stream000.theStringReader()).fillInStackTrace()));
            }
          }
        } catch (IncompatibleQuantityException e000) {
          ControlFrame.setFrameTruthValue(frame, Logic.UNKNOWN_TRUTH_VALUE);
          return (Logic.KWD_TERMINAL_FAILURE);
        }
        if (successP000) {
          ControlFrame.setFrameTruthValue(frame, Logic.TRUE_TRUTH_VALUE);
          return (Logic.KWD_FINAL_SUCCESS);
        }
        { Object [] caller_MV_returnarray = new Object[1];

          xbound = PlKernelKb.accessIntervalBounds(x, PlKernelKb.KWD_LOWER_BOUND, caller_MV_returnarray);
          strictxP = ((boolean)(((BooleanWrapper)(caller_MV_returnarray[0])).wrapperValue));
        }
        { Object [] caller_MV_returnarray = new Object[1];

          ybound = PlKernelKb.accessIntervalBounds(y, PlKernelKb.KWD_UPPER_BOUND, caller_MV_returnarray);
          strictyP = ((boolean)(((BooleanWrapper)(caller_MV_returnarray[0])).wrapperValue));
        }
        try {
          if (relation == PlKernelKb.SGT_PL_KERNEL_KB_el) {
            successP000 = ((strictxP ||
                strictyP) &&
                PlKernelKb.compareIntervalBoundsP(PlKernelKb.SGT_PL_KERNEL_KB_el, ybound, xbound)) ||
                PlKernelKb.compareIntervalBoundsP(PlKernelKb.SGT_PL_KERNEL_KB_l, ybound, xbound);
          }
          else if (relation == PlKernelKb.SGT_PL_KERNEL_KB_l) {
            successP000 = PlKernelKb.compareIntervalBoundsP(PlKernelKb.SGT_PL_KERNEL_KB_el, ybound, xbound);
          }
          else {
            { OutputStringStream stream001 = OutputStringStream.newOutputStringStream();

              stream001.nativeStream.print("`" + relation + "' is not a valid case option");
              throw ((StellaException)(StellaException.newStellaException(stream001.theStringReader()).fillInStackTrace()));
            }
          }
        } catch (IncompatibleQuantityException e001) {
          ControlFrame.setFrameTruthValue(frame, Logic.UNKNOWN_TRUTH_VALUE);
          return (Logic.KWD_TERMINAL_FAILURE);
        }
        if (successP000) {
          ControlFrame.setFrameTruthValue(frame, Logic.FALSE_TRUTH_VALUE);
          return (Logic.KWD_TERMINAL_FAILURE);
        }
      }
      if (Logic.skolemP(x) &&
          Logic.skolemP(y)) {
        return (Logic.KWD_FAILURE);
      }
      else {
        return (Logic.KWD_TERMINAL_FAILURE);
      }
    }
  }