com.xsb.interprolog
Class NativeEngine
java.lang.Object
|
+--com.declarativa.interprolog.PrologEngine
|
+--com.xsb.interprolog.NativeEngine
- public class NativeEngine
- extends PrologEngine
A PrologEngine implemented using the Java Native Interface. This class depends on interprolog_callback.c and other files,
that are included in the emu directory of XSB Prolog 2.5 and later
Constructor Summary |
NativeEngine(String startPrologCommand)
|
NativeEngine(String XSB_DIR,
boolean debug)
The XSB dll must be in a directory in the Windows PATH
so the Java loader finds it |
Methods inherited from class com.declarativa.interprolog.PrologEngine |
abortTasks, assignableType, command, consultFromPackage, consultRelative, deterministicGoal, deterministicGoal, deterministicGoal, doCallback, findConstructor, findMethod, firstJavaMessage, getJarDirectory, getJarDirectory, getRealJavaObject, getRealJavaObject, getRealJavaObject, handleCallback, interrupt, interruptTasks, isAvailable, isDebug, load_dynRelative, makeInvisible, printBindings, progressMessage, registerJavaObject, shortClassName, teachMoreObjects, teachMoreObjects, teachOneObject, waitUntilAvailable, waitUntilIdle |
NativeEngine
public NativeEngine(String startPrologCommand)
NativeEngine
public NativeEngine(String XSB_DIR,
boolean debug)
- The XSB dll must be in a directory in the Windows PATH
so the Java loader finds it
setDebug
public void setDebug(boolean d)
- Overrides:
setDebug
in class PrologEngine
shutdown
public void shutdown()
- Description copied from class:
PrologEngine
- Release Prolog engine resources, making it unusable
- Specified by:
shutdown
in class PrologEngine
deterministicGoal
public Object[] deterministicGoal(String G,
String OVar,
Object[] objectsP,
String RVars)
- Description copied from class:
PrologEngine
- Synchronously calls a Prolog goal.
Only the first solution is considered. G should contain a syntactically correct
Prolog term, without the trailing dot (.). Throws an IPAbortedException if a Prolog abort happens, and an
IPInterruptedException if the interrupt() method was invoked.
- Overrides:
deterministicGoal
in class PrologEngine
- Parameters:
G
- Prolog goal termOVar
- Prolog variable that will be bound to objectsP arrayobjectsP
- Array of Java objects to pass to Prolog goalRVars
- Prolog list with object specifications, typically containing variables occurring in g.
If null a single binding will be returned, containing a TermModel object representing the goal term solution
- Returns:
- a new array containing an object for each term in the rVars list, or null if goal fails
- See Also:
PrologEngine.deterministicGoal(String)
,
PrologEngine.deterministicGoal(String,String)
,
PrologEngine.deterministicGoal(String,String,Object[])
isIdle
public boolean isIdle()
- Description copied from class:
PrologEngine
- The engine is doing nothing
- Overrides:
isIdle
in class PrologEngine