Re: java calling prolog



On 2005-11-25, tushar.saxena@xxxxxxxxx <tushar.saxena@xxxxxxxxx> wrote:
> SICSTUS Prolog provides an interface called JASPER which is just waht
> you are looking for. But then again SICSTUS is expensive, so ......

For SWI-Prolog there is JPL which is based on JNI to create calls
between Prolog and Java and there is InterProlog, which uses network
communication. I think both are available for a few other Prolog systems
as well. I try to use neither. I've been closely involved with people
using notably JPL for various projects. I convinced some of them to give
up on the close link between Prolog and Java and instead run Prolog as a
(web-)server and use either an application-specific proprietary protocol
or HTTP+XML to access Prolog as a `logic server' component. The overall
experience is that this approach is much more flexible, stable, easier
to insall (deploy) and easier to debug (=develop). I recomment this
approach for applications where the overhead of network communication is
affortable.

I've also seen the use of Java from Prolog to access databases (JDBC)
and other (mostly network) resources. Generally, try to avoid it.
Compared to accessing these resources through C/C++, the Java approach
is slow, `bloadware', difficult to install and often less stable. For
many of these resources there are various good plain C or C++ libraries.

--- Jan
.



Relevant Pages

  • Re: Prolog in a Java Tomcat environnement
    ... >>1) should I write wrapper classes in java and use the JPL environnement ... >>prolog code in a tomcat environnement. ... I think the JPL ... your Java web app. ...
    (comp.lang.prolog)
  • Re: SWIPL + JPL multiple databases
    ... My small prolog example (using Family example from jpl swi + the ... But using the java example: ... Query q3 = new Query; ... JPL demo: Family ...
    (comp.lang.prolog)
  • Re: SWI PROLOG - JAVA Interface - NEED HELP --- URGENT
    ... > the steps I need to take after installing prolog itself to test jpl. ... You should make sure CLASSPATH includes ... If you call Prolog ... from Java, you must make sure the Prolog `bin' directory is in $PATH. ...
    (comp.lang.prolog)
  • Re: Java to Prolog and assert/retract
    ... >I am trying to access prolog from a Java program. ... >It is possible to add/delete rules at runtime through JPL or JIProlog? ... I know nothing of Java or JPL, so I can't answer your question. ... assert((names(saad))). ...
    (comp.lang.prolog)
  • Re: Is Prolog good for AI? (was: Minsky still posting)
    ... but it was Prolog nor AI. ... whereas it is actually a language with a heavy dependence on ... I write declarative-style programs in C and Java. ... but there are hardly any portable resources. ...
    (comp.lang.prolog)