% exercise on page 273 of Appleby north_of(X1,X2):-location(X1,Y1,Z1), location(X2,Y2,Z2), Y2 < Y1. location(new_york, 41,74). location(chicago, 42,88). location(tokyo,35,150). location(oslo,60,11). location(halto,0,80). location(cairo,30,30). a:-north_of(chicago, new_york). b:-north_of(X, new_york), prin(X), write(' is north of New York'), nl. doit:- write('exercise 1a'), nl, a. doit:- write('exercise 1b'), nl, b. :-print(' doit, a, b, location, north_of are all loaded...'). :- write('Input the prolog query 'doit?''), nl.