Skip to content

Commit

Permalink
- updated OpenModelica back-end to agree with the new DAE.FUNCTION de…
Browse files Browse the repository at this point in the history
…finition.

- 3 tests (testsuite/mofiles/ClassExtends*) fail due to changes in Inst.partialInstClassdef


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@4702 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed Dec 16, 2009
1 parent ba91508 commit 5bf1a88
Show file tree
Hide file tree
Showing 8 changed files with 106 additions and 89 deletions.
22 changes: 10 additions & 12 deletions Compiler/Codegen.mo
Expand Up @@ -1050,7 +1050,7 @@ algorithm

/* Modelica functions External functions */
case (DAE.FUNCTION(path = fpath,
dAElist = DAE.DAE(elementLst = dae),
functions = {DAE.FUNCTION_DEF(body = DAE.DAE(elementLst = dae))},
type_ = tp as (DAE.T_FUNCTION(funcArg = args,funcResultType = restype),_),
partialPrefix = false),rt)
equation
Expand Down Expand Up @@ -1122,17 +1122,16 @@ algorithm

/* MetaModelica Partial Function. sjoelund */
case (DAE.FUNCTION(path = fpath,
dAElist = DAE.DAE(elementLst = dae),
functions = {DAE.FUNCTION_DEF(body = DAE.DAE(elementLst = dae))},
type_ = (DAE.T_FUNCTION(funcArg = args,funcResultType = restype),_),
partialPrefix = true),rt)
then
({},{});

/* Builtin functions - stefan */
case (DAE.EXTFUNCTION(path = fpath,
dAElist = DAE.DAE(elementLst = orgdae),
type_ = (tp as (DAE.T_FUNCTION(funcArg = args,funcResultType = restype),_)),
externalDecl = extdecl),rt)
case (DAE.FUNCTION(path = fpath,
functions = {DAE.FUNCTION_EXT(body = DAE.DAE(elementLst = orgdae), externalDecl = extdecl)},
type_ = (tp as (DAE.T_FUNCTION(funcArg = args,funcResultType = restype),_))),rt)
equation
true = isBuiltinFunction(fpath);
fn_name_str = generateFunctionName(fpath);
Expand All @@ -1156,10 +1155,9 @@ algorithm
then (cfns, rt_1);

/* External functions */
case (DAE.EXTFUNCTION(path = fpath,
dAElist = DAE.DAE(elementLst = orgdae),
type_ = (tp as (DAE.T_FUNCTION(funcArg = args,funcResultType = restype),_)),
externalDecl = extdecl),rt)
case (DAE.FUNCTION(path = fpath,
functions = {DAE.FUNCTION_EXT(body = DAE.DAE(elementLst = orgdae), externalDecl = extdecl)},
type_ = (tp as (DAE.T_FUNCTION(funcArg = args,funcResultType = restype),_))),rt)
equation
fn_name_str = generateFunctionName(fpath);
fn_name_str = stringAppend("_", fn_name_str);
Expand Down Expand Up @@ -2486,7 +2484,7 @@ algorithm
(funcArgExps2,_,_) = Types.matchTypeTuple(funcArgExps1, funcArgTypes2, funcArgTypes1, {}, Types.matchTypeRegular, true);
isTuple = Types.isTuple(retType1);
// Call the regular function
(callCfn,callVar,tnr) = generateExpression(DAE.CALL(fpath,funcArgExps2,isTuple,false,DAE.ET_OTHER,false),tnr,funContext);
(callCfn,callVar,tnr) = generateExpression(DAE.CALL(fpath,funcArgExps2,isTuple,false,DAE.ET_OTHER,DAE.NO_INLINE),tnr,funContext);
resCref = DAE.CREF_IDENT(callVar,DAE.ET_OTHER,{});
// Fix crefs for regular struct
retTypeList1 = Types.resTypeToListTypes(retType1);
Expand Down Expand Up @@ -9951,7 +9949,7 @@ algorithm
list<DAE.Type> tys;
DAE.Type ft;
case {} then {};
case DAE.FUNCTION(dAElist = DAE.DAE(els))::rest
case DAE.FUNCTION(functions = {DAE.FUNCTION_DEF(body = DAE.DAE(els))})::rest
equation
paths1 = getUniontypePaths2(els);
paths2 = getUniontypePaths2(rest);
Expand Down
2 changes: 1 addition & 1 deletion Compiler/DAE.mo
Expand Up @@ -28,7 +28,7 @@
*
*/

