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