Problem list , input

hey guys i need the solution it would be better to understand the code im new to prolog found this problem in pdf file
it was one of little that has no answers i tried to solve it

fever([‘Do you have eye pain?’]|[“Or sore eyesskin flushing?”,“Or hot skin?”]).
heart([‘dizziness’]|[‘chest pain and discomfort’,‘or fluttering in your chest’]).
celiac([‘diarrhea’]|[ ‘or bloating’ ,‘or bone and joint pain’]).

main:- write(‘welcome to our digonoses’),nl,write('Do you want to check digonoses list? '),read(X),check(X).

check(X):-((X= yes,write(‘our digonoses list is’), disease(L), write(L), write( ‘Do you want to take test?’),read(Y),check1(Y))).


check2(Z):-((Z=yes ,heart(L),write(L),read©,check3©,write(‘you have fever, you tratment is: Tyleno’));
(Z=no, heart(L),write(L),read©,check3©)).

check3©:-(C=yes,celiac(L),write(L),read(A),check4(A),write(‘you have a heart, your tratment is: Nodolol’);

check4(A):-((A=no,write('Test is over the result is : '));
(A=yes,write('Test is over the result is : '),write(‘You have a celiac your tratment is: Bvitmins’))).

Your question is actually a popular homework problem and has a few responses at StackOverflow HTH.