Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
"be consistent"
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

There has been a bit of interest expressed in my AI::Perlog implementation, including requests for what code I have written so far. While I do not intend to upload anything to the CPAN as I consider this code to be pre-alpha quality, I figured I may as well honor the request and let you download the code. The documentation is spotty, but the tests pass and the should give an indication of what's working and what's not. Currently, the only thing I have implemented is boolean queries on facts.

use AI::Perlog; my $pg = AI::Perlog->new; $pg->add_fact( gives => qw/ Ovid money kudra / ); $pg->add_fact( gives => qw/ grep grief Ovid / ); # an underscore is synonymous with the empty string or undef print "y\n" if $pg->gives( qw/ _ _ kudra / ); # does anyone give + anything to kudra? print "y\n" if $pg->gives( '', '', 'kudra' ); # same thing print "y\n" if $pg->gives( undef, undef, 'kudra' ); # same thing print "y\n" if $pg->gives( qw/ grep _ Ovid / ); # does grep give a +nything to Ovid? print "n\n" if ! $pg->gives( qw/ Ovid _ grep / ); # Returns false. O +vid gives nothing to grep

Needless to say, it's just a toy right now, but I hope to have the first stab at unification done later this week, at which point this might actually have some limited utility. Currently, the code generates a spurious warning under Cygwin, but runs clean on Windows 2000 and RH 7.2 (both running 5.6.1).

Cheers,
Ovid

Update: You can read about some of the future plans at use.perl.

Update 2: Also be aware that this beast eats memory for breakfast. If anyone can come up with a less memory intestive solution that doesn't sacrifice performance, that would be great. Also, I intend to eventually port much of this to Inline::C, so the simpler the data structures, the better.

Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.


In reply to AI::Perlog -- Simple implementation by Ovid

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others chilling in the Monastery: (9)
    As of 2014-04-19 03:21 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      April first is:







      Results (475 votes), past polls