Stuff with the Perl Foundation. A couple of patches in the Perl core. A few CPAN modules. That about sums it up.
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.
undef vs. '' (Score:1)
i usually find clarity using undef vs ''. for instance, i'd write
$pg->owns( undef, 'gold' );
instead of
$pg->owns( '', 'gold' );
then again, if i wanted a more 'prologgy' syntax, i think i'd create a constant with an undefined value, like
sub X () {}
## or use constant X => undef;
$pg->owns( X, 'gold' );
in fact, i think i like the Prolog-like syntax in my last example. that's probably what i'll find myself using.
hrmmm... what if X is an lvalue subroutine?
Re:undef vs. '' (Score:2)
I think you'll be relatively happy with this. In the auto-generated rules, if an argument is encountered with a false value, such as the empty string or undef, it's ignored (sort of). This means that if you prefer undef, you'll be perfectly free to use it.
As for $pg->owns( X, 'gold' );, I like the syntax, but forcing a person to predefine all of those constants means that it will be harder for them to generate queries on the fly.
use constant Who => '';