I want this Clips program to compare 4 symptoms of a disease Bacterial fruit blotch of watermelon using if then rules of Clips (the symptoms are ows, yhp, sda and dgb). the issue is when I run the code it does not display anything. below is the sample code. I need your help please.
(defrule bacterial-fruit-blotch-of-watermelon
(initial-fact)
(printout t "is the plant showing a symptom of Oily and water-soaked cotyledons" crlf)
(printout t "is the plant showing a symptom of Yellow halo paralleling veins " crlf)
(printout t "is the plant showing a symptom of Small dark and angled lesion on leaves " crlf)
(printout t "is the plant showing a symptom of Dark green blotch on the upper surface of developing fruit " crlf)
=>
(assert (OWS (read)))
(assert (YHP (read)))
(assert (SDA (read)))
(assert (DGB (read))))
CLIPS>
(defrule check
(ows ?OWS)
(yhp ?YHP)
(sda ?SDA)
(dgb ?DGB)
=>
(if (and (eq ?OWS yes)
(and (eq ?YHP yes)
(and (eq ?SDA yes)
(eq ?DGB yes))))
then
(printout t "The plant is showing a symptom of bacterial fruit blotch of watermelon disease " crlf)
clips>(run)
With these changes the rule will execute:
CLIPS (6.4 2/9/21)
CLIPS>
(defrule bacterial-fruit-blotch-of-watermelon
=>
(print "Is the plant showing a symptom of Oily and water-soaked cotyledons? ")
(assert (OWS (read)))
(print "Is the plant showing a symptom of Yellow halo paralleling veins? ")
(assert (YHP (read)))
(print "Is the plant showing a symptom of Small dark and angled lesion on leaves? ")
(assert (SDA (read)))
(print "Is the plant showing a symptom of Dark green blotch on the upper surface of developing fruit? ")
(assert (DGB (read))))
CLIPS>
(defrule check
(OWS yes)
(YHP yes)
(SDA yes)
(DGB yes)
=>
(println "The plant is showing a symptom of bacterial fruit blotch of watermelon disease."))
CLIPS> (reset)
CLIPS> (run)
Is the plant showing a symptom of Oily and water-soaked cotyledons? yes
Is the plant showing a symptom of Yellow halo paralleling veins? yes
Is the plant showing a symptom of Small dark and angled lesion on leaves? yes
Is the plant showing a symptom of Dark green blotch on the upper surface of developing fruit? yes
The plant is showing a symptom of bacterial fruit blotch of watermelon disease.
CLIPS>