My AI::Perlog is coming along nicely. It's not posted anywhere yet, but maybe I'll have something in about a week? I have boolean responses working fairly well. I can do this:
my $pg = AI::Perlog->new;
$pg->add_fact( owns => qw/ Ovid gold / );
$pg->add_fact( owns => qw/ Yoda grep / );
$pg->owns( 'Ovid', 'gold' ); # returns true
$pg->owns( 'Yoda', 'gold' ); # returns false
$pg->owns( '', 'gold' ); # Does *anyone* own gold? Returns true
Actually, while the above facts work, there is a bug that can create false positives with complex facts. I know what's causing it but the data structure that I need to create to get around it is pretty large and for serious AI systems with millions of facts, it will eat up all of the system's memory. However, I've made the classic "space for time" trade-off and, as a result, this seems to run reasonably fast.
Fixing the first bug has the nice side effect of tremendously simplifying the unification problem, but that's still going to be a tricky one. I need to do some more research into exactly how Prolog handles some of these issues.
One thing I've noticed is that while my data structures are large, they're not complicated (well, to a Perl programmer they're not
Meanwhile, I have paying work to attend to. Sigh. The warm beauty of intellectualism shattered by the cold reality of life.