Skip to content

Commit

Permalink
fixed r16506 | Thanks to Martin.
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@16508 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Vitalij Ruge committed Jun 27, 2013
1 parent 8c5ed0f commit 287769d
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions Compiler/FrontEnd/ExpressionSimplify.mo
Original file line number Diff line number Diff line change
Expand Up @@ -3861,21 +3861,19 @@ algorithm
then res;

// (e1 op2 e2) op1 (e3 op3 e4) => (e1 op1 e3) op2 e2
// e2 = e4; op2=op3 \in {*, /, +, -}; op1 \in {+, -}
// e2 = e4; op2=op3 \in {*, /}; op1 \in {+, -}
case (op1,DAE.BINARY(e1,op2,e2),DAE.BINARY(e3,op3,e4))
equation
false = Expression.isConst(e2);
true = Expression.expEqual(e2,e4);
true = Expression.operatorEqual(op2,op3);
ty = Expression.typeof(e1);
false = Expression.isConst(e2);
true = Expression.expEqual(e2,e4);
true = Expression.operatorEqual(op2,op3);
ty = Expression.typeof(e1);

true = Expression.operatorEqual(op1,DAE.SUB(ty)) or
Expression.operatorEqual(op1,DAE.ADD(ty));
true = Expression.operatorEqual(op1,DAE.SUB(ty)) or
Expression.operatorEqual(op1,DAE.ADD(ty));

true = Expression.operatorEqual(op2,DAE.DIV(ty)) or
Expression.operatorEqual(op2,DAE.MUL(ty)) or
Expression.operatorEqual(op2,DAE.SUB(ty)) or
Expression.operatorEqual(op2,DAE.ADD(ty));
true = Expression.operatorEqual(op2,DAE.DIV(ty)) or
Expression.operatorEqual(op2,DAE.MUL(ty));
then
DAE.BINARY(DAE.BINARY(e1,op1,e3),op2,e4);

Expand Down

0 comments on commit 287769d

Please sign in to comment.