Sunday, February 20, 2011

Installing Prolog on Puppy Linux, howto

From the book, Seven Languages in Seven Weeks, I notice a trend toward specialty languages being glued together by Ruby, or any scripting language. We can use the right tool for the right purpose instead of one "sledgehammer" only! Some examples are Prolog for rules (or logic) and Io (w/s "io language") for parsing.

Today I installed the package SWI Prolog, useful for developing in Prolog, the logic computer programming language, on a computer running Puppy Linux (Quirky Retro 1.2).

Here's how I did it:

o From, download two 'lenny' packages:


o In the ROX-Filer file manager, click their icons to install them.

o Create a file, ~/.plrc containing the single line:

:- set_prolog_flag(editor,'geany').

o Within ~/my-documents, create and change to the directory, 'prolog'.

o Associate the file extension, '.pl' with SWI Prolog. Create a file like ''. Right-click it in ROX-Filer and edit the run command to be:

urxvt -e swipl -s "$@"

Now you can click on a file with extension '.pl' and it will be loaded by the interpreter.

To make changes, type, 'edit.'. The interpreter will re-read the file when you close the editor. Type 'halt.' to end the session.

One example to get you started: if you type 'alice.' into a file, and in the interpreter type 'alice.', it will respond with, 'true'.

For further information, the SWI Prolog user manual is available off-line at:


Their FAQ is:

Some tutorials appropriate to beginners:

Copyright (c) 2011 Mark D. Blackwell.