Hello all,
I'm probably making this more difficult that it needs to be, but I thought
I'd at least pose the question. I have a deftemplate, for which I could
have multiple facts asserted, but in this example I'm just going to assert
one.
(deftemplate trait (slot type) (slot name) (slot value))
(assert (trait (type DEMOGRAPHIC) (name INCOME)(value 1000)))
Then I may have two rules that test to see what the value of HAIR_COLOR and
INCOME is. My problem is I'm dealing with dynamic data, and so I can't
determine if a rule didn't fire because it didn't meet the condition, or if
it the fact just wasn't asserted in the first place. The rules for the fact
above follow:
(defrule income-rule
(trait
(name ?trait-name)
(value ?trait-value))
(test (and (eq ?trait-name INCOME)(< ?trait-value 50000)))
=>
(assert (rule-exec (num 1)(resolution success))))
(defrule haircolor-rule
(trait
(name ?trait-name)
(value ?trait-value))
(test (and (eq ?trait-name HAIR_COLOR)(eq ?trait-value brown)))
=>
(assert (rule-exec (num 1)(resolution success))))
In this case I know the hair color rule will never be fired, but how can I
tell whether it is due to information not being asserted or the rule not
firing. I think I remember seeing something on testing the not of a rule.
If this is not possible, is there a way to verify a rule hasn't fired,
besides testing for the inverse of the original condition and firing on
that.
Thanks for your help.
Sincerely,
Ryan
---------------------------------------------------------------------
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]
---------------------------------------------------------------------