min([X],X). min([G|R],M):- M is G, min(R,M1), M1