我正在尝试使用事实使专家系统成为序言,我已经定义了一些事实并试图通过用户输入来诊断这些事实,但是当传递参数时,它没有给出值,而不是剩余的参数
这些是事实
diseas(chikungunya,fever,jointpain,headache,musclepain,jointswelling).
diseas(dengue,fever,eyespain,headache,musclepain,nausea).
diseas(malaria,fever,chestpain,headache,musclepain,nausea).
diseas(dyria,fever,abdominalpain,_,abdominalpain,bloodinstool).
这是规则
question1:-write('do you have fever?,1.yes or 2.no'),nl,read(A),(A='yes'->Ch1='fever';(A='no'->Ch1='nofever')),display(Ch1),
write('which pain do you feel?'),nl,write('1.jointpain,2.eyespain,3.chestpain,4.abdominalpain'),read(B),(B=1->Ch2='jointpain';(B=2->Ch2='eyespain';(B=3->Ch2='chestpain';(B=4->Ch2='abdominalpain')))),
write('do you have headache?,1.yes or 2.no'),nl,read(C),(C='yes'->Ch3='headache';(C='no'->Ch3='noheadache')),display(Ch3),
write('inw hich part of body do you feel pain?'),nl,write('1.musclepain,2.abdominalpain'),read(D),(D=1->Ch4='musclepain';(D=2->Ch4='abdominalpain')),
write('any other issue'),nl,write('1.jointswelling,2.nausea,3.bloodinstool'),read(E),(E=1->Ch5='jointswelling';(E=2->Ch5='nausea';(E=3->ch5='bloodinstool'))),write(diseas(X,Ch1,Ch2,Ch3,Ch4,Ch5)).
我期望diseas(dengue,fever,eyespain,headache,muscularpain)
,但它给了diseas(_2345.fever,eyespain,headache,muscularpain)