> -----Original Message-----
> From: Ernest Friedman-Hill [mailto:[EMAIL PROTECTED]]
> Sent: Monday, November 15, 1999 8:59 AM
> To: George.Rudolph; [EMAIL PROTECTED]
> Subject: Re: Reusing Join Nodes
>
>
> Join nodes with function call tests are not shared. Although
> simple ones like this could be, deciding to share more
> complex ones could
> be very hard, so Jess simply punts. Expect to see improvement here as
> an optimization in the future.
>
> Note that these particular tests would be more efficient if written in
> the pattern itself, rather than in test CEs, anyway.
Oh. I thought the two forms were equivalent. Maybe that means functionally
equivalent.
The reason we chose to use CE's instead of patterns is that in many cases we
want to do more than
just a pattern match (with EQUALS). We could replace the call to equals
with some other (boolean)
arbitrary boolean function. But we wanted a uniform algorithm for
generating rules in all cases.
(Rules are being entered via a gui that doesn't know about Jess rules, but
uses an intermediate format.
Jess rules are then generated from that format.)
It looks like it's worth checking to see if the desired function is EQUAL,
and if so, generating the rule
using pattern matching syntax. Only in cases where it's not EQUAL would we
then be forced to use a CE.
I know quite a number of people on the list have dealt with the same
issues--any suggestions would be welcome.
>
> -----------------------------
>
> I have a bunch of rules of the following type, where
> clauses look identical,
> but when I use the (watch compilations) command or the
> (view), it clearly
> shows that 2-input nodes are not being reused. Why?
> And what can I do to solve the problem?
>
> (BTW, the thing object is defined by a defclass, if that makes a
> difference).
>
>
> (defrule rule1
> ""
> (declare (salience 0))
> (thing (color ?f1) (shape ?f0))
> (test (EQUALS ?f0 "02907"))
> (test (EQUALS ?f1 "64772"))
> =>
> )
>
> (defrule rule2
> ""
> (declare (salience 0))
> (thing (color ?f1) (shape ?f0))
> (test (EQUALS ?f0 "02907"))
> (test (EQUALS ?f1 "64772"))
> =>
> )
> --
>
> Ernest Friedman-Hill
> Distributed Systems Research Phone: (925) 294-2154
> Sandia National Labs FAX: (925) 294-2234
> Org. 8920, MS 9214 [EMAIL PROTECTED]
> PO Box 969 http://herzberg.ca.sandia.gov
> Livermore, CA 94550
>
---------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the
list (use your own address!) List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------