Prolog

This page contains basic beginner and more advanced Prolog snippets; the purpose of this page is for those who are learning and like to learn (via pure code), as well as, a location for mpettersson to keep snippets and Prolog related links. This pages subsections are:
 
Prolog 101
Miscellaneous Prolog Code
Prolog Resources
 
As always, please contact us with comments, concerns, questions, etc. about Prolog!
 
 

Prolog 101

For a “comprehensive free Prolog environment” download SWI-Prolog from the SWI Prolog download page. For just about everything you’d ever want to know about this particular version of Prolog, check out the SWI Prolog document page.
 
The following code snippet contains the instructions necessary to load a Prolog (.pl) file, furthermore, please note that the symbols ‘?-‘ simply represent (or indicate) the Prolog interpreter.

 
The contents of the File.pl Prolog file:

 

Miscellaneous Prolog Code

 
The following code is a collection of interesting Prolog code (well, at least from the perspective of an imperative programmer).

Binary Digits in Prolog

 

Prolog Resources

The following are links to Prolog related resources, such as books, blogs, tutorials, code, etc…
Logic, Programming and Prolog (2ed) by Ulf Nilsson and Jan Maluszynski
Prolog & Logic Programming Slides by Dr. Hamlen at UTD (my favorite professor at UTD).
Prolog Tutorial by J. R. Fisher

Leave a Reply