diff --git a/Compiler/BackEnd/BackendDAECreate.mo b/Compiler/BackEnd/BackendDAECreate.mo index 253c99e4997..d1758809b15 100644 --- a/Compiler/BackEnd/BackendDAECreate.mo +++ b/Compiler/BackEnd/BackendDAECreate.mo @@ -451,7 +451,7 @@ algorithm then (DAE.CALL(Absyn.IDENT("delay"), DAE.ICONST(iDelay)::es, attr), (ht, iDelay+1, iSample, timeEvents)); // sample [already in ht] - case (DAE.CALL(Absyn.IDENT("sample"), es as {start, interval}, attr), (ht, iDelay, iSample, timeEvents)) + case (DAE.CALL(Absyn.IDENT("sample"), es as {_, interval}, attr), (ht, iDelay, iSample, timeEvents)) guard (not Types.isClockOrSubTypeClock(Expression.typeof(interval))) equation i = BaseHashTable.get(inExp, ht); then (DAE.CALL(Absyn.IDENT("sample"), DAE.ICONST(i)::es, attr), (ht, iDelay, iSample, timeEvents)); @@ -697,7 +697,6 @@ algorithm b = DAEUtil.boolVarVisibility(protection); dae_var_attr = DAEUtil.setProtectedAttr(dae_var_attr, b); dae_var_attr = setMinMaxFromEnumeration(t, dae_var_attr); - fnstpl = (SOME(functionTree), {DAE.NORM_INLINE()}); // build algorithms for the inlined asserts eqLst = buildAssertAlgorithms({},source,assrtEqIn); // building an algorithm of the assert @@ -1097,7 +1096,7 @@ algorithm (eqns,inREquations,inIEquations); // Only succeds for initial tuple equations, i.e. (a,b,c) = foo(x,y,z) or foo(x,y,z) = (a,b,c) - case(DAE.INITIALEQUATION(e1 as DAE.TUPLE(explst),e2 as DAE.CALL(),source),_,_,_,_) + case(DAE.INITIALEQUATION(e1 as DAE.TUPLE(_),e2 as DAE.CALL(),source),_,_,_,_) equation (DAE.EQUALITY_EXPS(e1_1,e2_1), source) = ExpressionSimplify.simplifyAddSymbolicOperation(DAE.EQUALITY_EXPS(e1,e2),source); eqns = lowerExtendedRecordEqn(e1_1,e2_1,source,BackendDAE.INITIAL_EQUATION(),functionTree,inIEquations); @@ -1801,7 +1800,7 @@ algorithm then (eqnl, reqnl); - case DAE.EQUATION(exp = cre as DAE.TUPLE(PR=expl), scalar = e, source = source)::xs + case DAE.EQUATION(exp = DAE.TUPLE(PR=expl), scalar = e, source = source)::xs equation eqnl = lowerWhenTupleEqn(expl, inCond, e, source, 1, iEquationLst); (eqnl, reqnl) = lowerWhenEqn2(xs, inCond, functionTree, eqnl, iREquationLst); @@ -2189,7 +2188,7 @@ algorithm ht = BaseHashTable.add((cr, (e, source)), iHt); then lowerWhenIfEqnsElse(rest, functionTree, ht); - case (DAE.IF_EQUATION(condition1=expl, equations2=eqnslst, equations3=eqns, source = source)::rest, _, _) + case (DAE.IF_EQUATION(condition1=expl, equations2=eqnslst, equations3=eqns)::rest, _, _) equation ht = lowerWhenIfEqnsElse(eqns, functionTree, iHt); ht = lowerWhenIfEqns(listReverse(expl), listReverse(eqnslst), functionTree, ht); diff --git a/Compiler/BackEnd/BackendDAEOptimize.mo b/Compiler/BackEnd/BackendDAEOptimize.mo index f4a7d9b29ce..5341ff0fcfc 100644 --- a/Compiler/BackEnd/BackendDAEOptimize.mo +++ b/Compiler/BackEnd/BackendDAEOptimize.mo @@ -874,7 +874,7 @@ algorithm list lsteqns; Boolean b; - case syst as BackendDAE.EQSYSTEM(orderedVars=vars, orderedEqs=eqns) + case syst as BackendDAE.EQSYSTEM(orderedEqs=eqns) algorithm lsteqns := BackendEquation.equationList(eqns); (lsteqns, b) := BackendVarTransform.replaceEquations(lsteqns, repl, NONE()); @@ -1193,7 +1193,7 @@ algorithm BackendDAE.Var v; BackendDAE.Variables vars,vars1; DAE.ComponentRef cr; - case (v as BackendDAE.VAR(varKind = BackendDAE.PARAM()),(vars,vars1)) + case (v as BackendDAE.VAR(varKind = BackendDAE.PARAM()),(_,_)) then (v,inTpl); case (v as BackendDAE.VAR(),(vars,vars1)) equation @@ -1237,7 +1237,7 @@ algorithm tuple tp; // special case for time, it is never part of the equation system - case (e as DAE.CREF(componentRef = DAE.CREF_IDENT(ident="time")),(vars,vars1)) + case (e as DAE.CREF(componentRef = DAE.CREF_IDENT(ident="time")),(_,_)) then (e, inTuple); // Special Case for Records @@ -2234,7 +2234,7 @@ algorithm BackendDAE.EqSystem syst; BackendDAE.Shared shared; - case ( syst as BackendDAE.EQSYSTEM(orderedVars=vars, orderedEqs=eqns), + case ( syst as BackendDAE.EQSYSTEM(orderedEqs=eqns), shared as BackendDAE.SHARED(globalKnownVars=globalKnownVars) ) algorithm // traverse the equations @@ -2866,7 +2866,7 @@ algorithm oExp; // complex equation // (x,_) = f(.) - case(BackendDAE.COMPLEX_EQUATION(left = e1 as DAE.TUPLE(expl), right = e2)) + case(BackendDAE.COMPLEX_EQUATION(left = DAE.TUPLE(expl), right = e2)) algorithm expl1 := {}; idxs := {}; @@ -3433,7 +3433,7 @@ algorithm BackendDAE.Shared shared; list lsteqns; Boolean b; - case BackendDAE.DAE(systs, shared as BackendDAE.SHARED(globalKnownVars=globalKnownVars, initialEqs=inieqns)) + case BackendDAE.DAE(systs, shared as BackendDAE.SHARED(globalKnownVars=globalKnownVars)) algorithm repl := BackendVarTransform.emptyReplacements(); repl := BackendVariable.traverseBackendDAEVars(globalKnownVars, removeConstantsFinder, repl); @@ -3470,7 +3470,7 @@ algorithm list lsteqns; Boolean b; BackendDAE.EqSystem syst; - case syst as BackendDAE.EQSYSTEM(orderedVars=vars, orderedEqs=eqns) + case syst as BackendDAE.EQSYSTEM(orderedVars=vars) algorithm BackendVariable.traverseBackendDAEVarsWithUpdate(vars, replaceFinalVarTraverser, (repl, 0)); @@ -4592,7 +4592,7 @@ algorithm e2 := hetsSplitExp(e2); then DAE.BINARY(e1, op, e2); - case e as DAE.BINARY(e1, op, e2) + case e as DAE.BINARY(_, op, _) guard Expression.isAddOrSub(op) algorithm terms := Expression.terms(e); @@ -5632,7 +5632,7 @@ algorithm BackendDAE.EqSystem syst; BackendDAE.BaseClockPartitionKind partitionKind; - case syst as BackendDAE.EQSYSTEM(orderedVars=orderedVars, orderedEqs=orderedEqs) + case syst as BackendDAE.EQSYSTEM( orderedEqs=orderedEqs) algorithm BackendEquation.traverseEquationArray_WithUpdate(orderedEqs, addTimeAsState2, inFoo); then syst; diff --git a/Compiler/BackEnd/BackendDAEUtil.mo b/Compiler/BackEnd/BackendDAEUtil.mo index fddf3a70e11..b3094971168 100644 --- a/Compiler/BackEnd/BackendDAEUtil.mo +++ b/Compiler/BackEnd/BackendDAEUtil.mo @@ -775,7 +775,7 @@ algorithm BackendDAE.Var backendVar; Absyn.Ident name; - case (e as DAE.CREF(componentRef=cr), (vars, globalKnownVars, blst)) equation + case (e as DAE.CREF(componentRef=cr), (vars, globalKnownVars, _)) equation ((backendVar::_), _) = BackendVariable.getVar(cr, vars); false = BackendVariable.isVarDiscrete(backendVar); then (e, false, (vars, globalKnownVars, SOME(true))); @@ -1919,7 +1919,7 @@ algorithm then (e,inTpl); case (e as DAE.MATRIX(matrix=(((DAE.UNARY(exp = DAE.CREF())))::_)::_), (DAE.STMT_WHEN(), _)) then (e,inTpl); - case (e as DAE.ARRAY(array=(DAE.CREF())::_), (x as DAE.STMT_WHEN(), _)) + case (e as DAE.ARRAY(array=(DAE.CREF())::_), (DAE.STMT_WHEN(), _)) then (e,inTpl); case (e as DAE.ARRAY(array=(DAE.UNARY(exp = DAE.CREF()))::_), (DAE.STMT_WHEN(), _)) then (e,inTpl); @@ -3034,7 +3034,7 @@ algorithm equation failure(_ = List.getMemberOnTrue(i, vars, intEq)); then incidenceRowExp1(rest,irest,i::vars,diffindex); - case (_ :: rest,_::irest,_,_) + case (_ :: _,_::_,_,_) then vars; end matchcontinue; end incidenceRowExp1withInput; @@ -3489,11 +3489,11 @@ algorithm BackendDAE.StateSets stateSets; BackendDAE.BaseClockPartitionKind partitionKind; - case BackendDAE.EQSYSTEM(orderedVars=v, orderedEqs=eq, m=NONE()) equation + case BackendDAE.EQSYSTEM(m=NONE()) equation (m, mT) = incidenceMatrix(inSyst, inIndxType, inFunctionTree); then (BackendDAEUtil.setEqSystMatrices(inSyst, SOME(m), SOME(mT)), m, mT); - case BackendDAE.EQSYSTEM(orderedVars=v, orderedEqs=eq, m=SOME(m), mT=NONE()) equation + case BackendDAE.EQSYSTEM(orderedVars=v, m=SOME(m), mT=NONE()) equation mT = transposeMatrix(m, BackendVariable.varsSize(v)); then (BackendDAEUtil.setEqSystMatrices(inSyst, SOME(m), SOME(mT)), m, mT); @@ -4821,7 +4821,7 @@ algorithm DAE.Constraint con; list crlst; Boolean localCon; - case DAE.BINARY(exp1=e1, operator=DAE.DIV(), exp2=e2) + case DAE.BINARY(operator=DAE.DIV(), exp2=e2) equation rel = DAE.RELATION(e2,DAE.NEQUAL(DAE.T_UNKNOWN(DAE.emptyTypeSource)),DAE.RCONST(0.0),-1,NONE()); (_,crlst) = Expression.traverseExpTopDown(rel, Expression.traversingComponentRefFinderNoPreDer, {}); @@ -5096,15 +5096,15 @@ algorithm then (inExp, false, (vars, bs, iat, res)); // pre(v) is considered a known variable - case (DAE.CALL(path=Absyn.IDENT(name="pre"), expLst={DAE.CREF()}), (vars, bs, iat, pa)) + case (DAE.CALL(path=Absyn.IDENT(name="pre"), expLst={DAE.CREF()}), (_, _, _, _)) then (inExp, false, inTpl); // previous(v) is considered a known variable - case (DAE.CALL(path=Absyn.IDENT(name="previous"), expLst={DAE.CREF()}), (vars, bs, iat, pa)) + case (DAE.CALL(path=Absyn.IDENT(name="previous"), expLst={DAE.CREF()}), (_, _, _, _)) then (inExp, false, inTpl); // delay(e) can be used to break algebraic loops given some solver options - case (DAE.CALL(path=Absyn.IDENT(name="delay"), expLst={_, _, e1, e2}), (vars, bs, iat, pa)) equation + case (DAE.CALL(path=Absyn.IDENT(name="delay"), expLst={_, _, e1, e2}), (_, _, _, _)) equation b = Flags.getConfigBool(Flags.DELAY_BREAK_LOOP) and Expression.expEqual(e1, e2); then (inExp, not b, inTpl); @@ -6388,7 +6388,7 @@ algorithm a = SOME(DAE.VAR_ATTR_ENUMERATION(q_,min_,max_,i_,f_,eqbound_,p,fin,startOrigin)); end if; then (a,outExtraArg); - case(SOME(DAE.VAR_ATTR_CLOCK(p, fin)),_,_) + case(SOME(DAE.VAR_ATTR_CLOCK(_, _)),_,_) then (attr,extraArg); end match; @@ -8705,7 +8705,7 @@ author: Waurich TUD 09-2015" output list eqsOut; output list eqIdcxs; algorithm - (varsOut,varIdxs,eqsOut,eqIdcxs) := matchcontinue(comp,varArr,eqArr) + (varsOut,varIdxs,eqsOut,eqIdcxs) := match(comp,varArr,eqArr) local Integer vidx,eidx; list vidxs,eidxs, otherEqns, otherVars; @@ -8759,7 +8759,7 @@ algorithm vars = List.map1(vidxs,BackendVariable.getVarAtIndexFirst,varArr); eqs = BackendEquation.getEqns(eidxs,eqArr); then (vars,vidxs,eqs,eidxs); - end matchcontinue; + end match; end getStrongComponentVarsAndEquations; public function getStrongComponentEquations"gets all equations from a component" diff --git a/Compiler/BackEnd/BackendDump.mo b/Compiler/BackEnd/BackendDump.mo index c9d3a0b284a..6c3053ca58d 100644 --- a/Compiler/BackEnd/BackendDump.mo +++ b/Compiler/BackEnd/BackendDump.mo @@ -900,7 +900,7 @@ algorithm dumpBackendDAEEqnList2(res,printExpTree); then (); - case (BackendDAE.WHEN_EQUATION(whenEquation=weqn, attr=BackendDAE.EQUATION_ATTRIBUTES(kind=eqKind))::res, _) equation + case (BackendDAE.WHEN_EQUATION(whenEquation=weqn, attr=BackendDAE.EQUATION_ATTRIBUTES(kind=eqKind))::_, _) equation print("WHEN_EQUATION: "); str = whenEquationString(weqn, true); print(str); @@ -1502,7 +1502,7 @@ public function equationString "Helper function to e.g. dump." input BackendDAE.Equation inEquation; output String outString; algorithm - outString := matchcontinue (inEquation) + outString := match (inEquation) local String s1,s2,s3,s4,res; DAE.Exp e1,e2,e,cond, start, stop, iter; @@ -1515,7 +1515,7 @@ algorithm list> eqnstrue; list eqnsfalse,eqns; list whenStmtLst; - case (BackendDAE.EQUATION(exp = e1,scalar = e2, attr=attr)) + case (BackendDAE.EQUATION(exp = e1,scalar = e2)) equation s1 = ExpressionDump.printExpStr(e1); s2 = ExpressionDump.printExpStr(e2); @@ -1574,7 +1574,7 @@ algorithm res = stringAppendList({"for ",s1," loop \n ",s2, "; end for; "}); then res; - end matchcontinue; + end match; end equationString; protected function zeroCrossingString "Dumps a zerocrossing into a string, for debugging purposes." diff --git a/Compiler/BackEnd/BackendEquation.mo b/Compiler/BackEnd/BackendEquation.mo index 88fdc0cb8c1..5d3ed7c4553 100644 --- a/Compiler/BackEnd/BackendEquation.mo +++ b/Compiler/BackEnd/BackendEquation.mo @@ -297,11 +297,11 @@ algorithm then (e, true, inTuple); // case for pre vars - case (e as DAE.CALL(path = Absyn.IDENT(name = "pre")), _) + case (DAE.CALL(path = Absyn.IDENT(name = "pre")), _) then (inExp, false, inTuple); // case for previous vars - case (e as DAE.CALL(path = Absyn.IDENT(name = "previous")), _) + case (DAE.CALL(path = Absyn.IDENT(name = "previous")), _) then (inExp, false, inTuple); // add it @@ -707,7 +707,7 @@ algorithm (we_1, extArg) = traverseExpsOfWhenEquation(we, inFunc, inTypeA); then (if referenceEq(we,we_1) then inEquation else BackendDAE.WHEN_EQUATION(size, we_1, source, attr), extArg); - case BackendDAE.ALGORITHM(size=size, alg=alg as DAE.ALGORITHM_STMTS(statementLst = stmts), source=source, expand=crefExpand, attr=attr) equation + case BackendDAE.ALGORITHM(size=size, alg=DAE.ALGORITHM_STMTS(statementLst = stmts), source=source, expand=crefExpand, attr=attr) equation (stmts1, extArg) = DAEUtil.traverseDAEEquationsStmts(stmts, inFunc, inTypeA); then (if referenceEq(stmts,stmts1) then inEquation else BackendDAE.ALGORITHM(size, DAE.ALGORITHM_STMTS(stmts1), source, crefExpand, attr), extArg); @@ -1058,7 +1058,7 @@ algorithm (b, extArg) = traverseExpsOfWhenOps_WithStop(rest, inFunc, extArg, b); then (b, extArg); - case (BackendDAE.ASSERT(condition = e1, message = e2, level = level)::rest) + case (BackendDAE.ASSERT(condition = e1, message = e2)::rest) equation if inCont then (_, b, extArg) = inFunc(e1, inTypeA); @@ -1077,7 +1077,7 @@ algorithm (b, extArg) = traverseExpsOfWhenOps_WithStop(rest, inFunc, extArg, b); then (b, extArg); - case (BackendDAE.NORETCALL(exp = e1, source = source)::rest) + case (BackendDAE.NORETCALL(exp = e1)::rest) equation if inCont then (_, b, extArg) = inFunc(e1, inTypeA); diff --git a/Compiler/BackEnd/BackendInline.mo b/Compiler/BackEnd/BackendInline.mo index d22a207c720..806e8f430f6 100644 --- a/Compiler/BackEnd/BackendInline.mo +++ b/Compiler/BackEnd/BackendInline.mo @@ -344,7 +344,7 @@ protected function inlineWhenEq output DAE.ElementSource outSource; output Boolean inlined; algorithm - (outWhenEquation,outSource,inlined) := matchcontinue(inWhenEquation) + (outWhenEquation,outSource,inlined) := match(inWhenEquation) local DAE.ComponentRef cref; DAE.Exp e,e_1,cond; @@ -371,7 +371,7 @@ algorithm end if; then (BackendDAE.WHEN_STMTS(cond, whenStmtLst, oelsewe), source, b1 or b2 or b3); - end matchcontinue; + end match; end inlineWhenEq; protected function inlineWhenOps @@ -1195,7 +1195,7 @@ algorithm guard not Expression.isRecordType(ComponentReference.crefTypeFull(cr)) algorithm // create variables - (crVar, varLst, repl) := createReplacementVariables(cr, funcname, repl); + (_, varLst, repl) := createReplacementVariables(cr, funcname, repl); varLst := list(BackendVariable.setVarTS(_var, SOME(BackendDAE.AVOID())) for _var in varLst); outEqs := BackendVariable.addVarsDAE(varLst, outEqs); then (); diff --git a/Compiler/BackEnd/BackendVariable.mo b/Compiler/BackEnd/BackendVariable.mo index 05391c1e5fa..28facf5d4d6 100644 --- a/Compiler/BackEnd/BackendVariable.mo +++ b/Compiler/BackEnd/BackendVariable.mo @@ -1751,7 +1751,6 @@ algorithm fail(); end if; e = Expression.crefExp(name); - varStr = ComponentReference.printComponentRefStr(name); tp = BackendDAEUtil.makeExpType(varType); // do not add if const true @@ -1842,7 +1841,6 @@ algorithm cond = getMinMaxAsserts1(min, max, e, tp); (cond, _) = ExpressionSimplify.simplify(cond); false = Expression.isConstTrue(cond); - varStr = ComponentReference.printComponentRefStr(name); str = getMinMaxAsserts1Str(min, max, ComponentReference.printComponentRefStr(name), nominal=true); // if is real use %g otherwise use %d (ints and enums) format = if Types.isRealOrSubTypeReal(tp) then "g" else "d"; diff --git a/Compiler/BackEnd/FindZeroCrossings.mo b/Compiler/BackEnd/FindZeroCrossings.mo index ee89886365d..d7c985014bc 100644 --- a/Compiler/BackEnd/FindZeroCrossings.mo +++ b/Compiler/BackEnd/FindZeroCrossings.mo @@ -1019,7 +1019,7 @@ algorithm end if; then (eres, true, ((zeroCrossings, relations, samples, numRelations, numMathFunctions), tp1)); - case (DAE.CALL(path=Absyn.IDENT("mod"), expLst={e1, e2}, attr=attr as DAE.CALL_ATTR(ty=ty)), ((zeroCrossings, relations, samples, numRelations, numMathFunctions), tp1 as (eq_count, _, _))) equation + case (DAE.CALL(path=Absyn.IDENT("mod"), expLst={e1, e2}, attr=attr as DAE.CALL_ATTR()), ((zeroCrossings, relations, samples, numRelations, numMathFunctions), tp1 as (eq_count, _, _))) equation true = Flags.isSet(Flags.EVENTS); if Flags.isSet(Flags.RELIDX) then print("start collectZC: " + ExpressionDump.printExpStr(inExp) + " numMathFunctions: " +intString(numMathFunctions) + "\n"); @@ -1090,7 +1090,7 @@ algorithm case (DAE.CALL(path=Absyn.IDENT(name="smooth")), _) then (inExp, false, inTpl); - case (DAE.CALL(path=Absyn.IDENT(name="sample")), (iterator, inExpLst, range, (zeroCrossings, relations, samples, numRelations, numMathFunctions), tp1 as (alg_indx, vars, globalKnownVars))) equation + case (DAE.CALL(path=Absyn.IDENT(name="sample")), (iterator, inExpLst, range, (zeroCrossings, relations, samples, numRelations, numMathFunctions), tp1 as (alg_indx, _, _))) equation eqs = {alg_indx}; zc = createZeroCrossing(inExp, eqs); samples = listAppend(samples, {zc}); @@ -1101,19 +1101,19 @@ algorithm end if; then (inExp, true, (iterator, inExpLst, range, (zeroCrossings, relations, samples, numRelations, numMathFunctions), tp1)); - case (DAE.LUNARY(exp=e1), (iterator, inExpLst, range, _, (_, vars, globalKnownVars))) equation + case (DAE.LUNARY(exp=e1), (_, _, _, _, (_, vars, globalKnownVars))) equation false = BackendDAEUtil.hasExpContinuousParts(e1, vars, globalKnownVars); //fcall(Flags.RELIDX, print, "discrete LUNARY: " + intString(indx) + "\n"); //fcall(Flags.RELIDX, BackendDump.debugExpStr, (inExp, "\n")); then (inExp, true, inTpl); // conditions that are zerocrossings. - case (DAE.LUNARY(exp=e1, operator=op), (iterator, inExpLst, range as DAE.RANGE(), (zeroCrossings, relations, samples, numRelations, numMathFunctions), tp1)) equation + case (DAE.LUNARY(exp=e1, operator=op), (iterator, inExpLst, DAE.RANGE(), (zeroCrossings, relations, samples, numRelations, numMathFunctions), tp1)) equation true = Expression.expContains(inExp, iterator); if Flags.isSet(Flags.RELIDX) then print("continues LUNARY with Iterator: " + intString(numRelations) + "\n"); end if; - (e1, (iterator, inExpLst, range2, (_, relations, samples, numRelations, numMathFunctions), tp1 as (alg_indx, vars, globalKnownVars))) = Expression.traverseExpTopDown(e1, collectZCAlgsFor, inTpl); + (e1, (iterator, inExpLst, range2, (_, relations, samples, numRelations, numMathFunctions), tp1 as (alg_indx, _, _))) = Expression.traverseExpTopDown(e1, collectZCAlgsFor, inTpl); e_1 = DAE.LUNARY(op, e1); (explst, itmp) = replaceIteratorWithStaticValues(e_1, iterator, inExpLst, numRelations); zc_lst = createZeroCrossings(explst, {alg_indx}); @@ -1129,11 +1129,11 @@ algorithm then (e_1, false, (iterator, inExpLst, range2, (zeroCrossings, relations, samples, numRelations, numMathFunctions), tp1)); // coditions that are zerocrossings. - case (DAE.LUNARY(exp=e1, operator=op), (iterator, inExpLst, range, (zeroCrossings, relations, samples, numRelations, numMathFunctions), tp1 as (alg_indx, vars, globalKnownVars))) equation + case (DAE.LUNARY(exp=e1, operator=op), (iterator, inExpLst, range, (zeroCrossings, relations, samples, numRelations, numMathFunctions), tp1 as (alg_indx, _, _))) equation if Flags.isSet(Flags.RELIDX) then print("continues LUNARY: " + intString(numRelations) + "\n"); end if; - (e1, (iterator, inExpLst, range, (_, relations, samples, numRelations, numMathFunctions), tp1 as (alg_indx, vars, globalKnownVars))) = Expression.traverseExpTopDown(e1, collectZCAlgsFor, inTpl); + (e1, (iterator, inExpLst, range, (_, relations, samples, numRelations, numMathFunctions), tp1 as (alg_indx, _, _))) = Expression.traverseExpTopDown(e1, collectZCAlgsFor, inTpl); e_1 = DAE.LUNARY(op, e1); zc = createZeroCrossing(e_1, {alg_indx}); zc_lst = List.select1(zeroCrossings, zcEqual, zc); @@ -1159,7 +1159,7 @@ algorithm b1 = Expression.expContains(e1, iterator); true = if b1 then true else Expression.expContains(e2, iterator); (e_1, (iterator, inExpLst, range, (_, relations, samples, numRelations1, numMathFunctions), tp1)) = Expression.traverseExpTopDown(e1, collectZCAlgsFor, inTpl); - (e_2, (iterator, inExpLst, range, (_, relations, samples, numRelations1, numMathFunctions), tp1 as (alg_indx, vars, globalKnownVars))) = Expression.traverseExpTopDown(e2, collectZCAlgsFor, (iterator, inExpLst, range, (zeroCrossings, relations, samples, numRelations1, numMathFunctions), tp1)); + (e_2, (iterator, inExpLst, range, (_, relations, samples, numRelations1, numMathFunctions), tp1 as (alg_indx, _, _))) = Expression.traverseExpTopDown(e2, collectZCAlgsFor, (iterator, inExpLst, range, (zeroCrossings, relations, samples, numRelations1, numMathFunctions), tp1)); true = intGt(numRelations1, numRelations); e_1 = DAE.LBINARY(e_1, op, e_2); (explst, itmp) = replaceIteratorWithStaticValues(e_1, iterator, inExpLst, numRelations1); @@ -1174,13 +1174,13 @@ algorithm end if; then (e_1, false, (iterator, inExpLst, range, (zeroCrossings, relations, samples, numRelations1, numMathFunctions), tp1)); - case (DAE.LBINARY(exp1=e1, operator=op, exp2=e2), (iterator, inExpLst, range, (zeroCrossings, relations, samples, numRelations, numMathFunctions), (alg_indx, vars, globalKnownVars))) equation + case (DAE.LBINARY(exp1=e1, operator=op, exp2=e2), (iterator, inExpLst, range, (zeroCrossings, relations, samples, numRelations, numMathFunctions), (alg_indx, _, _))) equation if Flags.isSet(Flags.RELIDX) then print("continues LBINARY: " + intString(numRelations) + "\n"); BackendDump.debugExpStr(inExp, "\n"); end if; (e_1, (iterator, inExpLst, range, (_, relations, samples, numRelations1, numMathFunctions), tp1)) = Expression.traverseExpTopDown(e1, collectZCAlgsFor, inTpl); - (e_2, (iterator, inExpLst, range, (_, relations, samples, numRelations1, numMathFunctions), tp1 as (alg_indx, vars, globalKnownVars))) = Expression.traverseExpTopDown(e2, collectZCAlgsFor, (iterator, inExpLst, range, (zeroCrossings, relations, samples, numRelations1, numMathFunctions), tp1)); + (e_2, (iterator, inExpLst, range, (_, relations, samples, numRelations1, numMathFunctions), tp1 as (alg_indx, _, _))) = Expression.traverseExpTopDown(e2, collectZCAlgsFor, (iterator, inExpLst, range, (zeroCrossings, relations, samples, numRelations1, numMathFunctions), tp1)); true = intGt(numRelations1, numRelations); e_1 = DAE.LBINARY(e_1, op, e_2); zc = createZeroCrossing(e_1, {alg_indx}); @@ -1192,13 +1192,13 @@ algorithm then (e_1, false, (iterator, inExpLst, range, (zeroCrossings, relations, samples, numRelations1, numMathFunctions), tp1)); // function with discrete expressions generate no zerocrossing. - case (DAE.RELATION(exp1=e1, exp2=e2), (_, _, _, _, tp1 as (_, vars, globalKnownVars))) equation + case (DAE.RELATION(exp1=e1, exp2=e2), (_, _, _, _, (_, vars, globalKnownVars))) equation false = BackendDAEUtil.hasExpContinuousParts(e1, vars, globalKnownVars); false = BackendDAEUtil.hasExpContinuousParts(e2, vars, globalKnownVars); then (inExp, true, inTpl); // All other functions generate zerocrossing. - case (DAE.RELATION(exp1=e1, operator=op, exp2=e2), (iterator, inExpLst, range as DAE.RANGE(start=startvalue, step=stepvalueopt), (zeroCrossings, relations, samples, numRelations, numMathFunctions), tp1 as (alg_indx, vars, globalKnownVars))) equation + case (DAE.RELATION(exp1=e1, operator=op, exp2=e2), (iterator, inExpLst, range as DAE.RANGE(start=startvalue, step=stepvalueopt), (zeroCrossings, relations, samples, numRelations, numMathFunctions), tp1 as (alg_indx, _, globalKnownVars))) equation true = Flags.isSet(Flags.EVENTS); b1 = Expression.expContains(e1, iterator); true = if b1 then true else Expression.expContains(e2, iterator); @@ -1234,7 +1234,7 @@ algorithm then (eres, true, (iterator, inExpLst, range, (zeroCrossings, zc_lst, samples, numRelations, numMathFunctions), tp1)); // All other functions generate zerocrossing. - case (DAE.RELATION(exp1=e1, operator=op, exp2=e2), (iterator, inExpLst, range, (zeroCrossings, relations, samples, numRelations, numMathFunctions), tp1 as (alg_indx, vars, globalKnownVars))) equation + case (DAE.RELATION(exp1=e1, operator=op, exp2=e2), (iterator, inExpLst, range, (zeroCrossings, relations, samples, numRelations, numMathFunctions), tp1 as (alg_indx, _, _))) equation true = Flags.isSet(Flags.EVENTS); false = Expression.expContains(e1, iterator); false = Expression.expContains(e2, iterator); @@ -1254,7 +1254,7 @@ algorithm then (eres, true, (iterator, inExpLst, range, (zeroCrossings, zc_lst, samples, numRelations, numMathFunctions), tp1)); // math function that triggering events - case (DAE.CALL(path=Absyn.IDENT("integer"), expLst={e1}, attr=attr), (iterator, le, range, (zeroCrossings, relations, samples, numRelations, numMathFunctions), tp1 as (alg_indx, vars, globalKnownVars))) equation + case (DAE.CALL(path=Absyn.IDENT("integer"), expLst={e1}, attr=attr), (iterator, le, range, (zeroCrossings, relations, samples, numRelations, numMathFunctions), tp1 as (alg_indx, _, _))) equation true = Flags.isSet(Flags.EVENTS); if Flags.isSet(Flags.RELIDX) then print("start collectZC: " + ExpressionDump.printExpStr(inExp) + " numMathFunctions: " +intString(numMathFunctions) + "\n"); @@ -1270,7 +1270,7 @@ algorithm end if; then (eres, true, (iterator, le, range, (zeroCrossings, relations, samples, numRelations, numMathFunctions), tp1)); - case (DAE.CALL(path=Absyn.IDENT("floor"), expLst={e1}, attr=attr), (iterator, le, range, (zeroCrossings, relations, samples, numRelations, numMathFunctions), tp1 as (alg_indx, vars, globalKnownVars))) equation + case (DAE.CALL(path=Absyn.IDENT("floor"), expLst={e1}, attr=attr), (iterator, le, range, (zeroCrossings, relations, samples, numRelations, numMathFunctions), tp1 as (alg_indx, _, _))) equation true = Flags.isSet(Flags.EVENTS); if Flags.isSet(Flags.RELIDX) then print("start collectZC: " + ExpressionDump.printExpStr(inExp) + " numMathFunctions: " +intString(numMathFunctions) + "\n"); @@ -1286,7 +1286,7 @@ algorithm end if; then (eres, true, (iterator, le, range, (zeroCrossings, relations, samples, numRelations, numMathFunctions), tp1)); - case (DAE.CALL(path=Absyn.IDENT("ceil"), expLst={e1}, attr=attr), (iterator, le, range, (zeroCrossings, relations, samples, numRelations, numMathFunctions), tp1 as (alg_indx, vars, globalKnownVars))) equation + case (DAE.CALL(path=Absyn.IDENT("ceil"), expLst={e1}, attr=attr), (iterator, le, range, (zeroCrossings, relations, samples, numRelations, numMathFunctions), tp1 as (alg_indx, _, _))) equation true = Flags.isSet(Flags.EVENTS); if Flags.isSet(Flags.RELIDX) then print("start collectZC: " + ExpressionDump.printExpStr(inExp) + " numMathFunctions: " +intString(numMathFunctions) + "\n"); @@ -1302,7 +1302,7 @@ algorithm end if; then (eres, true, (iterator, le, range, (zeroCrossings, relations, samples, numRelations, numMathFunctions), tp1)); - case (DAE.CALL(path=Absyn.IDENT("div"), expLst={e1, e2}, attr=attr), (iterator, le, range, (zeroCrossings, relations, samples, numRelations, numMathFunctions), tp1 as (alg_indx, vars, globalKnownVars))) equation + case (DAE.CALL(path=Absyn.IDENT("div"), expLst={e1, e2}, attr=attr), (iterator, le, range, (zeroCrossings, relations, samples, numRelations, numMathFunctions), tp1 as (alg_indx, _, _))) equation true = Flags.isSet(Flags.EVENTS); if Flags.isSet(Flags.RELIDX) then print("start collectZC: " + ExpressionDump.printExpStr(inExp) + " numMathFunctions: " +intString(numMathFunctions) + "\n"); @@ -1318,7 +1318,7 @@ algorithm end if; then (eres, true, (iterator, le, range, (zeroCrossings, relations, samples, numRelations, numMathFunctions), tp1)); - case (DAE.CALL(path=Absyn.IDENT("mod"), expLst={e1, e2}, attr=attr as DAE.CALL_ATTR(ty = ty)), (iterator, le, range, (zeroCrossings, relations, samples, numRelations, numMathFunctions), tp1 as (alg_indx, vars, globalKnownVars))) equation + case (DAE.CALL(path=Absyn.IDENT("mod"), expLst={e1, e2}, attr=attr as DAE.CALL_ATTR()), (iterator, le, range, (zeroCrossings, relations, samples, numRelations, numMathFunctions), tp1 as (alg_indx, _, _))) equation true = Flags.isSet(Flags.EVENTS); if Flags.isSet(Flags.RELIDX) then print("start collectZC: " + ExpressionDump.printExpStr(inExp) + " numMathFunctions: " +intString(numMathFunctions) + "\n"); @@ -1335,7 +1335,7 @@ algorithm then (eres, true, (iterator, le, range, (zeroCrossings, relations, samples, numRelations, numMathFunctions), tp1)); // rem is rewritten to div(x/y)*y - x - case (DAE.CALL(path=Absyn.IDENT("rem"), expLst={e1, e2}, attr=attr as DAE.CALL_ATTR(ty = ty)), (iterator, le, range, (zeroCrossings, relations, samples, numRelations, numMathFunctions), tp1 as (alg_indx, vars, globalKnownVars))) equation + case (DAE.CALL(path=Absyn.IDENT("rem"), expLst={e1, e2}, attr=attr as DAE.CALL_ATTR(ty = ty)), (iterator, le, range, (zeroCrossings, relations, samples, numRelations, numMathFunctions), tp1 as (alg_indx, _, _))) equation true = Flags.isSet(Flags.EVENTS); if Flags.isSet(Flags.RELIDX) then print("start collectZC: " + ExpressionDump.printExpStr(inExp) + " numMathFunctions: " +intString(numMathFunctions) + "\n"); diff --git a/Compiler/BackEnd/HpcOmEqSystems.mo b/Compiler/BackEnd/HpcOmEqSystems.mo index 566d5b31ce4..a59ed3c16e7 100644 --- a/Compiler/BackEnd/HpcOmEqSystems.mo +++ b/Compiler/BackEnd/HpcOmEqSystems.mo @@ -1043,7 +1043,7 @@ algorithm vars = BackendVariable.listVar1(inVars); eqArr = BackendEquation.listEquation(inEqs); sysTmp = BackendDAEUtil.createEqSystem(vars, eqArr); - (sysTmp,m,mt) = BackendDAEUtil.getIncidenceMatrix(sysTmp,BackendDAE.NORMAL(),NONE()); + (sysTmp,m,_) = BackendDAEUtil.getIncidenceMatrix(sysTmp,BackendDAE.NORMAL(),NONE()); nVars = listLength(inVars); nEqs = listLength(inEqs); ass1 = arrayCreate(nVars, -1); diff --git a/Compiler/BackEnd/HpcOmScheduler.mo b/Compiler/BackEnd/HpcOmScheduler.mo index 65548453d87..a4560ff8fc6 100644 --- a/Compiler/BackEnd/HpcOmScheduler.mo +++ b/Compiler/BackEnd/HpcOmScheduler.mo @@ -1631,7 +1631,7 @@ algorithm case({section},HpcOmTaskGraph.TASKGRAPHMETA(inComps=inComps),_) equation // generate a serial section - compLst = List.flatten(List.map1(section,Array.getIndexFirst,inComps)); + _ = List.flatten(List.map1(section,Array.getIndexFirst,inComps)); //simEqSysIdcs = List.sort(simEqSysIdcs,intGt); task = makeCalcTaskLevel(section,inComps,iSccSimEqMapping); taskLst = HpcOmSimCode.SERIALTASKLIST({task}, true); @@ -2554,7 +2554,7 @@ protected function createMetisSchedule2 "author: Waurich TUD 03-2015 output list prioLstOut; output list otherLstOut; algorithm - (prioLstOut,otherLstOut) := matchcontinue(levelNodes,priorityArr,prioLstIn,otherLstIn) + (prioLstOut,otherLstOut) := match(levelNodes,priorityArr,prioLstIn,otherLstIn) local list level, prioLst, otherLst; list> rest; @@ -2570,7 +2570,7 @@ algorithm otherLst := listAppend(otherLstIn,otherLst); (prioLst,otherLst) := createMetisSchedule2(rest,priorityArr,prioLst,otherLst); then (prioLst,otherLst); - end matchcontinue; + end match; end createMetisSchedule2; protected function isPrioNode "author: Waurich TUD 03-2015" @@ -4550,7 +4550,7 @@ algorithm array> allCalcTasks; HpcOmSimCode.Schedule schedule; list order; - case(_,HpcOmTaskGraph.TASKGRAPHMETA(commCosts=commCosts,inComps=inComps),_,_,_) + case(_,HpcOmTaskGraph.TASKGRAPHMETA(commCosts=_),_,_,_) algorithm true := intNe(arrayLength(iTaskGraph),0); nTasks := arrayLength(iTaskGraph); @@ -4558,7 +4558,7 @@ algorithm partitions := arrayCreate(numProc,{}); taskMap := arrayCreate(nTasks,-1); partMap := arrayCreate(listLength(rootNodes),{}); - partitionCosts := arrayCreate(numProc,0.0); + _ := arrayCreate(numProc,0.0); graphT := BackendDAEUtil.transposeMatrix(iTaskGraph,arrayLength(iTaskGraph)); // get all existing partitions (taskMap,partMap,_) := List.fold1(rootNodes,assignPartitions,iTaskGraph,(taskMap,partMap,1)); @@ -6130,8 +6130,8 @@ algorithm true = taskIdx <= listLength(thread); task = listGet(thread,taskIdx); //compute timeFinished for the task - (threadTasks,checkedTasks,nextTaskIdx) = updateFinishingTime(task,taskIdx,threadIdxIn,threadTasksIn,checkedTasksIn,taskGraphTIn,taskGraphMetaIn); - taskIdcs = arrayUpdate(taskIdcsIn,threadIdxIn,nextTaskIdx); + (_,_,nextTaskIdx) = updateFinishingTime(task,taskIdx,threadIdxIn,threadTasksIn,checkedTasksIn,taskGraphTIn,taskGraphMetaIn); + _ = arrayUpdate(taskIdcsIn,threadIdxIn,nextTaskIdx); nextThreadIdx = getNextThreadIdx(threadIdxIn,closedThreadsIn,numProc); //threadTasks = computeTimeFinished(threadTasks,taskIdcs,nextThreadIdx,checkedTasks,taskGraphIn,taskGraphTIn,taskGraphMetaIn,numProc,closedThreadsIn); then diff --git a/Compiler/BackEnd/HpcOmTaskGraph.mo b/Compiler/BackEnd/HpcOmTaskGraph.mo index c9e409f1c8e..b130b56517b 100644 --- a/Compiler/BackEnd/HpcOmTaskGraph.mo +++ b/Compiler/BackEnd/HpcOmTaskGraph.mo @@ -4640,7 +4640,7 @@ algorithm costs = offset + 12*numAdds + 32*numMul + 37*numDiv + 236*numTrig + 2*numRel + 4*numLog + 110*numOth + 375*numFuncs; then (ops,intReal(costs)); - case(BackendDAE.SYSTEM(allOperations=_,size=size,density=dens))// density is in procent + case(BackendDAE.SYSTEM(size=size,density=dens))// density is in procent equation allOpCosts = realMul(0.049, realPow(realMul(intReal(size),(realAdd(1.0,realMul(dens,19.0)))),3.0)); then (1, allOpCosts); @@ -6074,7 +6074,7 @@ algorithm array compInformations1, compInformations2; case(_,_,_) equation - BackendDAE.DAE(eqs = systs, shared = shared) = dae; + BackendDAE.DAE(eqs = _, shared = shared) = dae; remEqs = BackendDAEUtil.collapseRemovedEqs(dae); TASKGRAPHMETA(varCompMapping=varCompMap) = graphDataIn; eqLst = BackendEquation.equationList(remEqs); diff --git a/Compiler/BackEnd/IndexReduction.mo b/Compiler/BackEnd/IndexReduction.mo index 03e66666be3..94026971f15 100644 --- a/Compiler/BackEnd/IndexReduction.mo +++ b/Compiler/BackEnd/IndexReduction.mo @@ -1081,7 +1081,7 @@ algorithm (syst,inShared,inAss1,inAss2,inStateOrd,inOrgEqnsLst,mapEqnIncRow,mapIncRowEqn); // if no state with unused derivative is in the set check global - case (_,{},_,_,_,syst as BackendDAE.EQSYSTEM(orderedVars=v, m=SOME(_), mT=SOME(mt))) + case (_,{},_,_,_,BackendDAE.EQSYSTEM(orderedVars=v, m=SOME(_), mT=SOME(mt))) equation ilst = Matching.getUnassigned(BackendVariable.varsSize(v), inAss1, {}); ilst = List.fold1(ilst, statesWithUnusedDerivative, mt, {}); @@ -1862,7 +1862,6 @@ algorithm syst = BackendEquation.equationsAddDAE(eqnslst1, inSystem); // Dummy Derivatives if Flags.getConfigString(Flags.INDEX_REDUCTION_METHOD) == "dummyDerivatives" and neqns < nfreeStates then - nfreeStates = neqns; //print("BEFORE:\n"); //BackendDump.printVarList(dummyVars); dummyVars = reduceStateSets(stateSets, dummyVars); diff --git a/Compiler/BackEnd/MathematicaDump.mo b/Compiler/BackEnd/MathematicaDump.mo index 32f31100248..a41bdf5f579 100644 --- a/Compiler/BackEnd/MathematicaDump.mo +++ b/Compiler/BackEnd/MathematicaDump.mo @@ -104,7 +104,7 @@ public function printMmaEqnStr "help function to printMmaEqnsStr" input tuple inTuple "required to find array eqns and algorithms"; output String str; algorithm - str := matchcontinue(eqn,inTuple) + str := match(eqn,inTuple) local DAE.Exp e1,e2; DAE.ComponentRef cr; BackendDAE.Variables vars,knvars; @@ -144,7 +144,7 @@ algorithm s2 = printExpMmaStr(e2,vars,knvars); str = stringAppendList({s1,"==",s2}); then str; - end matchcontinue; + end match; end printMmaEqnStr; diff --git a/Compiler/BackEnd/RemoveSimpleEquations.mo b/Compiler/BackEnd/RemoveSimpleEquations.mo index 3a6e034e599..5ad517a3b78 100644 --- a/Compiler/BackEnd/RemoveSimpleEquations.mo +++ b/Compiler/BackEnd/RemoveSimpleEquations.mo @@ -1713,7 +1713,7 @@ algorithm // constant or alias then constOrAliasAcausal(v, i, cr, es, eqnAttributes, inTpl); - case (_, _, _, _, (source, eqAttr), (_, BackendDAE.SHARED(functionTree=functionTree), _, _, _, _, _)) + case (_, _, _, _, (source, eqAttr), (_, BackendDAE.SHARED(), _, _, _, _, _)) equation // size of equation have to be equal with number of vars size = Expression.sizeOf(Expression.typeof(lhs)); @@ -3368,7 +3368,7 @@ algorithm case ((e, cr, i)::_) guard not Expression.isZero(e) then ((e, cr, i)); - case ((e, cr, i)::rest) + case ((_, _, _)::rest) then selectNonZeroExpression(rest); end match; @@ -3406,7 +3406,7 @@ algorithm // end of list analyse what we got case ({}, rest, _, _, _, _) equation - ((e, cr, i)) = selectNonZeroExpression(rest); + ((e, cr, _)) = selectNonZeroExpression(rest); crVar = BackendVariable.varCref(inVar); s = iStr + "=> select value from " + ComponentReference.printComponentRefStr(cr) + "(" + iAttributeName + " = " + ExpressionDump.printExpStr(e) + ") for variable: " + ComponentReference.printComponentRefStr(crVar) + "\n"; if Flags.isSet(Flags.DEBUG_ALIAS) then @@ -3563,7 +3563,7 @@ algorithm BackendDAE.Shared shared; case (false, _) then inDAE; - case (true, BackendDAE.DAE(systs, shared as BackendDAE.SHARED( globalKnownVars=globalKnownVars, aliasVars=aliasVars, initialEqs=inieqns, + case (true, BackendDAE.DAE(systs, shared as BackendDAE.SHARED( globalKnownVars=globalKnownVars, aliasVars=aliasVars, constraints=constraintsLst, classAttrs=clsAttrsLst ))) equation if Flags.isSet(Flags.DUMP_REPL) then @@ -4388,7 +4388,7 @@ algorithm Boolean b1; BackendVarTransform.VariableReplacements repl; - case ( syst as BackendDAE.EQSYSTEM(orderedVars=orderedVars, orderedEqs=orderedEqs, removedEqs=remeqns), + case ( syst as BackendDAE.EQSYSTEM(orderedVars=orderedVars, orderedEqs=orderedEqs), shared as BackendDAE.SHARED( globalKnownVars=globalKnownVars, aliasVars=aliasVars, initialEqs=inieqns, eventInfo=eventInfo) ) equation @@ -4655,9 +4655,9 @@ algorithm true = Types.isSimpleType(Expression.typeof(exp1)); exp2 = Expression.crefExp(cr2); - eqSolved as BackendDAE.EQUATION(scalar=res) = BackendEquation.solveEquation(eq,exp2,NONE()); + BackendDAE.EQUATION(scalar=res) = BackendEquation.solveEquation(eq,exp2,NONE()); true = isSimple(res); - eqSolved as BackendDAE.EQUATION(scalar=res) = BackendEquation.solveEquation(eq,exp1,NONE()); + BackendDAE.EQUATION(scalar=res) = BackendEquation.solveEquation(eq,exp1,NONE()); true = isSimple(res); if Flags.isSet(Flags.DEBUG_ALIAS) then print("Found Equation al1: " + BackendDump.equationString(eq) + "\n"); @@ -5179,7 +5179,7 @@ algorithm BackendDAE.EquationAttributes eqAttr; case ({}) then (outHTStartExpToInt,outHTNominalExpToInt); - case (cr1,eq)::cr_eq_rest equation + case (cr1,_)::cr_eq_rest equation (v,_) = BackendVariable.getVarSingle(cr1,inAliasVars); e = BackendVariable.varBindExp(v); if BackendVariable.varHasStartValue(v) then diff --git a/Compiler/BackEnd/StateMachineFeatures.mo b/Compiler/BackEnd/StateMachineFeatures.mo index 73cf93178f3..cdd06543b68 100644 --- a/Compiler/BackEnd/StateMachineFeatures.mo +++ b/Compiler/BackEnd/StateMachineFeatures.mo @@ -808,7 +808,7 @@ algorithm // CREF DAE.ComponentRef cref; DAE.Type ty; - case ((i, expThen)::{}, DAE.CREF(componentRef=cref,ty=ty)) + case ((i, expThen)::{}, DAE.CREF(componentRef=_,ty=ty)) equation callAttributes = DAE.CALL_ATTR(ty,false,true,false,false,DAE.NO_INLINE(),DAE.NO_TAIL()); // SMS_PRE.initialState.activeState == i @@ -2441,7 +2441,7 @@ algorithm then BaseHashTable.get(cstate1, inA) else MODE(ComponentReference.crefLastIdent(cstate1), true, HashSet.emptyHashSet(), BackendEquation.emptyEqns(), BackendEquation.emptyEqns(), {}, {}, {}); - MODE(name1,isInitial1,edges1,eqs1,outgoing1,os1,ol1,ps1) = mode1; + MODE(name1,_,edges1,eqs1,outgoing1,os1,ol1,ps1) = mode1; mode1 = MODE(name1,true,edges1,eqs1,outgoing1,os1,ol1,ps1); modes = BaseHashTable.add((cstate1, mode1), inA); then modes; diff --git a/Compiler/BackEnd/SymbolicJacobian.mo b/Compiler/BackEnd/SymbolicJacobian.mo index efe734ba44b..3e63c55fcb7 100644 --- a/Compiler/BackEnd/SymbolicJacobian.mo +++ b/Compiler/BackEnd/SymbolicJacobian.mo @@ -1618,10 +1618,10 @@ algorithm inputvars2 = List.select(knvarlst,BackendVariable.isVarOnTopLevelAndInput); outputvars = List.select(varlst, BackendVariable.isVarOnTopLevelAndOutput); - statesarr = BackendVariable.listVar1(states); - inputvarsarr = BackendVariable.listVar1(inputvars); - paramvarsarr = BackendVariable.listVar1(paramvars); - outputvarsarr = BackendVariable.listVar1(outputvars); + _ = BackendVariable.listVar1(states); + _ = BackendVariable.listVar1(inputvars); + _ = BackendVariable.listVar1(paramvars); + _ = BackendVariable.listVar1(outputvars); // Generate sparse pattern for matrices A (sparsePattern, sparseColoring) = generateSparsePattern(backendDAE2, states, states); @@ -2617,7 +2617,7 @@ algorithm case (DAE.CALL(path=Absyn.IDENT("homotopy")), (expLst, _, insideCall)) then (inExp, false, (inExp::expLst, false, insideCall)); // For now exclude all not built in calls - case (DAE.CALL(expLst=expLst1,attr=DAE.CALL_ATTR(builtin=false)), (expLst, b, insideCall)) then (inExp, false, (inExp::expLst, false, insideCall)); + case (DAE.CALL(attr=DAE.CALL_ATTR(builtin=false)), (expLst, _, insideCall)) then (inExp, false, (inExp::expLst, false, insideCall)); /* case (_, (expLst, _, true)) guard(Expression.isRecord(inExp)) then (inExp, false, (inExp::expLst, false, true)); @@ -2745,7 +2745,7 @@ algorithm // prepare vars and equations for BackendDAE emptyVars = BackendVariable.emptyVars(); - emptyEqns = BackendEquation.listEquation({}); + _ = BackendEquation.listEquation({}); cache = FCore.emptyCache(); graph = FGraph.empty(); shared = BackendDAEUtil.createEmptyShared(BackendDAE.ALGEQSYSTEM(), einfo, cache, graph); diff --git a/Compiler/BackEnd/VisualXML.mo b/Compiler/BackEnd/VisualXML.mo index 5d7ad5d44b7..2e1d8c3c2a5 100644 --- a/Compiler/BackEnd/VisualXML.mo +++ b/Compiler/BackEnd/VisualXML.mo @@ -188,7 +188,7 @@ algorithm vis := SHAPE(crefIn,"",arrayCreate(3,{DAE.RCONST(-1),DAE.RCONST(-1),DAE.RCONST(-1)}), arrayCreate(3,DAE.RCONST(-1)), arrayCreate(3,DAE.RCONST(-1)), arrayCreate(3,DAE.RCONST(-1)),arrayCreate(3,DAE.RCONST(-1)), DAE.RCONST(-1),DAE.RCONST(-1),DAE.RCONST(-1),DAE.RCONST(-1), arrayCreate(3,DAE.RCONST(-1)), DAE.RCONST(-1)); - (allVars,vis) := List.fold1(allVarsIn,fillVisualizationObjects1,true,({},vis)); + (_,vis) := List.fold1(allVarsIn,fillVisualizationObjects1,true,({},vis)); then (vis,allVarsIn); else algorithm @@ -222,7 +222,7 @@ algorithm (crefOut,wasCut) := matchcontinue(crefIn,crefCut) local DAE.ComponentRef crefCut1, crefIn1; - case(DAE.CREF_QUAL(componentRef=crefIn1),DAE.CREF_QUAL(componentRef=crefCut1)) + case(DAE.CREF_QUAL(componentRef=crefIn1),DAE.CREF_QUAL(componentRef=_)) equation // the crefs are not equal, check the next cref in crefIn true = not ComponentReference.crefFirstCrefEqual(crefIn,crefCut); @@ -370,8 +370,8 @@ algorithm case(DAE.CREF_IDENT(ident="extra"),BackendDAE.VAR(bindExp=bind), _ , SHAPE(ident=ident, shapeType=shapeType, T=T, r=r, r_shape=r_shape, lengthDir=lengthDir, widthDir=widthDir, length=length, width=width, height=height, extra=extra, color=color, specularCoeff=specularCoeff)) algorithm if isSome(bind) then - exp := if not Expression.isConstValue(Util.getOption(bind)) and storeProtectedCrefs then BackendVariable.varExp(var) else Util.getOption(bind); - else exp := BackendVariable.varExp(var); + _ := if not Expression.isConstValue(Util.getOption(bind)) and storeProtectedCrefs then BackendVariable.varExp(var) else Util.getOption(bind); + else _ := BackendVariable.varExp(var); end if; then (SHAPE(ident, shapeType, T, r, r_shape, lengthDir, widthDir, length, width, height, extra, color, specularCoeff)); @@ -384,7 +384,7 @@ algorithm color := arrayUpdate(color,pos,exp); then (SHAPE(ident, shapeType, T, r, r_shape, lengthDir, widthDir, length, width, height, extra, color, specularCoeff)); - case(DAE.CREF_IDENT(ident="specularCoefficient"),BackendDAE.VAR(bindExp=bind), _ , SHAPE(ident=ident, shapeType=shapeType, T=T, r=r, r_shape=r_shape, lengthDir=lengthDir, widthDir=widthDir, length=length, width=width, height=height, extra=extra, color=color, specularCoeff=specularCoeff)) + case(DAE.CREF_IDENT(ident="specularCoefficient"),BackendDAE.VAR(bindExp=bind), _ , SHAPE(ident=ident, shapeType=shapeType, T=T, r=r, r_shape=r_shape, lengthDir=lengthDir, widthDir=widthDir, length=length, width=width, height=height, extra=extra, color=color)) algorithm if isSome(bind) then exp := if not Expression.isConstValue(Util.getOption(bind)) and storeProtectedCrefs then BackendVariable.varExp(var) else Util.getOption(bind); @@ -396,8 +396,8 @@ algorithm algorithm BackendDAE.VAR(bindExp=bind) := var; if isSome(bind) then - exp := if not Expression.isConstValue(Util.getOption(bind)) and storeProtectedCrefs then BackendVariable.varExp(var) else Util.getOption(bind); - else exp := DAE.SCONST("NO_BINDING"); + _ := if not Expression.isConstValue(Util.getOption(bind)) and storeProtectedCrefs then BackendVariable.varExp(var) else Util.getOption(bind); + else _ := DAE.SCONST("NO_BINDING"); end if; //print("whats this? :"+ComponentReference.printComponentRefStr(cref)+" with binding: "+ExpressionDump.printExpStr(exp)+"\n"); then visIn; @@ -444,10 +444,10 @@ algorithm String obj; list paths; list paths_lst; - case(BackendDAE.VAR(varName=varName, varType = varType, source=source), (varLst,crefs)) + case(BackendDAE.VAR(varName=varName, source=source), (varLst,crefs)) algorithm paths := ElementSource.getElementSourceTypes(source); - paths_lst := list(Absyn.pathString(p) for p in paths); + _ := list(Absyn.pathString(p) for p in paths); //print("paths_lst "+stringDelimitList(paths_lst, "; ")+"\n"); (obj,idx) := hasVisPath(paths,1); true := Util.stringNotEqual(obj,""); diff --git a/Compiler/FrontEnd/Algorithm.mo b/Compiler/FrontEnd/Algorithm.mo index 7c1d076cded..ab65cfcdd8c 100644 --- a/Compiler/FrontEnd/Algorithm.mo +++ b/Compiler/FrontEnd/Algorithm.mo @@ -288,7 +288,7 @@ algorithm guard Expression.expEqual(lhs, e1) algorithm print(stringDelimitList(list(SCodeDump.printCommentAndAnnotationStr(comment) for comment in ElementSource.getCommentsFromSource(source)), "\n")); - if not max(SCode.commentHasBooleanNamedAnnotation(comment, "__OpenModelica_DisableListAppendWarning") for comment in ElementSource.getCommentsFromSource(source)) then + if Flags.isSet(Flags.LIST_REVERSE_WRONG_ORDER) and not max(SCode.commentHasBooleanNamedAnnotation(comment, "__OpenModelica_DisableListAppendWarning") for comment in ElementSource.getCommentsFromSource(source)) then Error.addSourceMessage(Error.LIST_REVERSE_WRONG_ORDER, {ExpressionDump.printExpStr(e1)}, ElementSource.getElementSourceFileInfo(source)); fail(); end if; diff --git a/Compiler/Lexers/LexerModelicaDiff.mo b/Compiler/Lexers/LexerModelicaDiff.mo index 6a0befc10cf..c2ec6fd961b 100644 --- a/Compiler/Lexers/LexerModelicaDiff.mo +++ b/Compiler/Lexers/LexerModelicaDiff.mo @@ -1541,7 +1541,7 @@ algorithm case (e as (_,TOKEN(id=TokenId.NEWLINE)))::(Diff.Add,TOKEN(id=TokenId.NEWLINE))::rest then (false,e::rest,tmp); case (e as (_,TOKEN(id=TokenId.NEWLINE)))::rest then (true,rest,e::tmp); - case (Diff.Add,TOKEN(id=TokenId.WHITESPACE))::(e as (Diff.Add,t))::rest guard lastIsNewline + case (Diff.Add,TOKEN(id=TokenId.WHITESPACE))::(e as (Diff.Add,_))::rest guard lastIsNewline then (false,rest,e:: (Diff.Add,TOKEN("WHITESPACE",TokenId.WHITESPACE,sum(" " for i in 1:depth),1,depth,0,0,0,0)) ::tmp); diff --git a/Compiler/Main/Main.mo b/Compiler/Main/Main.mo index 330df15185d..33d98bc7188 100644 --- a/Compiler/Main/Main.mo +++ b/Compiler/Main/Main.mo @@ -728,7 +728,7 @@ public function setWindowsPaths changes you will need to change here!" input String inOMHome; algorithm - _ := matchcontinue(inOMHome) + _ := match(inOMHome) local String oldPath, newPath, omHome, omdevPath, mingwDir, binDir, libBinDir, msysBinDir; Boolean hasBinDir, hasLibBinDir; @@ -765,7 +765,7 @@ algorithm end if; end if; then (); - end matchcontinue; + end match; end setWindowsPaths; protected function setDefaultCC "Reads the environment variable CC to change the default CC" diff --git a/Compiler/Script/Binding.mo b/Compiler/Script/Binding.mo index 737244c3484..58c9ab18fee 100644 --- a/Compiler/Script/Binding.mo +++ b/Compiler/Script/Binding.mo @@ -139,9 +139,9 @@ algorithm list cls; list prvs; list pref; - case SCode.CLASS(n, _, _, _, SCode.R_PACKAGE(), SCode.PARTS(elist, _,_,_,_,_,_,_), _, _) + case SCode.CLASS(_, _, _, _, SCode.R_PACKAGE(), SCode.PARTS(elist, _,_,_,_,_,_,_), _, _) then getAllElementsOfType(elist, typeName, {}); - case SCode.CLASS(n, _, _, _, _, SCode.PARTS(elist, _,_,_,_,_,_,_), _, _) + case SCode.CLASS(_, _, _, _, _, SCode.PARTS(elist, _,_,_,_,_,_,_), _, _) equation (true) = isOfType(elist, typeName); @@ -167,11 +167,11 @@ output Boolean result; SCode.Mod mod; String name; case {} then (false); - case SCode.EXTENDS(Absyn.IDENT(name), _, mod, _, _)::rest + case SCode.EXTENDS(Absyn.IDENT(name), _, _, _, _)::_ equation true = (name == typeName); then (true); - case el::rest + case _::rest then isOfType(rest, typeName); end matchcontinue; end isOfType; @@ -182,7 +182,7 @@ input Absyn.Class vmodel; input Absyn.Program env; output Absyn.Class out_vmodel; algorithm - out_vmodel := matchcontinue(client_list) + out_vmodel := match(client_list) local Client_e ce; list rest; @@ -192,7 +192,7 @@ output Absyn.Class out_vmodel; equation upd_vmodel = inferBindingClient(ce, vmodel, env); then inferBindingClientList(rest, upd_vmodel, env); - end matchcontinue; + end match; end inferBindingClientList; protected function inferBindingClient @@ -216,8 +216,8 @@ output Absyn.Class out_vmodel; list> out_es; Absyn.Exp exp, new_exp; Absyn.Class out_class; - case CLIENT_E(components, typeSpec, def, iname, predecessors, - MEDIATOR(mType, template, clients, providers, {})::_) /* no preferred bindings indicated */ + case CLIENT_E(_, typeSpec, _, iname, _, + MEDIATOR(_, template, _, providers, {})::_) /* no preferred bindings indicated */ equation out_es = getProviders(providers, vmodel, env, {}); if (template == "") then @@ -230,8 +230,8 @@ output Absyn.Class out_vmodel; end if; then out_class; - case CLIENT_E(components, typeSpec, def, iname, predecessors, - MEDIATOR(mType, template, clients, providers, preferred)::_) /* preferred bindings indicated */ + case CLIENT_E(_, typeSpec, _, iname, _, + MEDIATOR(_, _, _, providers, preferred)::_) /* preferred bindings indicated */ equation out_es = getProviders(providers, vmodel, env, {}); out_class = updateClass(vmodel, typeSpec, out_es, iname, env, true, preferred, ""); @@ -249,14 +249,14 @@ input list> e_list; input list in_es; output list out_es; algorithm - out_es := matchcontinue(e_list) + out_es := match(e_list) local list> rest; Absyn.Exp exp; case {} then in_es; case (exp, _)::rest then toExpList(rest, exp::in_es); - end matchcontinue; + end match; end toExpList; public function updateClass @@ -415,7 +415,7 @@ algorithm then in_elems; case (Absyn.ELEMENTITEM(Absyn.ELEMENT(finalPrefix,redeclareKeywords ,innerOuter, Absyn.COMPONENTS(attributes,tSpec, components), info , constrainClass))::rest) algorithm - path := Absyn.typeSpecPath(typeSpec); + _ := Absyn.typeSpecPath(typeSpec); // print ("*****************FINDING CLIENTS ... "); // print(Dump.unparseTypeSpec(typeSpec)); // print(" + "); @@ -491,7 +491,7 @@ output String cl_name; list rest; String c_id, p_id; case {} then fail(); - case PREFERRED(c_id, p_id)::rest + case PREFERRED(c_id, p_id)::_ equation true = (p_id == ename); then c_id; @@ -518,7 +518,7 @@ protected function applyModifierPreferred Absyn.ArrayDim arrayDim "Array dimensions, if any" ; Option modification "Optional modification" ; case {} then {}; - case Absyn.COMPONENTITEM(Absyn.COMPONENT(name, arrayDim, modification), condition, comment)::rest + case Absyn.COMPONENTITEM(Absyn.COMPONENT(name, arrayDim, _), condition, comment)::_ equation true = (typeSp == name); cnew = Absyn.COMPONENTITEM(Absyn.COMPONENT(name, arrayDim, @@ -557,7 +557,7 @@ protected function applyModifiers String ename; Absyn.ElementItem enew; case {} then {}; - case (e, ename)::rest + case (e, _)::rest equation cnew = applyModifier(comps, e, instance_name, counter); enew = Absyn.ELEMENTITEM(Absyn.ELEMENT(finalPrefix,redeclareKeywords ,innerOuter, Absyn.COMPONENTS(attributes,tSpec, cnew), info , constrainClass)); @@ -586,7 +586,7 @@ protected function applyModifier Absyn.ArrayDim arrayDim "Array dimensions, if any" ; Option modification "Optional modification" ; case {} then {}; - case Absyn.COMPONENTITEM(Absyn.COMPONENT(name, arrayDim, modification), condition, comment)::rest + case Absyn.COMPONENTITEM(Absyn.COMPONENT(name, arrayDim, _), condition, comment)::_ equation // print("-------------------- applying modifier\n"); new_name = name + "_autogen_bind_" + intString(counter); @@ -671,7 +671,7 @@ input Absyn.Program env; input list> in_es; output list> out_es; algorithm - out_es := matchcontinue(providers) + out_es := match(providers) local Provider pr; list rest; @@ -692,7 +692,7 @@ output list> out_es; exps = applyTemplate(exp, comps, {}); new_es = listAppend(exps, in_es); then getProviders(rest, vmodel, env, new_es); - end matchcontinue; + end match; end getProviders; protected function applyTemplate @@ -902,7 +902,7 @@ algorithm Absyn.ArrayDim arrayDim "Array dimensions, if any" ; Option modification "Optional modification" ; case {} then in_components; - case Absyn.COMPONENTITEM(Absyn.COMPONENT(name, arrayDim, modification), condition, comment)::rest + case Absyn.COMPONENTITEM(Absyn.COMPONENT(name, _, _), _, _)::rest equation newName = if(pathInClass == "") then name else pathInClass + "." + name; tmp = getAllProviderInstances(className, template, e_items, env, in_components, newName); @@ -1002,7 +1002,7 @@ algorithm list rest; list preferred; case {} then (false, "", in_m); - case MEDIATOR(mType, template, clients, providers, preferred)::rest + case MEDIATOR(mType, template, clients, providers, preferred)::_ equation //print("Testing mediator : " + mType + "\n"); (true, nm) = isClientInMediator(ci_name, clients); @@ -1030,7 +1030,7 @@ algorithm list rest; Boolean isM; case {} then (false, ""); - case CLIENT(name, inst, tmp, isM)::rest + case CLIENT(name, inst, _, _)::_ equation // print("Testing mediator for names: " + name + " " + ci_name + "\n"); true = (name == ci_name); @@ -1076,9 +1076,9 @@ algorithm list cls; list prvs; list pref; - case SCode.CLASS(n, _, _, _, SCode.R_PACKAGE(), SCode.PARTS(elist, _,_,_,_,_,_,_), _, _) + case SCode.CLASS(_, _, _, _, SCode.R_PACKAGE(), SCode.PARTS(elist, _,_,_,_,_,_,_), _, _) then getMediatorDefsElements(elist, {}); - case SCode.CLASS(n, _, _, _, SCode.R_RECORD(_), SCode.PARTS(elist, _,_,_,_,_,_,_), _, _) + case SCode.CLASS(_, _, _, _, SCode.R_RECORD(_), SCode.PARTS(elist, _,_,_,_,_,_,_), _, _) equation (true, SOME(mod)) = isMediator(elist); Absyn.STRING(template) = getValue(mod, "template", "string"); @@ -1110,7 +1110,7 @@ input list e; input list val; output list n_val; algorithm - n_val := matchcontinue(e) + n_val := match(e) local Absyn.FunctionArgs fArgs; list smod; @@ -1127,7 +1127,7 @@ output list n_val; providerInstancePath = getArg(argNames, "providerInstancePath"); print ("providerInstancePath " + providerInstancePath + "\n"); then getPreferredList(rest, PREFERRED(clientInstancePath, providerInstancePath)::val); - end matchcontinue; + end match; end getPreferredList; protected function getClientList @@ -1135,7 +1135,7 @@ input list e; input list val; output list n_val; algorithm - n_val := matchcontinue(e) + n_val := match(e) local Absyn.FunctionArgs fArgs; list smod; @@ -1158,7 +1158,7 @@ output list n_val; if(isM == "true") then isMandatory = true; else isMandatory = false; end if; then getClientList(rest, CLIENT(className, instance, template, isMandatory)::val); - end matchcontinue; + end match; end getClientList; protected function getProviderList @@ -1166,7 +1166,7 @@ input list e; input list val; output list n_val; algorithm - n_val := matchcontinue(e) + n_val := match(e) local Absyn.FunctionArgs fArgs; list smod; @@ -1185,7 +1185,7 @@ output list n_val; providerTemplate = getArg(argNames, "template"); print ("providerTemplate " + providerTemplate + "\n"); then getProviderList(rest, PROVIDER(className, instance, providerTemplate)::val); - end matchcontinue; + end match; end getProviderList; protected function getArg @@ -1199,7 +1199,7 @@ output String val; list rest; case {} then ""; - case Absyn.NAMEDARG(nname, Absyn.STRING(str))::rest + case Absyn.NAMEDARG(nname, Absyn.STRING(str))::_ equation // print("Comparing: " + name + " " +nname + "\n"); str1 = System.stringReplace(str, "%", ""); @@ -1226,9 +1226,9 @@ output Option mods; Absyn.Ident id; SCode.Mod mod; case {} then (false, NONE()); - case SCode.EXTENDS(Absyn.IDENT("Mediator"), _, mod, _, _)::rest + case SCode.EXTENDS(Absyn.IDENT("Mediator"), _, mod, _, _)::_ then (true, SOME(mod)); - case el::rest + case _::rest then isMediator(rest); end matchcontinue; end isMediator; @@ -1265,7 +1265,7 @@ output Absyn.Exp val; then Absyn.ARRAY({}); case ({}, "string") then Absyn.STRING(""); - case (SCode.NAMEMOD(n, SCode.MOD(_,_,_, SOME((eval)), _))::rest, _) + case (SCode.NAMEMOD(n, SCode.MOD(_,_,_, SOME((eval)), _))::_, _) equation if(n <> name) then fail(); end if; then eval; diff --git a/Compiler/Script/Figaro.mo b/Compiler/Script/Figaro.mo index ef6959034cc..b03a85535f8 100644 --- a/Compiler/Script/Figaro.mo +++ b/Compiler/Script/Figaro.mo @@ -187,16 +187,16 @@ algorithm case (fb, ft, program, _, SCode.CLASS(name = n, classDef = SCode.PARTS(elementLst = el)), e) equation then fcElementListExt(fb, ft, program, SOME(n), el, e); - case (fb, ft, program, SOME(cn), SCode.EXTENDS(baseClassPath = bcp, modifications = m), e) + case (fb, _, _, SOME(_), SCode.EXTENDS(baseClassPath = bcp), _) equation true = fb == getLastIdent(bcp); then true; - case (fb, ft, program, SOME(cn), SCode.EXTENDS(baseClassPath = bcp, modifications = m), e) + case (fb, ft, program, SOME(cn), SCode.EXTENDS(baseClassPath = bcp), e) equation cdef = SCodeUtil.getElementWithPathCheckBuiltin(e, bcp); then fcExtends(fb, ft, program, SOME(cn), cdef, e); // Nested class of some sort. - case (fb, ft, program, _, _, e) + case (_, _, _, _, _, _) then false; end matchcontinue; end fcExtends; @@ -222,7 +222,7 @@ algorithm list rf, rr; case (_, _, _, _, {}, _) then false; - case (fb, ft, program, cn, first :: rest, e) + case (fb, ft, program, cn, first :: _, e) equation true = fcExtends(fb, ft, program, cn, first, e); then true; @@ -683,7 +683,7 @@ protected function truncateExtension newName := match name local String c; List rest; - case "."::rest + case "."::_ then ""; case c::rest then stringAppend (c, truncateExtension(rest)); diff --git a/Compiler/SimCode/HpcOmSimCodeMain.mo b/Compiler/SimCode/HpcOmSimCodeMain.mo index ab8d2140ed9..84f537784f3 100644 --- a/Compiler/SimCode/HpcOmSimCodeMain.mo +++ b/Compiler/SimCode/HpcOmSimCodeMain.mo @@ -127,7 +127,7 @@ algorithm list> partitions, activatorsForPartitions; list stateToActivators; - case (BackendDAE.DAE(eqs=eqs), _, _, _, _,_, _, _, _, _, _, _, _) equation + case (BackendDAE.DAE(eqs=_), _, _, _, _,_, _, _, _, _, _, _, _) equation // DO MULTI-RATE-PARTITIONING true = Flags.isSet(Flags.MULTIRATE_PARTITION); print("DO MULTIRATE\n"); @@ -140,7 +140,7 @@ algorithm //get simCode-backendDAE mappings //---------------------------- - simVarMapping = SimCodeUtil.getSimVarMappingOfBackendMapping(simCode.backendMapping); + _ = SimCodeUtil.getSimVarMappingOfBackendMapping(simCode.backendMapping); (simeqCompMapping, sccSimEqMapping, daeSccSimEqMapping) = HpcOmTaskGraph.setUpHpcOmMapping(inBackendDAE, simCode, lastEqMappingIdx, equationSccMapping); ExecStat.execStat("hpcom setup"); @@ -318,7 +318,7 @@ algorithm numProc = Flags.getConfigInt(Flags.NUM_PROC); (numProc,_) = setNumProc(numProc,cpCostsWoC,taskGraphDataOde);//in case n-flag is not set - (scheduleDae,simCode,taskGraphDaeScheduled,taskGraphDataDaeScheduled,sccSimEqMapping) = createSchedule(taskGraphDaeSimplified,taskGraphDataDaeSimplified,daeSccSimEqMapping,simVarMapping,filenamePrefix,numProc,numProc,simCode,scheduledTasksDae,"DAE system",Flags.getConfigString(Flags.HPCOM_SCHEDULER)); + (scheduleDae,simCode,_,_,sccSimEqMapping) = createSchedule(taskGraphDaeSimplified,taskGraphDataDaeSimplified,daeSccSimEqMapping,simVarMapping,filenamePrefix,numProc,numProc,simCode,scheduledTasksDae,"DAE system",Flags.getConfigString(Flags.HPCOM_SCHEDULER)); //HpcOmScheduler.printSchedule(scheduleDae); //schedulerInfo = HpcOmScheduler.convertScheduleStrucToInfo(scheduleDae,arrayLength(taskGraphDaeScheduled)); //HpcOmTaskGraph.dumpAsGraphMLSccLevel(taskGraphDaeScheduled, taskGraphDataDaeScheduled, "taskGraph"+filenamePrefix+"DAE_scheduled.graphml", "", HpcOmTaskGraph.convertNodeListToEdgeTuples(listHead(criticalPaths)), HpcOmTaskGraph.convertNodeListToEdgeTuples(listHead(criticalPathsWoC)), sccSimEqMapping, schedulerInfo, HpcOmTaskGraph.GRAPHDUMPOPTIONS(false,false,false,false)); @@ -328,7 +328,7 @@ algorithm //schedulerInfo = HpcOmScheduler.convertScheduleStrucToInfo(scheduleOde,arrayLength(taskGraphOdeScheduled)); //HpcOmTaskGraph.dumpAsGraphMLSccLevel(taskGraphOdeScheduled, taskGraphDataOdeScheduled, "taskGraph"+filenamePrefix+"ODE_scheduled.graphml", "", HpcOmTaskGraph.convertNodeListToEdgeTuples(listHead(criticalPaths)), HpcOmTaskGraph.convertNodeListToEdgeTuples(listHead(criticalPathsWoC)), sccSimEqMapping, schedulerInfo, HpcOmTaskGraph.GRAPHDUMPOPTIONS(false,false,false,false)); - (scheduleZeroFunc,simCode,taskGraphZeroFuncScheduled,taskGraphDataZeroFuncScheduled,sccSimEqMapping) = createSchedule(taskGraphZeroFuncSimplified,taskGraphDataZeroFuncSimplified,daeSccSimEqMapping,simVarMapping,filenamePrefix,numProc,numProc,simCode,scheduledTasksZeroFunc,"ZeroFunc system",Flags.getConfigString(Flags.HPCOM_SCHEDULER)); + (scheduleZeroFunc,simCode,_,_,sccSimEqMapping) = createSchedule(taskGraphZeroFuncSimplified,taskGraphDataZeroFuncSimplified,daeSccSimEqMapping,simVarMapping,filenamePrefix,numProc,numProc,simCode,scheduledTasksZeroFunc,"ZeroFunc system",Flags.getConfigString(Flags.HPCOM_SCHEDULER)); //HpcOmScheduler.printSchedule(scheduleZeroFunc); //schedulerInfo = HpcOmScheduler.convertScheduleStrucToInfo(scheduleZeroFunc,arrayLength(taskGraphZeroFuncScheduled)); //HpcOmTaskGraph.dumpAsGraphMLSccLevel(taskGraphZeroFuncScheduled, taskGraphDataZeroFuncScheduled, "taskGraph"+filenamePrefix+"ZF_scheduled.graphml", "", HpcOmTaskGraph.convertNodeListToEdgeTuples(listHead(criticalPaths)), HpcOmTaskGraph.convertNodeListToEdgeTuples(listHead(criticalPathsWoC)), sccSimEqMapping, schedulerInfo, HpcOmTaskGraph.GRAPHDUMPOPTIONS(false,false,false,false)); diff --git a/Compiler/SimCode/SimCodeMain.mo b/Compiler/SimCode/SimCodeMain.mo index 2e7b2bc9475..c04bdab05ab 100644 --- a/Compiler/SimCode/SimCodeMain.mo +++ b/Compiler/SimCode/SimCodeMain.mo @@ -838,7 +838,6 @@ algorithm dlow = BackendDAECreate.lower(dae, cache, graph, BackendDAE.EXTRA_INFO(description,filenameprefix)); GC.free(dae); - graph = FCore.EG(""); if Flags.isSet(Flags.SERIALIZED_SIZE) then serializeNotify(dlow, filenameprefix, "dlow"); diff --git a/Compiler/Template/Tpl.mo b/Compiler/Template/Tpl.mo index 1fc6d8ee2cc..b37e02d8831 100644 --- a/Compiler/Template/Tpl.mo +++ b/Compiler/Template/Tpl.mo @@ -747,7 +747,7 @@ algorithm case (MEM_TEXT( tokens = {}, blocksStack = (itertoks, bt as BT_ITER( - options = iopts as ITER_OPTIONS( + options = ITER_OPTIONS( empty = SOME(emptok)), index0 = i0)) :: blstack )) diff --git a/Compiler/Util/AvlTree.mo b/Compiler/Util/AvlTree.mo index 9be4e0c84b8..ac25477ea1d 100644 --- a/Compiler/Util/AvlTree.mo +++ b/Compiler/Util/AvlTree.mo @@ -315,7 +315,7 @@ algorithm // replacements of nodes maybe allowed! // we have an update check function - case (_, NODE(i, h, l, r), 0, key, val) + case (_, NODE(i, _, _, _), 0, key, val) equation true = hasUpdateCheckFunction(inTree); updateCheckFunc = getUpdateCheckFunc(inTree); @@ -481,7 +481,7 @@ algorithm Item i; // replace this node. - case (_, NODE(item = ITEM(key = _), height = h, left = l, right = r), 0, key, val) + case (_, NODE(item = ITEM(), height = h, left = l, right = r), 0, key, val) then NODE(ITEM(key, val), h, l, r); @@ -510,7 +510,7 @@ protected function emptyNodeIfNoNode algorithm outNode := match(inNode) case (NO_NODE()) then NODE(NO_ITEM(), 0, NO_NODE(), NO_NODE()); - case (NODE(item = _)) then inNode; + case (NODE()) then inNode; end match; end emptyNodeIfNoNode; @@ -781,7 +781,7 @@ algorithm then res; - case (_, NODE(item = item as ITEM(key = _), left = l, right = r), _) + case (_, NODE(item = item as ITEM(), left = l, right = r), _) equation indent = inIndent + " "; s1 = prettyPrintNodeStr(inTree, l, indent); @@ -820,7 +820,7 @@ algorithm case (_, NO_NODE()) then ""; case (_, NODE(item = NO_ITEM())) then ""; - case (_, NODE(item = item as ITEM(_,_), left = left, right = right)) + case (_, NODE(item = item as ITEM(), left = left, right = right)) equation left_str = printNodeStr(inTree, left); right_str = printNodeStr(inTree, right); @@ -886,14 +886,14 @@ algorithm Val v; Key k; - case NODE(item = item as ITEM(k,v), left = left, right = right) + case NODE(item=ITEM(k,v)) equation true = valueEq(v, inVal); then k; // search left - case NODE(item = item as ITEM(k,v), left = left, right = right) + case NODE(item=ITEM(_,v), left = left) equation false = valueEq(v, inVal); k = getKeyOfValNode(inTree, left, inVal); @@ -901,7 +901,7 @@ algorithm k; // search right - case NODE(item = item as ITEM(k,v), left = left, right = right) + case NODE(item=ITEM(_,v), right = right) equation false = valueEq(v, inVal); k = getKeyOfValNode(inTree, right, inVal); @@ -1014,7 +1014,7 @@ protected function addNodeUnique_dispatch output Node outNode; output Item outItem; algorithm - (outNode, outItem) := matchcontinue(inTree, inNode, inKeyComp, inKey, inVal) + (outNode, outItem) := match(inTree, inNode, inKeyComp, inKey, inVal) local Key key; Val val; @@ -1025,7 +1025,7 @@ algorithm // replacements of nodes are not allowed in addUnique // we don't care about update check functions here - case (_, NODE(i, h, l, r), 0, key, val) + case (_, NODE(i, _, _, _), 0, _, _) then (inNode, i); // return the same node, no update for addUnique! @@ -1044,7 +1044,7 @@ algorithm (n, it) = addNodeUnique(inTree, n, key, val); then (NODE(i, h, n, r), it); - end matchcontinue; + end match; end addNodeUnique_dispatch; annotation(__OpenModelica_Interface="backend"); diff --git a/Compiler/Util/BaseHashTable.mo b/Compiler/Util/BaseHashTable.mo index a0a5cfeda90..881d3e66ea0 100644 --- a/Compiler/Util/BaseHashTable.mo +++ b/Compiler/Util/BaseHashTable.mo @@ -210,7 +210,7 @@ algorithm (varr,newpos) = valueArrayAdd(varr, v); indexes = hashvec[indx]; hashvec = arrayUpdate(hashvec, indx, ((key, newpos) :: indexes)); - n = valueArrayLength(varr); + _ = valueArrayLength(varr); then ((hashvec, varr, bsize, fntpl)); @@ -250,7 +250,7 @@ algorithm (varr,newpos) = valueArrayAdd(varr, v); indexes = hashvec[indx]; hashvec = arrayUpdate(hashvec, indx, ((key, newpos) :: indexes)); - n = valueArrayLength(varr); + _ = valueArrayLength(varr); then ((hashvec, varr, bsize, fntpl)); @@ -541,7 +541,7 @@ algorithm then ((n, size, arr)); - case ((n, size, arr), _, _) + case ((_, size, _), _, _) equation Error.addInternalError("HashTable.valueArraySet(pos="+String(pos)+") size="+String(size)+" failed\n", sourceInfo()); then diff --git a/Compiler/Util/Flags.mo b/Compiler/Util/Flags.mo index 269778617cd..f8dc2a0583f 100644 --- a/Compiler/Util/Flags.mo +++ b/Compiler/Util/Flags.mo @@ -505,6 +505,8 @@ constant DebugFlag DUMPBACKENDINLINE_VERBOSE = DEBUG_FLAG(165, "dumpBackendInlin Util.gettext("Dumps debug output while inline function.")); constant DebugFlag BLT_MATRIX_DUMP = DEBUG_FLAG(166, "bltmatrixdump", false, Util.gettext("Dumps the blt matrix in html file. IE seems to be very good in displaying large matrices.")); +constant DebugFlag LIST_REVERSE_WRONG_ORDER = DEBUG_FLAG(167, "listAppendWrongOrder", true, + Util.gettext("Print notifications about bad usage of listAppend.")); // This is a list of all debug flags, to keep track of which flags are used. A // flag can not be used unless it's in this list, and the list is checked at @@ -677,7 +679,8 @@ constant list allDebugFlags = { BACKEND_KEEP_ENV_GRAPH, DUMPBACKENDINLINE, DUMPBACKENDINLINE_VERBOSE, - BLT_MATRIX_DUMP + BLT_MATRIX_DUMP, + LIST_REVERSE_WRONG_ORDER }; public diff --git a/Compiler/Util/VarTransform.mo b/Compiler/Util/VarTransform.mo index 95fb2ad5604..d09d12a1a99 100644 --- a/Compiler/Util/VarTransform.mo +++ b/Compiler/Util/VarTransform.mo @@ -854,7 +854,7 @@ algorithm // then // fail(); - case ((REPLACEMENTS(_,_)),src,dst) + case ((REPLACEMENTS()),src,dst) equation (REPLACEMENTS(ht,invHt),src_1,dst_1) = makeTransitive(repl, src, dst); /*s1 = ComponentReference.printComponentRefStr(src); diff --git a/Compiler/boot/refactor-fix-notifications.py b/Compiler/boot/refactor-fix-notifications.py index b0a5c420fb4..ffa58dde174 100755 --- a/Compiler/boot/refactor-fix-notifications.py +++ b/Compiler/boot/refactor-fix-notifications.py @@ -53,7 +53,7 @@ def disable(self): def runOMC(arg): try: - res = subprocess.check_output(['../../build/bin/omc','+d=patternmAllInfo',arg],stderr=subprocess.STDOUT) + res = subprocess.check_output(['../../../build/bin/omc','-d=patternmAllInfo,-listAppendWrongOrder',arg],stderr=subprocess.STDOUT) except subprocess.CalledProcessError as e: print e.output,e raise @@ -100,6 +100,11 @@ def fixFileIter(stamp,moFile,logFile): except: return # It's ok; there were no messages allLines = log.readlines() + for l in allLines: + try: + NOTIFICATION.parseString(l.strip()) + except: + print("Notification failed for",l) lst = [NOTIFICATION.parseString(line.strip()) for line in allLines] len1 = len(lst) lst = [n for n in lst if n[0]['fileName'] == moFile] @@ -284,4 +289,8 @@ def runStamp(arg): fixFile(arg,logFile,moFile) for arg in args: - runStamp(arg) + try: + runStamp(arg) + except: + print("Failed for",arg) + raise