I have the following facts
%exam(Student,Subject)
exam(student1,subject1).
exam(student2,subject1).
exam(student3,subject1).
exam(student1,subject2).
exam(student3,subject2).
exam(student1,subject3).
I want to find the subjects of a student and put them in a list
Subjects(Student,[H|T]):-
exam(Student,Subject),
\\+Subject=H,
H = Subject,
Subjects(Student,T).
I can't figure out what the base case should be !