Excerpt: Are you new to Prolog? Do you need more information related to Prolog? Do you need a memory jog to get an idea related to SWI-Prolog out of the attic of your brain? Then you have come to right place.
Note: Do not reply to this topic; questions, concerns, comments, etc. are to be handled in
Wiki Discussion: Useful Prolog references
SWI-Prolog Getting Started
StackOverflow Prolog tag contains links to many Prolog implementations and free Prolog books.
Learn Prolog Now is a popular site for learning Prolog.
SO Documentation - Prolog Language
A test variation of Learn Prolog Now using SWISH.
Notes/Answers created by others using LearnPrologNow on GItHub
SO Documentation for Prolog. - StackOverflow had a documentation facet for tags for a while then discontinued it. The documentation Prolog was moved to
The Power of Prolog is a great online book (with some video links) explaining prolog from the ground up, including DCGs and Constraint Logic Programming; it is very good.
Simply Logical: Intelligent Reasoning by Example
By George F. Luger (site)
- “The Art of Prolog” By Leon S. Sterlingand and Ehud Y. Shapiro (site) (free pdf)
- “Prolog and Natural-Language Analysis” by Fernando C. N. Pereira and Stuart M. Shieber (site) (free pdf) Covingon, Michael (1997).
- “Prolog Programming in Depth” (pdf) (source code) Covingon, Michael (1994)
- “Natural Language Processing for Prolog Programmers” (pdf) (source code) Spivey, Michael (1996)
- “Introduction to Logic Programming Through Prolog” (site) (free pdf)
- “Formal Syntax and Semantics of Programming Languages” by Kenneth Slonneger and Barry L. Kurtz (free pdf)
- “Simply Logical - Intelligent Reasoning by Example” by Peter Flach (free pdf) (site)
- “Logic for Problem Solving” by Robert Kowalski (free pdf)
(Ordered by skill level from beginner to expert)
Prolog Programming for Artificial Intelligence (4th Edition) by Ivan Bratko (WorldCat)
Programming in Prolog by W F Clocksin and C S Mellish (WorldCat)
The Art of Prolog - advanced programming techniques by Leon S Sterling, Ehud Y Shapior and David H D Warren (WorldCat)
The Craft of Prolog by Richard A O`Keefe (WorldCat)
Free Programming Books - Prolog
The Stanford Encyclopedia of Philosophy has excellent overview articles:
- Classical Logic
- Automated Reasoning
- …and thereunder Logic Programming
- Visualizing SEP is an interactive visualization and search engine for exploring the Stanford Encyclopedia of Philosophy beautifully and powerfully.
Lecture Notes - An Introduction to Prolog Programming by Ulle Endriss (pdf)
Often contain useful examples
SICStus Prolog (HTML, PDF)
Quintus Prolog (HTML, PDF)
ECLiPSe (HTML, PDF links on page)
GNU Prolog (HTML, PDF)
Barry’s Prolog (PDF)
Logtalk (HTML, other formats)
- Google Scholar
- Microsoft Academic Search AKA MAS
- Electronic Colloquium on Computation Complexity
- Cryptology ePrint Archive
- The open archive HAL
require membership fee
- DBLP - The dblp computer science bibliography provides open bibliographic information on major computer science journals and proceedings.
- Some times the paper is not indexed by a search engine because the paper is stored on the public site of a professor but robots.txt excludes indexing personal pages. So if you know the author(s), go to their school site, search for the author, find their personal pages and manually search them. This has a low probably of working, but does sometimes work when Google or such fails.
The SWI-Prolog library
To see the source code for a specific predicate click on (link)
WorldCat - If you fill in your location on the page, it will show libraries near you where the book can be found, includes university libraries. Also includes places where you can purchase the book if desired, including out of print and used books.
Publications about SWI-Prolog
Intro to Web Prolog for Erlangers
Use of Prolog for developing a new programming language and A History of the Erlang VM
Negation as failure
Definite Clause Grammars for Language Analysis --A Survey of the Formalism and a Comparison with Augmented Transition Networks
The Computational Power and Complexity of Constraint Handling Rules by Jon Sneyers, Tom Schrijvers, and Bart Demoen
On the Performance of Bytecode Interpreters in Prolog by Philipp K¨orner, David Schneider and Michael Leuschel
RosettaCode has examples of lots of simple programming task implemented in many programming languages. If you know one programming language, you can often find the same implementation in another language. Prolog tasks.
General listing of all GitHub repositories with Prolog Code, YMMV. (ref)
The following list were hand selected for the exceptional quality of the Prolog code.
Individuals by alphabetical order of last name
GitHub repositories by Samer Abdallah
GitHub repositories by Wouter Beek
GitHub repositories by Carlo Capelli
GitHub repositories by James Cash
GitHub repositories by Robert van Engelen
GitHub repositories by Keri Harris
GitHub repositories by Michael Hendricks
GitHub repositories by Philipp Körner
GitHub repositories by Raivo Laanemets
GitHub repositories by Peter Ludemann
GitHub repositories by Edison Mera
GitHub repositories by Douglas R. Miles (TeamSPoon)
GitHub repositories by Falco Nogatz
GitHub repositories by Anne Ogborn
GitHub repositories by Jacco van Ossenbruggen
GitHub repositories by Roy Ratcliffe
GitHub repositories by Fabrizio Riguzzi
GitHub repositories by Markus Triska
GitHub repositories by Jan Wielemaker
GitHub repositories by Rick Workman (ridgeworks)
GitHub repositories by Eshel Yaron
GitHub repositories for Blog-Core
GitHub repositories for The Ciao Programming Language
GitHub repositories for Logtalk by Paulo Moura
GitHub repositories for TerminusDB
GitHub repositories for SWI-Prolog Ludum Dare Teams
Art of Prolog Code - The source code from the book “Sterling, Leon, and Ehud Y. Shapiro. The art of Prolog: advanced programming techniques. MIT press, 1994. APA”, by Noah Evans
Brachylog - is a declarative logic programming language much like Prolog. Brachylog is designed to be much terser than Prolog, while retaining some readability, by Julien Cumin
Embeddable λProlog Interpreter by Enrico Tassi
My SWI-Prolog page (GitHub) by Hakan Kjellerstrand
Learn Prolog Now Exercises by Peter Urbak
The Prolog GraphPlan Project - The Graphplan algorithm is an automatic planning algorithm that can compute, given a set of rules, a plan of action to go from an initial state to a final state, by Pierre Andrews
Toki Pona Parser - A Tool for Spelling, Grammar Check and Ambiguity Check of Toki Pona Sentences, by jan Lope
Thea2 - A collection of modules for parsing and manipulating OWL2 ontologies in Prolog, by Vangelis Vassiliadis
CMU Prolog Repository - This is some very old Prolog code but sometimes older code is easier to understand.
“Public-domain Prolog library” - Another collection of older Prolog code and libraries (1992-2010), by Jocelyn Ireson-Paine
SimGen - a simulation language.
ClioPatria - an extension of the SWI-Prolog RDF infrastructure (semweb package) that provides you with a ready-to-run web-server that can be extended into a full-fledged Semantic Web application.
Pengines - Web Logic Programming made easy
Pharos Static Binary Analysis Framework (GitHub) (YouTube)
Gerrit Code Review - Uses Prolog for rules
PRESS: PRolog Equation Solving System
ConceptBase.cc - A System for Metamodeling and Method Engineering
EYE - Euler Yet another proof Engine (GitHub)
FCube - An Efficient Prover for Intuitionistic Propositional Logic
Prolog and Logic Programming Historical Sources Archive - This is a gold mine if you want to see the history of different Prolog implementations with archived code included.
- The birth of Prolog by Alain Colmerauer and Philippe Roussel (PDF) (1992)
- History of Logic Programming by Robert Kowalski (page with download link) (2014)
- 1983–1993: The Wonder Years of Sequential Prolog Implementation by Peter Van Roy (page with download link) (1993)
- The Early Years of Logic Programming by Robert Kowalski, (PDF), appeared in “Communications of the ACM” January 1988
PceEmacs - SWI-Prolog built-in editor
SPIDER, the SICStus Prolog IDE based on Eclipse
- Coursera MooC: Prolog for Beginners
- An introduction to Prolog for SQL programers
- Graph Traversal for Problem Solving
- Web applications
- Various ways to iterate in Prolog
- Compiler example from Art of Prolog
Termination inference - cTI_lt (constraint based termination inference for left termination)