|
|||||||||
Home >> All >> alice >> [ tuprolog overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: ![]() ![]() ![]() |
DETAIL: FIELD | CONSTR | METHOD |
alice.tuprolog
Class Library

java.lang.Objectalice.tuprolog.Library
- All Implemented Interfaces:
- java.io.Serializable
- Direct Known Subclasses:
- CoreLibrary
- public abstract class Library
- extends java.lang.Object
- implements java.io.Serializable
- extends java.lang.Object
this abstract class is the base class for developing tuProlog built-in libraries, which can be dynamically loaded by prolog objects.
each library can expose to engine:
- a theory (as a string assigned to theory field)
- builtin predicates: each method whose signature is boolean name_arity(Struct goal) is considered a built-in predicate provided by the library
- builtin evaluable functors: each method whose signature is Term name_arity(Struct goal) is considered a built-in functors provided by the library
typically theory is assigned in library constructor
Field Summary | |
(package private) PrologVM |
engine
prolog core which loaded the library |
protected java.lang.String |
theory
theory provided by the library |
Constructor Summary | |
Library()
|
Method Summary | |
void |
dismiss()
method invoked by prolog engine when library is going to be removed |
PrologVM |
getEngine()
|
(package private) java.lang.String[] |
getFunctors()
used by core engine to retrieve built-in functors |
(package private) java.lang.String[] |
getPredicates()
used by core engine to retrieve built-in predicates |
Term |
getRenamedCopy(Term t0)
gets a copy of a term with variables renamed. |
java.lang.String |
getTheory()
|
void |
onSolveBegin(Term goal)
method invoked when the engine is going to demonstrate a goal |
void |
onSolveEnd()
method invoked when the engine has finished a demostration |
void |
setEngine(PrologVM e)
|
boolean |
unify(Term t0,
Term t1)
unification of two terms |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
engine
PrologVM engine
- prolog core which loaded the library
theory
protected java.lang.String theory
- theory provided by the library
Constructor Detail |
Library
public Library()
Method Detail |
unify
public final boolean unify(Term t0, Term t1)
- unification of two terms
getRenamedCopy
public final Term getRenamedCopy(Term t0)
- gets a copy of a term with variables renamed.
getTheory
public final java.lang.String getTheory()
getPredicates
final java.lang.String[] getPredicates()
- used by core engine to retrieve built-in predicates
getFunctors
final java.lang.String[] getFunctors()
- used by core engine to retrieve built-in functors
dismiss
public void dismiss()
- method invoked by prolog engine when library is
going to be removed
onSolveBegin
public void onSolveBegin(Term goal)
- method invoked when the engine is going
to demonstrate a goal
onSolveEnd
public void onSolveEnd()
- method invoked when the engine has
finished a demostration
setEngine
public final void setEngine(PrologVM e)
getEngine
public final PrologVM getEngine()
|
|||||||||
Home >> All >> alice >> [ tuprolog overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: ![]() ![]() ![]() |
DETAIL: FIELD | CONSTR | METHOD |