@@ -654,7 +654,7 @@ algorithm
654
654
algarr = listArray(algs);
655
655
funcs = DAEUtil.daeFunctionTree(lst);
656
656
einfo = Inline.inlineEventInfo(EVENT_INFO(whenclauses_1,zero_crossings),(NONE(),SOME(funcs),{DAE.NORM_INLINE()}));
657
- DAELowUtil.checkDEALowWithErrorMsg (DAELOW(vars_1,knvars,extVars,aliasVars,eqnarr,reqnarr,ieqnarr,arr_md_eqns,algarr,einfo,extObjCls));
657
+ DAELowUtil.checkDAELowWithErrorMsg (DAELOW(vars_1,knvars,extVars,aliasVars,eqnarr,reqnarr,ieqnarr,arr_md_eqns,algarr,einfo,extObjCls));
658
658
then DAELOW(vars_1,knvars,extVars,aliasVars,eqnarr,reqnarr,ieqnarr,arr_md_eqns,algarr,einfo,extObjCls);
659
659
660
660
case(lst, addDummyDerivativeIfNeeded, false) // do not simplify
@@ -691,7 +691,7 @@ algorithm
691
691
algarr = listArray(algs);
692
692
funcs = DAEUtil.daeFunctionTree(lst);
693
693
einfo = Inline.inlineEventInfo(EVENT_INFO(whenclauses_1,zero_crossings),(NONE(),SOME(funcs),{DAE.NORM_INLINE()}));
694
- DAELowUtil.checkDEALowWithErrorMsg (DAELOW(vars_1,knvars,extVars,aliasVars,eqnarr,reqnarr,ieqnarr,arr_md_eqns,algarr,einfo,extObjCls));
694
+ DAELowUtil.checkDAELowWithErrorMsg (DAELOW(vars_1,knvars,extVars,aliasVars,eqnarr,reqnarr,ieqnarr,arr_md_eqns,algarr,einfo,extObjCls));
695
695
then DAELOW(vars_1,knvars,extVars,aliasVars,eqnarr,reqnarr,ieqnarr,arr_md_eqns,algarr,einfo,extObjCls);
696
696
end matchcontinue;
697
697
end lower;
@@ -15406,7 +15406,7 @@ algorithm
15406
15406
end matchcontinue;
15407
15407
end getAllExpsEqn;
15408
15408
15409
- public function traverseDEALowExps "function: traverseDEALowExps
15409
+ public function traverseDAELowExps "function: traverseDAELowExps
15410
15410
author: Frenkel TUD
15411
15411
15412
15412
This function goes through the DAELow structure and finds all the
@@ -15438,12 +15438,12 @@ algorithm
15438
15438
case (DAELOW(orderedVars = vars1,knownVars = vars2,orderedEqs = eqns,removedEqs = reqns,
15439
15439
initialEqs = ieqns,arrayEqs = ae,algorithms = algs),true,func,inTypeA)
15440
15440
equation
15441
- exps1 = traverseDEALowExpsVars (vars1,func,inTypeA);
15442
- exps2 = traverseDEALowExpsVars (vars2,func,inTypeA);
15443
- exps3 = traverseDEALowExpsEqns (eqns,func,inTypeA);
15444
- exps4 = traverseDEALowExpsEqns (reqns,func,inTypeA);
15445
- exps5 = traverseDEALowExpsEqns (ieqns,func,inTypeA);
15446
- exps6 = traverseDEALowExpsArrayEqns (ae,func,inTypeA);
15441
+ exps1 = traverseDAELowExpsVars (vars1,func,inTypeA);
15442
+ exps2 = traverseDAELowExpsVars (vars2,func,inTypeA);
15443
+ exps3 = traverseDAELowExpsEqns (eqns,func,inTypeA);
15444
+ exps4 = traverseDAELowExpsEqns (reqns,func,inTypeA);
15445
+ exps5 = traverseDAELowExpsEqns (ieqns,func,inTypeA);
15446
+ exps6 = traverseDAELowExpsArrayEqns (ae,func,inTypeA);
15447
15447
alglst = arrayList(algs);
15448
15448
exps7 = Util.listMapFlat2(alglst, Algorithm.traverseExps,func,inTypeA);
15449
15449
exps = Util.listFlatten({exps1,exps2,exps3,exps4,exps5,exps6,exps7});
@@ -15452,27 +15452,27 @@ algorithm
15452
15452
case (DAELOW(orderedVars = vars1,knownVars = vars2,orderedEqs = eqns,removedEqs = reqns,
15453
15453
initialEqs = ieqns,arrayEqs = ae,algorithms = algs),false,func,inTypeA)
15454
15454
equation
15455
- exps1 = traverseDEALowExpsVars (vars1,func,inTypeA);
15456
- exps2 = traverseDEALowExpsVars (vars2,func,inTypeA);
15457
- exps3 = traverseDEALowExpsEqns (eqns,func,inTypeA);
15458
- exps4 = traverseDEALowExpsEqns (reqns,func,inTypeA);
15459
- exps5 = traverseDEALowExpsEqns (ieqns,func,inTypeA);
15460
- exps6 = traverseDEALowExpsArrayEqns (ae,func,inTypeA);
15455
+ exps1 = traverseDAELowExpsVars (vars1,func,inTypeA);
15456
+ exps2 = traverseDAELowExpsVars (vars2,func,inTypeA);
15457
+ exps3 = traverseDAELowExpsEqns (eqns,func,inTypeA);
15458
+ exps4 = traverseDAELowExpsEqns (reqns,func,inTypeA);
15459
+ exps5 = traverseDAELowExpsEqns (ieqns,func,inTypeA);
15460
+ exps6 = traverseDAELowExpsArrayEqns (ae,func,inTypeA);
15461
15461
exps = Util.listFlatten({exps1,exps2,exps3,exps4,exps5,exps6});
15462
15462
then
15463
15463
exps;
15464
15464
case (_,_,_,_)
15465
15465
equation
15466
- Debug.fprintln("failtrace", "- DAELow.traverseDEALowExps failed");
15466
+ Debug.fprintln("failtrace", "- DAELow.traverseDAELowExps failed");
15467
15467
then
15468
15468
fail();
15469
15469
end matchcontinue;
15470
- end traverseDEALowExps ;
15470
+ end traverseDAELowExps ;
15471
15471
15472
- protected function traverseDEALowExpsVars "function: traverseDEALowExpsVars
15472
+ protected function traverseDAELowExpsVars "function: traverseDAELowExpsVars
15473
15473
author: Frenkel TUD
15474
15474
15475
- Helper for traverseDEALowExps
15475
+ Helper for traverseDAELowExps
15476
15476
"
15477
15477
input Variables inVariables;
15478
15478
input FuncExpType func;
@@ -15500,20 +15500,20 @@ algorithm
15500
15500
case (VARIABLES(crefIdxLstArr = crefindex,strIdxLstArr = oldcrefindex,varArr = vararray,bucketSize = bsize,numberOfVars = nvars),func,inTypeA)
15501
15501
equation
15502
15502
vars = vararrayList(vararray) "We can ignore crefs, they don\'t contain real expressions" ;
15503
- talst = Util.listMapFlat2(vars, traverseDEALowExpsVar ,func,inTypeA);
15503
+ talst = Util.listMapFlat2(vars, traverseDAELowExpsVar ,func,inTypeA);
15504
15504
then
15505
15505
talst;
15506
15506
case (_,_,_)
15507
15507
equation
15508
- Debug.fprintln("failtrace", "- DAELow.traverseDEALowExpsVars failed");
15508
+ Debug.fprintln("failtrace", "- DAELow.traverseDAELowExpsVars failed");
15509
15509
then
15510
15510
fail();
15511
15511
end matchcontinue;
15512
- end traverseDEALowExpsVars ;
15512
+ end traverseDAELowExpsVars ;
15513
15513
15514
- protected function traverseDEALowExpsVar "function: traverseDEALowExpsVar
15514
+ protected function traverseDAELowExpsVar "function: traverseDAELowExpsVar
15515
15515
author: Frenkel TUD
15516
- Helper traverseDEALowExpsVar . Get all exps from a Var.
15516
+ Helper traverseDAELowExpsVar . Get all exps from a Var.
15517
15517
DAE.ET_OTHER is used as type for componentref. Not important here.
15518
15518
We only use the exp list for finding function calls"
15519
15519
input Var inVar;
@@ -15546,23 +15546,23 @@ algorithm
15546
15546
equation
15547
15547
e1 = Util.optionToList(bndexp);
15548
15548
talst = Util.listMapFlat1(e1,func,inTypeA);
15549
- talst1 = Util.listMapFlat2(instdims, traverseDEALowExpsSubscript ,func,inTypeA);
15549
+ talst1 = Util.listMapFlat2(instdims, traverseDAELowExpsSubscript ,func,inTypeA);
15550
15550
talst2 = listAppend(talst,talst1);
15551
15551
talst3 = func(DAE.CREF(cref,DAE.ET_OTHER()),inTypeA);
15552
15552
talst4 = listAppend(talst2,talst3);
15553
15553
then
15554
15554
talst4;
15555
15555
case (_,_,_)
15556
15556
equation
15557
- Debug.fprintln("failtrace", "- DAELow.traverseDEALowExpsVar failed");
15557
+ Debug.fprintln("failtrace", "- DAELow.traverseDAELowExpsVar failed");
15558
15558
then
15559
15559
fail();
15560
15560
end matchcontinue;
15561
- end traverseDEALowExpsVar ;
15561
+ end traverseDAELowExpsVar ;
15562
15562
15563
- protected function traverseDEALowExpsSubscript "function: traverseDEALowExpsSubscript
15563
+ protected function traverseDAELowExpsSubscript "function: traverseDAELowExpsSubscript
15564
15564
author: Frenkel TUD
15565
- helper for traverseDEALowExpsSubscript "
15565
+ helper for traverseDAELowExpsSubscript "
15566
15566
input DAE.Subscript inSubscript;
15567
15567
input FuncExpType func;
15568
15568
input Type_a inTypeA;
@@ -15592,12 +15592,12 @@ algorithm
15592
15592
talst = func(e,inTypeA);
15593
15593
then talst;
15594
15594
end matchcontinue;
15595
- end traverseDEALowExpsSubscript ;
15595
+ end traverseDAELowExpsSubscript ;
15596
15596
15597
- protected function traverseDEALowExpsEqns "function: traverseDEALowExpsEqns
15597
+ protected function traverseDAELowExpsEqns "function: traverseDAELowExpsEqns
15598
15598
author: Frenkel TUD
15599
15599
15600
- Helper for traverseDEALowExpsEqns
15600
+ Helper for traverseDAELowExpsEqns
15601
15601
"
15602
15602
input EquationArray inEquationArray;
15603
15603
input FuncExpType func;
@@ -15622,15 +15622,15 @@ algorithm
15622
15622
case ((eqnarray as EQUATION_ARRAY(numberOfElement = _)),func,inTypeA)
15623
15623
equation
15624
15624
eqns = equationList(eqnarray);
15625
- talst = Util.listMapFlat2(eqns, traverseDEALowExpsEqn ,func,inTypeA);
15625
+ talst = Util.listMapFlat2(eqns, traverseDAELowExpsEqn ,func,inTypeA);
15626
15626
then
15627
15627
talst;
15628
15628
end matchcontinue;
15629
- end traverseDEALowExpsEqns ;
15629
+ end traverseDAELowExpsEqns ;
15630
15630
15631
- protected function traverseDEALowExpsEqn "function: traverseDEALowExpsEqn
15631
+ protected function traverseDAELowExpsEqn "function: traverseDAELowExpsEqn
15632
15632
author: PA
15633
- Helper for traverseDEALowExpsEqn ."
15633
+ Helper for traverseDAELowExpsEqn ."
15634
15634
input Equation inEquation;
15635
15635
input FuncExpType func;
15636
15636
input Type_a inTypeA;
@@ -15689,7 +15689,7 @@ algorithm
15689
15689
talst = func(DAE.CREF(cr,tp),inTypeA);
15690
15690
talst1 = func(e,inTypeA);
15691
15691
talst2 = listAppend(talst,talst1);
15692
- talst3 = traverseDEALowExpsEqn (WHEN_EQUATION(elsePart,source),func,inTypeA);
15692
+ talst3 = traverseDAELowExpsEqn (WHEN_EQUATION(elsePart,source),func,inTypeA);
15693
15693
talst4 = listAppend(talst2,talst3);
15694
15694
then
15695
15695
talst4;
@@ -15700,13 +15700,20 @@ algorithm
15700
15700
talst = Util.listMapFlat1(expl,func,inTypeA);
15701
15701
then
15702
15702
talst;
15703
+ case (COMPLEX_EQUATION(index = ind, lhs = e1, rhs = e2),func,inTypeA)
15704
+ equation
15705
+ talst = func(e1, inTypeA);
15706
+ talst1 = func(e2, inTypeA);
15707
+ talst2 = listAppend(talst, talst1);
15708
+ then
15709
+ talst2;
15703
15710
end matchcontinue;
15704
- end traverseDEALowExpsEqn ;
15711
+ end traverseDAELowExpsEqn ;
15705
15712
15706
- protected function traverseDEALowExpsArrayEqns "function: traverseDEALowExpsArrayEqns
15713
+ protected function traverseDAELowExpsArrayEqns "function: traverseDAELowExpsArrayEqns
15707
15714
author: Frenkel TUD
15708
15715
15709
- helper for traverseDEALowExps
15716
+ helper for traverseDAELowExps
15710
15717
"
15711
15718
input MultiDimEquation[:] arr;
15712
15719
input FuncExpType func;
@@ -15724,13 +15731,13 @@ protected function traverseDEALowExpsArrayEqns "function: traverseDEALowExpsArra
15724
15731
list<MultiDimEquation> lst;
15725
15732
algorithm
15726
15733
lst := arrayList(arr);
15727
- outTypeBLst := Util.listMapFlat2(lst, traverseDEALowExpsArrayEqn ,func,inTypeA);
15728
- end traverseDEALowExpsArrayEqns ;
15734
+ outTypeBLst := Util.listMapFlat2(lst, traverseDAELowExpsArrayEqn ,func,inTypeA);
15735
+ end traverseDAELowExpsArrayEqns ;
15729
15736
15730
- protected function traverseDEALowExpsArrayEqn "function: traverseDEALowExpsArrayEqn
15737
+ protected function traverseDAELowExpsArrayEqn "function: traverseDAELowExpsArrayEqn
15731
15738
author: Frenkel TUD
15732
15739
15733
- Helper function to traverseDEALowExpsArrayEqns
15740
+ Helper function to traverseDAELowExpsArrayEqns
15734
15741
"
15735
15742
input MultiDimEquation inMultiDimEquation;
15736
15743
input FuncExpType func;
@@ -15759,7 +15766,7 @@ algorithm
15759
15766
then
15760
15767
talst2;
15761
15768
end matchcontinue;
15762
- end traverseDEALowExpsArrayEqn ;
15769
+ end traverseDAELowExpsArrayEqn ;
15763
15770
15764
15771
public function isParam
15765
15772
"function: isParam
@@ -16927,7 +16934,7 @@ end collectDelayExpressions;
16927
16934
public function findDelaySubExpressions
16928
16935
"Return all subexpressions of inExp that are calls to delay()"
16929
16936
input DAE.Exp inExp;
16930
- input list<Integer> inDummy "this is a dummy for traverseDEALowExps ";
16937
+ input list<Integer> inDummy "this is a dummy for traverseDAELowExps ";
16931
16938
output list<DAE.Exp> outExps;
16932
16939
algorithm
16933
16940
((_, outExps)) := Exp.traverseExp(inExp, collectDelayExpressions, {});
0 commit comments