package DAE
package DAE
" file: DAE.mo
package: DAE
description: DAE management and output
Expand Down
15 changes: 8 additions & 7 deletions Compiler/DAELow.mo
Expand Up @@ -1040,7 +1040,8 @@ algorithm
*
* adrpo: after a bit of talk with Francesco Casella & Peter Aronsson we will add der($dummy) = 0;
*/
(vars_1,(EQUATION(DAE.CALL(Absyn.IDENT("der"),{DAE.CREF(DAE.CREF_IDENT("$dummy",DAE.ET_REAL(),{}),DAE.ET_REAL())},false,true,DAE.ET_REAL(),false),
(vars_1,(EQUATION(DAE.CALL(Absyn.IDENT("der"),
{DAE.CREF(DAE.CREF_IDENT("$dummy",DAE.ET_REAL(),{}),DAE.ET_REAL())},false,true,DAE.ET_REAL(),DAE.NO_INLINE()),
DAE.RCONST(0.0)) :: eqns));

end matchcontinue;
Expand Down Expand Up @@ -3206,7 +3207,7 @@ algorithm
then
((
DAE.CALL(Absyn.IDENT("der"),{DAE.CREF(DAE.CREF_IDENT(id_1,ty,s),tp)},
false,true,DAE.ET_REAL(),false),str));
false,true,DAE.ET_REAL(),DAE.NO_INLINE()),str));
case ((e,str)) then ((e,str));
end matchcontinue;
end renameDerivativesExp;
Expand Down Expand Up @@ -8660,7 +8661,7 @@ algorithm
WhenEquation elsepart;
case (st,dummyder,EQUATION(exp = e1,scalar = e2))
equation
dercall = DAE.CALL(Absyn.IDENT("der"),{DAE.CREF(st,DAE.ET_REAL())},false,true,DAE.ET_REAL(),false) "scalar equation" ;
dercall = DAE.CALL(Absyn.IDENT("der"),{DAE.CREF(st,DAE.ET_REAL())},false,true,DAE.ET_REAL(),DAE.NO_INLINE()) "scalar equation" ;
(e1_1,_) = Exp.replaceExp(e1, dercall, DAE.CREF(dummyder,DAE.ET_REAL()));
(e2_1,_) = Exp.replaceExp(e2, dercall, DAE.CREF(dummyder,DAE.ET_REAL()));
then
Expand All @@ -8671,14 +8672,14 @@ algorithm
then ALGORITHM(indx,in_,out); /* Algorithms */
case (st,dummyder,WHEN_EQUATION(whenEquation = WHEN_EQ(index = i,left = cr,right = e1,elsewhenPart=NONE)))
equation
dercall = DAE.CALL(Absyn.IDENT("der"),{DAE.CREF(st,DAE.ET_REAL())},false,true,DAE.ET_REAL(),false);
dercall = DAE.CALL(Absyn.IDENT("der"),{DAE.CREF(st,DAE.ET_REAL())},false,true,DAE.ET_REAL(),DAE.NO_INLINE());
(e1_1,_) = Exp.replaceExp(e1, dercall, DAE.CREF(dummyder,DAE.ET_REAL()));
res = WHEN_EQUATION(WHEN_EQ(i,cr,e1_1,NONE));
then
res;
case (st,dummyder,WHEN_EQUATION(whenEquation = WHEN_EQ(index = i,left = cr,right = e1,elsewhenPart=SOME(elsepart))))
equation
dercall = DAE.CALL(Absyn.IDENT("der"),{DAE.CREF(st,DAE.ET_REAL())},false,true,DAE.ET_REAL(),false);
dercall = DAE.CALL(Absyn.IDENT("der"),{DAE.CREF(st,DAE.ET_REAL())},false,true,DAE.ET_REAL(),DAE.NO_INLINE());
(e1_1,_) = Exp.replaceExp(e1, dercall, DAE.CREF(dummyder,DAE.ET_REAL()));
WHEN_EQUATION(elsepartRes) = replaceDummyDer2(st,dummyder, WHEN_EQUATION(elsepart));
res = WHEN_EQUATION(WHEN_EQ(i,cr,e1_1,SOME(elsepartRes)));
Expand Down Expand Up @@ -11585,7 +11586,7 @@ algorithm
list<DAE.Exp> expl2;
Boolean tpl ;
Boolean b;
Boolean i;
DAE.InlineType i;
DAE.ExpType ty;
case({},vars) then {};
case(DAE.IFEXP(cond,t,f)::expl,vars) equation
Expand Down Expand Up @@ -13025,7 +13026,7 @@ algorithm
newid = Util.stringAppendList({derivativeNamePrefix, c_name}); // "$",c_name}) ;
// Derivatives are always or REAL type
then
((DAE.CALL(Absyn.IDENT("der"),{DAE.CREF(s,DAE.ET_REAL())},false,true,DAE.ET_REAL(),false) :: s1),
((DAE.CALL(Absyn.IDENT("der"),{DAE.CREF(s,DAE.ET_REAL())},false,true,DAE.ET_REAL(),DAE.NO_INLINE()) :: s1),
(DAE.CREF(DAE.CREF_IDENT(newid,DAE.ET_REAL(),{}),DAE.ET_REAL()) :: t1));
case (_)
equation
Expand Down
57 changes: 33 additions & 24 deletions Compiler/Derive.mo
Expand Up @@ -115,7 +115,8 @@ algorithm
DAE.Operator op,rel;
list<DAE.Exp> expl_1,expl,sub;
Absyn.Path a;
Boolean b,c,inl;
Boolean b,c;
DAE.InlineType inl;
Integer i;
Absyn.Path fname;
DAE.ExpType ty;
Expand All @@ -136,23 +137,23 @@ algorithm
equation
(_,_) = DAELow.getVar(cr, timevars);
then
DAE.CALL(Absyn.IDENT("der"),{e},false,true,DAE.ET_REAL(),false);
DAE.CALL(Absyn.IDENT("der"),{e},false,true,DAE.ET_REAL(),DAE.NO_INLINE());

case (DAE.CALL(path = fname,expLst = {e}),timevars)
equation
isSin(fname);
e_1 = differentiateExpTime(e, timevars) "der(sin(x)) = der(x)cos(x)" ;
then
DAE.BINARY(e_1,DAE.MUL(DAE.ET_REAL()),
DAE.CALL(Absyn.IDENT("cos"),{e},false,true,DAE.ET_REAL(),false));
DAE.CALL(Absyn.IDENT("cos"),{e},false,true,DAE.ET_REAL(),DAE.NO_INLINE()));

