-
Notifications
You must be signed in to change notification settings - Fork 78
Checking for alias variables and variability #76
Comments
@nickbattle : Thanks! IMHO this is a case where it is great to have a checker that is very strict to provide a warning, but we should not remove these FMUs from the FMI 2.0 XC repository, as the clarification came only in FMI 2.0.1 It is most important that the relevant tool vendor change this for the future. Update: For OpenModelica I created: https://trac.openmodelica.org/OpenModelica/newticket#ticket and I have sent an Email to Dassault. |
@chrbertsch OK, I'll downgrade the VDMCheck for this to be a warning (ie. if this is the only problem, it will report "No errors found"). Yes, I can confirm that it is only the three tools that you mentioned. |
VDMCheck 0.0.2 build 191016 now treats the new 2.0.1 errors as warnings:
|
If we can agree on a hard rule, I will add it to CI. @nickbattle, can you post the code you're using to detect the issue? |
@t-sommer Well, it's not "code" exactly: it's a set of rules expressed in VDM-SL. But it's sufficiently code-like that you can hopefully make sense of it:
In English: vars is the set of variabilities of the aliases (which are a set of SVs of the same type and reference). If there is a special alias in the set that is "input" or "parameter", then the vars set must be a single value that is the same as the variability of that SV. If there is no special SV, "highest" is set to the most significant variability in the vars set (the ordering is defined for the type, so ">" works), and the vars set has to be identical to just that one highest value. Note that earlier tests eliminate the case of having both "input" and "parameter" types in the alias set, because there is a rule that an alias set can only have one SV that is "settable" (rule 1 on p52). The last test is rather literal from the standard. You could just say that the set of variabilities has to be a single value, but in the case of errors (where there are multiple variabilities) it's useful to tell the user what the highest is. The |
@t-sommer PS. I hate to quibble, but these things come up when you express rules formally... The rule 1, regarding settable aliases, excludes the case of having both "input" and "parameter" types in the alias set. But it says hte exclusion are variables that can be set with fmi2SetXXX. In the case of "parameter" types, this can mean that they are both "parameter" and "tunable" (rule 4 on p88 or rule 6 on p88, depending on the state). So perhaps you could have a parameter that was not tunable and an input variable in the same alias group? In which case, what should be the variability of the group be: that of the "input" or that of the "parameter"? Or should the alias rule be for "tunable parameters" and inputs? |
I commented on the specification itself in modelica/fmi-standard#436 However, for the cross-checker the most important issue is that the variability-text (as far as I can tell) is non-normative, and thus not something we should reject models based on - even for 2.0.1. |
@HansOlsson These checks have been downgraded to warnings only now, so they will not fail an FMU by themselves (in VDMCheck). |
@chrbertsch I cannot find the ticket you mentioned above. Can you please send me the ticket number? |
Thanks, I seem not to have sent the ticket mentioned above. I have done it now: https://trac.openmodelica.org/OpenModelica/ticket/5673 |
FMI Standard issue 2.0.1 included a clarification paragraph to explain the rules regarding the variability setting of collections of aliased variables. VDMCheck was enhanced to make this new check, and the following list of FMUs in the cross-check repo were found to violate the rules:
alias_errors.txt
See modelica/fmi-standard#436
The text was updated successfully, but these errors were encountered: