I am trying to create a very simple symptom diagnostic tool using SWI prolog and i have tried to learn the language but it all seems very confusing. just when i think i'm getting somewhere i go back to square one. I don't know where or how to begin. HELP!!!!
% SDT knowledge base
if 'red blood cells are sickle shaped'
then 'person is probably a sickler'.
if 'experiencing body pains'
then 'person is probably a sickler'.
% managing questions and answers
question('experiencing body pains','are you experiencing body pains?',
['experiencing happiness'-no],['experiencing happiness'-yes]).
back_chain:-
goal( R ),
chain_demo( R ),
chain_post_result( conclusive(R) ).
chain_post_result( inconclusive ).
% using a cut to stop further probing
query(Sympt, Value):-
known(yes, Sympt, Value), !. % stop further querying if true/yes
query(Sympt, Value):-
known(_, Sympt, Value), % if false fail
!,
fail.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.