case (DAE.CALL(path = fname,expLst = {e}),timevars)
equation
isCos(fname);
e_1 = differentiateExpTime(e, timevars) "der(cos(x)) = -der(x)sin(x)" ;
then
DAE.UNARY(DAE.UMINUS(DAE.ET_REAL()),DAE.BINARY(e_1,DAE.MUL(DAE.ET_REAL()),
DAE.CALL(Absyn.IDENT("sin"),{e},false,true,DAE.ET_REAL(),false)));
DAE.CALL(Absyn.IDENT("sin"),{e},false,true,DAE.ET_REAL(),DAE.NO_INLINE())));

// der(arccos(x)) = -der(x)/sqrt(1-x^2)
case (DAE.CALL(path = fname,expLst = {e}),timevars)
Expand All @@ -161,7 +162,8 @@ algorithm
e_1 = differentiateExpTime(e, timevars) ;
then
DAE.UNARY(DAE.UMINUS(DAE.ET_REAL()),DAE.BINARY(e_1,DAE.DIV(DAE.ET_REAL()),
DAE.CALL(Absyn.IDENT("sqrt"),{DAE.BINARY(DAE.RCONST(1.0),DAE.SUB(DAE.ET_REAL()),DAE.BINARY(e,DAE.MUL(DAE.ET_REAL()),e))},false,true,DAE.ET_REAL(),false)));
DAE.CALL(Absyn.IDENT("sqrt"),{DAE.BINARY(DAE.RCONST(1.0),DAE.SUB(DAE.ET_REAL()),DAE.BINARY(e,DAE.MUL(DAE.ET_REAL()),e))},
false,true,DAE.ET_REAL(),DAE.NO_INLINE())));

