[an error occurred while processing this directive]


Ernest Friedman-Hill
(C) 1995 Sandia National Laboratories


A set of external commands for the CLIPS expert system shell implementing the KQML API (KAPI). KQML, the Knowledge Query and Manipulation Language, and in particular the KAPI interface, are together constitute a wonderful, open, and best of all portable agent architecture. The Lockheed/Stanford C-language KAPI, on which this is built, uses httpd's to provide an Agent Name Service (ANS); the agent network is then very flat indeed.

This version of the CLIPS API to KQML skimps on some aspects of error handling - those routines that return strings can't return errors too. Also, memory leaks should be pretty bad, because I haven't thought through how to reconcile the memory-management philosophies of the two libraries I'm using. Oh well, maybe in the next version...

I wrote this for UNIX - after all, the C KAPI is written for UNIX. It should be TOO hard to port the C KAPI and this code to PCs or Macs, though, if you can get a sockets package. Don't ask me about PC ports, but I MIGHT help you with a Mac port - at least give a little advice.

To learn to use this API, first read the documentation for the Lockheed/Stanford C-language KAPI, then look at the source below to see how the clips functions differ (slightly) fromm the KAPI functions. If any functions you need are missing, It should be easy to add them! If you make any big changes or write a new version, please send me a copy, OK? To install this API, just use the function UserFunctions from this file when linking CLIPS; the API functions will then be installed at runtime. If you have compiled CLIPS into a library called libclips.a containing everything but the UserFunctions function, you can use my Makefile. You also need to link with libkapi.a from the Stanford/ Lockheed KAPI (get this and build it first! - you can find it by WWW browsing starting from http://retriever.cs.umbc.edu/kqml/ . This is the place to learn about KQML, too.

To use the sample CLIPS agent, build "kapiclips" as described above, then run "kasey" in the background ("kasey &"). Then run the sample agent "client" that comes with the C KAPI - you should be able to send the "test", "time", "die" and "count" messages to kasey and get a response.

I'm sorry this isn't more polished - I just wrote it for myself. If anybody writes some improvements, I'll be glad to incorporate them (with due credit) and re-release the package.

Disclaimer: don't shoot me, I'm just the piano player. This is "FredWare" - If you don't like it, write a better one! Don't use this code as a style guide for writing CLIPS external functions - I'm sure you could do better. If you DO do better, please send me a copy! [an error occurred while processing this directive]