Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: AI::Perlog -- Q&A

by mattr (Curate)
on Aug 05, 2002 at 13:24 UTC ( #187652=note: print w/replies, xml ) Need Help??

in reply to AI::Perlog -- Q&A
in thread AI::Perlog -- Simple implementation

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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://187652]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2018-05-20 21:52 GMT
Find Nodes?
    Voting Booth?