Skip to content
HomeVideosBooks
AllTopicsTrends
BlogsPodcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    Cover of Programming in Prolog

    Programming in Prolog

    William F. Clocksin, Christopher S. Mellish · 1981

    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" Prolog. All examples conform to this standard and will run on the most widely-used Prolog implementations some of which are listed in the appendices with indications as to how they diverge from the standard.

    ProgrammingComputer Science
    Open LibraryAmazon
    Stats for nerds
    8recommend
    22mentions
    14people
    2009–2026years
    55% recommend41% neutral5% critical

    Mentions per year

    2009201120132015201720192021202320252026

    What Hacker News says

    1. YeGoblynQueenneJan 2026
      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 hard way that teaching Prolog as a mere programming language, without explaining the whole logic programming thing, fails.

      thread
    2. YeGoblynQueenneJan 2022
      To be honest I don't know any short articles that do a good job of describing Prolog.

      For a practically-minded programmer, I'd recommend this longer tutorial that guides you through the creation of an old-skewl text-based adventure game:

      https://amzi.com/AdventureInProlog/apreface.php

      As far as I remember, the tutorial should run on most Prologs without (significant?) modification.

      For a more in-depth, high-level, more computer-sciency view try Marcus Triska's pages:

      https://www.metalevel.at/prolog

      Marcus Triska is also the 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 by George Luger:

      AI Algorithms, Data Structures and Idioms in Prolog, Lisp and Java

      https://www.cs.fsu.edu/~cap5605/Luger_Supplementary_Text.pdf

      For the theory behind DCGs, there's Pereira and Shieber:

      Prolog and Natural Language Analysis

      http://www.mtome.com/Publications/PNLA/prolog-digital.pdf

      And for logic programming theory in general, the seminal source is J. W. Lloyd:

      Foundations of logic progamming

      https://link.springer.com/book/10.1007/978-3-642-83189-8

      Unfortunately, I can't recommend any newer texbooks.

      thread
    3. JtsummersJan 2021
      Here are some resources:

      https://github.com/klaussinani/awesome-prolog#resources

      I recall going 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 by Sterling and Shapiro, but have not read it.

      thread
    4. megameterJun 2020
      With 11.5 years to study and no guarantee of an interactive environment, there is no particular reason to start on anything but fundamental CS topics - that's time enough for two degrees and research work, and most likely, if he gets a few years into it he will tire of CS fundamentals and start seeking study of a more specific problem domain, which will motivate further effort.

      Either way, the industry landscape will change, but the old stuff will still be around and still relevant reference. Therefore, start studying old classics of CS, with a focus on fundamental algorithms, compilers and older, simpler language specifications.

      It is extremely likely that even if this man doesn't have access to the Internet, the computer he uses has a web browser, and therefore some version of Javascript. Therefore, I would pick Web tech as the entry point: Learning Web Design: A Beginner's Guide to HTML, CSS, JavaScript, and Web Graphics, Javascript the Definitive Guide, Eloquent Javascript, and Javascript the Good Parts.

      Failing that, he will probably have to bootstrap from Windows batch files and x86 machine code into a programming environment. I will ignore that possibility, since AFAIK nobody has tried to tutorialize such a task.

      To complement the JS stuff, a general outline book. I like Schaum's Outline of Principles of Computer Science.

      Then all the "big hits":

      The Art of Computer Programming

      Algorithms + Data Structures = Programs

      The C 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.

      thread
    5. daviddaviddavidJun 2020
      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 have a crazy day job and kids and non-programming hobbies, etc.

      Regarding just how it might make one a better programmer (while intentionally not answering anything about how it can "materially progress" one's career), I think that learning Prolog can make one a better problem solver because it forces you to specify the solutions to problems in terms of their truth conditions. This, in turn, makes you more likely to tackle problems by constructing mini proofs. I find this to be valuable no matter the language or language family I happen to be working in and it's a habit I definitely learned from writing Prolog.

      thread
    6. YeGoblynQueenneFeb 2020
      >> Why horn clauses, specifically?

      That's a very good question. My (sloppy) answer is that satisfiability of sets of clauses is undecidable for arbitrary clausal languages, but a variant of the resolution rule, SLDNF-Resolution, is refutation-complete for sets of Horn clauses and sound (and complete) for sets of definite clauses. Definite clauses are a subset of Horn clauses having exactly one positive literal (i.e. facts and rules in Prolog). Horn clauses are clauses with at most one positive literal.

      Given a set of definite clauses and a Horn goal clause, it is possible to prove by refutation that the goal is true in the context of the program, in a finite number of steps. This is how the Prolog interactive mode works: the user enters a goal clause as a "query" and Prolog tries to refute the query by SLDNF-resolution.

      SLDNF-resolution is "SLD resolution with Negatation as (finite) Failure". "SLD resolution" stands for Selective, Linear Definite resolution (it's a long story). Negation as (finite) failure (NAF) accepts that a statement is true if it cannot be proven false under a closed-world assumption (that all we know that is true, is all that we can assume is true). NAF means that Prolog programs can include clauses with negated literals, which is very handy because one often wants to say things like "X is an Evil Demon Bear from Mars if X has green fur and purple-glowing eyes _unless_ X plays the hurdy-gurdy".

      These are some of the basic assumptions of Prolog: SLDNF-resolution, definite clauses and negation-as-failure under a closed-world assumption. The goal is to have a package that, under some conditions, can prove a goal given a logic 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 tried implementing Prolog. Too much hard work and it's already been done by others :) So no idea how to do it. But it's probably the easiest way to get a good set of deep insights in the language and I should probably plonk my arse down and do it, myself.

      thread

    Related

    Cover of Prolog and natural-language analysis
    2010–2025

    Prolog and natural-language analysis

    Fernando C. N. Pereira
    6 recommend · 11
    Cover of Adventure in Prolog
    2016–2026

    Adventure in Prolog

    Dennis Merritt
    6 recommend · 10
    Cover of AI algorithms, data structures, and idioms in Prolog, Lisp, and Java
    2013–2022

    AI algorithms, data structures, and idioms in Prolog, Lisp, and Java

    George F. Luger
    1 recommend · 8
    Cover of Foundations of Logic Programming
    2010–2026

    Foundations of Logic Programming

    John W. Lloyd
    1 recommend · 7
    Cover of Inductive Logic Programming
    2016–2026

    Inductive Logic Programming

    Stephen H. Muggleton
    1 recommend · 5
    Prolog Programming in DepthMichael A. Covington
    2009–2025

    Prolog Programming in Depth

    Michael A. Covington
    4 recommend · 5
    Cover of The art of Prolog
    2009–2026

    The art of Prolog

    Leon Sterling
    36 recommend · 114
    Cover of The craft of Prolog
    2009–2026

    The craft of Prolog

    Richard A. O'Keefe
    18 recommend · 57