alice.tuprolog
Class Library

java.lang.Object
  extended byalice.tuprolog.Library
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
BasicLibrary, IOLibrary, ISOLibrary, JavaLibrary

public abstract class Library
extends java.lang.Object
implements java.io.Serializable

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:

See Also:
Serialized Form

Constructor Summary
Library()
           
 
Method Summary
 void dismiss()
          method invoked by prolog engine when library is going to be removed
 Prolog getEngine()
          Gets the engine to which the library is bound
 java.util.List getFunctors()
          gets the list of functors defined in the library
 java.lang.reflect.Method getLinkedMethod(Struct s)
          Gets the method linked to a builtin (null value if the builtin has not any linked service)
 java.lang.String getName()
          Gets the name of the library.
 java.lang.String[][] getOperatorSynonymMap()
          Gets the operator synonym mapping, as array of elements like { synonym, original operator name}
 java.util.List getPredicates()
          gets the list of predicates defined in the library
 java.lang.String getTheory()
          Gets the theory provided with the library Empty theory is provided by default.
 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
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Library

public Library()
Method Detail

getName

public java.lang.String getName()
Gets the name of the library. By default the name is the class name.

Returns:
the library name

getTheory

public java.lang.String getTheory()
Gets the theory provided with the library Empty theory is provided by default.


getOperatorSynonymMap

public java.lang.String[][] getOperatorSynonymMap()
Gets the operator synonym mapping, as array of elements like { synonym, original operator name}


getEngine

public Prolog getEngine()
Gets the engine to which the library is bound

Returns:
the engine

getPredicates

public java.util.List getPredicates()
gets the list of predicates defined in the library


getFunctors

public java.util.List getFunctors()
gets the list of functors defined in the library


getLinkedMethod

public java.lang.reflect.Method getLinkedMethod(Struct s)
Gets the method linked to a builtin (null value if the builtin has not any linked service)


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



DEIS, Universita' di Bologna, Sede di Cesena