00001 /*******************************************************/ 00002 /* "C" Language Integrated Production System */ 00003 /* */ 00004 /* CLIPS Version 6.30 10/19/06 */ 00005 /* */ 00006 /* NETWORK HEADER FILE */ 00007 /*******************************************************/ 00008 00009 /*************************************************************/ 00010 /* Purpose: */ 00011 /* */ 00012 /* Principal Programmer(s): */ 00013 /* Gary D. Riley */ 00014 /* */ 00015 /* Contributing Programmer(s): */ 00016 /* */ 00017 /* Revision History: */ 00018 /* */ 00019 /* 6.30: Added support for hashed alpha memories. */ 00020 /* */ 00021 /*************************************************************/ 00022 00023 #ifndef _H_network 00024 00025 #define _H_network 00026 00027 struct patternNodeHeader; 00028 struct joinNode; 00029 struct alphaMemoryHash; 00030 00031 #ifndef _H_match 00032 #include "match.h" 00033 #endif 00034 00035 #ifndef _H_expressn 00036 #include "expressn.h" 00037 #endif 00038 00039 struct patternNodeHeader 00040 { 00041 struct alphaMemoryHash *firstHash; 00042 struct alphaMemoryHash *lastHash; 00043 struct joinNode *entryJoin; 00044 struct expr *rightHash; 00045 unsigned int singlefieldNode : 1; 00046 unsigned int multifieldNode : 1; 00047 unsigned int stopNode : 1; 00048 unsigned int initialize : 1; 00049 unsigned int marked : 1; 00050 unsigned int beginSlot : 1; 00051 unsigned int endSlot : 1; 00052 unsigned int selector : 1; 00053 }; 00054 00055 struct patternNodeHashEntry 00056 { 00057 void *parent; 00058 void *child; 00059 int type; 00060 void *value; 00061 struct patternNodeHashEntry *next; 00062 }; 00063 00064 #define SIZE_PATTERN_HASH 16231 00065 00066 struct alphaMemoryHash 00067 { 00068 unsigned long bucket; 00069 struct patternNodeHeader *owner; 00070 struct partialMatch *alphaMemory; 00071 struct partialMatch *endOfQueue; 00072 struct alphaMemoryHash *nextHash; 00073 struct alphaMemoryHash *prevHash; 00074 struct alphaMemoryHash *next; 00075 struct alphaMemoryHash *prev; 00076 }; 00077 00078 typedef struct alphaMemoryHash ALPHA_MEMORY_HASH; 00079 00080 #ifndef _H_ruledef 00081 #include "ruledef.h" 00082 #endif 00083 00084 #define INITIAL_BETA_HASH_SIZE 17 00085 00086 struct betaMemory 00087 { 00088 unsigned long size; 00089 unsigned long count; 00090 struct partialMatch **beta; 00091 struct partialMatch **last; 00092 }; 00093 00094 struct joinLink 00095 { 00096 char enterDirection; 00097 struct joinNode *join; 00098 struct joinLink *next; 00099 long bsaveID; 00100 }; 00101 00102 struct joinNode 00103 { 00104 unsigned int firstJoin : 1; 00105 unsigned int logicalJoin : 1; 00106 unsigned int joinFromTheRight : 1; 00107 unsigned int patternIsNegated : 1; 00108 unsigned int patternIsExists : 1; 00109 unsigned int initialize : 1; 00110 unsigned int marked : 1; 00111 unsigned int rhsType : 3; 00112 unsigned int depth : 16; 00113 long bsaveID; 00114 long long memoryAdds; 00115 long long memoryDeletes; 00116 long long memoryCompares; 00117 struct betaMemory *leftMemory; 00118 struct betaMemory *rightMemory; 00119 struct expr *networkTest; 00120 struct expr *secondaryNetworkTest; 00121 struct expr *leftHash; 00122 struct expr *rightHash; 00123 void *rightSideEntryStructure; 00124 struct joinLink *nextLinks; 00125 struct joinNode *lastLevel; 00126 struct joinNode *rightMatchNode; 00127 struct defrule *ruleToActivate; 00128 }; 00129 00130 #endif 00131 00132 00133 00134
1.5.6