I have a problem with trying to get an input and fact-check it with symptoms in the asserted facts.
(deftemplate disease
(slot name)
(multislot symptom ))
(assert (disease
(name nitro-def) (symptom stunted-growth pale-yellow reddish-brown-leaf)))
(assert (disease
(name phosphor-def) (symptom stunted-root-growth spindly-stalk purplish-colour)))
(assert (disease
(name potassium-def) (symptom purple-colour weakened-stems shriveled-seeds)))
(defrule reading-input
(disease (name ?name1) (symptom ?symptom1))
=>
(printout t "Enter the symptom your plant exhibits: " )
(assert (var (read))))
(defrule checking-input
?vars <- (var)
(disease (name ?name1) (symptom ?symptom1))
(disease (symptom ?vars&:(eq ?vars ?symptom1)))
=>
(printout t "Disease is " ?name1 crlf))
So basically you input a symptom and Clips returns the disease that matches that symptom. Problem is, that after Loading the file as Batch and running it, nothing happens. The Facts are asserted but no input is required. Nothing even touches the first rule.
If anyone can help me in this issue, I would be dully grateful!
Thanks!