Am writing a program with CLIPS for expert system that will diagnose symptoms and conclude the type of disease affecting a watermelon plant. Now I want to use .NET to design a graphical user interface. so that the user will just use checkboxes to select the symptoms and press an analyse button to see the predicted disease affecting the watermelon plant. Am already using console to perform the task, whereby the user will be responding with yes or no to the symptoms, thereafter the system will diagnose the kind of disease affecting the watermelon plant. so now I want to stop using console and want to use .NET. But I have a little knowledge of .NET. I've download Microsoft visual studio now and want to design the interface.
(deftemplate symptom
(slot id)
(slot question)
(slot indicative (default yes)))
(deffacts symptoms
(symptom (id ows)
(question "Is the plant showing a symptom of Oily and water-soaked cotyledons?"))
(symptom (id yhp)
(question "Is the plant showing a symptom of Yellow halo paralleling veins?"))
(symptom (id sda)
(question "Is the plant showing a symptom of Small dark and angled lesion on leaves?"))
(symptom (id dgb)
(question "Is the plant showing a symptom of Dark green blotch on the upper surface of developing fruit?"))
(symptom (id corky)
(question "Is the plant showing a symptom of corky, dry necrosis?"))
(symptom (id misshaping)
(question "Is the plant showing a symptom of misshapen?"))
(symptom (id dark)
(question "Is the plant showing a symptom of dark, water-soaked depression?"))
(symptom (id shiny)
(question "Is the leaf showing a symptom of shiny, chlorotic halo?"))
(symptom (id sil)
(question "Does the leaf shows a symptom of small irregular lesions and became angular later?"))
(symptom (id owb)
(question "Is the plant showing a symptom of clorotic on watermelon boaders?"))
(symptom (id olb)
(question "Is the plant showing a symptom of Older lesions that is usually brown, dry and tear to produce a tattered appearance on leaf ?"))
(symptom (id sri)
(question "Is the leaf showing a symptom of Small, round to irregular, watersoaked spots appear on infected leaves?"))
(symptom (id sou)
(question "Is the leaf showing a symptom of spots on the upper leaf surfaces turn whitish gray to brown and die?"))
(symptom (id oll)
(question "Is the leaf showing a symptom of gummy and shiny On the lower leaf surfaces?"))
)
(deftemplate disease
(slot id)
(multislot symptoms))
(deffacts diseases
(disease (id "bacterial fruit blotch")
(symptoms ows yhp sda dgb))
(disease (id "bacterial rind necrosis")
(symptoms corky misshaping dark))
(disease (id "angular leaf spot")
(symptoms shiny sil owb olb sri sou oll))
)
(deftemplate answer
(slot id)
(slot value))
(deftemplate conclusion
(slot id))
(defrule conclude-disease
;; There is a disease
(disease (id ?disease))
;; For every symptom of that disease
(forall (disease (id ?disease)
(symptoms $? ?symptom $?))
(symptom (id ?symptom)
(indicative ?value))
;; There is a response indicative
;; of a problem
(answer (id ?symptom)
(value ?value)))
=>
;; Conclude the plant has the disease
(assert (conclusion (id ?disease))))
(deffunction ask-question (?question $?allowed-values)
(printout t ?question " " ?allowed-values " ")
(bind ?answer (read))
(if (lexemep ?answer)
then (bind ?answer (lowcase ?answer)))
(while (not (member$ ?answer ?allowed-values)) do
(printout t ?question " " ?allowed-values " ")
(bind ?answer (read))
(if (lexemep ?answer)
then (bind ?answer (lowcase ?answer))))
?answer)
(defrule ask-symptom
;; There is a symptom
(symptom (id ?symptom)
(question ?question))
;; For a disease
(disease (id ?disease)
(symptoms $? ?symptom $?))
;; That we have not determined
(not (answer (id ?symptom)))
;; And there is no prior response to a symptom
;; of that disease that is non-indicative.
(not (and (disease (id ?disease)
(symptoms $? ?other-symptom $?))
(symptom (id ?other-symptom)
(indicative ?value))
(answer (id ?other-symptom)
(value ~?value))))
=>
;; Ask the user the symptom question
(bind ?value (ask-question ?question yes no))
;; And assert the response.
(assert (answer (id ?symptom)
(value ?value))))
(defrule print-conclusion
(declare (salience -10))
(conclusion (id ?disease))
=>
(printout t "The plant is showing symptoms of " ?disease " watermelon disease." crlf))
(defrule print-no-conclusion
(declare (salience -10))
(not (conclusion))
=>
(printout t "The plant is not showing all symptoms of a watermelon disease." crlf))
Download the CLIPS documentation and the projects for Windows. There are examples of .NET applications. The Interfaces Guide has instructions for running the examples. The wine selection example is the closest fit to the application you've described.