#Prolog Homework