Advertisement

Backend logic of a bot?

Started by December 05, 2005 02:26 AM
0 comments, last by Yvanhoe 18 years, 11 months ago
I've been thinking for awhile now about a nice way to store facts about things, and the easiest way to get a bot to be able to infer data from known data. I was thinking of having a set of "objects". Each object has a number (for id), attributes, rules, and actions (scripts for that object). It also has a list of objects that inherits it. (yes, its strange, but its also pretty efficient). Inheritence works by filling in "defaults" for values for when we don't have specifics. ie. if i know that a wooden table is red, it sticks with that answer, rather then the derived answer of brown (as its made from wood, it inherits from it) If, however, you jave have a normal wooden table, it would answer that its brown, without needing to be told. For example, pick countries. We have a base object, "Country". It has the Size attribute of "Big". (so we know that a country is big, even if we don't know how big it is) We also have a "Location" attribute being "Earth". So, (translating queries into english, which my frontend bot will do) Which is bigger, belgium, or my big toe? Belgium (belgium inherits from country, so it inherited the size attribute of "Big", my big toe is an instance of big tow, which is an instance of toe, which has no size attribute, so its considered small). This was a question from last years (iirc) lobenner prize. You could also ask "Where is belgium", and it would answer "Earth" (which is right, just a little... vague.) A nice thing would be, for ex. to ask "Is a human warm blooded". It would come back yes, as a human is a mammal, and a mammal is warm blooded. Now, for a backend, does anybody see any problems? (i need to store facts, and draw inferences from them as quickly and efficiently as possible.) From, Nice coder
Click here to patch the mozilla IDN exploit, or click Here then type in Network.enableidn and set its value to false. Restart the browser for the patches to work.
I suppose the classical answer would be : look at prolog, that is the inference engine most AI researchers use (or used to use). But personally I find it lacks some convenient features.

Currently I am using CLIPS which has a good inference engine, whose behavior is maybe closer to what you need. It also provides a mean to implement class-like objects (but I never used these feature, I can't comment them). I like it partly because it provides python bindings which is my favorite language.

CLIPS:
http://www.ghg.net/clips/CLIPS.html
python bindings:
http://pyclips.sourceforge.net/

If you are using java or lisp, you may be interested in Algernon, which looked like an elegant inference engine to me.

Algernon for LISP:
http://www.cs.utexas.edu/users/qr/algy/
Algernon for Java:
http://algernon-j.sourceforge.net/

FLORA-2 is also a nice project, correcting some flaws of prolog, but it looked a bit too academic IMHO and lacked the usability of some other libs.

FLORA-2 Homepage
http://flora.sourceforge.net/florahome.php



I would recommend you to first give CLIPS a try. It's cool to see someone interested in the same topic as I, do not hesitate to PM me about your project, I would be glad to share informations!

This topic is closed to new replies.

Advertisement