|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Prolog
The class SICStus
and an inner class in
Jasper
inherit from this interface. These methods
should be used to call SICStus runtime in both multi threaded and single
threaded mode.
When using the Prolog-Java interface in single thread mode, the methods of
this interface are preferred over the old methods of the class
SICStus
.
Method Summary | |
---|---|
Term |
consFunctor(java.lang.String functor,
Term[] args)
Creates a term initialized to a compound term. |
Term |
consList(Term head,
Term tail)
Creates a term initialized to a list with given head and tail. |
se.sics.jasper.Server |
getServer()
For internal use by Jasper. |
Term |
listFromString(java.lang.String str)
Creates a term initialized to a list of character codes from a Java String . |
Term |
newObjectTerm(java.lang.Object obj)
Creates a term initialized to a *global* reference to a Java object. |
Term |
newTerm()
Creates a null-term (i.e. the empty list, '[]'). |
Term |
newTerm(double d)
Creates a term initialized to a Prolog float. |
Term |
newTerm(float f)
Creates a term initialized to a Prolog float. |
Term |
newTerm(int i)
Creates a term initialized to a Prolog integer from a Java int . |
Term |
newTerm(long j)
Creates a term initialized to a Prolog integer from a Java long . |
Term |
newTerm(java.lang.String a)
Creates a term initialized to a Prolog atom. |
Term |
newTerm(java.lang.String functor,
Term[] args)
Creates a term initialized to a Prolog compound term. |
Term |
newTerm(Term t)
Creates a term initialized to an existing term. |
Term |
newVariable()
Creates a term initialized to an unbound variable. |
Term |
numberFromString(java.lang.String str)
Creates a term initialized to a Prolog number from a string. |
Query |
openPrologQuery(java.lang.String string,
java.util.Map varMap)
Opens a query, specified as a string, for obtaining multiple solutions. |
Term |
prologReadFromString(java.lang.String string,
java.util.Map varMap)
Creates a term by reading from a string. |
boolean |
query(java.lang.String string,
java.util.Map varMap)
Finds the first solution to a query specified as a string. |
boolean |
queryCutFail(java.lang.String string,
java.util.Map varMap)
Finds the first solution to a query specified as a string, then cuts away any choicepoints and fails, i.e. ignores everything but the side-effects during the first solution. |
Method Detail |
---|
se.sics.jasper.Server getServer()
Query openPrologQuery(java.lang.String string, java.util.Map varMap) throws java.lang.NoSuchMethodException, java.lang.InterruptedException, java.lang.Exception
nextSolution
to do that. When no more solutions are needed,
the query must be closed using methods close
or cut
on the query-object.
Multiple queries can be open at the same time. See nextSolution
for details
and restrictions.
string
- The goal to use for the query, with terminating period.varMap
- The arguments to the predicate as a map from
variable names to Term objects. The map will get
entries added for all variables (with names not starting with
underscore) in the goal that were not already present as
input. May be null.
query
object.
java.lang.NoSuchMethodException
java.lang.InterruptedException
java.lang.Exception
Query.nextSolution()
,
Query.close()
,
Query.cut()
boolean query(java.lang.String string, java.util.Map varMap) throws java.lang.NoSuchMethodException, java.lang.InterruptedException, java.lang.Exception
openPrologQuery
.
string
- The goal to use for the query, with terminating period.varMap
- The arguments to the predicate as a map from
variable names to Term objects. On success varMap will get
entries added for all variables (with names not starting with
underscore) in the goal that were not already present as
input. May be null.
java.lang.NoSuchMethodException
java.lang.InterruptedException
java.lang.Exception
openPrologQuery(java.lang.String, java.util.Map)
,
queryCutFail(java.lang.String, java.util.Map)
,
Term
boolean queryCutFail(java.lang.String string, java.util.Map varMap) throws java.lang.NoSuchMethodException, java.lang.InterruptedException, java.lang.Exception
string
- The goal to use for the query, with terminating period.varMap
- The arguments to the predicate as a map from
variable names to Term objects. May be null. No bindings are
added.
java.lang.NoSuchMethodException
java.lang.InterruptedException
java.lang.Exception
query(java.lang.String, java.util.Map)
Term newTerm() throws java.lang.InterruptedException, java.lang.Exception
java.lang.InterruptedException
java.lang.Exception
Term newTerm(Term t) throws java.lang.InterruptedException, java.lang.Exception
t
- The Term object whose term to use
java.lang.InterruptedException
java.lang.Exception
Term newTerm(int i) throws java.lang.InterruptedException, java.lang.Exception
int
.
i
- Initial value of the integer.
java.lang.InterruptedException
java.lang.Exception
Term newTerm(long j) throws java.lang.InterruptedException, java.lang.Exception
long
.
j
- Initial value of the integer (long).
java.lang.InterruptedException
java.lang.Exception
Term newTerm(double d) throws java.lang.InterruptedException, java.lang.Exception
d
- Initial value of the float.
java.lang.InterruptedException
java.lang.Exception
Term newTerm(float f) throws java.lang.InterruptedException, java.lang.Exception
f
- Initial value of the float.
java.lang.InterruptedException
java.lang.Exception
Term newTerm(java.lang.String a) throws java.lang.InterruptedException, java.lang.Exception
a
- String describing the initial value of the atom.
java.lang.InterruptedException
java.lang.Exception
Term newTerm(java.lang.String functor, Term[] args) throws java.lang.InterruptedException, java.lang.Exception
functor
- The functor of the compound term as a stringargs
- The arguments as an array of Terms
java.lang.InterruptedException
java.lang.Exception
Term prologReadFromString(java.lang.String string, java.util.Map varMap) throws java.lang.InterruptedException, java.lang.Exception
string
- The printed representation of the term, with terminating period.varMap
- Bindings for any variables occurring in the term,
as a map from variable names to Term objects. The map will
get entries added for all variables (with names not starting
with underscore) in the term that were not already present as
input. May be null.
java.lang.InterruptedException
java.lang.Exception
Term newVariable() throws java.lang.InterruptedException, java.lang.Exception
java.lang.InterruptedException
java.lang.Exception
Term consFunctor(java.lang.String functor, Term[] args) throws java.lang.InterruptedException, java.lang.Exception
functor
- The term's functor as a Java String
args
- The arguments of the term
java.lang.InterruptedException
java.lang.Exception
Term consList(Term head, Term tail) throws java.lang.InterruptedException, java.lang.Exception
head
- The head of the listtail
- The tail of the list
java.lang.InterruptedException
java.lang.Exception
Term newObjectTerm(java.lang.Object obj) throws IllegalTermException, ConversionFailedException, java.lang.Exception
obj
- A reference to a Java object.
IllegalTermException
ConversionFailedException
java.lang.Exception
Term numberFromString(java.lang.String str) throws ConversionFailedException, IllegalTermException, java.lang.Exception
str
- The string containing the printed representation of the number.
ConversionFailedException
IllegalTermException
java.lang.Exception
Term listFromString(java.lang.String str) throws ConversionFailedException, IllegalTermException, java.lang.Exception
String
.
str
- The string of characters.
ConversionFailedException
IllegalTermException
java.lang.Exception
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |