Reported by stefanv on 6 Mar 2017 18:06 UTC
Section 6.6 of the 3.3 specification states:
If A is an array expression then B must also be an array expression, and ndims(A)=ndims(B). The type compatible expression an array expression with elements compatible with the elements of both A and B. If both size(A) and size(B) are known and size(A)=size(B) then this defines the size of the type compatible expression, otherwise the size of the expression is not known until the expression is about to be evaluated. In case of an if-expression the size of the type compatible expression is defined based on the branch selected, and for other cases size(A)=size(B) must hold at this point..
There are three issues with this, one that needs further clarification, and two that are just grammatical:
-
I think it must be clarified that in the case where the size of the expression is defined based on the selected branch, this branch must be selected by a condition that is a parameter expression. I.e., the if-expression cannot result in different sizes at different times during the simulation of a model.
-
The second sentence, "The type compatible expression an array expression with elements compatible with the elements of both A and B.", seems to be missing some word(s).
-
There are two periods at the end of the paragraph.
(I have put this down for MLS 3.4 since there is not yet a Design94 milestone.)
Migrated-From: https://trac.modelica.org/Modelica/ticket/2165
Reported by stefanv on 6 Mar 2017 18:06 UTC
Section 6.6 of the 3.3 specification states:
If A is an array expression then B must also be an array expression, and ndims(A)=ndims(B). The type compatible expression an array expression with elements compatible with the elements of both A and B. If both size(A) and size(B) are known and size(A)=size(B) then this defines the size of the type compatible expression, otherwise the size of the expression is not known until the expression is about to be evaluated. In case of an if-expression the size of the type compatible expression is defined based on the branch selected, and for other cases size(A)=size(B) must hold at this point..
There are three issues with this, one that needs further clarification, and two that are just grammatical:
I think it must be clarified that in the case where the size of the expression is defined based on the selected branch, this branch must be selected by a condition that is a parameter expression. I.e., the if-expression cannot result in different sizes at different times during the simulation of a model.
The second sentence, "The type compatible expression an array expression with elements compatible with the elements of both A and B.", seems to be missing some word(s).
There are two periods at the end of the paragraph.
(I have put this down for MLS 3.4 since there is not yet a Design94 milestone.)
Migrated-From: https://trac.modelica.org/Modelica/ticket/2165