in reply to Re^4: (why to use logic programming)
in thread Easy Text Adventures in Perl

The comparison to RegEx programming turned on a light bulb. Does that mean that (continuing the analogy) Prolog internals are as scary and byzantine (compared to its straightforward representation in code) as RegEx internals are to the straightforward (after you get the hang of them) representation of m// and its relatives?

Replies are listed 'Best First'.
Re^6: (why to use logic programming)
by Ovid (Cardinal) on Feb 14, 2005 at 17:36 UTC

    The internals of AI::Prolog might scare a few people, but generally, no, Prolog internals don't have to be as scary. The main issue (I think) with Perl's regex engine is that it is so powerful that people always thought it should do just a little bit more. So they made it do it. With hacks. Lots of 'em. For example, being able to embed code in regular expressions is natural because people really wanted to turn regular expressions into its own programming language. When you consider that we have perfectly good logic programming languages already out there ...

    Of course, if you mean how Prolog works "under the hood" without worrying too much about the actual implementation (i.e., what's the sequence of steps it takes to arrive at an answer), then I would say Prolog's internals are ridiculously straightforward.

    And gosh, why would I give Larry credit for posts as brilliant as TimToady's? ;)

    Cheers,
    Ovid

    New address of my CGI Course.