Programming in Prolog - Clocksin, William F.,Mellish, Christopher S. (Springer, 1984)