public static LogicObject collectionWithFewestChildren(Cons collections) {
    if (collections.rest == null) {
      return (((LogicObject)(collections.value)));
    }
    { LogicObject bestcollection = ((LogicObject)(collections.value));
      int lowestchildcount = 100;

      { LogicObject c = null;
        Cons iter000 = collections;

        for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) {
          c = ((LogicObject)(iter000.value));
          { int childcount = 0;

            { ConsIterator p = LogicObject.applicableRulesOfDescription(c, Logic.KWD_BACKWARD, true).allocateIterator();

              while (p.nextP()) {
                childcount = childcount + 1;
              }
            }
            if (childcount < lowestchildcount) {
              bestcollection = c;
              lowestchildcount = childcount;
            }
          }
        }
      }
      return (bestcollection);
    }
  }