// der(arcsin(x)) = der(x)/sqrt(1-x^2)
case (DAE.CALL(path = fname,expLst = {e}),timevars)
Expand All @@ -170,7 +172,8 @@ algorithm
e_1 = differentiateExpTime(e, timevars) ;
then
DAE.BINARY(e_1,DAE.DIV(DAE.ET_REAL()),
DAE.CALL(Absyn.IDENT("sqrt"),{DAE.BINARY(DAE.RCONST(1.0),DAE.SUB(DAE.ET_REAL()),DAE.BINARY(e,DAE.MUL(DAE.ET_REAL()),e))},false,true,DAE.ET_REAL(),false));
DAE.CALL(Absyn.IDENT("sqrt"),{DAE.BINARY(DAE.RCONST(1.0),DAE.SUB(DAE.ET_REAL()),DAE.BINARY(e,DAE.MUL(DAE.ET_REAL()),e))},
false,true,DAE.ET_REAL(),DAE.NO_INLINE()));

// der(arctan(x)) = der(x)/1+x^2
case (DAE.CALL(path = fname,expLst = {e}),timevars)
Expand All @@ -186,7 +189,7 @@ algorithm
e_1 = differentiateExpTime(e, timevars) "der(exp(x)) = der(x)exp(x)" ;
then
DAE.BINARY(e_1,DAE.MUL(DAE.ET_REAL()),
DAE.CALL(fname,{e},false,true,DAE.ET_REAL(),false));
DAE.CALL(fname,{e},false,true,DAE.ET_REAL(),DAE.NO_INLINE()));

case (DAE.CALL(path = fname,expLst = {e}),timevars)
equation
Expand Down Expand Up @@ -269,7 +272,7 @@ algorithm
e3_1 = differentiateExpTime(e3, tv);
then
DAE.IFEXP(e1,e2_1,e3_1);
case (DAE.CALL(path = (a as Absyn.IDENT(name = "der")),expLst = expl,tuple_ = b,builtin = c,ty=tp,inline=inl),tv)
case (DAE.CALL(path = (a as Absyn.IDENT(name = "der")),expLst = expl,tuple_ = b,builtin = c,ty=tp,inlineType=inl),tv)
local DAE.ExpType tp;
equation
expl_1 = Util.listMap1(expl, differentiateExpTime, tv);
Expand Down Expand Up @@ -355,7 +358,8 @@ algorithm
DAE.Exp e,e1_1,e2_1,e1,e2,const_one,d_e1,d_e2,exp,e_1,exp_1,e3_1,e3,cond;
DAE.ExpType tp;
Absyn.Path a,fname;
Boolean b,c,inl;
Boolean b,c;
DAE.InlineType inl;
DAE.Operator op,rel;
String e_str,s,s2,str;
list<DAE.Exp> expl_1,expl,sub;
Expand Down Expand Up @@ -417,13 +421,15 @@ algorithm
true = Exp.expContains(e2,DAE.CREF(tv,tp));
d_e2 = differentiateExp(e2, tv,differentiateIfExp);
exp = DAE.BINARY(d_e2,DAE.MUL(tp),
DAE.BINARY(e,DAE.MUL(tp),DAE.CALL(Absyn.IDENT("log"),{e1},false,true,tp,false))
DAE.BINARY(e,DAE.MUL(tp),DAE.CALL(Absyn.IDENT("log"),{e1},false,true,tp,DAE.NO_INLINE()))
);
then
exp;

