Yes, this is a bug in Jess 7.1p2. Any "test" CE can always be rewritten by simply attaching the condition to the previous CE; equivalently, you could rewrite this rule by putting the "test" before the "or".

On Aug 23, 2010, at 10:36 AM, [email protected] wrote:


Hi,

In the following code, the buy-car rule should not fire. It does not fire in Jess 7.0, but it fires in Jess71p2. Is there an issue with the 'or' condition causing the 'test' to succeed incorrectly in 7.1?
Thanks,
Tony

(watch all)

(deftemplate car ( slot price) )

(deffunction get-false()
    (return FALSE)
    )

(defrule buy-car
    ?candidate <- (or ( car ( price ?m&: (< ?m 20000) ) )
        ( car ( price ?m&: (> ?m 100000) ) ))
    (test (get-false))
    =>
    (printout t "this rule should not have fired" crlf) )

(assert (car (price 18000)))

(run)

----------------------------------------- ****************************************************************** This E-mail is confidential. It may also be legally privileged. If you are not the addressee you may not copy, forward, disclose or use any part of it. If you have received this message in error, please delete it and all copies from your system and notify the sender immediately by return E-mail. Internet communications cannot be guaranteed to be timely, secure, error or virus-free. The sender does not accept liability for any errors or omissions. ****************************************************************** SAVE PAPER - THINK BEFORE YOU PRINT!

---------------------------------------------------------
Ernest Friedman-Hill
Informatics & Decision Sciences          Phone: (925) 294-2154
Sandia National Labs
PO Box 969, MS 9012                            [email protected]
Livermore, CA 94550                             http://www.jessrules.com





--------------------------------------------------------------------
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].
--------------------------------------------------------------------

Reply via email to