10.3.3. State complicates matters
In the example above, perspectives were valid in the root state of their objects or subjects. When a perspective is only valid in some state, things get complicated very quickly when we want to combine perspectives.
The relation between two (macro) states can be thought of as a Venn-diagram of two circles representing the micro-states of both (macro) states. The diagram allows for three separate regions, where the perspectives may only be added in the union (the overlap of the two circles).
This would require we compute, in type time, the logical conjunction of both states’ condition. This we will not do. It requires logical reasoning beyond the complexity we are willing to tackle.
Of course, we can just combine both conditions and see what happens in runtime. However, we then might create conditions that will never evaluate to true but consume resources nevertheless.
Also, picture once again the Venn-diagram. It may be that one state is entirely inside the other. We would have no way of knowing it and would still have a separate perspective for the contained state. Again, a waste of resources.
10.3.3.1. What we will allow
Instead of reasoning about state conditions, we will allow
-
a perspective to be conditional on an Aspect state (this is a modelling facility: one can refer to Aspect state in an in state clause);
-
a non-ground state Aspect perspective to be added to a ground state specialised role’s perspective;
-
an ground state Aspect perspective to be added to a non-ground state specialised role’s perspective;
-
two perspectives to be added when conditional on the same state.
With regard to the formerly discussed Venn-diagram, this reduces to these cases:
-
the states of the specialised role perspective and the Aspect perspective are equal;
-
the specialised role perspective is valid in the (a) ground state, while the Aspect perspective is valid in a named state. In this case, the intersection coincides with the Aspect state;
-
The intersection coincides with the specialised role state perspective.
10.3.3.2. Aspect states that may be used
We only allow an Aspect state to be used in contexts or roles that have the type that has that state, as aspect.