public static Keyword inequalitySpecialist(ControlFrame frame, Keyword lastmove) {
    lastmove = lastmove;
    { Proposition proposition = frame.proposition;
      Surrogate relation = ((Surrogate)(proposition.operator));

      if (((Boolean)(Logic.$REVERSEPOLARITYp$.get())).booleanValue()) {
        { Object old$ReversepolarityP$000 = Logic.$REVERSEPOLARITYp$.get();

          try {
            Native.setBooleanSpecial(Logic.$REVERSEPOLARITYp$, false);
            if (relation == PlKernelKb.SGT_PL_KERNEL_KB_l) {
              return (PlKernelKb.lessSpecialistHelper(frame, PlKernelKb.SGT_PL_KERNEL_KB_el, (proposition.arguments.theArray)[1], (proposition.arguments.theArray)[0]));
            }
            else if (relation == PlKernelKb.SGT_PL_KERNEL_KB_el) {
              return (PlKernelKb.lessSpecialistHelper(frame, PlKernelKb.SGT_PL_KERNEL_KB_l, (proposition.arguments.theArray)[1], (proposition.arguments.theArray)[0]));
            }
            else if (relation == PlKernelKb.SGT_PL_KERNEL_KB_g) {
              return (PlKernelKb.lessSpecialistHelper(frame, PlKernelKb.SGT_PL_KERNEL_KB_el, (proposition.arguments.theArray)[0], (proposition.arguments.theArray)[1]));
            }
            else if (relation == Logic.SGT_PL_KERNEL_KB_ge) {
              return (PlKernelKb.lessSpecialistHelper(frame, PlKernelKb.SGT_PL_KERNEL_KB_l, (proposition.arguments.theArray)[0], (proposition.arguments.theArray)[1]));
            }
            else {
              { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

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

          } finally {
            Logic.$REVERSEPOLARITYp$.set(old$ReversepolarityP$000);
          }
        }
      }
      else {
        if (relation == PlKernelKb.SGT_PL_KERNEL_KB_l) {
          return (PlKernelKb.lessSpecialistHelper(frame, PlKernelKb.SGT_PL_KERNEL_KB_l, (proposition.arguments.theArray)[0], (proposition.arguments.theArray)[1]));
        }
        else if (relation == PlKernelKb.SGT_PL_KERNEL_KB_el) {
          return (PlKernelKb.lessSpecialistHelper(frame, PlKernelKb.SGT_PL_KERNEL_KB_el, (proposition.arguments.theArray)[0], (proposition.arguments.theArray)[1]));
        }
        else if (relation == PlKernelKb.SGT_PL_KERNEL_KB_g) {
          return (PlKernelKb.lessSpecialistHelper(frame, PlKernelKb.SGT_PL_KERNEL_KB_l, (proposition.arguments.theArray)[1], (proposition.arguments.theArray)[0]));
        }
        else if (relation == Logic.SGT_PL_KERNEL_KB_ge) {
          return (PlKernelKb.lessSpecialistHelper(frame, PlKernelKb.SGT_PL_KERNEL_KB_el, (proposition.arguments.theArray)[1], (proposition.arguments.theArray)[0]));
        }
        else {
          { OutputStringStream stream001 = OutputStringStream.newOutputStringStream();

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