diff options
Diffstat (limited to 'src/ruledef.h')
-rw-r--r-- | src/ruledef.h | 98 |
1 files changed, 71 insertions, 27 deletions
diff --git a/src/ruledef.h b/src/ruledef.h index 649cbc2..c138d3d 100644 --- a/src/ruledef.h +++ b/src/ruledef.h @@ -1,7 +1,7 @@ /*******************************************************/ /* "C" Language Integrated Production System */ /* */ - /* CLIPS Version 6.24 06/05/06 */ + /* CLIPS Version 6.30 01/25/15 */ /* */ /* DEFRULE HEADER FILE */ /*******************************************************/ @@ -15,15 +15,46 @@ /* Gary D. Riley */ /* */ /* Contributing Programmer(s): */ -/* Brian L. Donnell */ +/* Brian L. Dantes */ /* */ /* Revision History: */ /* */ /* 6.24: Removed DYNAMIC_SALIENCE and */ /* LOGICAL_DEPENDENCIES compilation flags. */ /* */ +/* Removed CONFLICT_RESOLUTION_STRATEGIES */ +/* compilation flag. */ +/* */ /* Renamed BOOLEAN macro type to intBool. */ /* */ +/* Corrected code to remove run-time program */ +/* compiler warnings. */ +/* */ +/* 6.30: Removed conditional code for unsupported */ +/* compilers/operating systems (IBM_MCW, */ +/* MAC_MCW, and IBM_TBC). */ +/* */ +/* Added support for hashed memories. */ +/* */ +/* Added additional developer statistics to help */ +/* analyze join network performance. */ +/* */ +/* Added salience groups to improve performance */ +/* with large numbers of activations of different */ +/* saliences. */ +/* */ +/* Added EnvGetDisjunctCount and */ +/* EnvGetNthDisjunct functions. */ +/* */ +/* Added const qualifiers to remove C++ */ +/* deprecation warnings. */ +/* */ +/* Converted API macros to function calls. */ +/* */ +/* Changed find construct functionality so that */ +/* imported modules are search when locating a */ +/* named construct. */ +/* */ /*************************************************************/ #ifndef _H_ruledef @@ -65,7 +96,6 @@ struct defruleModule; #include "network.h" #endif - struct defrule { struct constructHeader header; @@ -87,16 +117,26 @@ struct defrule struct defruleModule { struct defmoduleItemHeader header; + struct salienceGroup *groupings; struct activation *agenda; }; +#ifndef ALPHA_MEMORY_HASH_SIZE +#define ALPHA_MEMORY_HASH_SIZE 63559L +#endif + #define DEFRULE_DATA 16 struct defruleData - { + { struct construct *DefruleConstruct; int DefruleModuleIndex; - long CurrentEntityTimeTag; + long long CurrentEntityTimeTag; + struct alphaMemoryHash **AlphaMemoryTable; + intBool BetaMemoryResizingFlag; + struct joinLink *RightPrimeJoins; + struct joinLink *LeftPrimeJoins; + #if DEBUGGING_FUNCTIONS unsigned WatchRules; int DeletedRuleDebugFlags; @@ -109,10 +149,6 @@ struct defruleData #endif }; -#define EnvGetDefruleName(theEnv,x) GetConstructNameString((struct constructHeader *) x) -#define EnvGetDefrulePPForm(theEnv,x) GetConstructPPForm(theEnv,(struct constructHeader *) x) -#define EnvDefruleModule(theEnv,x) GetConstructModuleName((struct constructHeader *) x) - #define DefruleData(theEnv) ((struct defruleData *) GetEnvironmentData(theEnv,DEFRULE_DATA)) #define GetPreviousJoin(theJoin) \ @@ -134,28 +170,36 @@ struct defruleData #define LOCALE extern #endif -#if ENVIRONMENT_API_ONLY -#define DefruleModule(theEnv,x) GetConstructModuleName((struct constructHeader *) x) -#define FindDefrule(theEnv,a) EnvFindDefrule(theEnv,a) -#define GetDefruleName(theEnv,x) GetConstructNameString((struct constructHeader *) x) -#define GetDefrulePPForm(theEnv,x) GetConstructPPForm(theEnv,(struct constructHeader *) x) -#define GetNextDefrule(theEnv,a) EnvGetNextDefrule(theEnv,a) -#define IsDefruleDeletable(theEnv,a) EnvIsDefruleDeletable(theEnv,a) -#else -#define DefruleModule(x) GetConstructModuleName((struct constructHeader *) x) -#define FindDefrule(a) EnvFindDefrule(GetCurrentEnvironment(),a) -#define GetDefruleName(x) GetConstructNameString((struct constructHeader *) x) -#define GetDefrulePPForm(x) GetConstructPPForm(GetCurrentEnvironment(),(struct constructHeader *) x) -#define GetNextDefrule(a) EnvGetNextDefrule(GetCurrentEnvironment(),a) -#define IsDefruleDeletable(a) EnvIsDefruleDeletable(GetCurrentEnvironment(),a) -#endif - LOCALE void InitializeDefrules(void *); - LOCALE void *EnvFindDefrule(void *,char *); + LOCALE void *EnvFindDefrule(void *,const char *); + LOCALE void *EnvFindDefruleInModule(void *,const char *); LOCALE void *EnvGetNextDefrule(void *,void *); LOCALE struct defruleModule *GetDefruleModuleItem(void *,struct defmodule *); LOCALE intBool EnvIsDefruleDeletable(void *,void *); - +#if RUN_TIME + LOCALE void DefruleRunTimeInitialize(void *,struct joinLink *,struct joinLink *); #endif +#if RUN_TIME || BLOAD_ONLY || BLOAD || BLOAD_AND_BSAVE + LOCALE void AddBetaMemoriesToJoin(void *,struct joinNode *); +#endif + LOCALE long EnvGetDisjunctCount(void *,void *); + LOCALE void *EnvGetNthDisjunct(void *,void *,long); + LOCALE const char *EnvDefruleModule(void *,void *); + LOCALE const char *EnvGetDefruleName(void *,void *); + LOCALE const char *EnvGetDefrulePPForm(void *,void *); + +#if ALLOW_ENVIRONMENT_GLOBALS + + LOCALE const char *DefruleModule(void *); + LOCALE void *FindDefrule(const char *); + LOCALE const char *GetDefruleName(void *); + LOCALE const char *GetDefrulePPForm(void *); + LOCALE void *GetNextDefrule(void *); + LOCALE intBool IsDefruleDeletable(void *); + +#endif /* ALLOW_ENVIRONMENT_GLOBALS */ + + +#endif /* _H_ruledef */ |