|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectubc.cs.JLog.Foundation.jRule
public class jRule
This class represents a rule of the form Head :- Base, where Head is a predicate and Base is a term of predicates.
Field Summary | |
---|---|
protected boolean |
all_variables
|
protected jPredicateTerms |
base
|
protected jPredicate |
head
|
protected jVariableVector |
variables
|
Constructor Summary | |
---|---|
jRule(jPredicate h,
jPredicateTerms b)
|
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. |
java.util.Enumeration |
enumBase()
|
int |
getArity()
Returns the arity of this instance. |
jPredicateTerms |
getBase()
|
jPredicate |
getHead()
|
java.lang.String |
getName()
Returns the name of this instance. |
jTerm |
getUnifiedBase(jCompoundTerm input_goal,
jUnifiedVector unified)
Test if rule head will unify. |
boolean |
isConsultNeeded()
Determine if cached values already exist and hence if consulting is required. |
java.lang.String |
toString()
|
boolean |
unify(jPredicateGoal pg,
iGoalStack goals)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected jPredicate head
protected jPredicateTerms base
protected jVariableVector variables
protected boolean all_variables
Constructor Detail |
---|
public jRule(jPredicate h, jPredicateTerms b)
Method Detail |
---|
public java.lang.String getName()
iName
getName
in interface iName
String
containing name of this instance.public int getArity()
iNameArity
getArity
in interface iNameArity
int
whose value is the arity of this instance.public jPredicate getHead()
public jPredicateTerms getBase()
public boolean unify(jPredicateGoal pg, iGoalStack goals)
public jTerm getUnifiedBase(jCompoundTerm input_goal, jUnifiedVector unified)
jTerm
if it head unifies, null
otherwise.public void consult(jKnowledgeBase kb)
iConsultable
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.
consult
in interface iConsultable
kb
- the knowledge base which attempted proofs are based upon.public void consultReset()
iConsultable
jKnowledgeBase
changes. Should set all cached values to
dirty so that a following call to consult
would perform a full lookup
as required.
consultReset
in interface iConsultable
public boolean isConsultNeeded()
iConsultable
isConsultNeeded
in interface iConsultable
false
if cached values are valid,
true
otherwise, if consult
should be
called.public java.util.Enumeration enumBase()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |