public class FloraSubprocessEngine extends XSBSubprocessEngine
SubprocessEngine.OutputDumper
Modifier and Type | Field and Description |
---|---|
static String |
ERGO_AUX_BASE |
static String |
ERGOTEXT_EXTENSION |
static String |
FLORA_AUX_BASE |
ctrl_c, ctrlc
firstJavaMessageName, interPrologFileLoaded, nl, prologBinDirectoryOrCommand
MAX_INT_VALUE, MIN_INT_VALUE, version
Constructor and Description |
---|
FloraSubprocessEngine() |
FloraSubprocessEngine(boolean debug) |
FloraSubprocessEngine(String[] prologCommands) |
FloraSubprocessEngine(String[] prologCommands,
boolean debug) |
FloraSubprocessEngine(String[] prologCommands,
boolean debug,
boolean loadFromJar) |
FloraSubprocessEngine(String[] prologCommands,
String floraDirectory) |
FloraSubprocessEngine(String[] prologCommands,
String floraDirectory,
boolean outAndErrMerged,
boolean debug,
boolean loadFromJar) |
Modifier and Type | Method and Description |
---|---|
void |
abortEngine()
Assumes the engine is in a break state
|
boolean |
command(String s)
Execute a Prolog "command; returns true if it succeeds"
|
boolean |
consultAbsolute(File f)
\\load a Flora (into main module) or Prolog file
|
boolean |
consultFloraAbsolute(File f,
String module)
\\load a Flora file into a specific module.
|
String |
consultFloraFromPackage(String filename,
Object requester) |
String |
consultFloraFromPackage(String filename,
String module,
Object requester) |
String |
consultFromPackage(String filename,
Object requester)
Same as superclass, but also accepts a Flora file, which is loaded into module 'main'
|
boolean |
floraCommand(String s)
Execute a Flora/Ergo "command"
|
boolean |
floraDeterministicGoal(String FG) |
TermModel |
floraDeterministicGoal(String FG,
String FloraOutputVar) |
TermModel[] |
floraDeterministicGoal(String FG,
String FloraInputVars,
TermModel[] terms,
String FloraOutputVars)
Execute Flora goal FG, binding terms to the variables in FloraInputVars, and returning as many TermModels as vars in FloraOutputVars.
|
String |
getFloraBuild() |
String |
getFloraDirectory() |
String |
getFloraReleaseDate()
Return Flora's release date as YYYY-MM-DD
|
String |
getFloraVersion()
Return Flora's version
|
String |
getLanguage() |
boolean |
inFloraShell()
We know the engine to be in the Flora shell, so Prolog goals need a Flora suffix
|
boolean |
inPrologShell()
We know the engine to be in the Prolog shell, so Prolog goals do not need a postfix
|
void |
interrupt()
Interrupt Prolog and make it return to its top level.
|
boolean |
isErgo()
This Flora2 engine happens to also be an Ergo engine.
|
static boolean |
isErgo(String floraDirectory) |
static boolean |
isErgoSourceFile(File F) |
static boolean |
isErgoSourceFile(String filename) |
static boolean |
isErgotextSourceFile(File F) |
static boolean |
isErgotextSourceFile(String filename) |
static boolean |
isFloraSourceFile(File F) |
static boolean |
isFloraSourceFile(String filename) |
boolean |
isQuietDeterministicGoals() |
boolean |
isVerbose() |
static void |
main(String[] args)
Example to create an engine and run a simple query.
|
void |
resumeEngine()
Assumes the engine is in a break state
|
void |
setFloraShell() |
void |
setFloraShellStarted() |
void |
setPrologShell() |
void |
setQuietDeterministicGoals(boolean quietDeterministicGoals)
Determines whether Flora/Ergo standard output (such as "Yes", variable bindings etc) is produced during deterministicGoal
|
void |
setVerbose(boolean verbose)
Sets the Flora/Ergo engines's chatter level
|
addPrologOutputListener, addPrologStderrListener, addPrologStdoutListener, breakEngine, deterministicGoal, getCharset, isAvailable, isDetectErrorMessages, printPrologOutputToConsole, printPrologOutputToFile, realCommand, removePrologOutputListener, removePrologStderrListener, removePrologStdoutListener, sendAndFlush, sendAndFlushLn, setCharset, setDebug, setDetectErrorMessages, setEngineStarted, setSlowWindowsShutdown, shutdown, waitUntilAvailable
abortTasks, add_lib_dir, addPrologEngineListener, addSoftwareLibrary, addSoftwareLibrary, assignableType, command, command, consultAbsolute, consultFromPackage, consultRelative, createTempDirectory, currentTimeSecs, deleteAll, deleteTempFiles, deterministicGoal, deterministicGoal, deterministicGoal, deterministicGoal, deterministicGoalJSON, doCallback, endAllTasks, exec, executingOnJavaSide, findConstructor, findMethod, firstJavaMessage, getImplementationPeer, getInterprologPath, getJarDirectory, getJarDirectory, getLoadFromJar, getPrologBaseDirectory, getPrologNumericVersion, getPrologVersion, getRealJavaObject, getRealJavaObject, getRealJavaObject, getThePrologListener, goal, goal, handleCallback, hasPrologExtension, interruptTasks, is64WindowsOS, isAllowSimultaneousThreads, isDebug, isIdle, isLinuxOS, isMacOS, isPaused, isProfiling, isSerializable, isShutingDown, isThreadedCallbacks, isWindowsOS, lastSolutionUndefined, load_dynAbsolute, load_dynRelative, loop, loop2, makeInvisible, printAllStackTraces, printAllStackTraces, printBindings, printStackTrace, profilingMessage, progressMessage, progressMessage, prologBinToBaseDirectory, prologCanWork, prologEnteredBreak, prologResumedComputation, prologReturnedToTopLevel, registerJavaObject, removePrologEngineListener, serverFileSeparatorChar, serverIsWindows, setAllowSimultaneousThreads, setProfiling, setThreadedCallbacks, setTimedCallIntervall, shortClassName, stop, teachMoreObjects, teachMoreObjects, teachMoreObjects, teachOneObject, toString, unescapedFilePath, unregisterJavaObject, unregisterJavaObject, unregisterJavaObjects, waitUntilIdle
public static final String FLORA_AUX_BASE
public static final String ERGO_AUX_BASE
public static final String ERGOTEXT_EXTENSION
public FloraSubprocessEngine(String[] prologCommands, String floraDirectory, boolean outAndErrMerged, boolean debug, boolean loadFromJar)
prologCommands
- floraDirectory
- outAndErrMerged
- debug
- loadFromJar
- fj_floraSupported is asserted on the Prolog side
public FloraSubprocessEngine(String[] prologCommands, boolean debug, boolean loadFromJar)
prologCommands
- debug
- loadFromJar
- public FloraSubprocessEngine(String[] prologCommands, boolean debug)
public FloraSubprocessEngine(String[] prologCommands)
public FloraSubprocessEngine(boolean debug)
public FloraSubprocessEngine()
public boolean isQuietDeterministicGoals()
public void setQuietDeterministicGoals(boolean quietDeterministicGoals)
quietDeterministicGoals
- public static boolean isErgo(String floraDirectory)
public boolean isErgo()
public String getLanguage()
public void setFloraShellStarted()
public void setFloraShell()
public void setPrologShell()
public boolean inFloraShell()
public boolean inPrologShell()
inPrologShell
in interface PrologEngine
inPrologShell
in class AbstractPrologEngine
public void setVerbose(boolean verbose)
verbose
- public boolean isVerbose()
public void interrupt()
PrologEngine
interrupt
in interface PrologEngine
interrupt
in class AbstractPrologEngine
public void resumeEngine()
resumeEngine
in class SubprocessEngine
public void abortEngine()
abortEngine
in class SubprocessEngine
public boolean command(String s)
command
in interface PrologEngine
command
in class AbstractPrologEngine
AbstractPrologEngine.command(java.lang.String)
public boolean floraCommand(String s)
s
- the commandpublic static boolean isFloraSourceFile(File F)
public static boolean isFloraSourceFile(String filename)
public static boolean isErgoSourceFile(File F)
public static boolean isErgoSourceFile(String filename)
public static boolean isErgotextSourceFile(File F)
public static boolean isErgotextSourceFile(String filename)
public boolean consultAbsolute(File f)
consultAbsolute
in interface PrologEngine
consultAbsolute
in class AbstractPrologEngine
f
- AbstractPrologEngine.consultAbsolute(java.io.File)
public boolean consultFloraAbsolute(File f, String module)
public String consultFromPackage(String filename, Object requester)
consultFromPackage
in interface PrologEngine
consultFromPackage
in class AbstractPrologEngine
filename
- The Prolog file name, including extension; if it has no extension, the Prolog file extensions are appended in turn until a file is foundrequester
- Defines where the Prolog file residesAbstractPrologEngine.consultFromPackage(String,Object)
public String consultFloraFromPackage(String filename, Object requester)
filename
- requester
- public String consultFloraFromPackage(String filename, String module, Object requester)
filename
- module
- requester
- public boolean floraDeterministicGoal(String FG)
public TermModel[] floraDeterministicGoal(String FG, String FloraInputVars, TermModel[] terms, String FloraOutputVars)
FG
- FloraInputVars
- terms
- FloraOutputVars
- public String getFloraDirectory()
public String getFloraReleaseDate()
public String getFloraBuild()
public String getFloraVersion()
public static void main(String[] args)
args
- ignored