public static void recordForwardGoal(Proposition forwardrule, Vector arguments, Proposition consequentproposition) {
    { ForwardGoalRecord fwdgoalrec = null;
      Cons iter000 = consequentproposition.forwardChainingGoals().theConsList;

      for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) {
        fwdgoalrec = ((ForwardGoalRecord)(iter000.value));
        if (!fwdgoalrec.deletedP()) {
          { Proposition fwdgoal = fwdgoalrec.forwardGoal;

            { boolean testValue000 = false;

              testValue000 = fwdgoalrec.forwardRule == forwardrule;
              if (testValue000) {
                { boolean alwaysP000 = true;

                  { Stella_Object arg = null;
                    Vector vector000 = arguments;
                    int index000 = 0;
                    int length000 = vector000.length();
                    int i = Stella.NULL_INTEGER;
                    int iter001 = 1;

                    loop001 : for (;index000 < length000; index000 = index000 + 1, iter001 = iter001 + 1) {
                      arg = (vector000.theArray)[index000];
                      i = iter001;
                      if (!Stella_Object.eqlP((fwdgoal.arguments.theArray)[i], arg)) {
                        alwaysP000 = false;
                        break loop001;
                      }
                    }
                  }
                  testValue000 = alwaysP000;
                }
              }
              if (testValue000) {
                return;
              }
            }
          }
        }
      }
    }
    if (Proposition.elaborationRuleP(consequentproposition, forwardrule, arguments)) {
      return;
    }
    { Proposition forwardgoal = Logic.createProposition(Logic.SYM_STELLA_PREDICATE, arguments.length() + 1);

      { ForwardGoalRecord self000 = ForwardGoalRecord.newForwardGoalRecord();

        self000.forwardGoal = forwardgoal;
        self000.forwardRule = forwardrule;
        { ForwardGoalRecord fwdgoalrec = self000;

          forwardgoal.operator = Logic.SGT_PL_KERNEL_KB_HOLDS;
          (forwardgoal.arguments.theArray)[0] = ((forwardrule.arguments.theArray)[0]);
          { Stella_Object arg = null;
            Vector vector001 = arguments;
            int index001 = 0;
            int length001 = vector001.length();
            int i = Stella.NULL_INTEGER;
            int iter002 = 1;

            for (;index001 < length001; index001 = index001 + 1, iter002 = iter002 + 1) {
              arg = (vector001.theArray)[index001];
              i = iter002;
              (forwardgoal.arguments.theArray)[i] = arg;
            }
          }
          if (consequentproposition.forwardChainingGoals().emptyP()) {
            KeyValueList.setDynamicSlotValue(consequentproposition.dynamicSlots, Logic.SYM_LOGIC_FORWARD_CHAINING_GOALS, List.list(Cons.cons(fwdgoalrec, Stella.NIL)), null);
          }
          else {
            consequentproposition.forwardChainingGoals().insertNew(fwdgoalrec);
          }
        }
      }
    }
  }