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
1
vote
0 answers

Appropriate jpl.jar library version

import java.util.Hashtable; import jpl.*; import jpl.Query; public class Family { public static void main( String argv[] ) { String t1 = "consult('C:/Users/Kostas/Desktop/family.pl')"; Query q1 = new Query(t1); …
1
vote
0 answers

JPL Prolog/JAVA connection

I want to consult my Prolog project from the eclipse console. I Installed: SWI PROLOG 32 bit and ECLIPSE LUNA 32 bit About environment system variable... I added SWI_HOME_DIR with my path of swi prolog, that is C:\Program Files(x86)\swipl; I added…
1
vote
1 answer

jpl.PrologException: existence_error

I am trying to understand how to use JPL. For this purpose I copied one of it's tests from the doc section (swipl\doc\packages\examples\jpl\java\Time) to eclipse and tried to run it. If I double click the batch file, all runs well. If I run the Time…
Ido Barash
  • 4,856
  • 11
  • 41
  • 78
1
vote
0 answers

JPL and CLPFD in SWI-Prolog

I need to send in CLPFD Queries from JPL to SWI-Prolog and receive their executed output into a Java Program. PFA the Code I am using from Java Side using JPL. Query q = new Query("use_module(library(clpfd))."); Variable X = new…
1
vote
3 answers

to load the same prolog file into different modules in jpl

I am trying to use jpl to load the same swipl file into different modules. The reason I had to do this is because I want to have a module that I can assert new predicates to, while leave the other untouched. Problem is swipl seems forbidding…
Sheng
  • 1,697
  • 4
  • 19
  • 33
1
vote
1 answer

how to consult file as a module in jpl

I am trying to consult Prolog file as a module, since jpl does not support multiple prolog vms. In swipl console, I can do something like this successfully ?- consult(mod1:'data/load.pro') . In java (well, it is actually scala, but they are all on…
Sheng
  • 1,697
  • 4
  • 19
  • 33
1
vote
1 answer

Query working in the consult, but not in JPL and command line

I'm using JPL and launch some queries to Swi-Prolog. The program works fine with all queries, but one. This query is not working: assert(like(X, Y) :- element(I, [1, 2, 3], X), element(I, [2, 3, 4], Y) ). Exception in thread "main"…
user840718
  • 1,563
  • 6
  • 29
  • 54
1
vote
0 answers

jpl.dll: Can't find dependent libraries

I am using java netbeans and want to use prolog api in it but i keep getting error Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Program Files\swipl\bin\jpl.dll: Can't find dependent libraries at…
Saaram
  • 337
  • 3
  • 7
  • 29
1
vote
1 answer

Unexpected behavior of the JPL library in multithreaded programs (Interfacing Java and Prolog)

I have been experimenting with the multithreading features of JPL. As far as I understand from the comments in the source code one different Prolog engine is assigned per Java thread. Apparently there is a problem when a query is started in thread…
Sergio
  • 8,532
  • 11
  • 52
  • 94
1
vote
1 answer

Restarting Prolog engine from Java using JPL

In one java application that uses JPL to interact with Prolog, I want to be able to restart the prolog engine with different settings. As an example, I would like to change from SWI to YAP (I configure which engine to use this with the method…
Sergio
  • 8,532
  • 11
  • 52
  • 94
0
votes
1 answer

Compiling Prolog-JPL on Ubuntu 11.10 64-bit?

I'm trying to compile prolog-JPL as described here: https://code.google.com/p/javanaproche/wiki/HowToJPL Unfortunately, it ends with an error: ********************** * Package plunit ********************** config.status: creating…
NoBugs
  • 9,310
  • 13
  • 80
  • 146
0
votes
1 answer

How to fix 'configure: error: cannot find java include files'?

To install jpl(A Java Interface to Prolog),when I type 'make', it shows checking symlink for /etc/alternatives/javac... /usr/bin/gcj-wrapper-4.4 configure: error: cannot find java include files make: *** [installed] Error 1 How to fix it? Thank…
sam
  • 2,049
  • 3
  • 20
  • 27
0
votes
2 answers

How to handle prolog lists in java

I'm using jpl to connect java and prolog. I am trying to handle prolog lists in java. My prolog code when executed returns a list like the following L = [38, '(60)', '48^10', '36^6^58'] Now i'm trying to handle this output in java using the…
Anil
  • 2,405
  • 6
  • 25
  • 28
0
votes
1 answer

Problem with files using prolog (Existence error)

Why would the file run with no problems when using Eclipse but when I create a jar file of the same program I can't run it locally on my pc? This is the error I get where a is an input and signal.pl is a file I pass located in…
0
votes
1 answer

java.sql.SQLSyntaxErrorException: ORA-00923: FROM keyword not found where expected

I am trying to cast the result of a native query within an object called Account. But when I call the API it throws me this. The fun fact is that if a copy paste the query in the sql developer it works perfectly, without throwing the "FROM keyword…
Marius Pop
  • 158
  • 1
  • 4
  • 20