Writing a Prolog Tutorial

Ovid on 2005-03-18T18:12:04

I've realized that I need to write a Prolog tutorial. Prolog is very easy to use and there are tons of great tutorials out there (see Adventure in Prolog for a particularly nice one from one of the authors of Amzi Prolog.) However, I see that I need to bundle a basic intro in AI::Prolog. In fact, I need to bundle all of these things:

  • Tutorial
  • Glossary
  • Cookbook

There's really no way that most programmers will jump on the bandwagon unless I make things really, really easy for them.

Side note: if you decide to work through the Adventure in Prolog tutorial linked to above and you are using SWI-Prolog, be aware that predicates that are retracted and asserted must be declared "dynamic" in SWI-Prolog. That just means shoving something like this at the top of your code:

:- dynamic here/1, location/2, have/1, turned_off/1, turned_on/1,
           door/3.

Kudos to the Amzi Prolog folks for making their book free! And after you actually learn Prolog, you can then read their other free book on Building Expert Systems in Prolog.