samelength([], []). samelength([_|X], [_|Y]) :- samelength(X,Y).