This package, named JIPL, gives interface between Java and
With this package, you can
You can find K-Prolog Users manual at
. There is an English version now.
Download from archives,
Unzip the archive and place the contents in a directory.
Downloading and installation
Before unzipping, you must remove old JIPL beta files and directories.
UNIX directory candidate is /usr/local/plc/ Windows directory candidate is C:\plc\ and set the directory to environment variables PLC and PATH. You should also set LD_LIBRARY_PATH, and may specify through BROWSER variable, which browser to use, if you are using UNIX, to show help. Or, Netscape Communicator/Navigator users can specify MOZILLA_HOME, instead. i.e. unix % setenv PLC /usr/local/plc unix % setenv PATH $PLC:$PATH unix % setenv LD_LIBRARY_PATH $PLC:$LD_LIBRARY_PATH unix % setenv MOZILLA_HOME /usr/local/netscape win32> set PLC=C:\plc win32> set PATH=%PLC%;%PATH Set the Java classpath to the directory. For example, unix % java -classpath $PLC:$JAVA_HOME/lib/classes.zip
Adjust Makefile lines PLC = JAVA_HOME = to fit with your environment. Then > make run gives animated solution of 8-Queens problem.This example is incomplete as a Java animation. My aim is to show how JIPL interfaces Prolog and Java, and omitted unnecessary code.
starts the JIPL/IDE.
Then you may try
[Reconsult] and select queens.pl,
type in "queens(Q)" to [TextField] to run the program.
To erase the board, type in "dispose".
In the class com.kprolog.plc.Plc class, you may mainly use the methods, startPlc(String args) exec(String command) call(String functor, Object args) run()
Prolog APIjavaConstructor(Class(Args,...), Instance) Class(+atom) : Java class name, with full package path. Args(+term) : Arguments to be passed to the constructor. Don't use () if the constructor has no argument. Place just an atom as Class instead. Instance(-term) : Instance created. Calls constructor of Java object. javaMethod(ClassOrInstance, Method(Args,...), Return) ClassOrInstance : Class or Instance. Class(+atom) : Java class name, with full package path. Instance(+term) : An instance. Args(+term) : Arguments to be passed to the constructor. Don't use () if the method has no argument. Place just an atom as Method instead. Return(-term) : Returned object from the method. Remain intact if the method is void type. Calls a static method of a class, if ClassOrInstance is an atom. Calls an instance method, if an instance is given. javaGetField(ClassOrInstance, Field, Value) ClassOrInstance : Class or Instance. Class(+atom) : Java class name, with full package path. Instance(+term) : An instance. Field(+atom) : Field name. Value(-term) : Value of the field. Gets the value of the field. javaSetField(ClassOrInstance, Field, Value) ClassOrInstance : Class or Instance. Class(+atom) : Java class name, with full package path. Instance(+term) : An instance. Field(+atom) : Field name. Value(+term) : Value to be set to the field. Sets the value to the field.
Data conversionJava Prolog --------------------------- Integer 32bit integer Double 64bit float Long (may be bignum)integer BigInteger (may be bignum)integer String string (list of char code) Array list Other address term
starts the JIPL/IDE.
It is a shell script or batch file, which starts sample Prolog IDE. I abandoned using Java Invocation interface, for porting reasons. You can use it with environment variables PLC and JAVA_HOME set.
Source is available under src/ide directory, but you can't find any document.
I call this "IDE", but it contains no editor. [File]-[Edit] starts "vi" in default. With editor(EditorName) prolog builtin, you may specify an editor you use.
Example of IDE usage.
- If you don't have K-Prolog commercial product, you can't Compile(into native code objects)/Load(native code object/dll).
Permission to use, copy, modify, and distribute this release of the software for RESEARCH/EVALUATION purposes and without fee is hereby granted provided that this copyright notice appears in all copies. Notice that EDUCATIONAL purpose usage is NOT granted.
The Java package name, com.kprolog.plc, is reserved for KLS Research, Inc. So you should rename the package when you apply JIPL to other language processors.
Nobukuni Kino and KLS Research, Inc. make no warranties about the suitability of the software, either expressed or implied, fitness for a particular purpose. Nobukuni Kino and KLS Research, Inc. shall not be liable for any damages suffered by licensee as a result of using, modifying or distributing this software or its derivatives.
K-Prolog Compiler version 5.0 is the full set commercial package.
Personal users may download it through HTTP.
Contact firstname.lastname@example.org and purchase LICENSE FOR COMMERCIAL or EDUCATIONAL purpose.
Please report any problems or proposals to email@example.com (Nobukuni Kino) KLS Research Lab.