Go to the first, previous, next, last section, table of contents.


Java to Prolog interface

Author(s): Jesús Correas.

Version: 1.10#7 (2006/4/26, 19:22:13 CEST)

Version of last change: 1.9#65 (2003/3/14, 12:48:10 CET)

This module defines the Prolog side of the Java to Prolog interface. This side of the interface only has one public predicate: a server that listens at the socket connection with Java, and executes the commands received from the Java side.

In order to evaluate the goals received from the Java side, this module can work in two ways: executing them in the same engine, or starting a thread for each goal. The easiest way is to launch them in the same engine, but the goals must be evaluated sequentially: once a goal provides the first solution, all the subsequent goals must be finished before this goal can backtrack to provide another solution. The Prolog side of this interface works as a top-level, and the goals partially evaluated are not independent.

The solution of this goal dependence is to evaluate the goals in a different prolog engine. Although Ciao includes a mechanism to evaluate goals in different engines, the approach used in this interface is to launch each goal in a different thread.

The decision of what kind of goal evaluation is selected is done by the Java side. Each evaluation type has its own command terms, so the Java side can choose the type it needs.

A Prolog server starts by calling the prolog_server/0 predicate, or by calling prolog_server/1 predicate and providing the port number as argument. The user predicates and libraries to be called from Java must be included in the executable file, or be accesible using the built-in predicates dealing with code loading.

Usage and interface (jtopl)

Documentation on exports (jtopl)

PREDICATE: prolog_server/0:

Usage:

PREDICATE: prolog_server/1:

Usage:

PREDICATE: prolog_server/2:

Usage:

PREDICATE: shell_s/0:

Usage:

PREDICATE: query_solutions/2:

No further documentation available for this predicate.

The predicate is of type concurrent.

PREDICATE: query_requests/2:

No further documentation available for this predicate.

The predicate is of type concurrent.

PREDICATE: running_queries/2:

No further documentation available for this predicate.

The predicate is of type concurrent.


Go to the first, previous, next, last section, table of contents.