Skip to content

Missing variability rules for 'size' #3778

@henrikt-ma

Description

@henrikt-ma

This is a complement to #2240.

When reading the definition of size in https://specification.modelica.org/master/arrays.html#modelica:size-of-dim, I can't see anything that would forbid this:

model SizeVariability
  Real[:, :] a = fill(1.0, 2, 3);
  Integer d = if time < 0.5 then 1 else 2;
  Integer s = size(a, d);
end SizeVariability;

However, the variability rules don't cover size(a, d) where d is a non-parameter.

Shouldn't the variability of size(a, d) simply be defined as the variability of d, capped from below to evaluable (which is the variability requirement for the dimensions given to a)?

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions