    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Interface JavaAgent.resource.cdl.KnowledgeBase

public interface KnowledgeBase

A KnowledgeBase is a set of KRSentences. A KnowledgeBase, like a KRSentence, does not enforce much functionality. The idea is rather that if a function can be defined for Class implementing a KnowledgeBase then the function name and order of parameters can be assumed as described below. This allows other classes to test for the existence of these functions and assume that they are not implemented if it cannot find them. Thus, here is the intentional interface definition:

- public KnowledgeBase();
  This constructor allows the construction of an empty KnowledgeBase that does not contain any knowledge yet.
- public boolean isInconsistent();
  This function tests whether this KnowledgeBase is inconsistent. It return `true` iff this KnowledgeBase is inconsistent.
- public Hashtable evaluate(KRSentence sent, Vector vars);
  This function is an extension of `evaluate` described below. Instead of just testing whether the given KRSentence follows from this KnowledgeBase this function tries to find a substitution for the Variables in the given Vector such that the given KRSentence follows from this KnowledgeBase. If no such substitution can be found it will return null.
- public void writeToStream(OutputStream os);
  This function writes the content of this KnowledgeBase to the given OutputStream.

See Also:
  KRSentence

##

assert(KRSentence)
  This function can be used to add knowledge to this KnowledgeBase.
clone()
  This function generates a copy of this KnowledgeBase that holds the same knowledge in the same formalism.
evaluate(KRSentence)
  This function takes a KRSentence and evaluates it against this KnowledgeBase.
sentences()
  This function returns an enumerator for the KRSentences in this KnowledgeBase.

##

clone

     public abstract Object clone()

  This function generates a copy of this KnowledgeBase that holds the same knowledge in the same formalism.

  Returns:
    a copy of this KnowledgeBase
  Overrides:
    clone in class Object

assert

     public abstract void assert(KRSentence sent) throws IllegalArgumentException, FormalismException

  This function can be used to add knowledge to this KnowledgeBase.

  Parameters:
    sent - the KRSentence holding the new knowledge
  Throws: IllegalArgumentException
    An exception will occur if the given KRSentence is null.
  Throws: FormalismException
    An exception will occur if the given KRSentence is not of the right Formalism.

evaluate

     public abstract boolean evaluate(KRSentence sent) throws IllegalArgumentException, FormalismException, IOException

  This function takes a KRSentence and evaluates it against this KnowledgeBase.

  Parameters:
    sent - the KRSentence to be evaluated
  Returns:
    `true` iff the given KRSentence could be derived from the KnowledgeBase
  Throws: IllegalArgumentException
    An exception will occur if the given KRSentence is null.
  Throws: FormalismException
    An exception will occur if the given KRSentence is not of the right Formalism.
  Throws: IOException
    An exception can occur if writing to a given OutputStream for tracing fails.

sentences

     public abstract Enumeration sentences()

  This function returns an enumerator for the KRSentences in this KnowledgeBase.

  Returns:
    an Enumeration for the KRSentences in this KnowledgeBase

    All Packages  Class Hierarchy  This Package  Previous  Next  Index