Why does circuits[1..*] not conform to Collections::Collection?

I’ve defined a multi-valued property like so:

private import CollectionFunctions::size;
part circuits[1..*] : Circuit {
    redefines supplyVoltage = nominalVoltage;
    redefines ratedCurrent default = ElectricGrid::ratedCurrent / size( circuits);
}

Doesn’t circuits represent a collection?

In Syside Modeler I get the error message “circuits does not conform to Collections::Collection“, while the error message disappears when I import the size function from SequenceFunctions, although circuits does not represent a sequence since it’s not ordered.

Doesn’t circuits represent a collection?

No, it (and everything else) implicitly represents a sequence. A collection is a library type from Collections.

But the multi-valued feature circuits[1..*] is, by default, unique and unordered, so isn’t its value a unique (unordered) collection?

Do you know on which page the KerML spec defines

  1. the concepts of a sequence and of sequence functions?
  2. what is the value of an unordered multi-valued feature like circuits[1..*]?

In fact, it’s quite confusing since

  1. In the Collections library, nonunique ordered collections are not called “sequences”, but “lists”.
  2. In the SequenceFunctions library, the input parameter of size is not required to be ordered, while the input parameters of most other functions are required to be ordered.

Having had a look through the specification, collection seems to have a different meaning than the Collection used in the KerML library. In the specification, collection seems to be used as a term for any number of values, sequence - an ordered collection, and library Collection - collections as elements of collections.

During evaluation, values will be evaluated as results of bound feature value expressions, or the features themselves otherwise. Yet another confusing aspect of the specification and grammar since both feature values and bodies are allowed on features. This is different to programming languages where values (similar to features) are only allowed to have expressions (feature values) assigned to them.

There is also an OrderedCollection, List is just subclassification (new type) of it. Collections are more like container data structures used in programming languages, while sequences are the implicitly constructed arrays/lists/vectors of elements. All values in KerML/SysML are implicitly sequences:

  • null - an empty sequence
  • 1 - a sequence of size 1
  • (1, 2) - a sequence of size 2 etc.

That is only one confusing part of the specification, there are many more. Like self, this, and that defined as library features instead of keywords despite having semantic meaning.

Thanks for your answer.

I’ll post a question about this for Ed Seidewitz.