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
0
votes
1 answer

Retrieving ERROR and WARNING messages from SWI-Prolog through JPL

I am having some trouble retrieving error and warning messages when using JPL. For example, attempting to consult a non-existing file directly from SWI-Prolog produces the following output: 1 ?- consult('NonExistingFile'). ERROR: source_sink…
Epicurus
  • 2,103
  • 7
  • 29
  • 39
0
votes
0 answers

Querying predicate in Prolog and java

I want to make a query to use Prolog in java through JPL, I want to call a predicate like this in java: predicate_test([X,Y,Z]):- a_predicate(X), another_predicate(Y). I make the query in java to invoque "predicate_test" like this: …
Naty Bizz
  • 2,262
  • 6
  • 33
  • 52
0
votes
1 answer

JPL: is javax.persistence.Query.setParameter sql-injection safe?

Can I sql-inject jpl parameter set by setParameter? I mean, I know I can do it if I have something like this: String nm = "'anything' or 'x'='x'--"; Query m = em.createQuery("SELECT p FROM Tbl p WHERE UPPER(p.name) = '" + nm + "'"); Can I do a…
HtonS
  • 301
  • 4
  • 18
-1
votes
1 answer

Compiling error Java "package jpl does not exist" on Ubuntu

I installed swi-prolog by using $ sudo apt-get install swi-prolog and $ sudo apt-get install swi-prolog-java However I can't compile anything on netbeans because it gives me this: As you can see on the screenshot, I even tried importing jpl.jar to…
Tamara
  • 3
  • 4
1 2 3 4 5
6