?? disease_diagnosis_subset.clp
字號(hào):
;;;======================================================
;;; Medical Diagnosis Expert System
;;; Student no.:MA665272
;;; Name:Derek,Sam Sai Hei
;;;
;;; This expert system diagnoses some disease
;;; such as SARS,Flu-1,Flu-2,Heavy Cold,Normal Cold,
;;; Meningitis and Pneumonia
;;;
;;; To execute, merely load, reset and run.
;;;======================================================
(defrule startup ""
(initial-fact)
=>
(assert (next "yes"))
(printout t "Input the Symptoms 1.High-Fever,2.Low-Fever,3.Cough Seriously,4.Sputum,"crlf)
(printout t " 5.Snuffle and Drivel,6.Headache,7.Throatache,8.hard to breath,"crlf)
(printout t " 9.Virus in Blood,10.Neck Harden,0.No more Symtoms "crlf crlf)
(printout t "INPUT YOUR SYMPTOMS BY the 1 2 3... WAY"crlf)
(printout t "EXAMPLE: Key in 1 3 4 and press enter if you have high-fever, cough and sputum."crlf)
(printout t "This program will list all the possible disease that you may have."crlf crlf)
(printout t "Symptom:")
(assert(symptoms (explode$ (readline))))
(printout t crlf crlf)
)
(defrule analysis ""
(next ?)
(symptoms $?sym)
=>
(printout t "YOU MAY HAVE:"crlf crlf)
(if (subsetp (create$ ?sym) (create$ 1 3 4 6 7 8 9)) then (printout t "SARS"crlf))
(if (subsetp (create$ ?sym) (create$ 1 5 6 7 8 9)) then (printout t "Flu-1"crlf))
(if (subsetp (create$ ?sym) (create$ 2 3 4 5 7 9)) then (printout t "Flu-2"crlf))
(if (subsetp (create$ ?sym) (create$ 1 3 4 5 6 7)) then (printout t "Heavy Cold"crlf))
(if (subsetp (create$ ?sym) (create$ 1 5 6 7 8)) then (printout t "Heavy Cold"crlf))
(if (subsetp (create$ ?sym) (create$ 2 3 4 5 7)) then (printout t "Normal Cold"crlf))
(if (subsetp (create$ ?sym) (create$ 1 6 7 8 9 10)) then (printout t "Meningitis"crlf))
(if (subsetp (create$ ?sym) (create$ 2 3 4 6 8)) then (printout t "Pneumonia"crlf)))
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -