% largest(L,X) - X is the largest value in L.

largest([X],X).
largest([H|T],X) :- largest(T,Y), max(H,Y,X).

% max(V1,V2,M) :- M is the larger of V1 and V2.

max(V1,V2,V1) :- V1 >= V2.
max(V1,V2,V2) :- V2 > V1.
