🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Knowledge Based Agent

Started by
7 comments, last by Kleon 21 years, 8 months ago
Hello, I''d like to know how you guys implement knowledge based agent using c++ and the first order logic system for reasoning. I''m still new in this field and the book (" AI: A Modern Approach ") doesn''t say much about the implementation. Thanks in advance for your help guys!
Advertisement
If I were you I''d look into Prolog first - to try out the knowledge-based reasoning and stuff (I''ve read the book you mentioned) I''m sure there are free Prolog implementations available that you can link with C++, at a later stage

-----------------------
Always down - Never out
-----------------------Always down - Never out
A basic C++ implementation of a first order predicate logic would require you to write a script parser to decipher statements written in your logic and manipulate them according to the rules of your logic.

You''d then need to implement a resolution operator that can update your knowledge base of facts (database) with new information when it arrives.

You should be able to find software for research purposes online. If you want to use it in a game your writing, then you might want to right your own. As to how to go about doing this... I cannot think of any publications that explicitly explain implementations of FOLs. You should be able to find some journal and conference proceeding articles that cover some of hte broader ideas though.

If you get really stuck, I can ask one of my colleagues who''s fairly knowlegeable in this area.

Cheers,

Timkin

Well, i''ve searched the internet and found the implementations of SWI-Prolog and Amzi! Prolog Server API. Is it enough to use the API to build a smart agent in a game or for expert system? I''m eager to see some examples of the script parser and resolution implementations you mentioned. Could you show it?. Thanks
Thankfully I''ve never needed to write my own parser or resolution code... I''ve only had to teach the theory (I''m sure I could write the code if I needed to, it''s just I''ve never needed to!)! These days, there aren''t as many AI people working on first order logics as there used to be... it''s mainly philosophers! Sorry I cannot provide any code... of course I''d be happy to help you understand any of the theory so that you can build your own implementation.

Cheers,

Timkin

I checked out Amzi and SWI - SWI seems to have integration with C++, and Amzi probably has something similar.

SWI is Free, though, so that might be the better option, unless you just want to evaluate it on your own.

If C++ is not a must, there is something called Jess available if you''re programming in Java (Java Expert System Shell), which seems to allow you to do a lot of stuff.

At my job (www.intologic.com) we do a lot of logic programming (in Prolog). We don''t link with C++, but instead use a VB-interface available with Sicstus Prolog.

Actually, I think that logic programming is seeing a ''new dawn'', much depending on the improved performance of compilers, processor speed and connectivity to other languages. -''Declarative'' descriptions are becoming more popular in many cases - companies talk about ''business rules'' etc.

We''re making a tool that allows you to Draw logic rules and then compile them as Prolog of different styles. Check it out on our homepage if you''re into that kind of stuff

Oops! Our site is in Swedish, only - so here''s a direct link:
http://www.intologic.com/home/MOVIS.html

-----------------------
Always down - Never out
-----------------------Always down - Never out
toblo: What applications are you using logic programming for?
The system is used at certain divisions of Ericsson to model their product configuration models - those are basically a specialized kind of Prolog objects that are run in a configurator.

Even if I do say so myself; it works great - and the Ericsson people are pretty extatic about getting rid of the droves of consultants that used to be required for hand-coding this stuff.

Configuration (in this context): Some user enters a set of conditions/requirements on a product, and a configurator then figures out what (products) is needed to fulfill these demands, and sees to it that a complete 'solution' has everything it needs to function.

Classic example when running a configuration-model for building a PC
* You tell the configurator you want to use it for CAD-work
* It calculates that you will probably need X megs of memory
* It selects the required size of the memory modules, and the correct amount of them to fill the need


-----------------------
Always down - Never out

[edited by - toblo on October 25, 2002 8:07:46 AM]
-----------------------Always down - Never out
''Tis a pity I cannot read Swedish! That sounds like a very interesting product!

This topic is closed to new replies.

Advertisement