R1131 - modelint/shlaer-mellor-metamodel GitHub Wiki

R1131 / 1:Mc

Type Action operates on exactly one Scalar

Scalar is operated on by exactly one Type Action


Here we reflect the Darwen / Date rule that a type supports a number of operators. In the metamodel we concern ourselves only with Scalar types since we already model operations for manipulating relation types. Scalar's, however, are opaque to Shlaer-Mellor so we rely on an external typing system.

Thus, any given Type Action is defined on (operates on) a Scalar type.

And any Scalar supports any number of Type Actions.

In fact any type must support at least one operator to be useful. But the relationship is conditional because we exclude common computational types like +, *, -, / from consideration. For example:

a = b + c

Let's assume that all three labeled Scalar Flows in this Scrall statement are typed as Integer. Rather than use a Type Action, we'll parse this into a General Computation action. During execution, we can just convert the string into a platform specific computation retaining the + addition operator.

So, for now at least, Type Actions apply only to named operations rather than infix/postfix operation symbols.