Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#5821 closed defect (fixed)

New frontend fails with StateGraph2.Transition

Reported by: ahaumer@… Owned by: somebody
Priority: blocker Milestone: 1.16.0
Component: New Instantiation Version:
Keywords: Cc: christian@…

Description

Consider the enclosed small library, developing an example with StateGraph2.

The new frontend fails
[1] 20:39:28 Translation Error
[Modelica_StateGraph2: 12190:5-12190:45]: The second argument of Connections.branch must be on the form A.R, where A is a connector and R an over-determined type/record.

The old frontend throws a warning but translates successfully
[2] 20:40:58 Translation Warning
[Modelica_StateGraph2: 12195:5-12201:3]: Usage of non-standard operator (not specified in the Modelica specification): Connections.uniqueRoot. Functionality might be partially supported but is not guaranteed.

Attachments (2)

YD.mo (7.2 KB ) - added by anonymous 5 years ago.
YD.Test.svg (19.6 KB ) - added by Adrian Pop 5 years ago.
The graph of the system.

Download all attachments as: .zip

Change History (8)

by anonymous, 5 years ago

Attachment: YD.mo added

comment:1 by Adrian Pop, 5 years ago

The error message in the new front-end is correct. The line reads:

Connections.branch(inPort[i].node, node);

which is not according to the Modelica Specification because node is not of the form connectorName.overconstrainedRecord. One would need to put the node inside a connector and use that to make it correct. Or the Modelica spec needs changing.


https://specification.modelica.org/master/Ch9.html#overconstrained-equation-operators-for-connection-graphs

Connections.branch(A.R,B.R);
Defines a required spanning-tree edge from the overdetermined type or record instance R in connector instance A to the corresponding overdetermined type or record instance R in connector instance B for a virtual connection graph. This function can be used at all places where a connect(..) statement is allowed [e.g., it is not allowed to use this function in a when-clause. This definition shall be used if in a model with connectors A and B the overdetermined records A.R and B.R are algebraically coupled in the model, e.g., due to B.R = f(A.R, <other unknowns>)].


I guess we could allow it and issue a warning but then is really not clear what we should do about it. Just add a non-connector reference to the overconstrained connection graph?

Last edited 5 years ago by Adrian Pop (previous) (diff)

by Adrian Pop, 5 years ago

Attachment: YD.Test.svg added

The graph of the system.

comment:2 by Adrian Pop, 5 years ago

The fix for NF is part of PR: https://github.com/OpenModelica/OpenModelica/pull/713
I'm not sure we should merge this but we'll discuss it.

comment:3 by Adrian Pop, 5 years ago

Resolution: fixed
Status: newclosed

Fixed in 3ee004/OpenModelica, now the NF gives a warning and allows the non-standard operators and non-standard operator usage.

Last edited 5 years ago by Adrian Pop (previous) (diff)

comment:4 by Francesco Casella, 5 years ago

@ahaumer, this is from the main page of the StateGraph2 library on github:

Warning: Modelica_StateGraph2 is not fully Modelica compliant and might never be. Modelica 3.3 introduced state machines as a replacement for clocked systems. However, for non-clocked systems the situation is less clear. One possibility is that some of the good ideas from this library are integrated in Modelica.StateGraph in a Modelica compliant way.

Given these premises, we have marked the StateGraph2 library as currently not supported by OpenModelica, see #5726. Our priority is currently in supporting libraries that follow the standard 100%. The situation may change in the future if that library evolves towards using only standard Modelica language features.

comment:5 by Francesco Casella, 4 years ago

Milestone: 1.15.01.16.0

Release 1.15.0 was scrapped, because replaceable support eventually turned out to be more easily implemented in 1.16.0. Hence, all 1.15.0 tickets are rescheduled to 1.16.0

comment:6 by Francesco Casella, 4 years ago

Component: FrontendNew Instantiation
Note: See TracTickets for help on using tickets.