public static Keyword squareRootSpecialist(ControlFrame frame, Keyword lastmove) {
    { Proposition proposition = frame.proposition;
      Stella_Object mainarg = (proposition.arguments.theArray)[0];
      Stella_Object mainargvalue = Logic.argumentBoundTo(mainarg);
      Stella_Object rootarg = (proposition.arguments.theArray)[1];
      Stella_Object rootargvalue = Logic.argumentBoundTo(rootarg);
      Iterator iterator = ((Iterator)(KeyValueList.dynamicSlotValue(frame.dynamicSlots, Logic.SYM_STELLA_ITERATOR, null)));
      Cons collection = Stella.NIL;

      lastmove = lastmove;
      if (iterator == null) {
        if (mainargvalue == null) {
          if (rootargvalue == null) {
            return (Logic.KWD_TERMINAL_FAILURE);
          }
          else {
            if (Stella_Object.isaP(rootargvalue, Logic.SGT_STELLA_NUMBER_WRAPPER)) {
              if (((Boolean)(Logic.$REVERSEPOLARITYp$.get())).booleanValue()) {
                return (Logic.KWD_FAILURE);
              }
              else {
                return (Logic.selectProofResult(Logic.bindArgumentToValueP(mainarg, PlKernelKb.timesComputation(((NumberWrapper)(rootargvalue)), ((NumberWrapper)(rootargvalue))), true), false, true));
              }
            }
            else {
              return (Logic.KWD_TERMINAL_FAILURE);
            }
          }
        }
        else {
          if (Stella_Object.isaP(mainargvalue, Logic.SGT_STELLA_NUMBER_WRAPPER)) {
            if (PlKernelKb.arithmeticLessTest(((NumberWrapper)(mainargvalue)), IntegerWrapper.wrapInteger(0))) {
              return (Logic.KWD_TERMINAL_FAILURE);
            }
            else {
              if ((rootargvalue == null) &&
                  ((Boolean)(Logic.$REVERSEPOLARITYp$.get())).booleanValue()) {
                return (Logic.KWD_FAILURE);
              }
              else {
                { NumberWrapper sqrt = PlKernelKb.sqrtComputation(((NumberWrapper)(mainargvalue)));

                  collection = Cons.consList(Cons.cons(sqrt, Cons.cons(PlKernelKb.negateComputation(sqrt), Stella.NIL)));
                }
              }
            }
          }
          else {
            return (Logic.KWD_TERMINAL_FAILURE);
          }
        }
      }
      if (rootargvalue != null) {
        return (Logic.selectTestResult(PlKernelKb.arithmeticEqualTest(((NumberWrapper)(rootargvalue)), ((NumberWrapper)(collection.value))) ||
            PlKernelKb.arithmeticEqualTest(((NumberWrapper)(rootargvalue)), ((NumberWrapper)(collection.rest.value))), true, frame));
      }
      if (iterator == null) {
        iterator = collection.allocateIterator();
        KeyValueList.setDynamicSlotValue(frame.dynamicSlots, Logic.SYM_STELLA_ITERATOR, iterator, null);
      }
      if (iterator.nextP() &&
          Logic.bindArgumentToValueP(rootarg, iterator.value, true)) {
        return (Logic.KWD_CONTINUING_SUCCESS);
      }
      else {
        return (Logic.KWD_TERMINAL_FAILURE);
      }
    }
  }