-
Notifications
You must be signed in to change notification settings - Fork 33
Home
JPL is a set of Java classes and C functions providing a bidirectional interface between Java and Prolog. JPL uses the Java Native Interface (JNI) to connect to a Prolog engine through the Prolog Foreign Language Interface (FLI). JPL is not a pure Java implementation of Prolog; it makes extensive use of native implementations of Prolog on supported platforms. The current version of JPL only works with SWI-Prolog.
In its current version, JPL supports the embedding of a Prolog engine within the Java VM as well as the embedding of a Java VM within Prolog, so that, for example, one could take advantage of the rich class structure of the Java environment from within Prolog.
JPL is designed in two layers, a low-level interface to the Prolog FLI and a high-level Java interface for the Java programmer who is not concerned with the details of the Prolog FLI. The low-level interface is provided for C programmers who may wish to port their C implementations which use the FLI to Java with minimal fuss.
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. Check an overview of its many versions here.
- Setup and Install
- General Notes.
- Installing JPL in Linux.
- Installing JPL in Linux.
- Installing JPL in MacOs.
- Developing JPL: how to set-up a development install for JPL.
- Guides and Tutorials:
- Getting Started: A Tutorial: a walkthrough how one would use JPL from Java.
- To provide a dynamic, bidirectional, interface between SWI-Prolog and Java runtimes, JPL offers two APIs:
- The Java API: this interface comprises public Java classes which support:
- constructing Java representations of Prolog terms and queries;
- calling queries within SWI-Prolog engines;
- retrieving (as Java representations of Prolog terms) any bindings created by a call;
- The Prolog API: this interface comprises Prolog library predicates which support:
- creating instances (objects) of Java classes (built-in and user-defined);
- calling methods of Java objects (and static methods of classes), perhaps returning values or object references
- getting and setting the values of fields of Java objects and classes.
- The Java API: this interface comprises public Java classes which support:
- Specific Information:
- Version History: a short overview of the various versions of JPL since its creation.
- Types of Queries: One shot vs Iterative: reference of the main high-level interface offered to access Prolog from Java.
- Multi Threaded Queries: how to use JPL with iterative queries and multi-threaded applications.
- Applications: projects known where JPL has been used.
- The main Github repository for JPL 7 (which this one is a fork of): https://github.com/SWI-Prolog/packages-jpl
- Documentation:
- The main current JPL 7 site documentation: https://jpl7.org/
- The documentation of SWI
library(jpl)
: http://www.swi-prolog.org/pldoc/man?section=jpl - A Wiki on JPL (including a Getting Started guide: https://github.com/ssardina-research/packages-jpl/wiki
- The old JPL 3.x documentation: http://www.swi-prolog.org/packages/jpl/
- The Java Native Interface programming framework.
JPL is released under the terms of the Simplified BSD License. See LICENSE file.