All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jtelos.cpp.cppProposition

java.lang.Object
   |
   +----jtelos.cpp.cppProposition

public abstract class cppProposition
extends Object
implements Proposition
All Telos objects in a Telos KB, excepting the three primitive types Integer, Real and String, are represented by and accessed through (Java) instances of the four (Java) specializations of this class: cppAttribute, cppIndividual, cppOmegaAttributeClass and cppOmegaIndividualClass.

All cppProposition objects "belong" to a cppKB object. This cppKB object can be retrieved by the method kb(). Each cppKB object provides an interface to a C++ Telos KB object. Each cppProposition object belonging to a given cppKB object then represents and provides an interface to precisely one Telos proposition in the C++ Telos KB that is represented by the cppKB object. To be more precise, each instance of one of the four (Java) specializations of cppProposition (i.e., each instance of cppAttribute, cppIndividual, cppOmegaAttributeClass and cppOmegaIndividualClass) represents and provides an interface to precisely one Telos proposition in the C++ Telos KB represented by the cppKB object the instance belongs to. Indeed the class cppProposition is abstract and hence it can not be instantiated. To further emphasize this, the constructor for this class is protected.

As mentioned above, only one cppProposition object can reference a single C++ telos proposition. Whenever a Telos proposition from the C++ KB must be retrieved by a jtelos.cpp package object, a cppProposition object which references the C++ Telos proposition is returned. The C++ Telos library keeps track of which propositions from each C++ Telos KB have cppProposition object references. The following two possible actions are taken whenever a C++ object is requested by a jtelos.cpp package object: 1) the C++ Telos library returns a reference to the cppProposition object referencing the C++ Telos proposition whenever such an object exists; or 2) a cppProposition object referencing the C++ Telos proposition is allocated (with a reference to the newly created cppProposition object stored in a look-up table by the C++ library) and its reference returned whenever no cppProposition object already exists referencing the C++ proposition. Note that this paradigm allows one to meaningfully compare cppProposition objects using their references.

See Also:
cppIndividual, cppAttribute, PrimitiveType, cppKB, Proposition

Method Index

 o addDirectAncestors(Proposition[])
Makes all the propositions in the passed array ancestors of the proposition.
 o addDirectParents(Proposition[])
Makes all the propositions in the passed array parents of the proposition.
 o allAncestors()
All the propositions of which this proposition is a Telos instance.
 o allChildren()
All the propositions which specialize this proposition in Telos.
 o allInstances()
All the propositions of which this proposition is a Telos ancestor.
 o allParents()
All the propositions that this proposition specializes in Telos.
 o attributes()
All the attributes declared or inherited by this proposition in Telos.
 o attributes(String[], String)
All the attributes for this proposition in precisely the categories named in the first parameter and whose label also match the second parameter.
 o categories()
If this proposition is an attribute, this method returns the labels (without duplicates) of the attributes this attribute instantiates.
 o deleted()
Returns true iff the C++ mirror of this object has been deleted.
 o directAncestors()
The propositions of which this proposition is an explicit Telos instance.
 o directAttributes()
All the attributes directly declared by this proposition in Telos.
 o directAttributes(String[], String)
All the attributes for this proposition in precisely the categories named in the first parameter and whose label also match the second parameter.
 o directChildren()
The propositions directly specializing this proposition in Telos.
 o directInstances()
The propositions of which this proposition is an explicit Telos ancestor.
 o directParents()
The propositions that this proposition directly specializes in Telos.
 o from()
This returns the Telos source/declarer for this proposition.
 o inheritedAttributes()
All the attributes directly declared by this proposition in Telos.
 o inheritedAttributes(String[], String)
All the attributes for this proposition in precisely the categories named in the first parameter and whose label also match the second parameter.
 o isAncestorOf(Proposition)
Returns true if this proposition is a Telos ancestor of the parameter.
 o isBuiltin()
This returns true iff the proposition is one of the Telos builtin individuals.
 o isChildOf(Proposition)
Returns true if this proposition is a Telos child (subclass) of the parameter.
 o isInstanceOf(Proposition)
Returns true if this proposition is a Telos instance of the parameter.
 o isParentOf(Proposition)
Returns true if this proposition is a Telos parent (superclass) of the parameter.
 o kb()
The KB in which this proposition resides.
 o label()
This returns the Telos label for this proposition.
 o level()
This returns the level of Telos instantiation for this proposition.
 o referencedBy()
The attributes in this's KB that reference in Telos this proposition.
 o removeDirectAncestor(Proposition)
