%:-clrscr.
symptom(flu,fever,headache,na).

symptom(cold, chils,headache,sneezing).

symptom(malaria,chils,headache,shever).


menu:-message.

message:-write('==================================================='),nl,
	 write('==== Disease Dignosis Expert System ==============='),nl,
	 write('==================================================='),nl,nl,nl,
	 	write('===> type th word " so. " to start'),nl,nl,nl.

so:-	write('enter S1: '),
	read(S1),nl,
	write('enter S2: '),
	read(S2),nl,
	write('enter S3: '),
	read(S3),nl,
	sort([S1,S2,S3],S),
	%[C,D,E]=S,tell2(C,D,E).
	tell2(S1,S2,S3).

tell2(A,B,C):-symptom(D,A,B,C),nl,
	write('========================================================================'),nl,
	write('     = Disease caused by '),write(A),write(', '),write(B),write(' and '),write(C),write(' '),write('is '),write('=='),write(D),write('=='),nl,nl,
	write('========================================================================'),nl,nl,
	write('more request (y/n):'),read(Y),(Y=n;so).

tell2(A,B,C):-!,write('       =====>  sorry, you symptoms are below expected to indicate disease'),nl,
		write( '               you need to be ckeck up physicaly'),nl,nl,
		write('=============================================================='),nl,nl,
		write('more request (y/n):'),read(Y),not(Y=n;so).		
cls:- jok.
jok:-put(27),put(91),put(56),put(74). 
:-message.
:-clear_screen.
:-jok.