public static Stella_Object kifSentenceToUntypedStellaSentence(Stella_Object tree) {
    if (tree == null) {
      return (null);
    }
    { Surrogate testValue000 = Stella_Object.safePrimaryType(tree);

      if (testValue000 == Logic.SGT_STELLA_CONS) {
        { Cons tree000 = ((Cons)(tree));

          { Stella_Object operator = tree000.value;

            if (Stella_Object.isaP(operator, Logic.SGT_STELLA_CONS)) {
              return (Logic.kifPredicationToStellaPredication(Cons.cons(Logic.SYM_PL_KERNEL_KB_HOLDS, tree000.concatenate(Stella.NIL, Stella.NIL))));
            }
            if (!Stella_Object.symbolP(operator)) {
              { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

                { Object old$PrintreadablyP$000 = Stella.$PRINTREADABLYp$.get();

                  try {
                    Native.setBooleanSpecial(Stella.$PRINTREADABLYp$, true);
                    {
                      stream000.nativeStream.println("PARSING ERROR: Bad first argument in KIF sentence: `" + operator + "'");
                      stream000.nativeStream.println("   Operator must be a symbol or an expression.");
                    }
;
                    Logic.helpSignalPropositionError(stream000, Logic.KWD_ERROR);

                  } finally {
                    Stella.$PRINTREADABLYp$.set(old$PrintreadablyP$000);
                  }
                }
                throw ((ParsingError)(ParsingError.newParsingError(stream000.theStringReader()).fillInStackTrace()));
              }
            }
            { GeneralizedSymbol testValue001 = ((GeneralizedSymbol)(operator));

              if ((testValue001 == Logic.SYM_STELLA_AND) ||
                  ((testValue001 == Logic.SYM_STELLA_OR) ||
                   ((testValue001 == Logic.SYM_STELLA_NOT) ||
                    (testValue001 == Logic.SYM_LOGIC_FAIL)))) {
                Logic.changeKifExpressionsToStellaExpressions(tree000.rest, false);
                return (tree000);
              }
              else if ((testValue001 == Logic.SYM_STELLA_eg) ||
                  (testValue001 == Logic.SYM_STELLA_le)) {
                return (Logic.kifImpliesToOrNot(tree000));
              }
              else if ((testValue001 == Logic.SYM_LOGIC_leg) ||
                  ((testValue001 == Logic.SYM_LOGIC_legg) ||
                   ((testValue001 == Logic.SYM_LOGIC_lleg) ||
                    ((testValue001 == Logic.SYM_LOGIC_llegg) ||
                     ((testValue001 == Logic.SYM_LOGIC_ltg) ||
                      ((testValue001 == Logic.SYM_LOGIC_ltgg) ||
                       ((testValue001 == Logic.SYM_LOGIC_lltg) ||
                        (testValue001 == Logic.SYM_LOGIC_lltgg)))))))) {
                return (Logic.kifSentenceToUntypedStellaSentence(Logic.kifBiconditionalToTwoImplies(tree000)));
              }
              else if (testValue001 == Logic.SYM_STELLA_EXISTS) {
                return (Logic.kifExistsToStellaExists(tree000));
              }
              else if (testValue001 == Logic.SYM_STELLA_FORALL) {
                return (Logic.kifForallToStellaForall(tree000));
              }
              else if (testValue001 == Logic.SYM_STELLA_e) {
                return (Logic.kifEqualityToStellaEquality(tree000));
              }
              else if (testValue001 == Logic.SYM_LOGIC_ABOUT) {
                tree000.secondSetter(Logic.kifSentenceToUntypedStellaSentence(tree000.rest.value));
                return (tree000);
              }
              else if ((testValue001 == Logic.KWD_ABOUT) ||
                  ((testValue001 == Logic.SYM_LOGIC_lle) ||
                   ((testValue001 == Logic.SYM_LOGIC_egg) ||
                    ((testValue001 == Logic.SYM_LOGIC_lt) ||
                     ((testValue001 == Logic.SYM_LOGIC_tg) ||
                      ((testValue001 == Logic.SYM_LOGIC_llt) ||
                       (testValue001 == Logic.SYM_LOGIC_tgg))))))) {
                return (Logic.kifSentenceToUntypedStellaSentence(Logic.canonicalizeAnnotation(tree000)));
              }
              else {
                return (Logic.kifPredicationToStellaPredication(tree000));
              }
            }
          }
        }
      }
      else if (Surrogate.subtypeOfSymbolP(testValue000)) {
        { Symbol tree000 = ((Symbol)(tree));

          return (Logic.kifSymbolToStellaSymbol(tree000));
        }
      }
      else if (Surrogate.subtypeOfStringP(testValue000)) {
        { StringWrapper tree000 = ((StringWrapper)(tree));

          { OutputStringStream stream001 = OutputStringStream.newOutputStringStream();

            { Object old$PrintreadablyP$001 = Stella.$PRINTREADABLYp$.get();

              try {
                Native.setBooleanSpecial(Stella.$PRINTREADABLYp$, true);
                stream001.nativeStream.println("PARSING ERROR: Illegal term in sentence position: `" + tree000 + "'.");
                Logic.helpSignalPropositionError(stream001, Logic.KWD_ERROR);

              } finally {
                Stella.$PRINTREADABLYp$.set(old$PrintreadablyP$001);
              }
            }
            throw ((ParsingError)(ParsingError.newParsingError(stream001.theStringReader()).fillInStackTrace()));
          }
        }
      }
      else {
        return (tree);
      }
    }
  }