
Programming in Prolog
by William F. Clocksin, Christopher S. Mellish · first published 1981
57% recommend36% neutral7% critical
Why HN recommends it
A compact, exercise-driven introduction to Prolog. It is a small, useful reference for learners who want to work through the exercises and understand the language's core ideas.
Summarised by Claude from recommending comments
Since the first edition of this book in 1981, Prolog has continued to attract an unexpectedly great deal of interest in the computer science community and has turned out to be a basis for an important new family of programming languages and systems for Artificial Intelligence. In the preceding three editions, the authors have steadily added new material, improved the presentation, and corrected various minor errors to provide a textbook as well as a reference work for everyone who wants to study and use Prolog as a practical programming language. The authors concentrate on teaching "core" Prol
Affiliate links. As an Amazon Associate I earn from qualifying purchases.








…Programming Language The Little Schemer, Structure and Interpretation of Computer Programs, and Common Lisp the Language. Starting Forth, Thinking Forth, and the Forth-83 standard Smalltalk-80 the Language Programming in Prolog: Using the ISO Standard A Relational Model of Data for Large Shared Data Banks (Codd 1970) plus SQL Queries for Mere Mortals for the practical.
on “Ask HN: Advice for a prisoner learning to program” ↗…Prolog in the long run. (The newest edition is kind of expensive, but you could get by with the first edition. They fleshed out the latter 'project' chapters a lot in the second, though.) As a reference, _Programming in Prolog_ by Clocksin & Mellish is good. I also liked _Clause & Effect_ by Clocksin; it's sort of like _The Little Schemer_, but for Prolog. _The Craft of Prolog_ by O'Keefe is great, once you're comfortable with…
on “Ask HN: Confused semi-newbie programmer needs some advice.” ↗Absolutely. While some of the other introductions to Prolog cover the language quite well (_Programming in Prolog_ by Clocksin & Mellish is good), _The Art of Prolog_ unapologetically dives headfirst into the deep ideas in logic programming, then comes back to the surface and shows how standard Prolog captures them.…
on “A Prolog Introduction for Hackers” ↗Learn Prolog Now (http://learnprolognow.org/) is covers the basics better, IMHO, as does _Programming in Prolog_ by Clocksin & Mellish.
on “A Prolog Introduction for Hackers” ↗I've looked at and read a bunch of different Prolog books. In my opinion the best one is `Programming in Prolog: Using the ISO Standard' by Clocksin & Mellish. It's actually one of my favorite programming books. Do all the exercises! http://www.amazon.com/Programming-Prolog-Using-ISO-Standard/... http://www.swi-prolog.org/
on “Prolog for Programmers” ↗People have already recommended it, but "Programming in Prolog" by Clocksin and Mellish was the text book for the Prolog course that SWI-Prolog offered back in June. I'd recommend the class if it were offered again.
on “The Birth of Prolog (1992) [pdf]” ↗…program. Given that, it's possible to write a logic theorem and have it execute like a program, by proving a goal. In terms of learning resources- if you have a bit of a logic background I think that "Programming in Prolog" by Clocksin and Mellish does a good job of going over both the declarative and imperative reading of Prolog (but it's been more than 10 years since I first read it so I might be wrong). I haven't even…
on “Learn X in Y minutes Where X=Prolog” ↗I can sympathize with this perspective. One strategy that I try to employ is to find books which are both small and good. In the case of Prolog, Clocksin and Mellish's "Programming in Prolog" falls in that category. The Art of Prolog is a great book but it's a big book and you could probably spin your wheels on it for years, whereas a smaller book can conceivably be digested even if you…
on “The Art of Prolog (1994)” ↗…through the Adventure in Prolog one (free online resource) a while ago and enjoying it, helped direct a lot of exploration into the Prolog language and its capabilities for me. I have Clocksin & Mellish's Programming in Prolog (2003, 5th ed.) and liked it as a good introduction (or more expansion, I had dabbled in it previously and "knew" the language but not the full depth of it). I've read good things about The Art of Prolog…
on “Why Learn Prolog in 2021?” ↗…author of several constraint logic programming libraries, for example: https://www.swi-prolog.org/man/clpfd.html Then, there's a number of textbooks. The classics are Clockin and Mellish and Bratko: Programming in Prolog (Fifth Edition): https://www2.cs.arizona.edu/classes/cs372/spring15/Programmi... Prolog programing for AI https://archive.org/details/prologprogrammin0000brat I personally really enjoyed this book…
on “Dear sir, you have built a compiler” ↗And also "Prolog Programming for AI" by Bratko and "Programming in Prolog" by Clocksin and Mellish. Although these days I'd recommend anyone interested in Prolog starts in at the deep end with "Foundations of Logic Programming" by George W. Lloyd, because I've learned the…
on “My Gripes with Prolog” ↗…"SQL cookbook" texts for practical applications. Make sure that whatever cookbook you use covers things like SQL injection and that you fully understand that coverage. :-) 6) Prolog. The classic here is Programming in Prolog, by Clocksin and Mellish. However, I haven't been keeping up with Prolog for a long time. Someone else may have a better suggestion. 7) Machine learning and neural nets. No suggestion here -- it's not…
on “Ask HN: How would you relearn programming?” ↗…the best book IMHO is _The Art of Prolog_ by Sterling and Shapiro. The newer edition is out of print and expensive (but worth it!), the previous edition is more like $6 and will give you a good taste. _Programming in Prolog_ by Clocksin & Mellish is a pretty straightforward overview of the language, but TAoP really gets at Prolog's real potential. I also liked _Clause and Effect_, which is somewhat like a "Little Schemer"…
on “The Prolog Story ” ↗…Prolog starts out feeling declarative but then very quickly you need to be aware of all the backtracking rules to correctly guide Prolog to the solution you want. I have tried to get through Clocksin's Programming in Prolog a couple times now and it still hits me how quickly you need to get into the invisible details nobody blogs about in order to be even base-level productive in it.
on “Prolog for Beginners” ↗…several times). Although I don't think it's very good from a didactic point of view, many disagree, and at least the author really knows what they are talking about. I have a PDF of the fifth edition of "Programming in Prolog" by Clocksin and Mellish lying around here. I could swear it was available for free as open access for a while, though a very quick web search doesn't confirm this.
on “Who Killed Prolog? (2010)” ↗