Prolog Recursion skipping same results
问题 My code runs but the problem is it shows the same results more than once. Here's my code: disease(hiv,[sore_throat,headache,fever,rash]). disease(pregnancy,[fatigue,vomiting,light_headedness,increased_waistline]). disease(flu,[fatigue,fever,tiredness,nasal_discharge]). diagnose([], []). diagnose(Name, [H|T]) :- disease(The_Disease, Symptoms), member(H, Symptoms), write(Name), write(' has/is '), writeln(The_Disease), diagnose(Name, T). member(X,[X|_]). member(X,[_|T]):- member(X,T). Result