AITEC Contract Research Projects in FY1998:Intermediate Report
(13)DJ: A Java-based Constraint Language and System
Principal Investigator:
Neng-Fa Zhou, Associate Professor
Kyushu Institute of Technology
Title of the Research Project, Principal Investigator
(1) Title of the Research Project
DJ: A Java-based Constraint Language and System
(2) Principal Investigator
Neng-Fa Zhou, Associate Professor
Kyushu Institute of Technology
Contents
(1) Purpose of the report
DJ is a language that amalgamates Java and Constraint Programming. As
an extension of Java, DJ significantly simplifies the process of
constructing GUIs and Java applets. Developing GUIs including applets
in Java is a time-consuming process. The users have to choose
appropriate layout managers and sometimes have to determine the sizes
and positions of graphical components. In contrast, in DJ, the users
only need to specify the components that compose a GUI and the
relationships among the components by using constraints. The layout
for the components is automatically determined by the system. As a
constraint programming language, DJ improves the current constraint
languages in that problems and solutions can be described in the same
language. And most importantly, because DJ is a compiling language
that uses Java as the object language, solutions of Constraint
Satisfaction Problems (CSPs) can be distributed on the World Wide Web
as Java applets.
During the last fiscal year, we developed a compiler for DJ in B-Prolog
(http://www.cad.mse.kyutech.ac.jp/people/zhou/bprolog.html). The
objectives for this fiscal year are as follows:
(a) To extend the base classes and constraints to make it easier to
use DJ develop various applications.
(b) To extend DJ and enable it handle events.
(c) To write more example applications.
(d) To make both the system and manual more user-friendly.
(2) Current status of the project
We have introduced several new constraints, most of which are layout
constraints, into DJ. The constraints include table, tree, notOverlap,
line, circle, etc. We are still working on implementing some of the
constraints.
We have ported a Java interface (developed by Nobukuri Kino) to
B-Prolog. With this interface, it is possible now to display partial
solutions without generating Java programs and compiling them. We plan
to implement an environment through which users can control the search
process and pick up satisfactory solutions.
We are implementing two applications, one for developing time tables
for classes at Kyushu Institute of Technology and the other on drawing
proof trees.
(3) Major result at this moment
Some results are described in (2). In addition, we have done the
following extensions and improvements:
(a) it is possible now to attach actions to components that will be
taken when the components are clicked. We developed two example
programs that uses this new functionality: One is a working calculator
and the other is a WEB page navigator. We plan to write more example
programs that use this new feature.
(b) Arrays in the previous version were static. We have made it
possible for users to define dynamic arrays, which are very important
to write GUIs for which the number of components are not known in
advance.
(c) We re-implemented the parser to improve the performance and to
enable support inner classes in JDK 1.1.
(4) Image of the resulting software
The software will become more robust. We will check every
functionality by using several test programs. The applications will
also be helpful to this end.
The software will become much easier to use: The reasons are:
There is an environment through which users can control the search
process and select solutions.
There will be a large number of base classes and constraints that can make it dramatically easy to write
many applications.
More example programs will be available that illustrates the programming techniques for DJ.