7.1.3. Role

Roles are by far the most interesting type in PL. A Role is one of three things:

  1. A Simple Role, which is a Product of Properties;

  2. A Product Role, which is a Product of Roles;

  3. A Sum Role, which is a Sum of Roles.

Because we can transform a Product of Sums or a Sum of Products to a normal form that has just Simple Roles, we can simplify the above definitions by stating that a Product Role is a Product of Simple Roles (and a similar thing holds for Sum Roles). So, without loss of generality, we assume some normal form and just talk about Sums and Products of Simple Roles.

7.1.3.1. Role instances

Above we have defined Role types in terms of properties. Alternatively, we can define a Role type as a set of Role Instances. We say that the type is inhabited by its instances. An instance is a collection of values for Property Types.

A Role Type constrains the instances that can inhabit it. It requires that an inhabitant has a value for each of the Property Types that define the Role Type. Each such value must be one of the values of the Range type of the Property.

Here, it is of importance to distinguish the requirement that a role instance has at least the required properties, or that it has exactly the required properties. The latter we can interpret as a form of the closed world assumption (CWA): the descriptions are definite and something that is not described, is not the case.
7.1.3.2. Properties of a Product Role

A (normalised) Product Role is just a product of Simple Roles. A Simple Role is a product of properties. Hence, the properties of a Product Role is just the Product of the properties of all Roles in the product.

An instance of a Product Role of A and B is an instance of both A and B and carries all properties of A and all properties of B. Consider an instance ‘Joop’ of the product of Person and of PhysicalObject. As a Person, Joop has a familyname (Ringelberg). As a PhysicalObject, Joop has a dimension length (1.93 meter).

7.1.3.3. Properties of a Sum Role

A (normalised) Sum Role is just a sum of Simple Roles. A Simple Role is a product of properties. An instance of a Sum Role of A and B is either an A, or a B. What properties can we be sure of? Those that are in the intersection of the properties of A and B.

Consider a limited definition of a Vehicle as the Sum of either a Car or a Bicycle. This sum will have a property NumberOfWheels, but it will not have a property CapacityOfFuelTank – even though occasionally an instance of this sum will have both properties.

7.1.3.4. The Empty Role

We can imagine a Role with no properties: it is called the Empty Role. A Product of a Role with the Empty Role is just that Role itself; a Sum of a Role and the Empty Role is itself the Empty Role.

Explanation of EmptyRole x Role = Role. When we form a Product of Roles, we take the union of their properties. However, the EmptyRole does not have properties, so contributes nothing. Hence the result is just the original Role.

Explanation of EmptyRole + Role = EmptyRole. A Sum of Roles A and B is the role with the intersection of their properties. But the Empty Role has no properties, hence its intersection with any other Role is just an empty set – in other words the Empty Role itself.

Does the Empty Role have instances? A Role type constrains its instances by requiring that they have a value for each Property in the type. But the Empty Role has no Property Types, so is not much of a constraint. Hence, all role instances are an instance of the Empty Role.

An alternative interpretation, based on the CWA, holds that the role instance can have no properties as they are not described. Hence, we come to the opposite conclusion: just a role without any properties at all can be an instance of the Empty role. But what is a role without properties?
7.1.3.5. The Universal Role

Now turn to a Role with all properties: let’s call it the Universal Role. A product of the Universal Role and another Role is just the Universal Role; the Sum of the Universal Role and another Role is just that other Role.

Explanation of UniversalRole x Role = UniversalRole. When we form a Product of Roles, we take the union of their properties. However, the UniversalRole already has all properties, so Role contributes nothing. Hence the result is just the UniversalRole again.

Explanation of UniversalRole + Role = Role. A Sum of Roles A and B is the role with the intersection of their properties. But the Universal Role has all properties, hence its intersection with any other Role is just that other Role.

Universal Role instances

The Universal Role is funny when it comes to instances. To start with, an instance of the Universal Role is always an instance of any other Role (it always qualifies because it has values for all properties!).

But does the Universal Role have instances at all? Yes, infinitely many, because there are infinitely many properties and each instance of the Universal Role has a value for each of them. It follows that each such instance must be infinitely large.

Nevertheless, each ordinary Role has instances that the Universal Role does not have (because the Universal Role is the pickiest of all Role types). So, while being infinite, its instance set still is less than that of any other Role (for a discussion, see Instances of a Product, below).

Importantly, the infinite character of Universal Role instances severely limits its usefulness, however, because in our programs we only handle finite instances. In other words, in practice the Universal Role cannot be inhabited. So if we require that a Role be filled with instances of the Universal Role type, we say in that – again, in practice, in our programs - it will never be filled.

Empty Property construction

We have postulated a Property with a Range without values: the ValueLess property. If we concede that a Role instance with this Property cannot exist (because an instance must have a value for each Property), it follows that the Universal Role is an uninhabited type. After all, the Universal Role has all Properties, including the ValueLess Property.

So if we assume the ValueLess Property, the Universal Role has no instances, even in theory.