Most definitions can stay the same, but the sets inside apps and slots need to change from
apps([a,b,c]).
slots([x,y,z]).
to something that reads input from a file
random rankings
For testing, the following predicate generates random rankings:
rprefs(Goal,X) :- inv(Goal,Other),agent(Other,L),random_permutation(L,X).