public static void deriveComplexForwardRule(Proposition goal, Proposition masterforall) {
    { Description goaldescription = ((goal.kind == Logic.KWD_NOT) ? NamedDescription.getComplementOfGoalDescription(Logic.surrogateToDescription(((Surrogate)(((Proposition)((goal.arguments.theArray)[0])).operator)))) : Logic.surrogateToDescription(((Surrogate)(goal.operator))));
      ForwardChainingIndex duplicate = null;

      { ForwardChainingIndex idx = null;
        Cons iter000 = goaldescription.forwardChainingIndices().removeDeletedMembers().theConsList;

        for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) {
          idx = ((ForwardChainingIndex)(iter000.value));
          if (goal == idx.forwardGoal) {
            duplicate = idx;
          }
        }
      }
      if (duplicate != null) {
        goaldescription.forwardChainingIndices().remove(duplicate);
      }
      if (goaldescription.forwardChainingIndices() == Stella.NIL_LIST) {
        KeyValueList.setDynamicSlotValue(goaldescription.dynamicSlots, Logic.SYM_LOGIC_FORWARD_CHAINING_INDICES, List.list(Stella.NIL), null);
      }
      goaldescription.forwardChainingIndices().insert(Proposition.createForwardChainingIndex(goal, masterforall));
    }
  }