public static void collectClosedGoals(List goals, List goalsequence) {
    { Proposition g = null;
      Cons iter000 = goals.theConsList;

      for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) {
        g = ((Proposition)(iter000.value));
        if (Proposition.allArgumentsBoundP(g) &&
            (!goalsequence.memberP(g))) {
          goalsequence.push(g);
        }
      }
    }
  }