Gotcha! And in the way it works in recursive list cases... let's make up an example.
f([], 0).
f([H|T], X):- f(T, Y), g(H,Z), X is Y+Z.
g(a, 1).
g(X, 0).
inputting f([a,b,a],X), write(X), fail. to this will give you something like...
2110. It will get the first 2, fail. go back and instead...