Previous topic  Top  Next topic  Print this Topic
 

Instance-of Statements

 

ObjectLogic provides so-called isa-F-atoms in order to assert that an object is an instance of a certain class. The class membership is denoted by a single colon separating two id-terms, representing the instance and the class. The following example lists three isa-F-atoms expressing that Peter and Paul are members of the class person, whereas car74 is a member of the class car.

peter:Person.

paul:Person.

car74:Car.

In contrast to other object-oriented languages, where every object instantiates exactly one class, ObjectLogic permits that an object is an instance of several classes that are not necessarily linked via the subclass relationship.