SwiProlog-C++ is an interface between Prolog and C++. It is a wrapper around the Foreign Language Interface of the free Prolog interpreter SWI-Prolog, striving to make it easy for C++ programmers to interface to Prolog. With SwiProlog-C++ you can either incorporate C++ parts in a Prolog program (as foreign predicates) or the Prolog engine in a C++ program (for a logic component).
Designing the interface turned out to be quite tricky. There is a huge semantic gap between the logic programming and the imperative worlds. SwiProlog-C++ acts as a kind of bridge. It reinterprets the Prolog concepts in imperative terms, and tries to integrate the Prolog constructs as smoothly as possible in the C++ language. More details are in the manual.
Thanks to Jan Wielemaker for his support with the SWI-Prolog internals.
2004-09-21 Development has frozen for two years. I'm not sure if I will ever completely finish it. Possibly I will switch to another logic programming system, when I begin to experiment with expert systems again. SwiProlog-C++ is unfinished, but useful. If you want to use it, expect that you will have to do some modifications (and send me a patch).
SwiProlog-C++ is in a proceded state, and as far as it goes, is tested and mostly documented. It also should be quite mature and usable, since a lot of thought and reconsideration has gone into it. However, some things remain to be done. And it hasn't been in much usage yet.
Null bytes in atoms and Prolog strings aren't considered.
The main() function must be in the C++ part of the program.
Converting terms to strings should be done in such a way, that the strings are valid Prolog expressions (like write(..., [quoted(true)])).
Exceptions should conform to the ISO standard.
The documentation of how to write foreign predicates has not yet been written. See the test program for some examples.
The current version is 0.1.0, released 2002-01-14.
swiprolog-c++-0.1.0.tar.gz (69 kB)
Here is an online version of the manual.
Volker Wysk <firstname.lastname@example.org>