MCPcopy Index your code
hub / github.com/SWI-Prolog/packages-jpl

github.com/SWI-Prolog/packages-jpl @V10.1.11

Chat with this repo
repository ↗ · DeepWiki ↗ · release V10.1.11 ↗ · + Follow
923 symbols 2,615 edges 82 files 252 documented · 27%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

JPL - Java <-> SWI Prolog Interface

Java CI with Maven

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.

Further documentation

  • Overview documentation is maintained at this JPL Web Page, which subsumes the Wiki in this repo.
  • The Prolog API reference is provided from the SWI-Prolog manual.

OBJECTIVES

The objectives of JPL are to:

  1. enable Prolog applications to exploit any Java classes, instances, methods etc. (without requiring any wrappers, metadata etc. to be set up first);
  2. enable Java applications to manipulate any Standard Prolog libraries, predicates, etc. (without requiring any wrappers, metadata etc. to be set up first); and
  3. 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.

.. while also aim for:

  • minimum impact deployability: runtime support for Prolog+Java apps must be a position-independent, self-sufficient filestore tree, requiring no changes to registries, system libraries, system configuration files etc.
  • minimum dependency deployability: as with JVMs, the Prolog+Java runtime support must depend upon nothing which cannot be taken for granted in healthy OS installations
  • minimum vulnerability deployability: the Prolog+Java runtime support must be immune to legitimate variations in its environment (PATH settings, other applications and libraries including other Prolog+Java apps, etc.)

LICENSE

JPL is released under the terms of the Simplified BSD License. See LICENSE file.

Core symbols most depended-on inside this repo

oneSolution
called by 104
src/main/java/org/jpl7/Query.java
hasSolution
called by 92
src/main/java/org/jpl7/Query.java
arg
called by 92
src/main/java/org/jpl7/Term.java
name
called by 51
src/main/java/org/jpl7/Term.java
equals
called by 50
src/main/java/org/jpl7/JRef.java
jni_term_to_jfieldID
called by 36
src/main/c/jpl.c
jni_term_to_jclass
called by 36
src/main/c/jpl.c
textToTerm
called by 34
src/main/java/org/jpl7/Term.java

Shape

Method 632
Function 203
Class 88

Languages

Java78%
C22%
TypeScript1%

Modules by API surface

src/main/c/jpl.c204 symbols
src/main/java/org/jpl7/Term.java65 symbols
src/main/java/org/jpl7/fli/Prolog.java57 symbols
src/test/java/org/jpl7/Test.java32 symbols
src/main/java/org/jpl7/Query.java28 symbols
src/test/java/org/jpl7/junit/Test_List.java26 symbols
src/main/java/org/jpl7/JPL.java22 symbols
src/examples/java/time/Time.java21 symbols
src/test/java/org/jpl7/junit/Tests.java20 symbols
src/test/java/org/jpl7/junit/Test_Variables.java20 symbols
src/examples/java/test/Test.java20 symbols
src/test/java/org/jpl7/junit/Test_Types.java19 symbols

For agents

$ claude mcp add packages-jpl \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page