Stories
Slash Boxes
Comments
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)
http://mark-fisher.home.mindspring.com/

I am a Systems Engineer at Regenstrief Institute [regenstrief.org]. I also own Fisher's Creek Consulting [comcast.net].
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.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.