Opened 14 years ago

Closed 12 years ago

#1454 closed defect (fixed)

min, max and nominal asserts

Reported by: Willi Braun Owned by: Willi Braun
Priority: blocker Milestone:
Component: Backend Version: trunk
Keywords: Cc: Willi Braun, Frenkel, TUD

Description

They are created for all variables, but then some of them are removed by "removeSimpleEquations" and in combination with new alias Vars functionality it could produce "Memory access violation". I'm afraid not to have a minimal example for that for now.
I think this has to be done not while BackendDAECreate, but at the end of BackendDAE processing speak in SimCode.

Change History (6)

comment:1 by Jens Frenkel, 14 years ago

They have to be created in BackendDAECreate to ensure all min,max,nominal asserts are detected during simulation. Maybe removeSimpleEquations does not replace all alias variables.

comment:2 by Willi Braun, 14 years ago

Why we need to do it before all optimization things? And blow up at least the algorithms section needless. All these variables and there attributes are also available in SimCode.

comment:3 by Martin Sjölund, 14 years ago

I had the same thought. Plus, if you have
{{{class A

Real r(min=0) = r2;
Real r2(min=-3,max=15) = time;

end A;}}}

We will generate either
r=time or r2=time

In both of these cases we should have only one assert(r2>=0 && r2 <=15, "...")

comment:4 by Jens Frenkel, 14 years ago

It is also possible to generate them later, but than we have to merge the min,max,nominal attributes at removeAliasvariables

comment:5 by Martin Sjölund, 14 years ago

I think that's better, because you will end up with more efficient code (if all variables are alias of each other, you end up with 1 assertion instead of n).

comment:6 by Willi Braun, 12 years ago

Cc: Frenkel TUD added; Jens Frenkel removed
Component: Backend
Resolution: fixed
Status: assignedclosed

fixed sometime

Note: See TracTickets for help on using tickets.