Hi Bob,
Computers can be so literal-minded, can't they? In this case, the
behavior hinges (in a Clintonesque way) on your definition of "or".
THere are several ways to get Jess to do what you want here; probably
the best way is just to spell out your intentions exactly:
(defrule ruleA
(or (and (value1 ?v1) (not (value2 ?v2)))
(and (not (value1 ?v1)) (value2 ?v2))
(and (value1 ?v1) (value2 ?v2)))
=>
(printout t "GOT IT" crlf))
i.e., fire when A&~B, B&~A, or A&B.
I think Bob Stewart wrote:
> Hello,
>
> I have a situation where I want to match a rule only
> one time, but the rule has an or clause in it.
> Here is a simple (not 100% syntactically correct)
> example.
>
> (defrule ruleA
> (or (value1 ?v1) (value2 ?v2))
> ==>
> (printout t "GOT IT" crlf))
>
> if I were to assert two facts,
> (assert (value1 Yes))
> (assert (value2 No))
>
> And do a (run), I will get two matches. I looked at
> unique, but that can only be used
> with one value.
> I also tried exists, but I have had no success.
>
> I would like for "GOT IT" to be printed out
> only once.
>
> Thanks,
> Bob Stewart
>
> __________________________________________________
> Do You Yahoo!?
> Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
> http://im.yahoo.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]
> ---------------------------------------------------------------------
>
---------------------------------------------------------
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]
---------------------------------------------------------------------