PySWIP 0.2.2

PySWIP is a Python/SWI-Prolog bridge that enables you to query in prolog using SWI-Prolog in your Python programs.
PySWIP application is a Python/SWI-Prolog bridge that enables you to query in prolog using SWI-Prolog in your Python programs.

Requirements:

· Python 2.3 and higher (most probably other versions will also work).
· ctypes 0.9.9.9 and higher (most probably other versions will also work).
· SWI-Prolog 5.6.x and higher(most probably other versions will also work).
· libpl as a shared library.
· Tested only on Linux, should be working for other POSIX and Win32.

Installation:

PySWIP should work on Win32 systems, but this isn't tested. The instructions below are for POSIX systems.

+ First of all, you need to have SWI-Prolog's libpl as a shared library, e.g., ``libpl.so``, ``libpl.so.5.6.34``, etc. SWI-Prolog isn't compiled by default to enable shared library, so you need to compile it yourself with shared library production enabled. Please see ``INSTALL`` of this package.

+ Install a recent version of `ctypes` if you don't have it already (if you have Python 2.5 you don't need to install it seperately).

+ PySWIP supports distutils, so after the previous steps are satisfied, just do: `python setup.py install`.

+ To test, do the following at the shell::

$ python
[ ... python info ...]
>>> from pyswip.util import PrologRunner
>>> prolog = PrologRunner()
>>> prolog.query("assertz(father(michael,john))")
[{}]

If you get an error, such as "libpl (shared) not found." or "FATAL ERROR: Resource not found" be sure you have installed SWI-Prolog as a share library. Check your default library directory (usually ``/usr/lib``) for ``libpl.so``.

What's New in This Release:

· PySWIP won't rely on the (id of the) functor handle of "=/2".
· A patch to allow PySWIP to work on Mac OS X was incorporated.

last updated on:
February 8th, 2008, 12:17 GMT
price:
FREE!
developed by:
Yuce Tekol
homepage:
code.google.com
license type:
GPL (GNU General Public License) 
category:
ROOT \ Science and Engineering \ Artificial Intelligence

FREE!

In a hurry? Add it to your Download Basket!

user rating 21

3.4/5
 

0/5

Add your review!

SUBMIT