|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectubc.cs.JLog.Foundation.jRuleDefinitions
public class jRuleDefinitions
This class represents an ordered collection of jRule
s
of the same name and arity. This is designed for statically defined
rules that cannot change during a proof.
Field Summary | |
---|---|
protected boolean |
builtin
|
protected java.lang.String |
library
|
protected int |
rule_arity
|
protected java.lang.String |
rule_name
|
protected java.util.Vector |
rules
|
Constructor Summary | |
---|---|
protected |
jRuleDefinitions()
Constructor for use by sub-classes which set up the members themeselves. |
|
jRuleDefinitions(java.lang.String name,
int arity)
|
Method Summary | |
---|---|
void |
addRule(jRule fn)
Add a rule to the definitions. |
void |
addRuleFirst(jRule fn)
Add a rule to the begining of the rule definitions. |
void |
addRuleLast(jRule fn)
Add a rule to the end of the rule definitions. |
void |
clearRules()
|
void |
consult(jKnowledgeBase kb)
|
jPredicateGoal |
createGoal(jCompoundTerm t)
|
java.util.Enumeration |
enumRules()
|
int |
getArity()
Returns the arity of this instance. |
java.lang.String |
getLibrary()
Get the name of the library associated with this operator. |
java.lang.String |
getName()
Returns the name of this instance. |
jRule |
getRuleAt(int n)
|
boolean |
isBuiltin()
Determine if rules are builtin predicates. |
boolean |
match(iNameArity fn)
Determine if rules match the given name and arity. |
boolean |
prove(jPredicateGoal pg,
iGoalStack goals)
|
void |
removeRule(jRule fn)
Remove a rule from the rule definitions. |
boolean |
retry(jPredicateGoal pg)
|
boolean |
sameLibrary(java.lang.String lib)
|
void |
setLibrary(java.lang.String lib)
Set the name of the library associated with this rule definition. |
int |
size()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.util.Vector rules
protected java.lang.String rule_name
protected int rule_arity
protected java.lang.String library
protected boolean builtin
Constructor Detail |
---|
protected jRuleDefinitions()
public jRuleDefinitions(java.lang.String name, int arity)
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 boolean isBuiltin()
true
if these rules are builtin predicates,
false
otherwise.public void setLibrary(java.lang.String lib)
InvalidLibraryEntryException
in this
case). The default is a null
valued library.
lib
- The name of the library.public java.lang.String getLibrary()
null
.public boolean sameLibrary(java.lang.String lib)
public int size()
public jRule getRuleAt(int n)
public final boolean match(iNameArity fn)
fn
- The given name and arity.
true
if these rules have the same name and arity
as the given argument, false
otherwise.public void addRule(jRule fn)
fn
- The jRule
to add.public void addRuleFirst(jRule fn)
fn
- The jRule
to add.public void addRuleLast(jRule fn)
fn
- The jRule
to add.public void removeRule(jRule fn)
fn
- The jRule
to remove.public void clearRules()
public java.util.Enumeration enumRules()
public jPredicateGoal createGoal(jCompoundTerm t)
public void consult(jKnowledgeBase kb)
public final boolean prove(jPredicateGoal pg, iGoalStack goals)
public boolean retry(jPredicateGoal pg)
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 |