point(-4,4).
point(-3,2).
point(-1,1).
point(0,0).
point(-3,0).
point(1,3).
point(3,3).
point(-4,-4).
point(3,-3).
line([(X1,Y1),(X2,Y2)]) :- point(X1,Y1), point(X2,Y2), [X1,Y1] \= [X2,Y2].
horiz([(_,Y),(_,Y)]).
vert([(X,_),(X,_)]).
is_neg1(X) :- D is abs(X+1), D < 0.1.
perp(L1,L2) :- horiz(L1), vert(L2).
perp(L1,L2) :- vert(L1), horiz(L2).
perp(L1,L2) :- \+ vert(L1), \+ vert(L2), slope(L1,M1), slope(L2,M2), P is M1*M2, is_neg1(P).
slope([(X,_),(X,_)],infinite) :- !.
slope([(X1,Y1),(X2,Y2)],M) :- M is (Y2-Y1)/(X2-X1).
goal: line([P1,P2]),
line([P2,P3]),
line([P3,P4]),
line([P4,P1]),
perp([P1,P2],[P2,P3]),
perp([P2,P3],[P3,P4]),
perp([P3,P4],[P4,P1]).
false
.) Is there no rectangle amongst our points? (See the hint.)