Opened 14 years ago

Closed 10 years ago

#1459 closed defect (fixed)

Algorithm sections do not handle assertions in all cases

Reported by: Martin Sjölund Owned by: Martin Sjölund
Priority: high Milestone: 1.9.1
Component: Backend Version:
Keywords: Cc: Martin Sjölund, Frenkel, TUD, Willi Braun

Description

In this code, only the equation-assertion is statically checked during translation. We can also remove assertions from algorithm-sections.
Furthermore, the assertions in the algorithm-section do not seem to be called (or at least: they don't cause assertions).

An algorithm block seems to be removed if it does not define any variable (r was added to this example to get the code to run; tested with print("abc") to make sure).

algorithm
  if time<1.5 then
    myAssert(time<0.5, "time>=0.5");
    assert(time<0.75, "time>=0.75");
  end if;
  assert(false, "time>=0.35");
  r := 1.5;
equation
  assert(false, "time>=0.35");

Change History (1)

comment:1 by Martin Sjölund, 10 years ago

Cc: Frenkel TUD added; Jens Frenkel removed
Component: Backend
Milestone: 1.9.1
Resolution: fixed
Status: newclosed
Summary: Algorithm sections do not handle all casesAlgorithm sections do not handle assertions in all cases

This was fixed at some point

Note: See TracTickets for help on using tickets.