Programming in Prolog - W. F. Clocksin, C. S. Mellish (Springer, 1984)