/* ax^(a-1) */
case (DAE.BINARY(exp1 = (e1 as DAE.CALL(path = (a as Absyn.IDENT(name = "der")),expLst = {(exp as DAE.CREF(componentRef = cr))},tuple_ = b,builtin = c,ty=ctp,inline=inl)),operator = DAE.POW(ty = tp),exp2 = e2),tv,differentiateIfExp)
case (DAE.BINARY(exp1 = (e1 as DAE.CALL(path = (a as Absyn.IDENT(name = "der")),
expLst = {(exp as DAE.CREF(componentRef = cr))},tuple_ = b,builtin = c,ty=ctp,inlineType=inl)),
operator = DAE.POW(ty = tp),exp2 = e2),tv,differentiateIfExp)
local DAE.ExpType ctp;
equation
true = Exp.crefEqual(cr, tv) "der(e)^x => xder(e,2)der(e)^(x-1)" ;
Expand Down Expand Up @@ -464,7 +470,7 @@ algorithm
DAE.UNARY(op,e_1);

/* der(tanh(x)) = der(x) / cosh(x) */
case (DAE.CALL(path = fname,expLst = (exp :: {}),tuple_ = b,builtin = c,ty=tp,inline=inl),tv,differentiateIfExp)
case (DAE.CALL(path = fname,expLst = (exp :: {}),tuple_ = b,builtin = c,ty=tp,inlineType=inl),tv,differentiateIfExp)
local DAE.ExpType tp;
equation
isTanh(fname);
Expand All @@ -475,7 +481,7 @@ algorithm
DAE.CALL(Absyn.IDENT("cosh"),{exp},b,c,tp,inl));

/* der(cosh(x)) => der(x)sinh(x) */
case (DAE.CALL(path = fname,expLst = (exp :: {}),tuple_ = b,builtin = c,ty=tp,inline=inl),tv,differentiateIfExp)
case (DAE.CALL(path = fname,expLst = (exp :: {}),tuple_ = b,builtin = c,ty=tp,inlineType=inl),tv,differentiateIfExp)
local DAE.ExpType tp;
equation
isCosh(fname);
Expand All @@ -486,7 +492,7 @@ algorithm
DAE.CALL(Absyn.IDENT("sinh"),{exp},b,c,tp,inl));

/* der(sinh(x)) => der(x)sinh(x) */
case (DAE.CALL(path = fname,expLst = (exp :: {}),tuple_ = b,builtin = c,ty=tp,inline=inl),tv,differentiateIfExp)
case (DAE.CALL(path = fname,expLst = (exp :: {}),tuple_ = b,builtin = c,ty=tp,inlineType=inl),tv,differentiateIfExp)
local DAE.ExpType tp;
equation
isSinh(fname);
Expand All @@ -497,7 +503,7 @@ algorithm
DAE.CALL(Absyn.IDENT("cosh"),{exp},b,c,tp,inl));

/* sin(x) */
case (DAE.CALL(path = fname,expLst = (exp :: {}),tuple_ = b,builtin = c,ty=tp,inline=inl),tv,differentiateIfExp)
case (DAE.CALL(path = fname,expLst = (exp :: {}),tuple_ = b,builtin = c,ty=tp,inlineType=inl),tv,differentiateIfExp)
local DAE.ExpType tp;
equation
isSin(fname);
Expand All @@ -507,7 +513,7 @@ algorithm
DAE.BINARY(DAE.CALL(Absyn.IDENT("cos"),{exp},b,c,tp,inl),DAE.MUL(DAE.ET_REAL()),
exp_1);

