I've been trying to find how I could do this, I'm trying to sort facts like: package(X,Y,N), where N is a number. I want to create a list with the X values, ordered by the value of N (lowest to highest). Tried using :
gera_caminho_tempo(,L):- findall(package(N,,S), package(,,S), Packages), msort(Packages, L).
But no results, any ideas?