public class JPL
extends java.lang.Object
Copyright (C) 1998 Fred Dushin
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Modifier and Type | Field and Description |
---|---|
protected static boolean |
DEBUG |
static Term |
JFALSE |
static Term |
JNULL |
static Term |
JTRUE |
static Term |
JVOID |
static Atom |
LIST_NIL |
protected static Atom |
LIST_NIL_MODERN |
protected static Atom |
LIST_NIL_TRADITIONAL |
static java.lang.String |
LIST_PAIR |
protected static java.lang.String |
LIST_PAIR_MODERN |
protected static java.lang.String |
LIST_PAIR_TRADITIONAL |
static boolean |
LIST_TOSTRING_TEXTUAL |
protected static boolean |
modeDontTellMe |
Constructor and Description |
---|
JPL() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String[] |
getActualInitArgs()
Returns, in an array of String, the sequence of command-line arguments
that were actually used when the Prolog engine was formerly initialised.
|
static java.lang.String[] |
getDefaultInitArgs()
Returns, in an array of String, the sequence of command-line arguments
that would be used if the Prolog engine were to be initialised now.
|
static java.lang.String |
getSyntax() |
static void |
halt()
Deprecated.
|
static boolean |
init()
Initialises the Prolog engine using the current default initialisation
parameters, and returns 'true' (or 'false' if already initialised).
|
static boolean |
init(java.lang.String[] args)
Initializes the Prolog engine, using the String argument parameters
passed.
|
protected static boolean |
isSimpleName(java.lang.String s)
Checks if a string is a simple atom, with no quoting needed
|
static java.lang.String |
jarPath() |
static void |
loadNativeLibrary() |
static void |
main(java.lang.String[] args) |
static Term |
newJRef(java.lang.Object object) |
protected static java.lang.String |
quotedName(java.lang.String name)
Returns a quoted (iff necessary) form of the Atom's name, as understood
by Prolog read/1
|
static void |
setDefaultInitArgs(java.lang.String[] args)
Specifies, in an array of String, the sequence of command-line arguments
that should be used if the Prolog engine is subsequently initialised.
|
static void |
setDTMMode(boolean dtm)
Sets the global "dont-tell-me" mode (default value: true).
|
static java.lang.String |
setNativeLibraryDir(java.lang.String newDir) |
static java.lang.String |
setNativeLibraryName(java.lang.String newName) |
static java.lang.String |
setNativeLibraryPath(java.lang.String newPath) |
static void |
setTraditional() |
static void |
setTraditionalAnyway() |
static java.lang.String |
version_string()
Returns a String (eg "3.0.0-alpha") identifying this version of JPL.
|
static org.jpl7.Version |
version()
Returns (as a Version) an identification of this version of JPL.
|
protected static final boolean DEBUG
public static final Term JFALSE
public static final Term JTRUE
public static final Term JNULL
public static final Term JVOID
protected static boolean modeDontTellMe
protected static final Atom LIST_NIL_MODERN
protected static final Atom LIST_NIL_TRADITIONAL
public static Atom LIST_NIL
protected static final java.lang.String LIST_PAIR_MODERN
protected static final java.lang.String LIST_PAIR_TRADITIONAL
public static java.lang.String LIST_PAIR
public static boolean LIST_TOSTRING_TEXTUAL
public static java.lang.String setNativeLibraryName(java.lang.String newName)
public static java.lang.String setNativeLibraryDir(java.lang.String newDir)
public static java.lang.String setNativeLibraryPath(java.lang.String newPath)
public static void loadNativeLibrary()
public static java.lang.String jarPath()
public static void setDTMMode(boolean dtm)
This method should be regarded as experimental, and may subsequently be deprecated in favour of some more general mechanism for setting options, perhaps per-Query and per-call as well as globally.
dtm
- new "dont-tell-me" mode valuepublic static void setTraditional()
public static void setTraditionalAnyway()
public static java.lang.String getSyntax()
public static java.lang.String[] getDefaultInitArgs()
getActualInitArgs()
public static void setDefaultInitArgs(java.lang.String[] args)
args
- new default initialization argumentspublic static java.lang.String[] getActualInitArgs()
public static boolean init(java.lang.String[] args)
This method must be called before making any queries.
args
- Initialization parameter listpublic static boolean init()
protected static boolean isSimpleName(java.lang.String s)
s
- string to check if it is simple name (no quoting needed)public static Term newJRef(java.lang.Object object)
object
- the object of interest to get the JREFprotected static java.lang.String quotedName(java.lang.String name)
name
- the name to quote if needed@Deprecated public static void halt()
Note. This method calls the FLI halt() method with a status of 0, but the halt method currently is a no-op in SWI.
public static org.jpl7.Version version()
public static java.lang.String version_string()
public static void main(java.lang.String[] args)