Changeset e44d63b8 in OpenModelica


Ignore:
Timestamp:
2016-04-06T16:22:29+02:00 (8 years ago)
Author:
hudson <openmodelica@…>
Branches:
Added-citation-metadata, maintenance/v1.14, maintenance/v1.15, maintenance/v1.16, maintenance/v1.17, maintenance/v1.18, maintenance/v1.19, maintenance/v1.20, maintenance/v1.21, maintenance/v1.22, maintenance/v1.23, master, omlib-staging
Children:
96898a5d
Parents:
df3f1c94
git-author:
Martin Sjölund <martin.sjolund@…> (04/06/16 16:22:29)
git-committer:
hudson <openmodelica@…> (04/06/16 16:22:29)
Message:

Replace HT with AvlSet in InstExtends

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Compiler/FrontEnd/InstExtends.mo

    r98214dc re44d63b8  
    4646public import DAE;
    4747public import FCore;
    48 public import HashTableStringToPath;
    4948public import InnerOuter;
    5049public import SCode;
     
    5251
    5352// protected imports
    54 protected import BaseHashTable;
     53protected import AvlSetString;
    5554protected import ComponentReference;
    5655protected import Debug;
     
    115114        list<SCode.AlgorithmSection> alg1, ialg1, alg2, ialg2;
    116115        DAE.Mod mod;
    117         HashTableStringToPath.HashTable ht;
    118         list<HashTableStringToPath.HashTable> lht;
     116        AvlSetString.Tree tree;
    119117        array<FCore.Cache> cacheArr;
    120118        Boolean htHasEntries;
     
    163161          els1 := updateElementListVisibility(els1, el.visibility);
    164162
    165           // Build a hashtable with the constant elements from the extends scope.
    166           ht := HashTableStringToPath.emptyHashTableSized(BaseHashTable.lowBucketSize);
    167           ht := getLocalIdentList(InstUtil.constantAndParameterEls(inElementsFromExtendsScope),
    168             ht, getLocalIdentElement);
    169           ht := getLocalIdentList(InstUtil.constantAndParameterEls(els1), ht, getLocalIdentElement);
     163          // Build a set with the constant elements from the extends scope.
     164          tree := AvlSetString.new();
     165          tree := getLocalIdentList(InstUtil.constantAndParameterEls(inElementsFromExtendsScope),
     166            tree, getLocalIdentElement);
     167          tree := getLocalIdentList(InstUtil.constantAndParameterEls(els1), tree, getLocalIdentElement);
    170168
    171169          // Fully qualify modifiers in extends in the extends environment.
    172170          cacheArr := arrayCreate(1, outCache);
    173           emod := fixModifications(cacheArr, inEnv, emod, {ht});
     171          emod := fixModifications(cacheArr, inEnv, emod, tree);
    174172
    175173          cenv := FGraph.openScope(cenv, encf, cn, FGraph.classInfToScopeType(inState));
     
    193191              rest_els, clsext_els, els1, inState, inClassName, inImpl, inPartialInst);
    194192
    195           ht := HashTableStringToPath.emptyHashTableSized(BaseHashTable.lowBucketSize);
    196           ht := getLocalIdentList(els2, ht, getLocalIdentElementTpl);
    197           ht := getLocalIdentList(cdef_els, ht, getLocalIdentElement);
    198           ht := getLocalIdentList(import_els, ht, getLocalIdentElement);
    199           htHasEntries := BaseHashTable.hashTableCurrentSize(ht)<>0;
    200           lht := {ht};
     193          tree := AvlSetString.new();
     194          tree := getLocalIdentList(els2, tree, getLocalIdentElementTpl);
     195          tree := getLocalIdentList(cdef_els, tree, getLocalIdentElement);
     196          tree := getLocalIdentList(import_els, tree, getLocalIdentElement);
     197          htHasEntries := not AvlSetString.isEmpty(tree);
    201198
    202199          arrayUpdate(cacheArr, 1, outCache);
    203200          if htHasEntries then
    204             els2 := fixList(cacheArr, cenv, els2, lht, fixLocalIdent);
     201            els2 := fixList(cacheArr, cenv, els2, tree, fixLocalIdent);
    205202          end if;
    206203          // Update components with new merged modifiers.
     
    215212          if not inPartialInst then
    216213            if htHasEntries then
    217               eq1 := fixList(cacheArr, cenv,   eq1, lht, fixEquation);
    218               ieq1 := fixList(cacheArr, cenv,  ieq1, lht, fixEquation);
    219               alg1 := fixList(cacheArr, cenv,  alg1, lht, fixAlgorithm);
    220               ialg1 := fixList(cacheArr, cenv, ialg1, lht, fixAlgorithm);
     214              eq1 := fixList(cacheArr, cenv,   eq1, tree, fixEquation);
     215              ieq1 := fixList(cacheArr, cenv,  ieq1, tree, fixEquation);
     216              alg1 := fixList(cacheArr, cenv,  alg1, tree, fixAlgorithm);
     217              ialg1 := fixList(cacheArr, cenv, ialg1, tree, fixAlgorithm);
    221218            end if;
    222219            outNormalEqs := List.unionAppendListOnTrue(listReverse(eq1), outNormalEqs, valueEq);
     
    811808"
    812809  input list<Type_A> ielts;
    813   input HashTableStringToPath.HashTable inHt;
     810  input output AvlSetString.Tree tree;
    814811  input getIdentFn getIdent;
    815   output HashTableStringToPath.HashTable outHt = inHt;
    816812
    817813  replaceable type Type_A subtypeof Any;
    818814  partial function getIdentFn
    819815    input Type_A inA;
    820     input HashTableStringToPath.HashTable inHt;
    821     output HashTableStringToPath.HashTable outHt;
     816    input output AvlSetString.Tree tree;
    822817  end getIdentFn;
    823818algorithm
    824819  for elt in ielts loop
    825     outHt := getIdent(elt, outHt);
     820    tree := getIdent(elt, tree);
    826821  end for;
    827822end getLocalIdentList;
     
    832827"
    833828  input tuple<SCode.Element,DAE.Mod,Boolean> eltTpl;
    834   input HashTableStringToPath.HashTable ht;
    835   output HashTableStringToPath.HashTable outHt;
     829  input output AvlSetString.Tree tree;
    836830protected
    837831  SCode.Element elt;
    838832algorithm
    839833  (elt, _, _) := eltTpl;
    840   outHt := getLocalIdentElement(elt, ht);
     834  tree := getLocalIdentElement(elt, tree);
    841835end getLocalIdentElementTpl;
    842836
     
    845839  as well as aliases from imports to paths."
    846840  input SCode.Element elt;
    847   input HashTableStringToPath.HashTable inHt;
    848   output HashTableStringToPath.HashTable outHt;
    849 algorithm
    850   (outHt) := matchcontinue elt
     841  input output AvlSetString.Tree tree;
     842algorithm
     843  tree := match elt
    851844    local
    852845      String id;
    853       Absyn.Path p;
    854846
    855847    case SCode.COMPONENT(name = id)
    856       then BaseHashTable.add((id,Absyn.IDENT(id)), inHt);
     848      then AvlSetString.add(tree, id);
    857849
    858850    case SCode.CLASS(name = id)
    859       then BaseHashTable.add((id,Absyn.IDENT(id)), inHt);
    860 
    861     case SCode.IMPORT(imp = Absyn.NAMED_IMPORT(name = id, path = p))
    862       then BaseHashTable.addUnique((id, p), inHt);
    863 
    864     case SCode.IMPORT(imp = Absyn.QUAL_IMPORT(path = p))
    865       then BaseHashTable.addUnique((Absyn.pathLastIdent(p), p), inHt);
    866 
    867     // adrpo: 2010-10-07 handle unqualified imports!!! TODO! FIXME! should we just ignore them??
    868     //                   this fixes bug: #1234 https://openmodelica.org:8443/cb/issue/1234
    869     case SCode.IMPORT(imp = Absyn.UNQUAL_IMPORT(path = p))
    870       then BaseHashTable.addUnique((Absyn.pathLastIdent(p), p), inHt);
    871 
    872     else inHt;
    873   end matchcontinue;
     851      then AvlSetString.add(tree, id);
     852
     853    else tree;
     854  end match;
    874855end getLocalIdentElement;
    875856
     
    881862  input FCore.Graph inEnv;
    882863  input output tuple<SCode.Element,DAE.Mod,Boolean> elt;
    883   input list<HashTableStringToPath.HashTable> inHt;
     864  input AvlSetString.Tree tree;
    884865protected
    885866  SCode.Element elt1,elt2;
     
    888869algorithm
    889870  (elt1, mod, b) := elt;
    890   elt2 := fixElement(inCache, inEnv, elt1, inHt);
     871  elt2 := fixElement(inCache, inEnv, elt1, tree);
    891872  if (not referenceEq(elt1, elt2)) or not b then
    892873    elt := (elt2, mod, true);
     
    902883  input FCore.Graph inEnv;
    903884  input SCode.Element inElt;
    904   input list<HashTableStringToPath.HashTable> inHt;
     885  input AvlSetString.Tree tree;
    905886  output SCode.Element outElts;
    906887algorithm
    907   outElts := matchcontinue (inEnv,inElt,inHt)
     888  outElts := matchcontinue (inEnv,inElt)
    908889    local
    909890      String name;
     
    928909      FCore.Cache cache;
    929910      FCore.Graph env;
    930       list<HashTableStringToPath.HashTable> ht;
    931911      SCode.Element elt;
    932912
    933913    case (env,SCode.COMPONENT(name, prefixes as SCode.PREFIXES(replaceablePrefix = SCode.REPLACEABLE(_)),
    934                                     SCode.ATTR(ad, ct, prl, var, dir, isf), typeSpec, modifications, comment, condition, info),ht)
     914                                    SCode.ATTR(ad, ct, prl, var, dir, isf), typeSpec, modifications, comment, condition, info))
    935915      equation
    936916        //fprintln(Flags.DEBUG,"fix comp " + SCodeDump.unparseElementStr(elt,SCodeDump.defaultOptions));
     
    938918        (_, _, SCode.COMPONENT(name, prefixes, SCode.ATTR(ad, ct, prl, var, dir), typeSpec, modifications, comment, condition, info),
    939919         _, _, _) = Lookup.lookupIdentLocal(arrayGet(inCache, 1), env, name);
    940         modifications = fixModifications(inCache,env,modifications,ht);
    941         typeSpec = fixTypeSpec(inCache,env,typeSpec,ht);
    942         ad = fixArrayDim(inCache, env, ad, ht);
     920        modifications = fixModifications(inCache,env,modifications,tree);
     921        typeSpec = fixTypeSpec(inCache,env,typeSpec,tree);
     922        ad = fixArrayDim(inCache, env, ad, tree);
    943923      then
    944924        (SCode.COMPONENT(name, prefixes, SCode.ATTR(ad, ct, prl, var, dir, isf), typeSpec, modifications, comment, condition, info));
    945925
    946926    // we failed above
    947     case (env,SCode.COMPONENT(name, prefixes, SCode.ATTR(ad, ct, prl, var, dir, isf), typeSpec, modifications, comment, condition, info),ht)
     927    case (env,SCode.COMPONENT(name, prefixes, SCode.ATTR(ad, ct, prl, var, dir, isf), typeSpec, modifications, comment, condition, info))
    948928      equation
    949929        //fprintln(Flags.DEBUG,"fix comp " + SCodeDump.unparseElementStr(elt,SCodeDump.defaultOptions));
    950         modifications = fixModifications(inCache,env,modifications,ht);
    951         typeSpec = fixTypeSpec(inCache,env,typeSpec,ht);
    952         ad = fixArrayDim(inCache, env, ad, ht);
     930        modifications = fixModifications(inCache,env,modifications,tree);
     931        typeSpec = fixTypeSpec(inCache,env,typeSpec,tree);
     932        ad = fixArrayDim(inCache, env, ad, tree);
    953933      then
    954934        (SCode.COMPONENT(name, prefixes, SCode.ATTR(ad, ct, prl, var, dir, isf), typeSpec, modifications, comment, condition, info));
    955935
    956936    case (env,SCode.CLASS(name, prefixes as SCode.PREFIXES(replaceablePrefix = SCode.REPLACEABLE(_)),
    957                                 SCode.ENCAPSULATED(), partialPrefix, restriction, classDef, comment, info),ht)
     937                                SCode.ENCAPSULATED(), partialPrefix, restriction, classDef, comment, info))
    958938      equation
    959939        //fprintln(Flags.DEBUG,"fixClassdef " + name);
     
    962942                     cmt = comment, info = info,classDef=classDef),_) = Lookup.lookupClassLocal(env, name);
    963943        env = FGraph.openScope(env, SCode.ENCAPSULATED(), name, FGraph.restrictionToScopeType(restriction));
    964         classDef = fixClassdef(inCache, env,classDef,ht);
     944        classDef = fixClassdef(inCache, env,classDef,tree);
    965945      then
    966946        (SCode.CLASS(name, prefixes, SCode.ENCAPSULATED(), partialPrefix, restriction, classDef, comment, info));
    967947
    968948    // failed above
    969     case (env,SCode.CLASS(name, prefixes, SCode.ENCAPSULATED(), partialPrefix, restriction, classDef, comment, info),ht)
     949    case (env,SCode.CLASS(name, prefixes, SCode.ENCAPSULATED(), partialPrefix, restriction, classDef, comment, info))
    970950      equation
    971951        //fprintln(Flags.DEBUG,"fixClassdef " + name);
    972952        env = FGraph.openScope(env, SCode.ENCAPSULATED(), name, FGraph.restrictionToScopeType(restriction));
    973         classDef = fixClassdef(inCache, env,classDef,ht);
     953        classDef = fixClassdef(inCache, env,classDef,tree);
    974954      then
    975955        (SCode.CLASS(name, prefixes, SCode.ENCAPSULATED(), partialPrefix, restriction, classDef, comment, info));
    976956
    977957    case (env,SCode.CLASS(name, prefixes as SCode.PREFIXES(replaceablePrefix = SCode.REPLACEABLE(_)),
    978                                 SCode.NOT_ENCAPSULATED(), partialPrefix, restriction, classDef, comment, info),ht)
     958                                SCode.NOT_ENCAPSULATED(), partialPrefix, restriction, classDef, comment, info))
    979959      equation
    980960        //fprintln(Flags.DEBUG,"fixClassdef " + name + str);
     
    984964
    985965        env = FGraph.openScope(env, SCode.NOT_ENCAPSULATED(), name, FGraph.restrictionToScopeType(restriction));
    986         classDef = fixClassdef(inCache,env,classDef,ht);
     966        classDef = fixClassdef(inCache,env,classDef,tree);
    987967      then
    988968        (SCode.CLASS(name, prefixes, SCode.NOT_ENCAPSULATED(), partialPrefix, restriction, classDef, comment, info));
    989969
    990970    // failed above
    991     case (env,SCode.CLASS(name, prefixes, SCode.NOT_ENCAPSULATED(), partialPrefix, restriction, classDef, comment, info),ht)
     971    case (env,SCode.CLASS(name, prefixes, SCode.NOT_ENCAPSULATED(), partialPrefix, restriction, classDef, comment, info))
    992972      equation
    993973        //fprintln(Flags.DEBUG,"fixClassdef " + name + str);
    994974        env = FGraph.openScope(env, SCode.NOT_ENCAPSULATED(), name, FGraph.restrictionToScopeType(restriction));
    995         classDef = fixClassdef(inCache,env,classDef,ht);
     975        classDef = fixClassdef(inCache,env,classDef,tree);
    996976      then
    997977        (SCode.CLASS(name, prefixes, SCode.NOT_ENCAPSULATED(), partialPrefix, restriction, classDef, comment, info));
    998978
    999     case (env,SCode.EXTENDS(extendsPath,vis,modifications,optAnnotation,info),ht)
     979    case (env,SCode.EXTENDS(extendsPath,vis,modifications,optAnnotation,info))
    1000980      equation
    1001981        //fprintln(Flags.DEBUG,"fix extends " + SCodeDump.unparseElementStr(elt,SCodeDump.defaultOptions));
    1002         extendsPath = fixPath(inCache,env,extendsPath,ht);
    1003         modifications = fixModifications(inCache,env,modifications,ht);
     982        extendsPath = fixPath(inCache,env,extendsPath,tree);
     983        modifications = fixModifications(inCache,env,modifications,tree);
    1004984      then
    1005985        (SCode.EXTENDS(extendsPath,vis,modifications,optAnnotation,info));
    1006986
    1007     case (_,SCode.IMPORT(),_) then inElt;
    1008 
    1009     case (_,elt,_)
     987    case (_,SCode.IMPORT()) then inElt;
     988
     989    case (_,elt)
    1010990      equation
    1011991        true = Flags.isSet(Flags.FAILTRACE);
     
    10231003  input FCore.Graph inEnv;
    10241004  input SCode.ClassDef inCd;
    1025   input list<HashTableStringToPath.HashTable> inHt;
     1005  input AvlSetString.Tree inTree;
    10261006  output SCode.ClassDef outCd;
    1027 algorithm
    1028   outCd := matchcontinue (inEnv,inCd,inHt)
     1007protected
     1008  AvlSetString.Tree tree=inTree;
     1009algorithm
     1010  outCd := matchcontinue (inEnv,inCd)
    10291011    local
    1030       list<SCode.Element> elts;
    1031       list<SCode.Equation> ne,ie;
    1032       list<SCode.AlgorithmSection> na,ia;
    1033       list<SCode.ConstraintSection> nc;
     1012      list<SCode.Element> elts,elts_1;
     1013      list<SCode.Equation> ne,ne_1,ie,ie_1;
     1014      list<SCode.AlgorithmSection> na,na_1,ia,ia_1;
     1015      list<SCode.ConstraintSection> nc,nc_1;
    10341016      list<Absyn.NamedArg> clats;
    10351017      Option<SCode.ExternalDecl> ed;
    10361018      list<SCode.Annotation> ann;
    10371019      Option<SCode.Comment> c;
    1038       Absyn.TypeSpec ts;
     1020      Absyn.TypeSpec ts,ts_1;
    10391021      SCode.Attributes attr;
    10401022      String name;
    1041       SCode.Mod mod;
     1023      SCode.Mod mod,mod_1;
    10421024      FCore.Graph env;
    1043       list<HashTableStringToPath.HashTable> ht;
    1044       HashTableStringToPath.HashTable cls_ht;
    1045       SCode.ClassDef cd;
    1046 
    1047     case (env,SCode.PARTS(elts,ne,ie,na,ia,nc,clats,ed),ht)
     1025      SCode.ClassDef cd,cd_1;
     1026
     1027    case (env,SCode.PARTS(elts,ne,ie,na,ia,nc,clats,ed))
    10481028      algorithm
    1049         if not listEmpty(elts) then
    1050           cls_ht := HashTableStringToPath.emptyHashTableSized(Util.nextPrime(listLength(elts)));
    1051           cls_ht := getLocalIdentList(elts, cls_ht, getLocalIdentElement);
    1052           ht := cls_ht :: ht;
    1053         end if;
    1054 
    1055         elts := fixList(cache,env,elts,ht,fixElement);
    1056         ne := fixList(cache,env,ne,ht,fixEquation);
    1057         ie := fixList(cache,env,ie,ht,fixEquation);
    1058         na := fixList(cache,env,na,ht,fixAlgorithm);
    1059         ia := fixList(cache,env,ia,ht,fixAlgorithm);
    1060         nc := fixList(cache,env,nc,ht,fixConstraint);
    1061       then SCode.PARTS(elts,ne,ie,na,ia,nc,clats,ed);
    1062 
    1063     case (env,SCode.CLASS_EXTENDS(name,mod,SCode.PARTS(elts,ne,ie,na,ia,nc,clats,ed)),ht)
    1064       equation
    1065         mod = fixModifications(cache,env,mod,ht);
    1066         elts = fixList(cache,env,elts,ht,fixElement);
    1067         ne = fixList(cache,env,ne,ht,fixEquation);
    1068         ie = fixList(cache,env,ie,ht,fixEquation);
    1069         na = fixList(cache,env,na,ht,fixAlgorithm);
    1070         ia = fixList(cache,env,ia,ht,fixAlgorithm);
    1071         nc = fixList(cache,env,nc,ht,fixConstraint);
    1072       then (SCode.CLASS_EXTENDS(name,mod,SCode.PARTS(elts,ne,ie,na,ia,nc,clats,ed)));
    1073 
    1074     case (env,SCode.DERIVED(ts,mod,attr),ht)
    1075       equation
    1076         ts = fixTypeSpec(cache,env,ts,ht);
    1077         mod = fixModifications(cache,env,mod,ht);
    1078       then SCode.DERIVED(ts,mod,attr);
    1079 
    1080     case (_,cd as SCode.ENUMERATION(),_) then cd;
    1081     case (_,cd as SCode.OVERLOAD(),_) then cd;
    1082     case (_,cd as SCode.PDER(),_) then cd;
    1083 
    1084     case (_,cd,_)
     1029        tree := getLocalIdentList(elts, tree, getLocalIdentElement);
     1030        elts_1 := fixList(cache,env,elts,tree,fixElement);
     1031        ne_1 := fixList(cache,env,ne,tree,fixEquation);
     1032        ie_1 := fixList(cache,env,ie,tree,fixEquation);
     1033        na_1 := fixList(cache,env,na,tree,fixAlgorithm);
     1034        ia_1 := fixList(cache,env,ia,tree,fixAlgorithm);
     1035        nc_1 := fixList(cache,env,nc,tree,fixConstraint);
     1036      then if referenceEq(elts,elts_1) and referenceEq(ne,ne_1) and referenceEq(ie,ie_1) and referenceEq(na,na_1) and referenceEq(ia,ia_1) and referenceEq(nc,nc_1)
     1037           then inCd else SCode.PARTS(elts_1,ne_1,ie_1,na_1,ia_1,nc_1,clats,ed);
     1038
     1039    case (env,SCode.CLASS_EXTENDS(name,mod,cd as SCode.PARTS(elts,ne,ie,na,ia,nc,clats,ed)))
     1040      equation
     1041        mod_1 = fixModifications(cache,env,mod,inTree);
     1042        elts_1 = fixList(cache,env,elts,tree,fixElement);
     1043        ne_1 = fixList(cache,env,ne,tree,fixEquation);
     1044        ie_1 = fixList(cache,env,ie,tree,fixEquation);
     1045        na_1 = fixList(cache,env,na,tree,fixAlgorithm);
     1046        ia_1 = fixList(cache,env,ia,tree,fixAlgorithm);
     1047        nc_1 = fixList(cache,env,nc,tree,fixConstraint);
     1048        cd_1 = if referenceEq(elts,elts_1) and referenceEq(ne,ne_1) and referenceEq(ie,ie_1) and referenceEq(na,na_1) and referenceEq(ia,ia_1) and referenceEq(nc,nc_1)
     1049             then cd else SCode.PARTS(elts_1,ne_1,ie_1,na_1,ia_1,nc_1,clats,ed);
     1050      then if referenceEq(cd,cd_1) and referenceEq(mod,mod_1)
     1051           then inCd else SCode.CLASS_EXTENDS(name,mod_1,cd_1);
     1052
     1053    case (env,SCode.DERIVED(ts,mod,attr))
     1054      equation
     1055        ts_1 = fixTypeSpec(cache,env,ts,tree);
     1056        mod_1 = fixModifications(cache,env,mod,tree);
     1057      then if referenceEq(ts,ts_1) and referenceEq(mod,mod_1) then inCd else SCode.DERIVED(ts_1,mod_1,attr);
     1058
     1059    case (_,cd as SCode.ENUMERATION()) then cd;
     1060    case (_,cd as SCode.OVERLOAD()) then cd;
     1061    case (_,cd as SCode.PDER()) then cd;
     1062
     1063    case (_,cd)
    10851064      equation
    10861065        true = Flags.isSet(Flags.FAILTRACE);
     
    11001079  input FCore.Graph inEnv;
    11011080  input SCode.Equation inEq;
    1102   input list<HashTableStringToPath.HashTable> inHt;
     1081  input AvlSetString.Tree tree;
    11031082  output SCode.Equation outEq;
    11041083algorithm
     
    11091088    case SCode.EQUATION(eeq)
    11101089      algorithm
    1111         eeq := fixEEquation(inCache, inEnv, eeq, inHt);
     1090        eeq := fixEEquation(inCache, inEnv, eeq, tree);
    11121091      then SCode.EQUATION(eeq);
    11131092
     
    11281107  input FCore.Graph inEnv;
    11291108  input SCode.EEquation inEeq;
    1130   input list<HashTableStringToPath.HashTable> inHt;
     1109  input AvlSetString.Tree tree;
    11311110  output SCode.EEquation outEeq;
    11321111algorithm
     
    11461125    case SCode.EQ_IF(expl,eqll,eql,comment,info)
    11471126      equation
    1148         expl = fixList(cache,inEnv,expl,inHt,fixExp);
    1149         eqll = fixListList(cache,inEnv,eqll,inHt,fixEEquation);
    1150         eql = fixList(cache,inEnv,eql,inHt,fixEEquation);
     1127        expl = fixList(cache,inEnv,expl,tree,fixExp);
     1128        eqll = fixListList(cache,inEnv,eqll,tree,fixEEquation);
     1129        eql = fixList(cache,inEnv,eql,tree,fixEEquation);
    11511130      then (SCode.EQ_IF(expl,eqll,eql,comment,info));
    11521131    case SCode.EQ_EQUALS(exp1,exp2,comment,info)
    11531132      equation
    1154         exp1 = fixExp(cache,inEnv,exp1,inHt);
    1155         exp2 = fixExp(cache,inEnv,exp2,inHt);
     1133        exp1 = fixExp(cache,inEnv,exp1,tree);
     1134        exp2 = fixExp(cache,inEnv,exp2,tree);
    11561135      then (SCode.EQ_EQUALS(exp1,exp2,comment,info));
    11571136    case SCode.EQ_PDE(exp1,exp2,cref,comment,info)
    11581137      equation
    1159         exp1 = fixExp(cache,inEnv,exp1,inHt);
    1160         exp2 = fixExp(cache,inEnv,exp2,inHt);
    1161         cref = fixCref(cache,inEnv,cref,inHt);
     1138        exp1 = fixExp(cache,inEnv,exp1,tree);
     1139        exp2 = fixExp(cache,inEnv,exp2,tree);
     1140        cref = fixCref(cache,inEnv,cref,tree);
    11621141      then (SCode.EQ_PDE(exp1,exp2,cref,comment,info));
    11631142    case SCode.EQ_CONNECT(cref1,cref2,comment,info)
    11641143      equation
    1165         cref1 = fixCref(cache,inEnv,cref1,inHt);
    1166         cref2 = fixCref(cache,inEnv,cref2,inHt);
     1144        cref1 = fixCref(cache,inEnv,cref1,tree);
     1145        cref2 = fixCref(cache,inEnv,cref2,tree);
    11671146      then (SCode.EQ_CONNECT(cref1,cref2,comment,info));
    11681147    case SCode.EQ_FOR(id,optExp,eql,comment,info)
    11691148      equation
    1170         optExp = fixOption(cache,inEnv,optExp,inHt,fixExp);
    1171         eql = fixList(cache,inEnv,eql,inHt,fixEEquation);
     1149        optExp = fixOption(cache,inEnv,optExp,tree,fixExp);
     1150        eql = fixList(cache,inEnv,eql,tree,fixEEquation);
    11721151      then (SCode.EQ_FOR(id,optExp,eql,comment,info));
    11731152    case SCode.EQ_WHEN(exp,eql,whenlst,comment,info)
    11741153      equation
    1175         exp = fixExp(cache,inEnv,exp,inHt);
    1176         eql = fixList(cache,inEnv,eql,inHt,fixEEquation);
    1177         whenlst = fixListTuple2(cache,inEnv,whenlst,inHt,fixExp,fixListEEquation);
     1154        exp = fixExp(cache,inEnv,exp,tree);
     1155        eql = fixList(cache,inEnv,eql,tree,fixEEquation);
     1156        whenlst = fixListTuple2(cache,inEnv,whenlst,tree,fixExp,fixListEEquation);
    11781157      then (SCode.EQ_WHEN(exp,eql,whenlst,comment,info));
    11791158    case SCode.EQ_ASSERT(exp1,exp2,exp3,comment,info)
    11801159      equation
    1181         exp1 = fixExp(cache,inEnv,exp1,inHt);
    1182         exp2 = fixExp(cache,inEnv,exp2,inHt);
    1183         exp3 = fixExp(cache,inEnv,exp3,inHt);
     1160        exp1 = fixExp(cache,inEnv,exp1,tree);
     1161        exp2 = fixExp(cache,inEnv,exp2,tree);
     1162        exp3 = fixExp(cache,inEnv,exp3,tree);
    11841163      then (SCode.EQ_ASSERT(exp1,exp2,exp3,comment,info));
    11851164    case SCode.EQ_TERMINATE(exp,comment,info)
    11861165      equation
    1187         exp = fixExp(cache,inEnv,exp,inHt);
     1166        exp = fixExp(cache,inEnv,exp,tree);
    11881167      then (SCode.EQ_TERMINATE(exp,comment,info));
    11891168    case SCode.EQ_REINIT(cref,exp,comment,info)
    11901169      equation
    1191         cref = fixCref(cache,inEnv,cref,inHt);
    1192         exp = fixExp(cache,inEnv,exp,inHt);
     1170        cref = fixCref(cache,inEnv,cref,tree);
     1171        exp = fixExp(cache,inEnv,exp,tree);
    11931172      then (SCode.EQ_REINIT(cref,exp,comment,info));
    11941173    case SCode.EQ_NORETCALL(exp,comment,info)
    11951174      equation
    1196         exp = fixExp(cache,inEnv,exp,inHt);
     1175        exp = fixExp(cache,inEnv,exp,tree);
    11971176      then (SCode.EQ_NORETCALL(exp,comment,info));
    11981177  end match;
     
    12071186  input FCore.Graph env;
    12081187  input list<SCode.EEquation> eeq;
    1209   input list<HashTableStringToPath.HashTable> ht;
     1188  input AvlSetString.Tree tree;
    12101189  output list<SCode.EEquation> outEeq;
    12111190algorithm
    1212   outEeq := fixList(cache,env,eeq,ht,fixEEquation);
     1191  outEeq := fixList(cache,env,eeq,tree,fixEEquation);
    12131192end fixListEEquation;
    12141193
     
    12211200  input FCore.Graph inEnv;
    12221201  input SCode.AlgorithmSection inAlg;
    1223   input list<HashTableStringToPath.HashTable> inHt;
     1202  input AvlSetString.Tree tree;
    12241203  output SCode.AlgorithmSection outAlg;
    12251204protected
     
    12271206algorithm
    12281207  SCode.ALGORITHM(stmts) := inAlg;
    1229   stmts := fixList(inCache, inEnv, stmts, inHt, fixStatement);
     1208  stmts := fixList(inCache, inEnv, stmts, tree, fixStatement);
    12301209  outAlg := SCode.ALGORITHM(stmts);
    12311210end fixAlgorithm;
     
    12391218  input FCore.Graph inEnv;
    12401219  input SCode.ConstraintSection inConstrs;
    1241   input list<HashTableStringToPath.HashTable> inHt;
     1220  input AvlSetString.Tree tree;
    12421221  output SCode.ConstraintSection outConstrs;
    12431222protected
     
    12451224algorithm
    12461225  SCode.CONSTRAINTS(exps) := inConstrs;
    1247   exps := fixList(inCache, inEnv, exps, inHt, fixExp);
     1226  exps := fixList(inCache, inEnv, exps, tree, fixExp);
    12481227  outConstrs := SCode.CONSTRAINTS(exps);
    12491228end fixConstraint;
     
    12571236  input FCore.Graph env;
    12581237  input list<SCode.Statement> alg;
    1259   input list<HashTableStringToPath.HashTable> ht;
     1238  input AvlSetString.Tree tree;
    12601239  output list<SCode.Statement> outAlg;
    12611240algorithm
    1262   outAlg := fixList(cache,env,alg,ht,fixStatement);
     1241  outAlg := fixList(cache,env,alg,tree,fixStatement);
    12631242end fixListAlgorithmItem;
    12641243
     
    12711250  input FCore.Graph inEnv;
    12721251  input SCode.Statement inStmt;
    1273   input list<HashTableStringToPath.HashTable> inHt;
     1252  input AvlSetString.Tree tree;
    12741253  output SCode.Statement outStmt;
    12751254algorithm
     
    12881267    case SCode.ALG_ASSIGN(exp1,exp2,comment,info)
    12891268      equation
    1290         exp1 = fixExp(cache,inEnv,exp1,inHt);
    1291         exp2 = fixExp(cache,inEnv,exp2,inHt);
     1269        exp1 = fixExp(cache,inEnv,exp1,tree);
     1270        exp2 = fixExp(cache,inEnv,exp2,tree);
    12921271      then SCode.ALG_ASSIGN(exp1,exp2,comment,info);
    12931272
    12941273    case SCode.ALG_IF(exp,truebranch,elseifbranch,elsebranch,comment,info)
    12951274      equation
    1296         exp = fixExp(cache,inEnv,exp,inHt);
    1297         truebranch = fixList(cache,inEnv,truebranch,inHt,fixStatement);
    1298         elseifbranch = fixListTuple2(cache,inEnv,elseifbranch,inHt,fixExp,fixListAlgorithmItem);
    1299         elsebranch = fixList(cache,inEnv,elsebranch,inHt,fixStatement);
     1275        exp = fixExp(cache,inEnv,exp,tree);
     1276        truebranch = fixList(cache,inEnv,truebranch,tree,fixStatement);
     1277        elseifbranch = fixListTuple2(cache,inEnv,elseifbranch,tree,fixExp,fixListAlgorithmItem);
     1278        elsebranch = fixList(cache,inEnv,elsebranch,tree,fixStatement);
    13001279      then SCode.ALG_IF(exp,truebranch,elseifbranch,elsebranch,comment,info);
    13011280
    13021281    case SCode.ALG_FOR(iter,optExp,forbody,comment,info)
    13031282      equation
    1304         optExp = fixOption(cache,inEnv,optExp,inHt,fixExp);
    1305         forbody = fixList(cache,inEnv,forbody,inHt,fixStatement);
     1283        optExp = fixOption(cache,inEnv,optExp,tree,fixExp);
     1284        forbody = fixList(cache,inEnv,forbody,tree,fixStatement);
    13061285      then SCode.ALG_FOR(iter,optExp,forbody,comment,info);
    13071286
    13081287    case SCode.ALG_PARFOR(iter,optExp,forbody,comment,info)
    13091288      equation
    1310         optExp = fixOption(cache,inEnv,optExp,inHt,fixExp);
    1311         forbody = fixList(cache,inEnv,forbody,inHt,fixStatement);
     1289        optExp = fixOption(cache,inEnv,optExp,tree,fixExp);
     1290        forbody = fixList(cache,inEnv,forbody,tree,fixStatement);
    13121291      then SCode.ALG_PARFOR(iter,optExp,forbody,comment,info);
    13131292
    13141293    case SCode.ALG_WHILE(exp,whilebody,comment,info)
    13151294      equation
    1316         exp = fixExp(cache,inEnv,exp,inHt);
    1317         whilebody = fixList(cache,inEnv,whilebody,inHt,fixStatement);
     1295        exp = fixExp(cache,inEnv,exp,tree);
     1296        whilebody = fixList(cache,inEnv,whilebody,tree,fixStatement);
    13181297      then SCode.ALG_WHILE(exp,whilebody,comment,info);
    13191298
    13201299    case SCode.ALG_WHEN_A(whenlst,comment,info)
    13211300      equation
    1322         whenlst = fixListTuple2(cache,inEnv,whenlst,inHt,fixExp,fixListAlgorithmItem);
     1301        whenlst = fixListTuple2(cache,inEnv,whenlst,tree,fixExp,fixListAlgorithmItem);
    13231302      then SCode.ALG_WHEN_A(whenlst,comment,info);
    13241303
    13251304    case SCode.ALG_ASSERT(exp, exp1, exp2, comment, info)
    13261305      algorithm
    1327         exp := fixExp(cache, inEnv, exp, inHt);
    1328         exp1 := fixExp(cache, inEnv, exp1, inHt);
    1329         exp2 := fixExp(cache, inEnv, exp2, inHt);
     1306        exp := fixExp(cache, inEnv, exp, tree);
     1307        exp1 := fixExp(cache, inEnv, exp1, tree);
     1308        exp2 := fixExp(cache, inEnv, exp2, tree);
    13301309      then SCode.ALG_ASSERT(exp, exp1, exp2, comment, info);
    13311310
    13321311    case SCode.ALG_TERMINATE(exp, comment, info)
    13331312      algorithm
    1334         exp := fixExp(cache, inEnv, exp, inHt);
     1313        exp := fixExp(cache, inEnv, exp, tree);
    13351314      then SCode.ALG_TERMINATE(exp, comment, info);
    13361315
    13371316    case SCode.ALG_REINIT(cr, exp, comment, info)
    13381317      algorithm
    1339         cr := fixCref(cache, inEnv, cr, inHt);
    1340         exp := fixExp(cache, inEnv, exp, inHt);
     1318        cr := fixCref(cache, inEnv, cr, tree);
     1319        exp := fixExp(cache, inEnv, exp, tree);
    13411320      then SCode.ALG_REINIT(cr, exp, comment, info);
    13421321
    13431322    case SCode.ALG_NORETCALL(exp,comment,info)
    13441323      equation
    1345         exp = fixExp(cache,inEnv,exp,inHt);
     1324        exp = fixExp(cache,inEnv,exp,tree);
    13461325      then SCode.ALG_NORETCALL(exp,comment,info);
    13471326
     
    13661345  input FCore.Graph inEnv;
    13671346  input output Absyn.ArrayDim ads;
    1368   input list<HashTableStringToPath.HashTable> inHt;
    1369 algorithm
    1370   ads := fixList(inCache, inEnv, ads, inHt, fixSubscript);
     1347  input AvlSetString.Tree tree;
     1348algorithm
     1349  ads := fixList(inCache, inEnv, ads, tree, fixSubscript);
    13711350end fixArrayDim;
    13721351
     
    13791358  input FCore.Graph inEnv;
    13801359  input Absyn.Subscript inSub;
    1381   input list<HashTableStringToPath.HashTable> inHt;
     1360  input AvlSetString.Tree tree;
    13821361  output Absyn.Subscript outSub;
    13831362algorithm
     
    13891368    case Absyn.SUBSCRIPT(exp)
    13901369      algorithm
    1391         exp := fixExp(cache, inEnv, exp, inHt);
     1370        exp := fixExp(cache, inEnv, exp, tree);
    13921371      then Absyn.SUBSCRIPT(exp);
    13931372  end match;
     
    14021381  input FCore.Graph inEnv;
    14031382  input Absyn.TypeSpec inTs;
    1404   input list<HashTableStringToPath.HashTable> inHt;
     1383  input AvlSetString.Tree tree;
    14051384  output Absyn.TypeSpec outTs;
    14061385algorithm
     
    14131392    case Absyn.TPATH(path,arrayDim)
    14141393      equation
    1415         arrayDim = fixOption(cache,inEnv,arrayDim,inHt,fixArrayDim);
    1416         path = fixPath(cache,inEnv,path,inHt);
     1394        arrayDim = fixOption(cache,inEnv,arrayDim,tree,fixArrayDim);
     1395        path = fixPath(cache,inEnv,path,tree);
    14171396      then Absyn.TPATH(path,arrayDim);
    14181397    case Absyn.TCOMPLEX(path,typeSpecs,arrayDim)
    14191398      equation
    1420         arrayDim = fixOption(cache,inEnv,arrayDim,inHt,fixArrayDim);
    1421         path = fixPath(cache,inEnv,path,inHt);
    1422         typeSpecs = fixList(cache,inEnv,typeSpecs,inHt,fixTypeSpec);
     1399        arrayDim = fixOption(cache,inEnv,arrayDim,tree,fixArrayDim);
     1400        path = fixPath(cache,inEnv,path,tree);
     1401        typeSpecs = fixList(cache,inEnv,typeSpecs,tree,fixTypeSpec);
    14231402      then Absyn.TCOMPLEX(path,typeSpecs,arrayDim);
    14241403  end match;
     
    14321411  input FCore.Graph inEnv;
    14331412  input Absyn.Path inPath;
    1434   input list<HashTableStringToPath.HashTable> inHt;
     1413  input AvlSetString.Tree tree;
    14351414  output Absyn.Path outPath;
    14361415algorithm
     
    14471426      equation
    14481427        id = Absyn.pathFirstIdent(inPath);
    1449         path2 = lookupName(id, inHt);
    1450         path2 = Absyn.pathReplaceFirstIdent(inPath, path2);
    1451         path2 = FGraph.pathStripGraphScopePrefix(path2, inEnv, false);
     1428        true = AvlSetString.hasKey(tree, id);
     1429        path2 = FGraph.pathStripGraphScopePrefix(inPath, inEnv, false);
    14521430        //fprintln(Flags.DEBUG, "Replacing: " + Absyn.pathString(inPath) + " with " + Absyn.pathString(path2) + " s:" + FGraph.printGraphPathStr(inEnv));
    14531431      then path2;
     
    14811459  end matchcontinue;
    14821460end fixPath;
    1483 
    1484 protected function lookupName
    1485   input String inName;
    1486   input list<HashTableStringToPath.HashTable> inHT;
    1487   output Absyn.Path outPath;
    1488 algorithm
    1489   for ht in inHT loop
    1490     try
    1491       outPath := BaseHashTable.get(inName, ht);
    1492       return;
    1493     else
    1494     end try;
    1495   end for;
    1496   fail();
    1497 end lookupName;
    14981461
    14991462protected function lookupVarNoErrorMessage
     
    15211484  input FCore.Graph inEnv;
    15221485  input Absyn.ComponentRef inCref;
    1523   input list<HashTableStringToPath.HashTable> inHt;
     1486  input AvlSetString.Tree tree;
    15241487  output Absyn.ComponentRef outCref;
    15251488algorithm
    1526   outCref := matchcontinue (inEnv,inCref,inHt)
     1489  outCref := matchcontinue (inEnv,inCref)
    15271490    local
    15281491      String id;
     
    15301493      DAE.ComponentRef cref_;
    15311494      FCore.Graph env, denv;
    1532       list<HashTableStringToPath.HashTable> ht;
    15331495      Absyn.ComponentRef cref;
    15341496      SCode.Element c;
    15351497      Boolean isOutside;
    15361498
    1537     case (env,cref,ht)
     1499    case (env,cref)
    15381500      equation
    15391501        id = Absyn.crefFirstIdent(cref);
    1540         //fprintln(Flags.DEBUG,"Try ht lookup " + id);
    1541         path = lookupName(id, ht);
    1542         //fprintln(Flags.DEBUG,"Got path " + Absyn.pathString(path));
    1543         cref = Absyn.crefReplaceFirstIdent(cref,path);
     1502        true = AvlSetString.hasKey(tree, id);
    15441503        cref = FGraph.crefStripGraphScopePrefix(cref, env, false);
    1545         //fprintln(Flags.DEBUG, "Cref HT fixed: " + Absyn.printComponentRefStr(cref));
    15461504        cref = if Absyn.crefEqual(cref, inCref) then inCref else cref;
    15471505      then cref;
    15481506
    15491507    // try lookup var (constant in a package?)
    1550     case (env,cref,_)
     1508    case (env,cref)
    15511509      equation
    15521510        id = Absyn.crefFirstIdent(cref);
     
    15641522      then cref;
    15651523
    1566     case (env,cref,_)
     1524    case (env,cref)
    15671525      equation
    15681526        id = Absyn.crefFirstIdent(cref);
     
    15941552  input FCore.Graph inEnv;
    15951553  input SCode.Mod inMod;
    1596   input list<HashTableStringToPath.HashTable> inHT;
     1554  input AvlSetString.Tree tree;
    15971555  output SCode.Mod outMod = inMod;
    15981556algorithm
     
    16081566    case SCode.MOD()
    16091567      algorithm
    1610         subModLst := fixList(inCache, inEnv, outMod.subModLst, inHT, fixSubMod);
     1568        subModLst := fixList(inCache, inEnv, outMod.subModLst, tree, fixSubMod);
    16111569        outMod.subModLst := subModLst;
    16121570
    16131571        if isSome(outMod.binding) then
    16141572          SOME(exp) := outMod.binding;
    1615           exp := fixExp(inCache, inEnv, exp, inHT);
     1573          exp := fixExp(inCache, inEnv, exp, tree);
    16161574          outMod.binding := SOME(exp);
    16171575        end if;
     
    16201578    case SCode.REDECL(element = SCode.COMPONENT())
    16211579      algorithm
    1622         e := fixElement(inCache, inEnv, outMod.element, inHT);
     1580        e := fixElement(inCache, inEnv, outMod.element, tree);
    16231581        outMod.element := e;
    16241582      then outMod;
     
    16261584    case SCode.REDECL(element = e as SCode.CLASS(classDef = cdef))
    16271585      algorithm
    1628         cdef := fixClassdef(inCache, inEnv, cdef, inHT);
     1586        cdef := fixClassdef(inCache, inEnv, cdef, tree);
    16291587        e.classDef := cdef;
    16301588        outMod.element := e;
     
    16481606  input FCore.Graph inEnv;
    16491607  input output SCode.SubMod subMod;
    1650   input list<HashTableStringToPath.HashTable> inHt;
     1608  input AvlSetString.Tree tree;
    16511609protected
    16521610  Absyn.Ident ident;
     
    16541612algorithm
    16551613  SCode.NAMEMOD(ident, mod1) := subMod;
    1656   mod2 := fixModifications(inCache, inEnv, mod1, inHt);
     1614  mod2 := fixModifications(inCache, inEnv, mod1, tree);
    16571615  if not referenceEq(mod1, mod2) then
    16581616    subMod := SCode.NAMEMOD(ident, mod2);
     
    16681626  input FCore.Graph inEnv;
    16691627  input Absyn.Exp inExp;
    1670   input list<HashTableStringToPath.HashTable> inHt;
     1628  input AvlSetString.Tree tree;
    16711629  output Absyn.Exp outExp;
    16721630algorithm
    1673   (outExp,_) := Absyn.traverseExp(inExp,fixExpTraverse,(cache,inEnv,inHt));
     1631  (outExp,_) := Absyn.traverseExp(inExp,fixExpTraverse,(cache,inEnv,tree));
    16741632end fixExp;
    16751633
     
    16801638"
    16811639  input output Absyn.Exp exp;
    1682   input output tuple<array<FCore.Cache>,FCore.Graph,list<HashTableStringToPath.HashTable>> tpl;
     1640  input output tuple<array<FCore.Cache>,FCore.Graph,AvlSetString.Tree> tpl;
    16831641algorithm
    16841642  exp := match (exp,tpl)
     
    16891647      array<FCore.Cache> cache;
    16901648      FCore.Graph env;
    1691       list<HashTableStringToPath.HashTable> ht;
    1692 
    1693     case (Absyn.CREF(cref),(cache,env,ht))
    1694       equation
    1695         cref1 = fixCref(cache,env,cref,ht);
     1649      AvlSetString.Tree tree;
     1650
     1651    case (Absyn.CREF(cref),(cache,env,tree))
     1652      equation
     1653        cref1 = fixCref(cache,env,cref,tree);
    16961654      then (if referenceEq(cref, cref1) then exp else Absyn.CREF(cref1));
    16971655
    1698     case (Absyn.CALL(cref,fargs),(cache,env,ht))
     1656    case (Absyn.CALL(cref,fargs),(cache,env,tree))
    16991657      equation
    17001658        // print("cref actual: " + Absyn.crefString(cref) + " scope: " + FGraph.printGraphPathStr(env) + "\n");
    1701         cref1 = fixCref(cache,env,cref,ht);
     1659        cref1 = fixCref(cache,env,cref,tree);
    17021660        // print("cref fixed : " + Absyn.crefString(cref) + "\n");
    17031661      then (if referenceEq(cref, cref1) then exp else Absyn.CALL(cref1,fargs));
    17041662
    1705     case (Absyn.PARTEVALFUNCTION(cref,fargs),(cache,env,ht))
    1706       equation
    1707         cref1 = fixCref(cache,env,cref,ht);
     1663    case (Absyn.PARTEVALFUNCTION(cref,fargs),(cache,env,tree))
     1664      equation
     1665        cref1 = fixCref(cache,env,cref,tree);
    17081666      then (if referenceEq(cref, cref1) then exp else Absyn.PARTEVALFUNCTION(cref1,fargs));
    17091667
     
    17171675  input FCore.Graph inEnv;
    17181676  input Option<Type_A> inA;
    1719   input list<HashTableStringToPath.HashTable> inHt;
     1677  input AvlSetString.Tree tree;
    17201678  input FixAFn fixA;
    17211679  output Option<Type_A> outA;
     
    17251683    input FCore.Graph inEnv;
    17261684    input Type_A inA;
    1727     input list<HashTableStringToPath.HashTable> inHt;
     1685    input AvlSetString.Tree tree;
    17281686    output Type_A outTypeA;
    17291687  end FixAFn;
     
    17361694    case SOME(A1)
    17371695      equation
    1738         A2 = fixA(inCache, inEnv, A1, inHt);
     1696        A2 = fixA(inCache, inEnv, A1, tree);
    17391697      then if referenceEq(A1,A2) then inA else SOME(A2);
    17401698  end match;
     
    17461704  input FCore.Graph inEnv;
    17471705  input list<Type_A> inA;
    1748   input list<HashTableStringToPath.HashTable> inHt;
     1706  input AvlSetString.Tree tree;
    17491707  input FixAFn fixA;
    17501708  output list<Type_A> outA;
     
    17541712    input FCore.Graph inEnv;
    17551713    input Type_A inA;
    1756     input list<HashTableStringToPath.HashTable> inHt;
     1714    input AvlSetString.Tree tree;
    17571715    output Type_A outTypeA;
    17581716  end FixAFn;
     
    17621720    return;
    17631721  end if;
    1764   outA := List.mapCheckReferenceEq(inA, function fixA(inCache=inCache, inEnv=inEnv, inHt=inHt));
     1722  outA := List.mapCheckReferenceEq(inA, function fixA(inCache=inCache, inEnv=inEnv, tree=tree));
    17651723end fixList;
    17661724
     
    17701728  input FCore.Graph inEnv;
    17711729  input list<list<Type_A>> inA;
    1772   input list<HashTableStringToPath.HashTable> inHt;
     1730  input AvlSetString.Tree tree;
    17731731  input FixAFn fixA;
    17741732  output list<list<Type_A>> outA = {};
     
    17781736    input FCore.Graph inEnv;
    17791737    input Type_A inA;
    1780     input list<HashTableStringToPath.HashTable> inHt;
     1738    input AvlSetString.Tree tree;
    17811739    output Type_A outTypeA;
    17821740  end FixAFn;
     
    17871745  end if;
    17881746
    1789   outA := List.mapCheckReferenceEq(inA, function fixList(inCache=inCache, inEnv=inEnv, inHt=inHt, fixA=fixA));
     1747  outA := List.mapCheckReferenceEq(inA, function fixList(inCache=inCache, inEnv=inEnv, tree=tree, fixA=fixA));
    17901748end fixListList;
    17911749
     
    17951753  input FCore.Graph inEnv;
    17961754  input list<tuple<Type_A,Type_B>> inRest;
    1797   input list<HashTableStringToPath.HashTable> inHt;
     1755  input AvlSetString.Tree tree;
    17981756  input FixAFn fixA;
    17991757  input FixBFn fixB;
     
    18041762    input FCore.Graph inEnv;
    18051763    input Type_A inA;
    1806     input list<HashTableStringToPath.HashTable> inHt;
     1764    input AvlSetString.Tree tree;
    18071765    output Type_A outLst;
    18081766  end FixAFn;
     
    18111769    input FCore.Graph inEnv;
    18121770    input Type_B inA;
    1813     input list<HashTableStringToPath.HashTable> inHt;
     1771    input AvlSetString.Tree tree;
    18141772    output Type_B outTypeA;
    18151773  end FixBFn;
     
    18181776  Type_B b1,b2;
    18191777algorithm
    1820   outA := fixList(inCache, inEnv, inRest, inHt, function fixTuple2(fixA=fixA, fixB=fixB));
     1778  outA := fixList(inCache, inEnv, inRest, tree, function fixTuple2(fixA=fixA, fixB=fixB));
    18211779end fixListTuple2;
    18221780
     
    18261784  input FCore.Graph inEnv;
    18271785  input output tuple<Type_A,Type_B> tpl;
    1828   input list<HashTableStringToPath.HashTable> inHt;
     1786  input AvlSetString.Tree tree;
    18291787  input FixAFn fixA;
    18301788  input FixBFn fixB;
     
    18341792    input FCore.Graph inEnv;
    18351793    input Type_A inA;
    1836     input list<HashTableStringToPath.HashTable> inHt;
     1794    input AvlSetString.Tree tree;
    18371795    output Type_A outLst;
    18381796  end FixAFn;
     
    18411799    input FCore.Graph inEnv;
    18421800    input Type_B inA;
    1843     input list<HashTableStringToPath.HashTable> inHt;
     1801    input AvlSetString.Tree tree;
    18441802    output Type_B outTypeA;
    18451803  end FixBFn;
     
    18491807algorithm
    18501808  (a1, b1) := tpl;
    1851   a2 := fixA(inCache, inEnv, a1, inHt);
    1852   b2 := fixB(inCache, inEnv, b1, inHt);
     1809  a2 := fixA(inCache, inEnv, a1, tree);
     1810  b2 := fixB(inCache, inEnv, b1, tree);
    18531811  if not (referenceEq(a1,a2) and referenceEq(b1,b2)) then
    18541812    tpl := (a2, b2);
Note: See TracChangeset for help on using the changeset viewer.