THE READING ROOM / BOOK GUIDE
The art of Prolog
A guide to Prolog by Leon Sterling and Ehud Shapiro, written for programmers who want to reason about logic programs rather than memorize syntax.
About the book
The Art of Prolog: Advanced Programming Techniques is a book about writing Prolog programs well. Leon Sterling and Ehud Shapiro address readers who already know the language's basics and want to understand how logic programs behave, how to structure them, and how to reason about correctness. The emphasis falls on technique and design rather than on a tour of the language's syntax.
The book belongs to the period when logic programming was a serious subject of study and Prolog was taught in computer science programs. Its concerns are the ones that persist: how clauses combine, how execution proceeds, and how a programmer controls that execution while keeping programs readable. The subtitle signals the intended audience. This is a book for someone who has written small Prolog programs and now wants to write larger, more deliberate ones.
The authors treat programming as a craft with principles. Readers should expect discussion of program structure, the relationship between declarative meaning and procedural behavior, and the kinds of design decisions that separate a working program from a maintainable one. The book assumes familiarity with Prolog and with basic programming concepts, so it rewards patience and prior practice.
How to read it
Approach the book with a Prolog interpreter open. The arguments about program behavior become concrete when you can run clauses and watch how the system responds. Read slowly through the early material even if it looks familiar; the book builds a vocabulary for discussing programs that later sections rely on.
The prose is precise and academic, closer to a textbook than to a tutorial. Expect to reread passages and to work through examples rather than skim them. The book rewards readers who test its claims against their own programs. Where an example seems abstract, try to construct a small case that shows the point in action.
Who it suits
Programmers who already know Prolog and want to move beyond toy examples will find the most value here. Students taking a logic programming course will get a structured account of program design that complements lectures. Readers interested in the history of programming languages will see how logic programming was taught and argued about in the mid-1980s. Anyone who has never written Prolog should start elsewhere first.
Reading considerations
The book's examples and terminology reflect the Prolog systems of its era. Modern implementations may behave differently in edge cases, and some conventions have shifted. Check which edition you have, since later printings may differ. Treat the book as a guide to principles rather than a reference for a specific current implementation.
Follow the HN conversation
36 different recommenders are recorded in the upstream dataset. These are AI-classified source counts, not an independent rating.
Search HN comments about this book ↗
Explore videos on the same subject ↗
Book notes prepared with DeepSeek, using catalogue records and Open Library subject information. They are reading guidance, not a personal review or a verified chapter-by-chapter account. Book details can vary by edition. HN data methodology · Book metadata and covers.
