00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _H_factgen
00022
00023 #define _H_factgen
00024
00025 #ifndef _H_reorder
00026 #include "reorder.h"
00027 #endif
00028
00029 #ifdef LOCALE
00030 #undef LOCALE
00031 #endif
00032
00033 #ifdef _FACTGEN_SOURCE_
00034 #define LOCALE
00035 #else
00036 #define LOCALE extern
00037 #endif
00038
00039
00040
00041
00042
00043
00044 struct factGetVarPN1Call
00045 {
00046 unsigned int factAddress : 1;
00047 unsigned int allFields : 1;
00048 unsigned short whichField;
00049 unsigned short whichSlot;
00050 };
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060 struct factGetVarPN2Call
00061 {
00062 unsigned short whichSlot;
00063 };
00064
00065
00066
00067
00068 struct factGetVarPN3Call
00069 {
00070 unsigned int fromBeginning : 1;
00071 unsigned int fromEnd : 1;
00072 unsigned short beginOffset;
00073 unsigned short endOffset;
00074 unsigned short whichSlot;
00075 };
00076
00077
00078
00079
00080
00081
00082 struct factConstantPN1Call
00083 {
00084 unsigned int testForEquality : 1;
00085 unsigned short whichSlot;
00086 };
00087
00088
00089
00090
00091
00092
00093
00094
00095 struct factConstantPN2Call
00096 {
00097 unsigned int testForEquality : 1;
00098 unsigned int fromBeginning : 1;
00099 unsigned short offset;
00100 unsigned short whichSlot;
00101 };
00102
00103
00104
00105
00106
00107
00108 struct factGetVarJN1Call
00109 {
00110 unsigned int factAddress : 1;
00111 unsigned int allFields : 1;
00112 unsigned int lhs : 1;
00113 unsigned int rhs : 1;
00114 unsigned short whichPattern;
00115 unsigned short whichSlot;
00116 unsigned short whichField;
00117 };
00118
00119
00120
00121
00122 struct factGetVarJN2Call
00123 {
00124 unsigned int lhs : 1;
00125 unsigned int rhs : 1;
00126 unsigned short whichPattern;
00127 unsigned short whichSlot;
00128 };
00129
00130
00131
00132
00133 struct factGetVarJN3Call
00134 {
00135 unsigned int fromBeginning : 1;
00136 unsigned int fromEnd : 1;
00137 unsigned int lhs : 1;
00138 unsigned int rhs : 1;
00139 unsigned short beginOffset;
00140 unsigned short endOffset;
00141 unsigned short whichPattern;
00142 unsigned short whichSlot;
00143 };
00144
00145
00146
00147
00148 struct factCompVarsPN1Call
00149 {
00150 unsigned int pass : 1;
00151 unsigned int fail : 1;
00152 unsigned short field1;
00153 unsigned short field2;
00154 };
00155
00156
00157
00158
00159 struct factCompVarsJN1Call
00160 {
00161 unsigned int pass : 1;
00162 unsigned int fail : 1;
00163 unsigned int p1lhs: 1;
00164 unsigned int p1rhs: 1;
00165 unsigned int p2lhs: 1;
00166 unsigned int p2rhs: 1;
00167 unsigned short pattern1;
00168 unsigned short pattern2;
00169 unsigned short slot1;
00170 unsigned short slot2;
00171 };
00172
00173
00174
00175
00176 struct factCompVarsJN2Call
00177 {
00178 unsigned int pass : 1;
00179 unsigned int fail : 1;
00180 unsigned int p1lhs: 1;
00181 unsigned int p1rhs: 1;
00182 unsigned int p2lhs: 1;
00183 unsigned int p2rhs: 1;
00184 unsigned int fromBeginning1 : 1;
00185 unsigned int fromBeginning2 : 1;
00186 unsigned short offset1;
00187 unsigned short offset2;
00188 unsigned short pattern1;
00189 unsigned short pattern2;
00190 unsigned short slot1;
00191 unsigned short slot2;
00192 };
00193
00194
00195
00196
00197
00198
00199
00200
00201 struct factCheckLengthPNCall
00202 {
00203 unsigned int exactly : 1;
00204 unsigned short minLength;
00205 unsigned short whichSlot;
00206 };
00207
00208
00209
00210
00211
00212 LOCALE void InitializeFactReteFunctions(void *);
00213 LOCALE struct expr *FactPNVariableComparison(void *,struct lhsParseNode *,
00214 struct lhsParseNode *);
00215 LOCALE struct expr *FactJNVariableComparison(void *,struct lhsParseNode *,
00216 struct lhsParseNode *,int);
00217 LOCALE void FactReplaceGetvar(void *,struct expr *,struct lhsParseNode *,int);
00218 LOCALE void FactReplaceGetfield(void *,struct expr *,struct lhsParseNode *);
00219 LOCALE struct expr *FactGenPNConstant(void *,struct lhsParseNode *);
00220 LOCALE struct expr *FactGenGetfield(void *,struct lhsParseNode *);
00221 LOCALE struct expr *FactGenGetvar(void *,struct lhsParseNode *,int);
00222 LOCALE struct expr *FactGenCheckLength(void *,struct lhsParseNode *);
00223 LOCALE struct expr *FactGenCheckZeroLength(void *,unsigned);
00224
00225 #endif