public static Cons kifImpliesToOrNot(Cons tree) {
    if (tree.length() < 2) {
      { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

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

          try {
            Native.setBooleanSpecial(Stella.$PRINTREADABLYp$, true);
            stream000.nativeStream.println("PARSING ERROR: Illegal implication tree: `" + tree + "'.");
            Logic.helpSignalPropositionError(stream000, Logic.KWD_ERROR);

          } finally {
            Stella.$PRINTREADABLYp$.set(old$PrintreadablyP$000);
          }
        }
        throw ((ParsingError)(ParsingError.newParsingError(stream000.theStringReader()).fillInStackTrace()));
      }
    }
    if (((GeneralizedSymbol)(tree.value)) == Logic.SYM_STELLA_le) {
      tree.rest = tree.rest.reverse();
    }
    else {
    }
    Logic.changeKifExpressionsToStellaExpressions(tree.rest, false);
    tree.firstSetter(Logic.SYM_STELLA_OR);
    switch (tree.length()) {
      case 2: 
        return (((Cons)(tree.rest.value)));
      case 3: 
        tree.secondSetter(Logic.kifInvertSentence(tree.rest.value));
        return (tree);
      default:
        tree.rest = tree.rest.reverse();
        tree.rest.rest = Cons.cons(Cons.cons(Logic.SYM_STELLA_AND, tree.rest.rest.reverse().concatenate(Stella.NIL, Stella.NIL)), Stella.NIL);
        tree.rest = tree.rest.reverse();
        tree.secondSetter(Logic.kifInvertSentence(tree.rest.value));
        return (tree);
    }
  }