ubc.cs.JLog.Terms
Interface iConsultable

All Known Subinterfaces:
iList, iTerm
All Known Implementing Classes:
iPredicate, jAbs, jACos, jAdd, jAddEvent, jAfter, jAfterEqual, jAnimate, jAnimate_addshape, jAnimate_create, jAnimate_delete, jAnimate_getattr, jAnimate_getobject, jAnimate_getshape, jAnimate_init, jAnimate_move, jAnimate_objects, jAnimate_path, jAnimate_removeshape, jAnimate_rotate, jAnimate_setattr, jAnimate_setlevel, jAnimate_setmagnify, jAnimate_setview, jAnimate_shapes, jAnimate_update, jAppendArray, jArg, jASin, jAssert, jAsserta, jAssertz, jATan, jATan2, jAtom, jBefore, jBeforeEqual, jBinaryBuiltinPredicate, jBitwiseConjunction, jBitwiseDisjunction, jBitwiseExclusiveDisjunction, jBitwiseLeftShift, jBitwiseNegation, jBitwiseRightShift, jBuiltinPredicate, jBuiltinRule, jCall, jCallN, jCeiling, jClause, jCommand, jCompare, jCompoundTerm, jConjunctTerm, jCons, jConvertArray, jCopyTerm, jCos, jCreate3, jCreate4, jCreateArray, jCurrentOpList, jCut, jDBConnect, jDBDisconnect, jDBExecute, jDBExecuteParam, jDBSelect, jDCG, jDynamic, jEnumerateVariablesArray, jEqual, jEquivalence, jEquivalent, jExists, jExp, jExpandTerm, jFail, jFloor, jFSDelete, jFSExists, jFSisFileOrDir, jFSLength, jFSListDir, jFSMakeDir, jFSRead, jFSWrite, jFunctor, jGetArrayElement, jGreaterThan, jGreaterThanEqual, jIf, jImport, jInteger, jIntegerArithmetic, jIntegerDivide, jIntegerOnlyArithmetic, jIntersectArray, jInvoke4, jInvoke5, jIs, jIsAtom, jIsAtomic, jIsCallable, jIsCompound, jIsGround, jIsInteger, jIsList, jIsNonVariable, jIsNumber, jIsReal, jIsSimple, jIsType, jIsVariable, jJ2P, jKeysort, jLessThan, jLessThanEqual, jList, jListPair, jLoadLibrary, jLog, jLog10, jLog2, jLogBase, jLookup, jMax, jMin, jMinus, jMod, jMultiply, jName, jNaryBuiltinPredicate, jNotEqual, jNotEquivalence, jNotEquivalent, jNotUnify, jNullList, jNumericComparison, jObject, jOp, jOperator, jOr, jOrPredicate, jP2J, jPlus, jPow, jPredicate, jPredicateTerms, jQuadaryBuiltinPredicate, jRandom, jRead, jReal, jRealArithmetic, jRealDivide, jRealUnaryArithmetic, jRegister, jRepeat, jRetract, jRound, jRule, jSetArrayElement, jSin, jSort, jSqrt, jStatic, jSubtract, jSubtractArray, jTan, jTerm, jTermToList, jTime, jTrinaryBuiltinPredicate, jTrue, jTruncate, jUnaryArithmetic, jUnaryBuiltinPredicate, jUnaryOperator, jUnify, jUnionArray, jUnregister, jVariable, jWrite

public interface iConsultable

iConsultable is the interface for classes that may need to access the knowledge base before any proof attempts are made. Usually such consulting is done after the knowledge base changes, such as when a prolog source is consulted. The usual purpose of such consulting is to prefetch and cache the knowledge base entries so that a search of the knowledge base during the proof phase is not required.

Author:
Glendon Holst

Method Summary
 void consult(jKnowledgeBase kb)
          Consult the given jKnowledgeBase and cache any invariant values (those which would not change until the next time the jKnowledgeBase changes).
 void consultReset()
          Called when the jKnowledgeBase changes.
 boolean isConsultNeeded()
          Determine if cached values already exist and hence if consulting is required.
 

Method Detail

consult

void consult(jKnowledgeBase kb)
Consult the given jKnowledgeBase and cache any invariant values (those which would not change until the next time the jKnowledgeBase changes). Where possible, consultable objects should minimize computation and assume that any cached values are still accurate.

Parameters:
kb - the knowledge base which attempted proofs are based upon.

consultReset

void consultReset()
Called when the jKnowledgeBase changes. Should set all cached values to dirty so that a following call to consult would perform a full lookup as required.


isConsultNeeded

boolean isConsultNeeded()
Determine if cached values already exist and hence if consulting is required. If object does not knowimmediatly whether consulting is needed, then assuming it is required.

Returns:
false if cached values are valid, true otherwise, if consult should be called.