From 409e11db295ae2ba6b461b9a94866d3f3f7b5dd8 Mon Sep 17 00:00:00 2001 From: Lennart Ochel Date: Thu, 9 Apr 2015 11:32:03 +0000 Subject: [PATCH] - Preparation for new "remove simple equations" module: This introduces a new variable attribute named "unreplaceable". This is needed to prevent unintended replacements for generated variables (e.g. symbolic jacobian, encapsulated when conditions, substituted common sub-expressions, ...) git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@25467 f25d12d1-65f4-0310-ae8a-bbce733d8d8e --- Compiler/BackEnd/BackendDAE.mo | 5 +- Compiler/BackEnd/BackendDAECreate.mo | 6 +-- Compiler/BackEnd/BackendDAETransform.mo | 2 +- Compiler/BackEnd/BackendDAEUtil.mo | 54 +++++++++---------- Compiler/BackEnd/BackendEquation.mo | 12 ++--- Compiler/BackEnd/BackendInline.mo | 21 ++++---- Compiler/BackEnd/BackendVariable.mo | 66 ++++++++++++------------ Compiler/BackEnd/Differentiate.mo | 2 +- Compiler/BackEnd/DynamicOptimization.mo | 2 +- Compiler/BackEnd/FindZeroCrossings.mo | 6 +-- Compiler/BackEnd/HpcOmEqSystems.mo | 12 ++--- Compiler/BackEnd/IndexReduction.mo | 20 +++---- Compiler/BackEnd/Initialization.mo | 6 +-- Compiler/BackEnd/OnRelaxation.mo | 2 +- Compiler/BackEnd/StateMachineFeatures.mo | 2 +- Compiler/BackEnd/SymbolicJacobian.mo | 12 ++--- Compiler/BackEnd/Uncertainties.mo | 8 +-- 17 files changed, 116 insertions(+), 122 deletions(-) diff --git a/Compiler/BackEnd/BackendDAE.mo b/Compiler/BackEnd/BackendDAE.mo index 1bb93fb82c8..23a3d494a33 100644 --- a/Compiler/BackEnd/BackendDAE.mo +++ b/Compiler/BackEnd/BackendDAE.mo @@ -190,7 +190,7 @@ public uniontype Var "variables" record VAR .DAE.ComponentRef varName "variable name"; - VarKind varKind "Kind of variable"; + VarKind varKind "kind of variable"; .DAE.VarDirection varDirection "input, output or bidirectional"; .DAE.VarParallelism varParallelism "parallelism of the variable. parglobal, parlocal or non-parallel"; Type varType "built-in type or enumeration"; @@ -202,7 +202,8 @@ uniontype Var "variables" Option tearingSelectOption "value for TearingSelect"; Option comment "this contains the comment and annotation from Absyn"; .DAE.ConnectorType connectorType "flow, stream, unspecified or not connector."; - .DAE.VarInnerOuter innerOuter "inner, outer, inner outer or unspecified"; + .DAE.VarInnerOuter innerOuter "inner, outer, inner outer or unspecified"; + Boolean unreplaceable "indicates if it is allowed to replace this variable"; end VAR; end Var; diff --git a/Compiler/BackEnd/BackendDAECreate.mo b/Compiler/BackEnd/BackendDAECreate.mo index 74f5c9e3c51..13caf950be1 100644 --- a/Compiler/BackEnd/BackendDAECreate.mo +++ b/Compiler/BackEnd/BackendDAECreate.mo @@ -610,7 +610,7 @@ algorithm (dae_var_attr, source, _) = Inline.inlineStartAttribute(dae_var_attr, source, (SOME(functionTree), {DAE.NORM_INLINE()})); ts = BackendDAEUtil.setTearingSelectAttribute(comment); then - (BackendDAE.VAR(name, kind_1, dir, prl, tp, NONE(), NONE(), dims, source, dae_var_attr, ts, comment, ct, DAEUtil.toDAEInnerOuter(io))); + (BackendDAE.VAR(name, kind_1, dir, prl, tp, NONE(), NONE(), dims, source, dae_var_attr, ts, comment, ct, DAEUtil.toDAEInnerOuter(io), false)); end match; end lowerDynamicVar; @@ -676,7 +676,7 @@ algorithm (dae_var_attr, source, _) = Inline.inlineStartAttribute(dae_var_attr, source, fnstpl); ts = NONE(); then - (BackendDAE.VAR(name, kind_1, dir, prl, tp, bind1, NONE(), dims, source, dae_var_attr, ts, comment, ct, DAEUtil.toDAEInnerOuter(io)), inlineHT,eqLst); + (BackendDAE.VAR(name, kind_1, dir, prl, tp, bind1, NONE(), dims, source, dae_var_attr, ts, comment, ct, DAEUtil.toDAEInnerOuter(io), false), inlineHT, eqLst); else equation @@ -995,7 +995,7 @@ algorithm (dae_var_attr, source, _) = Inline.inlineStartAttribute(dae_var_attr, source, (SOME(functionTree), {DAE.NORM_INLINE()})); ts = NONE(); then - BackendDAE.VAR(name, kind_1, dir, prl, tp, bind, NONE(), dims, source, dae_var_attr, ts, comment, ct, DAEUtil.toDAEInnerOuter(io)); + BackendDAE.VAR(name, kind_1, dir, prl, tp, bind, NONE(), dims, source, dae_var_attr, ts, comment, ct, DAEUtil.toDAEInnerOuter(io), false); end match; end lowerExtObjVar; diff --git a/Compiler/BackEnd/BackendDAETransform.mo b/Compiler/BackEnd/BackendDAETransform.mo index 643c4cc0409..8d65fef7a4f 100644 --- a/Compiler/BackEnd/BackendDAETransform.mo +++ b/Compiler/BackEnd/BackendDAETransform.mo @@ -575,7 +575,7 @@ algorithm equation cr = ComponentReference.crefPrefixDer(cr); then - BackendDAE.VAR(cr,BackendDAE.STATE_DER(),dir,prl,tp,exp,v,dim,source,attr,ts,comment,ct, io); + BackendDAE.VAR(cr, BackendDAE.STATE_DER(), dir, prl, tp, exp, v, dim, source, attr, ts, comment, ct, io, false); else inVar; end match; diff --git a/Compiler/BackEnd/BackendDAEUtil.mo b/Compiler/BackEnd/BackendDAEUtil.mo index e3039b9064f..db4e6b3f72c 100644 --- a/Compiler/BackEnd/BackendDAEUtil.mo +++ b/Compiler/BackEnd/BackendDAEUtil.mo @@ -389,8 +389,7 @@ protected algorithm name := Expression.reductionIterName(iter); cr := ComponentReference.makeCrefIdent(name,DAE.T_INTEGER_DEFAULT,{}); - backendVar := BackendDAE.VAR(cr,BackendDAE.VARIABLE(),DAE.BIDIR(),DAE.NON_PARALLEL(),DAE.T_INTEGER_DEFAULT,NONE(),NONE(),{}, - DAE.emptyElementSource,NONE(),NONE(),NONE(),DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER()); + backendVar := BackendDAE.VAR(cr, BackendDAE.VARIABLE(), DAE.BIDIR(), DAE.NON_PARALLEL(), DAE.T_INTEGER_DEFAULT, NONE(), NONE(), {}, DAE.emptyElementSource, NONE(), NONE(), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER(), false); end makeIterVariable; protected function checkEquationSize"author: Frenkel TUD 2010-12 @@ -907,7 +906,7 @@ algorithm true = Expression.isConst(e); (_, v, _) = Ceval.ceval(cache, graph, e, false, NONE(), Absyn.NO_MSG(),0); then - BackendDAE.VAR(cr, vk, vd, prl, ty, SOME(e), SOME(v), dims, src, va, ts, c, ct, io); + BackendDAE.VAR(cr, vk, vd, prl, ty, SOME(e), SOME(v), dims, src, va, ts, c, ct, io, false); else inVar; end matchcontinue; end calculateValue; @@ -6059,6 +6058,7 @@ algorithm list whenClauseLst; Type_a ext_arg_1,ext_arg_2,ext_arg_4,ext_arg_5,ext_arg_6; list systs; + case (BackendDAE.DAE(eqs=systs,shared=BackendDAE.SHARED(knownVars = vars2,initialEqs = ieqns,removedEqs = reqns, eventInfo = BackendDAE.EVENT_INFO(whenClauseLst=whenClauseLst))),_,_) equation ext_arg_1 = List.fold1(systs,traverseBackendDAEExpsEqSystem,func,inTypeA); @@ -6068,11 +6068,10 @@ algorithm (_,ext_arg_6) = BackendDAETransform.traverseBackendDAEExpsWhenClauseLst(whenClauseLst,func,ext_arg_5); then ext_arg_6; - else - equation - Error.addMessage(Error.INTERNAL_ERROR,{"BackendDAEUtil.traverseBackendDAEExps failed"}); - then - fail(); + + else equation + Error.addMessage(Error.INTERNAL_ERROR,{"BackendDAEUtil.traverseBackendDAEExps failed"}); + then fail(); end matchcontinue; end traverseBackendDAEExps; @@ -6501,15 +6500,14 @@ protected function traverseBackendDAEExpsVarWithUpdate "author: Frenkel TUD output Type_a outA; end FuncExpType; algorithm - (ovar,outTypeA) := - matchcontinue (inVar,func,inTypeA) + (ovar, outTypeA) := matchcontinue(inVar) local DAE.Exp e1; DAE.ComponentRef cref; list instdims; Option attr; - Option ts; - Type_a ext_arg_1,ext_arg_2; + Option ts; + Type_a ext_arg_1, ext_arg_2; VarKind varKind; DAE.VarDirection varDirection; DAE.VarParallelism varParallelism; @@ -6519,28 +6517,24 @@ algorithm Option comment; DAE.ConnectorType ct; DAE.VarInnerOuter io; + Boolean unreplaceable; - case (NONE(),_,_) then (NONE(),inTypeA); + case NONE() + then (NONE(), inTypeA); - case (SOME(BackendDAE.VAR(cref,varKind,varDirection,varParallelism,varType,SOME(e1),bindValue,instdims,source,attr,ts,comment,ct,io)),_,_) - equation - (e1,ext_arg_1) = func(e1,inTypeA); - (attr,ext_arg_2) = traverseBackendDAEVarAttr(attr,func,ext_arg_1); - then - (SOME(BackendDAE.VAR(cref,varKind,varDirection,varParallelism,varType,SOME(e1),bindValue,instdims,source,attr,ts,comment,ct,io)),ext_arg_2); + case SOME(BackendDAE.VAR(cref, varKind, varDirection, varParallelism, varType, SOME(e1), bindValue, instdims, source, attr, ts, comment, ct, io, unreplaceable)) equation + (e1, ext_arg_1) = func(e1, inTypeA); + (attr, ext_arg_2) = traverseBackendDAEVarAttr(attr, func, ext_arg_1); + then (SOME(BackendDAE.VAR(cref, varKind, varDirection, varParallelism, varType, SOME(e1), bindValue, instdims, source, attr, ts, comment, ct, io, unreplaceable)), ext_arg_2); - case (SOME(BackendDAE.VAR(cref,varKind,varDirection,varParallelism,varType,NONE(),bindValue,instdims,source,attr,ts,comment,ct,io)),_,_) - equation - (attr,ext_arg_2) = traverseBackendDAEVarAttr(attr,func,inTypeA); - then - (SOME(BackendDAE.VAR(cref,varKind,varDirection,varParallelism,varType,NONE(),bindValue,instdims,source,attr,ts,comment,ct,io)),ext_arg_2); + case SOME(BackendDAE.VAR(cref, varKind, varDirection, varParallelism, varType, NONE(), bindValue, instdims, source, attr, ts, comment, ct, io, unreplaceable)) equation + (attr, ext_arg_2) = traverseBackendDAEVarAttr(attr, func, inTypeA); + then (SOME(BackendDAE.VAR(cref, varKind, varDirection, varParallelism, varType, NONE(), bindValue, instdims, source, attr, ts, comment, ct, io, unreplaceable)), ext_arg_2); - else - equation - true = Flags.isSet(Flags.FAILTRACE); - Debug.trace("- BackendDAE.traverseBackendDAEExpsVar failed\n"); - then - fail(); + else equation + true = Flags.isSet(Flags.FAILTRACE); + Debug.trace("- BackendDAE.traverseBackendDAEExpsVar failed\n"); + then fail(); end matchcontinue; end traverseBackendDAEExpsVarWithUpdate; diff --git a/Compiler/BackEnd/BackendEquation.mo b/Compiler/BackEnd/BackendEquation.mo index d2fc83c7928..780204a532a 100644 --- a/Compiler/BackEnd/BackendEquation.mo +++ b/Compiler/BackEnd/BackendEquation.mo @@ -2229,7 +2229,7 @@ algorithm case (_, DAE.RELATION(e1, DAE.LESS(_), e2, _, _)) equation lhs = ComponentReference.makeCrefIdent(conCrefName, DAE.T_REAL_DEFAULT, {}); - dummyVar = BackendDAE.VAR(lhs, conKind, DAE.OUTPUT(), DAE.NON_PARALLEL(), DAE.T_REAL_DEFAULT, NONE(), NONE(), {}, DAE.emptyElementSource, NONE(), NONE(), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER()); + dummyVar = BackendDAE.VAR(lhs, conKind, DAE.OUTPUT(), DAE.NON_PARALLEL(), DAE.T_REAL_DEFAULT, NONE(), NONE(), {}, DAE.emptyElementSource, NONE(), NONE(), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER(), false); rhs = Expression.expSub(e1,e2); (rhs, _) = ExpressionSimplify.simplify1(rhs); expNull = DAE.RCONST(0.0); @@ -2239,7 +2239,7 @@ algorithm case (_, DAE.RELATION(e1, DAE.LESSEQ(_), e2, _, _)) equation lhs = ComponentReference.makeCrefIdent(conCrefName, DAE.T_REAL_DEFAULT, {}); - dummyVar = BackendDAE.VAR(lhs, conKind, DAE.OUTPUT(), DAE.NON_PARALLEL(), DAE.T_REAL_DEFAULT, NONE(), NONE(), {}, DAE.emptyElementSource, NONE(), NONE(), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER()); + dummyVar = BackendDAE.VAR(lhs, conKind, DAE.OUTPUT(), DAE.NON_PARALLEL(), DAE.T_REAL_DEFAULT, NONE(), NONE(), {}, DAE.emptyElementSource, NONE(), NONE(), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER(), false); rhs = Expression.expSub(e1,e2); (rhs, _) = ExpressionSimplify.simplify1(rhs); expNull = DAE.RCONST(0.0); @@ -2249,7 +2249,7 @@ algorithm case (_, DAE.RELATION(e1, DAE.GREATER(_), e2, _, _)) equation lhs = ComponentReference.makeCrefIdent(conCrefName, DAE.T_REAL_DEFAULT, {}); - dummyVar = BackendDAE.VAR(lhs, conKind, DAE.OUTPUT(), DAE.NON_PARALLEL(), DAE.T_REAL_DEFAULT, NONE(), NONE(), {}, DAE.emptyElementSource, NONE(), NONE(), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER()); + dummyVar = BackendDAE.VAR(lhs, conKind, DAE.OUTPUT(), DAE.NON_PARALLEL(), DAE.T_REAL_DEFAULT, NONE(), NONE(), {}, DAE.emptyElementSource, NONE(), NONE(), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER(), false); rhs = Expression.expSub(e2,e1); (rhs, _) = ExpressionSimplify.simplify1(rhs); expNull = DAE.RCONST(0.0); @@ -2259,7 +2259,7 @@ algorithm case (_, DAE.RELATION(e1, DAE.GREATEREQ(_), e2, _, _)) equation lhs = ComponentReference.makeCrefIdent(conCrefName, DAE.T_REAL_DEFAULT, {}); - dummyVar = BackendDAE.VAR(lhs, conKind, DAE.OUTPUT(), DAE.NON_PARALLEL(), DAE.T_REAL_DEFAULT, NONE(), NONE(), {}, DAE.emptyElementSource, NONE(), NONE(), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER()); + dummyVar = BackendDAE.VAR(lhs, conKind, DAE.OUTPUT(), DAE.NON_PARALLEL(), DAE.T_REAL_DEFAULT, NONE(), NONE(), {}, DAE.emptyElementSource, NONE(), NONE(), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER(), false); rhs = Expression.expSub(e2,e1); (rhs, _) = ExpressionSimplify.simplify(rhs); expNull = DAE.RCONST(0.0); @@ -2269,7 +2269,7 @@ algorithm case (_, DAE.RELATION(e1, DAE.EQUAL(_), e2, _, _)) equation lhs = ComponentReference.makeCrefIdent(conCrefName, DAE.T_REAL_DEFAULT, {}); - dummyVar = BackendDAE.VAR(lhs, conKind, DAE.OUTPUT(), DAE.NON_PARALLEL(), DAE.T_REAL_DEFAULT, NONE(), NONE(), {}, DAE.emptyElementSource, NONE(), NONE(), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER()); + dummyVar = BackendDAE.VAR(lhs, conKind, DAE.OUTPUT(), DAE.NON_PARALLEL(), DAE.T_REAL_DEFAULT, NONE(), NONE(), {}, DAE.emptyElementSource, NONE(), NONE(), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER(), false); rhs = Expression.expSub(e2,e1); (rhs, _) = ExpressionSimplify.simplify(rhs); expNull = DAE.RCONST(0.0); @@ -2284,7 +2284,7 @@ algorithm end try; lhs := ComponentReference.makeCrefIdent(conCrefName, DAE.T_REAL_DEFAULT, {}); - dummyVar := BackendDAE.VAR(lhs, conKind, DAE.OUTPUT(), DAE.NON_PARALLEL(), DAE.T_REAL_DEFAULT, NONE(), NONE(), {}, DAE.emptyElementSource, NONE(), NONE(), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER()); + dummyVar := BackendDAE.VAR(lhs, conKind, DAE.OUTPUT(), DAE.NON_PARALLEL(), DAE.T_REAL_DEFAULT, NONE(), NONE(), {}, DAE.emptyElementSource, NONE(), NONE(), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER(), false); dummyVar := BackendVariable.mergeAliasVars(dummyVar, v, false, knvars); eqn := BackendDAE.SOLVED_EQUATION(lhs, e1, Source, BackendDAE.EQ_ATTR_DEFAULT_UNKNOWN); diff --git a/Compiler/BackEnd/BackendInline.mo b/Compiler/BackEnd/BackendInline.mo index c2a9c35d127..4d437ec155e 100644 --- a/Compiler/BackEnd/BackendInline.mo +++ b/Compiler/BackEnd/BackendInline.mo @@ -492,9 +492,8 @@ protected function inlineVar output BackendDAE.Var outVar; output Boolean inlined; algorithm - (outVar,inlined) := match(inVar,inElementList) + (outVar, inlined) := match(inVar) local - Inline.Functiontuple fns; DAE.ComponentRef varName; BackendDAE.VarKind varKind; DAE.VarDirection varDirection; @@ -503,21 +502,21 @@ algorithm Option bindValue; DAE.InstDims arrayDim; Option values,values1; - Option ts; + Option ts; Option comment; DAE.ConnectorType ct; - BackendDAE.Var var; DAE.ElementSource source; Option bind; Boolean b1,b2; DAE.VarInnerOuter io; - case(BackendDAE.VAR(varName,varKind,varDirection,varParallelism,varType,bind,bindValue,arrayDim,source,values,ts,comment,ct,io),fns) - equation - (bind,source,b1) = Inline.inlineExpOpt(bind,fns,source); - (values1,source,b2) = Inline.inlineStartAttribute(values,source,fns); - then - (BackendDAE.VAR(varName,varKind,varDirection,varParallelism,varType,bind,bindValue,arrayDim,source,values1,ts,comment,ct,io),b1 or b2); - case(var,_) then (var,false); + Boolean unreplaceable; + + case BackendDAE.VAR(varName,varKind,varDirection,varParallelism,varType,bind,bindValue,arrayDim,source,values,ts,comment,ct,io,unreplaceable) equation + (bind,source,b1) = Inline.inlineExpOpt(bind,inElementList,source); + (values1,source,b2) = Inline.inlineStartAttribute(values,source,inElementList); + then (BackendDAE.VAR(varName,varKind,varDirection,varParallelism,varType,bind,bindValue,arrayDim,source,values1,ts,comment,ct,io,unreplaceable), b1 or b2); + + else (inVar, false); end match; end inlineVar; diff --git a/Compiler/BackEnd/BackendVariable.mo b/Compiler/BackEnd/BackendVariable.mo index 5ad9a2dd7d4..0313b0db6b4 100644 --- a/Compiler/BackEnd/BackendVariable.mo +++ b/Compiler/BackEnd/BackendVariable.mo @@ -115,10 +115,10 @@ protected DAE.ConnectorType ct; DAE.VarInnerOuter io; algorithm - BackendDAE.VAR(a, b, c, prl, d, e, f, g, source, oattr, ts, s, ct,io) := inVar; + BackendDAE.VAR(a, b, c, prl, d, e, f, g, source, oattr, ts, s, ct, io, _) := inVar; oattr := if isSome(oattr) then oattr else SOME(getVariableAttributefromType(d)); oattr := DAEUtil.setFixedAttr(oattr, SOME(DAE.BCONST(inBoolean))); - outVar := BackendDAE.VAR(a, b, c, prl, d, e, f, g, source, oattr, ts, s, ct,io); + outVar := BackendDAE.VAR(a, b, c, prl, d, e, f, g, source, oattr, ts, s, ct, io, false); end setVarFixed; public function varFixed "author: PA @@ -168,10 +168,10 @@ protected DAE.ConnectorType ct; DAE.VarInnerOuter io; algorithm - BackendDAE.VAR(a, b, c, prl, d, e, f, g, source, oattr, ts, s, ct,io) := inVar; + BackendDAE.VAR(a, b, c, prl, d, e, f, g, source, oattr, ts, s, ct,io, _) := inVar; oattr := if isSome(oattr) then oattr else SOME(getVariableAttributefromType(d)); oattr := DAEUtil.setStartAttr(oattr, inExp); - outVar := BackendDAE.VAR(a, b, c, prl, d, e, f, g, source, oattr, ts, s, ct,io); + outVar := BackendDAE.VAR(a, b, c, prl, d, e, f, g, source, oattr, ts, s, ct,io, false); end setVarStartValue; public function setVarStartValueOption "author: Frenkel TUD @@ -196,10 +196,10 @@ protected DAE.ConnectorType ct; DAE.VarInnerOuter io; algorithm - BackendDAE.VAR(a, b, c, prl, d, e, f, g, source, oattr, ts, s, ct, io) := inVar; + BackendDAE.VAR(a, b, c, prl, d, e, f, g, source, oattr, ts, s, ct, io, _) := inVar; oattr := if isSome(oattr) then oattr else SOME(getVariableAttributefromType(d)); oattr := DAEUtil.setStartAttrOption(oattr, inExp); - outVar := BackendDAE.VAR(a, b, c, prl, d, e, f, g, source, oattr, ts, s, ct, io); + outVar := BackendDAE.VAR(a, b, c, prl, d, e, f, g, source, oattr, ts, s, ct, io, false); end setVarStartValueOption; public function setVarStartOrigin "author: Frenkel TUD @@ -224,10 +224,10 @@ protected DAE.ConnectorType ct; DAE.VarInnerOuter io; algorithm - BackendDAE.VAR(a, b, c, prl, d, e, f, g, source, oattr, ts, s, ct, io) := inVar; + BackendDAE.VAR(a, b, c, prl, d, e, f, g, source, oattr, ts, s, ct, io, _) := inVar; oattr := if isSome(oattr) then oattr else SOME(getVariableAttributefromType(d)); oattr := DAEUtil.setStartOrigin(oattr, startOrigin); - outVar := BackendDAE.VAR(a, b, c, prl, d, e, f, g, source, oattr, ts, s, ct, io); + outVar := BackendDAE.VAR(a, b, c, prl, d, e, f, g, source, oattr, ts, s, ct, io, false); end setVarStartOrigin; public function setVarAttributes "sets the variable attributes of a variable. @@ -250,8 +250,8 @@ protected DAE.ConnectorType ct; DAE.VarInnerOuter io; algorithm - BackendDAE.VAR(a,b,c,prl,d,e,f,g,source,_,ts,s,ct,io) := v; - outV := BackendDAE.VAR(a,b,c,prl,d,e,f,g,source,attr,ts,s,ct,io); + BackendDAE.VAR(a,b,c,prl,d,e,f,g,source,_,ts,s,ct,io, _) := v; + outV := BackendDAE.VAR(a,b,c,prl,d,e,f,g,source,attr,ts,s,ct,io, false); end setVarAttributes; public function varStartValue "author: PA @@ -485,10 +485,10 @@ protected DAE.ConnectorType ct; DAE.VarInnerOuter io; algorithm - BackendDAE.VAR(a, b, c, prl, d, e, f, g, source, oattr, ts, s, ct, io) := inVar; + BackendDAE.VAR(a, b, c, prl, d, e, f, g, source, oattr, ts, s, ct, io, _) := inVar; oattr := if isSome(oattr) then oattr else SOME(getVariableAttributefromType(d)); oattr := DAEUtil.setStateSelect(oattr, stateSelect); - outVar := BackendDAE.VAR(a, b, c, prl, d, e, f, g, source, oattr, ts, s, ct, io); + outVar := BackendDAE.VAR(a, b, c, prl, d, e, f, g, source, oattr, ts, s, ct, io, false); end setVarStateSelect; public function varStateDerivative "author: Frenkel TUD 2013-01 @@ -545,7 +545,7 @@ algorithm comment=s, connectorType=ct, innerOuter=io) := inVar; - outVar := BackendDAE.VAR(a,BackendDAE.STATE(indx,dcr),c,prl,d,e,f,g,source,oattr,ts,s,ct,io); + outVar := BackendDAE.VAR(a,BackendDAE.STATE(indx,dcr),c,prl,d,e,f,g,source,oattr,ts,s,ct,io, false); end setStateDerivative; public function getVariableAttributefromType @@ -590,10 +590,10 @@ protected DAE.ConnectorType ct; DAE.VarInnerOuter io; algorithm - BackendDAE.VAR(a, b, c, prl, d, e, f, g, source, oattr, ts, s, ct, io) := inVar; + BackendDAE.VAR(a, b, c, prl, d, e, f, g, source, oattr, ts, s, ct, io, _) := inVar; oattr := if isSome(oattr) then oattr else SOME(getVariableAttributefromType(d)); oattr := DAEUtil.setFinalAttr(oattr, finalPrefix); - outVar := BackendDAE.VAR(a, b, c, prl, d, e, f, g, source, oattr, ts, s, ct, io); + outVar := BackendDAE.VAR(a, b, c, prl, d, e, f, g, source, oattr, ts, s, ct, io, false); end setVarFinal; public function setVarMinMax "author: Frenkel TUD @@ -620,10 +620,10 @@ protected DAE.VarInnerOuter io; algorithm if isSome(inMin) or isSome(inMax) then - BackendDAE.VAR(a, b, c, prl, d, e, f, g, source, oattr, ts, s, ct, io) := inVar; + BackendDAE.VAR(a, b, c, prl, d, e, f, g, source, oattr, ts, s, ct, io, _) := inVar; oattr := if isSome(oattr) then oattr else SOME(getVariableAttributefromType(d)); oattr := DAEUtil.setMinMax(oattr, inMin, inMax); - outVar := BackendDAE.VAR(a, b, c, prl, d, e, f, g, source, oattr, ts, s, ct, io); + outVar := BackendDAE.VAR(a, b, c, prl, d, e, f, g, source, oattr, ts, s, ct, io, false); else outVar := inVar; end if; @@ -651,10 +651,10 @@ protected DAE.ConnectorType ct; DAE.VarInnerOuter io; algorithm - BackendDAE.VAR(a, b, c, prl, d, e, f, g, source, oattr, ts, s, ct, io) := inVar; + BackendDAE.VAR(a, b, c, prl, d, e, f, g, source, oattr, ts, s, ct, io, _) := inVar; oattr := if isSome(oattr) then oattr else SOME(getVariableAttributefromType(d)); oattr := DAEUtil.setUnitAttr(oattr, inUnit); - outVar := BackendDAE.VAR(a, b, c, prl, d, e, f, g, source, oattr, ts, s, ct, io); + outVar := BackendDAE.VAR(a, b, c, prl, d, e, f, g, source, oattr, ts, s, ct, io, false); end setUnit; public function varNominalValue "author: Frenkel TUD" @@ -686,10 +686,10 @@ protected DAE.ConnectorType ct; DAE.VarInnerOuter io; algorithm - BackendDAE.VAR(a, b, c, prl, d, e, f, g, source, oattr, ts, s, ct, io) := inVar; + BackendDAE.VAR(a, b, c, prl, d, e, f, g, source, oattr, ts, s, ct, io, _) := inVar; oattr := if isSome(oattr) then oattr else SOME(getVariableAttributefromType(d)); oattr := DAEUtil.setNominalAttr(oattr, inExp); - outVar := BackendDAE.VAR(a, b, c, prl, d, e, f, g, source, oattr, ts, s, ct, io); + outVar := BackendDAE.VAR(a, b, c, prl, d, e, f, g, source, oattr, ts, s, ct, io, false); end setVarNominalValue; public function varType "author: PA @@ -1670,7 +1670,7 @@ algorithm outVar := BackendDAE.VAR(cr, BackendDAE.VARIABLE(),DAE.BIDIR(),DAE.NON_PARALLEL(),DAE.T_REAL_DEFAULT,NONE(),NONE(),{}, DAE.emptyElementSource, NONE(), - NONE(), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER()); + NONE(), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER(), false); end createAliasDerVar; public function createDummyVar @@ -1682,7 +1682,7 @@ algorithm outVar := BackendDAE.VAR(outCr, BackendDAE.STATE(1,NONE()),DAE.BIDIR(),DAE.NON_PARALLEL(),DAE.T_REAL_DEFAULT,NONE(),NONE(),{}, DAE.emptyElementSource, SOME(DAE.VAR_ATTR_REAL(NONE(),NONE(),NONE(),NONE(),NONE(),NONE(),SOME(DAE.BCONST(true)),NONE(),NONE(),NONE(),NONE(),NONE(),NONE(),NONE(),NONE())), - NONE(),NONE(),DAE.NON_CONNECTOR(),DAE.NOT_INNER_OUTER()); + NONE(),NONE(),DAE.NON_CONNECTOR(),DAE.NOT_INNER_OUTER(), false); end createDummyVar; public function createCSEVar "Creates a cse variable with the name of inCref. @@ -1702,12 +1702,12 @@ algorithm DAE.T_COMPLEX(complexClassType=ClassInf.RECORD(path), source=typeLst) = inType; source = DAE.SOURCE(Absyn.dummyInfo, {}, NONE(), {}, path::typeLst, {}, {}); varKind = if Types.isDiscreteType(inType) then BackendDAE.DISCRETE() else BackendDAE.VARIABLE(); - outVar = BackendDAE.VAR(inCref, varKind, DAE.BIDIR(), DAE.NON_PARALLEL(), inType, NONE(), NONE(), {}, source, NONE(), SOME(BackendDAE.AVOID()), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER()); + outVar = BackendDAE.VAR(inCref, varKind, DAE.BIDIR(), DAE.NON_PARALLEL(), inType, NONE(), NONE(), {}, source, NONE(), SOME(BackendDAE.AVOID()), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER(), false); then outVar; case (_) equation varKind = if Types.isDiscreteType(inType) then BackendDAE.DISCRETE() else BackendDAE.VARIABLE(); - outVar = BackendDAE.VAR(inCref, varKind, DAE.BIDIR(), DAE.NON_PARALLEL(), inType, NONE(), NONE(), {}, DAE.emptyElementSource, NONE(), SOME(BackendDAE.AVOID()), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER()); + outVar = BackendDAE.VAR(inCref, varKind, DAE.BIDIR(), DAE.NON_PARALLEL(), inType, NONE(), NONE(), {}, DAE.emptyElementSource, NONE(), SOME(BackendDAE.AVOID()), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER(), false); then outVar; end match; end createCSEVar; @@ -1745,7 +1745,7 @@ algorithm comment = comment, connectorType = ct, innerOuter = io) := inVar; - outVar := BackendDAE.VAR(cr, kind, dir, prl, tp, bind, v, dim, source, attr, ts, comment, ct, io); + outVar := BackendDAE.VAR(cr, kind, dir, prl, tp, bind, v, dim, source, attr, ts, comment, ct, io, false); end copyVarNewName; public function setVarKindForVar"updates the varkind for an indexed var inside the variable-array. @@ -1805,7 +1805,7 @@ algorithm comment = comment, connectorType = ct, innerOuter = io) := inVar; - outVar := BackendDAE.VAR(cr, inVarKind, dir, prl, tp, bind, v, dim, source, attr, ts, comment, ct, io); + outVar := BackendDAE.VAR(cr, inVarKind, dir, prl, tp, bind, v, dim, source, attr, ts, comment, ct, io, false); // referenceUpdate(inVar, 2, new_kind); end setVarKind; @@ -1842,7 +1842,7 @@ algorithm comment = comment, connectorType = ct, innerOuter = io) := inVar; - outVar := BackendDAE.VAR(cr, varKind, dir, prl, tp, inBindExp, v, dim, source, attr, ts, comment, ct, io); + outVar := BackendDAE.VAR(cr, varKind, dir, prl, tp, inBindExp, v, dim, source, attr, ts, comment, ct, io, false); end setBindExp; public function setBindValue "author: lochel" @@ -1877,7 +1877,7 @@ algorithm comment = comment, connectorType = ct, innerOuter = io) := inVar; - outVar := BackendDAE.VAR(cr, varKind, dir, prl, tp, bindExp, inBindValue, dim, source, attr, ts, comment, ct, io); + outVar := BackendDAE.VAR(cr, varKind, dir, prl, tp, bindExp, inBindValue, dim, source, attr, ts, comment, ct, io, false); end setBindValue; public function setVarDirectionTpl @@ -1927,7 +1927,7 @@ algorithm connectorType = ct, innerOuter = io),_) equation - oVar = BackendDAE.VAR(cr,kind,varDirection,prl,tp,bind,v,dim,source,attr,ts,comment,ct,io); // referenceUpdate(inVar, 3, varDirection); + oVar = BackendDAE.VAR(cr,kind,varDirection,prl,tp,bind,v,dim,source,attr,ts,comment,ct,io,false); // referenceUpdate(inVar, 3, varDirection); then oVar; end match; @@ -2856,7 +2856,7 @@ end existsVar; public function makeVar input DAE.ComponentRef cr; - output BackendDAE.Var v = BackendDAE.VAR(cr, BackendDAE.VARIABLE(), DAE.BIDIR(), DAE.NON_PARALLEL(), DAE.T_REAL_DEFAULT, NONE(), NONE(), {}, DAE.emptyElementSource, NONE(), NONE(), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER()); + output BackendDAE.Var v = BackendDAE.VAR(cr, BackendDAE.VARIABLE(), DAE.BIDIR(), DAE.NON_PARALLEL(), DAE.T_REAL_DEFAULT, NONE(), NONE(), {}, DAE.emptyElementSource, NONE(), NONE(), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER(),false); end makeVar; public function addVarDAE @@ -3801,7 +3801,7 @@ algorithm equation ops = listReverse(iops); source = List.foldr(ops,DAEUtil.addSymbolicTransformation,source); - then BackendDAE.VAR(a,b,c,p,d,e,f,g,source,oattr,ts,s,ct,io); + then BackendDAE.VAR(a,b,c,p,d,e,f,g,source,oattr,ts,s,ct,io,false); end match; end mergeVariableOperations; @@ -4414,7 +4414,7 @@ algorithm equation cr = ComponentReference.crefPrefixDer(cr); then - BackendDAE.VAR(cr, BackendDAE.STATE_DER(), dir, prl, tp, exp, v, dim, source, attr, ts, comment, ct, io); + BackendDAE.VAR(cr, BackendDAE.STATE_DER(), dir, prl, tp, exp, v, dim, source, attr, ts, comment, ct, io,false); case (backendVar) then diff --git a/Compiler/BackEnd/Differentiate.mo b/Compiler/BackEnd/Differentiate.mo index 89957a87d17..17f9cef04d9 100644 --- a/Compiler/BackEnd/Differentiate.mo +++ b/Compiler/BackEnd/Differentiate.mo @@ -832,7 +832,7 @@ algorithm case (DAE.STMT_FOR(type_=type_, iterIsArray=iterIsArray, iter=ident, index=index, range=exp, statementLst=statementLst, source=source)::restStatements, _, _, _, _, _) equation cref = ComponentReference.makeCrefIdent(ident, DAE.T_INTEGER_DEFAULT, {}); - controlVar = BackendDAE.VAR(cref, BackendDAE.DISCRETE(), DAE.BIDIR(), DAE.NON_PARALLEL(), DAE.T_REAL_DEFAULT, NONE(), NONE(), {}, DAE.emptyElementSource, NONE(), NONE(), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER()); + controlVar = BackendDAE.VAR(cref, BackendDAE.DISCRETE(), DAE.BIDIR(), DAE.NON_PARALLEL(), DAE.T_REAL_DEFAULT, NONE(), NONE(), {}, DAE.emptyElementSource, NONE(), NONE(), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER(), false); inputData = addAllVars({controlVar}, inInputData); (derivedStatements1, functions) = differentiateStatements(statementLst, inDiffwrtCref, inputData, inDiffType, {}, inFunctionTree); diff --git a/Compiler/BackEnd/DynamicOptimization.mo b/Compiler/BackEnd/DynamicOptimization.mo index 9de1ed78b1b..5e92eac38c4 100644 --- a/Compiler/BackEnd/DynamicOptimization.mo +++ b/Compiler/BackEnd/DynamicOptimization.mo @@ -201,7 +201,7 @@ protected function makeVar "author: Vitalij Ruge" algorithm cr := ComponentReference.makeCrefIdent(name, DAE.T_REAL_DEFAULT, {}); - v := BackendDAE.VAR(cr, BackendDAE.VARIABLE(), DAE.OUTPUT(), DAE.NON_PARALLEL(), DAE.T_REAL_DEFAULT, NONE(), NONE(), {}, DAE.emptyElementSource, NONE(), SOME(BackendDAE.AVOID()), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER()); + v := BackendDAE.VAR(cr, BackendDAE.VARIABLE(), DAE.OUTPUT(), DAE.NON_PARALLEL(), DAE.T_REAL_DEFAULT, NONE(), NONE(), {}, DAE.emptyElementSource, NONE(), SOME(BackendDAE.AVOID()), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER(), false); end makeVar; protected function addOptimizationVarsEqns1 diff --git a/Compiler/BackEnd/FindZeroCrossings.mo b/Compiler/BackEnd/FindZeroCrossings.mo index 0b6c7cdebeb..6e441fd04f9 100644 --- a/Compiler/BackEnd/FindZeroCrossings.mo +++ b/Compiler/BackEnd/FindZeroCrossings.mo @@ -426,7 +426,7 @@ algorithm ht = BaseHashTable.add((inCondition, inIndex), inHT); crStr = "$whenCondition" + intString(inIndex); - var = BackendDAE.VAR(DAE.CREF_IDENT(crStr, DAE.T_BOOL_DEFAULT, {}), BackendDAE.DISCRETE(), DAE.BIDIR(), DAE.NON_PARALLEL(), DAE.T_BOOL_DEFAULT, NONE(), NONE(), {}, inSource, NONE(), NONE(), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER()); + var = BackendDAE.VAR(DAE.CREF_IDENT(crStr, DAE.T_BOOL_DEFAULT, {}), BackendDAE.DISCRETE(), DAE.BIDIR(), DAE.NON_PARALLEL(), DAE.T_BOOL_DEFAULT, NONE(), NONE(), {}, inSource, NONE(), NONE(), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER(), false); var = BackendVariable.setVarFixed(var, true); eqn = BackendDAE.EQUATION(DAE.CREF(DAE.CREF_IDENT(crStr, DAE.T_BOOL_DEFAULT, {}), DAE.T_BOOL_DEFAULT), inCondition, inSource, BackendDAE.EQ_ATTR_DEFAULT_DYNAMIC); @@ -604,7 +604,7 @@ algorithm case (DAE.ARRAY(array={condition})) equation crStr = "$whenCondition" + intString(inIndex); - var = BackendDAE.VAR(DAE.CREF_IDENT(crStr, DAE.T_BOOL_DEFAULT, {}), BackendDAE.DISCRETE(), DAE.BIDIR(), DAE.NON_PARALLEL(), DAE.T_BOOL_DEFAULT, NONE(), NONE(), {}, inSource, NONE(), NONE(), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER()); + var = BackendDAE.VAR(DAE.CREF_IDENT(crStr, DAE.T_BOOL_DEFAULT, {}), BackendDAE.DISCRETE(), DAE.BIDIR(), DAE.NON_PARALLEL(), DAE.T_BOOL_DEFAULT, NONE(), NONE(), {}, inSource, NONE(), NONE(), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER(), false); var = BackendVariable.setVarFixed(var, true); stmt = DAE.STMT_ASSIGN(DAE.T_BOOL_DEFAULT, DAE.CREF(DAE.CREF_IDENT(crStr, DAE.T_BOOL_DEFAULT, {}), DAE.T_BOOL_DEFAULT), condition, inSource); @@ -620,7 +620,7 @@ algorithm case _ equation crStr = "$whenCondition" + intString(inIndex); - var = BackendDAE.VAR(DAE.CREF_IDENT(crStr, DAE.T_BOOL_DEFAULT, {}), BackendDAE.DISCRETE(), DAE.BIDIR(), DAE.NON_PARALLEL(), DAE.T_BOOL_DEFAULT, NONE(), NONE(), {}, inSource, NONE(), NONE(), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER()); + var = BackendDAE.VAR(DAE.CREF_IDENT(crStr, DAE.T_BOOL_DEFAULT, {}), BackendDAE.DISCRETE(), DAE.BIDIR(), DAE.NON_PARALLEL(), DAE.T_BOOL_DEFAULT, NONE(), NONE(), {}, inSource, NONE(), NONE(), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER(), false); var = BackendVariable.setVarFixed(var, true); stmt = DAE.STMT_ASSIGN(DAE.T_BOOL_DEFAULT, DAE.CREF(DAE.CREF_IDENT(crStr, DAE.T_BOOL_DEFAULT, {}), DAE.T_BOOL_DEFAULT), inCondition, inSource); diff --git a/Compiler/BackEnd/HpcOmEqSystems.mo b/Compiler/BackEnd/HpcOmEqSystems.mo index be0dde0c909..7228d21c859 100644 --- a/Compiler/BackEnd/HpcOmEqSystems.mo +++ b/Compiler/BackEnd/HpcOmEqSystems.mo @@ -1158,7 +1158,7 @@ algorithm aName = "$a"+intString(tornSysIdx)+"_"+intString(resIdx)+"_"+intString(iIdx); ty = DAE.T_REAL_DEFAULT; aCRef = ComponentReference.makeCrefIdent(aName,ty,{}); - a_ii = BackendDAE.VAR(aCRef,BackendDAE.VARIABLE(),DAE.BIDIR(),DAE.NON_PARALLEL(),ty,NONE(),NONE(),{},DAE.emptyElementSource,NONE(),NONE(),NONE(),DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER()); + a_ii = BackendDAE.VAR(aCRef,BackendDAE.VARIABLE(),DAE.BIDIR(),DAE.NON_PARALLEL(),ty,NONE(),NONE(),{},DAE.emptyElementSource,NONE(),NONE(),NONE(),DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER(), false); a_ii = BackendVariable.setVarStartValue(a_ii,DAE.RCONST(0.0)); // build the equations to solve for the coefficients @@ -1187,7 +1187,7 @@ algorithm aName = "$a"+intString(tornSysIdx)+"_"+intString(resIdx)+"_"+intString(iIdx); ty = DAE.T_REAL_DEFAULT; aCRef = ComponentReference.makeCrefIdent(aName,ty,{}); - a_ii = BackendDAE.VAR(aCRef,BackendDAE.VARIABLE(),DAE.BIDIR(),DAE.NON_PARALLEL(),ty,NONE(),NONE(),{},DAE.emptyElementSource,NONE(),NONE(),NONE(),DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER()); + a_ii = BackendDAE.VAR(aCRef,BackendDAE.VARIABLE(),DAE.BIDIR(),DAE.NON_PARALLEL(),ty,NONE(),NONE(),{},DAE.emptyElementSource,NONE(),NONE(),NONE(),DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER(), false); a_ii = BackendVariable.setVarStartValue(a_ii,DAE.RCONST(0.0)); // build the equations to solve for the coefficients @@ -1471,7 +1471,7 @@ algorithm varExp := Expression.crefExp(cRef); replacementOut := BackendVarTransform.addReplacement(replacementIn,oVarCRef,varExp,NONE()); ty := ComponentReference.crefLastType(cRef); - replVar := BackendDAE.VAR(cRef,BackendDAE.VARIABLE(),DAE.BIDIR(),DAE.NON_PARALLEL(),ty,NONE(),NONE(),{},DAE.emptyElementSource,NONE(),NONE(),NONE(),DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER()); + replVar := BackendDAE.VAR(cRef,BackendDAE.VARIABLE(),DAE.BIDIR(),DAE.NON_PARALLEL(),ty,NONE(),NONE(),{},DAE.emptyElementSource,NONE(),NONE(),NONE(),DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER(), false); replVar := BackendVariable.setVarStartValue(replVar,DAE.RCONST(0.0)); replVarLstOut := replVar::replVarLstIn; tplOut := (replVarLstOut,replacementOut); @@ -1743,7 +1743,7 @@ protected DAE.ComponentRef cr; algorithm cr := ComponentReference.makeCrefIdent(ident,ty,{}); - var := BackendDAE.VAR(cr,BackendDAE.VARIABLE(),DAE.BIDIR(),DAE.NON_PARALLEL(),ty,NONE(),NONE(),{},DAE.emptyElementSource,NONE(),NONE(),NONE(),DAE.NON_CONNECTOR(),DAE.NOT_INNER_OUTER()); + var := BackendDAE.VAR(cr,BackendDAE.VARIABLE(),DAE.BIDIR(),DAE.NON_PARALLEL(),ty,NONE(),NONE(),{},DAE.emptyElementSource,NONE(),NONE(),NONE(),DAE.NON_CONNECTOR(),DAE.NOT_INNER_OUTER(), false); end makeVarOfIdent; protected function getNewChioRow @@ -1797,7 +1797,7 @@ algorithm (detExp,_) := ExpressionSimplify.simplify(detExp); detVarName := "$det_a"+intString(iter)+"__"+intString(row-1)+"_"+intString(col-1); detCR := ComponentReference.makeCrefIdent(detVarName,ty,{}); - detAVar := BackendDAE.VAR(detCR,BackendDAE.VARIABLE(),DAE.BIDIR(),DAE.NON_PARALLEL(),ty,NONE(),NONE(),{},DAE.emptyElementSource,NONE(),NONE(),NONE(),DAE.NON_CONNECTOR(),DAE.NOT_INNER_OUTER()); + detAVar := BackendDAE.VAR(detCR,BackendDAE.VARIABLE(),DAE.BIDIR(),DAE.NON_PARALLEL(),ty,NONE(),NONE(),{},DAE.emptyElementSource,NONE(),NONE(),NONE(),DAE.NON_CONNECTOR(),DAE.NOT_INNER_OUTER(), false); detVarExp := Expression.crefExp(detCR); detAeq := BackendDAE.EQUATION(exp=detVarExp,scalar=detExp,source=DAE.emptyElementSource,attr=BackendDAE.EQ_ATTR_DEFAULT_DYNAMIC); matrixB := Array.consToElement(row-1,detVarExp,matrixB); @@ -1812,7 +1812,7 @@ algorithm (detExp,_) := ExpressionSimplify.simplify(detExp); detVarName := "$det_b"+intString(iter)+"__"+intString(row-1)+"_"+intString(col-1); detCR := ComponentReference.makeCrefIdent(detVarName,ty,{}); - detAiVar := BackendDAE.VAR(detCR,BackendDAE.VARIABLE(),DAE.BIDIR(),DAE.NON_PARALLEL(),ty,NONE(),NONE(),{},DAE.emptyElementSource,NONE(),NONE(),NONE(),DAE.NON_CONNECTOR(),DAE.NOT_INNER_OUTER()); + detAiVar := BackendDAE.VAR(detCR,BackendDAE.VARIABLE(),DAE.BIDIR(),DAE.NON_PARALLEL(),ty,NONE(),NONE(),{},DAE.emptyElementSource,NONE(),NONE(),NONE(),DAE.NON_CONNECTOR(),DAE.NOT_INNER_OUTER(), false); detVarExp := Expression.crefExp(detCR); detAieq := BackendDAE.EQUATION(exp=detVarExp,scalar=detExp,source=DAE.emptyElementSource,attr=BackendDAE.EQ_ATTR_DEFAULT_DYNAMIC); arrayUpdate(vecAi,row-1,detVarExp); diff --git a/Compiler/BackEnd/IndexReduction.mo b/Compiler/BackEnd/IndexReduction.mo index f29ea6a8ae4..5d927ee5020 100644 --- a/Compiler/BackEnd/IndexReduction.mo +++ b/Compiler/BackEnd/IndexReduction.mo @@ -3201,7 +3201,7 @@ protected function generateVar input Option attr; output BackendDAE.Var var; algorithm - var := BackendDAE.VAR(cr,varKind,DAE.BIDIR(),DAE.NON_PARALLEL(),varType,NONE(),NONE(),subs,DAE.emptyElementSource,attr,NONE(),NONE(),DAE.NON_CONNECTOR(),DAE.NOT_INNER_OUTER()); + var := BackendDAE.VAR(cr,varKind,DAE.BIDIR(),DAE.NON_PARALLEL(),varType,NONE(),NONE(),subs,DAE.emptyElementSource,attr,NONE(),NONE(),DAE.NON_CONNECTOR(),DAE.NOT_INNER_OUTER(),false); end generateVar; protected function generateArrayVar @@ -3238,7 +3238,7 @@ algorithm vars; case (_,_,_,_) equation - var = BackendDAE.VAR(name,varKind,DAE.BIDIR(),DAE.NON_PARALLEL(),varType,NONE(),NONE(),{},DAE.emptyElementSource,attr,NONE(),NONE(),DAE.NON_CONNECTOR(),DAE.NOT_INNER_OUTER()); + var = BackendDAE.VAR(name,varKind,DAE.BIDIR(),DAE.NON_PARALLEL(),varType,NONE(),NONE(),{},DAE.emptyElementSource,attr,NONE(),NONE(),DAE.NON_CONNECTOR(),DAE.NOT_INNER_OUTER(), false); then {var}; end match; @@ -3416,7 +3416,7 @@ algorithm dattr = BackendVariable.getVariableAttributefromType(tp); odattr = DAEUtil.setFixedAttr(SOME(dattr), SOME(DAE.BCONST(false))); //kind = if_(intGt(n,1),BackendDAE.DUMMY_DER(),BackendDAE.STATE(1,NONE())); - var = BackendDAE.VAR(cr,BackendDAE.STATE(1,NONE()),dir,prl,tp,NONE(),NONE(),dim,source,odattr,ts,comment,ct,io); + var = BackendDAE.VAR(cr,BackendDAE.STATE(1,NONE()),dir,prl,tp,NONE(),NONE(),dim,source,odattr,ts,comment,ct,io,false); then (var,ht); // state case (BackendDAE.VAR(varKind=BackendDAE.STATE(index=diffcount,derName=derName)),_,_) @@ -3562,7 +3562,7 @@ algorithm dattr = BackendVariable.getVariableAttributefromType(tp); odattr = DAEUtil.setFixedAttr(SOME(dattr), SOME(DAE.BCONST(false))); kind = if intGt(diffCount,0) then BackendDAE.STATE(diffCount,NONE()) else BackendDAE.DUMMY_DER(); - var = BackendDAE.VAR(name,kind,dir,prl,tp,NONE(),NONE(),dim,source,odattr,ts,comment,ct,io); + var = BackendDAE.VAR(name,kind,dir,prl,tp,NONE(),NONE(),dim,source,odattr,ts,comment,ct,io,false); (vlst,ht,n) = makeHigherStatesRepl1(diffCount-1,diffedCount+1,iOrigName,name,inVar,vars,var::iVarLst,ht,iN+1); then (vlst,ht,n); // finished @@ -3657,7 +3657,7 @@ algorithm (varlst,ht) = makeAllDummyVarandDummyDerivativeRepl1(1,1,name,name,var,vars,so,varlst,ht); cr = ComponentReference.crefPrefixDer(name); source = DAEUtil.addSymbolicTransformation(source,DAE.NEW_DUMMY_DER(cr,{})); - then (BackendDAE.VAR(name,BackendDAE.DUMMY_STATE(),dir,prl,tp,bind,value,dim,source,attr,ts,comment,ct,io),(vars,so,varlst,ht)); + then (BackendDAE.VAR(name,BackendDAE.DUMMY_STATE(),dir,prl,tp,bind,value,dim,source,attr,ts,comment,ct,io,false),(vars,so,varlst,ht)); // state replacable without unknown derivative case (var as BackendDAE.VAR(name,BackendDAE.STATE(index=diffcount,derName=NONE()),dir,prl,tp,bind,value,dim,source,attr,ts,comment,ct,io),(vars,so,varlst,ht)) equation @@ -3666,7 +3666,7 @@ algorithm // dummy_der name vor Source information cr = ComponentReference.crefPrefixDer(name); source = DAEUtil.addSymbolicTransformation(source,DAE.NEW_DUMMY_DER(cr,{})); - then (BackendDAE.VAR(name,BackendDAE.DUMMY_STATE(),dir,prl,tp,bind,value,dim,source,attr,ts,comment,ct,io),(vars,so,varlst,ht)); + then (BackendDAE.VAR(name,BackendDAE.DUMMY_STATE(),dir,prl,tp,bind,value,dim,source,attr,ts,comment,ct,io,false),(vars,so,varlst,ht)); else (inVar,inTpl); end matchcontinue; end makeAllDummyVarandDummyDerivativeRepl; @@ -3731,7 +3731,7 @@ algorithm /* Dummy variables are algebraic variables without start value, min/max, .., hence fixed = false */ dattr = BackendVariable.getVariableAttributefromType(tp); odattr = DAEUtil.setFixedAttr(SOME(dattr), SOME(DAE.BCONST(false))); - var = BackendDAE.VAR(name,BackendDAE.DUMMY_DER(),dir,prl,tp,NONE(),NONE(),dim,source,odattr,ts,comment,ct,io); + var = BackendDAE.VAR(name,BackendDAE.DUMMY_DER(),dir,prl,tp,NONE(),NONE(),dim,source,odattr,ts,comment,ct,io, false); (vlst,ht) = makeAllDummyVarandDummyDerivativeRepl1(diffCount-1,diffedCount+1,iOrigName,name,inVar,vars,so,var::iVarLst,ht); then (vlst,ht); else @@ -3815,9 +3815,9 @@ algorithm /* Dummy variables are algebraic variables, hence fixed = false */ dattr = BackendVariable.getVariableAttributefromType(tp); odattr = DAEUtil.setFixedAttr(SOME(dattr), SOME(DAE.BCONST(false))); - dummy_derstate = BackendDAE.VAR(dummyderName,BackendDAE.DUMMY_DER(),dir,prl,tp,NONE(),NONE(),dim,source,odattr,ts,comment,ct,io); + dummy_derstate = BackendDAE.VAR(dummyderName,BackendDAE.DUMMY_DER(),dir,prl,tp,NONE(),NONE(),dim,source,odattr,ts,comment,ct,io, false); kind = if intEq(dn,0) then BackendDAE.DUMMY_STATE() else BackendDAE.DUMMY_DER(); - dummy_state = BackendDAE.VAR(name,kind,dir,prl,tp,NONE(),NONE(),dim,source,odattr,ts,comment,ct,io); + dummy_state = BackendDAE.VAR(name,kind,dir,prl,tp,NONE(),NONE(),dim,source,odattr,ts,comment,ct,io, false); dummy_state = if intEq(dn,0) then inVar else dummy_state; dummy_state = BackendVariable.setVarKind(dummy_state, kind); vars = BackendVariable.addVar(dummy_derstate, vars); @@ -4152,7 +4152,7 @@ algorithm equation b = intGt(counter,diffcounter); diffcounter = if b then counter else diffcounter; - var = BackendDAE.VAR(cr, BackendDAE.STATE(diffcounter,dcr), dir, prl, tp, bind, v, dim, source, attr, ts, comment, ct,io); + var = BackendDAE.VAR(cr, BackendDAE.STATE(diffcounter,dcr), dir, prl, tp, bind, v, dim, source, attr, ts, comment, ct,io, false); vars = if b then BackendVariable.addVar(var, inVars) else inVars; changedVars = List.consOnTrue(b,i,iChangedVars); (vars,ilst) = increaseDifferentiation(vlst,ilst,counter,vars,changedVars); diff --git a/Compiler/BackEnd/Initialization.mo b/Compiler/BackEnd/Initialization.mo index e706a35aabb..5887825cf91 100644 --- a/Compiler/BackEnd/Initialization.mo +++ b/Compiler/BackEnd/Initialization.mo @@ -990,7 +990,7 @@ algorithm case (BackendDAE.VAR(varName=cr, varKind=BackendDAE.DISCRETE(), varType=ty, arryDim=arryDim), vars) equation false = BackendVariable.varFixed(inVar); preCR = ComponentReference.crefPrefixPre(cr); // cr => $PRE.cr - preVar = BackendDAE.VAR(preCR, BackendDAE.VARIABLE(), DAE.BIDIR(), DAE.NON_PARALLEL(), ty, NONE(), NONE(), arryDim, DAE.emptyElementSource, NONE(), NONE(), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER()); + preVar = BackendDAE.VAR(preCR, BackendDAE.VARIABLE(), DAE.BIDIR(), DAE.NON_PARALLEL(), ty, NONE(), NONE(), arryDim, DAE.emptyElementSource, NONE(), NONE(), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER(), false); vars = BackendVariable.addVar(preVar, vars); then (inVar, vars); @@ -2074,7 +2074,7 @@ algorithm startValue = BackendVariable.varStartValue(var); preCR = ComponentReference.crefPrefixPre(cr); // cr => $PRE.cr - preVar = BackendDAE.VAR(preCR, BackendDAE.DISCRETE(), DAE.BIDIR(), DAE.NON_PARALLEL(), ty, NONE(), NONE(), arryDim, DAE.emptyElementSource, NONE(), NONE(), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER()); + preVar = BackendDAE.VAR(preCR, BackendDAE.DISCRETE(), DAE.BIDIR(), DAE.NON_PARALLEL(), ty, NONE(), NONE(), arryDim, DAE.emptyElementSource, NONE(), NONE(), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER(), false); preVar = BackendVariable.setVarFixed(preVar, false); preVar = BackendVariable.setVarStartValueOption(preVar, SOME(startValue)); @@ -2090,7 +2090,7 @@ algorithm preUsed = BaseHashSet.has(cr, hs); preCR = ComponentReference.crefPrefixPre(cr); // cr => $PRE.cr - preVar = BackendDAE.VAR(preCR, BackendDAE.VARIABLE(), DAE.BIDIR(), DAE.NON_PARALLEL(), ty, NONE(), NONE(), arryDim, DAE.emptyElementSource, NONE(), NONE(), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER()); + preVar = BackendDAE.VAR(preCR, BackendDAE.VARIABLE(), DAE.BIDIR(), DAE.NON_PARALLEL(), ty, NONE(), NONE(), arryDim, DAE.emptyElementSource, NONE(), NONE(), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER(), false); preVar = BackendVariable.setVarFixed(preVar, false); preVar = BackendVariable.setVarStartValueOption(preVar, SOME(DAE.CREF(cr, ty))); diff --git a/Compiler/BackEnd/OnRelaxation.mo b/Compiler/BackEnd/OnRelaxation.mo index 9dca4416c2f..86e017bc861 100644 --- a/Compiler/BackEnd/OnRelaxation.mo +++ b/Compiler/BackEnd/OnRelaxation.mo @@ -1885,7 +1885,7 @@ algorithm cr = ComponentReference.makeCrefIdent(stringAppendList({"$tmp",sa,"_",sb}),DAE.T_REAL_DEFAULT,{}); cexp = Expression.crefExp(cr); eqns = BackendEquation.addEquation(BackendDAE.EQUATION(cexp,e,DAE.emptyElementSource,BackendDAE.EQ_ATTR_DEFAULT_UNKNOWN),inEqns); - v = BackendDAE.VAR(cr,BackendDAE.VARIABLE(),DAE.BIDIR(),DAE.NON_PARALLEL(),DAE.T_REAL_DEFAULT,NONE(),NONE(),{},DAE.emptyElementSource,NONE(),NONE(),NONE(),DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER()); + v = BackendDAE.VAR(cr,BackendDAE.VARIABLE(),DAE.BIDIR(),DAE.NON_PARALLEL(),DAE.T_REAL_DEFAULT,NONE(),NONE(),{},DAE.emptyElementSource,NONE(),NONE(),NONE(),DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER(), false); vars = BackendVariable.addVar(v,inVars); then (vars,eqns,cexp,(a,b+1)); diff --git a/Compiler/BackEnd/StateMachineFeatures.mo b/Compiler/BackEnd/StateMachineFeatures.mo index e75756583f6..5ba76a31f57 100644 --- a/Compiler/BackEnd/StateMachineFeatures.mo +++ b/Compiler/BackEnd/StateMachineFeatures.mo @@ -1431,7 +1431,7 @@ Create a BackendDAE.Var with some defaults" output BackendDAE.Var var; algorithm var := BackendDAE.VAR(cref, varKind, DAE.BIDIR(), DAE.NON_PARALLEL(), varType, NONE(), NONE(), {}, - DAE.emptyElementSource, NONE(), NONE(), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER()); + DAE.emptyElementSource, NONE(), NONE(), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER(),false); end createVarWithDefaults; public function emptySMS " diff --git a/Compiler/BackEnd/SymbolicJacobian.mo b/Compiler/BackEnd/SymbolicJacobian.mo index d82171b4b8d..7a7b3e49fb9 100644 --- a/Compiler/BackEnd/SymbolicJacobian.mo +++ b/Compiler/BackEnd/SymbolicJacobian.mo @@ -2008,7 +2008,7 @@ algorithm case (_, _) equation derivedCref = Differentiate.createSeedCrefName(indiffVar, inMatrixName); - jacvar = BackendDAE.VAR(derivedCref, BackendDAE.STATE_DER(), DAE.BIDIR(), DAE.NON_PARALLEL(), DAE.T_REAL_DEFAULT, NONE(), NONE(), {}, DAE.emptyElementSource, NONE(), NONE(), NONE(),DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER()); + jacvar = BackendDAE.VAR(derivedCref, BackendDAE.STATE_DER(), DAE.BIDIR(), DAE.NON_PARALLEL(), DAE.T_REAL_DEFAULT, NONE(), NONE(), {}, DAE.emptyElementSource, NONE(), NONE(), NONE(),DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER(), false); then jacvar; end match; end createSeedVars; @@ -2039,27 +2039,27 @@ algorithm ({_}, _) = BackendVariable.getVar(currVar, inAllVars); currVar = ComponentReference.crefPrefixDer(currVar); derivedCref = Differentiate.createDifferentiatedCrefName(currVar, cref, inMatrixName); - r1 = BackendDAE.VAR(derivedCref, BackendDAE.STATE_DER(), DAE.BIDIR(), DAE.NON_PARALLEL(), DAE.T_REAL_DEFAULT, NONE(), NONE(), {}, DAE.emptyElementSource, NONE(), NONE(), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER()); + r1 = BackendDAE.VAR(derivedCref, BackendDAE.STATE_DER(), DAE.BIDIR(), DAE.NON_PARALLEL(), DAE.T_REAL_DEFAULT, NONE(), NONE(), {}, DAE.emptyElementSource, NONE(), NONE(), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER(), true); then createAllDiffedVars(restVar, cref, inAllVars, inIndex+1, inMatrixName,r1::iVars); case(BackendDAE.VAR(varName=currVar)::restVar,cref,_,_, _, _) equation ({_}, _) = BackendVariable.getVar(currVar, inAllVars); derivedCref = Differentiate.createDifferentiatedCrefName(currVar, cref, inMatrixName); - r1 = BackendDAE.VAR(derivedCref, BackendDAE.STATE_DER(), DAE.BIDIR(), DAE.NON_PARALLEL(), DAE.T_REAL_DEFAULT, NONE(), NONE(), {}, DAE.emptyElementSource, NONE(), NONE(), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER()); + r1 = BackendDAE.VAR(derivedCref, BackendDAE.STATE_DER(), DAE.BIDIR(), DAE.NON_PARALLEL(), DAE.T_REAL_DEFAULT, NONE(), NONE(), {}, DAE.emptyElementSource, NONE(), NONE(), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER(), true); then createAllDiffedVars(restVar, cref, inAllVars, inIndex+1, inMatrixName,r1::iVars); case(BackendDAE.VAR(varName=currVar,varKind=BackendDAE.STATE())::restVar,cref,_,_, _, _) equation currVar = ComponentReference.crefPrefixDer(currVar); derivedCref = Differentiate.createDifferentiatedCrefName(currVar, cref, inMatrixName); - r1 = BackendDAE.VAR(derivedCref, BackendDAE.VARIABLE(), DAE.BIDIR(), DAE.NON_PARALLEL(), DAE.T_REAL_DEFAULT, NONE(), NONE(), {}, DAE.emptyElementSource, NONE(), NONE(), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER()); + r1 = BackendDAE.VAR(derivedCref, BackendDAE.VARIABLE(), DAE.BIDIR(), DAE.NON_PARALLEL(), DAE.T_REAL_DEFAULT, NONE(), NONE(), {}, DAE.emptyElementSource, NONE(), NONE(), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER(), false); then createAllDiffedVars(restVar, cref, inAllVars, inIndex, inMatrixName,r1::iVars); case(BackendDAE.VAR(varName=currVar)::restVar,cref,_,_, _, _) equation derivedCref = Differentiate.createDifferentiatedCrefName(currVar, cref, inMatrixName); - r1 = BackendDAE.VAR(derivedCref, BackendDAE.VARIABLE(), DAE.BIDIR(), DAE.NON_PARALLEL(), DAE.T_REAL_DEFAULT, NONE(), NONE(), {}, DAE.emptyElementSource, NONE(), NONE(), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER()); + r1 = BackendDAE.VAR(derivedCref, BackendDAE.VARIABLE(), DAE.BIDIR(), DAE.NON_PARALLEL(), DAE.T_REAL_DEFAULT, NONE(), NONE(), {}, DAE.emptyElementSource, NONE(), NONE(), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER(), false); then createAllDiffedVars(restVar, cref, inAllVars, inIndex, inMatrixName,r1::iVars); @@ -2277,7 +2277,7 @@ algorithm expVarName = DAE.CREF(componentRef, DAE.T_REAL_DEFAULT); currEquation = BackendDAE.EQUATION(expVarName, exp, source, eqAttr); - currVariable = BackendDAE.VAR(componentRef, BackendDAE.VARIABLE(), DAE.OUTPUT(), DAE.NON_PARALLEL(), DAE.T_REAL_DEFAULT, NONE(), NONE(), {}, DAE.emptyElementSource, NONE(), NONE(), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER()); + currVariable = BackendDAE.VAR(componentRef, BackendDAE.VARIABLE(), DAE.OUTPUT(), DAE.NON_PARALLEL(), DAE.T_REAL_DEFAULT, NONE(), NONE(), {}, DAE.emptyElementSource, NONE(), NONE(), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER(), false); (equationList, variableList) = convertResidualsIntoSolvedEquations2(restEquationList, index+1,currEquation::iEquationList,currVariable::iVariableList); then (equationList, variableList); diff --git a/Compiler/BackEnd/Uncertainties.mo b/Compiler/BackEnd/Uncertainties.mo index ed59c18f227..8a91bcb831c 100644 --- a/Compiler/BackEnd/Uncertainties.mo +++ b/Compiler/BackEnd/Uncertainties.mo @@ -2243,8 +2243,8 @@ protected DAE.ConnectorType ct; DAE.VarInnerOuter io; algorithm - BackendDAE.VAR(name,kind,dir,prl,tp,bind,bindval,ad,source,attr,ts,cmt,ct,io) := inVar; - outVar := BackendDAE.VAR(cr,kind,dir,prl,tp,bind,bindval,ad,source,attr,ts,cmt,ct,io); + BackendDAE.VAR(name,kind,dir,prl,tp,bind,bindval,ad,source,attr,ts,cmt,ct,io,_) := inVar; + outVar := BackendDAE.VAR(cr,kind,dir,prl,tp,bind,bindval,ad,source,attr,ts,cmt,ct,io,false); end setVarCref; public function setVarBindingOpt "author: PA @@ -2268,8 +2268,8 @@ protected DAE.ConnectorType ct; DAE.VarInnerOuter innerOuter; algorithm - BackendDAE.VAR(name,kind,dir,prl,tp,bind,bindval,ad,source,attr,ts,cmt,ct,innerOuter) := inVar; - outVar := BackendDAE.VAR(name,kind,dir,prl,tp,bindExp,bindval,ad,source,attr,ts,cmt,ct,innerOuter); + BackendDAE.VAR(name,kind,dir,prl,tp,bind,bindval,ad,source,attr,ts,cmt,ct,innerOuter,_) := inVar; + outVar := BackendDAE.VAR(name,kind,dir,prl,tp,bindExp,bindval,ad,source,attr,ts,cmt,ct,innerOuter,false); end setVarBindingOpt; public function moveVariables "