SysML-v2-Pilot-Implementation icon indicating copy to clipboard operation
SysML-v2-Pilot-Implementation copied to clipboard

CollectionFunctions::size() returns unexpected value.

Open l-johnston opened this issue 3 months ago • 0 comments

I define the following in a Jupyter notebook.

package ArrayTest {
    attribute arr : Collections::Array = ((1,2), (3,4), (5,6));
    attribute arr_size : ScalarValues::Natural = CollectionFunctions::size(arr);
}

The evaluation

%eval ArrayTest::arr_size

returns

LiteralInteger 1 (003181e2-c969-4776-863d-90121656a037)

I note that there is zero documentation for functions like this in either the KerML standard or Pilot Implementation.

In Python for the same array, I get a reasonable result.

In [1]: import numpy as np
In [2]: arr = np.array([[1,2],[3,4],[5,6]])
In [3]: arr.size
Out[3]: 6

l-johnston avatar Oct 02 '25 14:10 l-johnston