Changes between Initial Version and Version 3 of Ticket #3074


Ignore:
Timestamp:
2015-01-13T23:15:00Z (10 years ago)
Author:
Francesco Casella
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #3074

    • Property Component UnknownBackend
    • Property Milestone Future1.9.2
    • Property Priority highcritical
    • Property Cc Lennart Ochel Willi Braun added
    • Property Summary Multiple problems with assert statementsInsufficient information about assertion violations
  • Ticket #3074 – Description

    initial v3  
    1 Please consider the attached test package, which demonstrates a number of problems regarding the handling of asserts in OMC.
     1Apologies, the first issue of this ticket was wrong due to a typo in the code. I have modified it to reflect the actual status with the corrected code.
    22
    3 If you simulate TestErrorVariable2, you get the following error message:
    4   Variable x is too big
     3Please consider the attached test package, which demonstrates how OMC does not provide essential information to the user when handling asserts.
    54
    6 Unfortunately, the message doesn't tell you an essential piece of information, i.e., ''where'' in the model has this error been triggered. Is it m1, m2 or m3?
     5Simulate TestWarningConstant. You get the following warning message:
     6  Warning: Variable x is probably too big
     7Unfortunately, the message doesn't tell you an essential piece of information, i.e., ''where'' in the model M has this error been triggered. Is it m1, m2 or m3? It also doesn't tell ''when'' the warning has been triggered
    78
    89One option is to enhance the error message like this:
    9   The following assertion has been violated: m2.x < 10
    10   Error message: Variable x is too big
     10  The following assertion has been violated at initialization:
     11  m3.x < 5
     12  Warning: Variable x is probably too big
    1113
    12 Incidentally, I think the "Process crashed" final message is inappropriate. It seem to hint to the fact that some uncontrolled error has taken place, such as a memory access violation in some external function, which is definitely not the case here. I would suggest to use "Process aborted", which seems more appropriate.
     14Simulate TestWarningVariable. You get the same message as before
     15  Warning: Variable x is probably too big
     16you should get something like:
     17  The following assertion has been violated at time = 0.8333
     18  m3.x < 5
     19  Warning: Variable x is probably too big
    1320
     21Simulate TestWarningRecurring. You still get
     22  Warning: Variable x is probably too big
     23According to the non-normative text of the Modelica Specification, Section 8.3.7, you should get something like
     24  The following assertion has been violated at time = 0.1577
     25  m3.x < 5
     26  Warning: Variable x is probably too big
    1427
    15 TestWarningConstant is terminated by an assertion violation at initialization. However, this assertion has AssertionLevel.warning, so according to the Modelica Spec. 8.3.7, a warning should be issued, then the simulation should continue.
     28  The following assertion is no longer violated at time = 0.3465
     29  m3.x < 5
     30  Warning: Variable x is probably too big
    1631
    17 TestWarningVariable is terminated when the warning assert is violated. According to the spec, a warning message should be issued once, then the simulation should continue.
     32Simulate TestErrorConstant. Here you should see:
     33  The following assertion has been violated at initialization:
     34  m2.x < 10
     35  Error: Variable x is too big
    1836
    19 TestErrorConstant is handled correctly, besides the above-mentioned lack of information, which is common to all cases.
     37Simulate TestErrorVariable. The information here is quite confusing. What you should get here is
     38  The following assertion has been violated at time = 0.25
     39  m2.x < 5
     40  Warning: Variable x is probably too big
    2041
    21 TestErrorVariable is terminated when the warning assert is violated. According to the spec, a warning message should be issued once, then the simulation should continue until the error assert is violated, then aborted.
     42  The following assertion has been violated at time = 0.5
     43  m2.x < 10
     44  Error: Variable x is too big
    2245
    23 Last, but not least, I would suggest to add these test cases to the Modelica Language Compliance Test library, as other tools seem to have the same kind of problems.
     46Incidentally, I think the "Process crashed" final message in the last case is inappropriate. It seem to hint to the fact that some uncontrolled error has taken place, such as a memory access violation in some external function, which is definitely not the case here. Evertything here is under control and we have reported the reason for the simulation to stop. I would suggest to use "Process aborted", which seems more appropriate.