Text this: Techniques of Prolog Programming :