title: Prolog : append to list
body: <p>I have facts like that :
  student(stud01, 'Programming 1', 90).
  student(stud01, 'Math 1', 78).
  student(stud01, 'Statistics 1', 94).
  student(stud01, 'Electronics 1', 81).
  student(stud01, 'Management', 66).
  student(stud01, 'English', 83).</p>
  <p>i want to build a predict that take the student id and and put all its grade in list
  and after that take the max grade</p>
  <p>i try this :
  stuGrade(ID,List):-
  stuGrade([],ID,List).</p>
  <p>stuGrade(TmpList,ID,List):-
  student(ID,Course,Grade),
  not(mem([ID],TmpList)), !,
  append_List([Grade],TmpList,NewTmpList),
  stuGrade(List,ID,NewTmpList).</p>
  <p>stuGrade(List,ID,List).</p>
  <p>maxStudentGrade(ID,Max):-
  stuGrade(ID,L),
  max(L,Max).</p>
  <p>but the problem that after using ?-trace. i see that the output list containing only the first grade (90) how can i slove this problem</p>