JPL A Java Interface to Prolog

A Java Interface to Prolog

### News

March 18, 2003

- JPL 2.0.2 re-released.

- see Release Notes

May 5, 1999

- JPL 1.0.1 released. This release contains the following changes:

- Fixed a bug with the representation of Tuples. They are now always binary terms, though generally structured as binary trees. The interface is the same, except we now require that Tuples contain at least two elements. (The single element constructor has been removed, but I consider this a patch, not an interface change)
- Added an ith() accessor to the Compound and Query classes. This is used to obtain the ith element in the array of Terms in the Compound or Query.
- Added a debugString() method to the Term and Query classes. This is used to obtain more detailed information about the structure of the Term or Query.
- Updated and fixed some of the documentation.

See the Copyright and License Information section for more information.

Feb 25, 1999

- JPL 1.0.0 is out. Check the download section for information about how to retrieve it. I hope most of the core interfaces are frozen.
- I am in need of Solaris testers! I have access to a Solaris box, but it has ancient and outdated compilers, libs, etc. If anyone gets this to compile on any platform other than Linux, please send me patches.
- Eventually I'd like to work out some config scripts. For now you must config manually. Sorry.
- I have not even tried getting this to run under Windows. Anyone with more expertise (and patience) than I is welcome to give it a go!

### General Description

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. The current version of JPL only works with SWI-Prolog.

Currently, JPL only supports the embedding of a Prolog engine within the Java VM. Future versions may support 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.

### Requirements

JPL now requires SWI-Prolog version 3.1.0 or later, which is available at the following URL:

> http://www.swi-prolog.org/

SWI-Prolog license information is available here:

> http://www.swi-prolog.org/license.html

You will also need a Java development environment. Sun's Java website is a good place to start:

> http://java.sun.com/

JPL 2.0.2 was developed and tested on Windows NT4, and has not yet been compiled on any non-Windows platform
JPL1.0.1 was written and tested on Linux kernel 2.1.24. It should compile on any other UNIX system with a full suite of gnu tools.

### Copyright and License Information

JPL is released under the terms of the Simplified BSD License:

> Copyright (c) 2003 Paul Singleton. All rights reserved.
> Copyright (c) 1998 Fred Dushin. All rights reserved.

> Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

> 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
> 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

> THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

### Documentation

The Documentation for JPL is organized into the following sections:

1. Getting Started
2. The Low-Level Interface
3. The High-Level Interface
4. The JPL API

### Download (this section is obsolete)

Gnu-zipped, UNIX compressed, and Zipped versions of the source distribution are available at:

> http://blackcat.cat.syr.edu/~fadushin/software/jpl/download

You may be interested in viewing the ChangeLog.

The latest version of JPL is available by the World Wide Web at the following URL:

> http://blackcat.cat.syr.edu/~fadushin/software/jpl

Writing free software is only gratifying if you hear from users. Please feel free to contact the author, Fred Dushin, at the following address:

> fadushin@top.cis.syr.edu

Happy Prologging.

These pages were created using Netscape Communicator, 4.5 for Linux on the PowerPC. The JPL logo was made by the Gimp.