Picstus is a two-way interface between Python and Sicstus Prolog. It allows using Sicstus from Python and vice versa, where one language is seen as a module of another. Programs in the two languages can even mutually call one another to an arbitrary depth. The learn more, read the online documentation.
The module hasn't been rigorously tested; precise and easily replicable bug reports are welcome.
Picstus is a free software which you may redistribute and/or modify under the GPL licence.
Picstus requires Python and Sicstus (or at least their crucial parts). I run it on Windows, but it shouldn't be difficult to port it to Linux. It is not picky about the version of Python. Regarding Sicstus, version 3.8 won't work and 3.12 does; I have no idea about the versions in between.
The Windows binary file provided on this page is compiled and linked against Python 2.3 and Sicstus 3.12. To work with another version of Python, the module needs to be rebuild. I used Visual C++ 6.0, but other compilers should work as well (possibly with minor adjustments). I have no idea about the constancy of Sicstus API, so I'd appreciate information whether rebuilding is needed for different versions Sicstus, too.
picstus.pygoes to the Python's subdirectory
python.dllgo to the Sicstus' subdirectory
libraryand the documentation goes in the center of your desktop. You will also need to check whether the Sicstus installer has set environment variable
SP_PATHto contain the Sicstus' base directory; set it yourself if needed. If Picstus complains that it cannot find sprt312.dll, add its directory to
python_glue.c, link it with
sprt312.lib) and name the resulting file
python.soon Linux). Then copy the files as described above. Project files for VS 6.0 are provided, but need to be modified to link with the right versions.
includewith the replacement provided in the archive. There should be a way around this, but the corresponding
#defines are not described in the Sicstus API documentation.