├── .gitignore ├── CLIPS ├── agenda.c ├── agenda.h ├── analysis.c ├── analysis.h ├── argacces.c ├── argacces.h ├── bload.c ├── bload.h ├── bmathfun.c ├── bmathfun.h ├── bsave.c ├── bsave.h ├── classcom.c ├── classcom.h ├── classexm.c ├── classexm.h ├── classfun.c ├── classfun.h ├── classinf.c ├── classinf.h ├── classini.c ├── classini.h ├── classpsr.c ├── classpsr.h ├── clips.h ├── clsltpsr.c ├── clsltpsr.h ├── cmptblty.h ├── commline.c ├── commline.h ├── conscomp.c ├── conscomp.h ├── constant.h ├── constrct.c ├── constrct.h ├── constrnt.c ├── constrnt.h ├── crstrtgy.c ├── crstrtgy.h ├── cstrcbin.c ├── cstrcbin.h ├── cstrccmp.h ├── cstrccom.c ├── cstrccom.h ├── cstrcpsr.c ├── cstrcpsr.h ├── cstrnbin.c ├── cstrnbin.h ├── cstrnchk.c ├── cstrnchk.h ├── cstrncmp.c ├── cstrncmp.h ├── cstrnops.c ├── cstrnops.h ├── cstrnpsr.c ├── cstrnpsr.h ├── cstrnutl.c ├── cstrnutl.h ├── default.c ├── default.h ├── defins.c ├── defins.h ├── developr.c ├── developr.h ├── dffctbin.c ├── dffctbin.h ├── dffctbsc.c ├── dffctbsc.h ├── dffctcmp.c ├── dffctcmp.h ├── dffctdef.c ├── dffctdef.h ├── dffctpsr.c ├── dffctpsr.h ├── dffnxbin.c ├── dffnxbin.h ├── dffnxcmp.c ├── dffnxcmp.h ├── dffnxexe.c ├── dffnxexe.h ├── dffnxfun.c ├── dffnxfun.h ├── dffnxpsr.c ├── dffnxpsr.h ├── dfinsbin.c ├── dfinsbin.h ├── dfinscmp.c ├── dfinscmp.h ├── drive.c ├── drive.h ├── ed.h ├── edbasic.c ├── edmain.c ├── edmisc.c ├── edstruct.c ├── edterm.c ├── emathfun.c ├── emathfun.h ├── engine.c ├── engine.h ├── envrnmnt.c ├── envrnmnt.h ├── evaluatn.c ├── evaluatn.h ├── expressn.c ├── expressn.h ├── exprnbin.c ├── exprnbin.h ├── exprnops.c ├── exprnops.h ├── exprnpsr.c ├── exprnpsr.h ├── extnfunc.c ├── extnfunc.h ├── factbin.c ├── factbin.h ├── factbld.c ├── factbld.h ├── factcmp.c ├── factcmp.h ├── factcom.c ├── factcom.h ├── factfun.c ├── factfun.h ├── factgen.c ├── factgen.h ├── facthsh.c ├── facthsh.h ├── factlhs.c ├── factlhs.h ├── factmch.c ├── factmch.h ├── factmngr.c ├── factmngr.h ├── factprt.c ├── factprt.h ├── factqpsr.c ├── factqpsr.h ├── factqury.c ├── factqury.h ├── factrete.c ├── factrete.h ├── factrhs.c ├── factrhs.h ├── filecom.c ├── filecom.h ├── filertr.c ├── filertr.h ├── generate.c ├── generate.h ├── genrcbin.c ├── genrcbin.h ├── genrccmp.c ├── genrccmp.h ├── genrccom.c ├── genrccom.h ├── genrcexe.c ├── genrcexe.h ├── genrcfun.c ├── genrcfun.h ├── genrcpsr.c ├── genrcpsr.h ├── globlbin.c ├── globlbin.h ├── globlbsc.c ├── globlbsc.h ├── globlcmp.c ├── globlcmp.h ├── globlcom.c ├── globlcom.h ├── globldef.c ├── globldef.h ├── globlpsr.c ├── globlpsr.h ├── immthpsr.c ├── immthpsr.h ├── incrrset.c ├── incrrset.h ├── inherpsr.c ├── inherpsr.h ├── inscom.c ├── inscom.h ├── insfile.c ├── insfile.h ├── insfun.c ├── insfun.h ├── insmngr.c ├── insmngr.h ├── insmoddp.c ├── insmoddp.h ├── insmult.c ├── insmult.h ├── inspsr.c ├── inspsr.h ├── insquery.c ├── insquery.h ├── insqypsr.c ├── insqypsr.h ├── iofun.c ├── iofun.h ├── lgcldpnd.c ├── lgcldpnd.h ├── main.c ├── match.h ├── memalloc.c ├── memalloc.h ├── miscfun.c ├── miscfun.h ├── modulbin.c ├── modulbin.h ├── modulbsc.c ├── modulbsc.h ├── modulcmp.c ├── modulcmp.h ├── moduldef.c ├── moduldef.h ├── modulpsr.c ├── modulpsr.h ├── modulutl.c ├── modulutl.h ├── msgcom.c ├── msgcom.h ├── msgfun.c ├── msgfun.h ├── msgpass.c ├── msgpass.h ├── msgpsr.c ├── msgpsr.h ├── multifld.c ├── multifld.h ├── multifun.c ├── multifun.h ├── network.h ├── objbin.c ├── objbin.h ├── objcmp.c ├── objcmp.h ├── object.h ├── objrtbin.c ├── objrtbin.h ├── objrtbld.c ├── objrtbld.h ├── objrtcmp.c ├── objrtcmp.h ├── objrtfnx.c ├── objrtfnx.h ├── objrtgen.c ├── objrtgen.h ├── objrtmch.c ├── objrtmch.h ├── parsefun.c ├── parsefun.h ├── pattern.c ├── pattern.h ├── pprint.c ├── pprint.h ├── prccode.c ├── prccode.h ├── prcdrfun.c ├── prcdrfun.h ├── prcdrpsr.c ├── prcdrpsr.h ├── prdctfun.c ├── prdctfun.h ├── prntutil.c ├── prntutil.h ├── proflfun.c ├── proflfun.h ├── reorder.c ├── reorder.h ├── reteutil.c ├── reteutil.h ├── retract.c ├── retract.h ├── router.c ├── router.h ├── rulebin.c ├── rulebin.h ├── rulebld.c ├── rulebld.h ├── rulebsc.c ├── rulebsc.h ├── rulecmp.c ├── rulecmp.h ├── rulecom.c ├── rulecom.h ├── rulecstr.c ├── rulecstr.h ├── ruledef.c ├── ruledef.h ├── ruledlt.c ├── ruledlt.h ├── rulelhs.c ├── rulelhs.h ├── rulepsr.c ├── rulepsr.h ├── scanner.c ├── scanner.h ├── setup.h ├── sortfun.c ├── sortfun.h ├── strngfun.c ├── strngfun.h ├── strngrtr.c ├── strngrtr.h ├── symblbin.c ├── symblbin.h ├── symblcmp.c ├── symblcmp.h ├── symbol.c ├── symbol.h ├── sysdep.c ├── sysdep.h ├── textpro.c ├── textpro.h ├── tmpltbin.c ├── tmpltbin.h ├── tmpltbsc.c ├── tmpltbsc.h ├── tmpltcmp.c ├── tmpltcmp.h ├── tmpltdef.c ├── tmpltdef.h ├── tmpltfun.c ├── tmpltfun.h ├── tmpltlhs.c ├── tmpltlhs.h ├── tmpltpsr.c ├── tmpltpsr.h ├── tmpltrhs.c ├── tmpltrhs.h ├── tmpltutl.c ├── tmpltutl.h ├── userdata.c ├── userdata.h ├── userfunctions.c ├── usrsetup.h ├── utility.c ├── utility.h ├── watch.c └── watch.h ├── README.md ├── binding.gyp ├── lib └── index.js ├── package.json ├── spec ├── animal.clp ├── assert.js ├── auto.clp ├── basic.js ├── mab.clp ├── wine.clp ├── wordgame.clp └── zebra.clp └── src ├── clips_environment.cc ├── clips_environment.h └── node_clips.cc /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | build 3 | -------------------------------------------------------------------------------- /CLIPS/analysis.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.24 06/05/06 */ 5 | /* */ 6 | /* ANALYSIS HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: Analyzes LHS patterns to check for semantic */ 11 | /* errors and to determine variable comparisons and other */ 12 | /* tests which must be performed either in the pattern or */ 13 | /* join networks. */ 14 | /* */ 15 | /* Principal Programmer(s): */ 16 | /* Gary D. Riley */ 17 | /* */ 18 | /* Contributing Programmer(s): */ 19 | /* */ 20 | /* Revision History: */ 21 | /* */ 22 | /* 6.24: Renamed BOOLEAN macro type to intBool. */ 23 | /* */ 24 | /*************************************************************/ 25 | 26 | #ifndef _H_analysis 27 | 28 | #define _H_analysis 29 | 30 | #ifndef _H_expressn 31 | #include "expressn.h" 32 | #endif 33 | #ifndef _H_reorder 34 | #include "reorder.h" 35 | #endif 36 | 37 | #ifdef LOCALE 38 | #undef LOCALE 39 | #endif 40 | #ifdef _ANALYSIS_SOURCE_ 41 | #define LOCALE 42 | #else 43 | #define LOCALE extern 44 | #endif 45 | 46 | LOCALE intBool VariableAnalysis(void *,struct lhsParseNode *); 47 | 48 | #endif 49 | 50 | -------------------------------------------------------------------------------- /CLIPS/bmathfun.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.24 06/05/06 */ 5 | /* */ 6 | /* BASIC MATH FUNCTIONS MODULE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Gary D. Riley */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /* 6.24: Renamed BOOLEAN macro type to intBool. */ 20 | /* */ 21 | /*************************************************************/ 22 | 23 | #ifndef _H_bmathfun 24 | 25 | #define _H_bmathfun 26 | 27 | #ifndef _H_evaluatn 28 | #include "evaluatn.h" 29 | #endif 30 | 31 | #ifdef LOCALE 32 | #undef LOCALE 33 | #endif 34 | 35 | #ifdef _BMATHFUN_SOURCE_ 36 | #define LOCALE 37 | #else 38 | #define LOCALE extern 39 | #endif 40 | 41 | #define GetAutoFloatDividend() EnvGetAutoFloatDividend(GetCurrentEnvironment()) 42 | #define SetAutoFloatDividend(a) EnvSetAutoFloatDividend(GetCurrentEnvironment(),a) 43 | 44 | LOCALE void BasicMathFunctionDefinitions(void *); 45 | LOCALE void AdditionFunction(void *,DATA_OBJECT_PTR); 46 | LOCALE void MultiplicationFunction(void *,DATA_OBJECT_PTR); 47 | LOCALE void SubtractionFunction(void *,DATA_OBJECT_PTR); 48 | LOCALE void DivisionFunction(void *,DATA_OBJECT_PTR); 49 | LOCALE long long DivFunction(void *); 50 | LOCALE intBool SetAutoFloatDividendCommand(void *); 51 | LOCALE intBool GetAutoFloatDividendCommand(void *); 52 | LOCALE intBool EnvGetAutoFloatDividend(void *); 53 | LOCALE intBool EnvSetAutoFloatDividend(void *,int); 54 | LOCALE long long IntegerFunction(void *); 55 | LOCALE double FloatFunction(void *); 56 | LOCALE void AbsFunction(void *,DATA_OBJECT_PTR); 57 | LOCALE void MinFunction(void *,DATA_OBJECT_PTR); 58 | LOCALE void MaxFunction(void *,DATA_OBJECT_PTR); 59 | 60 | #endif 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /CLIPS/classini.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Brian L. Dantes */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /*************************************************************/ 20 | 21 | #ifndef _H_classini 22 | #define _H_classini 23 | 24 | #ifndef _H_constrct 25 | #include "constrct.h" 26 | #endif 27 | #ifndef _H_object 28 | #include "object.h" 29 | #endif 30 | 31 | #if OBJECT_SYSTEM 32 | 33 | #ifdef LOCALE 34 | #undef LOCALE 35 | #endif 36 | 37 | #ifdef _CLASSINI_SOURCE_ 38 | #define LOCALE 39 | #else 40 | #define LOCALE extern 41 | #endif 42 | 43 | LOCALE void SetupObjectSystem(void *); 44 | #if RUN_TIME 45 | LOCALE void ObjectsRunTimeInitialize(void *,DEFCLASS *[],SLOT_NAME *[],DEFCLASS *[],unsigned); 46 | #else 47 | LOCALE void CreateSystemClasses(void *); 48 | #endif 49 | 50 | #endif 51 | 52 | #endif 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /CLIPS/classpsr.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.30 03/04/08 */ 5 | /* */ 6 | /* */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Brian L. Dantes */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /* 6.30: Added support to allow CreateClassScopeMap to */ 20 | /* be used by other functions. */ 21 | /* */ 22 | /*************************************************************/ 23 | 24 | #ifndef _H_classpsr 25 | #define _H_classpsr 26 | 27 | #if OBJECT_SYSTEM && (! BLOAD_ONLY) && (! RUN_TIME) 28 | 29 | #ifdef LOCALE 30 | #undef LOCALE 31 | #endif 32 | 33 | #ifdef _CLASSPSR_SOURCE_ 34 | #define LOCALE 35 | #else 36 | #define LOCALE extern 37 | #endif 38 | 39 | LOCALE int ParseDefclass(void *,char *); 40 | 41 | #if DEFMODULE_CONSTRUCT 42 | LOCALE void *CreateClassScopeMap(void *,DEFCLASS *); 43 | #endif 44 | 45 | #endif 46 | 47 | #endif 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /CLIPS/clsltpsr.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Brian L. Dantes */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /*************************************************************/ 20 | 21 | #ifndef _H_clsltpsr 22 | #define _H_clsltpsr 23 | 24 | #if OBJECT_SYSTEM && (! BLOAD_ONLY) && (! RUN_TIME) 25 | 26 | #define MATCH_RLN "pattern-match" 27 | #define REACTIVE_RLN "reactive" 28 | #define NONREACTIVE_RLN "non-reactive" 29 | 30 | #ifndef _H_object 31 | #include "object.h" 32 | #endif 33 | 34 | typedef struct tempSlotLink 35 | { 36 | SLOT_DESC *desc; 37 | struct tempSlotLink *nxt; 38 | } TEMP_SLOT_LINK; 39 | 40 | #ifdef LOCALE 41 | #undef LOCALE 42 | #endif 43 | 44 | #ifdef _CLSLTPSR_SOURCE_ 45 | #define LOCALE 46 | #else 47 | #define LOCALE extern 48 | #endif 49 | 50 | LOCALE TEMP_SLOT_LINK *ParseSlot(void *,char *,TEMP_SLOT_LINK *,PACKED_CLASS_LINKS *,int,int); 51 | LOCALE void DeleteSlots(void *,TEMP_SLOT_LINK *); 52 | 53 | #ifndef _CLSLTPSR_SOURCE_ 54 | #endif 55 | 56 | #endif 57 | 58 | #endif 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /CLIPS/crstrtgy.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.30 10/19/06 */ 5 | /* */ 6 | /* CONFLICT RESOLUTION STRATEGY HEADER MODULE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: Used to determine where a new activation is */ 11 | /* placed on the agenda based on the current conflict */ 12 | /* resolution strategy (depth, breadth, mea, lex, */ 13 | /* simplicity, or complexity). Also provides the */ 14 | /* set-strategy and get-strategy commands. */ 15 | /* */ 16 | /* Principal Programmer(s): */ 17 | /* Gary D. Riley */ 18 | /* */ 19 | /* Contributing Programmer(s): */ 20 | /* */ 21 | /* Revision History: */ 22 | /* 6.23: Corrected compilation errors for files */ 23 | /* generated by constructs-to-c. DR0861 */ 24 | /* */ 25 | /* 6.24: Removed CONFLICT_RESOLUTION_STRATEGIES */ 26 | /* compilation flag. */ 27 | /* */ 28 | /* 6.30: Added salience groups to improve performance */ 29 | /* with large numbers of activations of different */ 30 | /* saliences. */ 31 | /* */ 32 | /*************************************************************/ 33 | 34 | #ifndef _H_crstrtgy 35 | 36 | #define _H_crstrtgy 37 | 38 | #include "agenda.h" 39 | #include "symbol.h" 40 | 41 | #define DEPTH_STRATEGY 0 42 | #define BREADTH_STRATEGY 1 43 | #define LEX_STRATEGY 2 44 | #define MEA_STRATEGY 3 45 | #define COMPLEXITY_STRATEGY 4 46 | #define SIMPLICITY_STRATEGY 5 47 | #define RANDOM_STRATEGY 6 48 | 49 | #define DEFAULT_STRATEGY DEPTH_STRATEGY 50 | 51 | #ifdef LOCALE 52 | #undef LOCALE 53 | #endif 54 | 55 | #ifdef _CRSTRTGY_SOURCE_ 56 | #define LOCALE 57 | #else 58 | #define LOCALE extern 59 | #endif 60 | 61 | #define GetStrategy() EnvGetStrategy(GetCurrentEnvironment()) 62 | #define SetStrategy(a) EnvSetStrategy(GetCurrentEnvironment(),a) 63 | 64 | LOCALE void PlaceActivation(void *,ACTIVATION **,ACTIVATION *,struct salienceGroup *); 65 | LOCALE int EnvSetStrategy(void *,int); 66 | LOCALE int EnvGetStrategy(void *); 67 | LOCALE void *SetStrategyCommand(void *); 68 | LOCALE void *GetStrategyCommand(void *); 69 | 70 | #endif 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /CLIPS/cstrcbin.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Brian L. Dantes */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /*************************************************************/ 20 | 21 | #ifndef _H_cstrcbin 22 | #define _H_cstrcbin 23 | 24 | #if BLOAD || BLOAD_ONLY || BLOAD_AND_BSAVE 25 | 26 | struct bsaveConstructHeader 27 | { 28 | long name; 29 | long whichModule; 30 | long next; 31 | }; 32 | 33 | #ifndef _H_constrct 34 | #include "constrct.h" 35 | #endif 36 | 37 | #ifdef LOCALE 38 | #undef LOCALE 39 | #endif 40 | 41 | #ifdef _CSTRCBIN_SOURCE_ 42 | #define LOCALE 43 | #else 44 | #define LOCALE extern 45 | #endif 46 | 47 | #if BLOAD_AND_BSAVE 48 | LOCALE void MarkConstructHeaderNeededItems(struct constructHeader *,long); 49 | LOCALE void AssignBsaveConstructHeaderVals(struct bsaveConstructHeader *, 50 | struct constructHeader *); 51 | #endif 52 | 53 | LOCALE void UpdateConstructHeader(void *, 54 | struct bsaveConstructHeader *, 55 | struct constructHeader *,int,void *,int,void *); 56 | LOCALE void UnmarkConstructHeader(void *,struct constructHeader *); 57 | 58 | #ifndef _CSTRCBIN_SOURCE_ 59 | #endif 60 | 61 | #endif 62 | 63 | #endif 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /CLIPS/cstrccmp.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* CONSTRUCT CONSTRUCTS-TO-C HEADER */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* Support functions for the constructs-to-c of */ 12 | /* construct headers and related items. */ 13 | /* */ 14 | /* Principal Programmer(s): */ 15 | /* Gary D. Riley */ 16 | /* */ 17 | /* Contributing Programmer(s): */ 18 | /* */ 19 | /* Revision History: */ 20 | /* */ 21 | /*************************************************************/ 22 | 23 | #ifndef _H_cstrccmp 24 | #define _H_cstrccmp 25 | 26 | #ifdef LOCALE 27 | #undef LOCALE 28 | #endif 29 | 30 | #ifdef _CSTRCCMP_SOURCE_ 31 | #define LOCALE 32 | #else 33 | #define LOCALE extern 34 | #endif 35 | 36 | #ifndef _STDIO_INCLUDED_ 37 | #define _STDIO_INCLUDED_ 38 | #include 39 | #endif 40 | 41 | #if ANSI_COMPILER 42 | LOCALE void MarkConstructHeaders(int); 43 | #else 44 | LOCALE void MarkConstructHeaders(); 45 | #endif 46 | 47 | #endif 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /CLIPS/cstrcpsr.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* CONSTRUCT PARSER MODULE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: Parsing routines and utilities for parsing */ 11 | /* constructs. */ 12 | /* */ 13 | /* Principal Programmer(s): */ 14 | /* Gary D. Riley */ 15 | /* */ 16 | /* Contributing Programmer(s): */ 17 | /* */ 18 | /* Revision History: */ 19 | /* */ 20 | /*************************************************************/ 21 | 22 | #ifndef _H_cstrcpsr 23 | 24 | #define _H_cstrcpsr 25 | 26 | #ifndef _H_evaluatn 27 | #include "evaluatn.h" 28 | #endif 29 | #ifndef _H_scanner 30 | #include "scanner.h" 31 | #endif 32 | #ifndef _H_constrct 33 | #include "constrct.h" 34 | #endif 35 | 36 | #ifdef LOCALE 37 | #undef LOCALE 38 | #endif 39 | 40 | #ifdef _CSTRCPSR_SOURCE_ 41 | #define LOCALE 42 | #else 43 | #define LOCALE extern 44 | #endif 45 | 46 | #if ALLOW_ENVIRONMENT_GLOBALS 47 | LOCALE int Load(char *); 48 | #endif 49 | 50 | LOCALE int EnvLoad(void *,char *); 51 | LOCALE int LoadConstructsFromLogicalName(void *,char *); 52 | LOCALE int ParseConstruct(void *,char *,char *); 53 | LOCALE void RemoveConstructFromModule(void *,struct constructHeader *); 54 | LOCALE struct symbolHashNode *GetConstructNameAndComment(void *,char *, 55 | struct token *,char *, 56 | void *(*)(void *,char *), 57 | int (*)(void *,void *), 58 | char *,int,int,int); 59 | LOCALE void ImportExportConflictMessage(void *,char *,char *,char *,char *); 60 | 61 | #endif 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /CLIPS/cstrnbin.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* CONSTRAINT BLOAD/BSAVE/CONSTRUCTS-TO-C HEADER */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: Implements the binary save/load feature for */ 11 | /* constraint records. */ 12 | /* */ 13 | /* Principal Programmer(s): */ 14 | /* Gary D. Riley */ 15 | /* */ 16 | /* Contributing Programmer(s): */ 17 | /* */ 18 | /* Revision History: */ 19 | /* */ 20 | /*************************************************************/ 21 | 22 | #ifndef _H_cstrnbin 23 | #define _H_cstrnbin 24 | 25 | #ifndef _H_evaluatn 26 | #include "evaluatn.h" 27 | #endif 28 | #ifndef _H_constrnt 29 | #include "constrnt.h" 30 | #endif 31 | 32 | #ifdef LOCALE 33 | #undef LOCALE 34 | #endif 35 | 36 | #ifdef _CSTRNBIN_SOURCE_ 37 | #define LOCALE 38 | #else 39 | #define LOCALE extern 40 | #endif 41 | 42 | #ifndef _STDIO_INCLUDED_ 43 | #define _STDIO_INCLUDED_ 44 | #include 45 | #endif 46 | 47 | #define ConstraintIndex(theConstraint) (((! EnvGetDynamicConstraintChecking(theEnv)) || (theConstraint == NULL)) ? -1L : ((long) theConstraint->bsaveIndex)) 48 | #define ConstraintPointer(i) (((i) == -1L) ? NULL : (CONSTRAINT_RECORD *) &ConstraintData(theEnv)->ConstraintArray[i]) 49 | 50 | #if BLOAD_AND_BSAVE 51 | LOCALE void WriteNeededConstraints(void *,FILE *); 52 | #endif 53 | LOCALE void ReadNeededConstraints(void *); 54 | LOCALE void ClearBloadedConstraints(void *); 55 | 56 | #endif 57 | 58 | 59 | -------------------------------------------------------------------------------- /CLIPS/cstrncmp.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* CONSTRAINT CONSTRUCTS-TO-C HEADER */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: Implements the constructs-to-c feature for */ 11 | /* constraint records. */ 12 | /* */ 13 | /* Principal Programmer(s): */ 14 | /* Gary D. Riley */ 15 | /* */ 16 | /* Contributing Programmer(s): */ 17 | /* */ 18 | /* Revision History: */ 19 | /* */ 20 | /*************************************************************/ 21 | 22 | #ifndef _H_cstrncmp 23 | #define _H_cstrncmp 24 | 25 | #ifndef _H_evaluatn 26 | #include "evaluatn.h" 27 | #endif 28 | #ifndef _H_constrnt 29 | #include "constrnt.h" 30 | #endif 31 | 32 | #ifdef LOCALE 33 | #undef LOCALE 34 | #endif 35 | 36 | #ifdef _CSTRNCMP_SOURCE_ 37 | #define LOCALE 38 | #else 39 | #define LOCALE extern 40 | #endif 41 | 42 | #ifndef _STDIO_INCLUDED_ 43 | #define _STDIO_INCLUDED_ 44 | #include 45 | #endif 46 | 47 | LOCALE void PrintConstraintReference(void *,FILE *,CONSTRAINT_RECORD *,int,int); 48 | LOCALE void ConstraintRecordToCode(FILE *,CONSTRAINT_RECORD *); 49 | LOCALE int ConstraintsToCode(void *,char *,char *,char *,int,FILE *,int,int); 50 | 51 | #endif 52 | 53 | -------------------------------------------------------------------------------- /CLIPS/cstrnops.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* CONSTRAINT OPERATIONS HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: Provides functions for performing operations on */ 11 | /* constraint records including computing the intersection */ 12 | /* and union of constraint records. */ 13 | /* */ 14 | /* Principal Programmer(s): */ 15 | /* Gary D. Riley */ 16 | /* */ 17 | /* Contributing Programmer(s): */ 18 | /* */ 19 | /* Revision History: */ 20 | /* */ 21 | /*************************************************************/ 22 | 23 | #ifndef _H_cstrnops 24 | #define _H_cstrnops 25 | 26 | #if (! RUN_TIME) 27 | 28 | #ifndef _H_evaluatn 29 | #include "evaluatn.h" 30 | #endif 31 | #ifndef _H_constrnt 32 | #include "constrnt.h" 33 | #endif 34 | 35 | #ifdef LOCALE 36 | #undef LOCALE 37 | #endif 38 | 39 | #ifdef _CSTRNOPS_SOURCE_ 40 | #define LOCALE 41 | #else 42 | #define LOCALE extern 43 | #endif 44 | 45 | LOCALE struct constraintRecord *IntersectConstraints(void *,struct constraintRecord *,struct constraintRecord *); 46 | #if (! BLOAD_ONLY) 47 | LOCALE struct constraintRecord *UnionConstraints(void *,struct constraintRecord *,struct constraintRecord *); 48 | LOCALE void RemoveConstantFromConstraint(void *,int,void *,CONSTRAINT_RECORD *); 49 | #endif 50 | 51 | #endif 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /CLIPS/cstrnutl.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* CONSTRAINT UTILITY HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: Utility routines for manipulating, initializing, */ 11 | /* creating, copying, and comparing constraint records. */ 12 | /* */ 13 | /* Principal Programmer(s): */ 14 | /* Gary D. Riley */ 15 | /* */ 16 | /* Contributing Programmer(s): */ 17 | /* Brian Dantes */ 18 | /* */ 19 | /* Revision History: */ 20 | /* */ 21 | /*************************************************************/ 22 | 23 | #ifndef _H_cstrnutl 24 | #define _H_cstrnutl 25 | 26 | #ifndef _H_constrnt 27 | #include "constrnt.h" 28 | #endif 29 | 30 | #ifdef LOCALE 31 | #undef LOCALE 32 | #endif 33 | 34 | #ifdef _CSTRNUTL_SOURCE_ 35 | #define LOCALE 36 | #else 37 | #define LOCALE extern 38 | #endif 39 | 40 | #ifndef _STDIO_INCLUDED_ 41 | #define _STDIO_INCLUDED_ 42 | #include 43 | #endif 44 | 45 | LOCALE struct constraintRecord *GetConstraintRecord(void *); 46 | LOCALE int CompareNumbers(void *,int,void *,int,void *); 47 | LOCALE struct constraintRecord *CopyConstraintRecord(void *,CONSTRAINT_RECORD *); 48 | LOCALE int SetConstraintType(int,CONSTRAINT_RECORD *); 49 | LOCALE void SetAnyAllowedFlags(CONSTRAINT_RECORD *,int); 50 | LOCALE void SetAnyRestrictionFlags(CONSTRAINT_RECORD *,int); 51 | LOCALE CONSTRAINT_RECORD *ArgumentTypeToConstraintRecord(void *,int); 52 | LOCALE CONSTRAINT_RECORD *FunctionCallToConstraintRecord(void *,void *); 53 | LOCALE CONSTRAINT_RECORD *ExpressionToConstraintRecord(void *,struct expr *); 54 | 55 | #endif 56 | 57 | 58 | -------------------------------------------------------------------------------- /CLIPS/default.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.24 06/05/06 */ 5 | /* */ 6 | /* DEFAULT ATTRIBUTE HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: Provides functions for parsing the default */ 11 | /* attribute and determining default values based on */ 12 | /* slot constraints. */ 13 | /* */ 14 | /* Principal Programmer(s): */ 15 | /* Gary D. Riley */ 16 | /* */ 17 | /* Contributing Programmer(s): */ 18 | /* */ 19 | /* Revision History: */ 20 | /* */ 21 | /* 6.24: Support for deftemplate-slot-default-value */ 22 | /* function. */ 23 | /* */ 24 | /*************************************************************/ 25 | 26 | #ifndef _H_default 27 | #define _H_default 28 | 29 | #ifndef _H_constrnt 30 | #include "constrnt.h" 31 | #endif 32 | #ifndef _H_evaluatn 33 | #include "evaluatn.h" 34 | #endif 35 | 36 | #ifdef LOCALE 37 | #undef LOCALE 38 | #endif 39 | 40 | #ifdef _DEFAULT_SOURCE_ 41 | #define LOCALE 42 | #else 43 | #define LOCALE extern 44 | #endif 45 | 46 | LOCALE void DeriveDefaultFromConstraints(void *,CONSTRAINT_RECORD *,DATA_OBJECT *,int,int); 47 | LOCALE struct expr *ParseDefault(void *,char *,int,int,int,int *,int *,int *); 48 | 49 | #endif 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /CLIPS/developr.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.24 05/17/06 */ 5 | /* */ 6 | /* DEVELOPER HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Gary D. Riley */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /* 6.24: Converted INSTANCE_PATTERN_MATCHING to */ 20 | /* DEFRULE_CONSTRUCT. */ 21 | /* */ 22 | /*************************************************************/ 23 | 24 | #ifndef _H_developr 25 | #define _H_developr 26 | 27 | #ifdef LOCALE 28 | #undef LOCALE 29 | #endif 30 | 31 | #ifdef _DEVELOPR_SOURCE_ 32 | #define LOCALE 33 | #else 34 | #define LOCALE extern 35 | #endif 36 | 37 | LOCALE void DeveloperCommands(void *); 38 | LOCALE void PrimitiveTablesInfo(void *); 39 | LOCALE void PrimitiveTablesUsage(void *); 40 | LOCALE void EnableGCHeuristics(void *); 41 | LOCALE void DisableGCHeuristics(void *); 42 | 43 | #if DEFRULE_CONSTRUCT && DEFTEMPLATE_CONSTRUCT 44 | LOCALE void ShowFactPatternNetwork(void *); 45 | #endif 46 | #if DEFRULE_CONSTRUCT && OBJECT_SYSTEM 47 | LOCALE void PrintObjectPatternNetwork(void *); 48 | #endif 49 | #if OBJECT_SYSTEM 50 | LOCALE void InstanceTableUsage(void *); 51 | #endif 52 | 53 | #endif 54 | 55 | 56 | -------------------------------------------------------------------------------- /CLIPS/dffctbin.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* DEFFACTS BSAVE/BLOAD HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Gary D. Riley */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* Brian L. Dantes */ 17 | /* */ 18 | /* Revision History: */ 19 | /* */ 20 | /*************************************************************/ 21 | 22 | #if (! RUN_TIME) 23 | #ifndef _H_dffctbin 24 | 25 | #define _H_dffctbin 26 | 27 | #include "modulbin.h" 28 | #include "cstrcbin.h" 29 | #ifndef _H_constrct 30 | #include "constrct.h" 31 | #endif 32 | 33 | struct bsaveDeffacts 34 | { 35 | struct bsaveConstructHeader header; 36 | long assertList; 37 | }; 38 | 39 | struct bsaveDeffactsModule 40 | { 41 | struct bsaveDefmoduleItemHeader header; 42 | }; 43 | 44 | #define DFFCTBIN_DATA 26 45 | 46 | struct deffactsBinaryData 47 | { 48 | struct deffacts *DeffactsArray; 49 | long NumberOfDeffacts; 50 | struct deffactsModule *ModuleArray; 51 | long NumberOfDeffactsModules; 52 | }; 53 | 54 | #define DeffactsBinaryData(theEnv) ((struct deffactsBinaryData *) GetEnvironmentData(theEnv,DFFCTBIN_DATA)) 55 | 56 | #ifdef LOCALE 57 | #undef LOCALE 58 | #endif 59 | 60 | #ifdef _DFFCTBIN_SOURCE_ 61 | #define LOCALE 62 | #else 63 | #define LOCALE extern 64 | #endif 65 | 66 | LOCALE void DeffactsBinarySetup(void *); 67 | LOCALE void *BloadDeffactsModuleReference(void *,int); 68 | 69 | #endif 70 | #endif 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /CLIPS/dffctbsc.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.24 06/05/06 */ 5 | /* */ 6 | /* DEFFACTS BASIC COMMANDS HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: Implements core commands for the deffacts */ 11 | /* construct such as clear, reset, save, undeffacts, */ 12 | /* ppdeffacts, list-deffacts, and get-deffacts-list. */ 13 | /* */ 14 | /* Principal Programmer(s): */ 15 | /* Gary D. Riley */ 16 | /* */ 17 | /* Contributing Programmer(s): */ 18 | /* Brian L. Dantes */ 19 | /* */ 20 | /* Revision History: */ 21 | /* 6.23: Corrected compilation errors for files */ 22 | /* generated by constructs-to-c. DR0861 */ 23 | /* */ 24 | /* 6.24: Renamed BOOLEAN macro type to intBool. */ 25 | /* */ 26 | /*************************************************************/ 27 | 28 | #ifndef _H_dffctbsc 29 | #define _H_dffctbsc 30 | 31 | #ifndef _H_evaluatn 32 | #include "evaluatn.h" 33 | #endif 34 | 35 | #ifdef LOCALE 36 | #undef LOCALE 37 | #endif 38 | 39 | #ifdef _DFFCTBSC_SOURCE_ 40 | #define LOCALE 41 | #else 42 | #define LOCALE extern 43 | #endif 44 | 45 | #define GetDeffactsList(a,b) EnvGetDeffactsList(GetCurrentEnvironment(),a,b) 46 | #define ListDeffacts(a,b) EnvListDeffacts(GetCurrentEnvironment(),a,b) 47 | #define Undeffacts(a) EnvUndeffacts(GetCurrentEnvironment(),a) 48 | 49 | LOCALE void DeffactsBasicCommands(void *); 50 | LOCALE void UndeffactsCommand(void *); 51 | LOCALE intBool EnvUndeffacts(void *,void *); 52 | LOCALE void GetDeffactsListFunction(void *,DATA_OBJECT_PTR); 53 | LOCALE void EnvGetDeffactsList(void *,DATA_OBJECT_PTR,void *); 54 | LOCALE void *DeffactsModuleFunction(void *); 55 | LOCALE void PPDeffactsCommand(void *); 56 | LOCALE int PPDeffacts(void *,char *,char *); 57 | LOCALE void ListDeffactsCommand(void *); 58 | LOCALE void EnvListDeffacts(void *,char *,void *); 59 | 60 | #endif 61 | 62 | -------------------------------------------------------------------------------- /CLIPS/dffctcmp.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* DEFFACTS CONSTRUCT COMPILER HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Gary D. Riley */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /*************************************************************/ 20 | 21 | #ifndef _H_dffctcmp 22 | 23 | #define _H_dffctcmp 24 | 25 | #ifdef LOCALE 26 | #undef LOCALE 27 | #endif 28 | 29 | #ifdef _DFFCTCMP_SOURCE_ 30 | #define LOCALE 31 | #else 32 | #define LOCALE extern 33 | #endif 34 | 35 | LOCALE void DeffactsCompilerSetup(void *); 36 | LOCALE void DeffactsCModuleReference(void *,FILE *,int,int,int); 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /CLIPS/dffctpsr.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* DEFFACTS PARSER HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Gary D. Riley */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* Brian L. Dantes */ 17 | /* */ 18 | /* Revision History: */ 19 | /* */ 20 | /*************************************************************/ 21 | 22 | #ifndef _H_dffctpsr 23 | #define _H_dffctpsr 24 | 25 | #ifdef LOCALE 26 | #undef LOCALE 27 | #endif 28 | 29 | #ifdef _DFFCTPSR_SOURCE_ 30 | #define LOCALE 31 | #else 32 | #define LOCALE extern 33 | #endif 34 | 35 | LOCALE int ParseDeffacts(void *,char *); 36 | 37 | #endif 38 | 39 | -------------------------------------------------------------------------------- /CLIPS/dffnxbin.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Brian L. Dantes */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /*************************************************************/ 20 | 21 | #ifndef _H_dffnxbin 22 | #define _H_dffnxbin 23 | 24 | #if DEFFUNCTION_CONSTRUCT && (BLOAD || BLOAD_ONLY || BLOAD_AND_BSAVE) 25 | 26 | #include "dffnxfun.h" 27 | 28 | #ifdef LOCALE 29 | #undef LOCALE 30 | #endif 31 | 32 | #ifdef _DFFNXBIN_SOURCE_ 33 | #define LOCALE 34 | #else 35 | #define LOCALE extern 36 | #endif 37 | 38 | LOCALE void SetupDeffunctionsBload(void *); 39 | LOCALE void *BloadDeffunctionModuleReference(void *,int); 40 | 41 | #define DFFNXBIN_DATA 24 42 | 43 | struct deffunctionBinaryData 44 | { 45 | DEFFUNCTION *DeffunctionArray; 46 | long DeffunctionCount; 47 | long ModuleCount; 48 | DEFFUNCTION_MODULE *ModuleArray; 49 | }; 50 | 51 | #define DeffunctionBinaryData(theEnv) ((struct deffunctionBinaryData *) GetEnvironmentData(theEnv,DFFNXBIN_DATA)) 52 | 53 | #define DeffunctionPointer(i) (((i) == -1L) ? NULL : (DEFFUNCTION *) &DeffunctionBinaryData(theEnv)->DeffunctionArray[i]) 54 | 55 | #endif 56 | 57 | #endif 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /CLIPS/dffnxcmp.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: Deffunction Construct Compiler Code */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Brian L. Dantes */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /*************************************************************/ 20 | 21 | #ifndef _H_dffnxcmp 22 | #define _H_dffnxcmp 23 | 24 | #if DEFFUNCTION_CONSTRUCT && CONSTRUCT_COMPILER && (! RUN_TIME) 25 | 26 | #ifndef _STDIO_INCLUDED_ 27 | #define _STDIO_INCLUDED_ 28 | #include 29 | #endif 30 | 31 | #include "dffnxfun.h" 32 | 33 | #ifdef LOCALE 34 | #undef LOCALE 35 | #endif 36 | 37 | #ifdef _DFFNXCMP_SOURCE_ 38 | #define LOCALE 39 | #else 40 | #define LOCALE extern 41 | #endif 42 | 43 | LOCALE void SetupDeffunctionCompiler(void *); 44 | LOCALE void PrintDeffunctionReference(void *,FILE *,DEFFUNCTION *,int,int); 45 | LOCALE void DeffunctionCModuleReference(void *,FILE *,int,int,int); 46 | 47 | #endif 48 | 49 | #endif 50 | 51 | 52 | -------------------------------------------------------------------------------- /CLIPS/dffnxexe.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Brian L. Dantes */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /*************************************************************/ 20 | 21 | #ifndef _H_dffnxexe 22 | #define _H_dffnxexe 23 | 24 | #if DEFFUNCTION_CONSTRUCT 25 | 26 | #include "dffnxfun.h" 27 | #ifndef _H_expressn 28 | #include "expressn.h" 29 | #endif 30 | #ifndef _H_evaluatn 31 | #include "evaluatn.h" 32 | #endif 33 | 34 | #ifdef LOCALE 35 | #undef LOCALE 36 | #endif 37 | 38 | #ifdef _DFFNXEXE_SOURCE_ 39 | #define LOCALE 40 | #else 41 | #define LOCALE extern 42 | #endif 43 | 44 | LOCALE void CallDeffunction(void *,DEFFUNCTION *,EXPRESSION *,DATA_OBJECT *); 45 | 46 | #endif 47 | 48 | #endif 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /CLIPS/dffnxpsr.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.24 06/05/06 */ 5 | /* */ 6 | /* */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Brian L. Dantes */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /* 6.24: Renamed BOOLEAN macro type to intBool. */ 20 | /* */ 21 | /*************************************************************/ 22 | 23 | #ifndef _H_dffnxpsr 24 | #define _H_dffnxpsr 25 | 26 | #if DEFFUNCTION_CONSTRUCT && (! BLOAD_ONLY) && (! RUN_TIME) 27 | 28 | #ifdef LOCALE 29 | #undef LOCALE 30 | #endif 31 | 32 | #ifdef _DFFNXPSR_SOURCE_ 33 | #define LOCALE 34 | #else 35 | #define LOCALE extern 36 | #endif 37 | 38 | LOCALE intBool ParseDeffunction(void *,char *); 39 | 40 | #ifndef _DFFNXPSR_SOURCE_ 41 | #endif 42 | 43 | #endif 44 | 45 | #endif 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /CLIPS/dfinsbin.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Brian L. Dantes */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /*************************************************************/ 20 | 21 | #ifndef _H_dfinsbin 22 | #define _H_dfinsbin 23 | 24 | #if DEFINSTANCES_CONSTRUCT && (BLOAD || BLOAD_ONLY || BLOAD_AND_BSAVE) 25 | 26 | #ifndef _H_defins 27 | #include "defins.h" 28 | #endif 29 | 30 | #define DFINSBIN_DATA 25 31 | 32 | struct definstancesBinaryData 33 | { 34 | DEFINSTANCES *DefinstancesArray; 35 | long DefinstancesCount; 36 | long ModuleCount; 37 | DEFINSTANCES_MODULE *ModuleArray; 38 | }; 39 | 40 | #define DefinstancesBinaryData(theEnv) ((struct definstancesBinaryData *) GetEnvironmentData(theEnv,DFINSBIN_DATA)) 41 | 42 | #ifdef LOCALE 43 | #undef LOCALE 44 | #endif 45 | 46 | #ifdef _DFINSBIN_SOURCE_ 47 | #define LOCALE 48 | #else 49 | #define LOCALE extern 50 | #endif 51 | 52 | LOCALE void SetupDefinstancesBload(void *); 53 | LOCALE void *BloadDefinstancesModuleRef(void *,int); 54 | 55 | #ifndef _DFINSBIN_SOURCE_ 56 | #endif 57 | 58 | #endif 59 | 60 | #endif 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /CLIPS/dfinscmp.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: Definstances Construct Compiler Code */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Brian L. Dantes */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /*************************************************************/ 20 | 21 | #ifndef _H_dfinscmp 22 | #define _H_dfinscmp 23 | 24 | #if DEFINSTANCES_CONSTRUCT && CONSTRUCT_COMPILER && (! RUN_TIME) 25 | 26 | #ifndef _STDIO_INCLUDED_ 27 | #define _STDIO_INCLUDED_ 28 | #include 29 | #endif 30 | 31 | #ifdef LOCALE 32 | #undef LOCALE 33 | #endif 34 | 35 | #ifdef _DFINSCMP_SOURCE_ 36 | #define LOCALE 37 | #else 38 | #define LOCALE extern 39 | #endif 40 | 41 | LOCALE void SetupDefinstancesCompiler(void *); 42 | LOCALE void DefinstancesCModuleReference(void *,FILE *,int,int,int); 43 | 44 | #endif 45 | 46 | #endif 47 | 48 | 49 | -------------------------------------------------------------------------------- /CLIPS/drive.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.30 10/19/06 */ 5 | /* */ 6 | /* DRIVE HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: Handles join network activity associated with */ 11 | /* with the addition of a data entity such as a fact or */ 12 | /* instance. */ 13 | /* */ 14 | /* Principal Programmer(s): */ 15 | /* Gary D. Riley */ 16 | /* */ 17 | /* Contributing Programmer(s): */ 18 | /* */ 19 | /* Revision History: */ 20 | /* */ 21 | /* 6.24: Renamed BOOLEAN macro type to intBool. */ 22 | /* */ 23 | /* 6.30: Split out functions to improve performance. */ 24 | /* */ 25 | /*************************************************************/ 26 | 27 | #ifndef _H_drive 28 | 29 | #define _H_drive 30 | 31 | #ifndef _H_expressn 32 | #include "expressn.h" 33 | #endif 34 | #ifndef _H_match 35 | #include "match.h" 36 | #endif 37 | #ifndef _H_network 38 | #include "network.h" 39 | #endif 40 | 41 | #ifdef LOCALE 42 | #undef LOCALE 43 | #endif 44 | 45 | #ifdef _DRIVE_SOURCE_ 46 | #define LOCALE 47 | #else 48 | #define LOCALE extern 49 | #endif 50 | 51 | void NetworkAssert(void *,struct partialMatch *,struct joinNode *); 52 | intBool EvaluateJoinExpression(void *,struct expr *,struct joinNode *); 53 | void NetworkAssertLeft(void *,struct partialMatch *,struct joinNode *); 54 | void NetworkAssertRight(void *,struct partialMatch *,struct joinNode *); 55 | void PPDrive(void *,struct partialMatch *,struct partialMatch *,struct joinNode *); 56 | unsigned long BetaMemoryHashValue(void *,struct expr *,struct partialMatch *,struct partialMatch *,struct joinNode *); 57 | intBool EvaluateSecondaryNetworkTest(void *,struct partialMatch *,struct joinNode *); 58 | void EPMDrive(void *,struct partialMatch *,struct joinNode *); 59 | 60 | #endif 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /CLIPS/exprnbin.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* EXPRESSION BLOAD/BSAVE HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: Implements the binary save/load feature for the */ 11 | /* expression data structure. */ 12 | /* */ 13 | /* Principal Programmer(s): */ 14 | /* Gary D. Riley */ 15 | /* Brian L. Dantes */ 16 | /* */ 17 | /* Contributing Programmer(s): */ 18 | /* */ 19 | /* Revision History: */ 20 | /* */ 21 | /*************************************************************/ 22 | 23 | #ifndef _H_exprnbin 24 | #define _H_exprnbin 25 | 26 | #ifndef _H_expressn 27 | #include "expressn.h" 28 | #endif 29 | #ifndef _STDIO_INCLUDED_ 30 | #define _STDIO_INCLUDED_ 31 | #include 32 | #endif 33 | 34 | #ifdef LOCALE 35 | #undef LOCALE 36 | #endif 37 | #ifdef _EXPRNBIN_SOURCE_ 38 | #define LOCALE 39 | #else 40 | #define LOCALE extern 41 | #endif 42 | 43 | #define ExpressionPointer(i) ((struct expr *) (((i) == -1L) ? NULL : &ExpressionData(theEnv)->ExpressionArray[i])) 44 | #define HashedExpressionPointer(i) ExpressionPointer(i) 45 | 46 | LOCALE void AllocateExpressions(void *); 47 | LOCALE void RefreshExpressions(void *); 48 | LOCALE void ClearBloadedExpressions(void *); 49 | LOCALE void FindHashedExpressions(void *); 50 | LOCALE void BsaveHashedExpressions(void *,FILE *); 51 | LOCALE void BsaveConstructExpressions(void *,FILE *); 52 | LOCALE void BsaveExpression(void *,struct expr *,FILE *); 53 | 54 | #endif 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /CLIPS/exprnops.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.24 06/05/06 */ 5 | /* */ 6 | /* EXPRESSION OPERATIONS HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: Provides utility routines for manipulating and */ 11 | /* examining expressions. */ 12 | /* */ 13 | /* Principal Programmer(s): */ 14 | /* Gary D. Riley */ 15 | /* */ 16 | /* Contributing Programmer(s): */ 17 | /* Brian L. Dantes */ 18 | /* */ 19 | /* Revision History: */ 20 | /* */ 21 | /* 6.24: Renamed BOOLEAN macro type to intBool. */ 22 | /* */ 23 | /*************************************************************/ 24 | 25 | #ifndef _H_exprnops 26 | 27 | #define _H_exprnops 28 | 29 | #ifndef _H_expressn 30 | #include "expressn.h" 31 | #endif 32 | 33 | #ifdef LOCALE 34 | #undef LOCALE 35 | #endif 36 | 37 | #ifdef _EXPRNOPS_SOURCE_ 38 | #define LOCALE 39 | #else 40 | #define LOCALE extern 41 | #endif 42 | 43 | LOCALE intBool ConstantExpression(struct expr *); 44 | LOCALE void PrintExpression(void *,char *,struct expr *); 45 | LOCALE long ExpressionSize(struct expr *); 46 | LOCALE int CountArguments(struct expr *); 47 | LOCALE struct expr *CopyExpression(void *,struct expr *); 48 | LOCALE intBool ExpressionContainsVariables(struct expr *,int); 49 | LOCALE intBool IdenticalExpression(struct expr *,struct expr *); 50 | LOCALE struct expr *GenConstant(void *,unsigned short,void *); 51 | #if ! RUN_TIME 52 | LOCALE int CheckArgumentAgainstRestriction(void *,struct expr *,int); 53 | #endif 54 | LOCALE intBool ConstantType(int); 55 | LOCALE struct expr *CombineExpressions(void *,struct expr *,struct expr *); 56 | LOCALE struct expr *AppendExpressions(struct expr *,struct expr *); 57 | 58 | #endif 59 | 60 | 61 | -------------------------------------------------------------------------------- /CLIPS/factbin.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* FACT BLOAD/BSAVE HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Gary D. Riley */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /*************************************************************/ 20 | 21 | #ifndef _H_factbin 22 | 23 | #define _H_factbin 24 | 25 | #include "factbld.h" 26 | 27 | #define FACTBIN_DATA 62 28 | 29 | struct factBinaryData 30 | { 31 | struct factPatternNode *FactPatternArray; 32 | long NumberOfPatterns; 33 | }; 34 | 35 | #define FactBinaryData(theEnv) ((struct factBinaryData *) GetEnvironmentData(theEnv,FACTBIN_DATA)) 36 | 37 | #ifdef LOCALE 38 | #undef LOCALE 39 | #endif 40 | 41 | #ifdef _FACTBIN_SOURCE_ 42 | #define LOCALE 43 | #else 44 | #define LOCALE extern 45 | #endif 46 | 47 | LOCALE void FactBinarySetup(void *); 48 | 49 | #define BsaveFactPatternIndex(patPtr) ((patPtr == NULL) ? -1L : ((struct factPatternNode *) patPtr)->bsaveID) 50 | #define BloadFactPatternPointer(i) ((struct factPatternNode *) ((i == -1L) ? NULL : &FactBinaryData(theEnv)->FactPatternArray[i])) 51 | 52 | #endif 53 | 54 | -------------------------------------------------------------------------------- /CLIPS/factbld.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* FACT BUILD HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Gary D. Riley */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /*************************************************************/ 20 | 21 | #ifndef _H_factbld 22 | 23 | #define _H_factbld 24 | 25 | #ifndef _H_pattern 26 | #include "pattern.h" 27 | #endif 28 | #ifndef _H_network 29 | #include "network.h" 30 | #endif 31 | 32 | #ifdef LOCALE 33 | #undef LOCALE 34 | #endif 35 | 36 | struct factPatternNode 37 | { 38 | struct patternNodeHeader header; 39 | long bsaveID; 40 | unsigned short whichField; 41 | unsigned short whichSlot; 42 | unsigned short leaveFields; 43 | struct expr *networkTest; 44 | struct factPatternNode *nextLevel; 45 | struct factPatternNode *lastLevel; 46 | struct factPatternNode *leftNode; 47 | struct factPatternNode *rightNode; 48 | }; 49 | 50 | #ifdef _FACTBUILD_SOURCE_ 51 | #define LOCALE 52 | #else 53 | #define LOCALE extern 54 | #endif 55 | 56 | LOCALE void InitializeFactPatterns(void *); 57 | LOCALE void DestroyFactPatternNetwork(void *, 58 | struct factPatternNode *); 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /CLIPS/factcmp.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* FACT CONSTRUCT COMPILER HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Gary D. Riley */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /*************************************************************/ 20 | 21 | #ifndef _H_factcmp 22 | 23 | #define _H_factcmp 24 | 25 | #ifndef _H_pattern 26 | #include "pattern.h" 27 | #endif 28 | #ifndef _H_network 29 | #include "network.h" 30 | #endif 31 | 32 | #ifdef LOCALE 33 | #undef LOCALE 34 | #endif 35 | 36 | #ifdef _FACTCMP_SOURCE_ 37 | #define LOCALE 38 | #else 39 | #define LOCALE extern 40 | #endif 41 | 42 | LOCALE void FactPatternsCompilerSetup(void *); 43 | LOCALE void FactPatternNodeReference(void *,void *,FILE *,int,int); 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /CLIPS/factcom.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.21 06/15/03 */ 5 | /* */ 6 | /* FACT COMMANDS HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Gary D. Riley */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /*************************************************************/ 20 | 21 | #ifndef _H_factcom 22 | #define _H_factcom 23 | 24 | #ifndef _H_evaluatn 25 | #include "evaluatn.h" 26 | #endif 27 | 28 | #ifdef LOCALE 29 | #undef LOCALE 30 | #endif 31 | 32 | #ifdef _FACTCOM_SOURCE_ 33 | #define LOCALE 34 | #else 35 | #define LOCALE extern 36 | #endif 37 | 38 | #define Facts(a,b,c,d,e) EnvFacts(GetCurrentEnvironment(),a,b,c,d,e) 39 | #define LoadFacts(a) EnvLoadFacts(GetCurrentEnvironment(),a) 40 | #define SaveFacts(a,b,c) EnvSaveFacts(GetCurrentEnvironment(),a,b,c) 41 | #define LoadFactsFromString(a,b) EnvLoadFactsFromString(GetCurrentEnvironment(),a,b) 42 | 43 | LOCALE void FactCommandDefinitions(void *); 44 | LOCALE void AssertCommand(void *,DATA_OBJECT_PTR); 45 | LOCALE void RetractCommand(void *); 46 | LOCALE void AssertStringFunction(void *,DATA_OBJECT_PTR); 47 | LOCALE void FactsCommand(void *); 48 | LOCALE void EnvFacts(void *,char *,void *,long long,long long,long long); 49 | LOCALE int SetFactDuplicationCommand(void *); 50 | LOCALE int GetFactDuplicationCommand(void *); 51 | LOCALE int SaveFactsCommand(void *); 52 | LOCALE int LoadFactsCommand(void *); 53 | LOCALE int EnvSaveFacts(void *,char *,int,struct expr *); 54 | LOCALE int EnvLoadFacts(void *,char *); 55 | LOCALE int EnvLoadFactsFromString(void *,char *,int); 56 | LOCALE long long FactIndexFunction(void *); 57 | 58 | #endif 59 | 60 | 61 | -------------------------------------------------------------------------------- /CLIPS/facthsh.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.24 06/05/06 */ 5 | /* */ 6 | /* FACT HASHING MODULE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Gary D. Riley */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /* 6.24: Renamed BOOLEAN macro type to intBool. */ 20 | /* */ 21 | /*************************************************************/ 22 | 23 | #ifndef _H_facthsh 24 | 25 | #define _H_facthsh 26 | 27 | struct factHashEntry; 28 | 29 | #ifndef _H_factmngr 30 | #include "factmngr.h" 31 | #endif 32 | 33 | struct factHashEntry 34 | { 35 | struct fact *theFact; 36 | struct factHashEntry *next; 37 | }; 38 | 39 | #define SIZE_FACT_HASH 16231 40 | 41 | #ifdef LOCALE 42 | #undef LOCALE 43 | #endif 44 | #ifdef _FACTHSH_SOURCE_ 45 | #define LOCALE 46 | #else 47 | #define LOCALE extern 48 | #endif 49 | 50 | #define GetFactDuplication() EnvGetFactDuplication(GetCurrentEnvironment()) 51 | #define SetFactDuplication(a) EnvSetFactDuplication(GetCurrentEnvironment(),a) 52 | 53 | LOCALE void AddHashedFact(void *,struct fact *,unsigned long); 54 | LOCALE intBool RemoveHashedFact(void *,struct fact *); 55 | LOCALE unsigned long HandleFactDuplication(void *,void *,intBool *); 56 | LOCALE intBool EnvGetFactDuplication(void *); 57 | LOCALE intBool EnvSetFactDuplication(void *,int); 58 | LOCALE void InitializeFactHashTable(void *); 59 | LOCALE void ShowFactHashTable(void *); 60 | LOCALE unsigned long HashFact(struct fact *); 61 | 62 | #endif 63 | 64 | 65 | -------------------------------------------------------------------------------- /CLIPS/factlhs.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* FACT BUILD HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Gary D. Riley */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /*************************************************************/ 20 | 21 | #ifndef _H_factlhs 22 | 23 | #define _H_factlhs 24 | 25 | #ifndef _H_symbol 26 | #include "symbol.h" 27 | #endif 28 | #ifndef _H_scanner 29 | #include "scanner.h" 30 | #endif 31 | 32 | #ifdef LOCALE 33 | #undef LOCALE 34 | #endif 35 | 36 | #ifdef _FACTLHS_SOURCE_ 37 | #define LOCALE 38 | #else 39 | #define LOCALE extern 40 | #endif 41 | 42 | LOCALE int FactPatternParserFind(SYMBOL_HN *); 43 | LOCALE struct lhsParseNode *FactPatternParse(void *,char *,struct token *); 44 | LOCALE struct lhsParseNode *SequenceRestrictionParse(void *,char *,struct token *); 45 | LOCALE struct lhsParseNode *CreateInitialFactPattern(void *); 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /CLIPS/factmch.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* FACT MATCH HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Gary D. Riley */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /*************************************************************/ 20 | 21 | #ifndef _H_factmch 22 | 23 | #define _H_factmch 24 | 25 | #ifndef _H_evaluatn 26 | #include "evaluatn.h" 27 | #endif 28 | #ifndef _H_factmngr 29 | #include "factmngr.h" 30 | #endif 31 | #ifndef _H_factbld 32 | #include "factbld.h" 33 | #endif 34 | 35 | #ifdef LOCALE 36 | #undef LOCALE 37 | #endif 38 | 39 | #ifdef _FACTMCH_SOURCE_ 40 | #define LOCALE 41 | #else 42 | #define LOCALE extern 43 | #endif 44 | 45 | LOCALE void FactPatternMatch(void *,struct fact *, 46 | struct factPatternNode *,int, 47 | struct multifieldMarker *, 48 | struct multifieldMarker *); 49 | LOCALE void MarkFactPatternForIncrementalReset(void *,struct patternNodeHeader *,int); 50 | LOCALE void FactsIncrementalReset(void *); 51 | 52 | #endif 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /CLIPS/factprt.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* FACT RETE PRINT FUNCTIONS HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Gary D. Riley */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /*************************************************************/ 20 | 21 | #ifndef _H_factprt 22 | 23 | #define _H_factprt 24 | 25 | #ifdef LOCALE 26 | #undef LOCALE 27 | #endif 28 | 29 | #ifdef _FACTPRT_SOURCE_ 30 | #define LOCALE 31 | #else 32 | #define LOCALE extern 33 | #endif 34 | 35 | LOCALE void PrintFactJNCompVars1(void *,char *,void *); 36 | LOCALE void PrintFactJNCompVars2(void *,char *,void *); 37 | LOCALE void PrintFactPNCompVars1(void *,char *,void *); 38 | LOCALE void PrintFactJNGetVar1(void *,char *,void *); 39 | LOCALE void PrintFactJNGetVar2(void *,char *,void *); 40 | LOCALE void PrintFactJNGetVar3(void *,char *,void *); 41 | LOCALE void PrintFactPNGetVar1(void *,char *,void *); 42 | LOCALE void PrintFactPNGetVar2(void *,char *,void *); 43 | LOCALE void PrintFactPNGetVar3(void *,char *,void *); 44 | LOCALE void PrintFactSlotLength(void *,char *,void *); 45 | LOCALE void PrintFactPNConstant1(void *,char *,void *); 46 | LOCALE void PrintFactPNConstant2(void *,char *,void *); 47 | 48 | #endif 49 | 50 | 51 | -------------------------------------------------------------------------------- /CLIPS/factqpsr.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.23 01/31/05 */ 5 | /* */ 6 | /* */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Brian L. Dantes */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* Gary D. Riley */ 17 | /* */ 18 | /* Revision History: */ 19 | /* 6.23: Added fact-set queries. */ 20 | /* */ 21 | /*************************************************************/ 22 | 23 | #ifndef _H_factqpsr 24 | #define _H_factqpsr 25 | 26 | #if FACT_SET_QUERIES && (! RUN_TIME) 27 | 28 | #ifndef _H_expressn 29 | #include "expressn.h" 30 | #endif 31 | 32 | #ifdef LOCALE 33 | #undef LOCALE 34 | #endif 35 | 36 | #ifdef _FACTQPSR_SOURCE_ 37 | #define LOCALE 38 | #else 39 | #define LOCALE extern 40 | #endif 41 | 42 | LOCALE EXPRESSION *FactParseQueryNoAction(void *,EXPRESSION *,char *); 43 | LOCALE EXPRESSION *FactParseQueryAction(void *,EXPRESSION *,char *); 44 | 45 | #ifndef _FACTQPSR_SOURCE_ 46 | #endif 47 | 48 | #endif 49 | 50 | #endif 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /CLIPS/factrete.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.24 06/05/06 */ 5 | /* */ 6 | /* FACT RETE ACCESS FUNCTIONS HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Gary D. Riley */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /* 6.24: Renamed BOOLEAN macro type to intBool. */ 20 | /* */ 21 | /*************************************************************/ 22 | 23 | #ifndef _H_factrete 24 | 25 | #define _H_factrete 26 | 27 | #ifndef _H_evaluatn 28 | #include "evaluatn.h" 29 | #endif 30 | 31 | #ifdef LOCALE 32 | #undef LOCALE 33 | #endif 34 | 35 | #ifdef _FACTRETE_SOURCE_ 36 | #define LOCALE 37 | #else 38 | #define LOCALE extern 39 | #endif 40 | 41 | LOCALE intBool FactPNGetVar1(void *,void *,DATA_OBJECT_PTR); 42 | LOCALE intBool FactPNGetVar2(void *,void *,DATA_OBJECT_PTR); 43 | LOCALE intBool FactPNGetVar3(void *,void *,DATA_OBJECT_PTR); 44 | LOCALE intBool FactJNGetVar1(void *,void *,DATA_OBJECT_PTR); 45 | LOCALE intBool FactJNGetVar2(void *,void *,DATA_OBJECT_PTR); 46 | LOCALE intBool FactJNGetVar3(void *,void *,DATA_OBJECT_PTR); 47 | LOCALE intBool FactSlotLength(void *,void *,DATA_OBJECT_PTR); 48 | LOCALE int FactJNCompVars1(void *,void *,DATA_OBJECT_PTR); 49 | LOCALE int FactJNCompVars2(void *,void *,DATA_OBJECT_PTR); 50 | LOCALE int FactPNCompVars1(void *,void *,DATA_OBJECT_PTR); 51 | LOCALE intBool FactPNConstant1(void *,void *,DATA_OBJECT_PTR); 52 | LOCALE intBool FactPNConstant2(void *,void *,DATA_OBJECT_PTR); 53 | LOCALE int FactStoreMultifield(void *,void *,DATA_OBJECT_PTR); 54 | LOCALE unsigned short AdjustFieldPosition(void *,struct multifieldMarker *, 55 | unsigned short,unsigned short,int *); 56 | 57 | #endif 58 | 59 | 60 | -------------------------------------------------------------------------------- /CLIPS/factrhs.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* FACT RHS PATTERN PARSER HEADER MODULE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Gary D. Riley */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /*************************************************************/ 20 | 21 | #ifndef _H_factrhs 22 | #define _H_factrhs 23 | 24 | #ifndef _H_expressn 25 | #include "expressn.h" 26 | #endif 27 | #ifndef _H_scanner 28 | #include "scanner.h" 29 | #endif 30 | #ifndef _H_factmngr 31 | #include "factmngr.h" 32 | #endif 33 | #ifndef _H_symbol 34 | #include "symbol.h" 35 | #endif 36 | 37 | #ifdef LOCALE 38 | #undef LOCALE 39 | #endif 40 | 41 | #ifdef _FACTRHS_SOURCE_ 42 | #define LOCALE 43 | #else 44 | #define LOCALE extern 45 | #endif 46 | 47 | LOCALE struct expr *BuildRHSAssert(void *,char *,struct token *,int *,int,int,char *); 48 | LOCALE struct expr *GetAssertArgument(void *,char *,struct token *,int *,int,int,int *); 49 | LOCALE struct expr *GetRHSPattern(void *,char *,struct token *,int *,int, 50 | int,int,int); 51 | LOCALE struct fact *StringToFact(void *,char *); 52 | 53 | #endif 54 | 55 | -------------------------------------------------------------------------------- /CLIPS/filertr.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* FILE I/O ROUTER HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: I/O Router routines which allow files to be used */ 11 | /* as input and output sources. */ 12 | /* */ 13 | /* Principal Programmer(s): */ 14 | /* Gary D. Riley */ 15 | /* */ 16 | /* Contributing Programmer(s): */ 17 | /* */ 18 | /* Revision History: */ 19 | /* */ 20 | /*************************************************************/ 21 | 22 | #ifndef _H_filertr 23 | #define _H_filertr 24 | 25 | #ifndef _STDIO_INCLUDED_ 26 | #define _STDIO_INCLUDED_ 27 | #include 28 | #endif 29 | 30 | #define FILE_ROUTER_DATA 47 31 | 32 | struct fileRouter 33 | { 34 | char *logicalName; 35 | FILE *stream; 36 | struct fileRouter *next; 37 | }; 38 | 39 | struct fileRouterData 40 | { 41 | struct fileRouter *ListOfFileRouters; 42 | }; 43 | 44 | #define FileRouterData(theEnv) ((struct fileRouterData *) GetEnvironmentData(theEnv,FILE_ROUTER_DATA)) 45 | 46 | #ifdef LOCALE 47 | #undef LOCALE 48 | #endif 49 | 50 | #ifdef _FILERTR_SOURCE_ 51 | #define LOCALE 52 | #else 53 | #define LOCALE extern 54 | #endif 55 | 56 | LOCALE void InitializeFileRouter(void *); 57 | LOCALE FILE *FindFptr(void *,char *); 58 | LOCALE int OpenAFile(void *,char *,char *,char *); 59 | LOCALE int CloseAllFiles(void *); 60 | LOCALE int CloseFile(void *,char *); 61 | LOCALE int FindFile(void *,char *); 62 | 63 | #endif 64 | 65 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /CLIPS/generate.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* GENERATE HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: Provides routines for converting field */ 11 | /* constraints to expressions which can be used */ 12 | /* in the pattern and join networks. */ 13 | /* */ 14 | /* Principal Programmer(s): */ 15 | /* Gary D. Riley */ 16 | /* */ 17 | /* Contributing Programmer(s): */ 18 | /* */ 19 | /* Revision History: */ 20 | /* */ 21 | /*************************************************************/ 22 | 23 | #ifndef _H_generate 24 | 25 | #define _H_generate 26 | 27 | #ifndef _H_expressn 28 | #include "expressn.h" 29 | #endif 30 | #ifndef _H_reorder 31 | #include "reorder.h" 32 | #endif 33 | 34 | #ifdef LOCALE 35 | #undef LOCALE 36 | #endif 37 | 38 | #ifdef _GENERATE_SOURCE_ 39 | #define LOCALE 40 | #else 41 | #define LOCALE extern 42 | #endif 43 | 44 | LOCALE void FieldConversion(void *,struct lhsParseNode *,struct lhsParseNode *); 45 | LOCALE struct expr *GetvarReplace(void *,struct lhsParseNode *,int); 46 | LOCALE intBool IsNandTest(struct lhsParseNode *); 47 | 48 | #endif 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /CLIPS/genrcbin.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Brian L. Dantes */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /*************************************************************/ 20 | 21 | #ifndef _H_genrcbin 22 | #define _H_genrcbin 23 | 24 | #include "genrcfun.h" 25 | 26 | #define GENRCBIN_DATA 28 27 | 28 | struct defgenericBinaryData 29 | { 30 | DEFGENERIC *DefgenericArray; 31 | long ModuleCount; 32 | long GenericCount; 33 | long MethodCount; 34 | long RestrictionCount; 35 | long TypeCount; 36 | DEFGENERIC_MODULE *ModuleArray; 37 | DEFMETHOD *MethodArray; 38 | RESTRICTION *RestrictionArray; 39 | void **TypeArray; 40 | }; 41 | 42 | #define DefgenericBinaryData(theEnv) ((struct defgenericBinaryData *) GetEnvironmentData(theEnv,GENRCBIN_DATA)) 43 | 44 | #define GenericPointer(i) (((i) == -1L) ? NULL : (DEFGENERIC *) &DefgenericBinaryData(theEnv)->DefgenericArray[i]) 45 | 46 | #ifdef LOCALE 47 | #undef LOCALE 48 | #endif 49 | 50 | #ifdef _GENRCBIN_SOURCE_ 51 | #define LOCALE 52 | #else 53 | #define LOCALE extern 54 | #endif 55 | 56 | LOCALE void SetupGenericsBload(void *); 57 | LOCALE void *BloadDefgenericModuleReference(void *,int); 58 | 59 | #endif 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /CLIPS/genrccmp.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: Generic Function Construct Compiler Code */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Brian L. Dantes */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /*************************************************************/ 20 | 21 | #ifndef _H_genrccmp 22 | #define _H_genrccmp 23 | 24 | #ifdef LOCALE 25 | #undef LOCALE 26 | #endif 27 | 28 | #ifdef _GENRCCMP_SOURCE_ 29 | #define LOCALE 30 | #else 31 | #define LOCALE extern 32 | #endif 33 | 34 | #ifndef _STDIO_INCLUDED_ 35 | #define _STDIO_INCLUDED_ 36 | #include 37 | #endif 38 | 39 | #include "genrcfun.h" 40 | 41 | LOCALE void SetupGenericsCompiler(void *); 42 | LOCALE void PrintGenericFunctionReference(void *,FILE *,DEFGENERIC *,int,int); 43 | LOCALE void DefgenericCModuleReference(void *,FILE *,int,int,int); 44 | 45 | #endif 46 | 47 | -------------------------------------------------------------------------------- /CLIPS/genrcexe.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.24 05/17/06 */ 5 | /* */ 6 | /* */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Brian L. Dantes */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /* 6.24: Removed IMPERATIVE_METHODS compilation flag. */ 20 | /* */ 21 | /*************************************************************/ 22 | 23 | #ifndef _H_genrcexe 24 | #define _H_genrcexe 25 | 26 | #if DEFGENERIC_CONSTRUCT 27 | 28 | #include "genrcfun.h" 29 | #ifndef _H_expressn 30 | #include "expressn.h" 31 | #endif 32 | #ifndef _H_evaluatn 33 | #include "evaluatn.h" 34 | #endif 35 | 36 | #ifdef LOCALE 37 | #undef LOCALE 38 | #endif 39 | 40 | #ifdef _GENRCEXE_SOURCE_ 41 | #define LOCALE 42 | #else 43 | #define LOCALE extern 44 | #endif 45 | 46 | LOCALE void GenericDispatch(void *,DEFGENERIC *,DEFMETHOD *,DEFMETHOD *,EXPRESSION *,DATA_OBJECT *); 47 | LOCALE void UnboundMethodErr(void *); 48 | LOCALE intBool IsMethodApplicable(void *,DEFMETHOD *); 49 | 50 | LOCALE int NextMethodP(void *); 51 | LOCALE void CallNextMethod(void *,DATA_OBJECT *); 52 | LOCALE void CallSpecificMethod(void *,DATA_OBJECT *); 53 | LOCALE void OverrideNextMethod(void *,DATA_OBJECT *); 54 | 55 | LOCALE void GetGenericCurrentArgument(void *,DATA_OBJECT *); 56 | 57 | #ifndef _GENRCEXE_SOURCE_ 58 | #endif 59 | 60 | #endif 61 | 62 | #endif 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /CLIPS/genrcpsr.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.24 06/05/06 */ 5 | /* */ 6 | /* */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Brian L. Dantes */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /* 6.24: Renamed BOOLEAN macro type to intBool. */ 20 | /* */ 21 | /*************************************************************/ 22 | 23 | #ifndef _H_genrcpsr 24 | #define _H_genrcpsr 25 | 26 | #if DEFGENERIC_CONSTRUCT && (! BLOAD_ONLY) && (! RUN_TIME) 27 | 28 | #include "genrcfun.h" 29 | 30 | #ifdef LOCALE 31 | #undef LOCALE 32 | #endif 33 | 34 | #ifdef _GENRCPSR_SOURCE_ 35 | #define LOCALE 36 | #else 37 | #define LOCALE extern 38 | #endif 39 | 40 | LOCALE intBool ParseDefgeneric(void *,char *); 41 | LOCALE intBool ParseDefmethod(void *,char *); 42 | LOCALE DEFMETHOD *AddMethod(void *,DEFGENERIC *,DEFMETHOD *,int,short,EXPRESSION *, 43 | int,int,SYMBOL_HN *,EXPRESSION *,char *,int); 44 | LOCALE void PackRestrictionTypes(void *,RESTRICTION *,EXPRESSION *); 45 | LOCALE void DeleteTempRestricts(void *,EXPRESSION *); 46 | LOCALE DEFMETHOD *FindMethodByRestrictions(DEFGENERIC *,EXPRESSION *,int, 47 | SYMBOL_HN *,int *); 48 | 49 | #ifndef _GENRCPSR_SOURCE_ 50 | #endif 51 | 52 | #endif 53 | 54 | #endif 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /CLIPS/globlbin.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* DEFGLOBAL BINARY HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Gary D. Riley */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* Brian L. Dantes */ 17 | /* */ 18 | /* Revision History: */ 19 | /* */ 20 | /*************************************************************/ 21 | 22 | #ifndef _H_globlbin 23 | 24 | #define _H_globlbin 25 | 26 | #include "modulbin.h" 27 | #include "cstrcbin.h" 28 | #include "globldef.h" 29 | 30 | struct bsaveDefglobal 31 | { 32 | struct bsaveConstructHeader header; 33 | long initial; 34 | }; 35 | 36 | struct bsaveDefglobalModule 37 | { 38 | struct bsaveDefmoduleItemHeader header; 39 | }; 40 | 41 | #define GLOBLBIN_DATA 60 42 | 43 | struct defglobalBinaryData 44 | { 45 | struct defglobal *DefglobalArray; 46 | long NumberOfDefglobals; 47 | struct defglobalModule *ModuleArray; 48 | long NumberOfDefglobalModules; 49 | }; 50 | 51 | #define DefglobalBinaryData(theEnv) ((struct defglobalBinaryData *) GetEnvironmentData(theEnv,GLOBLBIN_DATA)) 52 | 53 | #define DefglobalPointer(i) ((struct defglobal *) (&DefglobalBinaryData(theEnv)->DefglobalArray[i])) 54 | 55 | #ifdef LOCALE 56 | #undef LOCALE 57 | #endif 58 | 59 | #ifdef _GLOBLBIN_SOURCE_ 60 | #define LOCALE 61 | #else 62 | #define LOCALE extern 63 | #endif 64 | 65 | LOCALE void DefglobalBinarySetup(void *); 66 | LOCALE void *BloadDefglobalModuleReference(void *,int); 67 | 68 | #ifndef _GLOBLBIN_SOURCE_ 69 | extern struct defglobal *DefglobalArray; 70 | #endif 71 | #endif 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /CLIPS/globlcmp.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* DEFGLOBAL CONSTRUCT COMPILER HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Gary D. Riley */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /*************************************************************/ 20 | 21 | #ifndef _H_globlcmp 22 | 23 | #define _H_globlcmp 24 | 25 | #ifdef LOCALE 26 | #undef LOCALE 27 | #endif 28 | 29 | #ifdef _GLOBLCMP_SOURCE_ 30 | #define LOCALE 31 | #else 32 | #define LOCALE extern 33 | #endif 34 | 35 | LOCALE void DefglobalCompilerSetup(void *); 36 | LOCALE void DefglobalCModuleReference(void *,FILE *,int,int,int); 37 | LOCALE void DefglobalCConstructReference(void *,FILE *,void *,int,int); 38 | 39 | #endif 40 | 41 | -------------------------------------------------------------------------------- /CLIPS/globlcom.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.24 06/05/06 */ 5 | /* */ 6 | /* DEFGLOBAL COMMANDS HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Gary D. Riley */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* Brian L. Dantes */ 17 | /* */ 18 | /* Revision History: */ 19 | /* */ 20 | /* 6.24: Renamed BOOLEAN macro type to intBool. */ 21 | /* */ 22 | /*************************************************************/ 23 | 24 | #ifndef _H_globlcom 25 | #define _H_globlcom 26 | 27 | #ifdef LOCALE 28 | #undef LOCALE 29 | #endif 30 | 31 | #ifdef _GLOBLCOM_SOURCE_ 32 | #define LOCALE 33 | #else 34 | #define LOCALE extern 35 | #endif 36 | 37 | #define GetResetGlobals() EnvGetResetGlobals(GetCurrentEnvironment()) 38 | #define SetResetGlobals(a) EnvSetResetGlobals(GetCurrentEnvironment(),a) 39 | #define ShowDefglobals(a,b) EnvShowDefglobals(GetCurrentEnvironment(),a,b) 40 | 41 | LOCALE void DefglobalCommandDefinitions(void *); 42 | LOCALE int SetResetGlobalsCommand(void *); 43 | LOCALE intBool EnvSetResetGlobals(void *,int); 44 | LOCALE int GetResetGlobalsCommand(void *); 45 | LOCALE intBool EnvGetResetGlobals(void *); 46 | LOCALE void ShowDefglobalsCommand(void *); 47 | LOCALE void EnvShowDefglobals(void *,char *,void *); 48 | 49 | #endif 50 | 51 | -------------------------------------------------------------------------------- /CLIPS/globlpsr.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.24 06/05/06 */ 5 | /* */ 6 | /* DEFGLOBAL PARSER HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Gary D. Riley */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /* 6.24: Renamed BOOLEAN macro type to intBool. */ 20 | /* */ 21 | /*************************************************************/ 22 | 23 | #ifndef _H_globlpsr 24 | 25 | #define _H_globlpsr 26 | 27 | #ifdef _DEFGLOBL_SOURCE_ 28 | struct defglobal; 29 | #endif 30 | 31 | #ifndef _H_expressn 32 | #include "expressn.h" 33 | #endif 34 | 35 | #ifdef LOCALE 36 | #undef LOCALE 37 | #endif 38 | 39 | #ifdef _GLOBLPSR_SOURCE_ 40 | #define LOCALE 41 | #else 42 | #define LOCALE extern 43 | #endif 44 | 45 | LOCALE intBool ParseDefglobal(void *,char *); 46 | LOCALE intBool ReplaceGlobalVariable(void *,struct expr *); 47 | LOCALE void GlobalReferenceErrorMessage(void *,char *); 48 | 49 | #endif 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /CLIPS/immthpsr.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Brian L. Dantes */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /*************************************************************/ 20 | 21 | #ifndef _H_immthpsr 22 | #define _H_immthpsr 23 | 24 | #if DEFGENERIC_CONSTRUCT && (! BLOAD_ONLY) && (! RUN_TIME) 25 | 26 | #include "genrcfun.h" 27 | 28 | #ifdef LOCALE 29 | #undef LOCALE 30 | #endif 31 | 32 | #ifdef _IMMTHPSR_SOURCE_ 33 | #define LOCALE 34 | #else 35 | #define LOCALE extern 36 | #endif 37 | 38 | LOCALE void AddImplicitMethods(void *,DEFGENERIC *); 39 | 40 | #ifndef _IMMTHPSR_SOURCE_ 41 | #endif 42 | 43 | #endif 44 | 45 | #endif 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /CLIPS/incrrset.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.24 06/05/06 */ 5 | /* */ 6 | /* INCREMENTAL RESET HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: Provides functionality for the incremental */ 11 | /* reset of the pattern and join networks when a new */ 12 | /* rule is added. */ 13 | /* */ 14 | /* Principal Programmer(s): */ 15 | /* Gary D. Riley */ 16 | /* */ 17 | /* Contributing Programmer(s): */ 18 | /* */ 19 | /* Revision History: */ 20 | /* */ 21 | /* 6.24: Renamed BOOLEAN macro type to intBool. */ 22 | /* */ 23 | /*************************************************************/ 24 | 25 | #ifndef _H_incrrset 26 | 27 | #define _H_incrrset 28 | 29 | #ifndef _H_ruledef 30 | #include "ruledef.h" 31 | #endif 32 | 33 | #ifdef LOCALE 34 | #undef LOCALE 35 | #endif 36 | 37 | #ifdef _INCRRSET_SOURCE_ 38 | #define LOCALE 39 | #else 40 | #define LOCALE extern 41 | #endif 42 | 43 | #define GetIncrementalReset() EnvGetIncrementalReset(GetCurrentEnvironment()) 44 | #define SetIncrementalReset(a) EnvSetIncrementalReset(GetCurrentEnvironment(),a) 45 | 46 | LOCALE void IncrementalReset(void *,struct defrule *); 47 | LOCALE intBool EnvGetIncrementalReset(void *); 48 | LOCALE intBool EnvSetIncrementalReset(void *,intBool); 49 | LOCALE int GetIncrementalResetCommand(void *); 50 | LOCALE int SetIncrementalResetCommand(void *); 51 | 52 | #endif 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /CLIPS/inherpsr.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Brian L. Dantes */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /*************************************************************/ 20 | 21 | #ifndef _H_inherpsr 22 | #define _H_inherpsr 23 | 24 | #if OBJECT_SYSTEM && (! BLOAD_ONLY) && (! RUN_TIME) 25 | 26 | #ifndef _H_object 27 | #include "object.h" 28 | #endif 29 | 30 | #ifdef LOCALE 31 | #undef LOCALE 32 | #endif 33 | 34 | #ifdef _INHERPSR_SOURCE_ 35 | #define LOCALE 36 | #else 37 | #define LOCALE extern 38 | #endif 39 | 40 | LOCALE PACKED_CLASS_LINKS *ParseSuperclasses(void *,char *,SYMBOL_HN *); 41 | LOCALE PACKED_CLASS_LINKS *FindPrecedenceList(void *,DEFCLASS *,PACKED_CLASS_LINKS *); 42 | LOCALE void PackClassLinks(void *,PACKED_CLASS_LINKS *,CLASS_LINK *); 43 | 44 | #ifndef _INHERPSR_SOURCE_ 45 | #endif 46 | 47 | #endif 48 | 49 | #endif 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /CLIPS/insmngr.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.24 05/17/06 */ 5 | /* */ 6 | /* INSTANCE PRIMITIVE SUPPORT MODULE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Brian L. Dantes */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /* 6.24: Converted INSTANCE_PATTERN_MATCHING to */ 20 | /* DEFRULE_CONSTRUCT. */ 21 | /* */ 22 | /* Renamed BOOLEAN macro type to intBool. */ 23 | /* */ 24 | /*************************************************************/ 25 | 26 | #ifndef _H_insmngr 27 | #define _H_insmngr 28 | 29 | #ifndef _H_object 30 | #include "object.h" 31 | #endif 32 | 33 | #ifdef LOCALE 34 | #undef LOCALE 35 | #endif 36 | 37 | #ifdef _INSMNGR_SOURCE_ 38 | #define LOCALE 39 | #else 40 | #define LOCALE extern 41 | #endif 42 | 43 | LOCALE void InitializeInstanceCommand(void *,DATA_OBJECT *); 44 | LOCALE void MakeInstanceCommand(void *,DATA_OBJECT *); 45 | LOCALE SYMBOL_HN *GetFullInstanceName(void *,INSTANCE_TYPE *); 46 | LOCALE INSTANCE_TYPE *BuildInstance(void *,SYMBOL_HN *,DEFCLASS *,intBool); 47 | LOCALE void InitSlotsCommand(void *,DATA_OBJECT *); 48 | LOCALE intBool QuashInstance(void *,INSTANCE_TYPE *); 49 | 50 | #if DEFRULE_CONSTRUCT && OBJECT_SYSTEM 51 | LOCALE void InactiveInitializeInstance(void *,DATA_OBJECT *); 52 | LOCALE void InactiveMakeInstance(void *,DATA_OBJECT *); 53 | #endif 54 | 55 | #endif 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /CLIPS/insmoddp.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.24 05/17/06 */ 5 | /* */ 6 | /* INSTANCE MODIFY AND DUPLICATE MODULE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Brian L. Dantes */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /* 6.24: Converted INSTANCE_PATTERN_MATCHING to */ 20 | /* DEFRULE_CONSTRUCT. */ 21 | /* */ 22 | /*************************************************************/ 23 | 24 | #ifndef _H_insmoddp 25 | #define _H_insmoddp 26 | 27 | #define DIRECT_MODIFY_STRING "direct-modify" 28 | #define MSG_MODIFY_STRING "message-modify" 29 | #define DIRECT_DUPLICATE_STRING "direct-duplicate" 30 | #define MSG_DUPLICATE_STRING "message-duplicate" 31 | 32 | #ifndef _H_evaluatn 33 | #include "evaluatn.h" 34 | #endif 35 | 36 | #ifdef LOCALE 37 | #undef LOCALE 38 | #endif 39 | 40 | #ifdef _INSMODDP_SOURCE_ 41 | #define LOCALE 42 | #else 43 | #define LOCALE extern 44 | #endif 45 | 46 | #if (! RUN_TIME) 47 | LOCALE void SetupInstanceModDupCommands(void *); 48 | #endif 49 | 50 | LOCALE void ModifyInstance(void *,DATA_OBJECT *); 51 | LOCALE void MsgModifyInstance(void *,DATA_OBJECT *); 52 | LOCALE void DuplicateInstance(void *,DATA_OBJECT *); 53 | LOCALE void MsgDuplicateInstance(void *,DATA_OBJECT *); 54 | 55 | #if DEFRULE_CONSTRUCT && OBJECT_SYSTEM 56 | LOCALE void InactiveModifyInstance(void *,DATA_OBJECT *); 57 | LOCALE void InactiveMsgModifyInstance(void *,DATA_OBJECT *); 58 | LOCALE void InactiveDuplicateInstance(void *,DATA_OBJECT *); 59 | LOCALE void InactiveMsgDuplicateInstance(void *,DATA_OBJECT *); 60 | #endif 61 | 62 | LOCALE void DirectModifyMsgHandler(void *,DATA_OBJECT *); 63 | LOCALE void MsgModifyMsgHandler(void *,DATA_OBJECT *); 64 | LOCALE void DirectDuplicateMsgHandler(void *,DATA_OBJECT *); 65 | LOCALE void MsgDuplicateMsgHandler(void *,DATA_OBJECT *); 66 | 67 | #ifndef _INSMODDP_SOURCE_ 68 | #endif 69 | 70 | #endif 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /CLIPS/insmult.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.24 06/05/06 */ 5 | /* */ 6 | /* */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Brian L. Dantes */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /* 6.24: Renamed BOOLEAN macro type to intBool. */ 20 | /* */ 21 | /*************************************************************/ 22 | 23 | #ifndef _H_insmult 24 | #define _H_insmult 25 | 26 | #ifndef _H_evaluatn 27 | #include "evaluatn.h" 28 | #endif 29 | 30 | #ifdef LOCALE 31 | #undef LOCALE 32 | #endif 33 | 34 | #ifdef _INSMULT_SOURCE_ 35 | #define LOCALE 36 | #else 37 | #define LOCALE extern 38 | #endif 39 | 40 | #if (! RUN_TIME) 41 | LOCALE void SetupInstanceMultifieldCommands(void *); 42 | #endif 43 | 44 | LOCALE void MVSlotReplaceCommand(void *,DATA_OBJECT *); 45 | LOCALE void MVSlotInsertCommand(void *,DATA_OBJECT *); 46 | LOCALE void MVSlotDeleteCommand(void *,DATA_OBJECT *); 47 | LOCALE intBool DirectMVReplaceCommand(void *); 48 | LOCALE intBool DirectMVInsertCommand(void *); 49 | LOCALE intBool DirectMVDeleteCommand(void *); 50 | 51 | #ifndef _INSMULT_SOURCE_ 52 | #endif 53 | 54 | #endif 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /CLIPS/inspsr.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Brian L. Dantes */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /*************************************************************/ 20 | 21 | #ifndef _H_inspsr 22 | #define _H_inspsr 23 | 24 | #ifndef _H_expressn 25 | #include "expressn.h" 26 | #endif 27 | 28 | #ifdef LOCALE 29 | #undef LOCALE 30 | #endif 31 | 32 | #ifdef _INSPSR_SOURCE_ 33 | #define LOCALE 34 | #else 35 | #define LOCALE extern 36 | #endif 37 | 38 | #if ! RUN_TIME 39 | LOCALE EXPRESSION *ParseInitializeInstance(void *,EXPRESSION *,char *); 40 | LOCALE EXPRESSION *ParseSlotOverrides(void *,char *,int *); 41 | #endif 42 | 43 | LOCALE EXPRESSION *ParseSimpleInstance(void *,EXPRESSION *,char *); 44 | 45 | #ifndef _INSCOM_SOURCE_ 46 | #endif 47 | 48 | #endif 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /CLIPS/insqypsr.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Brian L. Dantes */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /*************************************************************/ 20 | 21 | #ifndef _H_insqypsr 22 | #define _H_insqypsr 23 | 24 | #if INSTANCE_SET_QUERIES && (! RUN_TIME) 25 | 26 | #ifndef _H_expressn 27 | #include "expressn.h" 28 | #endif 29 | 30 | #ifdef LOCALE 31 | #undef LOCALE 32 | #endif 33 | 34 | #ifdef _INSQYPSR_SOURCE_ 35 | #define LOCALE 36 | #else 37 | #define LOCALE extern 38 | #endif 39 | 40 | LOCALE EXPRESSION *ParseQueryNoAction(void *,EXPRESSION *,char *); 41 | LOCALE EXPRESSION *ParseQueryAction(void *,EXPRESSION *,char *); 42 | 43 | #ifndef _INSQYPSR_SOURCE_ 44 | #endif 45 | 46 | #endif 47 | 48 | #endif 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /CLIPS/iofun.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.24 07/01/05 */ 5 | /* */ 6 | /* I/O FUNCTIONS HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Gary D. Riley */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* 6.24: Added the get-char function. */ 19 | /* */ 20 | /* Moved IllegalLogicalNameMessage function to */ 21 | /* argacces.c. */ 22 | /* */ 23 | /*************************************************************/ 24 | 25 | #ifndef _H_iofun 26 | 27 | #define _H_iofun 28 | 29 | #ifdef LOCALE 30 | #undef LOCALE 31 | #endif 32 | 33 | #ifdef _IOFUN_SOURCE_ 34 | #define LOCALE 35 | #else 36 | #define LOCALE extern 37 | #endif 38 | 39 | LOCALE void IOFunctionDefinitions(void *); 40 | #if IO_FUNCTIONS 41 | LOCALE intBool SetFullCRLF(void *,intBool); 42 | LOCALE void PrintoutFunction(void *); 43 | LOCALE void ReadFunction(void *,DATA_OBJECT_PTR); 44 | LOCALE int OpenFunction(void *); 45 | LOCALE int CloseFunction(void *); 46 | LOCALE int GetCharFunction(void *); 47 | LOCALE void ReadlineFunction(void *,DATA_OBJECT_PTR); 48 | LOCALE void *FormatFunction(void *); 49 | LOCALE int RemoveFunction(void *); 50 | LOCALE int RenameFunction(void *); 51 | LOCALE void SetLocaleFunction(void *,DATA_OBJECT_PTR); 52 | LOCALE void ReadNumberFunction(void *,DATA_OBJECT_PTR); 53 | #endif 54 | 55 | #endif 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /CLIPS/lgcldpnd.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.24 06/05/06 */ 5 | /* */ 6 | /* LOGICAL DEPENDENCIES HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: Provide support routines for managing truth */ 11 | /* maintenance using the logical conditional element. */ 12 | /* */ 13 | /* Principal Programmer(s): */ 14 | /* Gary D. Riley */ 15 | /* */ 16 | /* Contributing Programmer(s): */ 17 | /* */ 18 | /* Revision History: */ 19 | /* */ 20 | /* 6.24: Renamed BOOLEAN macro type to intBool. */ 21 | /* */ 22 | /*************************************************************/ 23 | 24 | #ifndef _H_lgcldpnd 25 | 26 | #define _H_lgcldpnd 27 | 28 | struct dependency 29 | { 30 | void *dPtr; 31 | struct dependency *next; 32 | }; 33 | 34 | #ifndef _H_match 35 | #include "match.h" 36 | #endif 37 | #ifndef _H_pattern 38 | #include "pattern.h" 39 | #endif 40 | 41 | #ifdef LOCALE 42 | #undef LOCALE 43 | #endif 44 | #ifdef _LGCLDPND_SOURCE_ 45 | #define LOCALE 46 | #else 47 | #define LOCALE extern 48 | #endif 49 | 50 | LOCALE intBool AddLogicalDependencies(void *,struct patternEntity *,int); 51 | LOCALE void RemoveEntityDependencies(void *,struct patternEntity *); 52 | LOCALE void RemovePMDependencies(void *,struct partialMatch *); 53 | LOCALE void DestroyPMDependencies(void *,struct partialMatch *); 54 | LOCALE void RemoveLogicalSupport(void *,struct partialMatch *); 55 | LOCALE void ForceLogicalRetractions(void *); 56 | LOCALE void Dependencies(void *,struct patternEntity *); 57 | LOCALE void Dependents(void *,struct patternEntity *); 58 | LOCALE void DependenciesCommand(void *); 59 | LOCALE void DependentsCommand(void *); 60 | LOCALE void ReturnEntityDependencies(void *,struct patternEntity *); 61 | LOCALE struct partialMatch *FindLogicalBind(struct joinNode *,struct partialMatch *); 62 | 63 | #endif 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /CLIPS/modulbin.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* DEFMODULE BSAVE/BLOAD HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Gary D. Riley */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* Brian L. Dantes */ 17 | /* */ 18 | /* Revision History: */ 19 | /* */ 20 | /*************************************************************/ 21 | 22 | #ifndef _H_modulbin 23 | 24 | #define _H_modulbin 25 | 26 | #ifndef _H_moduldef 27 | #include "moduldef.h" 28 | #endif 29 | 30 | struct bsaveDefmodule 31 | { 32 | unsigned long name; 33 | long importList; 34 | long exportList; 35 | long next; 36 | long bsaveID; 37 | }; 38 | 39 | struct bsaveDefmoduleItemHeader 40 | { 41 | long theModule; 42 | long firstItem; 43 | long lastItem; 44 | }; 45 | 46 | struct bsavePortItem 47 | { 48 | long moduleName; 49 | long constructType; 50 | long constructName; 51 | long next; 52 | }; 53 | 54 | #define ModulePointer(i) ((struct defmodule *) (&DefmoduleData(theEnv)->DefmoduleArray[i])) 55 | 56 | #ifdef LOCALE 57 | #undef LOCALE 58 | #endif 59 | 60 | #ifdef _MODULBIN_SOURCE_ 61 | #define LOCALE 62 | #else 63 | #define LOCALE extern 64 | #endif 65 | 66 | LOCALE void DefmoduleBinarySetup(void *); 67 | LOCALE void UpdateDefmoduleItemHeader 68 | (void *,struct bsaveDefmoduleItemHeader *, 69 | struct defmoduleItemHeader *,int,void *); 70 | 71 | #if BLOAD_AND_BSAVE 72 | LOCALE void AssignBsaveDefmdlItemHdrVals 73 | (struct bsaveDefmoduleItemHeader *, 74 | struct defmoduleItemHeader *); 75 | #endif 76 | 77 | #endif 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /CLIPS/modulbsc.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* DEFMODULE BASIC COMMANDS HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: Implements core commands for the deffacts */ 11 | /* construct such as clear, reset, save, undeffacts, */ 12 | /* ppdeffacts, list-deffacts, and get-deffacts-list. */ 13 | /* */ 14 | /* Principal Programmer(s): */ 15 | /* Gary D. Riley */ 16 | /* */ 17 | /* Contributing Programmer(s): */ 18 | /* Brian L. Dantes */ 19 | /* */ 20 | /* Revision History: */ 21 | /* */ 22 | /*************************************************************/ 23 | 24 | #ifndef _H_modulbsc 25 | #define _H_modulbsc 26 | 27 | #ifndef _H_evaluatn 28 | #include "evaluatn.h" 29 | #endif 30 | 31 | #ifdef LOCALE 32 | #undef LOCALE 33 | #endif 34 | 35 | #ifdef _MODULBSC_SOURCE_ 36 | #define LOCALE 37 | #else 38 | #define LOCALE extern 39 | #endif 40 | 41 | #define GetDefmoduleList(a) EnvGetDefmoduleList(GetCurrentEnvironment(),a) 42 | #define ListDefmodules(a) EnvListDefmodules(GetCurrentEnvironment(),a) 43 | 44 | LOCALE void DefmoduleBasicCommands(void *); 45 | LOCALE void EnvGetDefmoduleList(void *,DATA_OBJECT_PTR); 46 | LOCALE void PPDefmoduleCommand(void *); 47 | LOCALE int PPDefmodule(void *,char *,char *); 48 | LOCALE void ListDefmodulesCommand(void *); 49 | LOCALE void EnvListDefmodules(void *,char *); 50 | 51 | #endif 52 | 53 | -------------------------------------------------------------------------------- /CLIPS/modulcmp.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* DEFMODULE CONSTRUCT COMPILER HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: Implements the constructs-to-c feature for the */ 11 | /* defmodule construct. */ 12 | /* */ 13 | /* Principal Programmer(s): */ 14 | /* Gary D. Riley */ 15 | /* */ 16 | /* Contributing Programmer(s): */ 17 | /* */ 18 | /* Revision History: */ 19 | /* */ 20 | /*************************************************************/ 21 | 22 | #ifndef _H_modulcmp 23 | 24 | #define _H_modulcmp 25 | 26 | #ifndef _STDIO_INCLUDED_ 27 | #define _STDIO_INCLUDED_ 28 | #include 29 | #endif 30 | 31 | #ifndef _H_moduldef 32 | #include "moduldef.h" 33 | #endif 34 | 35 | #ifdef LOCALE 36 | #undef LOCALE 37 | #endif 38 | 39 | #ifdef _MODULCMP_SOURCE_ 40 | #define LOCALE 41 | #else 42 | #define LOCALE extern 43 | #endif 44 | 45 | LOCALE void DefmoduleCompilerSetup(void *); 46 | LOCALE void PrintDefmoduleReference(void *,FILE *,struct defmodule *); 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /CLIPS/modulpsr.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* DEFMODULE PARSER HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Gary D. Riley */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /*************************************************************/ 20 | 21 | #ifndef _H_modulpsr 22 | #define _H_modulpsr 23 | 24 | struct portConstructItem 25 | { 26 | char *constructName; 27 | int typeExpected; 28 | struct portConstructItem *next; 29 | }; 30 | 31 | #ifndef _H_symbol 32 | #include "symbol.h" 33 | #endif 34 | #ifndef _H_evaluatn 35 | #include "evaluatn.h" 36 | #endif 37 | #ifndef _H_moduldef 38 | #include "moduldef.h" 39 | #endif 40 | 41 | #ifdef LOCALE 42 | #undef LOCALE 43 | #endif 44 | 45 | #ifdef _MODULPSR_SOURCE_ 46 | #define LOCALE 47 | #else 48 | #define LOCALE extern 49 | #endif 50 | 51 | LOCALE long GetNumberOfDefmodules(void *); 52 | LOCALE void SetNumberOfDefmodules(void *,long); 53 | LOCALE void AddAfterModuleDefinedFunction(void *,char *,void (*)(void *),int); 54 | LOCALE int ParseDefmodule(void *,char *); 55 | LOCALE void AddPortConstructItem(void *,char *,int); 56 | LOCALE struct portConstructItem *ValidPortConstructItem(void *,char *); 57 | LOCALE int FindImportExportConflict(void *,char *,struct defmodule *,char *); 58 | 59 | #endif 60 | 61 | 62 | -------------------------------------------------------------------------------- /CLIPS/msgpsr.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Brian L. Dantes */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /*************************************************************/ 20 | 21 | #ifndef _H_msgpsr 22 | #define _H_msgpsr 23 | 24 | #if OBJECT_SYSTEM && (! BLOAD_ONLY) && (! RUN_TIME) 25 | 26 | #define SELF_STRING "self" 27 | 28 | #ifndef _H_object 29 | #include "object.h" 30 | #endif 31 | 32 | #ifdef LOCALE 33 | #undef LOCALE 34 | #endif 35 | 36 | #ifdef _MSGCOM_SOURCE_ 37 | #define LOCALE 38 | #else 39 | #define LOCALE extern 40 | #endif 41 | 42 | LOCALE int ParseDefmessageHandler(void *,char *); 43 | LOCALE void CreateGetAndPutHandlers(void *,SLOT_DESC *); 44 | 45 | #endif 46 | 47 | #endif 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /CLIPS/objbin.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Brian L. Dantes */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /*************************************************************/ 20 | 21 | #ifndef _H_objbin 22 | #define _H_objbin 23 | 24 | #ifndef _H_object 25 | #include "object.h" 26 | #endif 27 | 28 | #define OBJECTBIN_DATA 33 29 | 30 | struct objectBinaryData 31 | { 32 | DEFCLASS *DefclassArray; 33 | long ModuleCount; 34 | long ClassCount; 35 | long LinkCount; 36 | long SlotCount; 37 | long SlotNameCount; 38 | long TemplateSlotCount; 39 | long SlotNameMapCount; 40 | long HandlerCount; 41 | DEFCLASS_MODULE *ModuleArray; 42 | DEFCLASS **LinkArray; 43 | SLOT_DESC *SlotArray; 44 | SLOT_DESC **TmpslotArray; 45 | SLOT_NAME *SlotNameArray; 46 | unsigned *MapslotArray; 47 | HANDLER *HandlerArray; 48 | unsigned *MaphandlerArray; 49 | }; 50 | 51 | #define ObjectBinaryData(theEnv) ((struct objectBinaryData *) GetEnvironmentData(theEnv,OBJECTBIN_DATA)) 52 | 53 | #define DefclassPointer(i) (((i) == -1L) ? NULL : (DEFCLASS *) &ObjectBinaryData(theEnv)->DefclassArray[i]) 54 | #define DefclassIndex(cls) (((cls) == NULL) ? -1 : ((struct constructHeader *) cls)->bsaveID) 55 | 56 | 57 | #ifdef LOCALE 58 | #undef LOCALE 59 | #endif 60 | 61 | #ifdef _OBJBIN_SOURCE_ 62 | #define LOCALE 63 | #else 64 | #define LOCALE extern 65 | #endif 66 | 67 | LOCALE void SetupObjectsBload(void *); 68 | LOCALE void *BloadDefclassModuleReference(void *,int); 69 | 70 | #endif 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /CLIPS/objcmp.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: Object System Construct Compiler Code */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Brian L. Dantes */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /*************************************************************/ 20 | 21 | #ifndef _H_objcmp 22 | #define _H_objcmp 23 | 24 | #ifndef _STDIO_INCLUDED_ 25 | #include 26 | #define _STDIO_INCLUDED_ 27 | #endif 28 | 29 | #ifndef _H_conscomp 30 | #include "conscomp.h" 31 | #endif 32 | #ifndef _H_object 33 | #include "object.h" 34 | #endif 35 | 36 | #define OBJECT_COMPILER_DATA 36 37 | 38 | struct objectCompilerData 39 | { 40 | #if CONSTRUCT_COMPILER && (! RUN_TIME) 41 | struct CodeGeneratorItem *ObjectCodeItem; 42 | #endif 43 | }; 44 | 45 | #define ObjectCompilerData(theEnv) ((struct objectCompilerData *) GetEnvironmentData(theEnv,OBJECT_COMPILER_DATA)) 46 | 47 | #ifdef LOCALE 48 | #undef LOCALE 49 | #endif 50 | 51 | #ifdef _OBJCMP_SOURCE_ 52 | #define LOCALE 53 | #else 54 | #define LOCALE extern 55 | #endif 56 | 57 | LOCALE void SetupObjectsCompiler(void *); 58 | LOCALE void PrintClassReference(void *,FILE *,DEFCLASS *,int,int); 59 | LOCALE void DefclassCModuleReference(void *,FILE *,int,int,int); 60 | 61 | #endif 62 | 63 | -------------------------------------------------------------------------------- /CLIPS/objrtbin.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.24 05/17/06 */ 5 | /* */ 6 | /* */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Brian L. Dantes */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /* 6.24: Converted INSTANCE_PATTERN_MATCHING to */ 20 | /* DEFRULE_CONSTRUCT. */ 21 | /* */ 22 | /*************************************************************/ 23 | 24 | #ifndef _H_objrtbin 25 | #define _H_objrtbin 26 | 27 | #if DEFRULE_CONSTRUCT && OBJECT_SYSTEM 28 | 29 | #define OBJECTRETEBIN_DATA 34 30 | 31 | struct objectReteBinaryData 32 | { 33 | long AlphaNodeCount; 34 | long PatternNodeCount; 35 | OBJECT_ALPHA_NODE *AlphaArray; 36 | OBJECT_PATTERN_NODE *PatternArray; 37 | }; 38 | 39 | #define ObjectReteBinaryData(theEnv) ((struct objectReteBinaryData *) GetEnvironmentData(theEnv,OBJECTRETEBIN_DATA)) 40 | 41 | 42 | #ifdef LOCALE 43 | #undef LOCALE 44 | #endif 45 | 46 | #ifdef _OBJRTBIN_SOURCE_ 47 | #define LOCALE 48 | #else 49 | #define LOCALE extern 50 | #endif 51 | 52 | LOCALE void SetupObjectPatternsBload(void *); 53 | 54 | #endif 55 | 56 | #endif 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /CLIPS/objrtbld.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.24 05/17/06 */ 5 | /* */ 6 | /* OBJECT PATTERN MATCHER MODULE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Brian L. Dantes */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /* 6.24: Converted INSTANCE_PATTERN_MATCHING to */ 20 | /* DEFRULE_CONSTRUCT. */ 21 | /* */ 22 | /*************************************************************/ 23 | 24 | #ifndef _H_objrtbld 25 | #define _H_objrtbld 26 | 27 | #if DEFRULE_CONSTRUCT && OBJECT_SYSTEM 28 | 29 | #ifdef LOCALE 30 | #undef LOCALE 31 | #endif 32 | 33 | #ifdef _OBJRTBLD_SOURCE_ 34 | #define LOCALE 35 | #else 36 | #define LOCALE extern 37 | #endif 38 | 39 | LOCALE void SetupObjectPatternStuff(void *); 40 | 41 | #endif 42 | 43 | #endif 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /CLIPS/objrtcmp.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.24 05/17/06 */ 5 | /* */ 6 | /* */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Brian L. Dantes */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /* 6.24: Converted INSTANCE_PATTERN_MATCHING to */ 20 | /* DEFRULE_CONSTRUCT. */ 21 | /* */ 22 | /*************************************************************/ 23 | 24 | #ifndef _H_objrtcmp 25 | #define _H_objrtcmp 26 | 27 | #if DEFRULE_CONSTRUCT && OBJECT_SYSTEM && (! RUN_TIME) && CONSTRUCT_COMPILER 28 | 29 | #ifndef _STDIO_INCLUDED_ 30 | #include 31 | #define _STDIO_INCLUDED_ 32 | #endif 33 | 34 | #ifdef LOCALE 35 | #undef LOCALE 36 | #endif 37 | 38 | #ifdef _OBJRTCMP_SOURCE_ 39 | #define LOCALE 40 | #else 41 | #define LOCALE extern 42 | #endif 43 | 44 | LOCALE void ObjectPatternsCompilerSetup(void *); 45 | LOCALE void ObjectPatternNodeReference(void *,void *,FILE *,int,int); 46 | 47 | #endif 48 | 49 | #endif 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /CLIPS/objrtgen.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.24 05/17/06 */ 5 | /* */ 6 | /* */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Brian L. Dantes */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /* 6.24: Converted INSTANCE_PATTERN_MATCHING to */ 20 | /* DEFRULE_CONSTRUCT. */ 21 | /* */ 22 | /*************************************************************/ 23 | 24 | #ifndef _H_objrtgen 25 | #define _H_objrtgen 26 | 27 | #if DEFRULE_CONSTRUCT && OBJECT_SYSTEM && (! RUN_TIME) && (! BLOAD_ONLY) 28 | 29 | #ifndef _H_expressn 30 | #include "expressn.h" 31 | #endif 32 | #ifndef _H_reorder 33 | #include "reorder.h" 34 | #endif 35 | 36 | #ifdef LOCALE 37 | #undef LOCALE 38 | #endif 39 | 40 | #ifdef _OBJRTGEN_SOURCE_ 41 | #define LOCALE 42 | #else 43 | #define LOCALE extern 44 | #endif 45 | 46 | LOCALE void ReplaceGetJNObjectValue(void *,EXPRESSION *,struct lhsParseNode *,int); 47 | LOCALE EXPRESSION *GenGetJNObjectValue(void *,struct lhsParseNode *,int); 48 | LOCALE EXPRESSION *ObjectJNVariableComparison(void *,struct lhsParseNode *,struct lhsParseNode *,int); 49 | LOCALE EXPRESSION *GenObjectPNConstantCompare(void *,struct lhsParseNode *); 50 | LOCALE void ReplaceGetPNObjectValue(void *,EXPRESSION *,struct lhsParseNode *); 51 | LOCALE EXPRESSION *GenGetPNObjectValue(void *,struct lhsParseNode *); 52 | LOCALE EXPRESSION *ObjectPNVariableComparison(void *,struct lhsParseNode *,struct lhsParseNode *); 53 | LOCALE void GenObjectLengthTest(void *,struct lhsParseNode *); 54 | LOCALE void GenObjectZeroLengthTest(void *,struct lhsParseNode *); 55 | 56 | #endif 57 | 58 | #endif 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /CLIPS/parsefun.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* PARSING FUNCTIONS HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: Contains the code for several parsing related */ 11 | /* functions including... */ 12 | /* */ 13 | /* Principal Programmer(s): */ 14 | /* Gary D. Riley */ 15 | /* */ 16 | /* Contributing Programmer(s): */ 17 | /* */ 18 | /* Revision History: */ 19 | /* */ 20 | /*************************************************************/ 21 | 22 | #ifndef _H_parsefun 23 | 24 | #define _H_parsefun 25 | 26 | #ifndef _H_evaluatn 27 | #include "evaluatn.h" 28 | #endif 29 | 30 | #ifdef LOCALE 31 | #undef LOCALE 32 | #endif 33 | 34 | #ifdef _PARSEFUN_SOURCE_ 35 | #define LOCALE 36 | #else 37 | #define LOCALE extern 38 | #endif 39 | 40 | LOCALE void ParseFunctionDefinitions(void *); 41 | LOCALE void CheckSyntaxFunction(void *,DATA_OBJECT *); 42 | LOCALE int CheckSyntax(void *,char *,DATA_OBJECT_PTR); 43 | 44 | #endif 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /CLIPS/pprint.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* PRETTY PRINT HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: Routines for processing the pretty print */ 11 | /* representation of constructs. */ 12 | /* */ 13 | /* Principal Programmer(s): */ 14 | /* Gary D. Riley */ 15 | /* */ 16 | /* Contributing Programmer(s): */ 17 | /* */ 18 | /* Revision History: */ 19 | /* */ 20 | /*************************************************************/ 21 | 22 | #ifndef _H_pprint 23 | #define _H_pprint 24 | 25 | #define PRETTY_PRINT_DATA 52 26 | 27 | struct prettyPrintData 28 | { 29 | int PPBufferStatus; 30 | int PPBufferEnabled; 31 | int IndentationDepth; 32 | size_t PPBufferPos; 33 | size_t PPBufferMax; 34 | size_t PPBackupOnce; 35 | size_t PPBackupTwice; 36 | char *PrettyPrintBuffer; 37 | }; 38 | 39 | #define PrettyPrintData(theEnv) ((struct prettyPrintData *) GetEnvironmentData(theEnv,PRETTY_PRINT_DATA)) 40 | 41 | #ifdef LOCALE 42 | #undef LOCALE 43 | #endif 44 | 45 | #ifdef _PPRINT_SOURCE_ 46 | #define LOCALE 47 | #else 48 | #define LOCALE extern 49 | #endif 50 | 51 | LOCALE void InitializePrettyPrintData(void *); 52 | LOCALE void FlushPPBuffer(void *); 53 | LOCALE void DestroyPPBuffer(void *); 54 | LOCALE void SavePPBuffer(void *,char *); 55 | LOCALE void PPBackup(void *); 56 | LOCALE char *CopyPPBuffer(void *); 57 | LOCALE char *GetPPBuffer(void *); 58 | LOCALE void PPCRAndIndent(void *); 59 | LOCALE void IncrementIndentDepth(void *,int); 60 | LOCALE void DecrementIndentDepth(void *,int); 61 | LOCALE void SetIndentDepth(void *,int); 62 | LOCALE void SetPPBufferStatus(void *,int); 63 | LOCALE int GetPPBufferStatus(void *); 64 | LOCALE int SetPPBufferEnabled(void *,int); 65 | LOCALE int GetPPBufferEnabled(void *); 66 | 67 | #endif 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /CLIPS/prcdrpsr.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.24 06/05/06 */ 5 | /* */ 6 | /* PROCEDURAL FUNCTIONS PARSER HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Gary D. Riley */ 14 | /* Brian L. Dantes */ 15 | /* */ 16 | /* Contributing Programmer(s): */ 17 | /* */ 18 | /* Revision History: */ 19 | /* */ 20 | /* 6.24: Renamed BOOLEAN macro type to intBool. */ 21 | /* */ 22 | /*************************************************************/ 23 | 24 | #ifndef _H_prcdrpsr 25 | 26 | #define _H_prcdrpsr 27 | 28 | #ifndef _H_constrnt 29 | #include "constrnt.h" 30 | #endif 31 | 32 | #ifdef LOCALE 33 | #undef LOCALE 34 | #endif 35 | 36 | #ifdef _PRCDRPSR_SOURCE 37 | #define LOCALE 38 | #else 39 | #define LOCALE extern 40 | #endif 41 | 42 | struct BindInfo 43 | { 44 | struct symbolHashNode *name; 45 | CONSTRAINT_RECORD *constraints; 46 | struct BindInfo *next; 47 | }; 48 | 49 | #if (! RUN_TIME) 50 | LOCALE void ProceduralFunctionParsers(void *); 51 | LOCALE struct BindInfo *GetParsedBindNames(void *); 52 | LOCALE void SetParsedBindNames(void *,struct BindInfo *); 53 | LOCALE void ClearParsedBindNames(void *); 54 | LOCALE intBool ParsedBindNamesEmpty(void *); 55 | #endif 56 | #if (! BLOAD_ONLY) && (! RUN_TIME) 57 | LOCALE int SearchParsedBindNames(void *,struct symbolHashNode *); 58 | LOCALE int CountParsedBindNames(void *); 59 | LOCALE void RemoveParsedBindName(void *,struct symbolHashNode *); 60 | LOCALE struct constraintRecord *FindBindConstraints(void *,struct symbolHashNode *); 61 | #endif 62 | 63 | #endif 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /CLIPS/prdctfun.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.24 06/05/06 */ 5 | /* */ 6 | /* PREDICATE FUNCTIONS HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Gary D. Riley */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /* 6.24: Renamed BOOLEAN macro type to intBool. */ 20 | /* */ 21 | /*************************************************************/ 22 | 23 | #ifndef _H_prdctfun 24 | 25 | #define _H_prdctfun 26 | 27 | #ifdef LOCALE 28 | #undef LOCALE 29 | #endif 30 | 31 | #ifdef _PRDCTFUN_SOURCE_ 32 | #define LOCALE 33 | #else 34 | #define LOCALE extern 35 | #endif 36 | 37 | LOCALE void PredicateFunctionDefinitions(void *); 38 | LOCALE intBool EqFunction(void *); 39 | LOCALE intBool NeqFunction(void *); 40 | LOCALE intBool StringpFunction(void *); 41 | LOCALE intBool SymbolpFunction(void *); 42 | LOCALE intBool LexemepFunction(void *); 43 | LOCALE intBool NumberpFunction(void *); 44 | LOCALE intBool FloatpFunction(void *); 45 | LOCALE intBool IntegerpFunction(void *); 46 | LOCALE intBool MultifieldpFunction(void *); 47 | LOCALE intBool PointerpFunction(void *); 48 | LOCALE intBool NotFunction(void *); 49 | LOCALE intBool AndFunction(void *); 50 | LOCALE intBool OrFunction(void *); 51 | LOCALE intBool LessThanOrEqualFunction(void *); 52 | LOCALE intBool GreaterThanOrEqualFunction(void *); 53 | LOCALE intBool LessThanFunction(void *); 54 | LOCALE intBool GreaterThanFunction(void *); 55 | LOCALE intBool NumericEqualFunction(void *); 56 | LOCALE intBool NumericNotEqualFunction(void *); 57 | LOCALE intBool OddpFunction(void *); 58 | LOCALE intBool EvenpFunction(void *); 59 | 60 | #endif 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /CLIPS/retract.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.30 10/19/06 */ 5 | /* */ 6 | /* RETRACT HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: Handles join network activity associated with */ 11 | /* with the removal of a data entity such as a fact or */ 12 | /* instance. */ 13 | /* */ 14 | /* Principal Programmer(s): */ 15 | /* Gary D. Riley */ 16 | /* */ 17 | /* Contributing Programmer(s): */ 18 | /* */ 19 | /* Revision History: */ 20 | /* */ 21 | /* 6.24: Rule with exists CE has incorrect activation. */ 22 | /* DR0867 */ 23 | /* */ 24 | /* 6.30: Added support for hashed alpha memories. */ 25 | /* */ 26 | /* Added additional developer statistics to help */ 27 | /* analyze join network performance. */ 28 | /* */ 29 | /*************************************************************/ 30 | 31 | #ifndef _H_retract 32 | #define _H_retract 33 | 34 | #ifndef _H_match 35 | #include "match.h" 36 | #endif 37 | #ifndef _H_network 38 | #include "network.h" 39 | #endif 40 | 41 | #ifdef LOCALE 42 | #undef LOCALE 43 | #endif 44 | 45 | #ifdef _RETRACT_SOURCE_ 46 | #define LOCALE 47 | #else 48 | #define LOCALE extern 49 | #endif 50 | 51 | struct rdriveinfo 52 | { 53 | struct partialMatch *link; 54 | struct joinNode *jlist; 55 | struct rdriveinfo *next; 56 | }; 57 | 58 | LOCALE void NetworkRetract(void *,struct patternMatch *); 59 | LOCALE void ReturnPartialMatch(void *,struct partialMatch *); 60 | LOCALE void DestroyPartialMatch(void *,struct partialMatch *); 61 | LOCALE void FlushGarbagePartialMatches(void *); 62 | LOCALE void DeletePartialMatches(void *,struct partialMatch *); 63 | LOCALE void PosEntryRetractBeta(void *,struct partialMatch *,struct partialMatch *); 64 | LOCALE void PosEntryRetractAlpha(void *,struct partialMatch *); 65 | 66 | #endif 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /CLIPS/rulebld.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* RULE BUILD HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: Provides routines to ntegrates a set of pattern */ 11 | /* and join tests associated with a rule into the pattern */ 12 | /* and join networks. The joins are integrated into the */ 13 | /* join network by routines in this module. The pattern */ 14 | /* is integrated by calling the external routine */ 15 | /* associated with the pattern parser that originally */ 16 | /* parsed the pattern. */ 17 | /* */ 18 | /* Principal Programmer(s): */ 19 | /* Gary D. Riley */ 20 | /* */ 21 | /* Contributing Programmer(s): */ 22 | /* */ 23 | /* Revision History: */ 24 | /* */ 25 | /*************************************************************/ 26 | 27 | #ifndef _H_rulebld 28 | 29 | #define _H_rulebld 30 | 31 | #ifndef _H_reorder 32 | #include "reorder.h" 33 | #endif 34 | #ifndef _H_network 35 | #include "network.h" 36 | #endif 37 | 38 | #ifdef LOCALE 39 | #undef LOCALE 40 | #endif 41 | 42 | #ifdef _RULEBLD_SOURCE_ 43 | #define LOCALE 44 | #else 45 | #define LOCALE extern 46 | #endif 47 | 48 | LOCALE struct joinNode *ConstructJoins(void *,int,struct lhsParseNode *,int); 49 | 50 | #endif 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /CLIPS/rulecmp.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* DEFRULE CONSTRUCT COMPILER HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: Implements the constructs-to-c feature for the */ 11 | /* defrule construct. */ 12 | /* */ 13 | /* Principal Programmer(s): */ 14 | /* Gary D. Riley */ 15 | /* */ 16 | /* Contributing Programmer(s): */ 17 | /* */ 18 | /* Revision History: */ 19 | /* */ 20 | /*************************************************************/ 21 | 22 | #ifndef _H_rulecmp 23 | #define _H_rulecmp 24 | 25 | #include "conscomp.h" 26 | #ifndef _H_extnfunc 27 | #include "extnfunc.h" 28 | #endif 29 | 30 | #define JoinPrefix() ArbitraryPrefix(DefruleData(theEnv)->DefruleCodeItem,2) 31 | #define LinkPrefix() ArbitraryPrefix(DefruleData(theEnv)->DefruleCodeItem,3) 32 | 33 | #ifdef LOCALE 34 | #undef LOCALE 35 | #endif 36 | 37 | #ifdef _RULECMP_SOURCE_ 38 | #define LOCALE 39 | #else 40 | #define LOCALE extern 41 | #endif 42 | 43 | LOCALE void DefruleCompilerSetup(void *); 44 | LOCALE void DefruleCModuleReference(void *,FILE *,int,int,int); 45 | 46 | #ifndef _RULECMP_SOURCE_ 47 | extern struct CodeGeneratorItem *DefruleCodeItem; 48 | #endif 49 | 50 | #endif 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /CLIPS/rulecstr.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.24 06/05/06 */ 5 | /* */ 6 | /* RULE CONSTRAINTS HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: Provides routines for detecting constraint */ 11 | /* conflicts in the LHS and RHS of rules. */ 12 | /* */ 13 | /* Principal Programmer(s): */ 14 | /* Gary D. Riley */ 15 | /* */ 16 | /* Contributing Programmer(s): */ 17 | /* */ 18 | /* Revision History: */ 19 | /* */ 20 | /* 6.24: Renamed BOOLEAN macro type to intBool. */ 21 | /* */ 22 | /*************************************************************/ 23 | 24 | #ifndef _H_rulecstr 25 | 26 | #define _H_rulecstr 27 | 28 | #ifdef LOCALE 29 | #undef LOCALE 30 | #endif 31 | #ifdef _RULECSTR_SOURCE_ 32 | #define LOCALE 33 | #else 34 | #define LOCALE extern 35 | #endif 36 | 37 | LOCALE struct lhsParseNode *GetExpressionVarConstraints(void *,struct lhsParseNode *); 38 | LOCALE struct lhsParseNode *DeriveVariableConstraints(void *,struct lhsParseNode *); 39 | LOCALE intBool ProcessConnectedConstraints(void *,struct lhsParseNode *,struct lhsParseNode *,struct lhsParseNode *); 40 | LOCALE void ConstraintReferenceErrorMessage(void *, 41 | struct symbolHashNode *, 42 | struct lhsParseNode *, 43 | int,int, 44 | struct symbolHashNode *, 45 | int); 46 | LOCALE intBool CheckRHSForConstraintErrors(void *,struct expr *,struct lhsParseNode *); 47 | 48 | #endif 49 | 50 | -------------------------------------------------------------------------------- /CLIPS/ruledlt.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* RULE DELETION MODULE HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: Provides routines for deleting a rule including */ 11 | /* freeing the defrule data structures and removing the */ 12 | /* appropriate joins from the join network. */ 13 | /* */ 14 | /* Principal Programmer(s): */ 15 | /* Gary D. Riley */ 16 | /* */ 17 | /* Contributing Programmer(s): */ 18 | /* */ 19 | /* Revision History: */ 20 | /* */ 21 | /*************************************************************/ 22 | 23 | #ifndef _H_ruledlt 24 | 25 | #define _H_ruledlt 26 | 27 | #ifdef LOCALE 28 | #undef LOCALE 29 | #endif 30 | 31 | #ifdef _RULEDLT_SOURCE_ 32 | #define LOCALE 33 | #else 34 | #define LOCALE extern 35 | #endif 36 | 37 | LOCALE void ReturnDefrule(void *,void *); 38 | LOCALE void DestroyDefrule(void *,void *); 39 | 40 | #endif 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /CLIPS/rulelhs.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* DEFRULE LHS PARSING HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: Coordinates parsing of the LHS conditional */ 11 | /* elements of a rule. */ 12 | /* */ 13 | /* Principal Programmer(s): */ 14 | /* Gary D. Riley */ 15 | /* */ 16 | /* Contributing Programmer(s): */ 17 | /* */ 18 | /* Revision History: */ 19 | /* */ 20 | /*************************************************************/ 21 | 22 | #ifndef _H_rulelhs 23 | #define _H_rulelhs 24 | 25 | #ifndef _H_expressn 26 | #include "expressn.h" 27 | #endif 28 | #ifndef _H_reorder 29 | #include "reorder.h" 30 | #endif 31 | #ifndef _H_scanner 32 | #include "scanner.h" 33 | #endif 34 | #ifndef _H_pattern 35 | #include "pattern.h" 36 | #endif 37 | 38 | #ifdef LOCALE 39 | #undef LOCALE 40 | #endif 41 | 42 | #ifdef _RULELHS_SOURCE_ 43 | #define LOCALE 44 | #else 45 | #define LOCALE extern 46 | #endif 47 | 48 | LOCALE struct lhsParseNode *ParseRuleLHS(void *,char *,struct token *,char *,int *); 49 | LOCALE void PropagatePatternType(struct lhsParseNode *,struct patternParser *); 50 | 51 | #endif 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /CLIPS/rulepsr.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* RULE PARSING HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: Coordinates parsing of a rule. */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Gary D. Riley */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /*************************************************************/ 20 | 21 | #ifndef _H_rulepsr 22 | #define _H_rulepsr 23 | 24 | #ifdef LOCALE 25 | #undef LOCALE 26 | #endif 27 | 28 | #ifdef _RULEPSR_SOURCE_ 29 | #define LOCALE 30 | #else 31 | #define LOCALE extern 32 | #endif 33 | 34 | LOCALE int ParseDefrule(void *,char *); 35 | LOCALE struct lhsParseNode *FindVariable(struct symbolHashNode *, 36 | struct lhsParseNode *); 37 | 38 | #endif 39 | 40 | 41 | -------------------------------------------------------------------------------- /CLIPS/scanner.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* SCANNER HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: Routines for scanning lexical tokens from an */ 11 | /* input source. */ 12 | /* */ 13 | /* Principal Programmer(s): */ 14 | /* Gary D. Riley */ 15 | /* */ 16 | /* Contributing Programmer(s): */ 17 | /* */ 18 | /* Revision History: */ 19 | /* */ 20 | /*************************************************************/ 21 | 22 | #ifndef _H_scanner 23 | #define _H_scanner 24 | 25 | struct token; 26 | 27 | #ifndef _H_pprint 28 | #include "pprint.h" 29 | #endif 30 | 31 | #ifdef LOCALE 32 | #undef LOCALE 33 | #endif 34 | 35 | #ifdef _SCANNER_SOURCE_ 36 | #define LOCALE 37 | #else 38 | #define LOCALE extern 39 | #endif 40 | 41 | struct token 42 | { 43 | unsigned short type; 44 | void *value; 45 | char *printForm; 46 | }; 47 | 48 | #define SCANNER_DATA 57 49 | 50 | struct scannerData 51 | { 52 | char *GlobalString; 53 | size_t GlobalMax; 54 | size_t GlobalPos; 55 | long LineCount; 56 | int IgnoreCompletionErrors; 57 | }; 58 | 59 | #define ScannerData(theEnv) ((struct scannerData *) GetEnvironmentData(theEnv,SCANNER_DATA)) 60 | 61 | LOCALE void InitializeScannerData(void *); 62 | LOCALE void GetToken(void *,char *,struct token *); 63 | LOCALE void CopyToken(struct token *,struct token *); 64 | LOCALE void ResetLineCount(void *); 65 | LOCALE long GetLineCount(void *); 66 | LOCALE void IncrementLineCount(void *); 67 | LOCALE void DecrementLineCount(void *); 68 | 69 | #endif 70 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /CLIPS/sortfun.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* SORT FUNCTIONS HEADER MODULE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: Contains the code for sorting functions. */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Gary D. Riley */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /*************************************************************/ 20 | 21 | #ifndef _H_sortfun 22 | 23 | #define _H_sortfun 24 | 25 | #ifdef LOCALE 26 | #undef LOCALE 27 | #endif 28 | 29 | #ifdef _SORTFUN_SOURCE_ 30 | #define LOCALE 31 | #else 32 | #define LOCALE extern 33 | #endif 34 | 35 | LOCALE void SortFunctionDefinitions(void *); 36 | LOCALE void MergeSort(void *,unsigned long,DATA_OBJECT *, 37 | int (*)(void *,DATA_OBJECT *,DATA_OBJECT *)); 38 | LOCALE void SortFunction(void *,DATA_OBJECT *); 39 | 40 | #endif 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /CLIPS/strngfun.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.21 06/15/03 */ 5 | /* */ 6 | /* STRING FUNCTIONS HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Gary D. Riley */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /*************************************************************/ 20 | 21 | #ifndef _H_strngfun 22 | 23 | #define _H_strngfun 24 | 25 | #ifndef _H_evaluatn 26 | #include "evaluatn.h" 27 | #endif 28 | 29 | #ifdef LOCALE 30 | #undef LOCALE 31 | #endif 32 | 33 | #ifdef _STRNGFUN_SOURCE_ 34 | #define LOCALE 35 | #else 36 | #define LOCALE extern 37 | #endif 38 | 39 | #if ALLOW_ENVIRONMENT_GLOBALS 40 | LOCALE int Build(char *); 41 | LOCALE int Eval(char *,DATA_OBJECT_PTR); 42 | #endif 43 | 44 | LOCALE int EnvBuild(void *,char *); 45 | LOCALE int EnvEval(void *,char *,DATA_OBJECT_PTR); 46 | LOCALE void StringFunctionDefinitions(void *); 47 | LOCALE void StrCatFunction(void *,DATA_OBJECT_PTR); 48 | LOCALE void SymCatFunction(void *,DATA_OBJECT_PTR); 49 | LOCALE long long StrLengthFunction(void *); 50 | LOCALE void UpcaseFunction(void *,DATA_OBJECT_PTR); 51 | LOCALE void LowcaseFunction(void *,DATA_OBJECT_PTR); 52 | LOCALE long long StrCompareFunction(void *); 53 | LOCALE void *SubStringFunction(void *); 54 | LOCALE void StrIndexFunction(void *,DATA_OBJECT_PTR); 55 | LOCALE void EvalFunction(void *,DATA_OBJECT_PTR); 56 | LOCALE int BuildFunction(void *); 57 | LOCALE void StringToFieldFunction(void *,DATA_OBJECT *); 58 | LOCALE void StringToField(void *,char *,DATA_OBJECT *); 59 | 60 | #endif 61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /CLIPS/strngrtr.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* STRING I/O ROUTER HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: I/O Router routines which allow strings to be */ 11 | /* used as input and output sources. */ 12 | /* */ 13 | /* Principal Programmer(s): */ 14 | /* Gary D. Riley */ 15 | /* */ 16 | /* Contributing Programmer(s): */ 17 | /* */ 18 | /* Revision History: */ 19 | /* */ 20 | /*************************************************************/ 21 | 22 | #ifndef _H_strngrtr 23 | #define _H_strngrtr 24 | 25 | #ifndef _STDIO_INCLUDED_ 26 | #define _STDIO_INCLUDED_ 27 | #include 28 | #endif 29 | 30 | #define STRING_ROUTER_DATA 48 31 | 32 | struct stringRouter 33 | { 34 | char *name; 35 | char *str; 36 | size_t currentPosition; 37 | size_t maximumPosition; 38 | int readWriteType; 39 | struct stringRouter *next; 40 | }; 41 | 42 | struct stringRouterData 43 | { 44 | struct stringRouter *ListOfStringRouters; 45 | }; 46 | 47 | #define StringRouterData(theEnv) ((struct stringRouterData *) GetEnvironmentData(theEnv,STRING_ROUTER_DATA)) 48 | 49 | #ifdef LOCALE 50 | #undef LOCALE 51 | #endif 52 | 53 | #ifdef _STRNGRTR_SOURCE_ 54 | #define LOCALE 55 | #else 56 | #define LOCALE extern 57 | #endif 58 | 59 | /**************************/ 60 | /* I/O ROUTER DEFINITIONS */ 61 | /**************************/ 62 | 63 | LOCALE void InitializeStringRouter(void *); 64 | LOCALE int OpenStringSource(void *,char *,char *,size_t); 65 | LOCALE int OpenTextSource(void *,char *,char *,size_t,size_t); 66 | LOCALE int CloseStringSource(void *,char *); 67 | LOCALE int OpenStringDestination(void *,char *,char *,size_t); 68 | LOCALE int CloseStringDestination(void *,char *); 69 | 70 | #endif 71 | 72 | 73 | -------------------------------------------------------------------------------- /CLIPS/symblbin.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* SYMBOL BINARY SAVE HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: Implements the binary save/load feature for */ 11 | /* atomic data values. */ 12 | /* */ 13 | /* Principal Programmer(s): */ 14 | /* Gary D. Riley */ 15 | /* Brian L. Dantes */ 16 | /* */ 17 | /* Contributing Programmer(s): */ 18 | /* */ 19 | /* Revision History: */ 20 | /* */ 21 | /*************************************************************/ 22 | 23 | #ifndef _H_symblbin 24 | #define _H_symblbin 25 | 26 | #ifndef _STDIO_INCLUDED_ 27 | #define _STDIO_INCLUDED_ 28 | #include 29 | #endif 30 | 31 | #ifndef _H_symbol 32 | #include "symbol.h" 33 | #endif 34 | 35 | #ifdef LOCALE 36 | #undef LOCALE 37 | #endif 38 | 39 | #ifdef _SYMBLBIN_SOURCE_ 40 | #define LOCALE 41 | #else 42 | #define LOCALE extern 43 | #endif 44 | 45 | #define BitMapPointer(i) ((BITMAP_HN *) (SymbolData(theEnv)->BitMapArray[i])) 46 | #define SymbolPointer(i) ((SYMBOL_HN *) (SymbolData(theEnv)->SymbolArray[i])) 47 | #define FloatPointer(i) ((FLOAT_HN *) (SymbolData(theEnv)->FloatArray[i])) 48 | #define IntegerPointer(i) ((INTEGER_HN *) (SymbolData(theEnv)->IntegerArray[i])) 49 | 50 | LOCALE void MarkNeededAtomicValues(void); 51 | LOCALE void WriteNeededAtomicValues(void *,FILE *); 52 | LOCALE void ReadNeededAtomicValues(void *); 53 | LOCALE void InitAtomicValueNeededFlags(void *); 54 | LOCALE void FreeAtomicValueStorage(void *); 55 | LOCALE void WriteNeededSymbols(void *,FILE *); 56 | LOCALE void WriteNeededFloats(void *,FILE *); 57 | LOCALE void WriteNeededIntegers(void *,FILE *); 58 | LOCALE void ReadNeededSymbols(void *); 59 | LOCALE void ReadNeededFloats(void *); 60 | LOCALE void ReadNeededIntegers(void *); 61 | 62 | #endif 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /CLIPS/symblcmp.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* SYMBOL CONSTRUCT COMPILER HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: Implements the constructs-to-c feature for */ 11 | /* atomic data values: symbols, integers, floats, and */ 12 | /* bit maps. */ 13 | /* */ 14 | /* Principal Programmer(s): */ 15 | /* Gary D. Riley */ 16 | /* Brian L. Dantes */ 17 | /* */ 18 | /* Contributing Programmer(s): */ 19 | /* */ 20 | /* Revision History: */ 21 | /* */ 22 | /*************************************************************/ 23 | 24 | #ifndef _H_symblcmp 25 | #define _H_symblcmp 26 | 27 | #ifndef _STDIO_INCLUDED_ 28 | #define _STDIO_INCLUDED_ 29 | #include 30 | #endif 31 | 32 | #ifndef _H_symbol 33 | #include "symbol.h" 34 | #endif 35 | 36 | #ifdef LOCALE 37 | #undef LOCALE 38 | #endif 39 | 40 | #ifdef _SYMBLCMP_SOURCE_ 41 | #define LOCALE 42 | #else 43 | #define LOCALE extern 44 | #endif 45 | 46 | LOCALE void PrintSymbolReference(void *,FILE *,SYMBOL_HN *); 47 | LOCALE void PrintFloatReference(void *,FILE *,FLOAT_HN *); 48 | LOCALE void PrintIntegerReference(void *,FILE *,INTEGER_HN *); 49 | LOCALE void PrintBitMapReference(void *,FILE *,BITMAP_HN *); 50 | LOCALE void AtomicValuesToCode(void *,char *,char *,char *); 51 | 52 | #endif 53 | 54 | 55 | -------------------------------------------------------------------------------- /CLIPS/textpro.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.24 06/05/06 */ 5 | /* */ 6 | /* TEXT PROCESSING HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Brian L. Dantes */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /* 6.24: Added get-region function. */ 20 | /* */ 21 | /*************************************************************/ 22 | 23 | #ifndef _H_textpro 24 | 25 | #define _H_textpro 26 | 27 | #ifdef LOCALE 28 | #undef LOCALE 29 | #endif 30 | 31 | #ifdef _TEXTPRO_SOURCE_ 32 | #define LOCALE 33 | #else 34 | #define LOCALE extern 35 | #endif 36 | 37 | #if TEXTPRO_FUNCTIONS 38 | LOCALE void FetchCommand(void *,DATA_OBJECT *); 39 | LOCALE int PrintRegionCommand(void *); 40 | LOCALE void *GetRegionCommand(void *); 41 | int TossCommand(void *); 42 | #endif 43 | 44 | #if HELP_FUNCTIONS 45 | LOCALE void HelpFunction(void *); 46 | LOCALE void HelpPathFunction(void *); 47 | #endif 48 | 49 | LOCALE void HelpFunctionDefinitions(void *); 50 | #endif 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /CLIPS/tmpltbin.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* DEFTEMPLATE BSAVE/BLOAD HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Gary D. Riley */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* Brian L. Dantes */ 17 | /* */ 18 | /* Revision History: */ 19 | /* */ 20 | /*************************************************************/ 21 | 22 | #if (! RUN_TIME) 23 | #ifndef _H_tmpltbin 24 | 25 | #define _H_tmpltbin 26 | 27 | struct bsaveTemplateSlot 28 | { 29 | unsigned long slotName; 30 | unsigned int multislot : 1; 31 | unsigned int noDefault : 1; 32 | unsigned int defaultPresent : 1; 33 | unsigned int defaultDynamic : 1; 34 | long constraints; 35 | long defaultList; 36 | long facetList; 37 | long next; 38 | }; 39 | 40 | struct bsaveDeftemplate; 41 | struct bsaveDeftemplateModule; 42 | 43 | #include "cstrcbin.h" 44 | 45 | struct bsaveDeftemplate 46 | { 47 | struct bsaveConstructHeader header; 48 | long slotList; 49 | unsigned int implied : 1; 50 | unsigned int numberOfSlots : 15; 51 | long patternNetwork; 52 | }; 53 | 54 | #include "modulbin.h" 55 | 56 | struct bsaveDeftemplateModule 57 | { 58 | struct bsaveDefmoduleItemHeader header; 59 | }; 60 | 61 | #define TMPLTBIN_DATA 61 62 | 63 | struct deftemplateBinaryData 64 | { 65 | struct deftemplate *DeftemplateArray; 66 | long NumberOfDeftemplates; 67 | long NumberOfTemplateSlots; 68 | long NumberOfTemplateModules; 69 | struct templateSlot *SlotArray; 70 | struct deftemplateModule *ModuleArray; 71 | }; 72 | 73 | #define DeftemplateBinaryData(theEnv) ((struct deftemplateBinaryData *) GetEnvironmentData(theEnv,TMPLTBIN_DATA)) 74 | 75 | #define DeftemplatePointer(i) ((struct deftemplate *) (&DeftemplateBinaryData(theEnv)->DeftemplateArray[i])) 76 | 77 | #ifndef _H_tmpltdef 78 | #include "tmpltdef.h" 79 | #endif 80 | 81 | #ifdef LOCALE 82 | #undef LOCALE 83 | #endif 84 | 85 | #ifdef _TMPLTBIN_SOURCE_ 86 | #define LOCALE 87 | #else 88 | #define LOCALE extern 89 | #endif 90 | 91 | LOCALE void DeftemplateBinarySetup(void *); 92 | LOCALE void *BloadDeftemplateModuleReference(void *,int); 93 | 94 | #endif 95 | #endif 96 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /CLIPS/tmpltcmp.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* DEFTEMPLATE CONSTRUCT COMPILER HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Gary D. Riley */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /*************************************************************/ 20 | 21 | #ifndef _H_tmpltcmp 22 | 23 | #define _H_tmpltcmp 24 | 25 | #ifdef LOCALE 26 | #undef LOCALE 27 | #endif 28 | 29 | #ifdef _TMPLTCMP_SOURCE_ 30 | #define LOCALE 31 | #else 32 | #define LOCALE extern 33 | #endif 34 | 35 | LOCALE void DeftemplateCompilerSetup(void *); 36 | LOCALE void DeftemplateCModuleReference(void *,FILE *,int,int,int); 37 | LOCALE void DeftemplateCConstructReference(void *,FILE *,void *,int,int); 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /CLIPS/tmpltlhs.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* DEFTEMPLATE LHS HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Gary D. Riley */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /*************************************************************/ 20 | 21 | #ifndef _H_tmpltlhs 22 | 23 | #define _H_tmpltlhs 24 | 25 | #ifndef _H_symbol 26 | #include "symbol.h" 27 | #endif 28 | #ifndef _H_tmpltdef 29 | #include "tmpltdef.h" 30 | #endif 31 | 32 | #ifdef LOCALE 33 | #undef LOCALE 34 | #endif 35 | 36 | #ifdef _TMPLTLHS_SOURCE_ 37 | #define LOCALE 38 | #else 39 | #define LOCALE extern 40 | #endif 41 | 42 | LOCALE struct lhsParseNode *DeftemplateLHSParse(void *,char *,struct deftemplate *); 43 | 44 | #endif 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /CLIPS/tmpltpsr.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* DEFTEMPLATE PARSER HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Gary D. Riley */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /*************************************************************/ 20 | 21 | #ifndef _H_tmpltpsr 22 | 23 | #define _H_tmpltpsr 24 | 25 | #ifndef _H_symbol 26 | #include "symbol.h" 27 | #endif 28 | #ifndef _H_tmpltdef 29 | #include "tmpltdef.h" 30 | #endif 31 | 32 | #ifdef LOCALE 33 | #undef LOCALE 34 | #endif 35 | 36 | #ifdef _TMPLTPSR_SOURCE_ 37 | #define LOCALE 38 | #else 39 | #define LOCALE extern 40 | #endif 41 | 42 | LOCALE int ParseDeftemplate(void *,char *); 43 | LOCALE void InstallDeftemplate(void *,struct deftemplate *); 44 | 45 | #endif 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /CLIPS/tmpltrhs.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* DEFTEMPLATE RHS PARSING HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: */ 11 | /* */ 12 | /* Principal Programmer(s): */ 13 | /* Gary D. Riley */ 14 | /* */ 15 | /* Contributing Programmer(s): */ 16 | /* */ 17 | /* Revision History: */ 18 | /* */ 19 | /*************************************************************/ 20 | 21 | #ifndef _H_tmpltrhs 22 | 23 | #define _H_tmpltrhs 24 | 25 | #ifndef _H_scanner 26 | #include "scanner.h" 27 | #endif 28 | #ifndef _H_expressn 29 | #include "expressn.h" 30 | #endif 31 | #ifndef _H_tmpltdef 32 | #include "tmpltdef.h" 33 | #endif 34 | 35 | #ifdef LOCALE 36 | #undef LOCALE 37 | #endif 38 | 39 | #ifdef _TMPLTRHS_SOURCE_ 40 | #define LOCALE 41 | #else 42 | #define LOCALE extern 43 | #endif 44 | 45 | LOCALE struct expr *ParseAssertTemplate(void *,char *,struct token *,int *, 46 | int,int,struct deftemplate *); 47 | 48 | #endif 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /CLIPS/userdata.h: -------------------------------------------------------------------------------- 1 | /*******************************************************/ 2 | /* "C" Language Integrated Production System */ 3 | /* */ 4 | /* CLIPS Version 6.20 01/31/02 */ 5 | /* */ 6 | /* USER DATA HEADER FILE */ 7 | /*******************************************************/ 8 | 9 | /*************************************************************/ 10 | /* Purpose: Routines for attaching user data to constructs, */ 11 | /* facts, instances, user functions, etc. */ 12 | /* */ 13 | /* Principal Programmer(s): */ 14 | /* Gary D. Riley */ 15 | /* */ 16 | /* Revision History: */ 17 | /* */ 18 | /*************************************************************/ 19 | 20 | #ifndef _H_userdata 21 | #define _H_userdata 22 | 23 | #ifdef LOCALE 24 | #undef LOCALE 25 | #endif 26 | 27 | #ifdef _USERDATA_SOURCE_ 28 | #define LOCALE 29 | #else 30 | #define LOCALE extern 31 | #endif 32 | 33 | struct userData 34 | { 35 | unsigned char dataID; 36 | struct userData *next; 37 | }; 38 | 39 | typedef struct userData USER_DATA; 40 | typedef struct userData * USER_DATA_PTR; 41 | 42 | struct userDataRecord 43 | { 44 | unsigned char dataID; 45 | void *(*createUserData)(void *); 46 | void (*deleteUserData)(void *,void *); 47 | }; 48 | 49 | typedef struct userDataRecord USER_DATA_RECORD; 50 | typedef struct userDataRecord * USER_DATA_RECORD_PTR; 51 | 52 | #define MAXIMUM_USER_DATA_RECORDS 100 53 | 54 | #define USER_DATA_DATA 56 55 | 56 | struct userDataData 57 | { 58 | struct userDataRecord *UserDataRecordArray[MAXIMUM_USER_DATA_RECORDS]; 59 | unsigned char UserDataRecordCount; 60 | }; 61 | 62 | #define UserDataData(theEnv) ((struct userDataData *) GetEnvironmentData(theEnv,USER_DATA_DATA)) 63 | 64 | LOCALE void InitializeUserDataData(void *); 65 | LOCALE unsigned char InstallUserDataRecord(void *,struct userDataRecord *); 66 | LOCALE struct userData *FetchUserData(void *,unsigned char,struct userData **); 67 | LOCALE struct userData *TestUserData(unsigned char,struct userData *); 68 | LOCALE void ClearUserDataList(void *,struct userData *); 69 | LOCALE struct userData *DeleteUserData(void *,unsigned char,struct userData *); 70 | 71 | #endif 72 | 73 | -------------------------------------------------------------------------------- /CLIPS/usrsetup.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atrniv/node-clips/dbb3d293d51edbef1570cdd506e34930d075cfee/CLIPS/usrsetup.h -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Node CLIPS 2 | ========== 3 | 4 | **NOTE** 5 | **This repository is not actively maintained. The package will most probably fail to compile on any recent version of NodeJS after 0.11.0** 6 | 7 | 8 | 9 | NodeJS package for using CLIPS, a tool for building expert systems. 10 | 11 | For more information about CLIPS checkout the [official documentation](http://clipsrules.sourceforge.net/OnlineDocs.html). 12 | 13 | ##Install 14 | npm install node-clips 15 | 16 | ## Usage 17 | 18 | ###Step 1: Create a CLIPS Environment 19 | 20 | var clips = require('node-clips'); 21 | var env = new clips.Environment(); 22 | 23 | ### Step 2: Initialize and Run Environment 24 | 25 | env.initialize( function { 26 | 27 | // Load .clp file 28 | env.load(__dirname+'/animal.clp', function () { 29 | 30 | // Reset environment and run 31 | env.reset(function(){ 32 | 33 | // Rule firing limit set to 1000 34 | env.run(1000, function() { 35 | 36 | // Log fact list to console 37 | console.log(env.facts()); 38 | 39 | // Dispose of the CLIPS environment and free memory 40 | env.dispose(function(){ 41 | 42 | }); 43 | }); 44 | }); 45 | }); 46 | }); 47 | 48 | ##Environment Methods 49 | 50 | ###load (filename, callback) 51 | Load the constructs from the specified file into the CLIPS environment. 52 | 53 | ###save (filename, callback) 54 | Save the constructs in the current environment to a file. 55 | 56 | ###bload (filename, callback) 57 | Load the constructs from the specified binary file into the CLIPS environment. This is considerably faster than a simple load due to the time saved on parsing the constructs. 58 | 59 | ###bsave (filename, callback) 60 | Save the constructs in the current environment to a binary file. 61 | 62 | ###eval (expression, callback) 63 | Evaluate the expression as if it was entered into the CLIPS command line. The ```eval``` function cannot be used to define constructs. To define constructs use the ```build``` function. 64 | 65 | ###build (expression, callback) 66 | Evaluates the expression as if it was entered into the CLIPS command line. Can be used to define any CLIPS constructs . 67 | 68 | ###reset (callback) 69 | Reset the CLIPS environment. 70 | 71 | ###run (callback) 72 | Allows rules to execute. 73 | 74 | ###clear (callback) 75 | 76 | Clears the current CLIPS environment of all constructs. 77 | 78 | ###assert (fact, callback) 79 | 80 | Assert a fact into CLIPS. 81 | 82 | ###facts (callback) 83 | 84 | Get a list of facts. 85 | 86 | ##License 87 | [The MIT License](http://opensource.org/licenses/MIT) 88 | 89 | Copyright(c) 2013-2014, Playlyfe Technologies, developers@playlyfe.com, http://dev.playlyfe.com/ 90 | -------------------------------------------------------------------------------- /lib/index.js: -------------------------------------------------------------------------------- 1 | var engine = require('../build/Release/node_clips'); 2 | 3 | _assert = engine.Environment.prototype.assert; 4 | 5 | engine.Environment.prototype.assert = function() { 6 | var args = Array.prototype.slice.call(arguments, 0); 7 | if('[object Array]' == Object.prototype.toString.call(args[0])){ 8 | var rule = args[0]; 9 | var _expression; 10 | 11 | // This is an implied fact 12 | if (rule[1][0][0] === null) { 13 | _expression = '('+ rule[0] + ' ' + rule[1][0][1].join(' ') +')'; 14 | } else { 15 | // Regular fact 16 | _expression = '(' + rule[0] + ' '; 17 | for(var index = 0; index < rule[1].length; index++) { 18 | slot = rule[1][index]; 19 | _expression += '(' + slot[0] + ' ' + slot[1].join(' ') + ')'; 20 | } 21 | _expression += ')'; 22 | } 23 | args[0] = _expression; 24 | } 25 | _assert.apply(this, args); 26 | }; 27 | 28 | module.exports = engine; 29 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "node-clips", 3 | "version": "0.0.1", 4 | "description": "NodeJS package for using CLIPS, a tool for building expert systems.", 5 | "keywords": [ 6 | "clips", 7 | "expert systems", 8 | "rule engines" 9 | ], 10 | "repository": { 11 | "type": "git", 12 | "url": "git://github.com/atrniv/node-clips.git" 13 | }, 14 | "bugs": { 15 | "url": "http://github.com/atrniv/node-clips/issues" 16 | }, 17 | "author": { 18 | "name": "Johny Jose", 19 | "email": "johny@playlyfe.com", 20 | "url": "http://blog.playlyfe.com" 21 | }, 22 | "licenses": [ 23 | { 24 | "type": "MIT", 25 | "url": "http://www.opensource.org/licenses/MIT" 26 | } 27 | ], 28 | "main": "./lib", 29 | "devDependencies": { 30 | "jasmine-node": "*" 31 | }, 32 | "engines": { 33 | "node": ">=0.8.18" 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /spec/assert.js: -------------------------------------------------------------------------------- 1 | var clips = require('../lib/index'); 2 | var util = require('util'); 3 | var env = new clips.Environment(); 4 | 5 | env.initialize(function(){ 6 | env.build('(deftemplate duck (multislot var))', function(){ 7 | console.log(util.inspect(env.facts(), { depth: 6, colors: true })); 8 | env.assert(['duck', [['var', ['x', 'y']]]], function(err, fact){ 9 | console.log(util.inspect(env.facts(), { depth: 6, colors: true })); 10 | env.dispose(function(){ 11 | console.log('environment disposed'); 12 | }); 13 | }); 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /spec/basic.js: -------------------------------------------------------------------------------- 1 | var clips = require('../lib/index'); 2 | var util = require('util'); 3 | var env = new clips.Environment(); 4 | var file = __dirname + '/animal.clp'; 5 | var start = new Date(); 6 | 7 | console.log(process.memoryUsage()); 8 | env.initialize(function() { 9 | console.log('Initialized'); 10 | env.load(file, function(err) { 11 | var now = new Date(); 12 | console.log(now-start); 13 | if (err) throw err; 14 | console.log('file loaded'); 15 | env.reset(function(err) { 16 | if (err) throw err; 17 | console.log('environment reset'); 18 | env.facts(); 19 | //console.log(util.inspect(env.facts(), { depth: 6 })); 20 | console.log(process.memoryUsage()); 21 | env.evaluate('(run)', function(err, numRules) { 22 | if (err) throw err; 23 | //console.log(util.inspect(env.facts(), { depth: 6 })); 24 | console.log(util.inspect(numRules, { depth: 6, colors: true })); 25 | env.dispose(function(){ 26 | console.log(process.memoryUsage()); 27 | console.log('environment disposed'); 28 | }); 29 | }); 30 | }); 31 | }); 32 | }); 33 | 34 | -------------------------------------------------------------------------------- /src/clips_environment.h: -------------------------------------------------------------------------------- 1 | #ifndef CLIPS_ENVIRONMENT_H 2 | #define CLIPS_ENVIRONMENT_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "../CLIPS/clips.h" 9 | 10 | 11 | #define CLIPS_INITIALIZE 0 12 | #define CLIPS_DISPOSE 1 13 | #define CLIPS_LOAD 2 14 | #define CLIPS_SAVE 3 15 | #define CLIPS_BLOAD 4 16 | #define CLIPS_BSAVE 5 17 | #define CLIPS_BUILD 6 18 | #define CLIPS_RESET 7 19 | #define CLIPS_CLEAR 8 20 | #define CLIPS_RUN 9 21 | #define CLIPS_EVAL 10 22 | #define CLIPS_ASSERT_STRING 11 23 | #define CLIPS_FACTS 12 24 | 25 | #define RVAL_INT 0 26 | 27 | struct func_args1 { 28 | v8::Persistent arg0; 29 | }; 30 | 31 | struct func_args2 { 32 | v8::Persistent arg0; 33 | v8::Persistent arg1; 34 | }; 35 | 36 | struct func_baton { 37 | uv_work_s req; 38 | int argc; 39 | int rargc; 40 | int func; 41 | void* rval; 42 | void** clips; 43 | void* args; 44 | v8::Persistentcb; 45 | }; 46 | 47 | void CLIPSInitialize(uv_work_t* req); 48 | void CLIPSDispose(uv_work_t* req); 49 | void CLIPSLoad(uv_work_t* req); 50 | void CLIPSSave(uv_work_t* req); 51 | void CLIPSBLoad(uv_work_t* req); 52 | void CLIPSBSave(uv_work_t* req); 53 | void CLIPSBuild(uv_work_t* req); 54 | void CLIPSReset(uv_work_t* req); 55 | void CLIPSClear(uv_work_t* req); 56 | void CLIPSRun(uv_work_t* req); 57 | void CLIPSEval(uv_work_t* req); 58 | void CLIPSWork(uv_work_t* req); 59 | void CLIPSCleanup(uv_work_t* req, int status); 60 | 61 | v8::Handle FactToJSON(void* fact_ptr); 62 | v8::Handle MultiFieldToJSON(void* multifield_ptr, long begin, long end); 63 | v8::Handle DataObjectToJSON(DATA_OBJECT& obj); 64 | 65 | class CLIPSEnvironment: public node::ObjectWrap { 66 | public: 67 | static void Init(v8::Handle exports); 68 | 69 | private: 70 | CLIPSEnvironment(); 71 | ~CLIPSEnvironment(); 72 | 73 | static v8::Handle New(const v8::Arguments& args); 74 | static v8::Handle Initialize(const v8::Arguments& args); 75 | static v8::Handle Dispose(const v8::Arguments& args); 76 | static v8::Handle Load(const v8::Arguments& args); 77 | static v8::Handle Save(const v8::Arguments& args); 78 | static v8::Handle BLoad(const v8::Arguments& args); 79 | static v8::Handle BSave(const v8::Arguments& args); 80 | static v8::Handle Build(const v8::Arguments& args); 81 | static v8::Handle Reset(const v8::Arguments& args); 82 | static v8::Handle Run(const v8::Arguments& args); 83 | static v8::Handle Clear(const v8::Arguments& args); 84 | static v8::Handle Eval(const v8::Arguments& args); 85 | static v8::Handle ListFacts(const v8::Arguments& args); 86 | static v8::Handle JSAssert(const v8::Arguments& args); 87 | 88 | void* clips; 89 | 90 | }; 91 | 92 | #endif 93 | -------------------------------------------------------------------------------- /src/node_clips.cc: -------------------------------------------------------------------------------- 1 | #include "clips_environment.h" 2 | 3 | using namespace v8; 4 | 5 | void InitAll(Handle exports) { 6 | CLIPSEnvironment::Init(exports); 7 | } 8 | 9 | NODE_MODULE(node_clips, InitAll) 10 | --------------------------------------------------------------------------------