
% demonstrates that all these different expressions
% represent the same lists

thesame(A,B,C) :-
	check(A,B), check(B,C).

check(X,Y) :- X = Y, !, show(X, ' == ', Y).
check(X,Y) :- show(X, ' != ', Y).

show(X,Rel,Y) :- print(X), print(Rel), print(Y), nl.

listTests:-
	thesame('.'(a,[]), [a|[]], [a]),
	thesame('.'(a,'.'(b,[])), [a|[b|[]]], [a,b]),
	thesame('.'(a,'.'(b,'.'(c,[]))), [a|[b|[c|[]]]], [a,b,c]),
	thesame('.'(a,b), [a|b], [a|b]),
	thesame('.'(a,'.'(b,c)), [a|[b|c]], [a,b|c]).
