@@ -4572,7 +4572,7 @@ protected function simplifyTwoBinaryExpressions
45724572 input Boolean operatorEqualLhsRhs;
45734573 output DAE . Exp outExp;
45744574algorithm
4575- outExp := matchcontinue (e1,lhsOperator,e2,mainOperator,e3,rhsOperator,e4,expEqual_e1_e3,expEqual_e1_e4,expEqual_e2_e3,expEqual_e2_e4,isConst_e1,isConst_e2,isConst_e3,operatorEqualLhsRhs)
4575+ outExp := match (e1,lhsOperator,e2,mainOperator,e3,rhsOperator,e4,expEqual_e1_e3,expEqual_e1_e4,expEqual_e2_e3,expEqual_e2_e4,isConst_e1,isConst_e2,isConst_e3,operatorEqualLhsRhs)
45764576 local
45774577 DAE . Exp e1_1,e,e_1,e_2,e_3,e_4,e_5,e_6,res,one;
45784578 Operator oper, op1 ,op2, op3, op;
@@ -4655,9 +4655,7 @@ algorithm
46554655 op1,
46564656 _,_,_,
46574657 _,_,_,true /* e2==e4*/ ,_,false /* isConst(e2)*/ ,_,true /* op2==op3*/ )
4658- equation
4659- true = Expression . isAddOrSub(op1);
4660- true = Expression . isMulOrDiv(op2);
4658+ guard Expression . isAddOrSub(op1) and Expression . isMulOrDiv(op2)
46614659 then
46624660 DAE . BINARY (DAE . BINARY (e1,op1,e3),op2,e4);
46634661
@@ -4667,8 +4665,8 @@ algorithm
46674665 op1,
46684666 _,DAE . DIV (_),_,
46694667 true /* e1==e3*/ ,_,_,_,false /* isConst(e1)*/ ,_,_,_)
4668+ guard Expression . isAddOrSub(op1)
46704669 equation
4671- true = Expression . isAddOrSub(op1);
46724670 one = Expression . makeConstOne(ty);
46734671 e = Expression . makeDiv(one,e4);
46744672 then
@@ -4680,8 +4678,8 @@ algorithm
46804678 op1,
46814679 _,DAE . MUL (_),_,
46824680 true /* e1==e3*/ ,_,_,_,false /* isConst(e1)*/ ,_,_,_)
4681+ guard Expression . isAddOrSub(op1)
46834682 equation
4684- true = Expression . isAddOrSub(op1);
46854683 one = Expression . makeConstOne(ty);
46864684 e = Expression . makeDiv(one,e2);
46874685 then
@@ -4693,9 +4691,8 @@ algorithm
46934691 op1,
46944692 e,_,_,
46954693 _,_,_,true /* e2==e4==e_3==e_5*/ ,_,false /* isConst(e2==e_3)*/ ,_,true /* op2==op3*/ )
4694+ guard Expression . isAddOrSub(op1) and Expression . isMulOrDiv(op2)
46964695 equation
4697- true = Expression . isAddOrSub(op1);
4698- true = Expression . isMulOrDiv(op2);
46994696 res = DAE . BINARY (e1_1,op1,e);
47004697 then DAE . BINARY (res,op2,e_3);
47014698
@@ -4705,12 +4702,9 @@ algorithm
47054702 op1,
47064703 e,op3,e_6,
47074704 _,_,_,_,_,_,_,_)
4705+ guard (not Expression . isConstValue(e_2)) and Expression . expEqual(e_2,e_6) and Expression . operatorEqual(op2,op3) and Expression . isAddOrSub(op1)
4706+ and Expression . isMulOrDiv(op2)
47084707 equation
4709- false = Expression . isConstValue(e_2);
4710- true = Expression . expEqual(e_2,e_6);
4711- true = Expression . operatorEqual(op2,op3);
4712- true = Expression . isAddOrSub(op1);
4713- true = Expression . isMulOrDiv(op2);
47144708 e1_1 = DAE . BINARY (e_1, DAE . MUL (ty),e_3);
47154709 res = DAE . BINARY (e1_1,op1,e);
47164710 then DAE . BINARY (res,op2,e_2);
@@ -4721,13 +4715,9 @@ algorithm
47214715 op1,
47224716 DAE . BINARY (e_4,op3,e_5),DAE . MUL (_),e_6,
47234717 _,_,_,_,_,_,_,_)
4718+ guard (not Expression . isConstValue(e_2)) and Expression . expEqual(e_2,e_5) and Expression . operatorEqual(op2,op3) and Expression . isAddOrSub(op1)
4719+ and Expression . isMulOrDiv(op2)
47244720 equation
4725- false = Expression . isConstValue(e_2);
4726- true = Expression . expEqual(e_2,e_5);
4727- true = Expression . operatorEqual(op2,op3);
4728- true = Expression . isAddOrSub(op1);
4729- true = Expression . isMulOrDiv(op2);
4730-
47314721 e1_1 = DAE . BINARY (e_1, DAE . MUL (ty),e_3);
47324722 e = DAE . BINARY (e_4, DAE . MUL (ty),e_6);
47334723 res = DAE . BINARY (e1_1,op1,e);
@@ -4739,11 +4729,9 @@ algorithm
47394729 op1,
47404730 DAE . BINARY (e_4,op3,e_5),DAE . MUL (ty),e_6,
47414731 _,_,_,_,_,false /* isConst(e2==e_3)*/ ,_,_)
4732+ guard Expression . expEqual(e_3,e_5) and Expression . operatorEqual(op2,op3) and Expression . isAddOrSub(op1)
4733+ and Expression . isMulOrDiv(op2)
47424734 equation
4743- true = Expression . expEqual(e_3,e_5);
4744- true = Expression . operatorEqual(op2,op3);
4745- true = Expression . isAddOrSub(op1);
4746- true = Expression . isMulOrDiv(op2);
47474735 e = DAE . BINARY (e_4,DAE . MUL (ty),e_6);
47484736 res = DAE . BINARY (e_1,op1,e);
47494737 then DAE . BINARY (res,op2,e_3);
@@ -4762,7 +4750,7 @@ algorithm
47624750 _,true /* e1==e4*/ ,_,_,_,_,_,_)
47634751 then DAE . BINARY (e1,lhsOperator,DAE . BINARY (e2,mainOperator,e3));
47644752
4765- end matchcontinue ;
4753+ end match ;
47664754end simplifyTwoBinaryExpressions;
47674755
47684756protected function simplifyLBinary
0 commit comments