I am having trouble understanding prolog, I have to find if X is before Y in a list.
so I have a base case with an empty list
before(X, Y, [ ]). <
before(X, Y, [ ]).
You can use append/3 to locate X and the remaining list after it, then locate Y.
before(X, Y, L):- append(_, [X|Tail], L), append(_, [Y|_], Tail).