I've been on vacation.
Indeed, you're right. While it works for normal slots,
Jess> (deftemplate foo (slot X) (slot Y))
TRUE
Jess> (defrule foo (foo (X ?x) (Y =(+ ?x 1))) => )
TRUE
Jess> (ppdefrule foo)
(defrule foo
""
(declare (salience 0))
(foo (X ?x) (Y ?__jesp0&:(eq* ?__jesp0 (+ ?x 1))))
=>)
it's broken in multislots.
Jess> (defrule foo (foo ?x =(+ ?x 1)) => )
TRUE
Jess> (ppdefrule foo)
(defrule foo
""
(declare (salience 0))
(foo ?x :(eq* ?x (+ ?x 1)))
=>)
Last time I checked, ?x and (+ ?x 1) are rarely equal. The parser is
supposed to synthesize a new variable for the second field, but it's
using ?x instead.
You can change line 1276 of Jesp.java to look like this to fix it:
if (var2.type() == RU.VARIABLE & t1.m_subIdx == subidx)
Thanks for the report.
I think G. David Barnett wrote:
>
> Hello-
>
> It appears that the '=(+ ?x 1)' pattern binding in defrule still doesn't
> work in 50b1.
>
> -Dave Barnett
>
>
---------------------------------------------------------
Ernest Friedman-Hill
Distributed Systems Research Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
Org. 8920, MS 9012 [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]
---------------------------------------------------------------------