Programming in prolog - Clocksin, William F.,Mellish, Christopher S. (Springer, 1981)