Skip to content

Commit

Permalink
- bugfix for BackendEquation.aliasEquation
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@13870 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Jens Frenkel committed Nov 12, 2012
1 parent f26af92 commit f63133c
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions Compiler/BackEnd/BackendEquation.mo
Original file line number Diff line number Diff line change
Expand Up @@ -1967,16 +1967,6 @@ algorithm
then (cr1,cr2,e1,e2,false)::inTpls;
case (DAE.UNARY(DAE.UMINUS_ARR(_),e1 as DAE.CREF(componentRef = cr1)),DAE.UNARY(DAE.UMINUS_ARR(_),e2 as DAE.CREF(componentRef = cr2)),_)
then (cr1,cr2,e1,e2,false)::inTpls;
// lhs = 0
case (_,_,_)
equation
true = Expression.isZero(rhs);
then aliasExpression(lhs,inTpls);
// 0 = rhs
case (_,_,_)
equation
true = Expression.isZero(lhs);
then aliasExpression(rhs,inTpls);
// a = not b;
case (DAE.CREF(componentRef = cr1),DAE.LUNARY(DAE.NOT(ty),DAE.CREF(componentRef = cr2)),_)
then (cr1,cr2,DAE.LUNARY(DAE.NOT(ty),lhs),rhs,true)::inTpls;
Expand All @@ -1991,16 +1981,6 @@ algorithm
// {a1,a2,a3,..} = {b1,b2,b3,..};
case (DAE.ARRAY(array = elst1),DAE.ARRAY(array = elst2),_)
then List.threadFold(elst1,elst2,aliasEquation1,inTpls);
// {a1+b1,a2+b2,a3+b3,..} = 0;
case (DAE.ARRAY(array = elst1),_,_)
equation
true = Expression.isZero(rhs);
then List.fold(elst1,aliasExpression,inTpls);
// 0 = {a1+b1,a2+b2,a3+b3,..};
case (_,DAE.ARRAY(array = elst2),_)
equation
true = Expression.isZero(lhs);
then List.fold(elst2,aliasExpression,inTpls);
// a = {b1,b2,b3,..}
//case (DAE.CREF(componentRef = cr1),DAE.ARRAY(array = elst2),_)
// -a = {b1,b2,b3,..}
Expand Down Expand Up @@ -2044,6 +2024,26 @@ algorithm
true = Absyn.pathEqual(patha,patha1);
true = Absyn.pathEqual(pathb,pathb1);
then List.threadFold(elst1,elst2,aliasEquation1,inTpls);
// {a1+b1,a2+b2,a3+b3,..} = 0;
case (DAE.ARRAY(array = elst1),_,_)
equation
true = Expression.isZero(rhs);
then List.fold(elst1,aliasExpression,inTpls);
// 0 = {a1+b1,a2+b2,a3+b3,..};
case (_,DAE.ARRAY(array = elst2),_)
equation
true = Expression.isZero(lhs);
then List.fold(elst2,aliasExpression,inTpls);
// lhs = 0
case (_,_,_)
equation
true = Expression.isZero(rhs);
then aliasExpression(lhs,inTpls);
// 0 = rhs
case (_,_,_)
equation
true = Expression.isZero(lhs);
then aliasExpression(rhs,inTpls);
end match;
end aliasEquation1;

Expand Down

0 comments on commit f63133c

Please sign in to comment.