All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----jtelos.cpp.cppKB
A Telos KB consists of the built-in Telos objects and their associations, as well as propositions corresponding to any object definitions processed by the system.
Instances of this class have methods for adding and removing propositions from themselves. Moreover, instances of this class provide methods for changing the relationships between the objects they contain. Finally instances of this class provide methods for retrieving all the propositions they contain.
Every instance of this class has access to unique cppOmegaIndividualClass objects of the following built-in Omega level individual classes:
Proposition
Class
Individual
IndividualClass
OmegaClass
Every instance of this class has access to unique cppOmegaAttributeClass objects of the following built-in Omega level attribute classes:
Attribute
AttributeClass
Single
Every instance of this class has access to unique cppIndividual objects if the following built-in "level" classes:
Token
SClass
M1Class
M2Class
M3Class
Every instance of this class has access to unique cppIndividual objects of the following built-in "primitive" classes:
Integer
String
Real
The above cppPropositions can be accessed through the querying methods
individual() and attribute(), as appropriate.
This implementation does not define the Omega level attribute class
Necessary and does not define any builtin "level" class at a
higher level of instantiation than M3Class.
name and
path path.
telosName in the KB.
identifier in the
KB.
declarer, categories categories, label
label and target target.
identifier at the level level.
public cppKB(String name,
String path)
name and
path path. If the file path is nonempty, it is
loaded into the kb. The contents of the file path must NOT
have any syntax or semantic errors. The file path should be
the file produced automatically by the C++ telos system when it closes the
C++ mirror of this KB. Being automatically generated it should contain no
semantic errors. Checksums could be implemented by the user of this class
to ensure that the load file is not corrupted
public final void closeKB()
public String name()
public int size()
public boolean containsOnlyBuiltIns()
public boolean isEmpty()
public Attribute[] attributes()
public Individual[] individuals()
public Proposition[] builtIns()
public Attribute attribute(String telosName)
telosName in the KB. If the method finds an attribute with
telosName telosName in the KB, it returns it;
otherwise, it throws an AttributeNotInKBException exception. See the
method telosName() in the interface NamedObject
for a description of the naming conventions for attributes.
It is assumed that the string telosName is syntactically
correct (as it should be if it is produced automatically).
telosName.
public Individual individual(String telosName)
identifier in the
KB. If the method finds an individual with the given information in the KB,
it returns it; otherwise, it throws an IndividualNotInKBException exception.
identifier.
public Attribute newAttribute(Proposition declarer,
String categories[],
String label,
PropositionOrPrimitive target)
declarer, categories categories, label
label and target target. Note that the passed
information to this method maps, via the procedure outlined in
NamedObject, to a unique attribute telosName;
conversely, an attribute telosName uniquely specifies the
declarer, categories, label and target of an attribute.
As in newIndividual(...), if there is an attribute with
the same telosName already in the KB, the already created attribute is
returned. Otherwise an attribute with the passed declarer, categories,
label and target is TELLed into the KB. If no exceptions occur, the newly
created attribute is returned.
It is assumed that declarer and target are not null, and that categories is not an empty list. It is up to the caller to ensure this.
public Individual newIndividual(String identifier,
int level)
identifier at the level level. As in
newAttribute(...), if there is an individual with the same
identifier already in the KB, the already created individual
is returned. Otherwise an individual with the passed identifier and level
is TELLed into the KB. If no exceptions occur, the newly created individual
is returned.
public void removeAndDeleteProposition(Proposition prop)
InstancesExistException is thrown while in the latter case a
DeletedObjectAccessedException is thrown.
public void load(String fileName)
public void save()
public void RETELL(String untellInput,
String tellInput)
UNTELL and then
TELL instead of RETELL.
The definitions in untellInput and tellInput can be in either s-expression format or in "text" format (but not in both!). Syntax and semantic errors are reported by throwing a RetellException.
public void fileRETELL(String untellInputFileName,
String tellInputFileName)
UNTELL and then TELL
instead of RETELL.
The definitions in untellInputFileName and tellInputFileName can be in either s-expression format or in "text" format (but not in both!). Syntax and semantic errors should be reported by throwing a RetellException.
public void TELL(String tellInput)
public void fileTELL(String tellInputFileName)
public void UNTELL(String untellInput)
public void fileUNTELL(String untellInputFileName)
public void wipe()
All Packages Class Hierarchy This Package Previous Next Index