clipsruby 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/ext/clipsruby/agenda.c +1373 -0
- data/ext/clipsruby/agenda.h +169 -0
- data/ext/clipsruby/analysis.c +1142 -0
- data/ext/clipsruby/analysis.h +61 -0
- data/ext/clipsruby/argacces.c +526 -0
- data/ext/clipsruby/argacces.h +77 -0
- data/ext/clipsruby/bload.c +884 -0
- data/ext/clipsruby/bload.h +94 -0
- data/ext/clipsruby/bmathfun.c +557 -0
- data/ext/clipsruby/bmathfun.h +66 -0
- data/ext/clipsruby/bsave.c +634 -0
- data/ext/clipsruby/bsave.h +130 -0
- data/ext/clipsruby/classcom.c +976 -0
- data/ext/clipsruby/classcom.h +115 -0
- data/ext/clipsruby/classexm.c +1376 -0
- data/ext/clipsruby/classexm.h +97 -0
- data/ext/clipsruby/classfun.c +1392 -0
- data/ext/clipsruby/classfun.h +164 -0
- data/ext/clipsruby/classinf.c +1245 -0
- data/ext/clipsruby/classinf.h +94 -0
- data/ext/clipsruby/classini.c +843 -0
- data/ext/clipsruby/classini.h +75 -0
- data/ext/clipsruby/classpsr.c +957 -0
- data/ext/clipsruby/classpsr.h +73 -0
- data/ext/clipsruby/clips.h +133 -0
- data/ext/clipsruby/clipsruby.c +619 -0
- data/ext/clipsruby/clsltpsr.c +931 -0
- data/ext/clipsruby/clsltpsr.h +72 -0
- data/ext/clipsruby/commline.c +1217 -0
- data/ext/clipsruby/commline.h +131 -0
- data/ext/clipsruby/conscomp.c +1593 -0
- data/ext/clipsruby/conscomp.h +150 -0
- data/ext/clipsruby/constant.h +264 -0
- data/ext/clipsruby/constrct.c +1090 -0
- data/ext/clipsruby/constrct.h +216 -0
- data/ext/clipsruby/constrnt.c +554 -0
- data/ext/clipsruby/constrnt.h +132 -0
- data/ext/clipsruby/crstrtgy.c +1088 -0
- data/ext/clipsruby/crstrtgy.h +85 -0
- data/ext/clipsruby/cstrcbin.c +185 -0
- data/ext/clipsruby/cstrcbin.h +61 -0
- data/ext/clipsruby/cstrccmp.h +43 -0
- data/ext/clipsruby/cstrccom.c +1791 -0
- data/ext/clipsruby/cstrccom.h +115 -0
- data/ext/clipsruby/cstrcpsr.c +835 -0
- data/ext/clipsruby/cstrcpsr.h +97 -0
- data/ext/clipsruby/cstrnbin.c +282 -0
- data/ext/clipsruby/cstrnbin.h +55 -0
- data/ext/clipsruby/cstrnchk.c +826 -0
- data/ext/clipsruby/cstrnchk.h +91 -0
- data/ext/clipsruby/cstrncmp.c +238 -0
- data/ext/clipsruby/cstrncmp.h +57 -0
- data/ext/clipsruby/cstrnops.c +1176 -0
- data/ext/clipsruby/cstrnops.h +47 -0
- data/ext/clipsruby/cstrnpsr.c +1394 -0
- data/ext/clipsruby/cstrnpsr.h +88 -0
- data/ext/clipsruby/cstrnutl.c +564 -0
- data/ext/clipsruby/cstrnutl.h +54 -0
- data/ext/clipsruby/default.c +454 -0
- data/ext/clipsruby/default.h +57 -0
- data/ext/clipsruby/defins.c +971 -0
- data/ext/clipsruby/defins.h +127 -0
- data/ext/clipsruby/developr.c +677 -0
- data/ext/clipsruby/developr.h +69 -0
- data/ext/clipsruby/dffctbin.c +477 -0
- data/ext/clipsruby/dffctbin.h +76 -0
- data/ext/clipsruby/dffctbsc.c +308 -0
- data/ext/clipsruby/dffctbsc.h +72 -0
- data/ext/clipsruby/dffctcmp.c +297 -0
- data/ext/clipsruby/dffctcmp.h +44 -0
- data/ext/clipsruby/dffctdef.c +364 -0
- data/ext/clipsruby/dffctdef.h +104 -0
- data/ext/clipsruby/dffctpsr.c +179 -0
- data/ext/clipsruby/dffctpsr.h +49 -0
- data/ext/clipsruby/dffnxbin.c +520 -0
- data/ext/clipsruby/dffnxbin.h +67 -0
- data/ext/clipsruby/dffnxcmp.c +378 -0
- data/ext/clipsruby/dffnxcmp.h +54 -0
- data/ext/clipsruby/dffnxexe.c +241 -0
- data/ext/clipsruby/dffnxexe.h +58 -0
- data/ext/clipsruby/dffnxfun.c +1192 -0
- data/ext/clipsruby/dffnxfun.h +155 -0
- data/ext/clipsruby/dffnxpsr.c +514 -0
- data/ext/clipsruby/dffnxpsr.h +57 -0
- data/ext/clipsruby/dfinsbin.c +509 -0
- data/ext/clipsruby/dfinsbin.h +66 -0
- data/ext/clipsruby/dfinscmp.c +345 -0
- data/ext/clipsruby/dfinscmp.h +48 -0
- data/ext/clipsruby/drive.c +1191 -0
- data/ext/clipsruby/drive.h +65 -0
- data/ext/clipsruby/emathfun.c +1213 -0
- data/ext/clipsruby/emathfun.h +99 -0
- data/ext/clipsruby/engine.c +1568 -0
- data/ext/clipsruby/engine.h +203 -0
- data/ext/clipsruby/entities.h +276 -0
- data/ext/clipsruby/envrnbld.c +514 -0
- data/ext/clipsruby/envrnbld.h +40 -0
- data/ext/clipsruby/envrnmnt.c +257 -0
- data/ext/clipsruby/envrnmnt.h +112 -0
- data/ext/clipsruby/evaluatn.c +1736 -0
- data/ext/clipsruby/evaluatn.h +211 -0
- data/ext/clipsruby/expressn.c +494 -0
- data/ext/clipsruby/expressn.h +154 -0
- data/ext/clipsruby/exprnbin.c +538 -0
- data/ext/clipsruby/exprnbin.h +60 -0
- data/ext/clipsruby/exprnops.c +564 -0
- data/ext/clipsruby/exprnops.h +67 -0
- data/ext/clipsruby/exprnpsr.c +1112 -0
- data/ext/clipsruby/exprnpsr.h +98 -0
- data/ext/clipsruby/extconf.rb +2 -0
- data/ext/clipsruby/extnfunc.c +1015 -0
- data/ext/clipsruby/extnfunc.h +157 -0
- data/ext/clipsruby/factbin.c +447 -0
- data/ext/clipsruby/factbin.h +56 -0
- data/ext/clipsruby/factbld.c +1035 -0
- data/ext/clipsruby/factbld.h +63 -0
- data/ext/clipsruby/factcmp.c +386 -0
- data/ext/clipsruby/factcmp.h +46 -0
- data/ext/clipsruby/factcom.c +759 -0
- data/ext/clipsruby/factcom.h +80 -0
- data/ext/clipsruby/factfile.c +1761 -0
- data/ext/clipsruby/factfile.h +54 -0
- data/ext/clipsruby/factfun.c +682 -0
- data/ext/clipsruby/factfun.h +77 -0
- data/ext/clipsruby/factgen.c +1305 -0
- data/ext/clipsruby/factgen.h +229 -0
- data/ext/clipsruby/facthsh.c +438 -0
- data/ext/clipsruby/facthsh.h +81 -0
- data/ext/clipsruby/factlhs.c +250 -0
- data/ext/clipsruby/factlhs.h +54 -0
- data/ext/clipsruby/factmch.c +905 -0
- data/ext/clipsruby/factmch.h +68 -0
- data/ext/clipsruby/factmngr.c +3373 -0
- data/ext/clipsruby/factmngr.h +325 -0
- data/ext/clipsruby/factprt.c +498 -0
- data/ext/clipsruby/factprt.h +60 -0
- data/ext/clipsruby/factqpsr.c +796 -0
- data/ext/clipsruby/factqpsr.h +61 -0
- data/ext/clipsruby/factqury.c +1267 -0
- data/ext/clipsruby/factqury.h +112 -0
- data/ext/clipsruby/factrete.c +978 -0
- data/ext/clipsruby/factrete.h +70 -0
- data/ext/clipsruby/factrhs.c +667 -0
- data/ext/clipsruby/factrhs.h +55 -0
- data/ext/clipsruby/filecom.c +353 -0
- data/ext/clipsruby/filecom.h +137 -0
- data/ext/clipsruby/filertr.c +481 -0
- data/ext/clipsruby/filertr.h +94 -0
- data/ext/clipsruby/fileutil.c +1020 -0
- data/ext/clipsruby/fileutil.h +50 -0
- data/ext/clipsruby/generate.c +1079 -0
- data/ext/clipsruby/generate.h +57 -0
- data/ext/clipsruby/genrcbin.c +902 -0
- data/ext/clipsruby/genrcbin.h +69 -0
- data/ext/clipsruby/genrccmp.c +640 -0
- data/ext/clipsruby/genrccmp.h +59 -0
- data/ext/clipsruby/genrccom.c +2017 -0
- data/ext/clipsruby/genrccom.h +119 -0
- data/ext/clipsruby/genrcexe.c +737 -0
- data/ext/clipsruby/genrcexe.h +73 -0
- data/ext/clipsruby/genrcfun.c +890 -0
- data/ext/clipsruby/genrcfun.h +185 -0
- data/ext/clipsruby/genrcpsr.c +1618 -0
- data/ext/clipsruby/genrcpsr.h +80 -0
- data/ext/clipsruby/globlbin.c +458 -0
- data/ext/clipsruby/globlbin.h +71 -0
- data/ext/clipsruby/globlbsc.c +361 -0
- data/ext/clipsruby/globlbsc.h +83 -0
- data/ext/clipsruby/globlcmp.c +330 -0
- data/ext/clipsruby/globlcmp.h +52 -0
- data/ext/clipsruby/globlcom.c +289 -0
- data/ext/clipsruby/globlcom.h +63 -0
- data/ext/clipsruby/globldef.c +1087 -0
- data/ext/clipsruby/globldef.h +151 -0
- data/ext/clipsruby/globlpsr.c +530 -0
- data/ext/clipsruby/globlpsr.h +59 -0
- data/ext/clipsruby/immthpsr.c +431 -0
- data/ext/clipsruby/immthpsr.h +55 -0
- data/ext/clipsruby/incrrset.c +530 -0
- data/ext/clipsruby/incrrset.h +73 -0
- data/ext/clipsruby/inherpsr.c +850 -0
- data/ext/clipsruby/inherpsr.h +52 -0
- data/ext/clipsruby/inscom.c +2076 -0
- data/ext/clipsruby/inscom.h +182 -0
- data/ext/clipsruby/insfile.c +1764 -0
- data/ext/clipsruby/insfile.h +96 -0
- data/ext/clipsruby/insfun.c +1451 -0
- data/ext/clipsruby/insfun.h +134 -0
- data/ext/clipsruby/insmngr.c +2550 -0
- data/ext/clipsruby/insmngr.h +125 -0
- data/ext/clipsruby/insmoddp.c +1041 -0
- data/ext/clipsruby/insmoddp.h +91 -0
- data/ext/clipsruby/insmult.c +804 -0
- data/ext/clipsruby/insmult.h +62 -0
- data/ext/clipsruby/inspsr.c +602 -0
- data/ext/clipsruby/inspsr.h +60 -0
- data/ext/clipsruby/insquery.c +1278 -0
- data/ext/clipsruby/insquery.h +115 -0
- data/ext/clipsruby/insqypsr.c +729 -0
- data/ext/clipsruby/insqypsr.h +63 -0
- data/ext/clipsruby/iofun.c +2045 -0
- data/ext/clipsruby/iofun.h +116 -0
- data/ext/clipsruby/lgcldpnd.c +644 -0
- data/ext/clipsruby/lgcldpnd.h +75 -0
- data/ext/clipsruby/main.c +112 -0
- data/ext/clipsruby/match.h +142 -0
- data/ext/clipsruby/memalloc.c +481 -0
- data/ext/clipsruby/memalloc.h +197 -0
- data/ext/clipsruby/miscfun.c +1801 -0
- data/ext/clipsruby/miscfun.h +132 -0
- data/ext/clipsruby/modulbin.c +607 -0
- data/ext/clipsruby/modulbin.h +84 -0
- data/ext/clipsruby/modulbsc.c +347 -0
- data/ext/clipsruby/modulbsc.h +67 -0
- data/ext/clipsruby/modulcmp.c +499 -0
- data/ext/clipsruby/modulcmp.h +54 -0
- data/ext/clipsruby/moduldef.c +817 -0
- data/ext/clipsruby/moduldef.h +271 -0
- data/ext/clipsruby/modulpsr.c +1150 -0
- data/ext/clipsruby/modulpsr.h +69 -0
- data/ext/clipsruby/modulutl.c +1036 -0
- data/ext/clipsruby/modulutl.h +84 -0
- data/ext/clipsruby/msgcom.c +1221 -0
- data/ext/clipsruby/msgcom.h +125 -0
- data/ext/clipsruby/msgfun.c +1076 -0
- data/ext/clipsruby/msgfun.h +118 -0
- data/ext/clipsruby/msgpass.c +1441 -0
- data/ext/clipsruby/msgpass.h +103 -0
- data/ext/clipsruby/msgpsr.c +698 -0
- data/ext/clipsruby/msgpsr.h +73 -0
- data/ext/clipsruby/multifld.c +1404 -0
- data/ext/clipsruby/multifld.h +130 -0
- data/ext/clipsruby/multifun.c +2182 -0
- data/ext/clipsruby/multifun.h +102 -0
- data/ext/clipsruby/network.h +142 -0
- data/ext/clipsruby/objbin.c +1522 -0
- data/ext/clipsruby/objbin.h +79 -0
- data/ext/clipsruby/objcmp.c +1507 -0
- data/ext/clipsruby/objcmp.h +71 -0
- data/ext/clipsruby/object.h +260 -0
- data/ext/clipsruby/objrtbin.c +701 -0
- data/ext/clipsruby/objrtbin.h +79 -0
- data/ext/clipsruby/objrtbld.c +2393 -0
- data/ext/clipsruby/objrtbld.h +66 -0
- data/ext/clipsruby/objrtcmp.c +734 -0
- data/ext/clipsruby/objrtcmp.h +66 -0
- data/ext/clipsruby/objrtfnx.c +1330 -0
- data/ext/clipsruby/objrtfnx.h +222 -0
- data/ext/clipsruby/objrtgen.c +736 -0
- data/ext/clipsruby/objrtgen.h +63 -0
- data/ext/clipsruby/objrtmch.c +1524 -0
- data/ext/clipsruby/objrtmch.h +160 -0
- data/ext/clipsruby/parsefun.c +415 -0
- data/ext/clipsruby/parsefun.h +67 -0
- data/ext/clipsruby/pattern.c +1265 -0
- data/ext/clipsruby/pattern.h +163 -0
- data/ext/clipsruby/pprint.c +328 -0
- data/ext/clipsruby/pprint.h +79 -0
- data/ext/clipsruby/prccode.c +1478 -0
- data/ext/clipsruby/prccode.h +145 -0
- data/ext/clipsruby/prcdrfun.c +640 -0
- data/ext/clipsruby/prcdrfun.h +95 -0
- data/ext/clipsruby/prcdrpsr.c +1068 -0
- data/ext/clipsruby/prcdrpsr.h +79 -0
- data/ext/clipsruby/prdctfun.c +869 -0
- data/ext/clipsruby/prdctfun.h +77 -0
- data/ext/clipsruby/prntutil.c +878 -0
- data/ext/clipsruby/prntutil.h +125 -0
- data/ext/clipsruby/proflfun.c +827 -0
- data/ext/clipsruby/proflfun.h +118 -0
- data/ext/clipsruby/reorder.c +2082 -0
- data/ext/clipsruby/reorder.h +172 -0
- data/ext/clipsruby/reteutil.c +1732 -0
- data/ext/clipsruby/reteutil.h +111 -0
- data/ext/clipsruby/retract.c +710 -0
- data/ext/clipsruby/retract.h +74 -0
- data/ext/clipsruby/router.c +737 -0
- data/ext/clipsruby/router.h +147 -0
- data/ext/clipsruby/rulebin.c +1136 -0
- data/ext/clipsruby/rulebin.h +153 -0
- data/ext/clipsruby/rulebld.c +1328 -0
- data/ext/clipsruby/rulebld.h +62 -0
- data/ext/clipsruby/rulebsc.c +517 -0
- data/ext/clipsruby/rulebsc.h +91 -0
- data/ext/clipsruby/rulecmp.c +733 -0
- data/ext/clipsruby/rulecmp.h +63 -0
- data/ext/clipsruby/rulecom.c +1583 -0
- data/ext/clipsruby/rulecom.h +116 -0
- data/ext/clipsruby/rulecstr.c +892 -0
- data/ext/clipsruby/rulecstr.h +53 -0
- data/ext/clipsruby/ruledef.c +559 -0
- data/ext/clipsruby/ruledef.h +179 -0
- data/ext/clipsruby/ruledlt.c +599 -0
- data/ext/clipsruby/ruledlt.h +58 -0
- data/ext/clipsruby/rulelhs.c +1216 -0
- data/ext/clipsruby/rulelhs.h +52 -0
- data/ext/clipsruby/rulepsr.c +1073 -0
- data/ext/clipsruby/rulepsr.h +61 -0
- data/ext/clipsruby/scanner.c +856 -0
- data/ext/clipsruby/scanner.h +112 -0
- data/ext/clipsruby/setup.h +488 -0
- data/ext/clipsruby/sortfun.c +433 -0
- data/ext/clipsruby/sortfun.h +55 -0
- data/ext/clipsruby/strngfun.c +1173 -0
- data/ext/clipsruby/strngfun.h +96 -0
- data/ext/clipsruby/strngrtr.c +523 -0
- data/ext/clipsruby/strngrtr.h +97 -0
- data/ext/clipsruby/symblbin.c +648 -0
- data/ext/clipsruby/symblbin.h +64 -0
- data/ext/clipsruby/symblcmp.c +893 -0
- data/ext/clipsruby/symblcmp.h +61 -0
- data/ext/clipsruby/symbol.c +1961 -0
- data/ext/clipsruby/symbol.h +243 -0
- data/ext/clipsruby/sysdep.c +894 -0
- data/ext/clipsruby/sysdep.h +164 -0
- data/ext/clipsruby/textpro.c +1388 -0
- data/ext/clipsruby/textpro.h +77 -0
- data/ext/clipsruby/tmpltbin.c +609 -0
- data/ext/clipsruby/tmpltbin.h +108 -0
- data/ext/clipsruby/tmpltbsc.c +327 -0
- data/ext/clipsruby/tmpltbsc.h +87 -0
- data/ext/clipsruby/tmpltcmp.c +450 -0
- data/ext/clipsruby/tmpltcmp.h +57 -0
- data/ext/clipsruby/tmpltdef.c +584 -0
- data/ext/clipsruby/tmpltdef.h +155 -0
- data/ext/clipsruby/tmpltfun.c +2477 -0
- data/ext/clipsruby/tmpltfun.h +122 -0
- data/ext/clipsruby/tmpltlhs.c +379 -0
- data/ext/clipsruby/tmpltlhs.h +50 -0
- data/ext/clipsruby/tmpltpsr.c +819 -0
- data/ext/clipsruby/tmpltpsr.h +59 -0
- data/ext/clipsruby/tmpltrhs.c +595 -0
- data/ext/clipsruby/tmpltrhs.h +55 -0
- data/ext/clipsruby/tmpltutl.c +637 -0
- data/ext/clipsruby/tmpltutl.h +82 -0
- data/ext/clipsruby/userdata.c +156 -0
- data/ext/clipsruby/userdata.h +72 -0
- data/ext/clipsruby/userfunctions.c +70 -0
- data/ext/clipsruby/usrsetup.h +7 -0
- data/ext/clipsruby/utility.c +1594 -0
- data/ext/clipsruby/utility.h +250 -0
- data/ext/clipsruby/watch.c +865 -0
- data/ext/clipsruby/watch.h +124 -0
- data/lib/clipsruby.rb +1 -0
- metadata +388 -0
@@ -0,0 +1,62 @@
|
|
1
|
+
/*******************************************************/
|
2
|
+
/* "C" Language Integrated Production System */
|
3
|
+
/* */
|
4
|
+
/* CLIPS Version 6.40 06/28/17 */
|
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
|
+
/* 6.24: Removed INCREMENTAL_RESET compilation flag. */
|
26
|
+
/* */
|
27
|
+
/* Corrected code to remove compiler warnings. */
|
28
|
+
/* */
|
29
|
+
/* 6.30: Changes to constructing join network. */
|
30
|
+
/* */
|
31
|
+
/* Added support for hashed memories. */
|
32
|
+
/* */
|
33
|
+
/* 6.31: DR#882 Logical retraction not working if */
|
34
|
+
/* logical CE starts with test CE. */
|
35
|
+
/* */
|
36
|
+
/* 6.40: Removed LOCALE definition. */
|
37
|
+
/* */
|
38
|
+
/* Pragma once and other inclusion changes. */
|
39
|
+
/* */
|
40
|
+
/* Added support for booleans with <stdbool.h>. */
|
41
|
+
/* */
|
42
|
+
/* Removed use of void pointers for specific */
|
43
|
+
/* data structures. */
|
44
|
+
/* */
|
45
|
+
/*************************************************************/
|
46
|
+
|
47
|
+
#ifndef _H_rulebld
|
48
|
+
|
49
|
+
#pragma once
|
50
|
+
|
51
|
+
#define _H_rulebld
|
52
|
+
|
53
|
+
#include "network.h"
|
54
|
+
#include "reorder.h"
|
55
|
+
|
56
|
+
struct joinNode *ConstructJoins(Environment *,int,struct lhsParseNode *,int,struct joinNode *,bool,bool);
|
57
|
+
void AttachTestCEsToPatternCEs(Environment *,struct lhsParseNode *);
|
58
|
+
|
59
|
+
#endif /* _H_rulebld */
|
60
|
+
|
61
|
+
|
62
|
+
|
@@ -0,0 +1,517 @@
|
|
1
|
+
/*******************************************************/
|
2
|
+
/* "C" Language Integrated Production System */
|
3
|
+
/* */
|
4
|
+
/* CLIPS Version 6.40 07/02/18 */
|
5
|
+
/* */
|
6
|
+
/* DEFRULE BASIC COMMANDS HEADER FILE */
|
7
|
+
/*******************************************************/
|
8
|
+
|
9
|
+
/*************************************************************/
|
10
|
+
/* Purpose: Implements core commands for the defrule */
|
11
|
+
/* construct such as clear, reset, save, undefrule, */
|
12
|
+
/* ppdefrule, list-defrules, and */
|
13
|
+
/* get-defrule-list. */
|
14
|
+
/* */
|
15
|
+
/* Principal Programmer(s): */
|
16
|
+
/* Gary D. Riley */
|
17
|
+
/* */
|
18
|
+
/* Contributing Programmer(s): */
|
19
|
+
/* Brian L. Dantes */
|
20
|
+
/* */
|
21
|
+
/* Revision History: */
|
22
|
+
/* */
|
23
|
+
/* 6.23: Corrected compilation errors for files */
|
24
|
+
/* generated by constructs-to-c. DR0861 */
|
25
|
+
/* */
|
26
|
+
/* Changed name of variable log to logName */
|
27
|
+
/* because of Unix compiler warnings of shadowed */
|
28
|
+
/* definitions. */
|
29
|
+
/* */
|
30
|
+
/* 6.24: Renamed BOOLEAN macro type to intBool. */
|
31
|
+
/* */
|
32
|
+
/* 6.30: Removed conditional code for unsupported */
|
33
|
+
/* compilers/operating systems (IBM_MCW, */
|
34
|
+
/* MAC_MCW, and IBM_TBC). */
|
35
|
+
/* */
|
36
|
+
/* Support for join network changes. */
|
37
|
+
/* */
|
38
|
+
/* Added const qualifiers to remove C++ */
|
39
|
+
/* deprecation warnings. */
|
40
|
+
/* */
|
41
|
+
/* Converted API macros to function calls. */
|
42
|
+
/* */
|
43
|
+
/* Added code to prevent a clear command from */
|
44
|
+
/* being executed during fact assertions via */
|
45
|
+
/* JoinOperationInProgress mechanism. */
|
46
|
+
/* */
|
47
|
+
/* 6.40: Pragma once and other inclusion changes. */
|
48
|
+
/* */
|
49
|
+
/* Added support for booleans with <stdbool.h>. */
|
50
|
+
/* */
|
51
|
+
/* Removed use of void pointers for specific */
|
52
|
+
/* data structures. */
|
53
|
+
/* */
|
54
|
+
/* ALLOW_ENVIRONMENT_GLOBALS no longer supported. */
|
55
|
+
/* */
|
56
|
+
/* UDF redesign. */
|
57
|
+
/* */
|
58
|
+
/* Pretty print functions accept optional logical */
|
59
|
+
/* name argument. */
|
60
|
+
/* */
|
61
|
+
/*************************************************************/
|
62
|
+
|
63
|
+
#include "setup.h"
|
64
|
+
|
65
|
+
#if DEFRULE_CONSTRUCT
|
66
|
+
|
67
|
+
#include <stdio.h>
|
68
|
+
|
69
|
+
#include "argacces.h"
|
70
|
+
#include "constrct.h"
|
71
|
+
#include "drive.h"
|
72
|
+
#include "engine.h"
|
73
|
+
#include "envrnmnt.h"
|
74
|
+
#include "extnfunc.h"
|
75
|
+
#include "multifld.h"
|
76
|
+
#include "reteutil.h"
|
77
|
+
#include "router.h"
|
78
|
+
#include "ruledef.h"
|
79
|
+
#include "watch.h"
|
80
|
+
|
81
|
+
#if BLOAD || BLOAD_ONLY || BLOAD_AND_BSAVE
|
82
|
+
#include "rulebin.h"
|
83
|
+
#endif
|
84
|
+
#if CONSTRUCT_COMPILER && (! RUN_TIME)
|
85
|
+
#include "rulecmp.h"
|
86
|
+
#endif
|
87
|
+
|
88
|
+
#include "rulebsc.h"
|
89
|
+
|
90
|
+
/***************************************/
|
91
|
+
/* LOCAL INTERNAL FUNCTION DEFINITIONS */
|
92
|
+
/***************************************/
|
93
|
+
|
94
|
+
static void ResetDefrules(Environment *,void *);
|
95
|
+
static void ResetDefrulesPrime(Environment *,void *);
|
96
|
+
static void SaveDefrules(Environment *,Defmodule *,const char *,void *);
|
97
|
+
#if (! RUN_TIME)
|
98
|
+
static bool ClearDefrulesReady(Environment *,void *);
|
99
|
+
static void ClearDefrules(Environment *,void *);
|
100
|
+
#endif
|
101
|
+
|
102
|
+
/*************************************************************/
|
103
|
+
/* DefruleBasicCommands: Initializes basic defrule commands. */
|
104
|
+
/*************************************************************/
|
105
|
+
void DefruleBasicCommands(
|
106
|
+
Environment *theEnv)
|
107
|
+
{
|
108
|
+
AddResetFunction(theEnv,"defrule",ResetDefrules,70,NULL);
|
109
|
+
AddResetFunction(theEnv,"defrule",ResetDefrulesPrime,10,NULL);
|
110
|
+
AddSaveFunction(theEnv,"defrule",SaveDefrules,0,NULL);
|
111
|
+
#if (! RUN_TIME)
|
112
|
+
AddClearReadyFunction(theEnv,"defrule",ClearDefrulesReady,0,NULL);
|
113
|
+
AddClearFunction(theEnv,"defrule",ClearDefrules,0,NULL);
|
114
|
+
#endif
|
115
|
+
|
116
|
+
#if DEBUGGING_FUNCTIONS
|
117
|
+
AddWatchItem(theEnv,"rules",0,&DefruleData(theEnv)->WatchRules,70,DefruleWatchAccess,DefruleWatchPrint);
|
118
|
+
#endif
|
119
|
+
|
120
|
+
#if ! RUN_TIME
|
121
|
+
AddUDF(theEnv,"get-defrule-list","m",0,1,"y",GetDefruleListFunction,"GetDefruleListFunction",NULL);
|
122
|
+
AddUDF(theEnv,"undefrule","v",1,1,"y",UndefruleCommand,"UndefruleCommand",NULL);
|
123
|
+
AddUDF(theEnv,"defrule-module","y",1,1,"y",DefruleModuleFunction,"DefruleModuleFunction",NULL);
|
124
|
+
|
125
|
+
#if DEBUGGING_FUNCTIONS
|
126
|
+
AddUDF(theEnv,"rules","v",0,1,"y",ListDefrulesCommand,"ListDefrulesCommand",NULL);
|
127
|
+
AddUDF(theEnv,"list-defrules","v",0,1,"y",ListDefrulesCommand,"ListDefrulesCommand",NULL);
|
128
|
+
AddUDF(theEnv,"ppdefrule","vs",1,2,";y;ldsyn",PPDefruleCommand,"PPDefruleCommand",NULL);
|
129
|
+
#endif
|
130
|
+
|
131
|
+
#if (BLOAD || BLOAD_ONLY || BLOAD_AND_BSAVE)
|
132
|
+
DefruleBinarySetup(theEnv);
|
133
|
+
#endif
|
134
|
+
|
135
|
+
#if CONSTRUCT_COMPILER && (! RUN_TIME)
|
136
|
+
DefruleCompilerSetup(theEnv);
|
137
|
+
#endif
|
138
|
+
|
139
|
+
#endif
|
140
|
+
}
|
141
|
+
|
142
|
+
/*****************************************************/
|
143
|
+
/* ResetDefrules: Defrule reset routine for use with */
|
144
|
+
/* the reset command. Sets the current entity time */
|
145
|
+
/* tag (used by the conflict resolution strategies */
|
146
|
+
/* for recency) to zero. The focus stack is also */
|
147
|
+
/* cleared. */
|
148
|
+
/*****************************************************/
|
149
|
+
static void ResetDefrules(
|
150
|
+
Environment *theEnv,
|
151
|
+
void *context)
|
152
|
+
{
|
153
|
+
Defmodule *theModule;
|
154
|
+
struct joinLink *theLink;
|
155
|
+
struct partialMatch *notParent;
|
156
|
+
|
157
|
+
DefruleData(theEnv)->CurrentEntityTimeTag = 1L;
|
158
|
+
ClearFocusStack(theEnv);
|
159
|
+
theModule = FindDefmodule(theEnv,"MAIN");
|
160
|
+
Focus(theModule);
|
161
|
+
|
162
|
+
for (theLink = DefruleData(theEnv)->RightPrimeJoins;
|
163
|
+
theLink != NULL;
|
164
|
+
theLink = theLink->next)
|
165
|
+
{ PosEntryRetractAlpha(theEnv,theLink->join->rightMemory->beta[0],NETWORK_ASSERT); }
|
166
|
+
|
167
|
+
for (theLink = DefruleData(theEnv)->LeftPrimeJoins;
|
168
|
+
theLink != NULL;
|
169
|
+
theLink = theLink->next)
|
170
|
+
{
|
171
|
+
if ((theLink->join->patternIsNegated || theLink->join->joinFromTheRight) &&
|
172
|
+
(! theLink->join->patternIsExists))
|
173
|
+
{
|
174
|
+
notParent = theLink->join->leftMemory->beta[0];
|
175
|
+
|
176
|
+
if (notParent->marker)
|
177
|
+
{ RemoveBlockedLink(notParent); }
|
178
|
+
|
179
|
+
/*==========================================================*/
|
180
|
+
/* Prevent any retractions from generating partial matches. */
|
181
|
+
/*==========================================================*/
|
182
|
+
|
183
|
+
notParent->marker = notParent;
|
184
|
+
|
185
|
+
if (notParent->children != NULL)
|
186
|
+
{ PosEntryRetractBeta(theEnv,notParent,notParent->children,NETWORK_ASSERT); }
|
187
|
+
/*
|
188
|
+
if (notParent->dependents != NULL)
|
189
|
+
{ RemoveLogicalSupport(theEnv,notParent); } */
|
190
|
+
}
|
191
|
+
}
|
192
|
+
}
|
193
|
+
|
194
|
+
/***********************/
|
195
|
+
/* ResetDefrulesPrime: */
|
196
|
+
/***********************/
|
197
|
+
static void ResetDefrulesPrime(
|
198
|
+
Environment *theEnv,
|
199
|
+
void *context)
|
200
|
+
{
|
201
|
+
struct joinLink *theLink;
|
202
|
+
struct partialMatch *notParent;
|
203
|
+
|
204
|
+
for (theLink = DefruleData(theEnv)->RightPrimeJoins;
|
205
|
+
theLink != NULL;
|
206
|
+
theLink = theLink->next)
|
207
|
+
{ NetworkAssert(theEnv,theLink->join->rightMemory->beta[0],theLink->join); }
|
208
|
+
|
209
|
+
for (theLink = DefruleData(theEnv)->LeftPrimeJoins;
|
210
|
+
theLink != NULL;
|
211
|
+
theLink = theLink->next)
|
212
|
+
{
|
213
|
+
if ((theLink->join->patternIsNegated || theLink->join->joinFromTheRight) &&
|
214
|
+
(! theLink->join->patternIsExists))
|
215
|
+
{
|
216
|
+
notParent = theLink->join->leftMemory->beta[0];
|
217
|
+
|
218
|
+
if (theLink->join->secondaryNetworkTest != NULL)
|
219
|
+
{
|
220
|
+
if (EvaluateSecondaryNetworkTest(theEnv,notParent,theLink->join) == false)
|
221
|
+
{ continue; }
|
222
|
+
}
|
223
|
+
|
224
|
+
notParent->marker = NULL;
|
225
|
+
|
226
|
+
EPMDrive(theEnv,notParent,theLink->join,NETWORK_ASSERT);
|
227
|
+
}
|
228
|
+
}
|
229
|
+
|
230
|
+
}
|
231
|
+
|
232
|
+
#if (! RUN_TIME)
|
233
|
+
|
234
|
+
/******************************************************************/
|
235
|
+
/* ClearDefrulesReady: Indicates whether defrules can be cleared. */
|
236
|
+
/******************************************************************/
|
237
|
+
static bool ClearDefrulesReady(
|
238
|
+
Environment *theEnv,
|
239
|
+
void *context)
|
240
|
+
{
|
241
|
+
if (EngineData(theEnv)->ExecutingRule != NULL) return false;
|
242
|
+
|
243
|
+
if (EngineData(theEnv)->JoinOperationInProgress) return false;
|
244
|
+
|
245
|
+
ClearFocusStack(theEnv);
|
246
|
+
if (GetCurrentModule(theEnv) == NULL) return false;
|
247
|
+
|
248
|
+
DefruleData(theEnv)->CurrentEntityTimeTag = 1L;
|
249
|
+
|
250
|
+
return true;
|
251
|
+
}
|
252
|
+
|
253
|
+
/***************************************************************/
|
254
|
+
/* ClearDefrules: Pushes the MAIN module as the current focus. */
|
255
|
+
/***************************************************************/
|
256
|
+
static void ClearDefrules(
|
257
|
+
Environment *theEnv,
|
258
|
+
void *context)
|
259
|
+
{
|
260
|
+
Defmodule *theModule;
|
261
|
+
|
262
|
+
theModule = FindDefmodule(theEnv,"MAIN");
|
263
|
+
Focus(theModule);
|
264
|
+
}
|
265
|
+
|
266
|
+
#endif
|
267
|
+
|
268
|
+
/**************************************/
|
269
|
+
/* SaveDefrules: Defrule save routine */
|
270
|
+
/* for use with the save command. */
|
271
|
+
/**************************************/
|
272
|
+
static void SaveDefrules(
|
273
|
+
Environment *theEnv,
|
274
|
+
Defmodule *theModule,
|
275
|
+
const char *logicalName,
|
276
|
+
void *context)
|
277
|
+
{
|
278
|
+
SaveConstruct(theEnv,theModule,logicalName,DefruleData(theEnv)->DefruleConstruct);
|
279
|
+
}
|
280
|
+
|
281
|
+
/******************************************/
|
282
|
+
/* UndefruleCommand: H/L access routine */
|
283
|
+
/* for the undefrule command. */
|
284
|
+
/******************************************/
|
285
|
+
void UndefruleCommand(
|
286
|
+
Environment *theEnv,
|
287
|
+
UDFContext *context,
|
288
|
+
UDFValue *returnValue)
|
289
|
+
{
|
290
|
+
UndefconstructCommand(context,"undefrule",DefruleData(theEnv)->DefruleConstruct);
|
291
|
+
}
|
292
|
+
|
293
|
+
/********************************/
|
294
|
+
/* Undefrule: C access routine */
|
295
|
+
/* for the undefrule command. */
|
296
|
+
/********************************/
|
297
|
+
bool Undefrule(
|
298
|
+
Defrule *theDefrule,
|
299
|
+
Environment *allEnv)
|
300
|
+
{
|
301
|
+
Environment *theEnv;
|
302
|
+
|
303
|
+
if (theDefrule == NULL)
|
304
|
+
{
|
305
|
+
theEnv = allEnv;
|
306
|
+
return Undefconstruct(theEnv,NULL,DefruleData(theEnv)->DefruleConstruct);
|
307
|
+
}
|
308
|
+
else
|
309
|
+
{
|
310
|
+
theEnv = theDefrule->header.env;
|
311
|
+
return Undefconstruct(theEnv,&theDefrule->header,DefruleData(theEnv)->DefruleConstruct);
|
312
|
+
}
|
313
|
+
}
|
314
|
+
|
315
|
+
/************************************************/
|
316
|
+
/* GetDefruleListFunction: H/L access routine */
|
317
|
+
/* for the get-defrule-list function. */
|
318
|
+
/************************************************/
|
319
|
+
void GetDefruleListFunction(
|
320
|
+
Environment *theEnv,
|
321
|
+
UDFContext *context,
|
322
|
+
UDFValue *returnValue)
|
323
|
+
{
|
324
|
+
GetConstructListFunction(context,returnValue,DefruleData(theEnv)->DefruleConstruct);
|
325
|
+
}
|
326
|
+
|
327
|
+
/****************************************/
|
328
|
+
/* GetDefruleList: C access routine */
|
329
|
+
/* for the get-defrule-list function. */
|
330
|
+
/****************************************/
|
331
|
+
void GetDefruleList(
|
332
|
+
Environment *theEnv,
|
333
|
+
CLIPSValue *returnValue,
|
334
|
+
Defmodule *theModule)
|
335
|
+
{
|
336
|
+
UDFValue result;
|
337
|
+
|
338
|
+
GetConstructList(theEnv,&result,DefruleData(theEnv)->DefruleConstruct,theModule);
|
339
|
+
NormalizeMultifield(theEnv,&result);
|
340
|
+
returnValue->value = result.value;
|
341
|
+
}
|
342
|
+
|
343
|
+
/*********************************************/
|
344
|
+
/* DefruleModuleFunction: H/L access routine */
|
345
|
+
/* for the defrule-module function. */
|
346
|
+
/*********************************************/
|
347
|
+
void DefruleModuleFunction(
|
348
|
+
Environment *theEnv,
|
349
|
+
UDFContext *context,
|
350
|
+
UDFValue *returnValue)
|
351
|
+
{
|
352
|
+
returnValue->value = GetConstructModuleCommand(context,"defrule-module",DefruleData(theEnv)->DefruleConstruct);
|
353
|
+
}
|
354
|
+
|
355
|
+
#if DEBUGGING_FUNCTIONS
|
356
|
+
|
357
|
+
/******************************************/
|
358
|
+
/* PPDefruleCommand: H/L access routine */
|
359
|
+
/* for the ppdefrule command. */
|
360
|
+
/******************************************/
|
361
|
+
void PPDefruleCommand(
|
362
|
+
Environment *theEnv,
|
363
|
+
UDFContext *context,
|
364
|
+
UDFValue *returnValue)
|
365
|
+
{
|
366
|
+
PPConstructCommand(context,"ppdefrule",DefruleData(theEnv)->DefruleConstruct,returnValue);
|
367
|
+
}
|
368
|
+
|
369
|
+
/***********************************/
|
370
|
+
/* PPDefrule: C access routine for */
|
371
|
+
/* the ppdefrule command. */
|
372
|
+
/***********************************/
|
373
|
+
bool PPDefrule(
|
374
|
+
Environment *theEnv,
|
375
|
+
const char *defruleName,
|
376
|
+
const char *logicalName)
|
377
|
+
{
|
378
|
+
return(PPConstruct(theEnv,defruleName,logicalName,DefruleData(theEnv)->DefruleConstruct));
|
379
|
+
}
|
380
|
+
|
381
|
+
/*********************************************/
|
382
|
+
/* ListDefrulesCommand: H/L access routine */
|
383
|
+
/* for the list-defrules command. */
|
384
|
+
/*********************************************/
|
385
|
+
void ListDefrulesCommand(
|
386
|
+
Environment *theEnv,
|
387
|
+
UDFContext *context,
|
388
|
+
UDFValue *returnValue)
|
389
|
+
{
|
390
|
+
ListConstructCommand(context,DefruleData(theEnv)->DefruleConstruct);
|
391
|
+
}
|
392
|
+
|
393
|
+
/************************************/
|
394
|
+
/* ListDefrules: C access routine */
|
395
|
+
/* for the list-defrules command. */
|
396
|
+
/************************************/
|
397
|
+
void ListDefrules(
|
398
|
+
Environment *theEnv,
|
399
|
+
const char *logicalName,
|
400
|
+
Defmodule *theModule)
|
401
|
+
{
|
402
|
+
ListConstruct(theEnv,DefruleData(theEnv)->DefruleConstruct,logicalName,theModule);
|
403
|
+
}
|
404
|
+
|
405
|
+
/*******************************************************/
|
406
|
+
/* DefruleGetWatchActivations: C access routine for */
|
407
|
+
/* retrieving the current watch value of a defrule's */
|
408
|
+
/* activations. */
|
409
|
+
/*******************************************************/
|
410
|
+
bool DefruleGetWatchActivations(
|
411
|
+
Defrule *rulePtr)
|
412
|
+
{
|
413
|
+
Defrule *thePtr;
|
414
|
+
|
415
|
+
for (thePtr = rulePtr;
|
416
|
+
thePtr != NULL;
|
417
|
+
thePtr = thePtr->disjunct)
|
418
|
+
{ if (thePtr->watchActivation) return true; }
|
419
|
+
|
420
|
+
return false;
|
421
|
+
}
|
422
|
+
|
423
|
+
/********************************************/
|
424
|
+
/* DefruleGetWatchFirings: C access routine */
|
425
|
+
/* for retrieving the current watch value */
|
426
|
+
/* of a defrule's firings. */
|
427
|
+
/********************************************/
|
428
|
+
bool DefruleGetWatchFirings(
|
429
|
+
Defrule *rulePtr)
|
430
|
+
{
|
431
|
+
Defrule *thePtr;
|
432
|
+
|
433
|
+
for (thePtr = rulePtr;
|
434
|
+
thePtr != NULL;
|
435
|
+
thePtr = thePtr->disjunct)
|
436
|
+
{ if (thePtr->watchFiring) return true; }
|
437
|
+
|
438
|
+
return false;
|
439
|
+
}
|
440
|
+
|
441
|
+
/************************************************/
|
442
|
+
/* DefruleSetWatchActivations: C access routine */
|
443
|
+
/* for setting the current watch value of a */
|
444
|
+
/* defrule's activations. */
|
445
|
+
/************************************************/
|
446
|
+
void DefruleSetWatchActivations(
|
447
|
+
Defrule *rulePtr,
|
448
|
+
bool newState)
|
449
|
+
{
|
450
|
+
Defrule *thePtr;
|
451
|
+
|
452
|
+
for (thePtr = rulePtr;
|
453
|
+
thePtr != NULL;
|
454
|
+
thePtr = thePtr->disjunct)
|
455
|
+
{ thePtr->watchActivation = newState; }
|
456
|
+
}
|
457
|
+
|
458
|
+
/********************************************/
|
459
|
+
/* DefruleSetWatchFirings: C access routine */
|
460
|
+
/* for setting the current watch value of */
|
461
|
+
/* a defrule's firings. */
|
462
|
+
/********************************************/
|
463
|
+
void DefruleSetWatchFirings(
|
464
|
+
Defrule *rulePtr,
|
465
|
+
bool newState)
|
466
|
+
{
|
467
|
+
Defrule *thePtr;
|
468
|
+
|
469
|
+
for (thePtr = rulePtr;
|
470
|
+
thePtr != NULL;
|
471
|
+
thePtr = thePtr->disjunct)
|
472
|
+
{ thePtr->watchFiring = newState; }
|
473
|
+
}
|
474
|
+
|
475
|
+
/*******************************************************************/
|
476
|
+
/* DefruleWatchAccess: Access function for setting the watch flags */
|
477
|
+
/* associated with rules (activations and rule firings). */
|
478
|
+
/*******************************************************************/
|
479
|
+
bool DefruleWatchAccess(
|
480
|
+
Environment *theEnv,
|
481
|
+
int code,
|
482
|
+
bool newState,
|
483
|
+
struct expr *argExprs)
|
484
|
+
{
|
485
|
+
if (code)
|
486
|
+
return(ConstructSetWatchAccess(theEnv,DefruleData(theEnv)->DefruleConstruct,newState,argExprs,
|
487
|
+
(ConstructGetWatchFunction *) DefruleGetWatchActivations,
|
488
|
+
(ConstructSetWatchFunction *) DefruleSetWatchActivations));
|
489
|
+
else
|
490
|
+
return(ConstructSetWatchAccess(theEnv,DefruleData(theEnv)->DefruleConstruct,newState,argExprs,
|
491
|
+
(ConstructGetWatchFunction *) DefruleGetWatchFirings,
|
492
|
+
(ConstructSetWatchFunction *) DefruleSetWatchFirings));
|
493
|
+
}
|
494
|
+
|
495
|
+
/*****************************************************************/
|
496
|
+
/* DefruleWatchPrint: Access routine for printing which defrules */
|
497
|
+
/* have their watch flag set via the list-watch-items command. */
|
498
|
+
/*****************************************************************/
|
499
|
+
bool DefruleWatchPrint(
|
500
|
+
Environment *theEnv,
|
501
|
+
const char *logName,
|
502
|
+
int code,
|
503
|
+
struct expr *argExprs)
|
504
|
+
{
|
505
|
+
if (code)
|
506
|
+
return(ConstructPrintWatchAccess(theEnv,DefruleData(theEnv)->DefruleConstruct,logName,argExprs,
|
507
|
+
(ConstructGetWatchFunction *) DefruleGetWatchActivations,
|
508
|
+
(ConstructSetWatchFunction *) DefruleSetWatchActivations));
|
509
|
+
else
|
510
|
+
return(ConstructPrintWatchAccess(theEnv,DefruleData(theEnv)->DefruleConstruct,logName,argExprs,
|
511
|
+
(ConstructGetWatchFunction *) DefruleGetWatchActivations,
|
512
|
+
(ConstructSetWatchFunction *) DefruleGetWatchActivations));
|
513
|
+
}
|
514
|
+
|
515
|
+
#endif /* DEBUGGING_FUNCTIONS */
|
516
|
+
|
517
|
+
#endif /* DEFTEMPLATE_CONSTRUCT */
|
@@ -0,0 +1,91 @@
|
|
1
|
+
/*******************************************************/
|
2
|
+
/* "C" Language Integrated Production System */
|
3
|
+
/* */
|
4
|
+
/* CLIPS Version 6.40 08/25/16 */
|
5
|
+
/* */
|
6
|
+
/* DEFRULE BASIC COMMANDS HEADER FILE */
|
7
|
+
/*******************************************************/
|
8
|
+
|
9
|
+
/*************************************************************/
|
10
|
+
/* Purpose: Implements core commands for the defrule */
|
11
|
+
/* construct such as clear, reset, save, undefrule, */
|
12
|
+
/* ppdefrule, list-defrules, and */
|
13
|
+
/* get-defrule-list. */
|
14
|
+
/* */
|
15
|
+
/* Principal Programmer(s): */
|
16
|
+
/* Gary D. Riley */
|
17
|
+
/* */
|
18
|
+
/* Contributing Programmer(s): */
|
19
|
+
/* Brian L. Dantes */
|
20
|
+
/* */
|
21
|
+
/* Revision History: */
|
22
|
+
/* */
|
23
|
+
/* 6.23: Corrected compilation errors for files */
|
24
|
+
/* generated by constructs-to-c. DR0861 */
|
25
|
+
/* */
|
26
|
+
/* Changed name of variable log to logName */
|
27
|
+
/* because of Unix compiler warnings of shadowed */
|
28
|
+
/* definitions. */
|
29
|
+
/* */
|
30
|
+
/* 6.24: Renamed BOOLEAN macro type to intBool. */
|
31
|
+
/* */
|
32
|
+
/* 6.30: Removed conditional code for unsupported */
|
33
|
+
/* compilers/operating systems (IBM_MCW, */
|
34
|
+
/* MAC_MCW, and IBM_TBC). */
|
35
|
+
/* */
|
36
|
+
/* Support for join network changes. */
|
37
|
+
/* */
|
38
|
+
/* Added const qualifiers to remove C++ */
|
39
|
+
/* deprecation warnings. */
|
40
|
+
/* */
|
41
|
+
/* Converted API macros to function calls. */
|
42
|
+
/* */
|
43
|
+
/* Added code to prevent a clear command from */
|
44
|
+
/* being executed during fact assertions via */
|
45
|
+
/* JoinOperationInProgress mechanism. */
|
46
|
+
/* */
|
47
|
+
/* 6.40: Removed LOCALE definition. */
|
48
|
+
/* */
|
49
|
+
/* Pragma once and other inclusion changes. */
|
50
|
+
/* */
|
51
|
+
/* Added support for booleans with <stdbool.h>. */
|
52
|
+
/* */
|
53
|
+
/* Removed use of void pointers for specific */
|
54
|
+
/* data structures. */
|
55
|
+
/* */
|
56
|
+
/* ALLOW_ENVIRONMENT_GLOBALS no longer supported. */
|
57
|
+
/* */
|
58
|
+
/* UDF redesign. */
|
59
|
+
/* */
|
60
|
+
/*************************************************************/
|
61
|
+
|
62
|
+
#ifndef _H_rulebsc
|
63
|
+
|
64
|
+
#pragma once
|
65
|
+
|
66
|
+
#define _H_rulebsc
|
67
|
+
|
68
|
+
#include "evaluatn.h"
|
69
|
+
|
70
|
+
void DefruleBasicCommands(Environment *);
|
71
|
+
void UndefruleCommand(Environment *,UDFContext *,UDFValue *);
|
72
|
+
bool Undefrule(Defrule *,Environment *);
|
73
|
+
void GetDefruleListFunction(Environment *,UDFContext *,UDFValue *);
|
74
|
+
void GetDefruleList(Environment *,CLIPSValue *,Defmodule *);
|
75
|
+
void DefruleModuleFunction(Environment *,UDFContext *,UDFValue *);
|
76
|
+
#if DEBUGGING_FUNCTIONS
|
77
|
+
void PPDefruleCommand(Environment *,UDFContext *,UDFValue *);
|
78
|
+
bool PPDefrule(Environment *,const char *,const char *);
|
79
|
+
void ListDefrulesCommand(Environment *,UDFContext *,UDFValue *);
|
80
|
+
void ListDefrules(Environment *,const char *,Defmodule *);
|
81
|
+
bool DefruleGetWatchFirings(Defrule *);
|
82
|
+
bool DefruleGetWatchActivations(Defrule *);
|
83
|
+
void DefruleSetWatchFirings(Defrule *,bool);
|
84
|
+
void DefruleSetWatchActivations(Defrule *,bool);
|
85
|
+
bool DefruleWatchAccess(Environment *,int,bool,struct expr *);
|
86
|
+
bool DefruleWatchPrint(Environment *,const char *,int,struct expr *);
|
87
|
+
#endif
|
88
|
+
|
89
|
+
#endif /* _H_rulebsc */
|
90
|
+
|
91
|
+
|