public static void collectAllVariables(Proposition self, List collection, List beenthere) {
    beenthere.insert(self);
    { Stella_Object arg = null;
      Vector vector000 = self.arguments;
      int index000 = 0;
      int length000 = vector000.length();

      for (;index000 < length000; index000 = index000 + 1) {
        arg = (vector000.theArray)[index000];
        { Surrogate testValue000 = Stella_Object.safePrimaryType(arg);

          if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_PATTERN_VARIABLE)) {
            { PatternVariable arg000 = ((PatternVariable)(arg));

              collection.insertNew(arg000);
            }
          }
          else if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_PROPOSITION)) {
            { Proposition arg000 = ((Proposition)(arg));

              if (!(beenthere.memberP(arg000))) {
                Proposition.collectAllVariables(arg000, collection, beenthere);
              }
            }
          }
          else {
          }
        }
      }
    }
  }