Removes the passed ancestor from this proposition's "direct ancestors" list and removes this proposition from that ancestor's "instances" list.
 o removeDirectAttr(Attribute)
This removes the passed attribute from the proposition.
 o removeDirectParent(Proposition)
Removes the passed parent from this proposition's "direct parents" list and removes this proposition from that parent's "direct children" list.
 o setDeclared(boolean)
This method is not supported since it is incompatible with C++ telos.
 o setLevel(int)
This method is not supported since it is incompatible with C++ telos.
 o telosName()
Implements the method described in NamedObject.
 o to()
This returns the Telos target/destination for this proposition.
 o toString()
Returns telosName();

Methods

 o deleted
 public boolean deleted()
Returns true iff the C++ mirror of this object has been deleted.

 o toString
 public String toString()
Returns telosName();

Overrides:
toString in class Object
 o telosName
 public String telosName()
Implements the method described in NamedObject. This is overriden in cppAttribute.

See Also:
telosName, telosName
 o kb
 public KB kb()
The KB in which this proposition resides. There may be several KB's available in Telos repositories, so Telos objects with the same name may exist with different state in each KB (each of them is a different Telos object sharing the same unique identifier within the KB).

See Also:
kb
 o from
 public Proposition from()
This returns the Telos source/declarer for this proposition.

See Also:
from
 o label
 public String label()
This returns the Telos label for this proposition.

See Also:
telosName
 o to
 public PropositionOrPrimitive to()
This returns the Telos target/destination for this proposition.

See Also:
to
 o level
 public final int level()
This returns the level of Telos instantiation for this proposition.

See Also:
Levels
 o directInstances
 public final Proposition[] directInstances()
The propositions of which this proposition is an explicit Telos ancestor.

Throws: TokenAccessedAsAClassException
when this is a Token.
See Also:
directAncestors, allAncestors, allInstances
 o directAncestors
 public final Proposition[] directAncestors()
The propositions of which this proposition is an explicit Telos instance.

See Also:
directInstances, allInstances, allAncestors
 o directChildren
 public final Proposition[] directChildren()
The propositions directly specializing this proposition in Telos.

Throws: TokenAccessedAsAClassException
when this is a Token.
See Also:
directParents, allParents, allChildren
 o directParents
 public final Proposition[] directParents()
The propositions that this proposition directly specializes in Telos.

Throws: TokenAccessedAsAClassException
when this is a Token.
See Also:
directChildren, allChildren, allParents
 o allInstances
 public final Proposition[] allInstances()
All the propositions of which this proposition is a Telos ancestor.

Throws: TokenAccessedAsAClassException
when this is a Token.
See Also:
directAncestors, allAncestors, directInstances
 o allAncestors
 public final Proposition[] allAncestors()
All the propositions of which this proposition is a Telos instance.

See Also:
directInstances, allInstances, directAncestors
 o allChildren
 public final Proposition[] allChildren()
All the propositions which specialize this proposition in Telos.

Throws: TokenAccessedAsAClassException
when this is a Token.
See Also:
directParents, allParents, directChildren
 o allParents
 public final Proposition[] allParents()
All the propositions that this proposition specializes in Telos.

Throws: TokenAccessedAsAClassException
when this is a Token.
See Also:
directChildren, allChildren, directParents
 o categories
 public String[] categories()
If this proposition is an attribute, this method returns the labels (without duplicates) of the attributes this attribute instantiates. This method is overriden for cppIndividuals to throw an IndividualAccessedAsAnAttributeException

Note that an attribute may be in several categories sharing the same label. So the number of categories will always be less than or equal to the number of ancestors for this attribute. The directAncestors() and allAncestors() methods in this class return arrays of the actual ancestors of the attribute.

See Also:
directAncestors, allAncestors, categories
 o attributes
 public Attribute[] attributes()
All the attributes declared or inherited by this proposition in Telos.

See Also:
attributes
 o attributes
 public Attribute[] attributes(String categories[],
                               String attrLabel)
All the attributes for this proposition in precisely the categories named in the first parameter and whose label also match the second parameter. If the label is null, then we return the attributes for this proposition matching the categories. The returned attributes may be directly declared by this proposition or they may be inherited.

See Also:
attributes
 o directAttributes
 public Attribute[] directAttributes()
All the attributes directly declared by this proposition in Telos.

Throws: AttributeNotFoundException
when no matches are found.
See Also:
directAttributes
 o directAttributes
 public Attribute[] directAttributes(String categories[],
                                     String attrLabel)
