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.
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. The current version of JPL only works with SWI-Prolog.
JPL has been integrated into the full SWI-Prolog distribution starting with version 5.4.x and is included in the binary packages provided by swi-prolog.org. Binary packages provided by 3rd parties may differ, not providing JPL or providing it as a separate package.
The objectives of JPL are to:
.. while also aim for:
JPL is released under the terms of the Simplified BSD License. See LICENSE file.
$ claude mcp add packages-jpl \
-- python -m otcore.mcp_server <graph>