Skip to content

Commit

Permalink
- Fix listMember (was listMember(lst, elt); should be listMember(elt,…
Browse files Browse the repository at this point in the history
… lst))

git-svn-id: https://openmodelica.org/svn/OpenModelica/branches/sjoelund-functiontree@6396 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Oct 17, 2010
1 parent aba5bfd commit b701941
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 21 deletions.
6 changes: 3 additions & 3 deletions Compiler/Builtin.mo
Expand Up @@ -1962,8 +1962,8 @@ protected constant tuple<DAE.TType, Option<Type_a>> list2int=(
protected constant tuple<DAE.TType, Option<Type_a>> list2boolean=(
DAE.T_FUNCTION({("x",(DAE.T_LIST((DAE.T_NOTYPE(),NONE)),NONE))},DAE.T_BOOL_DEFAULT,DAE.NO_INLINE),NONE);

protected constant tuple<DAE.TType, Option<Type_a>> listAA2boolean=(
DAE.T_FUNCTION({("lst",(DAE.T_LIST(typeA),NONE)),("el",typeA)},DAE.T_BOOL_DEFAULT,DAE.NO_INLINE),NONE);
protected constant tuple<DAE.TType, Option<Type_a>> AlistA2boolean=(
DAE.T_FUNCTION({("el",typeA),("lst",(DAE.T_LIST(typeA),NONE))},DAE.T_BOOL_DEFAULT,DAE.NO_INLINE),NONE);

protected constant tuple<DAE.TType, Option<Type_a>> boxed2any=(
DAE.T_FUNCTION({("x",typeBoxedAny)},((DAE.T_NOTYPE(),NONE)),DAE.NO_INLINE),NONE);
Expand Down Expand Up @@ -2994,7 +2994,7 @@ algorithm
env = Env.extendFrameT(env, "listAppend", listAListA2listA);
env = Env.extendFrameT(env, "listReverse", listA2listA);
env = Env.extendFrameT(env, "listLength", list2int);
env = Env.extendFrameT(env, "listMember", listAA2boolean);
env = Env.extendFrameT(env, "listMember", AlistA2boolean);
env = Env.extendFrameT(env, "listGet", listAInt2A);
env = Env.extendFrameT(env, "listNth", listAInt2A);
env = Env.extendFrameT(env, "listRest", listA2listA);
Expand Down
24 changes: 12 additions & 12 deletions Compiler/DAELow.mo
Expand Up @@ -1934,8 +1934,8 @@ algorithm
array<list<Value>> m,mt;
case (blt,(dae as DAELOW(orderedVars = v,knownVars = kv,orderedEqs = e,removedEqs = se,initialEqs = ie,arrayEqs = ae,algorithms = al)),ass1,ass2,m,mt)
equation
size = array_length(ass1) "equation_size(e) => size &" ;
arr = fill(0, size);
size = arrayLength(ass1) "equation_size(e) => size &" ;
arr = arrayCreate(size, 0);
arr_1 = markStateEquations(dae, arr, m, mt, ass1, ass2);
(blt_states,blt_no_states) = splitBlocks(blt, arr);
then
Expand Down Expand Up @@ -7260,8 +7260,8 @@ public function emptyVars
list<Option<Var>> lst;
array<Option<Var>> emptyarr;
algorithm
arr := fill({}, 10);
arr2 := fill({}, 10);
arr := arrayCreate(10, {});
arr2 := arrayCreate(10, {});
lst := Util.listFill(NONE, 10);
emptyarr := listArray(lst);
outVariables := VARIABLES(arr,arr2,VARIABLE_ARRAY(0,10,emptyarr),10,0);
Expand Down Expand Up @@ -8614,7 +8614,7 @@ algorithm
Value size;
case (ASSIGNMENTS(actualSize = size,arrOfIndices = arr))
equation
newarr = fill(0, size);
newarr = arrayCreate(size, 0);
newarr_1 = Util.arrayNCopy(arr, newarr, size);
vec = array_copy(newarr_1);
then
Expand Down Expand Up @@ -11110,7 +11110,7 @@ algorithm
rlen := intReal(len);
rlen_1 := rlen *. 1.4;
size := realInt(rlen_1);
optarr := fill(NONE, size);
optarr := arrayCreate(size, NONE());
eqn_optlst := Util.listMap(lst, Util.makeOption);
eqnarr := listArray(eqn_optlst);
newarr := Util.arrayCopy(eqnarr, optarr);
Expand Down Expand Up @@ -16131,15 +16131,15 @@ algorithm
equation
VARIABLES(crefIdxLstArr,strIdxLstArr,varArr,bucketSize,numberOfVars) = ordvars;
VARIABLE_ARRAY(n1,size1,varOptArr) = varArr;
crefIdxLstArr1 = fill({}, size1);
crefIdxLstArr1 = arrayCreate(size1, {});
crefIdxLstArr1 = Util.arrayCopy(crefIdxLstArr, crefIdxLstArr1);
strIdxLstArr1 = fill({}, size1);
strIdxLstArr1 = arrayCreate(size1, {});
strIdxLstArr1 = Util.arrayCopy(strIdxLstArr, strIdxLstArr1);
varOptArr1 = fill(NONE, size1);
varOptArr1 = arrayCreate(size1, NONE());
varOptArr1 = Util.arrayCopy(varOptArr, varOptArr1);
ordvars1 = VARIABLES(crefIdxLstArr1,strIdxLstArr1,VARIABLE_ARRAY(n1,size1,varOptArr1),bucketSize,numberOfVars);
EQUATION_ARRAY(numberOfElement = n,arrSize = size,equOptArr = arr) = eqns;
arr_1 = fill(NONE, size);
arr_1 = arrayCreate(size, NONE());
arr_1 = Util.arrayCopy(arr, arr_1);
eqns1 = EQUATION_ARRAY(n,size,arr_1);
then
Expand Down Expand Up @@ -16194,9 +16194,9 @@ algorithm
// try tearing
(residualeqns,tearingvars,tearingeqns,dlow_1,dlow1_1,m_1,mT_1,v1_1,v2_1,comp_1) = tearingSystem2(dlow,dlow1,m,mT,v1,v2,comp,tvars,{},{},{},{},crlst);
// clean v1,v2,m,mT
v2_2 = fill(0, ll);
v2_2 = arrayCreate(ll, 0);
v2_2 = Util.arrayNCopy(v2_1, v2_2,ll);
v1_2 = fill(0, ll);
v1_2 = arrayCreate(ll, 0);
v1_2 = Util.arrayNCopy(v1_1, v1_2,ll);
m_3 = incidenceMatrix(dlow1_1);
mT_3 = transposeMatrix(m_3);
Expand Down
2 changes: 1 addition & 1 deletion Compiler/Exp.mo
Expand Up @@ -13341,7 +13341,7 @@ algorithm
local
String s;
Integer x;
case DAE.DIM_UNKNOWN then ":";
case DAE.DIM_UNKNOWN() then ":";
case DAE.DIM_ENUM(enumTypeName = p)
local Absyn.Path p;
equation
Expand Down
4 changes: 2 additions & 2 deletions Compiler/TplAbsyn.mo
Expand Up @@ -5799,7 +5799,7 @@ public function fullyQualifyASTDefs
input list<ASTDef> inASTDefs;
output list<ASTDef> outFullyQualifiedASTDefs;
algorithm
outFullyQualifiedASTDef := matchcontinue inASTDefs
outFullyQualifiedASTDefs := matchcontinue inASTDefs
local
list<tuple<Ident, TypeInfo>> typeLst;
PathIdent importckg;
Expand Down Expand Up @@ -6065,7 +6065,7 @@ public function fullyQualifyTemplateTypeSignature

output TypeSignature outFullyQualifiedTypeSignature;
algorithm
outASTDefTypeSignature := matchcontinue (inTemplateTypeSignature, inASTDefs)
outFullyQualifiedTypeSignature := matchcontinue (inTemplateTypeSignature, inASTDefs)
local
list<TypeSignature> typeLst;
Ident typeident;
Expand Down
2 changes: 1 addition & 1 deletion Compiler/TplMain.mo
Expand Up @@ -105,7 +105,7 @@ public function testStringEquality

output Integer outNotPassedCnt;
algorithm
outPassed := matchcontinue (inStringReturned, inStringShouldBe, inPrintResult, inPrintErrorBuffer, inTestLabel, inNotPassedCnt)
outNotPassedCnt := matchcontinue (inStringReturned, inStringShouldBe, inPrintResult, inPrintErrorBuffer, inTestLabel, inNotPassedCnt)
local
// Tpl.Tokens toks, txttoks;
String strRet, strShouldBe, strLabel, strRes, strErrBuf;
Expand Down
2 changes: 1 addition & 1 deletion Compiler/Util.mo
Expand Up @@ -1507,7 +1507,7 @@ function listMap2_tail
input Type_b inTypeB;
input Type_c inTypeC;
input list<Type_d> accumulator;
output list<Type_d> outTypeDLst;
output list<Type_d> outLst;
replaceable type Type_a subtypeof Any;
partial function FuncTypeType_aType_bType_cToType_d
input Type_a inTypeA;
Expand Down
2 changes: 1 addition & 1 deletion c_runtime/meta_modelica_builtin.cpp
Expand Up @@ -558,7 +558,7 @@ listLength_rettype listLength(modelica_metatype lst)
return res;
}

listMember_rettype listMember(modelica_metatype lst, modelica_metatype obj)
listMember_rettype listMember(modelica_metatype obj, modelica_metatype lst)
{
while (!MMC_NILTEST(lst))
{
Expand Down

0 comments on commit b701941

Please sign in to comment.