Hello -
I am trying to define a rule to find the facts for which the value in a variable is one of the values within a multislot within the fact. Specifically:
(defrule illness-is
?fact-id <- (illness (symptoms $?s&:(member$ ?user-symptom $?s)))
=>
(printout t "You may have " (fact-slot-value ?fact-id name) crlf)
)
But Jess doesn't like the use of ?user-symptom variable. I get the following error:
Jess reported an error in routine ReteCompiler.eval.
Message: Unbound variable found in funcall: user-symptom .
Program text: ( defrule illness-is ?fact-id <- ( illness ( symptoms $?s & : (
member$ ?user-symptom $?s ) ) ) = > ( printout t "You may have " ( fact-slot-val
ue ?fact-id name ) crlf ) ) at line 72.
The value for ?user-symptom will be defined later based on user input.
I'm I going astray here or is this an invalid use of variables in Jess? If so any suggestions on another way of doing this?
Thanks
Eric
