I just started Prolog and for practice I'm trying to compare two lists and see if the first list is greater than the second list by one element. So far I got the base case to work, but for any list with more than one element it loops infinitely. Could anyone explain why this is happening? Any information is appreciated.
Code
one_longer([H],[]).
one_longer([H|T],[H2|T2]) :- one_longer([T],[T2]).