public static Proposition buildPredicateProposition(Cons tree) {
    if ((tree.length() == 2) &&
        Logic.classOperatorP(((GeneralizedSymbol)(tree.value)))) {
      return (Logic.buildIsaProposition(Cons.list$(Cons.cons(Logic.SYM_STELLA_ISA, Cons.cons(tree.rest.value, Cons.cons(Cons.cons(tree.value, Stella.NIL), Stella.NIL))))));
    }
    if (Logic.holdsOperatorP(tree.value)) {
      return (Logic.buildHoldsProposition(tree));
    }
    { Stella_Object predicatename = tree.value;
      Proposition proposition = Logic.createProposition(Logic.SYM_STELLA_PREDICATE, tree.rest.length());
      Stella_Object firstargument = null;
      LogicObject predicatevalue = null;

      { Object [] caller_MV_returnarray = new Object[1];

        predicatevalue = Logic.evaluatePredicateAndFirstArgument(tree, caller_MV_returnarray);
        firstargument = ((Stella_Object)(caller_MV_returnarray[0]));
      }
      if (firstargument != null) {
        tree.secondSetter(firstargument);
        (proposition.arguments.theArray)[0] = firstargument;
      }
      if ((predicatevalue != null) &&
          Logic.functionP(predicatevalue)) {
        if (Logic.descriptionModeP()) {
          proposition.kind = Logic.KWD_FUNCTION;
        }
        else {
          { int lastargindex = tree.length() - 1;
            Stella_Object resultargument = Logic.evaluateTypedArgument(tree.nth(lastargindex), ((Surrogate)(((NamedDescription)(predicatevalue)).ioVariableTypes.last())));

            tree.nthSetter(null, lastargindex);
            tree = tree.remove(null);
            return (((Proposition)(Logic.buildProposition(Cons.list$(Cons.cons(Logic.SYM_STELLA_e, Cons.cons(tree, Cons.cons(Cons.cons(resultargument, Stella.NIL), Stella.NIL))))))));
          }
        }
      }
      { Stella_Object arg = null;
        Cons iter000 = LogicObject.evaluateRemainingArguments(predicatevalue, tree.rest.rest);
        int i = Stella.NULL_INTEGER;
        int iter001 = 1;

        for (;!(iter000 == Stella.NIL); iter000 = iter000.rest, iter001 = iter001 + 1) {
          arg = iter000.value;
          i = iter001;
          (proposition.arguments.theArray)[i] = arg;
        }
      }
      proposition.operator = ((predicatevalue != null) ? predicatevalue.surrogateValueInverse : ((GeneralizedSymbol)(predicatename)));
      if (proposition.operator == Logic.SGT_PL_KERNEL_KB_VALUE) {
        proposition = Proposition.normalizeValueFunction(proposition);
      }
      Proposition.verifyArgumentTypesAndCount(proposition);
      return (proposition);
    }
  }