case (DAE.CALL(path = fname,expLst = (exp :: {}),tuple_ = b,builtin = c,ty=tp,inline=inl),tv,differentiateIfExp)
case (DAE.CALL(path = fname,expLst = (exp :: {}),tuple_ = b,builtin = c,ty=tp,inlineType=inl),tv,differentiateIfExp)
local DAE.ExpType tp;
equation
isCos(fname);
Expand All @@ -526,7 +532,8 @@ algorithm
e_1 = differentiateExp(e, tv,differentiateIfExp) ;
then
DAE.UNARY(DAE.UMINUS(DAE.ET_REAL()),DAE.BINARY(e_1,DAE.DIV(DAE.ET_REAL()),
DAE.CALL(Absyn.IDENT("sqrt"),{DAE.BINARY(DAE.RCONST(1.0),DAE.SUB(DAE.ET_REAL()),DAE.BINARY(e,DAE.MUL(DAE.ET_REAL()),e))},false,true,DAE.ET_REAL(),false)));
DAE.CALL(Absyn.IDENT("sqrt"),{DAE.BINARY(DAE.RCONST(1.0),DAE.SUB(DAE.ET_REAL()),DAE.BINARY(e,DAE.MUL(DAE.ET_REAL()),e))},
false,true,DAE.ET_REAL(),DAE.NO_INLINE())));

// der(arcsin(x)) = der(x)/sqrt(1-x^2)
case (DAE.CALL(path = fname,expLst = {e}),tv,differentiateIfExp)
Expand All @@ -536,7 +543,8 @@ algorithm
e_1 = differentiateExp(e, tv,differentiateIfExp) ;
then
DAE.BINARY(e_1,DAE.DIV(DAE.ET_REAL()),
DAE.CALL(Absyn.IDENT("sqrt"),{DAE.BINARY(DAE.RCONST(1.0),DAE.SUB(DAE.ET_REAL()),DAE.BINARY(e,DAE.MUL(DAE.ET_REAL()),e))},false,true,DAE.ET_REAL(),false));
DAE.CALL(Absyn.IDENT("sqrt"),{DAE.BINARY(DAE.RCONST(1.0),DAE.SUB(DAE.ET_REAL()),DAE.BINARY(e,DAE.MUL(DAE.ET_REAL()),e))},
false,true,DAE.ET_REAL(),DAE.NO_INLINE()));

// der(arctan(x)) = der(x)/1+x^2
case (DAE.CALL(path = fname,expLst = {e}),tv,differentiateIfExp)
Expand All @@ -547,7 +555,7 @@ algorithm
then
DAE.BINARY(e_1,DAE.DIV(DAE.ET_REAL()),DAE.BINARY(DAE.RCONST(1.0),DAE.ADD(DAE.ET_REAL()),DAE.BINARY(e,DAE.MUL(DAE.ET_REAL()),e)));

case (DAE.CALL(path = fname,expLst = (exp :: {}),tuple_ = b,builtin = c,ty=tp,inline=inl),tv,differentiateIfExp)
case (DAE.CALL(path = fname,expLst = (exp :: {}),tuple_ = b,builtin = c,ty=tp,inlineType=inl),tv,differentiateIfExp)
local DAE.ExpType tp;
equation
isExp(fname) "exp(x) => x\' exp(x)" ;
Expand All @@ -565,7 +573,7 @@ algorithm
DAE.BINARY(exp_1,DAE.MUL(DAE.ET_REAL()),
DAE.BINARY(DAE.RCONST(1.0),DAE.DIV(DAE.ET_REAL()),exp));

