RE: [PATCH] lisa bug: matching on retracted facts

"Young, David" <[email protected]> Fri, 8 Jul 2005 10:56:30 -0400
Newsgroups gmane.lisp.lisa.general
Message-ID <A24502FBD4FB85468D5781CD84213E40015B97B9@mail01.bhusa.bhsoftware.com>
Ok, I applied your patch and ran it against the mab examples; they continue
to work. I don't have an explanation for the asymmetry either; I'd have to
"re-load" Lisa's rete algorithm into my thought processes. For now, I'd say
continue your testing and make sure your rulesets behave correctly. If
you're successful, please let me know and I'll make a release with this
patch (and some others in the queue).

Thanks very much for your contribution.

Cheers, David

-----Original Message-----
From: Andy Sloane [mailto:[email protected]]
Sent: Friday, July 08, 2005 12:01 AM
To: [email protected]; [email protected]
Subject: [Lisa-users] [PATCH] lisa bug: matching on retracted facts


Andy Sloane wrote:
> I have a much simpler test case which more clearly demonstrates what's 
> going on, and a workaround:

...And now I have a patch.

In the node2 class, there was a specialized defmethod for 
test-against-left-memory when the right token was a remove token, but 
none for test-against-right-memory for the complementary condition. 
Adding it fixes the problem.

I don't really understand the asymmetry between "left tokens" and "right 
token" in the Rete code -- they both seem to contain one token.  Was 
there a reason this method wasn't supposed to exist?

Also, should the first test-against-right-memory method specialize to 
(left-tokens add-token), as all the other *-from-left methods do?

-Andy


diff -u -3 -p -u -r1.2 node2.lisp
--- src/rete/reference/node2.lisp	21 Jun 2005 00:23:40 -0000	1.2
+++ src/rete/reference/node2.lisp	8 Jul 2005 03:37:36 -0000
@@ -33,6 +33,14 @@
             (pass-tokens-to-successor
              self (combine-tokens left-tokens right-token)))))

+(defmethod test-against-right-memory ((self node2) (left-tokens 
remove-token))
+  (loop for right-token being the hash-value
+      of (join-node-right-memory self)
+      do (when (test-tokens self left-tokens right-token)
+           (pass-tokens-to-successor
+            self (combine-tokens
+                  (make-remove-token left-tokens) right-token)))))
+
  (defmethod test-against-left-memory ((self node2) (right-token add-token))
    (loop for left-tokens being the hash-value
        of (join-node-left-memory self)


-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Lisa-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lisa-users


-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar