|
||||||||||
| 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. |
Enumeration |
enumBase()
|
int |
getArity()
Returns the arity of this instance. |
jPredicateTerms |
getBase()
|
jPredicate |
getHead()
|
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. |
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 String getName()
iName
getName in interface iNameString containing name of this instance.public int getArity()
iNameArity
getArity in interface iNameArityint 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)
iConsultablejKnowledgeBase 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 iConsultablekb - the knowledge base which attempted proofs are based upon.public void consultReset()
iConsultablejKnowledgeBase 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 iConsultablepublic boolean isConsultNeeded()
iConsultable
isConsultNeeded in interface iConsultablefalse if cached values are valid,
true otherwise, if consult should be
called.public Enumeration enumBase()
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||