public static LogicObject chooseBestDownclassifiedParent(Cons parents) {
    if (parents == Stella.NIL) {
      return (null);
    }
    { Cons downclassifiedparents = Stella.NIL;
      LogicObject bestparent = null;

      { LogicObject p = null;
        Cons iter000 = parents;
        Cons collect000 = null;

        for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) {
          p = ((LogicObject)(iter000.value));
          if (LogicObject.downclassifiedP(p)) {
            {
            }
            if (collect000 == null) {
              {
                collect000 = Cons.cons(p, Stella.NIL);
                if (downclassifiedparents == Stella.NIL) {
                  downclassifiedparents = collect000;
                }
                else {
                  Cons.addConsToEndOfConsList(downclassifiedparents, collect000);
                }
              }
            }
            else {
              {
                collect000.rest = Cons.cons(p, Stella.NIL);
                collect000 = collect000.rest;
              }
            }
          }
        }
      }
      switch (downclassifiedparents.length()) {
        case 0: 
          { Cons namedparents = Stella.NIL;

            { LogicObject p = null;
              Cons iter001 = parents;
              Cons collect001 = null;

              for (;!(iter001 == Stella.NIL); iter001 = iter001.rest) {
                p = ((LogicObject)(iter001.value));
                if (Description.namedDescriptionP(((Description)(p)))) {
                  if (collect001 == null) {
                    {
                      collect001 = Cons.cons(p, Stella.NIL);
                      if (namedparents == Stella.NIL) {
                        namedparents = collect001;
                      }
                      else {
                        Cons.addConsToEndOfConsList(namedparents, collect001);
                      }
                    }
                  }
                  else {
                    {
                      collect001.rest = Cons.cons(p, Stella.NIL);
                      collect001 = collect001.rest;
                    }
                  }
                }
              }
            }
            if (!(namedparents == Stella.NIL)) {
              bestparent = Logic.collectionWithFewestChildren(namedparents);
            }
            if (bestparent == null) {
              bestparent = Logic.collectionWithFewestChildren(parents);
            }
            LogicObject.downclassifyOneDescription(bestparent);
          }
        break;
        case 1: 
          bestparent = ((LogicObject)(downclassifiedparents.value));
        break;
        default:
          bestparent = Logic.collectionWithFewestChildren(downclassifiedparents);
        break;
      }
      if ((Stella.$TRACED_KEYWORDS$ != null) &&
          Stella.$TRACED_KEYWORDS$.membP(Logic.KWD_CLASSIFIER)) {
        System.out.println("   BEST PARENT:   " + bestparent + "   ALL-PARENTS: " + parents);
      }
      return (bestparent);
    }
  }