in reply to Sorting, given only comparisions

For anyone who read What's the big deal? and was disappointed that Logical Programming took a backseat to the other three branches of programming, this current question is framed in a very Logical Programming kind of way.

First we list some "Truths" about our world, then we attempt to derive the truthfulness of other relationships, based on the principals of logical reasoning.

The dearth of answers here shows that perl doesn't intuitively behave this way. For logical programming languages, this problem is trivial (could probably be the first example in the intro book), because they are designed to solve exactly this type of problem.

Sorry I didn't address the actual question.... perhaps someting like Prolog is better suited for this. (Though I'm sure some clever person will work some sort of perl solution out...)

-Blake

Replies are listed 'Best First'.
Re: Re: Sorting, given only comparisions
by Anonymous Monk on Sep 08, 2001 at 18:59 UTC
    Hi Blakem,
    Appreciate your thoughts and agree with your perception:

    Not to disappoint you, but I haven't considered prolog for this task, as the entire system is written in perl.
    What this means that it gives us an opportunity to mimic prolog/logical programming via perl modules and operator overloading.

    First we list some "Truths" about our world, then we attempt to derive the truthfulness of other relationships, based on the principals of logical reasoning.
    I defintely liked your verbal derivation of the problem. What I have mentioned is just a simple ranking problem. Your idea could be applied in general and we can prepare a complex data set to come up with the complicated query.
    More pointers in this direction, if you have done some research, would be definitely helpful.

      While I haven't tried it myself, princepawn has a module by the name of AI::Proplog that might be what you're looking for. My reading of the POD is that it's still somewhat preliminary, but it seems to be a start in the direction you're looking.



      If God had meant us to fly, he would *never* have given us the railroads.
          --Michael Flanders