public static Proposition substituteProposition(Proposition proposition, Proposition outprop, Proposition inprop) {
    if (proposition == outprop) {
      return (inprop);
    }
    { Stella_Object arg = null;
      Vector vector000 = proposition.arguments;
      int index000 = 0;
      int length000 = vector000.length();
      int i = Stella.NULL_INTEGER;
      int iter000 = 0;

      for (;index000 < length000; index000 = index000 + 1, iter000 = iter000 + 1) {
        arg = (vector000.theArray)[index000];
        i = iter000;
        if (arg == outprop) {
          (proposition.arguments.theArray)[i] = inprop;
        }
        else if (Stella_Object.isaP(arg, Logic.SGT_LOGIC_PROPOSITION)) {
          Proposition.substituteProposition(((Proposition)(arg)), outprop, inprop);
        }
      }
    }
    return (proposition);
  }