< back to notes

prolog notes

Prolog(Wikipedia) (Programmation en logigue) is a programming language based around predicate logic. I've considered seriously learning it.

Why Prolog is cool

TODO wax lyrical about the joys of Prolog.

Implementations

There's GNU Prolog (gprolog), SWI Prolog (swi-prolog), and Scryer Prolog (scryer-prolog), and a bunch of proprietary versions too. Scryer Prolog is probably the best one.

A quick demo of Prolog

TODO provide demo code.

Once you have your prolog file, run scryer-prolog file.pl. This will give you a prompt.

You can type human(X). to query for humans. The interpreter will tell you if the statement can be true, and if it can be true, give an example. You can get it to give all the solutions but I don't remember how.

The Green Goose trans WP:BOLD Hosted on Neocities Edited with Vim - Improved & Free - I love my editor Enter the Void Anti-fascism The Mod Archive