All the attributes for this proposition in precisely the categories named in the first parameter and whose label also match the second parameter. If the label is null, then we return the attributes for this proposition matching the categories. The returned attributes are restricted to those directly declared by this proposition.

Throws: AttributeNotFoundException
when no matches are found.
See Also:
directAttributes
 o inheritedAttributes
 public Attribute[] inheritedAttributes()
All the attributes directly declared by this proposition in Telos.

Throws: AttributeNotFoundException
when no matches are found.
Throws: TokenAccessedAsAClassException
when this is a Token since tokens do not inherit attributes.
See Also:
inheritedAttributes
 o inheritedAttributes
 public Attribute[] inheritedAttributes(String categories[],
                                        String attrLabel)
All the attributes for this proposition in precisely the categories named in the first parameter and whose label also match the second parameter. If the label is null, then we return the attributes for this proposition matching the categories. The returned attributes are restricted to only those inherited by this proposition.

Throws: AttributeNotFoundException
when no matches are found.
Throws: TokenAccessedAsAClassException
when this is a Token since tokens do not inherit attributes.
See Also:
inheritedAttributes
 o referencedBy
 public Attribute[] referencedBy()
The attributes in this's KB that reference in Telos this proposition.

See Also:
referencedBy
 o isInstanceOf
 public final boolean isInstanceOf(Proposition candidate)
Returns true if this proposition is a Telos instance of the parameter.

 o isChildOf
 public final boolean isChildOf(Proposition candidate)
Returns true if this proposition is a Telos child (subclass) of the parameter.

 o isAncestorOf
 public final boolean isAncestorOf(Proposition candidate)
Returns true if this proposition is a Telos ancestor of the parameter.

 o isParentOf
 public final boolean isParentOf(Proposition candidate)
Returns true if this proposition is a Telos parent (superclass) of the parameter.

 o isBuiltin
 public final boolean isBuiltin()
This returns true iff the proposition is one of the Telos builtin individuals.

 o setDeclared
 public final void setDeclared(boolean isDeclared)
This method is not supported since it is incompatible with C++ telos.

 o setLevel
 public final void setLevel(int level)
This method is not supported since it is incompatible with C++ telos.

 o addDirectAncestors
 public void addDirectAncestors(Proposition newDirectAncestors[])
Makes all the propositions in the passed array ancestors of the proposition.

Throws: TellException
is thrown if any semantic errors are encountered.
Throws: ImmutableBuiltInException
is thrown if this is a builtin.
See Also:
TELL, RETELL
 o addDirectParents
 public void addDirectParents(Proposition newDirectParents[])
Makes all the propositions in the passed array parents of the proposition.

Throws: TellException
is thrown if any semantic errors are encountered.
Throws: ImmutableBuiltInException
is thrown if this is a builtin.
See Also:
TELL, RETELL
 o removeDirectAncestor
 public void removeDirectAncestor(Proposition ancestor)
Removes the passed ancestor from this proposition's "direct ancestors" list and removes this proposition from that ancestor's "instances" list. Note that it does not remove the ancestor from the KB.

Preconditions: Neither this proposition nor the removed ancestor can be builtins. Also, this proposition cannot have instances.

Throws: UntellException
is thrown if any semantic errors are encountered.
Throws: ImmutableBuiltInException
is thrown if this or the ancestor to be removed are built-in classes.
 o removeDirectParent
 public void removeDirectParent(Proposition parent)
Removes the passed parent from this proposition's "direct parents" list and removes this proposition from that parent's "direct children" list. Note that it does not remove the parent from the KB. Note also, that since IsA is a transitive relation and Telos supports multiple inheritance, the removed parent may still be an indirect parent of this proposition. For instance, this happens when an unremoved parent's parent is the removed direct parent.

Preconditions: Neither this proposition nor the parent to be removed can be built-in propositions. Moreover, this proposition cannot have instances.

Throws: UntellException
is thrown if any semantic errors are encountered.
Throws: ImmutableBuiltInException
is thrown if this or the ancestor to be removed are built-in classes.
 o removeDirectAttr
 public void removeDirectAttr(Attribute attr)
This removes the passed attribute from the proposition. Note that since each attribute is declared by only one proposition, this also deletes the attribute from the KB.

Preconditions: The attribute cannot be a builtin. There cannot be any instances of the attribute's declarer (from/source proposition) in the KB.

Throws: UntellException
is thrown if any semantic errors are encountered.
Throws: ImmutableBuiltInException
is thrown if the attribute to be removed is a built-in class.

All Packages  Class Hierarchy  This Package  Previous  Next  Index