Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Mark Leighton Fisher (4252)

Mark Leighton Fisher
  (email not shown publicly)

I am a Systems Engineer at Regenstrief Institute []. I also own Fisher's Creek Consulting [].
Friday May 18, 2007
12:04 PM

Prolog and Bogo-Sort

[ #33306 ]

An amusing note from Alan Kay's Re-inventing Programming NSF grant:

A simple example is that it is possible to define sorting in Prolog as a permutation of the inputs that obey a particular pairwise relationship. This is really simple and will work, but Prolog has no recourse but to generate all possible permutations of the input until one is found that satisfies the predicate.

Using this sorting algorithm in Prolog is only one step above Bogo-Sort. (It is one step above Bogo-Sort, as this sort never repeats a permutation, while Bogo-Sort might repeat any permutation depending on the randomization implementation.)

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.