weather(phoenix, spring, hot).
weather(phoenix, summer, hot).
weather(phoenix, fall, hot).
weather(phoenix, winter, warm).
weather(wellington, spring, warm).
weather(wellington, summer, warm).
weather(wellington, fall, hot).
weather(wellington, winter, cold).
weather(toronto, spring, cold).
weather(toronto, summer, hot).
weather(toronto, fall, cold).
weather(toronto, winter, cold).
warmer_than(C1, C2) :-
weather(C1, spring, hot),
weather(C2, spring, warm).
colder_than(C1, C2) :-
weather(C1, winter, cold),
weather(C2, winter, warm).
weatherquestions :-
warmer_than(phoenix, X),
write('Phoenix is warmer than '), write(X), nl.
colder_than(X, toronto),
write('Toronto is colder than '), write(X), nl.
warmer_than(X, wellington),
write('The city/cities warmer than Wellington are '), write(X), nl.
colder_than(X, phoenix),
write('The city/cities colder than Phoenix are '), write(X), nl.
colder_than(X, toronto),
warmer_than(X, wellington),
write('The city/cities colder than Toronto and warmer than Wellington are '), write(X), nl.
print_all_warmer_than(X) :-
warmer_than(X, phoenix),
write('The cities warmer than Phoenix are '), write(X), nl.