Questions tagged [jpl]

JPL is a set of Java classes and C functions providing an interface between Java and Prolog.

JPL is a set of Java classes and C functions providing an 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), which is more or less in the process of being standardized in various implementations of Prolog. JPL is not a pure Java implementation of Prolog; it makes extensive use of native implementations of Prolog on supported platforms.

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. http://www.swi-prolog.org/packages/jpl/java_api/index.html

79 questions
3
votes
2 answers

Querying Prolog variables with JPL

I want to make a query to use Prolog in java through JPL, I read the documentation (http://www.swi-prolog.org/packages/jpl/java_api/getting_started.html) The prolog predicates are these: child_of(joe, ralf). child_of(mary, joe). child_of(steve,…
Naty Bizz
  • 2,262
  • 6
  • 33
  • 52
3
votes
1 answer

Using JPL (Java + Prolog) in a Java EE web application

I would like to develop a Java EE web application that requires Prolog, via JPL, for certain search related tasks. The web application will be deployed in the JBoss application server. The Prolog engine can be either YAP or SWI (afaik the only…
Sergio
  • 8,532
  • 11
  • 52
  • 94
2
votes
1 answer

Putting SWI-Prolog's JPL interface to work

I want to use JPL to create a graphic interface to my project, so I went and searched a code example to start working with, I downloaded the code but when I run it, it shows the following message: ERROR: c:/program files/swipl/library/jpl.pl:4243: …
2
votes
0 answers

Create Prolog knowledge base in Java using JPL

I'm trying to wrap my head around the Java-Prolog interface library JPL. I can find plenty of examples where people query Prolog from Java for information from the knowledge base, but no examples where the knowledge base is constructed dynamically…
Dylan Knowles
  • 2,726
  • 1
  • 26
  • 52
2
votes
0 answers

Docker image of swipl does not contain jpl

I developed a web Application using Jhipster(Spring + Angular). This application utilizes Prolog JPL interface. While executing it from my machine works, I want to Dockerize this application. Jhipster provides a Dockerfile that I can build and run…
Antifa
  • 377
  • 1
  • 4
  • 14
2
votes
1 answer

How can I use a GUI debugger on the Prolog code that runs inside a Java app through JPL?

I'm developing a Java+Prolog application through the JPL bridge. The main application is in Java and it calls the Prolog code using Query.oneSolution("doPrologStuff(here)") I tried running the GUI debugger/tracer using Query.hasSolution("gtrace")…
Daniel
  • 2,728
  • 3
  • 21
  • 33
2
votes
0 answers

Error using a function of jpl API when running in a phone with android studio

I am linking a game developed in prolog to an android app in android studio whith jpl (http://jpl7.org/740/doc/index.html) and an error occurs when I use a function of the library jpl7. The error message E/AndroidRuntime: FATAL EXCEPTION: main …
2
votes
1 answer

jpl library won't work with java maven project

I have an issue using jpl library within my project. The weird thing is that on an old project, that was an ordinary Java application, worked fine with jpl library by following this solution JPL/SWI Prolog configuration failure. The solution…
Mkur
  • 46
  • 6
2
votes
1 answer

How to use JPL (bidirectional Java/Prolog interface) on Linux?

I'm interested in embedding a Prolog interpreter in Java. One option is using JPL, but the download links on the JPL site are broken, and the installation page mentions a jpl.zip that I can't find. I downloaded SWI-Prolog which seems to include JPL…
lemmy njaria
  • 81
  • 1
  • 5
  • 13
2
votes
0 answers

pass parameters from java to Prolog

I have the code below in Prolog and I made a GUI in Java. In this gui I have some checkboxes with symptoms and I want to pass only clicked symptoms in the list of findDiseases predicate. Can anyone tell me how I can do that? The only thing that I…
Debbie Mp
  • 163
  • 1
  • 11
2
votes
1 answer

Failing to redirect standard output in Java

I am attempting to redirect the console output of a Java library to a JTextArea in my application. The library in question is JPL, a bridge between Java and SWI-Prolog (though I doubt this has much relevance conceptually). Here is my code: …
Epicurus
  • 2,103
  • 7
  • 29
  • 39
2
votes
4 answers

JPL/SWI Prolog configuration failure

I'm configuring the JPL right now, and wanna work with swi-prolog using java. I downloaded the newest stable version of SWI-Prolog, which is 6.2.0, and installed in D:\swipl First, I added the following path to the PATH virable: D:\swipl\bin, which…
user1649263
  • 69
  • 1
  • 1
  • 5
1
vote
1 answer

Showing console output of a third party JNI library in an eclipse plugin

I am using JPL, a JNI library for interacting with Prolog from Java. In my application it is important to see the output that the Prolog engine generates (for example: when loading Prolog files, executing unit tests, etc). This is happening when I…
Sergio
  • 8,532
  • 11
  • 52
  • 94
1
vote
1 answer

accessing prolog list term

I've been using jpl for calling prolog from java. I'm using the following code in java to get the value of X from prolog. String t4 = "myNumber(X)"; Query q4 = new Query(t4); System.out.println( "first solution of " + t4 + ": X = " +…
Venkata
  • 31
  • 2
  • 7
1
vote
1 answer

Can't get Java to find JPL library on Mac OS - "no jpl on java.library.path"

I've been desperately trying to get JPL (Java/SWI-Prolog interface) to work on Mac using those instructions: https://ssardina-research.github.io/packages-jpl/DeploymentMacos I have fixed all the dependencies link on libjpl.dylip, both for the one in…