Skip to content

Commit

Permalink
[Janitor mode] Fix tabs
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@16529 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
OpenModelica-Hudson committed Jun 30, 2013
1 parent 20b485a commit a3ac10e
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions Compiler/FrontEnd/ExpressionSimplify.mo
Original file line number Diff line number Diff line change
Expand Up @@ -3745,11 +3745,11 @@ algorithm

// |e1| /e1 => sign(e1)
case(DAE.DIV(ty),DAE.CALL(path=Absyn.IDENT("abs"),expLst={e1}),e2)
equation
true = Expression.expEqual(e1,e2);
equation
true = Expression.expEqual(e1,e2);
res = Expression.makeBuiltinCall("sign",{e1},ty);
then
res;
then
res;

// SUB is not commutative
// (e*e1) - (e*e2) => e*(e1-e2)
Expand Down Expand Up @@ -3940,8 +3940,8 @@ algorithm
true = Expression.expEqual(e2,e4);
true = Expression.operatorEqual(op1,DAE.SUB(ty)) or
Expression.operatorEqual(op1,DAE.ADD(ty));
e = Expression.expDiv(e3,e4);
res = DAE.BINARY(e1,op1,e);
e = Expression.expDiv(e3,e4);
res = DAE.BINARY(e1,op1,e);
then
res;

Expand All @@ -3951,8 +3951,8 @@ algorithm
true = Expression.expEqual(e2,e4);
true = Expression.operatorEqual(op1,DAE.SUB(ty)) or
Expression.operatorEqual(op1,DAE.ADD(ty));
e = Expression.expDiv(e3,e4);
res = DAE.BINARY(e,op1,e1);
e = Expression.expDiv(e3,e4);
res = DAE.BINARY(e,op1,e1);
then
res;

Expand All @@ -3964,9 +3964,9 @@ algorithm
Expression.operatorEqual(op1,DAE.ADD(ty));
true = Expression.operatorEqual(op2,DAE.DIV(ty)) or
Expression.operatorEqual(op2,DAE.MUL(ty));
e = Expression.expDiv(e4,e3);
e1_1 = DAE.BINARY(e1,op2,e2);
res = DAE.BINARY(e1_1,op1,e);
e = Expression.expDiv(e4,e3);
e1_1 = DAE.BINARY(e1,op2,e2);
res = DAE.BINARY(e1_1,op1,e);
then
res;

Expand Down Expand Up @@ -4053,19 +4053,19 @@ algorithm

// |e1| * |e2| => |e1*e2|
case(DAE.MUL(ty),DAE.CALL(path=Absyn.IDENT("abs"),expLst={e1}),DAE.CALL(path=Absyn.IDENT("abs"),expLst={e2}))
equation
equation
res = DAE.BINARY(e1, DAE.MUL(ty),e2);
then
Expression.makeBuiltinCall("abs",{res},ty);
then
Expression.makeBuiltinCall("abs",{res},ty);

// exp(e1) * exp(e2) => exp(e1 + e2)
case(DAE.MUL(ty),DAE.CALL(path=Absyn.IDENT("exp"),expLst={e1}),DAE.CALL(path=Absyn.IDENT("exp"),expLst={e2}))
equation
false = Expression.isConst(e1) or Expression.isConst(e2);
equation
false = Expression.isConst(e1) or Expression.isConst(e2);
e = DAE.BINARY(e1, DAE.ADD(ty),e1);
res = Expression.makeBuiltinCall("exp",{e},ty);
then
res;
res = Expression.makeBuiltinCall("exp",{e},ty);
then
res;

// (a+b)/c1 => a/c1+b/c1, for constant c1
case (DAE.DIV(ty = ty),DAE.BINARY(exp1 = e1,operator = DAE.ADD(ty = ty2),exp2 = e2),e3)
Expand Down

0 comments on commit a3ac10e

Please sign in to comment.