ubc.cs.JLog.Foundation
Class jKnowledgeBase

java.lang.Object
  extended by ubc.cs.JLog.Foundation.jKnowledgeBase

public class jKnowledgeBase
extends java.lang.Object

The Prolog rule definitions database.

Author:
Glendon Holst

Field Summary
protected  java.util.Hashtable definitions
           
 
Constructor Summary
jKnowledgeBase()
           
 
Method Summary
 void addRule(jRule r)
           
 void addRuleDefinitions(jRuleDefinitions rds)
          Use this method to set all the rules for a particular predicate definition at once.
 void addRuleFirst(jRule r)
           
 void addRuleLast(jRule r)
           
 void clearRules()
           
 void consult()
           
 java.util.Enumeration enumDefinitions()
           
protected  java.lang.String getKeyString(iNameArity r)
           
 jRuleDefinitions getRuleDefinitionsMatch(iNameArity r)
          Access the set of rules matching the given name and arity.
 void makeRuleDefinitionDynamic(iNameArity r)
          Convert a set of rules matching the given name and arity to dynamic rules.
 void removeRule(jRule r)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

definitions

protected java.util.Hashtable definitions
Constructor Detail

jKnowledgeBase

public jKnowledgeBase()
Method Detail

addRuleDefinitions

public void addRuleDefinitions(jRuleDefinitions rds)
Use this method to set all the rules for a particular predicate definition at once. Unlike the separate addRule methods, this method only updates the rule definition if it does not already exist. It is an error if the definition already exists and belongs to a different library.

Parameters:
rds - The rule definition to add.

addRule

public void addRule(jRule r)

addRuleFirst

public void addRuleFirst(jRule r)

addRuleLast

public void addRuleLast(jRule r)

removeRule

public void removeRule(jRule r)

clearRules

public void clearRules()

enumDefinitions

public java.util.Enumeration enumDefinitions()

makeRuleDefinitionDynamic

public void makeRuleDefinitionDynamic(iNameArity r)
Convert a set of rules matching the given name and arity to dynamic rules.

Parameters:
r - The name and arity of the rule set to convert.

getRuleDefinitionsMatch

public jRuleDefinitions getRuleDefinitionsMatch(iNameArity r)
Access the set of rules matching the given name and arity.

Parameters:
r - The name and arity of the rule set to retrieve.
Returns:
The jRuleDefinitions rule set, or null if it doesn't exist.

consult

public void consult()

getKeyString

protected java.lang.String getKeyString(iNameArity r)