⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 disease_diagnosis_subset.clp

📁 基于专家系统的 智能医疗诊断系统 CLIPS源代码
💻 CLP
字号:

;;;======================================================
;;;     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)))





⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -