rpms/clips/devel DR0873.txt, NONE, 1.1 FunctionContext.zip, NONE, 1.1 objrtmch.c, NONE, 1.1 .cvsignore, 1.4, 1.5 clips.spec, 1.11, 1.12 sources, 1.6, 1.7 xclips.desktop, 1.1, 1.2

Rick L. Vinyard, Jr. rvinyard at fedoraproject.org
Tue Mar 3 16:44:14 UTC 2009


Author: rvinyard

Update of /cvs/pkgs/rpms/clips/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv5775

Modified Files:
	.cvsignore clips.spec sources xclips.desktop 
Added Files:
	DR0873.txt FunctionContext.zip objrtmch.c 
Log Message:



--- NEW FILE DR0873.txt ---
                          CLIPS DISCREPANCY REPORT

DR #                : 0873
DATE                : 06/22/06
STATUS              : OPEN

REPORTED BY         : CLIPS User
ORGANIZATION        : 
PHONE #             :
ADDRESS             :

CLIPS VERSION       : CLIPS 6.24
HOST                : All
OS                  : All

********************
PROBLEM DESCRIPTION:
********************

Use of the object-pattern-match-delay function could cause a NULL
pointer exception.

*****************
COMMAND SEQUENCE:
*****************

1) Load this program:

(defclass A
   (is-a USER) 
   (slot x)) 

(defclass B
   (is-a USER) 
   (slot y)) 

(definstances initialization 
   (ob1 of A (x 1)) 
   (ob2 of B (y 1))) 

(defrule one 
   (object (is-a A) 
           (x ~0)) 
   (object (is-a B) 
           (y ?val)) 
   (test (> ?val 0)) 
   =>)
   
(defrule trigger
   =>
   (object-pattern-match-delay
      (modify-instance [ob1] (x 2))
      (make-instance [ob2] of B (y 2))))
      
2) Issue a (reset) command followed by a (run) command.      
      

***********
RESOLUTION:
***********

Modified the QueueObjectMatchAction function in objrtmch.c
so that instance retract actions always occur before instance
assert and modify actions. This prevents the pattern matching
process from attempting the evaluation of a join expression
that accesses the slots of a retracted instance.

*******
STATUS:
*******

FIXED BY            : Gary Riley
DATE                : 06/22/06
IMPLEMENTED BY      : Gary Riley
IN VERSION          : 6.25
DATE                :
DOCUMENTED BY       :
DATE                :
TESTED BY           :
DATE                :
APPROVED BY         :
DATE                :



--- NEW FILE FunctionContext.zip ---
PK

`À¾°Ø]’²»µÜ³»A˜ðgóx“týx˜ûCJNãŒS?£9O“ ïga“ËG–ѱn/ø8»§ç—ä'š2œëǝý¿²÷ãîÞþîޏ3Wš™Î¿¯:½£.ysÝ;¾:=ë‘÷g'×ÝŽxYjo,ªÀºÏót’0z at .’<cÊÈ I‰a<$1’œÑ”@Ì
è
ö.dY’>ÎAøµÎÏTî ešÒ>Ú˜~P’%$¥ãäž’4·³pLÉDзfþ~2ž€
FçYÚ&[1ìæÍ;ø«4*\x¸Áu²PIS±²ñ¤ÀÅ1!€h%/‰s­r‰Û¯ºàuœ
T㫘Žà'-‰á›—¤wÝír» wœð‹aÛ¯°åPö¦Y|#V¬´ºð¶
„„{‡Úþ”/p„%$ùüGÉ¿^“>Ü)ü~Ÿ2F¬j£Vuÿv5:½ŸN/Îzï;½«›£óÓ›³^÷g|÷9êvÏ>ܘÝo»g¯º—êDB{co­Xä§`Mü1gŽ:s£jimMøISý^[Ãùý,÷£@khšÅC%VâOÁ·4;ÎáægÆáÖò„3·ìEþ d‘¯Ñ^\ÝÓ«ö”ã㹁& b/mÔÍö ]‡ÿêI‰\Ý¥1$¶ôg	ãäqËpuØ•Ý”OÈör²Ìk”¶ÅDFIA™ÕW×6§	Yƒ­©ÐäC˜ŽÅí´‘ÙŠ½6Óçfö궦‰±Æ&ž–Çm]Þ蟂é
õšøî:dö¿ b¯!ÊðçÌþ:š¢-¥àT„—ý¿:~̍ÕCë‘ÕŠ~ÿÅĵÉTí?½jÄ•­”%•#êi˜ÿ…Ž¨'çü=¥ªBð„gWU*JgØúO°žÎ$`¨kʈŸsÒðæ6qâ[˜4ËüþH¬±©)v*&…`؉H0ðè鼩–"Îï“íb[~¤¸æàoþ6I"
;F.L-àÕ=M3±	ö8¾M"¯¾ð(YÀû¹ ËðÀIŽ:2Ii_$žQâ»ã¼øÀcBÅo/FLâ•áC€wï;Jâ¡ê*ï¡€ÿ
àóø.N¦1i‰
·14Kjϳ~ë9
yn£O	*¹}$|M1Jç‚¿«ÎÏS»|sÀG
°ÁÂÙëO8ÿLš-¶~†ò#ˆµÀSÀçÆú—¿øº|É<ðS\¿`ûRð&ý³k;ËÇÌŸtìk°„f¬ÿh
F¹þ˜lÇtªšu ˜´ŠUctõ™ÿo+Úß.wß6w÷›»ƒæîAswØÜý[s÷]swÔÜ=nîŽE7ÞÏ^ÿ³s|usùóåUç}-@"Ô•Ä=Š5Ïš7wß/º¨‡¹5…Q¥DAkÏÃ\6R÷Æ7aèȖ᫉(;
 5¾&‹bbÒlfÖDÇð
ÐíW}?ÒñxT;@Öºüùýë³îÍ»ÆÔÙQ\rÓU],Á¤s?¥¨„bÌq’Ã%¸q÷J0Ÿ .Õª
3L*? @ÊIñ,…¡ßE9ù®6UŒôt‰ÿØ(/Uð÷'?Ê)
Vñ‚ì{ä/äÀ1´Zߐá0Ì,_ö>òPN¹‘«ÅÖ3ÀøÇf¤¢Ísšç¯ÈoYûÛ49Vâ•5Öü³J艟2΍ÒêNÀë'ÙAN¢ê F?åNi¸É$wµ£Ê‡Š%)ð¥ÜUÎYŠr_»NU´ôR•/Y!©çˇ'¹;r5©Yôå÷5åÀÅ‘;H“1¿qE ¬$”’ñK¸,–“R^]½—20M’rÛX®ã‡3|ˆH¢G>“‰mÁ„Ò8*va1ßõ”	ØF’#Àó`Ù|<FŽ¸Ôú’ÿ¶×a(DgõˆxYìË™t>¡Ž#AíщÓL0;j„XI—b‘šìå,8®iáó¢ ‡ÎóãC#FmÄrZ}nÕ
_ÔjrÍtWÍ̯”£5kå|jN±ÚÀ9w‚ÈcI?äeu>aÚŇ¡? z Ã„1™Š^OÃldë5é£xÅ¡hœŽÂþˆL}¦+§sfÄx6;ò°C>ŒhØCV`‚ß¹÷´ù´æzÕ"+ÑäiEF
GÁ¨ 2CÅŸÅÑ#±“~”_ÓÐn
Rü{÷¢J;Må» ;pŠ)xªœ°Ûˆã$«"WØÔ$Öež5”wØòf¸k¹›Ï_3Œ6J#Ùjm
xM`©œXt¶ož€7RÒš
Ã弯*ηxAÕ‚)3PøÆLvÁKÝž‹‹³‹ö¦¾Ì‹+ˆàm‚‚vËã}(P¼‚ÜSáØίñ¦¶(EàÁ¸Éc¤îÒ$»õÕ‡ÓÑì)Ýz¸r^(Ö$%†Q6I…#1Ã¥µ½
3ABæ9<—…ÚYŸô[rïÚß‚W•¿˜‹Ëa è¾°»$µ¸f­_¹ðà~.駳ûèMäÙyïß	é¦^KŽ¥" ?`”ÛR
?æ¶D{
«–´ì–SYi«9Ž«SÍʃ™$,´l>6ÂÛQ6ËL‡L©
ß³†j¹ê£P¬Få,Ô.¡Rˆ*Û¼C`ù</šuò“kŽÍÔÜ$ÿwüÔÊ*#óе\²9)Á^ÖÏ5M¢´_c,N5©Ã”u0¹·³$U$!ìM-Aø‹ Š$."e>Ó–­ÄLS¨ÅÙ
"ãdÛYÝNÌc«­Ø±Ã`ÌŸ01Cm­©«[Ö|”/üýjiMYˆŠ¯/þXO­Ù×X=2š¢«	íÚö¢Lú•NçÒw¥*gèúÎ#꿬©¡î3¹(ÂцbÙÏŠÁqóãDM_
«ó„Ô熷æ<áRÄ-ë¸2Ÿáx_Ií|Ÿ©C„OsíÔGøjÇ×:’“ª`Ç.²;â®^!H¥›½UW·Ž´¢-DåSr1WnŽ"»˜NqàÂet<i,®[É.7iƒ~g‘j|ûA½Cc´®†#FZ´Îê»-Ÿ,ïŽ3V ‰V·á+ÕÜÉ
Û›—UuŠƒ+]߃ôŒóñQŠ‰yóÞ8$ÎÇ·"­³º¦‹>LÄ÷Jo1Vyç|Õ˦ŒPkœ?<­õ€»2Ðq?Ùÿض_…S•VUOíµÝýŽHÙÙ~®Hκ÷±ôδšžã€g¿î=+TO½ÝQàP¯n¨Ó™øYª~u:c1¦
Èè¹E ˆæ«,>2f6n,ýÙ-UþCT‰Ž¯BªŠ5þu¤Ê1Pq¤g	|þÕKàÿ

ÛôÐÕÿ~°›{òoWr-ÔíÅõxx5êô®á(–påSòcšùA|xûFC'ÝþðºÑ\u{Ýk6n°QJjn—MQ®°H—=Mi¶ZÞ>5˦ñbBŸXl–FiæE™]J£»$ZäKtá…a<µKQKÓ$Wÿ!‹gvé2™ú	çZ]…Y0}»tæM³E4Oò-D(¸0ß”/Ó,ÂÙc¾xPHSŸJzÍH·wvvuÑA‹yÝ^Œ'£«ÎÄ
­†Ìç6C¡²ì²Y2vÚÒ¿˜ôFð("ß¿èã¿ã:ó$&ˆPLÉ]ø®ùÖhéÍA@.“¨Å‹ƒ=h2lñ›'[¹lPý(È/þA…Ò]ÊT
,ôœé ‰£2­0|
#õ‹ÞÖPOÜ ’ð
–hà›„zNžXC›0Ð=ÿ®þ#(hÐVc,6K{"Z QVhfh1Ù’x/ö÷üpÑ$”È84®»g^’]rÉ–
=3%½¥a­çïn•&(veP¢e5vKBÅË+pW%@Ú´f–"…œñ8)J佃ú/Ê´2ˆY¹Žæý‰
>bC`&zÒ¸/åã뻯ÉqŽ:¨0xc†emß{‰Ýo’47ùƒ¦°ýÍ&áõ¥wƒ&¦ISé˜çv;ôH•ÆË›v4êšg£wÃ~÷d`5õ&1犄½)v³žÝŠEáÆêH:´5ØRl{
môz»Œ4¤„­»œT”jTY#O_(5JÒ«&y³µgÑtµD;ëG©ƒ:Jfo‚³'œ×é®íÙTc«ðxþ
f®‡_×]ä:!ÅÈÄôªÃøD<ŸUã9[í|&ïÆ«í¹7|ö“O’Y{_ç+çI€ÿÅK
D(Ù|ª‹L-F‘àM‹M÷†­Wî—,á´Y[g-ÖwKÇœ—a(6““ßòr‹?¸‹îâÈ]¼*ÊàîRåØšoåš›D«e<÷+fv•Ñª‰ãOgÞ*ÌŠçÉ¢,)‡ÿT&ý<m½,ö½‡ ±D¹ÿ¹?¹>k÷W£^%qûX{¢{ò×…Áq©JA9Æ30­ŽÊ‡»]c”“‰IúÛ«Á¤Öï
ºëã¡nC0´Q#nÌ€šÍBüÒjé†Îƒ¨rKº¤%`Aåv
`¦r±æ-æÑflvô»Žùñm‹W·„`X5{Šüwo4ŽZO%²äiZ<¶YÆ\°5z'AJVÑ
Rí¢-Ѷ‘œœv„Ds`,؏n!‘ZÌ–‚²©TXYpGÓv’x¿ZÙïsi!EίWŒßˆ^C)–vû`^ÁòqË\ŸÒÔȼ(ãniJ„C·ïip"[Jå)ìȯW{â×ΉÛå=l´•Û&<Û–?ë³Lö‘dÒ8Ø—ì(ÇΖ㜟·.MM]d¯^—Â\ö)C¾ÔoÝ"­^2¥ÈWM3/WŽeIJ<aQª’$Y–*ÓCà
ÐJEa3_³ÌÞ¦Ðп—6÷“‚ Ó7r¬ÏêÚ)­™QýÜAu™¸ü)KC.ö_šþÉ5•E	‹î†0ÚüØ…"1´šÞ,„dæÅ†Ë ÙEl¤Èä(c
ÌþˆsP•µä©*(V#;žù”MM51<Ñêß4#ñÌÌ™W†ŽÛ˜˜x<Æ,]‡=K(%ºˆ“GóTƾTž‰³KÎò	þs/¹ñæô2K™ó }È.1K_‚µÀ(°®VbÔD%O
úüM$OÀÃpìÒ€[liÏ|$`’EלžÈWÇÿ\ðn¯5òÂ2n-êhm¦ó”	Só•8H—tÌ”xL½àñÊÂQÀ-eÁ„ª.Y`;ÝèľK6¼dnÊ…È»æ¥ågXÆñ¦#
ŽƒꌂQV<ÉPvÊ€ƒ·s}Dá“œuûBìè—Lõç4	£~Üåvn­5sé!ëâ-;OÐÐÏu$Ï0,
Œíë)4a„ù­˜=n¿˜”É{Á–
»"½qOà „£§½’ÂØ€qooŠ^žþx}ˆâûˆàYs‹“b"#»6£PYå4êiÄÔÛIžߘ}Ü=÷Vgå=Q{#`{¯†ŸtŒî c­ZXÇÌ“tÄÎ;ZšE˜0¾¶&¤Ñ<»%ÿ IÌœ²õ÷Íô±ömýÛˆ•c[Å·q^¬{)Ûäæä)jåƒf±ž²|[|Å£&/v\Ç°ÆÄvîºLŠûGÜY÷–Ë$^&àK¦ñÊ8(Ü

ì‹wŒò†læWBg4¡ÑT{øœg ½ˆxP3˜êÍÎÃmt¢ÍSPKvØ°Õ»»¢çN¥ÇŠËtyÄ`x
N·¾
Â
œä¬íüŠ>Õö*}d-[kŒ>nyƒ¦ª±Žàîè¥)•Sn"¶S:µ-BQñ¬µ*Õ£(nª9I­l’ÚúH5mè#Ù2­ÜpAG©¦-%à•›_¯¹jí?îRt6u—$Ãiò¶}é¦ò¶
ͧ{VhŽÝ
mç TA·¹‚×E/8MãiÀ.µôéV™ÜÙå‹0½·ãÕ:à—ºÁýˆÐÙ÷‡Y³Âsl‡/Ê ¥›G2¥Iææ•I)i¤+Ð\®‡Aef&Ho6Ív¼„²ká ¥ÕRm÷'ô.ˆW©èhó6¦	SçؽÑÃòkY#Àqð:lÖËH‘û Igä†Ê½nk\Ó8aèPÉcÛ où­CP›.RÞbÅ!àED)Þt7Kâ…Þ´$5Ò¼ÖœF”_:šé!0Ä‹Úí~±‘’{cÛ‘Qk²ŠÒ`±]xÜõ9ÁËF8|ñŠœ®æä,x·ˆ:´>¦s•§! ôK­'OÔ]DÆRè+k)$¬¡óR±
>Muî±4©?㪛Òå”R·ˆ¦®Šj%ðÍÆý+hÝTl±ÁÂfÍ6Šqy’‚êþ?ÃâTA£Úhl—…äGZ“cÀv²
týµô–PòϺ¯­gÓeÌAÇ`[¼ò>çOyUxÉ¢Ž5œ£—ªG¥ˆ¢WÞº^ÒKé*pÑ\…D^›2ÇM$U·k×ÂݼVÑCy8=	·ü`œ‘„¦`.”RTÄõÎz£ˆ>Ú«‘\ís£vtðºÚ£®OG4™—¦lðÜÇ©!-gxàP]˜^½uéלSñS¸J;ɈðÌES¹;"‹Ç¤æK•TkVi1â	b1kZÕ5¤fò
NœT^Ènøda,˜åí·ðÇœ‹cK_MÎk‰Ó4ú/ÇÄä æ2/<0ybõ¡°³ATug:ˆùÔdW)7œmyižmYªä"&šX‚Rz at qb­`„C”ç_Ö¶ñ¼êpZ‹»õ
ew¾{ËeLååÉ[M;CW–nü¸6n^½h’gÏHã+Ò‰¬(wbl4ŸÄ˽£¡
åŽÑzÔʦ|þ …MLµ&Ušãn½ U©P–›èoL!&+l÷‘WœB¼v%1
3G3M(J™:à×}ÀݳŮ nÚ¥\+xù•Býq˜X6 FEÙS"V.8뤆½“Yt읾‰€½ãit썼[€•ã×zB6ñBö¥
Î0¢®X‘tY–ùs×Vë™6« r®
¿«tv'9kÕ
Yþt•nŠLå²y Þáì„Eèq_jþˆC&Âë~Iµ¼U»aâß”}²{™KÎY¨oq*j«ï¼”"lú‚%HšI_[%o9²ÉL„Ü!µ›Õô-Þ¹ Å(Ÿ…¤š3\_­¤Ä’qãAÌåL2Șß9êr`4ñ
yù·fsŸ¸²ö.ÕÚÎô?ÔÁVÓŸàY#*Å%²Ô
0”X8ã¨j³-_|¸b%ñÚ½vU[ìµ¥üÓ¶ù-÷’íò	·ï°†ŒëB\‰•~ZÈºsÕ‰™Èèþ„ŸªàóÏg©‰°ñK[uö—ÊV÷[:ý€üN)uo²¹¤©Úq¦âžÀZb°=V_|áIÚÜAX-
ú~4žÆK+HÕlæÏ/¯±é—̦c7Ü™2®|Ùn`[PT̏ÝjÐÓ)ŒŒœLô8ìJÎsFNÖÍÖô¬GA
«®MÊyâ$M=LéÄ·Æ\N_m*qGr¦„nk®«ÁOÊcH$Ì,ÌéeUÕTÐÕôòbjïîñ“Ê,ºBØÇÀ6v}QÑ欠²PÕÌaÑ
jC%äz“XBq£‘
Fqý³Ÿµ·nįC;‰¼9}bSòó²¨ö¶¹^`òmó@~_½
»$Áo~ûÖu{¾xiÅ	ÕF3«ÃäÐ*zYLò³²D\m¼^qDxãä™ǘwè¸ÅÙѹdbœÄÒÛÊö`tÙ¦ÑìšT–{ ‘nÎýòvä1ԏt(ùÕwFýKöÍ{b~®<
ãì9ŸÝFÄGï¾éÃ=,Ô$˜b>‹:¹ ÿN“ˆ†f<
 ú—W“±Âyzx•ŠÏ²§0B23ÂR)ñáß‹í/'2þõ\ã]üŽša1uò«ýʉWˆ”¹Œ›Ô+

̲D)βDUx
Îo¶g¾ù<þ<c
0ΐŒ«þ¸„¯b²¢0äš®$Ñt)ñ\3ÁaºQš†©yÙùƒ£Ò¹ï'SøJ¥2±n;?ÿн½é~¾éÞt>+2güՏÆÏðäØLJ‡¡ëÔ:ŸšíÆ©®[
Â8Ð,
(Pþʤà!åZuRö'&-?½‰/Ÿ³ˆF(‘0¤²©ZwÇú'ã‘È
:à³€n>ÿô‘úûô•%{bJ¹9‚øEã'Èorâ»÷<ױǒ¹ 7-€q}/DÐù?â§Ã^,0z_R|ç~Ì5©³Ó,cž<ûNÿeâgÒMd<Xw¾k<;ÎB’¿×”áþS0O²€&ëP 	Ì •°”"½¦ûþiÁ)¢˜´k‘fVØiu.}ÿŸï*Υ̮ÊúÃH7VxÄ]b%Xä7¦:Uñ/s€ó
Xãš-9Ò…ÙÓÓ+yÈuã:å_Z+ªMøM¸ÂçA¼ p•.tÖWkÊl™Xc×ëÛ®Ó¸ŽyqV¶™mKýlê½ø}g–ÇÏíEß,Þ•|‡•í¾Lß
ˆ&†b¼˜+¶2‚3‘gš‘€ýƒó;øÔ+Õ\
ÁbR¬yù€ªœ¡#`{ð–Ùr¡,æˆ5@†I9¦ áÕؾUOµç2›<û½(©vÊ>ML.µñçÀù4›Í:ø¤Ö­Ÿ~Ë2ûçÖï¯Vdz0Hû•1=9ü
)@Ã$:{†YS¬«Pvˆ96·ÌÒ»ouÛ.i´é&—Iª“ã¢(y'."aåÛu½ßKeàÑõîmwZˆ“Ä®˜ò~,Mk*Ä)éú8¾•8÷›äm6Ki)¡¾ÏÎ*«îp5‡-¡”+ÍÞ(“J)å	ËŠùєҟһtŽBØÿkmHÚØžˆZ6:ËjgË@]\oÔG9vdÐæ—´¢²"è7¦G$*l|ìQ ŠØœ§Tü!9µ5zûªÓ¶¸÷‚Ûˆ}º~³6SÅù

d;{¤Áˆ#‹(E
$e[Móß÷Íɹxˆ’»»ÚØäï¾æB/:ÍžˆLFôy:xŠF^t»ön1:2|›xöч$ö׳,ˆ#t¹I3¼dÃõÉ[>ÎɃÑù‡Kô')ÙëçÞ?!tøˋ×/_UNÞigx†ãçÓÉøb8¾B“ÓëÑ°drSj4*
1ÂÑ]ÄÑGYÚcÐ7$šÄžìŸÑ,Xy!‘å'­´}Tw>}ÞyɝöÐ4ñf»ý›?lþßTÀÞi'›€ïuúá>B}ßýšÅ>FYŒ	}æL#/ç	Æ…û{!Lñ7ðoϨ®ú^æ¡`Žâ£xŽ²FKúÕ9Ÿ@|¼ ìýÉø³ç"öƒy
ò§ À
Ä-Cžsþ§)1V€p¡{/EëÈûRj
šÀ %pyò¯<SyK
ûc õ,‰Q¶YQ
Æìušùað¥·x«¿bó(÷-y—¿|šâl½ê-žªï@‡©>“×ùÛUeàCýmn'ú;ÝÌú»t“úx¥¿#«ÙÆØÄ(‰–QÆ^sü/Ïÿ=¼Q‚†›÷ýË÷½üñe}/OÙ9šú#t>¾NÇðÃÙõxpu>£ÓáÙùøœüx¹
ã‹ÀöG£É?4øލ&'ýÑ%	`Ò$r†îâÀw‰	ˆõ{/]`_1&-àªJQÝi++
:"m±u”·DàÃ8ºÕVàFÓ‚i
Vü7«Ñó(È/~WÍ&ÙãŠx‘™ë|‡#pS5–c0*K
BìEëÕ™ÐꝠíXñÁiÜ‘Ø‹-šn–_â@?&E§ÓåæaìeêûƒzÖÂõð%‰a¾Å‰c³/Avá­”€ÚNúð±?=ïŸ@4þøú I¥Ž÷Œ¹BùóÈÇè
:¬!üÀ¹ŽK¼`úøz4ªµ0—¦ºw1ŸËgcÓN©^É©ægiœ)Ýñ|ÄA§+<c56Á³8ñµH¤)´·aLÈ',Eä- +դ΀¦|$â/9MbKȦ¢žÚ*)X†®X§Õ™éêÜn±õÛmò•!vëˆ¥ä:À¾bs€˜A‡É;ßÔdž;4Y1󢿀¢Ò!Ϙ-Ðï8‰{2»ÝzòèX‹Ð½µh3ó•[ÃÏ[O>‰¨áåg0Áô½¯¤4÷
~9ér’T“ã
/\P£Â «GÇ7uéøSgñ:ôQS[¹1ɐÃ@jS@÷°›£\C%3.³8aœàŽJ)
G]”܁vKÙ#i+ :
Ðkw¶Ÿž=3ìhEj®øýSðùXͤŒIO”ðž?mùó×ü­lf*¡,“ÿDìáà
5„±I
Å?Ö>ˆª;“ñ]0ra·ÉŽø+ËïÐz‡u’Çõ$÷”ÈŸ´ÐÓ|Ö]@*å/¢uhvÌìš[ËÄš)Xhä=£ž(?
$TíêÿÛ—!)j4)'±Rú´Þ‚Æ»Umoo¢²T»ù0óL•þn²OIùs uh
/–ÞŠ%Ï5ù®Â©@£í¨.»S g	…Ï#ÊÄŽYt¹žqjþ?Ä®Œ!ËKÍÒms ©%íãÚT¨œ®¤~VþJÍÊYKŠð½ºKŵ$<÷&ÒÍptõ“
]B,œBS$+;ŠSE' ÿ[Ò sÉeRòKpÊe=§ò#²U"ÖÌ€šA좴6_läí-{ˆ È–†Ð!´‘eU[A~Ì)¨
T$tés
(.
(Mæ² Ú‰—
u`·å©Æ[]§j«k
Kn%˜Âëž—Àú(Š£åóÔ'§óe¥&5'r
—ªT-òjŠ¥Í°ÕKû¬*ÙÔ(›4çQ#…3«6&&å³¾7UA)ºhŸéõ!]E§¡*î Ž™)…ûQ”Ò¨5WK§bZ”߃jî)c(´–‚sl5¨Jzf•,wáZ#Eµ«¦6NeuŒh /¼gÜìÎ=ïRC\I4IWy<§Çbâ/ìPæíÛVóðAÁ½9qË͝JW]‘¸,÷7¸ä}¨|.CBf x)
pz[÷£\«CJCà®éM}Ú¾nÉ’HàV	Néq÷ÌZERC<žM¯GÛÁd|	
®ä®ôfº{Çáž‘?ñr;]vè*»)Óœ @Ii;#çåÕ)n¥dŽYS}þ²+š‘ÈX³½µ´îìê¯w5™X·Kó6E¸Õ©1±]Ò{Â؁
NÌÅDEC¢K´£Ÿ¦òè*ïÍQÖ±úv´=ò_ô~ü**ýDŒœm2¼úNzQ©­¶XTõXZ;çGi¹Z¶rY~þ–‰r¯YÓÓaýñrпlCGTŸ8ÿÕqŒ\ûbW‘ò;8>oç+©÷(ÄN13`“‡„p'£Éàï7ËÉô_ŒVD«ûax{þæàŽJ#M<÷­•üäÇ­Œùþe§jD•FÈ’L=¨©³Úé]µ 4]'ª_ÝÇRÝÞž*!+½ôÂjT#Ͼ﫲hñ·Ã}^UÙ¨Z7íkùe ZA	:g‚eò•”;÷°tòP’|¦÷“ N‚lSRá¶Â’ß =×¼(Ì~	½4c6Wù“eáF­0Cq l[÷,ÆêncJ;¿+6ª
r À·

z„-"² Ðe’.8‘Ô…Ýh&½Áh#$
ñ}åš«T¹ÙëFðJ¹P¾oî¸{¼½{¸½{<ª|Žgû±=t¬´_œæ¸ÛwFб­–=„v·g—(ŸÊvãTÕÌ
úÃ0’£æ!âº[
2Éaèß”é_ÀÿÃX®‹ÞE´Z…\Æe°"B¨{™á%Ñ7‰p7 qóB}(
 qíÍÂ…Ig‚2…7“
›;I±	¦¡;læG.…«dãfyÕ¸¦ÌõæûfWœ
ÁrâÙVN!wª(t‰$ê´!$ÇÇÚ)“-ÌSÿaçüªºg* è±tB4b̈ïgJfÕ³’-	ƒÌdDr*#Î^‰Ñ1æ]|€‰š‘Ýå ÄoÊumz®þœƒ ¢C3V„‹L
írKRá²`¼Ôß=¹l&£Âÿ«y¸ÿï@W3}ø}ä?]n5Öô÷Ù	˜ñw×v¨Šgçês.ÌæºUcyÔCà|^¼Ž5egD?÷×~Û'Qroø·gððK¨–¯~v¤&‘²Fx´³
™›sV̪9°ƶÇÜò.[‡:ŒÔ‘ËáîgTÕ˜úŽÆØßÁ¥h´ø"R““úAÄEGð½0·â=©é'Œ$ˆÄ$*§ñšVÉÛwZÝ>ЍƿPK






̲DUx





--- NEW FILE objrtmch.c ---
   /*******************************************************/
   /*      "C" Language Integrated Production System      */
   /*                                                     */
   /*               CLIPS Version 6.25  06/22/06          */
   /*                                                     */
   /*          OBJECT PATTERN MATCHER MODULE              */
   /*******************************************************/

/**************************************************************/
/* Purpose: RETE Network Interface for Objects                */
/*                                                            */
/* Principal Programmer(s):                                   */
/*      Brian L. Donnell                                      */
/*                                                            */
/* Contributing Programmer(s):                                */
/*                                                            */
/* Revision History:                                          */
/*      6.23: Correction for FalseSymbol/TrueSymbol. DR0859   */
/*                                                            */
/*      6.24: Removed INCREMENTAL_RESET and                   */
/*            LOGICAL_DEPENDENCIES compilation flags.         */
/*                                                            */
/*            Converted INSTANCE_PATTERN_MATCHING to          */
/*            DEFRULE_CONSTRUCT.                              */
/*                                                            */
/*            Renamed BOOLEAN macro type to intBool.          */
/*                                                            */
/*      6.25: Modified the QueueObjectMatchAction function    */
/*            so that instance retract actions always occur   */
/*            before instance assert and modify actions.      */
/*            This prevents the pattern matching process      */
/*            from attempting the evaluation of a join        */
/*            expression that accesses the slots of a         */
/*            retracted instance.                             */
/*                                                            */
/**************************************************************/
/* =========================================
   *****************************************
               EXTERNAL DEFINITIONS
   =========================================
   ***************************************** */
#include "setup.h"

#if DEFRULE_CONSTRUCT && OBJECT_SYSTEM

#include "classfun.h"
#include "memalloc.h"
#include "drive.h"
#include "engine.h"
#include "envrnmnt.h"
#include "lgcldpnd.h"
#include "multifld.h"

#if (! RUN_TIME) && (! BLOAD_ONLY)
#include "incrrset.h"
#endif

#include "reteutil.h"
#include "ruledlt.h"
#include "reorder.h"
#include "retract.h"
#include "router.h"

#include "objrtfnx.h"

#define _OBJRTMCH_SOURCE_
#include "objrtmch.h"

#include "insmngr.h"

/* =========================================
   *****************************************
      INTERNALLY VISIBLE FUNCTION HEADERS
   =========================================
   ***************************************** */

static void QueueObjectMatchAction(void *,int,INSTANCE_TYPE *,int);
static SLOT_BITMAP *QueueModifySlotMap(void *,SLOT_BITMAP *,int);
static void ReturnObjectMatchAction(void *,OBJECT_MATCH_ACTION *);
static void ProcessObjectMatchQueue(void *);
static void MarkObjectPatternNetwork(void *,SLOT_BITMAP *);
static intBool CompareSlotBitMaps(SLOT_BITMAP *,SLOT_BITMAP *);
static void ObjectPatternMatch(void *,int,OBJECT_PATTERN_NODE *,struct multifieldMarker *);
static void ProcessPatternNode(void *,int,OBJECT_PATTERN_NODE *,struct multifieldMarker *);
static void CreateObjectAlphaMatch(void *,OBJECT_ALPHA_NODE *);
static intBool EvaluateObjectPatternTest(void *,int,struct multifieldMarker *,EXPRESSION *,
                                         OBJECT_PATTERN_NODE *);
static void ObjectAssertAction(void *,INSTANCE_TYPE *);
static void ObjectModifyAction(void *,INSTANCE_TYPE *,SLOT_BITMAP *);
static void ObjectRetractAction(void *,INSTANCE_TYPE *,SLOT_BITMAP *);
static void ObjectPatternNetErrorMessage(void *,OBJECT_PATTERN_NODE *);
static void TraceErrorToObjectPattern(void *,int,OBJECT_PATTERN_NODE *);

/* =========================================
   *****************************************
          EXTERNALLY VISIBLE FUNCTIONS
   =========================================
   ***************************************** */

/***************************************************************************
  NAME         : ObjectMatchDelay
  DESCRIPTION  : H/L interface for SetDelayObjectPatternMatching
  INPUTS       : None
  RETURNS      : Nothing useful
  SIDE EFFECTS : DelayObjectPatternMatching set and Rete network updates
                 delayed until pattern-matching is completed
  NOTES        : H/L Syntax: (object-pattern-match-delay <action>*)
 ***************************************************************************/
globle void ObjectMatchDelay(
  void *theEnv,
  DATA_OBJECT *result)
  {
   register int ov;

   ov = SetDelayObjectPatternMatching(theEnv,TRUE);
   EvaluateExpression(theEnv,GetFirstArgument(),result);
   if (EvaluationData(theEnv)->EvaluationError)
     {
      SetHaltExecution(theEnv,FALSE);
      SetEvaluationError(theEnv,FALSE);
      SetDelayObjectPatternMatching(theEnv,ov);
      SetEvaluationError(theEnv,TRUE);
     }
   else
     SetDelayObjectPatternMatching(theEnv,ov);
  }

/***************************************************
  NAME         : SetDelayObjectPatternMatching
  DESCRIPTION  : Sets the flag determining if Rete
                 network activity is to be delayed
                 for objects or not
  INPUTS       : The value of the flag
  RETURNS      : The old value of the flag
  SIDE EFFECTS : DelayObjectPatternMatching set
  NOTES        : When the delay is set to FALSE,
                 all pending Rete network updates
                 are performed
 ***************************************************/
globle intBool SetDelayObjectPatternMatching(
  void *theEnv,
  int value)
  {
   intBool oldval;

   oldval = ObjectReteData(theEnv)->DelayObjectPatternMatching;
   if (value)
     ObjectReteData(theEnv)->DelayObjectPatternMatching = TRUE;
   else
     {
      ObjectReteData(theEnv)->DelayObjectPatternMatching = FALSE;
      ObjectNetworkAction(theEnv,0,NULL,-1);
     }
   return(oldval);
  }

/***************************************************
  NAME         : GetDelayObjectPatternMatching
  DESCRIPTION  : Gets the flag determining if Rete
                 network activity is to be delayed
                 for objects or not
  INPUTS       : None
  RETURNS      : The flag
  SIDE EFFECTS : None
  NOTES        : None
 ***************************************************/
globle intBool GetDelayObjectPatternMatching(
  void *theEnv)
  {
   return(ObjectReteData(theEnv)->DelayObjectPatternMatching);
  }

/********************************************************
  NAME         : ObjectNetworkPointer
  DESCRIPTION  : Returns the first object network
                 pattern node
  INPUTS       : None
  RETURNS      : The top of the object pattern network
  SIDE EFFECTS : None
  NOTES        : None
 ********************************************************/
globle OBJECT_PATTERN_NODE *ObjectNetworkPointer(
  void *theEnv)
  {
   return(ObjectReteData(theEnv)->ObjectPatternNetworkPointer);
  }

/********************************************************
  NAME         : ObjectNetworkTerminalPointer
  DESCRIPTION  : Returns the first terminal pattern node
  INPUTS       : None
  RETURNS      : The last node of a pattern
  SIDE EFFECTS : None
  NOTES        : None
 ********************************************************/
globle OBJECT_ALPHA_NODE *ObjectNetworkTerminalPointer(
  void *theEnv)
  {
   return(ObjectReteData(theEnv)->ObjectPatternNetworkTerminalPointer);
  }

/***************************************************
  NAME         : SetObjectNetworkPointer
  DESCRIPTION  : Sets the object pattern network to
                  the given network
  INPUTS       : Top of the new pattern network
  RETURNS      : Nothing useful
  SIDE EFFECTS : ObjectPatternNetworkPointer set
  NOTES        : None
 ***************************************************/
globle void SetObjectNetworkPointer(
  void *theEnv,
  OBJECT_PATTERN_NODE *value)
  {
   ObjectReteData(theEnv)->ObjectPatternNetworkPointer = value;
  }

/*******************************************************
  NAME         : SetObjectNetworkTerminalPointer
  DESCRIPTION  : Sets the global list of terminal
                 pattern nodes (the ones containing
                 the bitmaps) to the given node
  INPUTS       : The last node of a pattern
  RETURNS      : Nothing useful
  SIDE EFFECTS : ObjectPatternNetworkTerminalPointer set
  NOTES        : None
 *******************************************************/
globle void SetObjectNetworkTerminalPointer(
  void *theEnv,
  OBJECT_ALPHA_NODE *value)
  {
   ObjectReteData(theEnv)->ObjectPatternNetworkTerminalPointer = value;
  }

/************************************************************************
  NAME         : ObjectNetworkAction
  DESCRIPTION  : Main driver for pattern-matching on objects
                 If the pattern-matching is current delayed or another
                 object is currently being pattern-matched, the requested
                 match action is queued for later processing.
                 Otherwise, the match action is performed and the
                 Rete network is updated.
  INPUTS       : 1) The match action type
                    OBJECT_ASSERT  (1)
                    OBJECT_RETRACT (2)
                    OBJECT_MODIFY  (3)
                 2) The instance to be matched (can be NULL if only
                    want pending actions to be performed)
                 3) The name id of the slot being updated (can be -1)
                    If this argument is -1, it is assumed that any
                    pattern which could match this instance must be
                    checked.  Otherwise, only the patterns which
                    explicitly match on the named slot will be checked.
  RETURNS      : Nothing useful
  SIDE EFFECTS : Action queued or Rete network updated
  NOTES        : None
 ************************************************************************/
globle void ObjectNetworkAction(
  void *theEnv,
  int type,
  INSTANCE_TYPE *ins,
  int slotNameID)
  {
   SLOT_BITMAP *tmpMap;

   if (EngineData(theEnv)->JoinOperationInProgress)
     return;

   EngineData(theEnv)->JoinOperationInProgress = TRUE;


   /* ================================================
      For purposes of conflict resolution, all objects
      which have had pattern-matching delayed will
      have the same relative timestamp, i.e., the
      inference engine thinks they all just appeared
      simultaneously

      When delay is off, however, each object gets the
      new and current timestamp as expected.
      ================================================ */
   ObjectReteData(theEnv)->UseEntityTimeTag = DefruleData(theEnv)->CurrentEntityTimeTag++;

   /* ==================================================
      If pattern-matching is delayed (by use of the
      set-object-pattern-match-delay function), then
      the instance should be marked for later processing
      (when the delay is turned off).
      ================================================== */
   if (ins != NULL)
     {
      /* 6.05 Bug Fix */
      ins->reteSynchronized = FALSE;

      if (ObjectReteData(theEnv)->DelayObjectPatternMatching == FALSE)
        switch (type)
        {
         case OBJECT_ASSERT  :
           ObjectAssertAction(theEnv,ins);
           break;
         case OBJECT_RETRACT :
           ObjectRetractAction(theEnv,ins,NULL);
           break;
         default             :
           tmpMap = QueueModifySlotMap(theEnv,NULL,slotNameID);
           ObjectModifyAction(theEnv,ins,tmpMap);
           rm(theEnv,(void *) tmpMap,SlotBitMapSize(tmpMap));
        }
      else
        QueueObjectMatchAction(theEnv,type,ins,slotNameID);
     }

   /* ========================================
      Process all pending actions in the queue
      All updates will use the same timestamp
      ======================================== */
   ProcessObjectMatchQueue(theEnv);

   EngineData(theEnv)->JoinOperationInProgress = FALSE;

   ForceLogicalRetractions(theEnv);

   /*=========================================*/
   /* Free partial matches that were released */
   /* by the assertion of the fact.           */
   /*=========================================*/

   if (EngineData(theEnv)->ExecutingRule == NULL) FlushGarbagePartialMatches(theEnv);
  }

/* =========================================
   *****************************************
          INTERNALLY VISIBLE FUNCTIONS
   =========================================
   ***************************************** */

/***************************************************
  NAME         : ResetObjectMatchTimeTags
  DESCRIPTION  : If CurrentObjectMatchTimeTag + 1
                 would cause an overflow,
                 CurrentObjectMatchTimeTag
                 is reset to 0L and all time tags
                 in object pattern nodes are reset.
  INPUTS       : None
  RETURNS      : Nothing useful
  SIDE EFFECTS : CurrentObjectMatchTimeTag reset to
                 0, and all match time tags reset
                 These tags are used to recognize
                 valid pattern nodes on a match
  NOTES        : None
 ***************************************************/
globle void ResetObjectMatchTimeTags(
  void *theEnv)
  {
   OBJECT_ALPHA_NODE *alphaPtr;
   OBJECT_PATTERN_NODE *lastLevel;

   /* ============================================
      If the current tag incremented by one would
      not cause an overflow, then we can leave
      things alone.
      ============================================ */
   if ((ObjectReteData(theEnv)->CurrentObjectMatchTimeTag + 1L) > ObjectReteData(theEnv)->CurrentObjectMatchTimeTag)
     return;
   ObjectReteData(theEnv)->CurrentObjectMatchTimeTag = 0L;
   alphaPtr = ObjectNetworkTerminalPointer(theEnv);
   while (alphaPtr != NULL)
     {
      alphaPtr->matchTimeTag = 0L;
      lastLevel = alphaPtr->patternNode;
      while (lastLevel != NULL)
        {
         if (lastLevel->matchTimeTag == 0L)
           break;
         lastLevel->matchTimeTag = 0L;
         lastLevel = lastLevel->lastLevel;
        }
      alphaPtr = alphaPtr->nxtTerminal;
     }
  }

/***************************************************
  NAME         : QueueObjectMatchAction
  DESCRIPTION  : Posts a Rete network match event
                 for later processing
  INPUTS       : 1) The match action type
                    OBJECT_ASSERT  (1)
                    OBJECT_RETRACT (2)
                    OBJECT_MODIFY  (3)
                 2) The instance to be matched
                 3) The name id of the slot being
                    updated (can be -1)
  RETURNS      : Nothing useful
  SIDE EFFECTS : Queue updated
  NOTES        : None
 ***************************************************/
static void QueueObjectMatchAction(
  void *theEnv,
  int type,
  INSTANCE_TYPE *ins,
  int slotNameID)
  {
   OBJECT_MATCH_ACTION *prv,*cur,*newMatch;
   OBJECT_MATCH_ACTION *prvRetract = NULL; /* DR0873 */
   
   prv = NULL;
   cur = ObjectReteData(theEnv)->ObjectMatchActionQueue;
   while (cur != NULL)
     {
      /* ===========================================================
         Here are the possibilities for the first Rete event already
         on the queue as compared with the new event for an object:

         Assert/Retract  -->  Delete assert event
                              Ignore retract event
         Assert/Modify   -->  Ignore modify event
         Modify/Modify   -->  Merge new modify event
         Modify/Retract  -->  Delete modify event
                              Queue the retract event
         =========================================================== */
      if (cur->ins == ins)
        {
         /* ===================================================
            An action for initially asserting the newly created
            object to all applicable patterns
            =================================================== */
         if (cur->type == OBJECT_ASSERT)
           {
            if (type == OBJECT_RETRACT)
              {
               /* ===================================================
                  If we are retracting the entire object, then we can
                  remove the assert action (and all modifies as well)
                  and ignore the retract action
                  (basically the object came and went before the Rete
                  network had a chance to see it)
                  =================================================== */
               if (prv == NULL)
                 ObjectReteData(theEnv)->ObjectMatchActionQueue = cur->nxt;
               else
                 prv->nxt = cur->nxt;
               cur->ins->busy--;
               ReturnObjectMatchAction(theEnv,cur);
              }

            /* =================================================
               If this is a modify action, then we can ignore it
               since the assert action will encompass it
               ================================================= */
           }

         /* ===================================================
            If the object is being deleted after a slot modify,
            drop the modify event and replace with the retract
            =================================================== */
         else if (type == OBJECT_RETRACT)
           {
            cur->type = OBJECT_RETRACT;
            if (cur->slotNameIDs != NULL)
              {
               rm(theEnv,(void *) cur->slotNameIDs,SlotBitMapSize(cur->slotNameIDs));
               cur->slotNameIDs = NULL;
              }
           }

         /* ====================================================
            If a modify event for this slot is already on the
            queue, ignore this one. Otherwise, merge the slot id
            ==================================================== */
         else
            cur->slotNameIDs = QueueModifySlotMap(theEnv,cur->slotNameIDs,slotNameID);

         return;
        }
        
      if (cur->type == OBJECT_RETRACT) /* DR0873 */ 
        { prvRetract = cur; }          /* DR0873 */
      prv = cur;
      cur = cur->nxt;
     }

   /* ================================================
      If there are no actions for the instance already
      on the queue, the new action is simply appended.
      ================================================ */
   newMatch = get_struct(theEnv,objectMatchAction);
   newMatch->type = type;
   newMatch->nxt = NULL; /* If we get here, cur should be NULL */
   newMatch->slotNameIDs = (type != OBJECT_MODIFY) ? NULL :
                       QueueModifySlotMap(theEnv,NULL,slotNameID);
   newMatch->ins = ins;
   newMatch->ins->busy++;
   
   /* DR0873 Begin */
   /* Retract operations must be processed before assert and   */
   /* modify actions, otherwise the pattern matching process   */
   /* might attempt to access the slots of a retract instance. */

   if (type == OBJECT_RETRACT)
     {
      if (prvRetract == NULL)
        {
         newMatch->nxt = ObjectReteData(theEnv)->ObjectMatchActionQueue;
         ObjectReteData(theEnv)->ObjectMatchActionQueue = newMatch;
        }
      else
        {
         newMatch->nxt = prvRetract->nxt;
         prvRetract->nxt = newMatch;
        }
     }
   else
   /* DR0873 End */
   
   if (prv == NULL)
     ObjectReteData(theEnv)->ObjectMatchActionQueue = newMatch;
   else
     prv->nxt = newMatch;
  }

/****************************************************
  NAME         : QueueModifySlotMap
  DESCRIPTION  : Sets the bitmap for a queued
                 object modify Rete network action
  INPUTS       : 1) The old bitmap (can be NULL)
                 2) The canonical slot id to set
  RETURNS      : The (new) bitmap
  SIDE EFFECTS : Bitmap allocated/reallocated if
                 necessary, and slot id bit set
  NOTES        : If the bitmap must be (re)allocated,
                 this routine allocates twice the
                 room necessary for the current id
                 to allow for growth.
 ****************************************************/
static SLOT_BITMAP *QueueModifySlotMap(
  void *theEnv,
  SLOT_BITMAP *oldMap,
  int slotNameID)
  {
   SLOT_BITMAP *newMap;
   unsigned short newmaxid;
   unsigned oldsz,newsz;

   if ((oldMap == NULL) ? TRUE : (slotNameID > oldMap->maxid))
     {
      newmaxid = (unsigned short) (slotNameID * 2);
      newsz = sizeof(SLOT_BITMAP) +
              (sizeof(char) * (newmaxid / BITS_PER_BYTE));
      newMap = (SLOT_BITMAP *) gm2(theEnv,newsz);
      ClearBitString((void *) newMap,newsz);
      if (oldMap != NULL)
        {
         oldsz = SlotBitMapSize(oldMap);
         GenCopyMemory(char,oldsz,newMap,oldMap);
         rm(theEnv,(void *) oldMap,oldsz);
        }
      newMap->maxid = newmaxid;
     }
   else
     newMap = oldMap;
   SetBitMap(newMap->map,slotNameID);
   return(newMap);
  }

/***************************************************
  NAME         : ReturnObjectMatchAction
  DESCRIPTION  : Deallocates and object match action
                 structure and associated slot
                 bitmap (if any)
  INPUTS       : The queued match action item
  RETURNS      : Nothing useful
  SIDE EFFECTS : Object match action item deleted
  NOTES        : None
 ***************************************************/
static void ReturnObjectMatchAction(
  void *theEnv,
  OBJECT_MATCH_ACTION *omaPtr)
  {
   if (omaPtr->slotNameIDs != NULL)
     rm(theEnv,(void *) omaPtr->slotNameIDs,SlotBitMapSize(omaPtr->slotNameIDs));
   rtn_struct(theEnv,objectMatchAction,omaPtr);
  }

/***************************************************
  NAME         : ProcessObjectMatchQueue
  DESCRIPTION  : Processes all outstanding object
                 Rete network update events
  INPUTS       : None
  RETURNS      : Nothing useful
  SIDE EFFECTS : Pattern-matching on objects
  NOTES        : None
 ***************************************************/
static void ProcessObjectMatchQueue(
  void *theEnv)
  {
   OBJECT_MATCH_ACTION *cur;

   while ((ObjectReteData(theEnv)->ObjectMatchActionQueue != NULL) &&
          (ObjectReteData(theEnv)->DelayObjectPatternMatching == FALSE))
     {
      cur = ObjectReteData(theEnv)->ObjectMatchActionQueue;
      ObjectReteData(theEnv)->ObjectMatchActionQueue = cur->nxt;

      switch(cur->type)
        {
         case OBJECT_ASSERT  :
           ObjectAssertAction(theEnv,cur->ins);
           break;
         case OBJECT_RETRACT :
           ObjectRetractAction(theEnv,cur->ins,cur->slotNameIDs);
           break;
         default             :
           ObjectModifyAction(theEnv,cur->ins,cur->slotNameIDs);
        }
      cur->ins->busy--;
      ReturnObjectMatchAction(theEnv,cur);
     }
  }

/******************************************************
  NAME         : MarkObjectPatternNetwork
  DESCRIPTION  : Iterates through all terminal
                 pattern nodes checking class and
                 slot bitmaps.  If a pattern is
                 applicable to the object/slot change,
                 then all the nodes belonging to
                 the pattern are marked as needing
                 to be examined by the pattern matcher.
  INPUTS       : The bitmap of ids of the slots being
                 changed (NULL if this is an assert for the
                  for the entire object)
  RETURNS      : Nothing useful
  SIDE EFFECTS : Applicable pattern nodes marked
  NOTES        : Incremental reset status is also
                 checked here
 ******************************************************/
static void MarkObjectPatternNetwork(
  void *theEnv,
  SLOT_BITMAP *slotNameIDs)
  {
   OBJECT_ALPHA_NODE *alphaPtr;
   OBJECT_PATTERN_NODE *upper;
   CLASS_BITMAP *clsset;
   unsigned id;

   ResetObjectMatchTimeTags(theEnv);
   ObjectReteData(theEnv)->CurrentObjectMatchTimeTag++;
   alphaPtr = ObjectNetworkTerminalPointer(theEnv);
   id = ObjectReteData(theEnv)->CurrentPatternObject->cls->id;
   while (alphaPtr != NULL)
     {
      /* =============================================================
         If an incremental reset is in progress, make sure that the
         pattern has been marked for initialization before proceeding.
         ============================================================= */
#if (! RUN_TIME) && (! BLOAD_ONLY)
      if (EngineData(theEnv)->IncrementalResetInProgress &&
          (alphaPtr->header.initialize == FALSE))
        {
         alphaPtr = alphaPtr->nxtTerminal;
         continue;
        }
#endif

      /* ============================================
         Check the class bitmap to see if the pattern
         pattern is applicable to the object at all
         ============================================ */
      clsset = (CLASS_BITMAP *) ValueToBitMap(alphaPtr->classbmp);

      if ((id > (unsigned) clsset->maxid) ? FALSE : TestBitMap(clsset->map,id))
        {
         /* ===================================================
            If we are doing an assert, then we need to
            check all patterns which satsify the class bitmap
            (The retraction has already been done in this case)
            =================================================== */
         if (slotNameIDs == NULL)
           {
            alphaPtr->matchTimeTag = ObjectReteData(theEnv)->CurrentObjectMatchTimeTag;
            for (upper = alphaPtr->patternNode ; upper != NULL ; upper = upper->lastLevel)
              {
               if (upper->matchTimeTag == ObjectReteData(theEnv)->CurrentObjectMatchTimeTag)
                 break;
               else
                 upper->matchTimeTag = ObjectReteData(theEnv)->CurrentObjectMatchTimeTag;
              }
           }

         /* ===================================================
            If we are doing a slot modify, then we need to
            check only the subset of patterns which satisfy the
            class bitmap AND actually match on the slot in
            question.
            =================================================== */
         else if (alphaPtr->slotbmp != NULL)
           {
           if (CompareSlotBitMaps(slotNameIDs,
                  (SLOT_BITMAP *) ValueToBitMap(alphaPtr->slotbmp)))
              {
               alphaPtr->matchTimeTag = ObjectReteData(theEnv)->CurrentObjectMatchTimeTag;
               for (upper = alphaPtr->patternNode ; upper != NULL ; upper = upper->lastLevel)
                 {
                  if (upper->matchTimeTag == ObjectReteData(theEnv)->CurrentObjectMatchTimeTag)
                    break;
                  else
                    upper->matchTimeTag = ObjectReteData(theEnv)->CurrentObjectMatchTimeTag;
                 }
              }
           }
        }
      alphaPtr = alphaPtr->nxtTerminal;
     }
  }

/***************************************************
  NAME         : CompareSlotBitMaps
  DESCRIPTION  : Compares two slot bitmaps by
                 bitwising and'ing byte per byte up
                 to the length of the smaller map.
  INPUTS       : The two slot bitmaps
  RETURNS      : TRUE if any common bits
                 are set in both maps, FALSE
                 otherwise
  SIDE EFFECTS : None
  NOTES        : None
 ***************************************************/
static intBool CompareSlotBitMaps(
  SLOT_BITMAP *smap1,
  SLOT_BITMAP *smap2)
  {
   unsigned short i,maxByte;

   maxByte = (unsigned short)
             (((smap1->maxid < smap2->maxid) ?
              smap1->maxid : smap2->maxid) / BITS_PER_BYTE);
   for (i = 0 ; i <= maxByte ; i++)
     if (smap1->map[i] & smap2->map[i])
       return(TRUE);
   return(FALSE);
  }

/**********************************************************************************
  NAME         : ObjectPatternMatch
  DESCRIPTION  : Iterates through all the pattern nodes on one level
                 in the pattern network.  A node is only processed
                 if it can lead to a terminating class bitmap node
                 which applies to the object being matched.  This
                 allows for a significant reduction in the number of
                 patterns considered.
  INPUTS       : 1) The offset of the slot position from the pattern index
                 2) The pattern node being examined
                 3) The end of the list of multifield markers for the pattern
  RETURNS      : Nothing useful
  SIDE EFFECTS : The pattern tests are evaluated and the child nodes may
                 be processed (which may cause a whole series of Rete network
                 updates).
  NOTES        : Several globals are used to keep track of the current
                 slot being examined:
                 CurrentPatternMarks - the series of multifield markers
                 CurrentPatternObject - the object being pattern-matched
                 CurrentPatternObjectSlot - the current slot being examined
                 CurrentObjectSlotLength - the cardinality of the slot value

                 An optimization is performed when evaluating
                 constant tests on a slot value field.  All
                 pattern nodes on a level which restrict the same slot
                 are grouped together.  Those which are constant
                 tests are placed at the far right.  Thus, as soon
                 as one of these constant tests succeeds, the remaining
                 nodes for that slot on this level can be skipped
 **********************************************************************************/
static void ObjectPatternMatch(
  void *theEnv,
  int offset,
  OBJECT_PATTERN_NODE *patternTop,
  struct multifieldMarker *endMark)
  {
   register unsigned saveSlotLength;
   register INSTANCE_SLOT *saveSlot;
   OBJECT_PATTERN_NODE *blockedNode;

   while (patternTop != NULL)
     {
      /* ===========================================================
         MarkObjectPatternNetwork() has already marked pattern nodes
         which need processing according to the class bitmaps,
         slot updates and incremental reset status
         =========================================================== */
      if (patternTop->matchTimeTag == ObjectReteData(theEnv)->CurrentObjectMatchTimeTag)
        {
         /* ========================================
            Make sure we are examining the correct
            slot of the object for this pattern node
            ======================================== */
         if ((patternTop->slotNameID == ISA_ID) ||
             (patternTop->slotNameID == NAME_ID))
           {
            ObjectReteData(theEnv)->CurrentPatternObjectSlot = NULL;
            ObjectReteData(theEnv)->CurrentObjectSlotLength = 1;
            offset = 0;
           }
         else if ((ObjectReteData(theEnv)->CurrentPatternObjectSlot == NULL) ? TRUE :
                  (ObjectReteData(theEnv)->CurrentPatternObjectSlot->desc->slotName->id != patternTop->slotNameID))
           {
            /* ====================================================
               Need to reset the indices for the multifield
               markers now that we have moved onto a different slot
                  ==================================================== */
            ObjectReteData(theEnv)->CurrentPatternObjectSlot =
             ObjectReteData(theEnv)->CurrentPatternObject->slotAddresses[ObjectReteData(theEnv)->CurrentPatternObject->cls->slotNameMap
                                             [patternTop->slotNameID] - 1];
            offset = 0;
            if (ObjectReteData(theEnv)->CurrentPatternObjectSlot->desc->multiple)
              ObjectReteData(theEnv)->CurrentObjectSlotLength =
                GetInstanceSlotLength(ObjectReteData(theEnv)->CurrentPatternObjectSlot);
            else
              ObjectReteData(theEnv)->CurrentObjectSlotLength = 1;
           }

         /* ========================================================
            Process the pattern node.  If it is satisfied by the
            the instance, ProcessPatternNode() will recursively pass
            all of its children nodes through ObjectPatternMatch()
            ======================================================== */
         saveSlotLength = ObjectReteData(theEnv)->CurrentObjectSlotLength;
         saveSlot = ObjectReteData(theEnv)->CurrentPatternObjectSlot;
         ProcessPatternNode(theEnv,offset,patternTop,endMark);
         ObjectReteData(theEnv)->CurrentObjectSlotLength = saveSlotLength;
         ObjectReteData(theEnv)->CurrentPatternObjectSlot = saveSlot;
        }

      /* ==============================================================
         Move on to the siblings of this node - if the current node was
         a constant test that succeeded, skip further sibling nodes
         (which test on the same field in the pattern)
         which match on the same slot since they are all constant tests
         as well and will, of course fail.
         ============================================================== */
      if (patternTop->blocked == TRUE)
        {
         patternTop->blocked = FALSE;
         blockedNode = patternTop;
         patternTop = patternTop->rightNode;
         while (patternTop != NULL)
           {
            if ((patternTop->slotNameID != blockedNode->slotNameID) ||
                (patternTop->whichField != blockedNode->whichField))
              break;
            patternTop = patternTop->rightNode;
           }
        }
      else
        patternTop = patternTop->rightNode;
     }
  }

/**********************************************************************************
  NAME         : ProcessPatternNode
  DESCRIPTION  : Determines if a pattern node satsifies the corresponding
                 slot value field(s) in an object.  If it does,
                 ObjectPatternMatch() is recursively called to process
                 the child nodes of this node.  In this mutual recursion
                 between ObjectPatternMatch() and ProcessPatternNode(),
                 the nodes of all applicable patterns are processed
                 to completion.  ObjectPatternMatch() enters an object
                 into a pattern's aplha memory when the traversal reaches
                 a terminal class bitmap node.
  INPUTS       : 1) The offset of the slot index from the pattern index
                 2) The pattern node being examined
                 3) The end of the list of multifield markers for the pattern
  RETURNS      : Nothing useful
  SIDE EFFECTS : The pattern tests are evaluated and the child nodes may
                 be processed (which may cause a whole series of Rete network
                 updates).
  NOTES        : Several globals are used to keep track of the current
                 slot being examined:
                 CurrentPatternMarks - the series of multifield markers
                 CurrentPatternObject - the object being pattern-matched
                 CurrentPatternObjectSlot - the current slot being examined
                 CurrentObjectSlotLength - the cardinality of the slot value
 **********************************************************************************/
static void ProcessPatternNode(
  void *theEnv,
  int offset,
  OBJECT_PATTERN_NODE *patternNode,
  struct multifieldMarker *endMark)
  {
   int patternSlotField,objectSlotField;
   unsigned objectSlotLength;
   int repeatCount;
   INSTANCE_SLOT *objectSlot;
   struct multifieldMarker *newMark;

   patternSlotField = patternNode->whichField;
   objectSlotField = patternSlotField + offset;

   /* ==========================================
      If this is a test on the class or the name
      of the object, process it separately.
      ========================================== */
   if (ObjectReteData(theEnv)->CurrentPatternObjectSlot == NULL)
     {
      if ((patternNode->networkTest == NULL) ? TRUE :
          (EvaluateObjectPatternTest(theEnv,objectSlotField,NULL,
                                     (EXPRESSION *) patternNode->networkTest,patternNode)))
        {
         if (patternNode->alphaNode != NULL)
           CreateObjectAlphaMatch(theEnv,patternNode->alphaNode);
         ObjectPatternMatch(theEnv,offset,patternNode->nextLevel,endMark);
        }
      return;
     }

   /* ================================
      Check a single-field restriction
      ================================ */
   if (patternNode->multifieldNode == 0)
     {
      if ((patternNode->networkTest == NULL) ? TRUE :
          EvaluateObjectPatternTest(theEnv,objectSlotField,NULL,
                                    (EXPRESSION *) patternNode->networkTest,patternNode))
        {
         if (patternNode->alphaNode != NULL)
           CreateObjectAlphaMatch(theEnv,patternNode->alphaNode);
         ObjectPatternMatch(theEnv,offset,patternNode->nextLevel,endMark);
        }
      return;
     }

   /* ==================================================================
      Check a multifield restriction.  Add a marker for this field which
      has indices indicating to which values in the object slot the
      multifield pattern node is bound
      ================================================================== */
   newMark = get_struct(theEnv,multifieldMarker);
   newMark->whichField = patternSlotField;
   newMark->where.whichSlot = (void *) ObjectReteData(theEnv)->CurrentPatternObjectSlot->desc->slotName->name;
   newMark->startPosition = objectSlotField;
   newMark->next = NULL;
   if (ObjectReteData(theEnv)->CurrentPatternObjectMarks == NULL)
     ObjectReteData(theEnv)->CurrentPatternObjectMarks = newMark;
   else
     endMark->next = newMark;

   /* ==========================================================
      If there are further pattern restrictions on this slot,
      try pattern-matching for all possible bound values of the
      multifield pattern node: from no values to all values from
      the starting position of the multifield to the end of the
      object slot.  Otherwise, bind the multifield to all the
      remaining fields in the slot value and continue with
      pattern-matching
      ========================================================== */
   if (patternNode->endSlot == FALSE)
     {
      objectSlotLength = ObjectReteData(theEnv)->CurrentObjectSlotLength;
      objectSlot = ObjectReteData(theEnv)->CurrentPatternObjectSlot;
      newMark->endPosition = newMark->startPosition - 1;
      repeatCount = (int) (objectSlotLength - newMark->startPosition
                    - patternNode->leaveFields + 2);
      while (repeatCount > 0)
        {
         if ((patternNode->networkTest == NULL) ? TRUE :
              EvaluateObjectPatternTest(theEnv,objectSlotField,newMark,
                        (EXPRESSION *) patternNode->networkTest,patternNode))
           {
            if (patternNode->alphaNode != NULL)
              CreateObjectAlphaMatch(theEnv,patternNode->alphaNode);
            ObjectPatternMatch(theEnv,(int) (offset + (newMark->endPosition - objectSlotField)),
                               patternNode->nextLevel,newMark);
            ObjectReteData(theEnv)->CurrentObjectSlotLength = objectSlotLength;
            ObjectReteData(theEnv)->CurrentPatternObjectSlot = objectSlot;
           }
         newMark->endPosition++;
         repeatCount--;
        }
     }
   else
     {
      newMark->endPosition = (long) ObjectReteData(theEnv)->CurrentObjectSlotLength;
      if ((patternNode->networkTest == NULL) ? TRUE :
          EvaluateObjectPatternTest(theEnv,objectSlotField,newMark,
                                    (EXPRESSION *) patternNode->networkTest,patternNode))
        {
         if (patternNode->alphaNode != NULL)
           CreateObjectAlphaMatch(theEnv,patternNode->alphaNode);
         ObjectPatternMatch(theEnv,0,patternNode->nextLevel,newMark);
        }
     }

   /* ======================================
      Delete the temporary multifield marker
      ====================================== */

   if (ObjectReteData(theEnv)->CurrentPatternObjectMarks == newMark)
     ObjectReteData(theEnv)->CurrentPatternObjectMarks = NULL;
   else
     endMark->next = NULL;
   rtn_struct(theEnv,multifieldMarker,newMark);
  }

/***************************************************
  NAME         : CreateObjectAlphaMatch
  DESCRIPTION  : Places an instance in the alpha
                 memory of a pattern and drives the
                 partial match through the join
                 network
  INPUTS       : The alpha memory node
  RETURNS      : Nothing useful
  SIDE EFFECTS : Join network updated
  NOTES        : None
 ***************************************************/
static void CreateObjectAlphaMatch(
  void *theEnv,
  OBJECT_ALPHA_NODE *alphaPtr)
  {
   struct joinNode *listOfJoins;
   struct partialMatch *theMatch;
   struct patternMatch *newMatch;

   while (alphaPtr != NULL)
     {
      if (alphaPtr->matchTimeTag == ObjectReteData(theEnv)->CurrentObjectMatchTimeTag)
        {
         /* ===================================================
            If we have reached the class bitmap of the pattern,
            place the object in the alpha memory of each of
            the terminal nodes underneath and drive
            the partial matches through the join network.

            Insert the instance into the alpha memory
            of this pattern and mark it as busy
            =================================================== */
         ObjectReteData(theEnv)->CurrentPatternObject->busy++;
         theMatch = CreateAlphaMatch(theEnv,(void *) ObjectReteData(theEnv)->CurrentPatternObject,
                                     ObjectReteData(theEnv)->CurrentPatternObjectMarks,
                                     (struct patternNodeHeader *) alphaPtr);

         /* ======================================
            Attach the partial match to the object
            to ease later retraction
            ====================================== */
         newMatch = get_struct(theEnv,patternMatch);
         newMatch->next = (struct patternMatch *) ObjectReteData(theEnv)->CurrentPatternObject->partialMatchList;
         newMatch->matchingPattern = (struct patternNodeHeader *) alphaPtr;
         newMatch->theMatch = theMatch;
         ObjectReteData(theEnv)->CurrentPatternObject->partialMatchList = (void *) newMatch;

         /* ================================================
            Drive the partial match through the join network
            ================================================ */
         listOfJoins = alphaPtr->header.entryJoin;
         while (listOfJoins != NULL)
           {
            NetworkAssert(theEnv,theMatch,listOfJoins,RHS);
            listOfJoins = listOfJoins->rightMatchNode;
           }
        }
      alphaPtr = alphaPtr->nxtInGroup;
     }
  }

/******************************************************
  NAME         : EvaluateObjectPatternTest
  DESCRIPTION  : Evaluates the pattern network test
                 expression for a node
  INPUTS       : 1) The actual index of the slot value
                    field currently being examined
                 2) The multifield marker (if any)
                    for the pattern node being exmained
                 3) The pattern network test expression
                 4) The pattern node being examined
  RETURNS      : TRUE if the node passes the
                 test, FALSE otherwise
  SIDE EFFECTS : Evaluation of the test
                 EvaluationError and HaltExecution
                 are always set to FALSE
  NOTES        : Assumes networkTest != NULL
 ******************************************************/
static intBool EvaluateObjectPatternTest(
  void *theEnv,
  int objectSlotField,
  struct multifieldMarker *selfSlotMarker,
  EXPRESSION *networkTest,
  OBJECT_PATTERN_NODE *patternNode)
  {
   DATA_OBJECT vresult;
   int rv;

   if (networkTest->type == OBJ_PN_CONSTANT)
     {
      struct expr *oldArgument;

      oldArgument = EvaluationData(theEnv)->CurrentExpression;
      EvaluationData(theEnv)->CurrentExpression = networkTest;
      rv = ObjectCmpConstantFunction(theEnv,networkTest->value,&vresult);
      EvaluationData(theEnv)->CurrentExpression = oldArgument;
      if (rv)
        {
         if (((struct ObjectCmpPNConstant *)
                 ValueToBitMap(networkTest->value))->pass)
           patternNode->blocked = TRUE;
         return(TRUE);
        }
      return(FALSE);
     }

   /* =========================================================
      Evaluate or expressions expressed in the format:
         (or <expression 1> <expression 2> ... <expression n>)
       Returns TRUE (1.0) if any of the expression are TRUE,
       otherwise returns false (0.0).
      ========================================================= */
   if (networkTest->value == ExpressionData(theEnv)->PTR_OR)
     {
      networkTest = networkTest->argList;
      while (networkTest != NULL)
        {
         if (EvaluateObjectPatternTest(theEnv,objectSlotField,selfSlotMarker,networkTest,patternNode))
           {
            /* ============================================
               A node can be blocked ONLY if there were one
               positive constant test on that node
               ============================================ */
            patternNode->blocked = FALSE;
            return(TRUE);
           }
         patternNode->blocked = FALSE;
         networkTest = networkTest->nextArg;
        }
      return(FALSE);
     }

   /* ==========================================================
      Evaluate and expressions expressed in the format:
       (and <expression 1> <expression 2> ... <expression n>)
      Returns false (0.0) if any of the expression are false,
      otherwise returns TRUE (1.0).
      ========================================================== */
   else if (networkTest->value == ExpressionData(theEnv)->PTR_AND)
     {
      networkTest = networkTest->argList;
      while (networkTest != NULL)
        {
         if (EvaluateObjectPatternTest(theEnv,objectSlotField,selfSlotMarker,networkTest,patternNode)
              == FALSE)
           {
            patternNode->blocked = FALSE;
            return(FALSE);
           }
         patternNode->blocked = FALSE;
         networkTest = networkTest->nextArg;
        }
      return(TRUE);
     }

   /* =======================================================
      Evaluate all other expressions using EvaluateExpression
      ======================================================= */
   else
     {
      EvaluationData(theEnv)->HaltExecution = FALSE;
      if (EvaluateExpression(theEnv,networkTest,&vresult))
        {
         ObjectPatternNetErrorMessage(theEnv,patternNode);
         EvaluationData(theEnv)->EvaluationError = FALSE;
         EvaluationData(theEnv)->HaltExecution = FALSE;
         return(FALSE);
        }
      if ((vresult.value != EnvFalseSymbol(theEnv)) || (vresult.type != SYMBOL))
        return(TRUE);
     }
   return(FALSE);
  }

/***************************************************
  NAME         : ObjectAssertAction
  DESCRIPTION  : Filters an instance through the
                 object pattern network
  INPUTS       : The instance
  RETURNS      : Nothing useful
  SIDE EFFECTS : Instance matched
  NOTES        : None
 ***************************************************/
static void ObjectAssertAction(
  void *theEnv,
  INSTANCE_TYPE *ins)
  {
   ins->header.timeTag = ObjectReteData(theEnv)->UseEntityTimeTag;
   ObjectReteData(theEnv)->CurrentPatternObject = ins;
   ObjectReteData(theEnv)->CurrentPatternObjectSlot = NULL;
   MarkObjectPatternNetwork(theEnv,NULL);
   ObjectPatternMatch(theEnv,0,ObjectNetworkPointer(theEnv),NULL);
   ins->reteSynchronized = TRUE;
  }

/**********************************************************************
  NAME         : ObjectModifyAction
  DESCRIPTION  : Removes an instance from patterns (and attached joins)
                 applicable to specified slot(s), and then filters
                 same instance through object pattern network
                 (only against patterns which explicitly match on
                 named slot(s))
  INPUTS       : 1) The instance
                 2) The bitmap of slot ids
  RETURNS      : Nothing useful
  SIDE EFFECTS : Instance retracted/asserted
  NOTES        : None
 **********************************************************************/
static void ObjectModifyAction(
  void *theEnv,  
  INSTANCE_TYPE *ins,
  SLOT_BITMAP *slotNameIDs)
  {
   ins->header.timeTag = ObjectReteData(theEnv)->UseEntityTimeTag;
   ObjectRetractAction(theEnv,ins,slotNameIDs);
   ObjectReteData(theEnv)->CurrentPatternObject = ins;
   ObjectReteData(theEnv)->CurrentPatternObjectSlot = NULL;
   MarkObjectPatternNetwork(theEnv,slotNameIDs);
   ObjectPatternMatch(theEnv,0,ObjectNetworkPointer(theEnv),NULL);
   ins->reteSynchronized = TRUE;
  }

/****************************************************
  NAME         : ObjectRetractAction
  DESCRIPTION  : Retracts the instance from the
                 applicable patterns for the object
                 (if the slotNameID != -1, then the
                  instance is only retracted from
                  the alpha memories of the patterns
                  which actually match on that slot)
  INPUTS       : 1) The instance
                 2) The slot bitmap for a modify
                    (NULL if the instance is actually
                     being removed)
  RETURNS      : Nothing useful
  SIDE EFFECTS : Retractions performed
  NOTES        : None
 ****************************************************/
static void ObjectRetractAction(
  void *theEnv,
  INSTANCE_TYPE *ins,
  SLOT_BITMAP *slotNameIDs)
  {
   struct patternMatch *prvMatch,*tmpMatch,
                       *deleteMatch,*lastDeleteMatch;
   OBJECT_ALPHA_NODE *alphaPtr;
   void *saveDependents;

   if (slotNameIDs == NULL)
     {
      if (ins->partialMatchList != NULL)
        {
         tmpMatch = (struct patternMatch *) ins->partialMatchList;
         while (tmpMatch != NULL)
           {
            ins->busy--;
            tmpMatch = tmpMatch->next;
           }
         NetworkRetract(theEnv,(struct patternMatch *) ins->partialMatchList);
         ins->partialMatchList = NULL;
        }
     }
   else
     {
      deleteMatch = NULL;
      lastDeleteMatch = NULL;
      prvMatch = NULL;
      tmpMatch = (struct patternMatch *) ins->partialMatchList;
      while (tmpMatch != NULL)
        {
         alphaPtr = (OBJECT_ALPHA_NODE *) tmpMatch->matchingPattern;
         if (alphaPtr->slotbmp != NULL)
           {
           if (CompareSlotBitMaps(slotNameIDs,
                  (SLOT_BITMAP *) ValueToBitMap(alphaPtr->slotbmp)))
              {
               ins->busy--;
               if (prvMatch == NULL)
                 ins->partialMatchList = (void *) tmpMatch->next;
               else
                 prvMatch->next = tmpMatch->next;
               if (!deleteMatch)
                 deleteMatch = tmpMatch;
               else
                 lastDeleteMatch->next = tmpMatch;
               lastDeleteMatch = tmpMatch;
               tmpMatch = tmpMatch->next;
               lastDeleteMatch->next = NULL;
              }
            else
              {
               prvMatch = tmpMatch;
               tmpMatch = tmpMatch->next;
              }
           }
         else
           {
            prvMatch = tmpMatch;
            tmpMatch = tmpMatch->next;
           }
        }

      /* =============================================
         We need to preserve any logical dependencies
         of this object and reattach them after doing
         the retract.  Otherwise, the Rete network
         will believe the object is gone and remove
         the links from the partial matches upon which
         this object is logically dependent.
         ============================================= */
      if (deleteMatch != NULL)
        {
         saveDependents = ins->header.dependents;
         ins->header.dependents = NULL;
         NetworkRetract(theEnv,deleteMatch);
         ins->header.dependents = saveDependents;
        }
     }
   ins->reteSynchronized = TRUE;
  }

/*****************************************************
  NAME         : ObjectPatternNetErrorMessage
  DESCRIPTION  : Prints out a locational error message
                 when an evaluation error occurs
                 during object pattern-matching
  INPUTS       : The pattern node
  RETURNS      : Nothing useful
  SIDE EFFECTS : Error message displayed
  NOTES        : None
 *****************************************************/
static void ObjectPatternNetErrorMessage(
  void *theEnv,
  OBJECT_PATTERN_NODE *patternPtr)
  {
   PrintErrorID(theEnv,"OBJRTMCH",1,TRUE);
   EnvPrintRouter(theEnv,WERROR,"This error occurred in the object pattern network\n");
   EnvPrintRouter(theEnv,WERROR,"   Currently active instance: [");
   EnvPrintRouter(theEnv,WERROR,ValueToString(ObjectReteData(theEnv)->CurrentPatternObject->name));
   EnvPrintRouter(theEnv,WERROR,"]\n");
   EnvPrintRouter(theEnv,WERROR,"   Problem resides in slot ");
   EnvPrintRouter(theEnv,WERROR,ValueToString(FindIDSlotName(theEnv,patternPtr->slotNameID)));
   EnvPrintRouter(theEnv,WERROR," field #");
   PrintLongInteger(theEnv,WERROR,(long) patternPtr->whichField);
   EnvPrintRouter(theEnv,WERROR,"\n");
   TraceErrorToObjectPattern(theEnv,TRUE,patternPtr);
   EnvPrintRouter(theEnv,WERROR,"\n");
  }

/*********************************************************
  NAME         : TraceErrorToObjectPattern
  DESCRIPTION  : Used by ObjectPatternNetErrorMessage() to
                 print the rule(s) which contain an object
                 pattern.
  INPUTS       : 1) A flag indicating if this is the
                    node in which the error actually
                    occurred or not
                 2) The pattern node
  RETURNS      : Nothing useful
  SIDE EFFECTS : Error message displayed
  NOTES        : None
 *********************************************************/
static void TraceErrorToObjectPattern(
  void *theEnv,
  int errorNode,
  OBJECT_PATTERN_NODE *patternPtr)
  {
   struct joinNode *joinPtr;

   while (patternPtr != NULL)
     {
      if (patternPtr->alphaNode != NULL)
        {
         joinPtr = patternPtr->alphaNode->header.entryJoin;
         while (joinPtr != NULL)
           {
            EnvPrintRouter(theEnv,WERROR,"      Of pattern #");
            PrintLongInteger(theEnv,WERROR,(long) joinPtr->depth);
            EnvPrintRouter(theEnv,WERROR," in rule(s):\n");
            TraceErrorToRule(theEnv,joinPtr,"         ");
            joinPtr = joinPtr->rightMatchNode;
           }
        }
      TraceErrorToObjectPattern(theEnv,FALSE,patternPtr->nextLevel);
      if (errorNode)
        break;
      patternPtr = patternPtr->rightNode;
     }

  }

#endif



Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/clips/devel/.cvsignore,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- .cvsignore	2 Feb 2007 19:04:04 -0000	1.4
+++ .cvsignore	3 Mar 2009 16:43:44 -0000	1.5
@@ -1,14 +1,12 @@
-3CCP.pdf
-AllExamples.tar.Z
 abstract.pdf
+clips_core_source_624.tar.Z
+x_windows_ide_source_624.tar.Z
+examples_624.tar.Z
 apg.pdf
 arch5-1.pdf
 bpg.pdf
-clipssrc.tar.Z
 ig.pdf
-usrguide.pdf
-x-prjct.tar.Z
-FunctionContext.zip
-objrtmch.c
-DR0873.txt
-clips-6.24-linux.patch.bz2
+ug.pdf
+3CCP.pdf
+clips-doc-html.tar.bz2
+clips-6.24-linux.patch


Index: clips.spec
===================================================================
RCS file: /cvs/pkgs/rpms/clips/devel/clips.spec,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- clips.spec	24 Feb 2009 07:51:15 -0000	1.11
+++ clips.spec	3 Mar 2009 16:43:44 -0000	1.12
@@ -1,33 +1,48 @@
 Summary:	CLIPS language for developing expert systems
 Name:		clips
 Version:	6.24
-Release:	26%{?dist}
-Url:		http://www.ghg.net/clips/download/source/
+Release:	27%{?dist}
+Url:		http://clipsrules.sourceforge.net
 License:	GPLv2
 Group:		Development/Tools
-Source0:	http://www.ghg.net/clips/download/source/clipssrc.tar.Z
-Source1:	http://www.ghg.net/clips/download/source/x-prjct.tar.Z
-Source2:	http://www.ghg.net/clips/download/executables/examples/AllExamples.tar.Z
-Source3:	http://www.ghg.net/clips/download/documentation/abstract.pdf
-Source4:	http://www.ghg.net/clips/download/documentation/apg.pdf
-Source5:	http://www.ghg.net/clips/download/documentation/arch5-1.pdf
-Source6:	http://www.ghg.net/clips/download/documentation/bpg.pdf
-Source7:	http://www.ghg.net/clips/download/documentation/ig.pdf
-Source8:	http://www.ghg.net/clips/download/documentation/usrguide.pdf
-Source9:	http://www.ghg.net/clips/download/documentation/3CCP.pdf
+Source0:	http://downloads.sourceforge.net/clipsrules/clips_core_source_624.tar.Z
+Source1:	http://downloads.sourceforge.net/clipsrules/x_windows_ide_source_624.tar.Z
+Source2:	http://downloads.sourceforge.net/clipsrules/examples_624.tar.Z
+Source3:	abstract.pdf
+Source4:	http://clipsrules.sourceforge.net/documentation/v624/apg.pdf
+Source5:	http://clipsrules.sourceforge.net/documentation/other/arch5-1.pdf
+Source6:	http://clipsrules.sourceforge.net/documentation/v624/bpg.pdf
+Source7:	http://clipsrules.sourceforge.net/documentation/v624/ig.pdf
+Source8:	http://clipsrules.sourceforge.net/documentation/v624/ug.pdf
+Source9:	http://clipsrules.sourceforge.net/documentation/other/3CCP.pdf
 Source10:	xclips.png
 Source11:	clips-init.el
 Source12:	clips-mode.el
 Source13:	inf-clips.el
-Source14:	http://www.ghg.net/clips/download/other/Bug_Fixes/objrtmch.c
-Source15:	http://www.ghg.net/clips/download/other/FunctionContext.zip
-Source16:	http://www.ghg.net/clips/download/other/Bug_Fixes/DR0873.txt
+Source14:	objrtmch.c
+Source15:	FunctionContext.zip
+Source16:	DR0873.txt
 Source17:	xclips.desktop
+# The following source was generated with the following commands:
+# mkdir html
+# cd html
+# for i in apg.htm bpg.htm ig.htm ug.htm; do
+#   wget -p -nH --cut-dirs=2 --convert-links http://clipsrules.sourceforge.net/documentation/v624/$i
+#   dos2unix $i
+# done
+# cd ..
+# tar -cjf clips-doc-html.tar.bz2 html
+Source18:	clips-doc-html.tar.bz2
 Patch0:		clips-6.24-linux.patch
 Patch1:		clips-6.24-time-sysdep.c.patch
-BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-BuildRequires:	ncurses-devel libXt-devel libXext-devel libXmu-devel libXaw-devel xorg-x11-server-Xorg xorg-x11-proto-devel xorg-x11-xbitmaps desktop-file-utils
+BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+BuildRequires:	ncurses-devel 
+BuildRequires:	libXt-devel libXext-devel libXmu-devel libXaw-devel 
+BuildRequires:	xorg-x11-server-Xorg xorg-x11-proto-devel xorg-x11-xbitmaps 
+BuildRequires:	desktop-file-utils
 BuildRequires:	automake autoconf libtool
+BuildRequires:	pkgconfig
+BuildRequires:	ImageMagick
 
 %description
 CLIPS is a productive development and delivery expert system tool which 
@@ -46,7 +61,7 @@
 This package contains the run-time libraries needed for CLIPS applications.
 
 %package	devel
-Summary:	Headers for developing programs that will embed CLIPS
+Summary:	C headers for developing programs that will embed CLIPS
 Group:		Development/Libraries
 Requires:	clips-libs = %{version}-%{release}
 Requires:	ncurses-devel pkgconfig
@@ -58,6 +73,8 @@
 %package	xclips
 Summary:	X interface to CLIPS
 Group:		Development/Tools
+Requires:	%{name} = %{version}-%{release}
+Requires:	hicolor-icon-theme
 
 %description	xclips
 X interface to CLIPS.
@@ -73,15 +90,15 @@
 The following are some of the documents in this package:
 - Proceedings of the Third Conference on CLIPS, 1994 (3CCP.pdf)
 - Application abstracts (abstract.pdf)
-- CLIPS Reference Manual, Volume II, Advanced Programming Guide (apg.pdf)
+- CLIPS Reference Manual, Volume I, Basic Programming Guide (bpg.pdf,bpg.htm)
+- CLIPS Reference Manual, Volume II, Adv. Programming Guide (apg.pdf, apg.htm)
+- CLIPS Reference Manual, Volume III, Interfaces Guide (ig.pdf,ig.htm)
 - CLIPS Architecture Manual (arch5-1.pdf)
-- CLIPS Reference Manual, Volume I, Basic Programming Guide (bpg.pdf)
-- CLIPS Reference Manual, Volume III, Interfaces Guide (ig.pdf)
-- CLIPS Users Guide (usrguide.pdf)
+- CLIPS Users Guide (ug.pdf,ug.htm)
 
 
 %prep
-%setup -q -a 1 -a 2 -a 15 -c
+%setup -q -a 1 -a 2 -a 15 -a 18 -c
 mv x-prjct/xinterface clipssrc/
 mv x-prjct/color clipssrc/
 mv clipssrc/clipssrc clipssrc/clips
@@ -110,18 +127,27 @@
 %{__make} %{?_smp_mflags}
 
 %install
-%{__rm} -rf %{buildroot}
-%{__install} -D %{SOURCE10} %{buildroot}%{_datadir}/pixmaps/xclips.png
-%{__install} -m 644 -D %{SOURCE11} %{buildroot}%{_datadir}/emacs/site-lisp/site-start.d/clips-init.el
-%{__install} -m 644 -D %{SOURCE12} %{buildroot}%{_datadir}/emacs/site-lisp/clips-mode.el
-%{__install} -m 644 -D %{SOURCE13} %{buildroot}%{_datadir}/emacs/site-lisp/inf-clips.el
 cd clipssrc
+%{__rm} -rf %{buildroot}
+%{__make} install DESTDIR=%{buildroot} INSTALL="%{__install} -p"
+find %{buildroot} -type f -name "*.la" -exec rm -f {} ';'
+%{__install} -p --mode=0644 -D %{SOURCE11} %{buildroot}%{_datadir}/emacs/site-lisp/site-start.d/clips-init.el
+%{__install} -p --mode=0644 -D %{SOURCE12} %{buildroot}%{_datadir}/emacs/site-lisp/clips-mode.el
+%{__install} -p --mode=0644 -D %{SOURCE13} %{buildroot}%{_datadir}/emacs/site-lisp/inf-clips.el
+
+# create icons
+# create 16x16, 32x32, 64x64, 128x128 icons
+for s in 16 32 64 128 ; do
+  %{__mkdir_p} %{buildroot}/%{_datadir}/icons/hicolor/${s}x${s}/apps/
+  convert -scale ${s}x${s} \
+    %{SOURCE10} \
+    %{buildroot}/%{_datadir}/icons/hicolor/${s}x${s}/apps/xclips.png
+done
+
 desktop-file-install --vendor fedora \
 	--dir %{buildroot}%{_datadir}/applications \
 	--add-category X-Fedora \
 	%{SOURCE17}
-%{__make} install DESTDIR=%{buildroot} INSTALL="%{__install} -p" 
-find %{buildroot} -type f -name "*.la" -exec rm -f {} ';'
 
 %clean
 %{__rm} -rf %{buildroot}
@@ -130,6 +156,19 @@
 
 %postun libs -p /sbin/ldconfig
 
+%post xclips
+touch --no-create %{_datadir}/icons/hicolor
+if [ -x %{_bindir}/gtk-update-icon-cache ] ; then
+  %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
+fi
+
+%postun xclips
+touch --no-create %{_datadir}/icons/hicolor
+if [ -x %{_bindir}/gtk-update-icon-cache ] ; then
+  %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
+fi
+
+
 %files
 %defattr(-,root,root,-)
 %{_bindir}/clips
@@ -156,17 +195,31 @@
 %defattr(-,root,root,-)
 %{_bindir}/xclips
 %{_bindir}/xclips-color
-%{_datadir}/pixmaps/xclips.png
+%{_datadir}/icons/hicolor/*x*/apps/xclips.png
 %{_datadir}/applications/*xclips.desktop
 
 %files doc
 %defattr(-,root,root,-)
 %doc Examples/
-%doc abstract.pdf arch5-1.pdf bpg.pdf usrguide.pdf 3CCP.pdf
+%doc abstract.pdf arch5-1.pdf bpg.pdf ug.pdf 3CCP.pdf
 %doc apg.pdf
 %doc ig.pdf
+%doc html/
  
 %changelog
+* Tue Mar 03 2009 Rick L Vinyard Jr <rvinyard at cs.nmsu.edu> 6.24-27
+- Updated desktop entry file to add categories and remove deprecated items
+- Added hicolor-icon-theme requires to xclips
+- Install xclips icons to hicolor directory
+- Added validation to desktop file
+- Added icon cache rebuild to pre and post sections for xclips
+- Added preserve to file installs
+- Made install modes explicit
+- Added pkgconfig and ImageMagick to build requires
+- Updated URL
+- Updated source URL's
+- Added html docs
+
 * Tue Feb 24 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 6.24-26
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
 


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/clips/devel/sources,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- sources	2 Feb 2007 19:19:53 -0000	1.6
+++ sources	3 Mar 2009 16:43:44 -0000	1.7
@@ -1,14 +1,12 @@
-a6a60733af08f9e9e6d0928272ad4dd9  3CCP.pdf
-f5c02b997199f3ede779b8502af2ba09  AllExamples.tar.Z
 cd3ecddc4e538b8af0e5cf08ab7fd89c  abstract.pdf
+ccba9d912375e57a1b7d9eba12da4198  clips_core_source_624.tar.Z
+1bb0d0e684742188b8c14912c26f12cb  x_windows_ide_source_624.tar.Z
+f5c02b997199f3ede779b8502af2ba09  examples_624.tar.Z
 fae2267d96fb95603345e91c9990caaa  apg.pdf
 9a13d2ed18fe6ab67902d5bce29957cb  arch5-1.pdf
 63891971aa782dc67c2de0579647247e  bpg.pdf
-ccba9d912375e57a1b7d9eba12da4198  clipssrc.tar.Z
 89beca5caa08b30d8285cca7f1df1d26  ig.pdf
-44e54697a8acf3509bc4ca51d88b65bd  usrguide.pdf
-1bb0d0e684742188b8c14912c26f12cb  x-prjct.tar.Z
-ac0d7c465a909158ae908fe39d68478c  FunctionContext.zip
-da5ad2328e4d8dd7680d8bb28005e90d  objrtmch.c
-f80256270a8a93504e37644ab9bc16b4  DR0873.txt
-cbf0382ca4153adc0446b0bf5c123559  clips-6.24-linux.patch.bz2
+44e54697a8acf3509bc4ca51d88b65bd  ug.pdf
+a6a60733af08f9e9e6d0928272ad4dd9  3CCP.pdf
+99f463e8a2536198da37e9dc73304322  clips-doc-html.tar.bz2
+0cb3238a5be85211658ba7ca47257bf8  clips-6.24-linux.patch


Index: xclips.desktop
===================================================================
RCS file: /cvs/pkgs/rpms/clips/devel/xclips.desktop,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- xclips.desktop	26 Aug 2007 06:16:44 -0000	1.1
+++ xclips.desktop	3 Mar 2009 16:43:44 -0000	1.2
@@ -1,10 +1,9 @@
 [Desktop Entry]
-Encoding=UTF-8
 Name=XCLIPS
 GenericName=XCLIPS Expert System
 Exec=xclips
-Icon=xclips.png
+Icon=xclips
 Terminal=false
 Type=Application
-Categories=Application;Development;
+Categories=Development;Building;IDE;Education;Science;ArtificialIntelligence;ComputerScience;Robotics;
 Version=1.0




More information about the fedora-extras-commits mailing list