case (DAE.CALL(path = fname,expLst = (exp :: {}),tuple_ = b,builtin = c,ty=tp,inline=inl),tv,differentiateIfExp)
case (DAE.CALL(path = fname,expLst = (exp :: {}),tuple_ = b,builtin = c,ty=tp,inlineType=inl),tv,differentiateIfExp)
local DAE.ExpType tp;
equation
isLog10(fname) "log10(x) => x\'1/(xlog(10))" ;
Expand All @@ -577,7 +585,7 @@ algorithm
DAE.BINARY(exp,DAE.MUL(DAE.ET_REAL()),
DAE.CALL(Absyn.IDENT("log"),{DAE.RCONST(10.0)},b,c,tp,inl))));

case (DAE.CALL(path = fname,expLst = (exp :: {}),tuple_ = b,builtin = c,ty=tp,inline=inl),tv,differentiateIfExp)
case (DAE.CALL(path = fname,expLst = (exp :: {}),tuple_ = b,builtin = c,ty=tp,inlineType=inl),tv,differentiateIfExp)
local DAE.ExpType tp;
equation
isSqrt(fname) "sqrt(x) => 1(2 sqrt(x)) der(x)" ;
Expand All @@ -589,7 +597,7 @@ algorithm
DAE.BINARY(DAE.RCONST(2.0),DAE.MUL(DAE.ET_REAL()),
DAE.CALL(Absyn.IDENT("sqrt"),(exp :: {}),b,c,tp,inl))),DAE.MUL(DAE.ET_REAL()),exp_1);

case (DAE.CALL(path = fname,expLst = (exp :: {}),tuple_ = b,builtin = c,ty=tp,inline=inl),tv,differentiateIfExp)
case (DAE.CALL(path = fname,expLst = (exp :: {}),tuple_ = b,builtin = c,ty=tp,inlineType=inl),tv,differentiateIfExp)
local DAE.ExpType tp;
equation
isTan(fname) "tan x => 1/((cos x)^2)" ;
Expand Down Expand Up @@ -631,7 +639,8 @@ algorithm
DAE.RELATION(e1_1,rel,e2_1);

/* der(x) */
case (DAE.CALL(path = (a as Absyn.IDENT(name = "der")),expLst = {(exp as DAE.CREF(componentRef = cr))},tuple_ = b,builtin = c,ty=tp,inline=inl),tv,differentiateIfExp)
case (DAE.CALL(path = (a as Absyn.IDENT(name = "der")),expLst =
{(exp as DAE.CREF(componentRef = cr))},tuple_ = b,builtin = c,ty=tp,inlineType=inl),tv,differentiateIfExp)
local DAE.ExpType tp;
equation
true = Exp.crefEqual(cr, tv);
Expand All @@ -643,7 +652,7 @@ algorithm
equation
exp_1 = differentiateExp(exp, tv,differentiateIfExp);
then
DAE.BINARY(DAE.CALL(Absyn.IDENT("sign"),{exp_1},false,true,DAE.ET_INT(),false),
DAE.BINARY(DAE.CALL(Absyn.IDENT("sign"),{exp_1},false,true,DAE.ET_INT(),DAE.NO_INLINE()),
DAE.MUL(DAE.ET_REAL()),exp_1);

case (DAE.ARRAY(ty = tp,scalar = b,array = expl),tv,differentiateIfExp)
Expand Down
4 changes: 1 addition & 3 deletions Compiler/Main.mo
Expand Up @@ -1180,9 +1180,7 @@ algorithm
args_1 = RTOpts.args(args);

// we need this as we get the arguments in reverse from RTOpts.args
args_1 = listReverse(args_1);

System.addToRoots("instantiationCache", Inst.emptyInstHashTable());
args_1 = listReverse(args_1);

//Env.globalCache = fill(Env.emptyCache,1);
symbolTable = readSettings(args);
Expand Down

0 comments on commit 5bf1a88

Please sign in to comment.