Congratulations, you have indeed found a bug; I'll fix it for the next
release and you get credit for reporting it.
The (easy) workaround for now is just to write
(defrule detect-bla-objects
?o <- (bla (ID1 ?id) (ID2 ?id2&:(neq ?id ?id2)))
I think Thomas Gentsch wrote:
>
> OK, I did some checking and upgrading (now I have 6.0a6), but it still
> doesn't work.
>
> The difference is that I did not define the deftemplate in the Jess code
> but rather have:
>
> (defclass bla bla)
>
> (defrule detect-bla-objects
> ?o <- (bla (ID1 ?id) (ID2 ?id2&~?id))
> =>
> ...
> )
>
> and a Java file with the class 'bla', which is basically the same thing,
> just the place where the deftemplate gets defined is different. The Java
> bean appears to be OK, because the following works just fine:
>
> (defrule detect-bla-objects
> ?o <- (bla (ID1 ?id) (ID2 ?id2))
> (test (neq ?id2 ?id))
> =>
> ...
> )
>
> Thanks,
> tge
>
> Emmanuel Lecharny wrote:
> >
> > Hi,
> >
> > that's strange, because it's working on a jess 6.0a5 version. Are you using
> > this version? :
> >
> > C:\Jess>java -classpath . jess/Main
> >
> > Jess, the Java Expert System Shell
> > Copyright (C) 1998 E.J. Friedman Hill and the Sandia Corporation
> > Jess Version 6.0a5 3/12/2001
> >
> > Jess> (deftemplate AA (slot name) (slot n2))
> > TRUE
> > Jess> (defrule tt (AA (name ?name) (n2 ?n2&~?name)) => (printout t "diff"
> > crlf))
> > TRUE
> > Jess> (assert (AA (name "aa") (n2 "bb")))
> > <Fact-0>
> > Jess> (run)
> > diff
> > 1
> > Jess> (assert (AA (name "aa") (n2 "aa")))
> > <Fact-1>
> > Jess> (run)
> > 0
> > Jess>
> >
> > Emmanuel Lecharny, IKTEK
> > 06 08 33 32 61, www.iktek.com <http://www.iktek.com>
> >
> > -----Message d'origine-----
> > De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]De
> > la part de Thomas Gentsch
> > Envoye : samedi 26 mai 2001 14:58
> > A : Jess
> > Objet : JESS: Undefined variable referenced
> >
> > Hello there,
> >
> > discovered some behavior, which doesn't make sense to me:
> >
> > (defrule warn-if-low
> > (tank (name ?name) (another_name ?n2&~?name) (low TRUE) (intact TRUE))
> > ...
> >
> > If I do this Jess complains that I use ?name before defining it (the
> > beans are OK) - seems to be like a parser bug (?)
> > Does somebody know a fix/workaround besides changing the rule by adding
> > a (test (neq ?n2 ?name))
> >
> > Thanks a lot,
> > tge
> >
> > --
> >
> > Thomas Gentsch
> >
> > ---------------------------------------------------------------------
> > 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]
> > ---------------------------------------------------------------------
>
> --
> ................................................
> Thomas Gentsch
> --------------
> Phone: +49 711 486948 E-mail: [EMAIL PROTECTED]
> Mobil: +49 173 6620507
> Fax: +49 711 4687889 WWW: www.e-tge.de
> ................................................
>
>
>
> ---------------------------------------------------------------------
> 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]
> ---------------------------------------------------------------------
>
---------------------------------------------------------
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]
---------------------------------------------------------------------