Opened 8 years ago

Closed 8 years ago

#4059 closed defect (fixed)

Wrong detection of structual parameters for instances

Reported by: Patrick Täuber Owned by: Patrick Täuber
Priority: high Milestone: Future
Component: Frontend Version:
Keywords: structural parameter Cc:

Description

While flattening of the following model b is detected as structural parameter instead of bar.b:

package ParameterBug3
  model parameterBug3
    foo bar (b=true);
  equation
  end parameterBug3;
  
  model foo
    parameter Boolean b;
    Real x;
  equation
    if b then
      x = 1;
    else
      x = 2;
    end if;
  end foo;
end ParameterBug3;

-d=printStructuralParameters:

"Notification: The following structural parameters were evaluated in the front-end: b

The final attribute for bar.b is lost before the backend.
-d=dumpdaelow:

Known variables only depending on parameters and constants - globalKnownVars (1)
========================================
1: bar.b:PARAM()  = true  type: Boolean

Adding another variable b at top level leads to a final attribute for b which is wrong:

package ParameterBug3
  model parameterBug3
    parameter Boolean b = true;
    foo bar (b=true);
  equation
  end parameterBug3;
  
  model foo
    parameter Boolean b;
    Real x;
  equation
    if b then
      x = 1;
    else
      x = 2;
    end if;
  end foo;
end ParameterBug3;

-d=printStructuralParameters:

"Notification: The following structural parameters were evaluated in the front-end: b

The final attribute for bar.b is lost before the backend.
-d=dumpdaelow:

Known variables only depending on parameters and constants - globalKnownVars (2)
========================================
1: bar.b:PARAM()  = true  type: Boolean
2: b:PARAM(final = true )  = true  type: Boolean

Change History (1)

comment:1 by Patrick Täuber, 8 years ago

Resolution: fixed
Status: newclosed

This is fixed in d75f648.

Note: See TracTickets for help on using tickets.