PySWIP application is a Python/SWI-Prolog bridge that enables you to query in prolog using SWI-Prolog in your Python programs.
· Ключевые особенности и характеристики PySWIP 0.1.3
Не определены
· Ограничения PySWIP 0.1.3
Ограничения не определены
· Специальные требования PySWIP 0.1.3
· 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``.
· История версий и изменений PySWIP
Версия: 0.1.3
· This release adds a new module to use SWI-Prolog FFI more easily.
· Starting with this release, it is possible to register a Python function as a Prolog predicate through SWI-Prolog's FFI.
· The core module has been improved.
· A few example programs have been added to demonstrate registering foreign functions, including a "Towers of Hanoi" solver.
· Описание и дополнения от редакторов и пользователей сайта