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,644 @@
|
|
1
|
+
/*******************************************************/
|
2
|
+
/* "C" Language Integrated Production System */
|
3
|
+
/* */
|
4
|
+
/* CLIPS Version 6.40 08/25/16 */
|
5
|
+
/* */
|
6
|
+
/* LOGICAL DEPENDENCIES MODULE */
|
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: Removed LOGICAL_DEPENDENCIES compilation flag. */
|
21
|
+
/* */
|
22
|
+
/* Renamed BOOLEAN macro type to intBool. */
|
23
|
+
/* */
|
24
|
+
/* Rule with exists CE has incorrect activation. */
|
25
|
+
/* DR0867 */
|
26
|
+
/* */
|
27
|
+
/* 6.30: Added support for hashed memories. */
|
28
|
+
/* */
|
29
|
+
/* 6.40: Added Env prefix to GetHaltExecution and */
|
30
|
+
/* SetHaltExecution functions. */
|
31
|
+
/* */
|
32
|
+
/* Pragma once and other inclusion changes. */
|
33
|
+
/* */
|
34
|
+
/* Added support for booleans with <stdbool.h>. */
|
35
|
+
/* */
|
36
|
+
/* Removed use of void pointers for specific */
|
37
|
+
/* data structures. */
|
38
|
+
/* */
|
39
|
+
/* UDF redesign. */
|
40
|
+
/* */
|
41
|
+
/*************************************************************/
|
42
|
+
|
43
|
+
#include <stdio.h>
|
44
|
+
|
45
|
+
#include "setup.h"
|
46
|
+
|
47
|
+
#if DEFRULE_CONSTRUCT
|
48
|
+
|
49
|
+
#include "argacces.h"
|
50
|
+
#include "engine.h"
|
51
|
+
#include "envrnmnt.h"
|
52
|
+
#include "evaluatn.h"
|
53
|
+
#include "factmngr.h"
|
54
|
+
#include "memalloc.h"
|
55
|
+
#include "pattern.h"
|
56
|
+
#include "reteutil.h"
|
57
|
+
#include "router.h"
|
58
|
+
|
59
|
+
#include "lgcldpnd.h"
|
60
|
+
|
61
|
+
/***************************************/
|
62
|
+
/* LOCAL INTERNAL FUNCTION DEFINITIONS */
|
63
|
+
/***************************************/
|
64
|
+
|
65
|
+
static struct dependency *DetachAssociatedDependencies(Environment *,struct dependency *,void *);
|
66
|
+
|
67
|
+
/***********************************************************************/
|
68
|
+
/* AddLogicalDependencies: Adds the logical dependency links between a */
|
69
|
+
/* data entity (such as a fact or instance) and the partial match */
|
70
|
+
/* which logically supports that data entity. If a data entity is */
|
71
|
+
/* unconditionally asserted (i.e. the global variable TheLogicalJoin */
|
72
|
+
/* is NULL), then existing logical support for the data entity is no */
|
73
|
+
/* longer needed and it is removed. If a data entity is already */
|
74
|
+
/* unconditionally supported and that data entity is conditionally */
|
75
|
+
/* asserted (i.e. the global variable TheLogicalJoin is not NULL), */
|
76
|
+
/* then the logical support is ignored. Otherwise, the partial match */
|
77
|
+
/* is linked to the data entity and the data entity is linked to the */
|
78
|
+
/* partial match. Note that the word assert is used to refer to */
|
79
|
+
/* creating a fact with the assert command and creating an instance */
|
80
|
+
/* with the make-instance command. */
|
81
|
+
/***********************************************************************/
|
82
|
+
bool AddLogicalDependencies(
|
83
|
+
Environment *theEnv,
|
84
|
+
struct patternEntity *theEntity,
|
85
|
+
bool existingEntity)
|
86
|
+
{
|
87
|
+
struct partialMatch *theBinds;
|
88
|
+
struct dependency *newDependency;
|
89
|
+
|
90
|
+
/*==============================================*/
|
91
|
+
/* If the rule has no logical patterns, then no */
|
92
|
+
/* dependencies have to be established. */
|
93
|
+
/*==============================================*/
|
94
|
+
|
95
|
+
if (EngineData(theEnv)->TheLogicalJoin == NULL)
|
96
|
+
{
|
97
|
+
if (existingEntity) RemoveEntityDependencies(theEnv,theEntity);
|
98
|
+
return true;
|
99
|
+
}
|
100
|
+
else if (existingEntity && (theEntity->dependents == NULL))
|
101
|
+
{ return true; }
|
102
|
+
|
103
|
+
/*===========================================================*/
|
104
|
+
/* Retrieve the partial match in the logical join associated */
|
105
|
+
/* with activation partial match (retrieved when the run */
|
106
|
+
/* command was initiated). If the partial match's parent */
|
107
|
+
/* links have been removed, then the partial match must have */
|
108
|
+
/* been deleted by a previous RHS action and the dependency */
|
109
|
+
/* link should not be added. */
|
110
|
+
/*===========================================================*/
|
111
|
+
|
112
|
+
theBinds = EngineData(theEnv)->TheLogicalBind;
|
113
|
+
if (theBinds == NULL) return false;
|
114
|
+
if ((theBinds->leftParent == NULL) && (theBinds->rightParent == NULL))
|
115
|
+
{ return false; }
|
116
|
+
|
117
|
+
/*==============================================================*/
|
118
|
+
/* Add a dependency link between the partial match and the data */
|
119
|
+
/* entity. The dependency links are stored in the partial match */
|
120
|
+
/* behind the data entities stored in the partial match and the */
|
121
|
+
/* activation link, if any. */
|
122
|
+
/*==============================================================*/
|
123
|
+
|
124
|
+
newDependency = get_struct(theEnv,dependency);
|
125
|
+
newDependency->dPtr = theEntity;
|
126
|
+
newDependency->next = (struct dependency *) theBinds->dependents;
|
127
|
+
theBinds->dependents = newDependency;
|
128
|
+
|
129
|
+
/*================================================================*/
|
130
|
+
/* Add a dependency link between the entity and the partialMatch. */
|
131
|
+
/*================================================================*/
|
132
|
+
|
133
|
+
newDependency = get_struct(theEnv,dependency);
|
134
|
+
newDependency->dPtr = theBinds;
|
135
|
+
newDependency->next = (struct dependency *) theEntity->dependents;
|
136
|
+
theEntity->dependents = newDependency;
|
137
|
+
|
138
|
+
/*==================================================================*/
|
139
|
+
/* Return true to indicate that the data entity should be asserted. */
|
140
|
+
/*==================================================================*/
|
141
|
+
|
142
|
+
return true;
|
143
|
+
}
|
144
|
+
|
145
|
+
/************************************************************************/
|
146
|
+
/* FindLogicalBind: Finds the partial match associated with the logical */
|
147
|
+
/* CE which will provide logical support for a data entity asserted */
|
148
|
+
/* from the currently executing rule. The function is called when */
|
149
|
+
/* creating logical support links between the data entity and */
|
150
|
+
/* supporting partial matches. */
|
151
|
+
/************************************************************************/
|
152
|
+
struct partialMatch *FindLogicalBind(
|
153
|
+
struct joinNode *theJoin,
|
154
|
+
struct partialMatch *theBinds)
|
155
|
+
{
|
156
|
+
struct partialMatch *compPtr;
|
157
|
+
|
158
|
+
/*========================================================*/
|
159
|
+
/* Follow the parent link of the activation back through */
|
160
|
+
/* the join network until the join containing the logical */
|
161
|
+
/* partial match is found. The partial match at this */
|
162
|
+
/* join will have the dependency link assigned to it. */
|
163
|
+
/*========================================================*/
|
164
|
+
|
165
|
+
for (compPtr = theBinds;
|
166
|
+
compPtr != NULL;
|
167
|
+
compPtr = compPtr->leftParent)
|
168
|
+
{
|
169
|
+
if (compPtr->owner == theJoin)
|
170
|
+
{ return(compPtr); }
|
171
|
+
}
|
172
|
+
|
173
|
+
return NULL;
|
174
|
+
}
|
175
|
+
|
176
|
+
/*********************************************************************/
|
177
|
+
/* RemoveEntityDependencies: Removes all logical support links from */
|
178
|
+
/* a pattern entity that point to partial matches or other pattern */
|
179
|
+
/* entities. Also removes the associated links from the partial */
|
180
|
+
/* matches or pattern entities which point back to the pattern */
|
181
|
+
/* entities. */
|
182
|
+
/*********************************************************************/
|
183
|
+
void RemoveEntityDependencies(
|
184
|
+
Environment *theEnv,
|
185
|
+
struct patternEntity *theEntity)
|
186
|
+
{
|
187
|
+
struct dependency *fdPtr, *nextPtr, *theList;
|
188
|
+
struct partialMatch *theBinds;
|
189
|
+
|
190
|
+
/*===============================*/
|
191
|
+
/* Get the list of dependencies. */
|
192
|
+
/*===============================*/
|
193
|
+
|
194
|
+
fdPtr = (struct dependency *) theEntity->dependents;
|
195
|
+
|
196
|
+
/*========================================*/
|
197
|
+
/* Loop through each of the dependencies. */
|
198
|
+
/*========================================*/
|
199
|
+
|
200
|
+
while (fdPtr != NULL)
|
201
|
+
{
|
202
|
+
/*===============================*/
|
203
|
+
/* Remember the next dependency. */
|
204
|
+
/*===============================*/
|
205
|
+
|
206
|
+
nextPtr = fdPtr->next;
|
207
|
+
|
208
|
+
/*================================================================*/
|
209
|
+
/* Remove the link between the data entity and the partial match. */
|
210
|
+
/*================================================================*/
|
211
|
+
|
212
|
+
theBinds = (struct partialMatch *) fdPtr->dPtr;
|
213
|
+
theList = (struct dependency *) theBinds->dependents;
|
214
|
+
theList = DetachAssociatedDependencies(theEnv,theList,theEntity);
|
215
|
+
theBinds->dependents = theList;
|
216
|
+
|
217
|
+
/*========================*/
|
218
|
+
/* Return the dependency. */
|
219
|
+
/*========================*/
|
220
|
+
|
221
|
+
rtn_struct(theEnv,dependency,fdPtr);
|
222
|
+
|
223
|
+
/*=================================*/
|
224
|
+
/* Move on to the next dependency. */
|
225
|
+
/*=================================*/
|
226
|
+
|
227
|
+
fdPtr = nextPtr;
|
228
|
+
}
|
229
|
+
|
230
|
+
/*=====================================================*/
|
231
|
+
/* Set the dependency list of the data entity to NULL. */
|
232
|
+
/*=====================================================*/
|
233
|
+
|
234
|
+
theEntity->dependents = NULL;
|
235
|
+
}
|
236
|
+
|
237
|
+
/********************************************************************/
|
238
|
+
/* ReturnEntityDependencies: Removes all logical support links from */
|
239
|
+
/* a pattern entity. This is unidirectional. The links from the */
|
240
|
+
/* the partial match to the entity are not removed. */
|
241
|
+
/********************************************************************/
|
242
|
+
void ReturnEntityDependencies(
|
243
|
+
Environment *theEnv,
|
244
|
+
struct patternEntity *theEntity)
|
245
|
+
{
|
246
|
+
struct dependency *fdPtr, *nextPtr;
|
247
|
+
|
248
|
+
fdPtr = (struct dependency *) theEntity->dependents;
|
249
|
+
|
250
|
+
while (fdPtr != NULL)
|
251
|
+
{
|
252
|
+
nextPtr = fdPtr->next;
|
253
|
+
rtn_struct(theEnv,dependency,fdPtr);
|
254
|
+
fdPtr = nextPtr;
|
255
|
+
}
|
256
|
+
|
257
|
+
theEntity->dependents = NULL;
|
258
|
+
}
|
259
|
+
|
260
|
+
/*******************************************************************/
|
261
|
+
/* DetachAssociatedDependencies: Removes all logical support links */
|
262
|
+
/* which pointer to a pattern entity from a list of dependencies */
|
263
|
+
/* (which may be associated with either a partial match or */
|
264
|
+
/* another pattern entity). Does not remove links which point in */
|
265
|
+
/* the other direction. */
|
266
|
+
/*******************************************************************/
|
267
|
+
static struct dependency *DetachAssociatedDependencies(
|
268
|
+
Environment *theEnv,
|
269
|
+
struct dependency *theList,
|
270
|
+
void *theEntity)
|
271
|
+
{
|
272
|
+
struct dependency *fdPtr, *nextPtr, *lastPtr = NULL;
|
273
|
+
|
274
|
+
fdPtr = theList;
|
275
|
+
|
276
|
+
while (fdPtr != NULL)
|
277
|
+
{
|
278
|
+
if (fdPtr->dPtr == theEntity)
|
279
|
+
{
|
280
|
+
nextPtr = fdPtr->next;
|
281
|
+
if (lastPtr == NULL) theList = nextPtr;
|
282
|
+
else lastPtr->next = nextPtr;
|
283
|
+
rtn_struct(theEnv,dependency,fdPtr);
|
284
|
+
fdPtr = nextPtr;
|
285
|
+
}
|
286
|
+
else
|
287
|
+
{
|
288
|
+
lastPtr = fdPtr;
|
289
|
+
fdPtr = fdPtr->next;
|
290
|
+
}
|
291
|
+
}
|
292
|
+
|
293
|
+
return(theList);
|
294
|
+
}
|
295
|
+
|
296
|
+
/**************************************************************************/
|
297
|
+
/* RemovePMDependencies: Removes all logical support links from a partial */
|
298
|
+
/* match that point to any data entities. Also removes the associated */
|
299
|
+
/* links from the data entities which point back to the partial match. */
|
300
|
+
/**************************************************************************/
|
301
|
+
void RemovePMDependencies(
|
302
|
+
Environment *theEnv,
|
303
|
+
struct partialMatch *theBinds)
|
304
|
+
{
|
305
|
+
struct dependency *fdPtr, *nextPtr, *theList;
|
306
|
+
struct patternEntity *theEntity;
|
307
|
+
|
308
|
+
fdPtr = (struct dependency *) theBinds->dependents;
|
309
|
+
|
310
|
+
while (fdPtr != NULL)
|
311
|
+
{
|
312
|
+
nextPtr = fdPtr->next;
|
313
|
+
|
314
|
+
theEntity = (struct patternEntity *) fdPtr->dPtr;
|
315
|
+
|
316
|
+
theList = (struct dependency *) theEntity->dependents;
|
317
|
+
theList = DetachAssociatedDependencies(theEnv,theList,theBinds);
|
318
|
+
theEntity->dependents = theList;
|
319
|
+
|
320
|
+
rtn_struct(theEnv,dependency,fdPtr);
|
321
|
+
fdPtr = nextPtr;
|
322
|
+
}
|
323
|
+
|
324
|
+
theBinds->dependents = NULL;
|
325
|
+
}
|
326
|
+
|
327
|
+
/************************************************************/
|
328
|
+
/* DestroyPMDependencies: Removes all logical support links */
|
329
|
+
/* from a partial match that point to any data entities. */
|
330
|
+
/************************************************************/
|
331
|
+
void DestroyPMDependencies(
|
332
|
+
Environment *theEnv,
|
333
|
+
struct partialMatch *theBinds)
|
334
|
+
{
|
335
|
+
struct dependency *fdPtr, *nextPtr;
|
336
|
+
|
337
|
+
fdPtr = (struct dependency *) theBinds->dependents;
|
338
|
+
|
339
|
+
while (fdPtr != NULL)
|
340
|
+
{
|
341
|
+
nextPtr = fdPtr->next;
|
342
|
+
|
343
|
+
rtn_struct(theEnv,dependency,fdPtr);
|
344
|
+
fdPtr = nextPtr;
|
345
|
+
}
|
346
|
+
|
347
|
+
theBinds->dependents = NULL;
|
348
|
+
}
|
349
|
+
|
350
|
+
/************************************************************************/
|
351
|
+
/* RemoveLogicalSupport: Removes the dependency links between a partial */
|
352
|
+
/* match and the data entities it logically supports. Also removes */
|
353
|
+
/* the associated links from the data entities which point back to */
|
354
|
+
/* the partial match by calling DetachAssociatedEntityDependencies. */
|
355
|
+
/* If an entity has all of its logical support removed as a result of */
|
356
|
+
/* this procedure, the dependency link from the partial match is */
|
357
|
+
/* added to the list of unsupported data entities so that the entity */
|
358
|
+
/* will be deleted as a result of losing its logical support. */
|
359
|
+
/************************************************************************/
|
360
|
+
void RemoveLogicalSupport(
|
361
|
+
Environment *theEnv,
|
362
|
+
struct partialMatch *theBinds)
|
363
|
+
{
|
364
|
+
struct dependency *dlPtr, *tempPtr, *theList;
|
365
|
+
struct patternEntity *theEntity;
|
366
|
+
|
367
|
+
/*========================================*/
|
368
|
+
/* If the partial match has no associated */
|
369
|
+
/* dependencies, then return. */
|
370
|
+
/*========================================*/
|
371
|
+
|
372
|
+
if (theBinds->dependents == NULL) return;
|
373
|
+
|
374
|
+
/*=======================================*/
|
375
|
+
/* Loop through each of the dependencies */
|
376
|
+
/* attached to the partial match. */
|
377
|
+
/*=======================================*/
|
378
|
+
|
379
|
+
dlPtr = (struct dependency *) theBinds->dependents;
|
380
|
+
|
381
|
+
while (dlPtr != NULL)
|
382
|
+
{
|
383
|
+
/*===============================*/
|
384
|
+
/* Remember the next dependency. */
|
385
|
+
/*===============================*/
|
386
|
+
|
387
|
+
tempPtr = dlPtr->next;
|
388
|
+
|
389
|
+
/*==========================================================*/
|
390
|
+
/* Determine the data entity associated with the dependency */
|
391
|
+
/* structure and delete its dependency references to this */
|
392
|
+
/* partial match. */
|
393
|
+
/*==========================================================*/
|
394
|
+
|
395
|
+
theEntity = (struct patternEntity *) dlPtr->dPtr;
|
396
|
+
|
397
|
+
theList = (struct dependency *) theEntity->dependents;
|
398
|
+
theList = DetachAssociatedDependencies(theEnv,theList,theBinds);
|
399
|
+
theEntity->dependents = theList;
|
400
|
+
|
401
|
+
/*==============================================================*/
|
402
|
+
/* If the data entity has lost all of its logical support, then */
|
403
|
+
/* add the dependency structure from the partial match to the */
|
404
|
+
/* list of unsupported data entities to be deleted. Otherwise, */
|
405
|
+
/* just delete the dependency structure. */
|
406
|
+
/*==============================================================*/
|
407
|
+
|
408
|
+
if (theEntity->dependents == NULL)
|
409
|
+
{
|
410
|
+
(*theEntity->theInfo->base.incrementBusyCount)(theEnv,theEntity);
|
411
|
+
dlPtr->next = EngineData(theEnv)->UnsupportedDataEntities;
|
412
|
+
EngineData(theEnv)->UnsupportedDataEntities = dlPtr;
|
413
|
+
}
|
414
|
+
else
|
415
|
+
{ rtn_struct(theEnv,dependency,dlPtr); }
|
416
|
+
|
417
|
+
/*==================================*/
|
418
|
+
/* Move on to the next dependency. */
|
419
|
+
/*==================================*/
|
420
|
+
|
421
|
+
dlPtr = tempPtr;
|
422
|
+
}
|
423
|
+
|
424
|
+
/*=====================================*/
|
425
|
+
/* The partial match no longer has any */
|
426
|
+
/* dependencies associated with it. */
|
427
|
+
/*=====================================*/
|
428
|
+
|
429
|
+
theBinds->dependents = NULL;
|
430
|
+
}
|
431
|
+
|
432
|
+
/********************************************************************/
|
433
|
+
/* ForceLogicalRetractions: Deletes the data entities found on the */
|
434
|
+
/* list of items that have lost their logical support. The delete */
|
435
|
+
/* function associated with each data entity is called to delete */
|
436
|
+
/* that data entity. Calling the delete function may in turn */
|
437
|
+
/* add more data entities to the list of data entities which have */
|
438
|
+
/* lost their logical support. */
|
439
|
+
/********************************************************************/
|
440
|
+
void ForceLogicalRetractions(
|
441
|
+
Environment *theEnv)
|
442
|
+
{
|
443
|
+
struct dependency *tempPtr;
|
444
|
+
struct patternEntity *theEntity;
|
445
|
+
|
446
|
+
/*===================================================*/
|
447
|
+
/* Don't reenter this function once it's called. Any */
|
448
|
+
/* new additions to the list of items to be deleted */
|
449
|
+
/* as a result of losing their logical support will */
|
450
|
+
/* be handled properly. */
|
451
|
+
/*===================================================*/
|
452
|
+
|
453
|
+
if (EngineData(theEnv)->alreadyEntered) return;
|
454
|
+
EngineData(theEnv)->alreadyEntered = true;
|
455
|
+
|
456
|
+
/*=======================================================*/
|
457
|
+
/* Continue to delete the first item on the list as long */
|
458
|
+
/* as one exists. This is done because new items may be */
|
459
|
+
/* placed at the beginning of the list as other data */
|
460
|
+
/* entities are deleted. */
|
461
|
+
/*=======================================================*/
|
462
|
+
|
463
|
+
while (EngineData(theEnv)->UnsupportedDataEntities != NULL)
|
464
|
+
{
|
465
|
+
/*==========================================*/
|
466
|
+
/* Determine the data entity to be deleted. */
|
467
|
+
/*==========================================*/
|
468
|
+
|
469
|
+
theEntity = (struct patternEntity *) EngineData(theEnv)->UnsupportedDataEntities->dPtr;
|
470
|
+
|
471
|
+
/*================================================*/
|
472
|
+
/* Remove the dependency structure from the list. */
|
473
|
+
/*================================================*/
|
474
|
+
|
475
|
+
tempPtr = EngineData(theEnv)->UnsupportedDataEntities;
|
476
|
+
EngineData(theEnv)->UnsupportedDataEntities = EngineData(theEnv)->UnsupportedDataEntities->next;
|
477
|
+
rtn_struct(theEnv,dependency,tempPtr);
|
478
|
+
|
479
|
+
/*=========================*/
|
480
|
+
/* Delete the data entity. */
|
481
|
+
/*=========================*/
|
482
|
+
|
483
|
+
(*theEntity->theInfo->base.decrementBusyCount)(theEnv,theEntity);
|
484
|
+
(*theEntity->theInfo->base.deleteFunction)(theEntity,theEnv);
|
485
|
+
}
|
486
|
+
|
487
|
+
/*============================================*/
|
488
|
+
/* Deletion of items on the list is complete. */
|
489
|
+
/*============================================*/
|
490
|
+
|
491
|
+
EngineData(theEnv)->alreadyEntered = false;
|
492
|
+
}
|
493
|
+
|
494
|
+
/****************************************************************/
|
495
|
+
/* Dependencies: C access routine for the dependencies command. */
|
496
|
+
/****************************************************************/
|
497
|
+
void Dependencies(
|
498
|
+
Environment *theEnv,
|
499
|
+
struct patternEntity *theEntity)
|
500
|
+
{
|
501
|
+
struct dependency *fdPtr;
|
502
|
+
|
503
|
+
/*=========================================*/
|
504
|
+
/* If the data entity has no dependencies, */
|
505
|
+
/* then print "None" and return. */
|
506
|
+
/*=========================================*/
|
507
|
+
|
508
|
+
if (theEntity->dependents == NULL)
|
509
|
+
{
|
510
|
+
WriteString(theEnv,STDOUT,"None\n");
|
511
|
+
return;
|
512
|
+
}
|
513
|
+
|
514
|
+
/*============================================*/
|
515
|
+
/* Loop through the list of the data entities */
|
516
|
+
/* dependencies and print them. */
|
517
|
+
/*============================================*/
|
518
|
+
|
519
|
+
for (fdPtr = (struct dependency *) theEntity->dependents;
|
520
|
+
fdPtr != NULL;
|
521
|
+
fdPtr = fdPtr->next)
|
522
|
+
{
|
523
|
+
if (GetHaltExecution(theEnv) == true) return;
|
524
|
+
PrintPartialMatch(theEnv,STDOUT,(struct partialMatch *) fdPtr->dPtr);
|
525
|
+
WriteString(theEnv,STDOUT,"\n");
|
526
|
+
}
|
527
|
+
}
|
528
|
+
|
529
|
+
/************************************************************/
|
530
|
+
/* Dependents: C access routine for the dependents command. */
|
531
|
+
/************************************************************/
|
532
|
+
void Dependents(
|
533
|
+
Environment *theEnv,
|
534
|
+
struct patternEntity *theEntity)
|
535
|
+
{
|
536
|
+
struct patternEntity *entityPtr = NULL;
|
537
|
+
struct patternParser *theParser = NULL;
|
538
|
+
struct dependency *fdPtr;
|
539
|
+
struct partialMatch *theBinds;
|
540
|
+
bool found = false;
|
541
|
+
|
542
|
+
/*=================================*/
|
543
|
+
/* Loop through every data entity. */
|
544
|
+
/*=================================*/
|
545
|
+
|
546
|
+
for (GetNextPatternEntity(theEnv,&theParser,&entityPtr);
|
547
|
+
entityPtr != NULL;
|
548
|
+
GetNextPatternEntity(theEnv,&theParser,&entityPtr))
|
549
|
+
{
|
550
|
+
if (GetHaltExecution(theEnv) == true) return;
|
551
|
+
|
552
|
+
/*====================================*/
|
553
|
+
/* Loop through every dependency link */
|
554
|
+
/* associated with the data entity. */
|
555
|
+
/*====================================*/
|
556
|
+
|
557
|
+
for (fdPtr = (struct dependency *) entityPtr->dependents;
|
558
|
+
fdPtr != NULL;
|
559
|
+
fdPtr = fdPtr->next)
|
560
|
+
{
|
561
|
+
if (GetHaltExecution(theEnv) == true) return;
|
562
|
+
|
563
|
+
/*=====================================================*/
|
564
|
+
/* If the data entity which was the argument passed to */
|
565
|
+
/* the dependents command is contained in one of the */
|
566
|
+
/* partial matches of the data entity currently being */
|
567
|
+
/* examined, then the data entity being examined is a */
|
568
|
+
/* dependent. Print the data entity and then move on */
|
569
|
+
/* to the next data entity. */
|
570
|
+
/*=====================================================*/
|
571
|
+
|
572
|
+
theBinds = (struct partialMatch *) fdPtr->dPtr;
|
573
|
+
if (FindEntityInPartialMatch(theEntity,theBinds) == true)
|
574
|
+
{
|
575
|
+
if (found) WriteString(theEnv,STDOUT,",");
|
576
|
+
(*entityPtr->theInfo->base.shortPrintFunction)(theEnv,STDOUT,entityPtr);
|
577
|
+
found = true;
|
578
|
+
break;
|
579
|
+
}
|
580
|
+
}
|
581
|
+
}
|
582
|
+
|
583
|
+
/*=================================================*/
|
584
|
+
/* If no dependents were found, then print "None." */
|
585
|
+
/* Otherwise print a carriage return after the */
|
586
|
+
/* list of dependents. */
|
587
|
+
/*=================================================*/
|
588
|
+
|
589
|
+
if (! found) WriteString(theEnv,STDOUT,"None\n");
|
590
|
+
else WriteString(theEnv,STDOUT,"\n");
|
591
|
+
}
|
592
|
+
|
593
|
+
#if DEBUGGING_FUNCTIONS
|
594
|
+
|
595
|
+
/*********************************************/
|
596
|
+
/* DependenciesCommand: H/L access routine */
|
597
|
+
/* for the dependencies command. */
|
598
|
+
/*********************************************/
|
599
|
+
void DependenciesCommand(
|
600
|
+
Environment *theEnv,
|
601
|
+
UDFContext *context,
|
602
|
+
UDFValue *returnValue)
|
603
|
+
{
|
604
|
+
UDFValue item;
|
605
|
+
void *ptr;
|
606
|
+
|
607
|
+
ptr = GetFactOrInstanceArgument(context,1,&item);
|
608
|
+
|
609
|
+
if (ptr == NULL) return;
|
610
|
+
|
611
|
+
#if DEFRULE_CONSTRUCT
|
612
|
+
Dependencies(theEnv,(struct patternEntity *) ptr);
|
613
|
+
#else
|
614
|
+
WriteString(theEnv,STDOUT,"None\n");
|
615
|
+
#endif
|
616
|
+
}
|
617
|
+
|
618
|
+
/*******************************************/
|
619
|
+
/* DependentsCommand: H/L access routine */
|
620
|
+
/* for the dependents command. */
|
621
|
+
/*******************************************/
|
622
|
+
void DependentsCommand(
|
623
|
+
Environment *theEnv,
|
624
|
+
UDFContext *context,
|
625
|
+
UDFValue *returnValue)
|
626
|
+
{
|
627
|
+
UDFValue item;
|
628
|
+
void *ptr;
|
629
|
+
|
630
|
+
ptr = GetFactOrInstanceArgument(context,1,&item);
|
631
|
+
|
632
|
+
if (ptr == NULL) return;
|
633
|
+
|
634
|
+
#if DEFRULE_CONSTRUCT
|
635
|
+
Dependents(theEnv,(struct patternEntity *) ptr);
|
636
|
+
#else
|
637
|
+
WriteString(theEnv,STDOUT,"None\n");
|
638
|
+
#endif
|
639
|
+
}
|
640
|
+
|
641
|
+
#endif /* DEBUGGING_FUNCTIONS */
|
642
|
+
|
643
|
+
#endif /* DEFRULE_CONSTRUCT */
|
644
|
+
|