persistent output in prolog -
for school project attempting write described "interactive diagnosis environment" using prolog. user enter symptom, , list of diseases match symptom printed screen. user list symptom, , diseases removed previous list if not match second symptom, forming new list. new list printed.
example user input: symptom_in(fever, 150). symptom_in(vomiting, 1).
a list of possible diseases printed after each input.
this process repeated until diagnosis made or until somehow determined can't, @ point tests suggested , user can input data regarding tests in similar manner, arriving @ diagnosis.
so far, have list of facts compile , can interact with, don't understand how supposed carry on list of diseases 1 input next. don't understand how move taking symptom input suggesting tests, although maybe evident once understand how symptom input portion.
i appreciate help.
thanks.
edit:
could take 2 values symptom_in call, use them symptom(x, fever, 150)., , assert output store (like in answer this question)? maybe can same thing next call , take union of 2 lists?
you want create expert system. there lot of info on net. example:
https://www.csupomona.edu/~jrfisher/www/prolog_tutorial/2_17.html http://www.amzi.com/expertsystemsinprolog/02usingprolog.php
there lot of info on stack overflow.
in short: need know how use assert
, retract
in proper way.
Comments
Post a Comment