PyCLIPS - expert systems shell in Python

PyCLIPS embeds the CLIPS "expert systems shell" in Python.

It appears to be a set of Python wrappers for the CLIPS C modules themselves, rather than a complete reimplementation in Python. In fact, the CLIPS engine runs in its own memory space and allocates its own objects. However, the integration with the engine is extensive enough to be of interest here, because some of the challenges it poses are similar to those involved in embedding one language in another (e.g. finding a good fit between Python syntax and the protocol used to communicate with the engine).

More details can be found in the manual, downloadable from the project's sourceforge site.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.


Is the manual available for online reading without having to download the whole package?


Yes, you can get it from the downloads page on sourceforge as a separate .pdf.


Of related interest might be TixClips, which allows CLIPS to be driven from Tcl. This is based on a SWIG generated wrapper. Is the PyClips version also SWIG generated?

TixClips / SWIG

I think part of the motivation for PyCLIPS is to enable development of GUI applications (like the TixClips IDE) for CLIPS work.

I would be surprised if SWIG were not used to generated the basic interface to the C modules, as it seems to be pretty standard with Python these days. However, I didn't find anything in the manual about how the basic wrapper was created. It does look as if PyCLIPS is more than just a low-level wrapper for CLIPS - it tries to model the domain of CLIPS "constructs" by mapping it to a set of Python proxies that shadow CLIPS objects and forward messages to them.

SWIG or not?


I'm the owner of the PyCLIPS project and just wanted to quickly(?) answer some of these questions... I'm glad to see that there is some interest about this module.

About SWIG, I'm not a SWIG user, so it wouldn't be easy for me to setup a SWIG interface for CLIPS. Also, CLIPS only exposes just part of its functions to the user - and so I tried to do almost the same with the Python low-level (C submodule) interface: in this way, the low-level functions are almost one-to-one mapped to the ones explained in the CLIPS Advanced Programming Guide. Moreover, most of the "items" that the CLIPS API accepts are passed in as obscured void pointers... SWIG would probably find difficult to "translate" these objects to their Python counterparts. So the short answer is: no, I did not use SWIG.

As of what Dominic says, well, one of the primary goals is to allow to use CLIPS in a graphical Python based infrastructure. Python however has also other points of strength, and one of the most appreciated is the readability: users of imperative languages that just need an inference engine like CLIPS but find its "COOL" feature, as well as other constructs, difficult to use (as I do, for instance) can delegate at least part of the imperative section of an application to Python, while letting CLIPS deal with knowledge bases and facts.

I hope that there will be other interested people, and maybe someone joining the project as well.

Sorry for the lack of conciseness... Cheers,