InterProlog:
a Java front-end and enhancement for Prolog

Miguel Calejo
Declarativa, Portugal

InterProlog is a programming library and simple environment for XSB Prolog, initially developed by Servisoft within the PROLOPPE project, and later enhanced by Declarativa. It consists of a Java application front-end that communicates with a Prolog system running either as a subprocess, using standard console redirection and TCP/IP sockets, or as a dynamic loadable library, using the Java Native Interface.

Some features:

Standard top level window, interacting with the back-end Prolog stdio streams.


If you feel an urge to interrupt Prolog, your "ctrl-c" key is on the Tools menu. A history of commands is on the right menu.

GUI based on Java Foundation Classes (Swing) You may want to check out the Swing gallery to see what's possible on the Java platform.
Bidirectional conversion between virtually any Serializable Java object and a Prolog term Based on a bidirectional Definite Clause Grammar implementing Java's Object Serialization Stream Protocol

 

A mechanism for generating Prolog templates+access variables, from object examples (prototypes) provided by the Java programmer Writing in Java: ... allows the Prolog programmer to use either of the following fact clauses (only some bindings shown):
new ObjectExamplePair(
new Integer(1), new Integer(2)
)

Any serializable object prototype can be given to the PrologEngine class, which encapsulates all access to Prolog

ipObjectTemplate('java.lang.Integer',Template,ANames,Vars,[1])
or
ipObjectSpec(Name,Template,Vars,examples-[[1],[2]]/ANames)

Allows object construction from templates

Prolog goals launched from Java boolean deterministicGoal(String G, String RVars, Object[] bindings), and more
Any Java message sent from Prolog to any Java object javaMessage(Target,Result,Exception,MessageName,ArgList,NewArgList)
sweeter varieties available, for example javaMessage(Target,'MessageName'(ArgList))
Term outline/textual displayer, written in Java and Prolog; includes functionality of standard Prolog write, and takes into account a particular set of op declarations browseTerm(1+2*3/4-A):

 
after expanding  one node :

 

Table displayer browseLiteralInstances(parceiro(nome,cidade),[parceiro(servisoft,porto),...]):

 

A term list browser. Double-clicking invokes a term browser for the selected item.

browseList(List)
wpe3.jpg (4060 bytes)
A Sudoku puzzle editor and solver, GUI in Java and reasoning in Prolog

 


 Declarativa - Serviços de Informática, Lda.
  www.declarativa.com, info@declarativa.com  fax: +351-22-030-1511  tel: +351-22-030-1580
UPTEC - Parque de Ciência e Tecnologia da Universidade do Porto (GoogleMap)
Rua Actor Ferreira da Silva 100 4200-298 Porto Portugal