Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

comment on

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

Your points are perfectly correct. I have no intention of simply being able to add facts to the database and forcing the end user to write the rules by hand. This was merely a "proof of concept" to test some ideas. I'm actually preparing a much longer write-up with the intention of starting some useful discussion.

Auto-generating some of the rules will be a must. If I have the following facts:

drinks(lemming,scotch). drinks(ovid,scotch). drinks(grep,guiness).

I should be able to auto-generate queries like the following:

?- drinks(ovid,scotch). yes

And with unification (associating variables with items):

?- drinks(grep,Drink). Drink=guiness yes ?- drinks(Who,scotch). Who=lemming Who=ovid yes

Those should be fairly easy to auto-generate. However, some rules have to be crafted by hand:

steals(Perp,Item) :- thief(Perp), owns(Victim,Item), Valuable(Item).

The problem there will be to create an easy to use (and parse!) syntax that supports this. You mention that my facts and rules are stored different ways and I like your example, but I'll have to play with it to see if that's what I really want.

You also bring up the tail-recursion issue (tail recursion, for those who are wondering, is where the return value of a recursive call returns directly to the caller rather than propogating back through the call stack). You stated that machines today have "millions of times more storage", thus suggesting that this might not be an issue. I think it is an issue because full-blown AI systems can store millions of facts and being able to take advantage of any optimizations will be critical, as Perl is not well-suited to this task. That's an issue I think I can put off for later, though.

In the meantime, I'll have a fairly detailed post later this evening outlining some of the issues that I need to tackle before I can really begin serious work on this.


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

In reply to Re: Re: AI in Perl - proof of concept by Ovid
in thread AI in Perl - proof of concept by Ovid

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!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • 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
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            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?

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

    How do I use this? | Other CB clients
    Other Users?
    Others about the Monastery: (6)
    As of 2019-07-22 08:06 GMT
    Find Nodes?
      Voting Booth?
      If you were the first to set foot on the Moon, what would be your epigram?

      Results (11 votes). Check out past polls.