Opened 5 years ago

Last modified 3 years ago

#5580 new defect

--evaluateProtectedParameters should default to true

Reported by: Francesco Casella Owned by: Karim Adbdelhak
Priority: high Milestone:
Component: Backend Version:
Keywords: Cc:

Description

I scanned the specification looking for the various meanings of protected, trying to understand how should we deal with protected parameters.

In particular, Section 4.1 states:

A protected element, P, in classes and components may not be accessed via dot notation (e.g., A.P, a.P, a[1].P, a.b.P, .A.P; but there is no restriction on using P or P.x for a protected element P). They may not be modified or redeclared except for modifiers applied to protected elements in a base-class modification (not inside any component or class) and the modifier on the declaration of the protected element.

As far as final is concerned, Section 7.2.6 states

An element defined as final by the final prefix in an element modification or declaration cannot be modified by a modification or by a redeclaration

We all agree that the interpretation of final can be extended to mean that you can't change the parameter value at runtime. What I understand from the two excerpts of the specifications is that from this point of view there is no difference between a final parameter and a protected parameter: both cannot be modified. Redeclarations do not apply at runtime, because we are using statically compiled models,so they are ruled out anyway.

Conclusion:

  • there is no reason to treat protected parameters differently from final parameters
  • --evaluateProtectedParameters should default to true.

Change History (7)

comment:1 by Karim Adbdelhak, 5 years ago

--evaluateProtectedParameters=true only affects the backend module evaluateParameters. Should it be done by the frontend, just as final parameters?

From what i understand the backend module should be superfluous with the new frontend anyways. When i got some time i will check what breaks when switching it of, i would really like to remove it if it's not needed.

in reply to:  1 comment:2 by Francesco Casella, 5 years ago

Replying to Karim.Abdelhak:

--evaluateProtectedParameters=true only affects the backend module evaluateParameters. Should it be done by the frontend, just as final parameters?

I wonder if it may be the case that there is some further evaluation that can only be carried out after the backend has performed some optimizations and symbolic manipulations.

From what I understand the backend module should be superfluous with the new frontend anyways. When i got some time i will check what breaks when switching it off

Sounds like a good idea.

comment:3 by Lennart Ochel, 5 years ago

The only optimization running before the module evaluateParameters is inlining of functions with annotation Evaluate=true.

comment:4 by Francesco Casella, 5 years ago

Milestone: 1.14.01.16.0

Releasing 1.14.0 which is stable and has many improvements w.r.t. 1.13.2. This issue is rescheduled to 1.16.0

comment:5 by Francesco Casella, 4 years ago

Milestone: 1.16.01.17.0

Retargeted to 1.17.0 after 1.16.0 release

comment:6 by Francesco Casella, 4 years ago

Milestone: 1.17.01.18.0

Retargeted to 1.18.0 because of 1.17.0 timed release.

comment:7 by Francesco Casella, 3 years ago

Milestone: 1.18.0

Ticket retargeted after milestone closed

Note: See TracTickets for help on using tickets.