public static Cons kifEqualityToStellaEquality(Cons tree) {
    if (tree.length() == 3) {
      { Cons functiontree = null;
        Stella_Object arg1 = tree.rest.value;
        Stella_Object arg2 = tree.rest.rest.value;

        { boolean testValue000 = false;

          { 
            functiontree = Logic.helpTransformKifFunction(arg1, arg2);
            testValue000 = functiontree != null;
          }
          if (!testValue000) {
            { 
              functiontree = Logic.helpTransformKifFunction(arg2, arg1);
              testValue000 = functiontree != null;
            }
          }
          if (testValue000) {
            if (Stella_Object.consP(functiontree.value)) {
              functiontree = Cons.cons(Logic.SYM_PL_KERNEL_KB_VALUE, functiontree);
            }
            functiontree.firstSetter(Logic.kifOperatorToInternalStella(((Symbol)(functiontree.value))));
            Logic.changeKifExpressionsToStellaExpressions(functiontree.rest, true);
            return (functiontree);
          }
        }
      }
    }
    Logic.changeKifExpressionsToStellaExpressions(tree.rest, true);
    return (tree);
  }