Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Just one thing I'd like to say now, What about Who? :) Or, how to differentiate between declarations and queries.. Maybe you want to say that the user specified in the string $Who does in fact own gold.

So to answer your question about $Who syntax I started thinking about dbi-like placeholders, (e.g. :who) but Who can be multivalued, right? So a Set object or even a simple list might be good.

Somehow I got this funny idea of letting the underscore ("anyone"/"anything") symbol contribute dimensions to the answer of who gives what to Kudra, so $pg->gives(qw( _ _ kudra )) could give you a two-dimensional array, which works out to a hash %_ that says $_{who} = what. Is this useful? One problem I see besides speed is that of autovivification. If your structure didn't present autoviv. problems to the casual user you could even return an array of references to points in the knowledge base so they could easily modify it. I think I need to know a lot more about how Prolog is used to be intelligent about this.

I went back to the Haskell page when thinking about your question re embedded facts. I was interested to see that they mention SQL in the context of functional languages. And from their languages page I found an example of syntax in the Curry language which might be applicable.


In reply to Re: AI::Perlog -- Q&A by mattr
in thread 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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2024-04-19 16:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found