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)

Monday July 29, 2002
01:47 PM

AI::Perlog continued

[ #6729 ]

I actually got a lot done on AI::Perlog this weekend. It's brainwrenching, but it now works and, as a curious side-effect, is about twice as fast as it was for binary queries. The bug that I alluded to in a previous entry was the following:

my $pg = AI::Perlog->new;
$pg->add_fact( bizzle => qw/ foo bar baz / );
$pg->add_fact( bizzle => qw/ tic tac toe / );
$pg->bizzle( qw/ foo _ toe / ); # returns true

Clearly, that should not return true, but my original, naive implementation didn't check whether subsequent arguments were dependent on their predecessors. Now, it's just a simple query inside the module:

if ($self->{_arg_pos}{$predicate}[$pos1]{$arg1}[$pos2]{$arg2}) {

Ugh. That's nasty. On the other hand, it's lightning fast so long as you don't have so many facts that you eat up all of your memory. I'm becoming convinced that I am developing something that no one else is going to be able to work on, though the interface is fairly easy to use.

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.
  • You just can't go on like this, making us waiting for that beast....


    Please post it on CPAN fo we can all play with it...

    Moreover :
    • You'll got testers for free
    • You'll improve your karma
    • I'll vote for you if you ever decide to be a president.
    • Maybe I could help (Let me dream ;-)
    • Currently, I only have a modest module with no real functionality beyond what I have described. I would like to post it to the CPAN, but only after there's enough there for it to be useful. If you absolutely have to play with it (and stroke my little ego), you can download it from my site []. The documentation is minimal and I wouldn't even consider this alpha quality code.

      If you want to see what it does, you'll have to read the tests. If you want to see how it does it, you're crazy :) -- though it's not