from https://mitpress.mit.edu/9780262691635/the-art-of-prolog/ you can access https://mitp-content-server.mit.edu/books/content/sectbyfn/books_pres_0/1408/1408.pdf?dl=1 and download the ebook.