I need my rules to behave differently when a fact already exist in the
system. In a C syntax-like, what I want to do would be like:

if      cf3 does not exist, then cf3 = min (cf1, cf2)
else    cf3 = min {cf1, cf2, cf3}

cf is a certainty factor. I have found that this can be done by using two
rules like:

(defrule rule1
        (x1 value1 ?cf1)
        (x2 value2 ?cf2)
        (x3 value3 ?cf3)
  =>
        (assert (x3 value3 (min ?cf1 ?cf2 ?cf3)))
)

(defrule rule2
        (x1 value1 ?cf1)
        (x2 value2 ?cf2)
  =>
        (assert (x3 value3 (min ?cf1 ?cf2)))
)

By this way, the number of rules of the system would duplicate. Is there a
better solution?

Thanks a lot

Fernando Bobillo


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