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 ]

Ovid (2709)

  (email not shown publicly)
AOL IM: ovidperl (Add Buddy, Send Message)

Stuff with the Perl Foundation. A couple of patches in the Perl core. A few CPAN modules. That about sums it up.

Journal of Ovid (2709)

Wednesday March 16, 2005
05:33 PM

My AI::Prolog Victim ... I Mean "Hero"

[ #23686 ]

You've possibly noticed lately that I've been rather quiet on the AI::Prolog front. This has been deliberate. Right now, adding new predicates and behavior is rather easy -- so long as I do not alter the grammar. Altering the grammar has proven rather difficult. Adding the unary cut operator was a pain. I gave up on binary infix operators and simply allowed math to be declared via predicates. This has led to the following ugliness:

% Instead of
%   X is (Z+2) * Y - 1.
% We have to use
is(X, minus(times(Y,plus(Z,2))1)).

Syntactic sugar is clearly needed here.

Enter Richard Freytag. He's taking a compiler class and volunteered to write a proper parser for AI::Prolog. You can read quite a bit about his work at the Prolog section of his Wiki. Specifically, the grammar section details quite a bit about the new grammar.

This should make extending AI::Prolog much easier. Infix operators should be coming soon. I also hope to add definite clause grammars, too, but that's almost impossible with the current ad hoc parser.

Thank you, Richard!

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.
  • What practical applications do you use Prolog or other AI for? Just curious.
    • Well, to be fair, I regret putting this into the AI namespace. Logic programming, while frequently used for AI, is not AI. Of course, the caveat here is that you can ask ten AI researches what AI is and get ten different answers.

      Possibly one of the most common uses of Prolog is expert systems. These are systems where you take the knowledge of a specialist in a field and encode it in such a way that your software can usually offer similar answers as a human expert. Medical diagnostic expert systems eve