Opened 10 years ago

Last modified 7 years ago

#2967 new defect

Pantelides fails for arrays

Reported by: sjoelund.se Owned by: somebody
Priority: high Milestone: Future
Component: Backend Version: trunk
Keywords: Cc: wbraun, lochel

Description

Pantelides fails for the following models using arrays:

package ModelicaCompliance  "A semantics compliance suite for the Modelica language" 
  extends Icons.TestPackage;

  package Algorithms  
    extends Icons.TestPackage;

    package For  
      extends Icons.TestPackage;

      model BoolRange  
        extends Icons.TestCase;
        Boolean[Boolean] b;
      algorithm
        for i in false:true loop
          b[i] := i;
        end for;
        assert(b[false] == false, "b[false] was not set correctly.");
        assert(b[true] == true, "b[true] was not set correctly.");
        annotation(__ModelicaAssociation(TestCase(shouldPass = true, section = {"11.2.2"})), experiment(StopTime = 0.01)); 
      end BoolRange;
    end For;
  end Algorithms;

  package Icons  
    model TestCase  end TestCase;

    package TestPackage  end TestPackage;
  end Icons;
  annotation(version = "3.2"); 
end ModelicaCompliance;

model BoolRange_total
  extends ModelicaCompliance.Algorithms.For.BoolRange;
 annotation(__ModelicaAssociation(TestCase(shouldPass = true, section = {"11.2.2"})), experiment(StopTime = 0.01));
end BoolRange_total;
package ModelicaCompliance  "A semantics compliance suite for the Modelica language" 
  extends Icons.TestPackage;

  package Algorithms  
    extends Icons.TestPackage;

    package For  
      extends Icons.TestPackage;

      model EnumRange  
        extends Icons.TestCase;
        type TwoEnums = enumeration(one, two);
        TwoEnums[TwoEnums] te;
      algorithm
        for e in TwoEnums.one:TwoEnums.two loop
          te[e] := e;
        end for;
        assert(te[TwoEnums.one] == TwoEnums.one, "te[TwoEnums.one] was not set correctly.");
        assert(te[TwoEnums.two] == TwoEnums.two, "te[TwoEnums.two] was not set correctly.");
        annotation(__ModelicaAssociation(TestCase(shouldPass = true, section = {"11.2.2"})), experiment(StopTime = 0.01)); 
      end EnumRange;
    end For;
  end Algorithms;

  package Icons  
    model TestCase  end TestCase;

    package TestPackage  end TestPackage;
  end Icons;
  annotation(version = "3.2"); 
end ModelicaCompliance;

model EnumRange_total
  extends ModelicaCompliance.Algorithms.For.EnumRange;
 annotation(__ModelicaAssociation(TestCase(shouldPass = true, section = {"11.2.2"})), experiment(StopTime = 0.01));
end EnumRange_total;

Change History (8)

comment:1 Changed 10 years ago by sjoelund.se

  • Milestone changed from 1.9.2 to 1.9.3

Milestone changed to 1.9.3 since 1.9.2 was released.

comment:2 Changed 9 years ago by sjoelund.se

  • Milestone changed from 1.9.3 to 1.9.4

Moved to new milestone 1.9.4

comment:3 Changed 9 years ago by hkiel

When I run

function EnumRange
  type TwoEnums = enumeration(one, two);
  output TwoEnums te[TwoEnums];
algorithm
  for e in TwoEnums.one : TwoEnums.two loop
    te[e] := e;
  end for;
assert(te[TwoEnums.one] == TwoEnums.one, "te[TwoEnums.one] was not set correctly.");
assert(te[TwoEnums.two] == TwoEnums.two, "te[TwoEnums.two] was not set correctly.");
end EnumRange;

with

loadFile("enumRange.mo");
EnumRange();

everything works as expected. How can I trigger the error? (I see it fail when I run the ModelicaCompliance Suite locally)

BoolRange works btw., it is EnumRange() RealRange and StringRange() that fail in the Compliance Suite.

comment:4 Changed 9 years ago by sjoelund.se

  • Milestone changed from 1.9.4 to 1.9.5

Milestone pushed to 1.9.5

comment:5 Changed 9 years ago by sjoelund.se

  • Milestone changed from 1.9.5 to 1.10.0

Milestone renamed

comment:6 Changed 8 years ago by sjoelund.se

  • Milestone changed from 1.10.0 to 1.11.0

Ticket retargeted after milestone closed

comment:7 Changed 8 years ago by sjoelund.se

  • Milestone changed from 1.11.0 to 1.12.0

Milestone moved to 1.12.0 due to 1.11.0 already being released.

comment:8 Changed 7 years ago by casella

  • Milestone changed from 1.12.0 to Future

The milestone of this ticket has been reassigned to "Future".

If you think the issue is still valid and relevant for you, please select milestone 1.13.0 for back-end, code generation and run-time issues, or 2.0.0 for front-end issues.

If you are aware that the problem is no longer present, please select the milestone corresponding to the version of OMC you used to check that, and set the status to "worksforme".

In both cases, a short informative comment would be welcome.

Note: See TracTickets for help on using tickets.