示例#1
0
文件: incrrset.c 项目: atrniv/CLIPS
static void MarkJoinsForIncrementalReset(
  void *theEnv,
  EXEC_STATUS,
  struct joinNode *joinPtr,
  int value)
  {
   struct patternNodeHeader *patternPtr;

   for (;
        joinPtr != NULL;
        joinPtr = joinPtr->lastLevel)
     {
      if (joinPtr->ruleToActivate != NULL)
        { 
         joinPtr->marked = FALSE;
         joinPtr->initialize = value;
         continue; 
        }
        
      if (joinPtr->joinFromTheRight)
        { MarkJoinsForIncrementalReset(theEnv,execStatus,(struct joinNode *) joinPtr->rightSideEntryStructure,value); }

      /*================*/
      /* Mark the join. */
      /*================*/

      joinPtr->marked = FALSE; /* GDR 6.05 */
        
      if (joinPtr->initialize) 
        {
         joinPtr->initialize = value;
         if (joinPtr->joinFromTheRight == FALSE)
           {
            patternPtr = (struct patternNodeHeader *) GetPatternForJoin(joinPtr);
            if (patternPtr != NULL)
              { MarkPatternForIncrementalReset(theEnv,execStatus,(int) joinPtr->rhsType,patternPtr,value); }
           }
        }
     }
  }
static void MarkNetworkForIncrementalReset(
  void *theEnv,
  struct defrule *tempRule,
  int value)
  {
   struct joinNode *joinPtr;
   struct patternNodeHeader *patternPtr;

   /*============================================*/
   /* Loop through each of the rule's disjuncts. */
   /*============================================*/

   for (;
        tempRule != NULL;
        tempRule = tempRule->disjunct)
     {
      /*============================================*/
      /* Loop through each of the disjunct's joins. */
      /*============================================*/

      for (joinPtr = tempRule->lastJoin;
           joinPtr != NULL;
           joinPtr = GetPreviousJoin(joinPtr))
        {
         /*================*/
         /* Mark the join. */
         /*================*/

         joinPtr->marked = FALSE; /* GDR 6.05 */
         if ((joinPtr->initialize) && (joinPtr->joinFromTheRight == FALSE))
           {
            joinPtr->initialize = value;
            patternPtr = (struct patternNodeHeader *) GetPatternForJoin(joinPtr);
            MarkPatternForIncrementalReset(theEnv,(int) joinPtr->rhsType,patternPtr,value);
           }
        }
     }
  }