-
Notifications
You must be signed in to change notification settings - Fork 33
Home
JPL is a "library using the SWI-Prolog foreign interface and the Java jni interface providing a bidirectional interface between Java and Prolog that can be used to embed Prolog in Java as well as for embedding Java in Prolog. In both setups it provides a reentrant bidirectional interface."
As far as I can tell, JPL has been developed originally by Paul Singleton and maintained by him and Jan Wielemaker (and possibly others?).
JPL has been integrated into the full SWI-Prolog distribution starting with version 5.4.x, including binaries for MS-Windows and a Linux RPM.
There was an initial JPL 3.x, now discontinued, which then evolved into the current JPL 7.4.
The objectives of JPL are to:
- enable Prolog applications to exploit any Java classes, instances, methods etc. (without requiring any wrappers, metadata etc. to be set up first);
- enable Java applications to manipulate any Standard Prolog libraries, predicates, etc. (without requiring any wrappers, metadata etc. to be set up first);
- enable hybrid Prolog+Java applications to be designed and implemented so as to take best advantage of both language systems, and to be testable, debuggable, maintainable.
- The main current JPL 7 site: <https://jpl7.org/)
- It includes the Java API (to access Prolog from Java) and the Prolog API (to access Java from Prolog).
- The main Github repository for JPL 7 (which this one is a fork of): https://github.com/SWI-Prolog/packages-jpl
- The documentation of SWI
library(jpl)
: http://www.swi-prolog.org/pldoc/man?section=jpl - The old JPL 3.x documentation: http://www.swi-prolog.org/packages/jpl/
I have forked the main JPL Github repo mainly for two reasons:
- To fix issue #9 that preclude Java to perform queries on specific SWI modules.
- This issue has been resoled and merged into the master branch of JPL in pull request #10 and hopefully will be available in SWI 7.7.X release.
- To expose JPL repo as a Maven repo, so it can be obtained automatically as a dependency via JitPack.
More generally, I am using SWI+JPL to provide Prolog knowledgebase management to SARL agent systems. To do so, I have developed a SARL Capacity and Skill SARL-PROLOG-CAP that SARL agents can use to access SWI Prolog knowledgbases.
One example of such use is the SARL Agent System to play the 2017 Multi-Agent Agents in City game. A base sytem, showcasing how to use SWI Prolog via JPL, can be obtained in this repo.