亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? engine.c

?? clips源代碼
?? C
?? 第 1 頁 / 共 3 頁
字號:
   /*******************************************************/   /*      "C" Language Integrated Production System      */   /*                                                     */   /*             CLIPS Version 6.30  10/19/06            */   /*                                                     */   /*                    ENGINE MODULE                    */   /*******************************************************//*************************************************************//* Purpose: Provides functionality primarily associated with *//*   the run and focus commands.                             *//*                                                           *//* Principal Programmer(s):                                  *//*      Gary D. Riley                                        *//*                                                           *//* Contributing Programmer(s):                               *//*      Bebe Ly                                              *//*      Brian L. Donnell                                     *//*                                                           *//* Revision History:                                         *//*      6.23: Correction for FalseSymbol/TrueSymbol. DR0859  *//*                                                           *//*            Corrected compilation errors for files         *//*            generated by constructs-to-c. DR0861           *//*                                                           *//*      6.24: Removed DYNAMIC_SALIENCE, INCREMENTAL_RESET,   *//*            and LOGICAL_DEPENDENCIES compilation flags.    *//*                                                           *//*            Renamed BOOLEAN macro type to intBool.         *//*                                                           *//*            Added access functions to the HaltRules flag.  *//*                                                           *//*            Added EnvGetNextFocus, EnvGetFocusChanged, and *//*            EnvSetFocusChanged functions.                  *//*                                                           *//*      6.30: Added additional developer statistics to help  *//*            analyze join network performance.              *//*                                                           *//*            Removed pseudo-facts used in not CEs.          *//*                                                           *//*************************************************************/#define _ENGINE_SOURCE_#include <stdio.h>#define _STDIO_INCLUDED_#include <string.h>#include "setup.h"#if DEFRULE_CONSTRUCT#include "agenda.h"#include "argacces.h"#include "constant.h"#include "envrnmnt.h"#include "factmngr.h"#include "inscom.h"#include "memalloc.h"#include "modulutl.h"#include "prccode.h"#include "prcdrfun.h"#include "proflfun.h"#include "reteutil.h"#include "retract.h"#include "router.h"#include "ruledlt.h"#include "sysdep.h"#include "utility.h"#include "watch.h"#include "engine.h"/***************************************//* LOCAL INTERNAL FUNCTION DEFINITIONS *//***************************************/   static struct activation      *NextActivationToFire(void *);   static struct defmodule       *RemoveFocus(void *,struct defmodule *);   static void                    DeallocateEngineData(void *);/*****************************************************************************//* InitializeEngine: Initializes the activations and statistics watch items. *//*****************************************************************************/globle void InitializeEngine(  void *theEnv)  {      AllocateEnvironmentData(theEnv,ENGINE_DATA,sizeof(struct engineData),DeallocateEngineData);   EngineData(theEnv)->IncrementalResetFlag = TRUE;   #if DEBUGGING_FUNCTIONS   AddWatchItem(theEnv,"statistics",0,&EngineData(theEnv)->WatchStatistics,20,NULL,NULL);   AddWatchItem(theEnv,"focus",0,&EngineData(theEnv)->WatchFocus,0,NULL,NULL);#endif  }  /*************************************************//* DeallocateEngineData: Deallocates environment *//*    data for engine functionality.             *//*************************************************/static void DeallocateEngineData(  void *theEnv)  {   struct focus *tmpPtr, *nextPtr;      DeallocateCallList(theEnv,EngineData(theEnv)->ListOfRunFunctions);   tmpPtr = EngineData(theEnv)->CurrentFocus;   while (tmpPtr != NULL)     {      nextPtr = tmpPtr->next;      rtn_struct(theEnv,focus,tmpPtr);      tmpPtr = nextPtr;     }  }/*************************************************//* EnvRun: C access routine for the run command. *//*************************************************/globle long long EnvRun(  void *theEnv,  long long runLimit)  {   long long rulesFired = 0;   DATA_OBJECT result;   struct callFunctionItem *theRunFunction;#if DEBUGGING_FUNCTIONS   unsigned long maxActivations = 0, sumActivations = 0;#if DEFTEMPLATE_CONSTRUCT   unsigned long maxFacts = 0, sumFacts = 0;#endif#if OBJECT_SYSTEM   unsigned long maxInstances = 0, sumInstances = 0;#endif   double endTime, startTime = 0.0;   unsigned long tempValue;#endif   unsigned short i;   struct patternEntity *theMatchingItem;   struct partialMatch *theBasis;   ACTIVATION *theActivation;   char *ruleFiring;#if PROFILING_FUNCTIONS   struct profileFrameInfo profileFrame;#endif   struct trackedMemory *theTM;   /*=====================================================*/   /* Make sure the run command is not already executing. */   /*=====================================================*/   if (EngineData(theEnv)->AlreadyRunning) return(0);   EngineData(theEnv)->AlreadyRunning = TRUE;   /*================================*/   /* Set up statistics information. */   /*================================*/#if DEBUGGING_FUNCTIONS   if (EngineData(theEnv)->WatchStatistics)     {#if DEFTEMPLATE_CONSTRUCT      maxFacts = GetNumberOfFacts(theEnv);      sumFacts = maxFacts;#endif#if OBJECT_SYSTEM      maxInstances = GetGlobalNumberOfInstances(theEnv);      sumInstances = maxInstances;#endif      maxActivations = GetNumberOfActivations(theEnv);      sumActivations = maxActivations;      startTime = gentime();     }#endif   /*=============================*/   /* Set up execution variables. */   /*=============================*/   if (EvaluationData(theEnv)->CurrentEvaluationDepth == 0) SetHaltExecution(theEnv,FALSE);   EngineData(theEnv)->HaltRules = FALSE;#if DEVELOPER   EngineData(theEnv)->leftToRightComparisons = 0;   EngineData(theEnv)->rightToLeftComparisons = 0;   EngineData(theEnv)->leftToRightSucceeds = 0;   EngineData(theEnv)->rightToLeftSucceeds = 0;   EngineData(theEnv)->leftToRightLoops = 0;   EngineData(theEnv)->rightToLeftLoops = 0;   EngineData(theEnv)->findNextConflictingComparisons = 0;   EngineData(theEnv)->betaHashListSkips = 0;   EngineData(theEnv)->betaHashHTSkips = 0;   EngineData(theEnv)->unneededMarkerCompare = 0;#endif   /*=====================================================*/   /* Fire rules until the agenda is empty, the run limit */   /* has been reached, or a rule execution error occurs. */   /*=====================================================*/   theActivation = NextActivationToFire(theEnv);   while ((theActivation != NULL) &&          (runLimit != 0) &&          (EvaluationData(theEnv)->HaltExecution == FALSE) &&          (EngineData(theEnv)->HaltRules == FALSE))     {      /*===========================================*/      /* Detach the activation from the agenda and */      /* determine which rule is firing.           */      /*===========================================*/      DetachActivation(theEnv,theActivation);      theTM = AddTrackedMemory(theEnv,theActivation,sizeof(struct activation));      ruleFiring = EnvGetActivationName(theEnv,theActivation);      theBasis = (struct partialMatch *) GetActivationBasis(theActivation);      EngineData(theEnv)->ExecutingRule = (struct defrule *) GetActivationRule(theActivation);      /*=============================================*/      /* Update the number of rules that have fired. */      /*=============================================*/      rulesFired++;      if (runLimit > 0) { runLimit--; }      /*==================================*/      /* If rules are being watched, then */      /* print an information message.    */      /*==================================*/#if DEBUGGING_FUNCTIONS      if (EngineData(theEnv)->ExecutingRule->watchFiring)        {         char printSpace[60];         gensprintf(printSpace,"FIRE %4lld ",rulesFired);         EnvPrintRouter(theEnv,WTRACE,printSpace);         EnvPrintRouter(theEnv,WTRACE,ruleFiring);         EnvPrintRouter(theEnv,WTRACE,": ");         PrintPartialMatch(theEnv,WTRACE,theBasis);         EnvPrintRouter(theEnv,WTRACE,"\n");        }#endif      /*=================================================*/      /* Remove the link between the activation and the  */      /* completed match for the rule. Set the busy flag */      /* for the completed match to TRUE (so the match   */      /* upon which our RHS variables are dependent is   */      /* not deleted while our rule is firing). Set up   */      /* the global pointers to the completed match for  */      /* routines which do variable extractions.         */      /*=================================================*/      theBasis->marker = NULL;      theBasis->busy = TRUE;      EngineData(theEnv)->GlobalLHSBinds = theBasis;      EngineData(theEnv)->GlobalRHSBinds = NULL;      /*===================================================================*/      /* Increment the count for each of the facts/objects associated with */      /* the rule activation so that the facts/objects cannot be deleted   */      /* by garbage collection while the rule is executing.                */      /*===================================================================*/      for (i = 0; i < theBasis->bcount; i++)        {         if (theBasis->binds[i].gm.theMatch == NULL) continue;         theMatchingItem = theBasis->binds[i].gm.theMatch->matchingItem;         if (theMatchingItem != NULL)           { (*theMatchingItem->theInfo->incrementBasisCount)(theEnv,theMatchingItem); }        }      /*====================================================*/      /* Execute the rule's right hand side actions. If the */      /* rule has logical CEs, set up the pointer to the    */      /* rules logical join so the assert command will      */      /* attach the appropriate dependencies to the facts.  */      /*====================================================*/      EngineData(theEnv)->TheLogicalJoin = EngineData(theEnv)->ExecutingRule->logicalJoin;      EvaluationData(theEnv)->CurrentEvaluationDepth++;      SetEvaluationError(theEnv,FALSE);      EngineData(theEnv)->ExecutingRule->executing = TRUE;#if PROFILING_FUNCTIONS      StartProfile(theEnv,&profileFrame,                   &EngineData(theEnv)->ExecutingRule->header.usrData,                   ProfileFunctionData(theEnv)->ProfileConstructs);#endif      EvaluateProcActions(theEnv,EngineData(theEnv)->ExecutingRule->header.whichModule->theModule,                          EngineData(theEnv)->ExecutingRule->actions,EngineData(theEnv)->ExecutingRule->localVarCnt,                          &result,NULL);#if PROFILING_FUNCTIONS      EndProfile(theEnv,&profileFrame);#endif      EngineData(theEnv)->ExecutingRule->executing = FALSE;      SetEvaluationError(theEnv,FALSE);      EvaluationData(theEnv)->CurrentEvaluationDepth--;      EngineData(theEnv)->TheLogicalJoin = NULL;      /*=====================================================*/      /* If rule execution was halted, then print a message. */      /*=====================================================*/#if DEBUGGING_FUNCTIONS      if ((EvaluationData(theEnv)->HaltExecution) || (EngineData(theEnv)->HaltRules && EngineData(theEnv)->ExecutingRule->watchFiring))#else      if ((EvaluationData(theEnv)->HaltExecution) || (EngineData(theEnv)->HaltRules))#endif        {         PrintErrorID(theEnv,"PRCCODE",4,FALSE);         EnvPrintRouter(theEnv,WERROR,"Execution halted during the actions of defrule ");         EnvPrintRouter(theEnv,WERROR,ruleFiring);         EnvPrintRouter(theEnv,WERROR,".\n");        }      /*===================================================*/      /* Decrement the count for each of the facts/objects */      /* associated with the rule activation.              */      /*===================================================*/      theBasis->busy = FALSE;      for (i = 0; i < (theBasis->bcount); i++)        {         if (theBasis->binds[i].gm.theMatch == NULL) continue;         theMatchingItem = theBasis->binds[i].gm.theMatch->matchingItem;         if (theMatchingItem != NULL)           { (*theMatchingItem->theInfo->decrementBasisCount)(theEnv,theMatchingItem); }        }      /*========================================*/      /* Return the agenda node to free memory. */      /*========================================*/      RemoveTrackedMemory(theEnv,theTM);      RemoveActivation(theEnv,theActivation,FALSE,FALSE);      /*======================================*/      /* Get rid of partial matches discarded */      /* while executing the rule's RHS.      */      /*======================================*/      FlushGarbagePartialMatches(theEnv);      /*==================================*/      /* Get rid of other garbage created */      /* while executing the rule's RHS.  */      /*==================================*/      PeriodicCleanup(theEnv,FALSE,TRUE);      /*==========================*/      /* Keep up with statistics. */      /*==========================*/#if DEBUGGING_FUNCTIONS      if (EngineData(theEnv)->WatchStatistics)        {#if DEFTEMPLATE_CONSTRUCT         tempValue = GetNumberOfFacts(theEnv);         if (tempValue > maxFacts) maxFacts = tempValue;         sumFacts += tempValue;#endif#if OBJECT_SYSTEM         tempValue = GetGlobalNumberOfInstances(theEnv);         if (tempValue > maxInstances) maxInstances = tempValue;         sumInstances += tempValue;#endif         tempValue = GetNumberOfActivations(theEnv);         if (tempValue > maxActivations) maxActivations = tempValue;         sumActivations += tempValue;        }#endif      /*==================================*/      /* Update saliences if appropriate. */      /*==================================*/      if (EnvGetSalienceEvaluation(theEnv) == EVERY_CYCLE) EnvRefreshAgenda(theEnv,NULL);      /*========================================*/      /* Execute the list of functions that are */      /* to be called after each rule firing.   */      /*========================================*/      for (theRunFunction = EngineData(theEnv)->ListOfRunFunctions;           theRunFunction != NULL;           theRunFunction = theRunFunction->next)        {          if (theRunFunction->environmentAware)           { (*theRunFunction->func)(theEnv); }         else                       { ((void (*)(void))(*theRunFunction->func))(); }        }      /*========================================*/      /* If a return was issued on the RHS of a */      /* rule, then remove *that* rule's module */      /* from the focus stack                   */      /*========================================*/      if (ProcedureFunctionData(theEnv)->ReturnFlag == TRUE)        { RemoveFocus(theEnv,EngineData(theEnv)->ExecutingRule->header.whichModule->theModule); }      ProcedureFunctionData(theEnv)->ReturnFlag = FALSE;      /*========================================*/      /* Determine the next activation to fire. */      /*========================================*/      theActivation = (struct activation *) NextActivationToFire(theEnv);      /*==============================*/      /* Check for a rule breakpoint. */      /*==============================*/      if (theActivation != NULL)        {         if (((struct defrule *) GetActivationRule(theActivation))->afterBreakpoint)           {            EngineData(theEnv)->HaltRules = TRUE;            EnvPrintRouter(theEnv,WDIALOG,"Breaking on rule ");            EnvPrintRouter(theEnv,WDIALOG,EnvGetActivationName(theEnv,theActivation));            EnvPrintRouter(theEnv,WDIALOG,".\n");           }        }     }   /*=====================================================*/   /* Make sure run functions are executed at least once. */   /*=====================================================*/   if (rulesFired == 0)     {      for (theRunFunction = EngineData(theEnv)->ListOfRunFunctions;           theRunFunction != NULL;           theRunFunction = theRunFunction->next)        {          if (theRunFunction->environmentAware)           { (*theRunFunction->func)(theEnv); }         else                       { ((void (*)(void))(*theRunFunction->func))(); }        }     }

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久综合一区二区| 91国内精品野花午夜精品| 中文字幕精品在线不卡| 欧美三级日韩三级| 国产精品69毛片高清亚洲| 亚洲va欧美va国产va天堂影院| 中文字幕一区二区三区在线播放| 成人av片在线观看| 久久精工是国产品牌吗| 亚洲综合色视频| 国产精品妹子av| 欧美r级电影在线观看| 欧美喷水一区二区| 日本乱人伦aⅴ精品| 成人在线视频一区二区| 久久噜噜亚洲综合| 一区二区三区在线免费| 国产人妖乱国产精品人妖| 日韩一区二区三区视频在线| 在线精品亚洲一区二区不卡| 成人激情av网| 国产成人自拍网| 久久一区二区三区四区| 91精品视频网| 欧美日韩一区二区不卡| 色激情天天射综合网| 91论坛在线播放| 成人爱爱电影网址| 国产99一区视频免费| 激情文学综合网| 久久99蜜桃精品| 麻豆成人免费电影| 麻豆久久一区二区| 蜜臀99久久精品久久久久久软件| 天天色综合成人网| 一本色道**综合亚洲精品蜜桃冫 | 欧美三级中文字幕| 色婷婷亚洲精品| 99精品国产视频| 91免费国产在线观看| 91美女福利视频| 色欧美日韩亚洲| 在线观看亚洲一区| 欧美日韩一区 二区 三区 久久精品| 91啪亚洲精品| 在线视频一区二区三| 欧美日精品一区视频| 在线播放中文一区| 中文字幕精品三区| 欧美一级日韩免费不卡| 日韩欧美一区在线| 成年人午夜久久久| 99国产精品久久久久久久久久久| 99这里只有精品| 色婷婷综合久久久| 欧美日韩国产不卡| 91精品国产入口| www国产成人免费观看视频 深夜成人网| 2024国产精品| 国产精品女主播在线观看| 亚洲免费观看高清在线观看| 亚洲国产一区二区a毛片| 五月天国产精品| 欧美日韩免费观看一区三区| 国产69精品久久久久777| 97se亚洲国产综合在线| 欧美三级在线播放| 欧美tickling挠脚心丨vk| 中文字幕第一区综合| 一区二区三区在线视频免费| 日韩高清中文字幕一区| 国产一区二区三区久久久| 成人h动漫精品一区二| 欧美日韩不卡视频| 久久久影院官网| 一区二区三区中文在线| 精品一区二区三区视频| 91麻豆精品一区二区三区| 67194成人在线观看| 国产亚洲人成网站| 亚洲444eee在线观看| 国产在线播放一区| 日本视频一区二区三区| 国产91清纯白嫩初高中在线观看 | 国产午夜亚洲精品午夜鲁丝片| 欧美激情一区二区三区在线| 亚洲国产精品久久人人爱蜜臀| 精品制服美女丁香| 不卡的av电影在线观看| 91精品国产综合久久精品性色| 久久久久久久综合日本| 亚洲电影在线播放| 国产乱子轮精品视频| 欧洲亚洲国产日韩| 日韩激情在线观看| 美女一区二区在线观看| 97久久精品人人爽人人爽蜜臀 | 精品国产91久久久久久久妲己 | 99国产精品视频免费观看| 精品国产成人系列| 亚洲国产精品久久一线不卡| 成人av免费网站| 欧美岛国在线观看| 亚洲午夜精品在线| 99国产精品久久久久久久久久 | 69堂成人精品免费视频| 亚洲人成影院在线观看| 国产一区二区剧情av在线| 欧美电影在哪看比较好| 亚洲乱码国产乱码精品精小说| 国产一区美女在线| 91精品国产色综合久久| 在线亚洲人成电影网站色www| 91免费看片在线观看| 中文字幕不卡三区| 国产在线精品一区二区不卡了| 欧美蜜桃一区二区三区| 亚洲视频在线一区观看| 欧美va亚洲va| 国产精品日产欧美久久久久| 精品一区二区三区免费毛片爱| 欧美美女黄视频| 亚洲一区av在线| 91麻豆精东视频| 日韩毛片一二三区| 91视频www| 亚洲欧美在线观看| 99久久精品国产一区| 国产精品视频第一区| 成人一区二区视频| 中文在线资源观看网站视频免费不卡| 精品一区二区三区蜜桃| 26uuu成人网一区二区三区| 美国欧美日韩国产在线播放| 欧美成人猛片aaaaaaa| 免费日韩伦理电影| 日韩欧美亚洲国产精品字幕久久久 | 欧美www视频| 蜜桃视频一区二区| 制服丝袜日韩国产| 麻豆精品一二三| 日韩精品专区在线影院观看| 喷水一区二区三区| 精品入口麻豆88视频| 国内精品久久久久影院一蜜桃| 欧美成人一区二区三区| 激情综合色丁香一区二区| 欧美精品一区二区三区四区 | 成人免费视频网站在线观看| 国产乱码精品一品二品| 国产精品网曝门| 97精品久久久午夜一区二区三区| 国产精品欧美精品| 欧美亚洲丝袜传媒另类| 午夜欧美大尺度福利影院在线看| 777午夜精品免费视频| 精品亚洲aⅴ乱码一区二区三区| 久久奇米777| 一本久久精品一区二区| 日日骚欧美日韩| 精品88久久久久88久久久| 国产成人免费视频网站高清观看视频 | 国产日韩亚洲欧美综合| aaa国产一区| 五月综合激情婷婷六月色窝| 精品国产制服丝袜高跟| 成人开心网精品视频| 亚洲国产日韩a在线播放性色| 91精品国产欧美一区二区18| 国产精品欧美一级免费| 欧美日韩高清在线| 国产精品自拍在线| 亚洲黄色性网站| 日韩精品一区在线| 91小视频在线观看| 免费人成在线不卡| 亚洲欧美另类小说| 日韩女优毛片在线| 色网综合在线观看| 老司机精品视频线观看86| 亚洲欧洲日本在线| 日韩亚洲欧美中文三级| 91小视频在线免费看| 久久www免费人成看片高清| 亚洲三级免费观看| 亚洲欧美区自拍先锋| 日韩欧美不卡在线观看视频| 91玉足脚交白嫩脚丫在线播放| 日韩av网站在线观看| 亚洲视频在线观看一区| 久久午夜国产精品| 欧美性三三影院| 成人av网站免费观看| 精品制服美女久久| 三级欧美在线一区| 亚洲色图清纯唯美| 久久久久久久久久久久久女国产乱 | 成人综合在线视频| 日韩高清在线电影| 曰韩精品一区二区|