public static Cons allEquivalentCollections(LogicObject self, boolean reflexiveP) {
    { Cons equivalents = Cons.consList(Cons.cons(self, Stella.NIL));
      List unscannedequivalents = List.list(Cons.cons(self, Stella.NIL));
      LogicObject u = null;

      if (LogicObject.allSupercollections(self).memberP(self)) {
        loop000 : for (;;) {
          u = ((LogicObject)(unscannedequivalents.pop()));
          { LogicObject parent = null;
            Iterator iter000 = LogicObject.allDirectSupercollections(u, false);

            while (iter000.nextP()) {
              parent = ((LogicObject)(iter000.value));
              if ((!equivalents.memberP(parent)) &&
                  LogicObject.allSupercollections(parent).memberP(u)) {
                equivalents = Cons.cons(parent, equivalents);
                unscannedequivalents.push(parent);
              }
            }
          }
          if (unscannedequivalents.emptyP()) {
            break loop000;
          }
        }
      }
      if (reflexiveP) {
        return (equivalents);
      }
      else {
        return (equivalents.remove(self));
      }
    }
  }