I have an expert system for diagnosing some disease.
It's coded in clips. But this code didn't run in clips and return false
statement at the end of the run. I trace it again and again but I didn't notice what is the problem.
Here is some part of my code:
please help me.
sincerely.
`(deffacts init (start)) `
'(Defining defrule mainmenu '
'(start) '
'?ml <- (start) '
'=> '
'(printout t crlf crlf crlf crlf crlf crlf)'
'(printout t '
'"an expert system for diagnosis of some skin '
'disease" crlf crlf'
'" Main Menu" crlf'
'" ==========crlf crlf crlf'
'" 1-Skin rashes without fever" crlf crlf'
'" 2- Skin rashes with fever" crlf crlf'
'" 3- Skin infection " crlf crlf crlf'
'" 0- Quit the program " crlf crlf'
'"Type number of your choice then hit return key" crlf crlf'
'" Choice: ")'
'(bind ?response (read))'
'(if (eq ?response 1)'
'then (assert (type 0-1))'
'else'
'(if (eq ?response 2) then (assert (type 0-2)))'
'else '
'(if (eq ?response 3) then (assert (type 0-3)))'
'else'
'(if (eq ?response 0) then (assert (type quit)))'
'(printout t crlf)'
'(retract ?ml))'
'(Defining defrule user-quits'
'(type quit)'
'=>'
'(printout t "you have QUIT the program." crlf)'
'(halt))'
'((Defining defrule without'
'?p <- (type 0-1)'
'=>'
'(printout t crlf crlf crlf)'
'(retract ?p)'
'"printout t'
'" Diagnosis of some skin desease " crlf crlf crlf'
'" Skin rashes without fever menu" crlf'
'" ==================================" crlf'
'crlf'
'" 1- red patches of skin , painful joints, " crlf'
'" pitted nails, poorly controlled dandruff" crlf'
'crlf'
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…