Jekejeke Prolog
Encyclopedia
Jekejeke Prolog is an interpreter only implementation of Prolog
Prolog
Prolog is a general purpose logic programming language associated with artificial intelligence and computational linguistics.Prolog has its roots in first-order logic, a formal logic, and unlike many other programming languages, Prolog is declarative: the program logic is expressed in terms of...

 written in 100% Java
Java (programming language)
Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities...

. The interpreter exists in two flavors. The runtime library provides an embeddable Prolog interpreter without any user interface. The development environment provides a simple console interface whereby the developer can execute and debug Prolog texts.

The implementation of the language mainly follows the ISO core standard. The implementation also features an application programming interface. It is possible to write Prolog applications that use Java foreign predicates and that make use of multi-threading. To a great extend such applications can already be tested in the development environment before they are independently deployed via the runtime library.

Features

Since release 0.9.0 Jekejeke Prolog features Just-in-time clause indexing over multiple arguments. This changes fundamentally how predicates are executed. Predicates that would be non-deterministic in normal Prolog systems are suddently deterministic. Here is an example, take the following Prolog text:

map_eq([],[]).
map_eq([X|Y],[Z|T]) :- X=Z, map_eq(Y,T).

Now most of the Prolog systems that use first argument indexing will determine that the following query is deterministic:

?- X=[1,2], map_eq(X,Y).
Y=[1,2]

But only a few Prolog systems, that can handle multiple indexes, will determine as well that the following query is deterministic:

?- Y=[1,2], map_eq(X,Y).
X=[1,2]

Just-in-time clause indexing does not require that the multiple indexes are declared by the end-user. The indexes are automatically determined from the call patterns at runtime.
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK