diff --git a/.gitignore b/.gitignore index 508701febca..065d7fceba4 100644 --- a/.gitignore +++ b/.gitignore @@ -106,6 +106,7 @@ Compiler/Script/OpenModelicaScriptingAPIQt.h Compiler/Template/AbsynDumpTpl.mo Compiler/Template/CodegenAdevs.mo Compiler/Template/CodegenC.mo +Compiler/Template/CodegenCFunctions.mo Compiler/Template/CodegenC.mo.log Compiler/Template/CodegenCSharp.mo Compiler/Template/CodegenCpp.mo @@ -116,6 +117,7 @@ Compiler/Template/CodegenFMU1.mo Compiler/Template/CodegenFMU2.mo Compiler/Template/CodegenFMUCommon.mo Compiler/Template/CodegenFMUCpp.mo +Compiler/Template/CodegenFMUCppHpcom.mo Compiler/Template/CodegenJS.mo Compiler/Template/CodegenJava.mo Compiler/Template/CodegenModelica.mo diff --git a/Compiler/BackEnd/BackendDAE.mo b/Compiler/BackEnd/BackendDAE.mo index 9733fcfe06c..00e604bb7ad 100644 --- a/Compiler/BackEnd/BackendDAE.mo +++ b/Compiler/BackEnd/BackendDAE.mo @@ -126,9 +126,16 @@ uniontype Shared "Data shared for all equation-systems" BackendDAEType backendDAEType "indicate for what the BackendDAE is used"; SymbolicJacobians symjacs "Symbolic Jacobians"; ExtraInfo info "contains extra info that we send around like the model name"; + PartitionsInfo partitionsInfo; end SHARED; end Shared; +uniontype PartitionsInfo + record PARTITIONS_INFO + array<.DAE.ClockKind> clocks; + end PARTITIONS_INFO; +end PartitionsInfo; + uniontype ExtraInfo "extra information that we should send around with the DAE" record EXTRA_INFO "extra information that we should send around with the DAE" String description "the model description string"; @@ -536,7 +543,6 @@ uniontype EventInfo list sampleLst "[deprecated] list of sample as before, only used by cpp runtime (TODO: REMOVE ME)"; list relationsLst "list of zero crossing function as before"; Integer numberMathEvents "stores the number of math function that trigger events e.g. floor, ceil, integer, ..."; - array<.DAE.ClockKind> clocks; end EVENT_INFO; end EventInfo; diff --git a/Compiler/BackEnd/BackendDAECreate.mo b/Compiler/BackEnd/BackendDAECreate.mo index a98988fab01..9b4ac2ca5d7 100644 --- a/Compiler/BackEnd/BackendDAECreate.mo +++ b/Compiler/BackEnd/BackendDAECreate.mo @@ -133,7 +133,7 @@ algorithm eqnarr := BackendEquation.listEquation(eqns); reqnarr := BackendEquation.listEquation(reqns); ieqnarr := BackendEquation.listEquation(ieqns); - einfo := BackendDAE.EVENT_INFO(timeEvents, whenclauses_1, {}, {}, {}, 0, arrayCreate(0, DAE.INFERRED_CLOCK())); + einfo := BackendDAE.EVENT_INFO(timeEvents, whenclauses_1, {}, {}, {}, 0); symjacs := {(NONE(), ({}, {}, ({}, {})), {}), (NONE(), ({}, {}, ({}, {})), {}), (NONE(), ({}, {}, ({}, {})), {}), (NONE(), ({}, {}, ({}, {})), {})}; outBackendDAE := BackendDAE.DAE(BackendDAEUtil.createEqSystem(vars_1, eqnarr)::{}, BackendDAE.SHARED(knvars, @@ -149,7 +149,8 @@ algorithm einfo, extObjCls, BackendDAE.SIMULATION(), - symjacs,inExtraInfo)); + symjacs,inExtraInfo, + BackendDAE.PARTITIONS_INFO(BackendDAEUtil.emptyClocks()))); BackendDAEUtil.checkBackendDAEWithErrorMsg(outBackendDAE); neqStr := intString(BackendDAEUtil.equationSize(eqnarr)); nvarStr := intString(BackendVariable.varsSize(vars_1)); diff --git a/Compiler/BackEnd/BackendDAEOptimize.mo b/Compiler/BackEnd/BackendDAEOptimize.mo index eeb5d224dc0..2e6c9e0115e 100644 --- a/Compiler/BackEnd/BackendDAEOptimize.mo +++ b/Compiler/BackEnd/BackendDAEOptimize.mo @@ -217,29 +217,15 @@ protected function simplifyTimeIndepFuncCallsShared "pre(param) -> param author: Frenkel TUD 2012-06" input BackendDAE.BackendDAE inDAE; output BackendDAE.BackendDAE outDAE; +protected + BackendDAE.Shared shared; algorithm - outDAE := match inDAE - local - BackendDAE.Variables knvars, aliasVars; - BackendDAE.EquationArray remeqns, inieqns; - BackendDAE.EventInfo eventInfo; - BackendDAE.EqSystems systs; - BackendDAE.Shared shared; - - case BackendDAE.DAE(systs, shared as BackendDAE.SHARED ( - knownVars=knvars, aliasVars=aliasVars, initialEqs=inieqns, removedEqs=remeqns, eventInfo=eventInfo )) - algorithm - BackendDAEUtil.traverseBackendDAEExpsVarsWithUpdate( knvars, Expression.traverseSubexpressionsHelper, - (traverserExpsimplifyTimeIndepFuncCalls, (knvars, aliasVars, false)) ); - BackendDAEUtil.traverseBackendDAEExpsEqnsWithUpdate( inieqns, Expression.traverseSubexpressionsHelper, - (traverserExpsimplifyTimeIndepFuncCalls, (knvars, aliasVars, false)) ); - BackendDAEUtil.traverseBackendDAEExpsEqnsWithUpdate(remeqns, Expression.traverseSubexpressionsHelper, - (traverserExpsimplifyTimeIndepFuncCalls, (knvars, aliasVars, false)) ); - (eventInfo, _) := traverseEventInfoExps( eventInfo, Expression.traverseSubexpressionsHelper, - (traverserExpsimplifyTimeIndepFuncCalls, (knvars, aliasVars, false)) ); - shared.eventInfo := eventInfo; - then BackendDAE.DAE(systs, shared); - end match; + shared := inDAE.shared; + BackendDAEUtil.traverseBackendDAEExpsVarsWithUpdate(shared.knownVars, Expression.traverseSubexpressionsHelper, (traverserExpsimplifyTimeIndepFuncCalls, (shared.knownVars, shared.aliasVars, false))); + BackendDAEUtil.traverseBackendDAEExpsEqnsWithUpdate(shared.initialEqs, Expression.traverseSubexpressionsHelper, (traverserExpsimplifyTimeIndepFuncCalls, (shared.knownVars, shared.aliasVars, false))); + BackendDAEUtil.traverseBackendDAEExpsEqnsWithUpdate(shared.removedEqs, Expression.traverseSubexpressionsHelper, (traverserExpsimplifyTimeIndepFuncCalls, (shared.knownVars, shared.aliasVars, false))); + (shared.eventInfo, _) := traverseEventInfoExps(shared.eventInfo, Expression.traverseSubexpressionsHelper, (traverserExpsimplifyTimeIndepFuncCalls, (shared.knownVars, shared.aliasVars, false))); + outDAE := BackendDAE.DAE(inDAE.eqs, shared); end simplifyTimeIndepFuncCallsShared; protected function traverseEventInfoExps @@ -259,14 +245,13 @@ protected list whenClauseLst; list zeroCrossingLst, sampleLst, relationsLst; Integer numberMathEvents; - array clocks; algorithm - BackendDAE.EVENT_INFO(timeEvents, whenClauseLst, zeroCrossingLst, sampleLst, relationsLst, numberMathEvents, clocks) := iEventInfo; + BackendDAE.EVENT_INFO(timeEvents, whenClauseLst, zeroCrossingLst, sampleLst, relationsLst, numberMathEvents) := iEventInfo; (whenClauseLst, outTypeA) := traverseWhenClauseExps(whenClauseLst, func, inTypeA, {}); (zeroCrossingLst, outTypeA) := traverseZeroCrossingExps(zeroCrossingLst, func, outTypeA, {}); (sampleLst, outTypeA) := traverseZeroCrossingExps(sampleLst, func, outTypeA, {}); (relationsLst, outTypeA) := traverseZeroCrossingExps(relationsLst, func, outTypeA, {}); - oEventInfo := BackendDAE.EVENT_INFO(timeEvents, whenClauseLst, zeroCrossingLst, sampleLst, relationsLst, numberMathEvents, clocks); + oEventInfo := BackendDAE.EVENT_INFO(timeEvents, whenClauseLst, zeroCrossingLst, sampleLst, relationsLst, numberMathEvents); end traverseEventInfoExps; protected function traverseWhenClauseExps @@ -3939,16 +3924,15 @@ end updateStatesVars; // ============================================================================= public function addedScaledVars -" added var_norm = var/nominal, - where var is state. -" + "added var_norm = var/nominal, where var is state." input BackendDAE.BackendDAE inDAE; output BackendDAE.BackendDAE outDAE; algorithm - outDAE := if Flags.isSet(Flags.ADD_SCALED_VARS) or Flags.isSet(Flags.ADD_SCALED_VARS_INPUT) then - addedScaledVarsWork(inDAE) - else - inDAE; + if Flags.isSet(Flags.ADD_SCALED_VARS) or Flags.isSet(Flags.ADD_SCALED_VARS_INPUT) then + outDAE := addedScaledVarsWork(inDAE); + else + outDAE := inDAE; + end if; end addedScaledVars; protected function addedScaledVarsWork @@ -3957,24 +3941,18 @@ protected function addedScaledVarsWork protected list systlst; list osystlst = {}; - BackendDAE.Variables vars; BackendDAE.EquationArray eqns; - - BackendDAE.Variables vars; - BackendDAE.Variables knvars; - list kvarlst, lst_states, lst_inputs, lst_normv, lst_new_var = {}; + list kvarlst, lst_states, lst_inputs; BackendDAE.Var tmpv; DAE.ComponentRef cref; DAE.Exp norm, y_norm, y, lhs; BackendDAE.Equation eqn; BackendDAE.Shared oshared; BackendDAE.EqSystem syst; - algorithm BackendDAE.DAE(systlst, oshared) := inDAE; - BackendDAE.SHARED(knownVars=knvars) := oshared; - kvarlst := BackendVariable.varList(knvars); + kvarlst := BackendVariable.varList(oshared.knownVars); lst_inputs := List.select(kvarlst, BackendVariable.isVarOnTopLevelAndInputNoDerInput); // states if Flags.isSet(Flags.ADD_SCALED_VARS) then @@ -4051,15 +4029,15 @@ end addedScaledVarsWork; // ============================================================================= public function sortEqnsVars - input BackendDAE.BackendDAE iDAE; - output BackendDAE.BackendDAE oDAE; + input BackendDAE.BackendDAE inDAE; + output BackendDAE.BackendDAE outDAE; algorithm - oDAE := if Flags.isSet(Flags.SORT_EQNS_AND_VARS) then sortEqnsVarsWork(iDAE) else iDAE; + outDAE := if Flags.isSet(Flags.SORT_EQNS_AND_VARS) then sortEqnsVarsWork(inDAE) else inDAE; end sortEqnsVars; protected function sortEqnsVarsWork - input BackendDAE.BackendDAE iDAE; - output BackendDAE.BackendDAE oDAE = iDAE; + input BackendDAE.BackendDAE inDAE; + output BackendDAE.BackendDAE outDAE = inDAE; protected list systlst, new_systlst = {}; BackendDAE.Shared shared; @@ -4077,8 +4055,8 @@ protected list var_lst; list eqn_lst; algorithm - //BackendDump.bltdump("START:", oDAE); - BackendDAE.DAE(systlst, shared) := iDAE; + //BackendDump.bltdump("START:", outDAE); + BackendDAE.DAE(systlst, shared) := inDAE; BackendDAE.SHARED(functionTree=functionTree) := shared; for syst in systlst loop syst := match syst @@ -4121,8 +4099,8 @@ algorithm new_systlst := syst :: new_systlst; end for; //syst - oDAE:= BackendDAE.DAE(new_systlst, shared); - //BackendDump.bltdump("ENDE:", oDAE); + outDAE:= BackendDAE.DAE(new_systlst, shared); + //BackendDump.bltdump("ENDE:", outDAE); end sortEqnsVarsWork; protected function sortEqnsVarsWorkTpl @@ -4180,15 +4158,15 @@ end compWeightsEqns; // ============================================================================= public function simplifyLoops - input BackendDAE.BackendDAE iDAE; - output BackendDAE.BackendDAE oDAE; + input BackendDAE.BackendDAE inDAE; + output BackendDAE.BackendDAE outDAE; algorithm - oDAE := if Flags.getConfigInt(Flags.SIMPLIFY_LOOPS) > 0 then simplifyLoopsMain(iDAE) else iDAE; + outDAE := if Flags.getConfigInt(Flags.SIMPLIFY_LOOPS) > 0 then simplifyLoopsMain(inDAE) else inDAE; end simplifyLoops; protected function simplifyLoopsMain - input BackendDAE.BackendDAE iDAE; - output BackendDAE.BackendDAE oDAE = iDAE; + input BackendDAE.BackendDAE inDAE; + output BackendDAE.BackendDAE outDAE = inDAE; protected list systlst, new_systlst = {}; BackendDAE.Shared shared; @@ -4208,9 +4186,9 @@ protected Integer ne, nv; Boolean simDAE; algorithm - //BackendDump.bltdump("START:", oDAE); - BackendDAE.DAE(systlst, shared) := iDAE; - BackendDAE.SHARED(functionTree=functionTree) := shared; + //BackendDump.bltdump("START:", outDAE); + shared := inDAE.shared; + functionTree := shared.functionTree; simDAE := match shared case BackendDAE.SHARED(backendDAEType = BackendDAE.SIMULATION()) then true; @@ -4223,7 +4201,7 @@ algorithm print("\n***noSIM***\n"); end if; end if; - for syst in systlst loop + for syst in inDAE.eqs loop update := false; ass1 := {}; ass2 := {}; @@ -4242,9 +4220,9 @@ algorithm nSyst := if update then simplifyLoopsUpdateMatching(vars, eqns, syst, listReverse(ass1), listReverse(ass2), ne, nv, functionTree, listReverse(compOrders)) else syst; new_systlst := nSyst :: new_systlst; end for; //syst - oDAE:= BackendDAE.DAE(new_systlst, shared); - //oDAE:= BackendDAE.DAE(listReverse(new_systlst), shared); - //BackendDump.bltdump("ENDE:", oDAE); + outDAE:= BackendDAE.DAE(new_systlst, shared); + //outDAE:= BackendDAE.DAE(listReverse(new_systlst), shared); + //BackendDump.bltdump("ENDE:", outDAE); if Flags.isSet(Flags.DUMP_SIMPLIFY_LOOPS) then print("END: simplifyLoops\n"); @@ -4709,22 +4687,20 @@ protected function symEulerWork input Boolean b " true => add, false => remove euler equation"; output BackendDAE.BackendDAE outDAE; protected - list systlst, osystlst = {}; + list osystlst = {}; BackendDAE.EqSystem syst_; BackendDAE.Shared shared; BackendDAE.Var tmpv; DAE.ComponentRef cref; algorithm - BackendDAE.DAE(systlst, shared) := inDAE; - // make dt cref := ComponentReference.makeCrefIdent(BackendDAE.symEulerDT, DAE.T_REAL_DEFAULT, {}); tmpv := BackendVariable.makeVar(cref); //tmpv := BackendVariable.setVarKind(tmpv, BackendDAE.PARAM()); tmpv := BackendVariable.setBindExp(tmpv, SOME(DAE.RCONST(0.0))); - shared := BackendVariable.addKnVarDAE(tmpv, shared); + shared := BackendVariable.addKnVarDAE(tmpv, inDAE.shared); - for syst in systlst loop + for syst in inDAE.eqs loop (syst_, shared) := symEulerUpdateSyst(syst, b, shared); osystlst := syst_ :: osystlst; end for; @@ -5029,27 +5005,19 @@ algorithm end matchcontinue; end traverserExpapplyRewriteRulesBackend; -protected function applyRewriteRulesBackendShared -"@author: adrpo" +protected function applyRewriteRulesBackendShared "@author: adrpo" input BackendDAE.BackendDAE inDAE; output BackendDAE.BackendDAE outDAE; +protected + BackendDAE.Shared shared; algorithm - outDAE := match inDAE - local - BackendDAE.Variables knvars; - BackendDAE.EquationArray remeqns, inieqns; - BackendDAE.EqSystems systs; - BackendDAE.Shared shared; - case BackendDAE.DAE(systs, shared as BackendDAE.SHARED( knownVars=knvars, - initialEqs=inieqns, removedEqs=remeqns )) - algorithm - BackendDAEUtil.traverseBackendDAEExpsVarsWithUpdate(knvars, traverserapplyRewriteRulesBackend, false); - BackendDAEUtil.traverseBackendDAEExpsEqnsWithUpdate(inieqns, traverserapplyRewriteRulesBackend, false); - BackendDAEUtil.traverseBackendDAEExpsEqnsWithUpdate(remeqns, traverserapplyRewriteRulesBackend, false); - // not sure if we should apply the rules on the event info! - // (ei,_) = traverseEventInfoExps(eventInfo,traverserapplyRewriteRulesBackend, false); - then BackendDAE.DAE(systs, shared); - end match; + shared := inDAE.shared; + BackendDAEUtil.traverseBackendDAEExpsVarsWithUpdate(shared.knownVars, traverserapplyRewriteRulesBackend, false); + BackendDAEUtil.traverseBackendDAEExpsEqnsWithUpdate(shared.initialEqs, traverserapplyRewriteRulesBackend, false); + BackendDAEUtil.traverseBackendDAEExpsEqnsWithUpdate(shared.removedEqs, traverserapplyRewriteRulesBackend, false); + // not sure if we should apply the rules on the event info! + // (ei, _) := traverseEventInfoExps(eventInfo, traverserapplyRewriteRulesBackend, false); + outDAE := BackendDAE.DAE(inDAE.eqs, shared); end applyRewriteRulesBackendShared; // ============================================================================= @@ -5060,12 +5028,11 @@ end applyRewriteRulesBackendShared; public function listAllIterationVariables "author: lochel" input BackendDAE.BackendDAE inBackendDAE; protected - list eqs; BackendDAE.BackendDAEType backendDAEType; list warnings; algorithm - BackendDAE.DAE(eqs=eqs, shared=BackendDAE.SHARED(backendDAEType=backendDAEType)) := inBackendDAE; - warnings := listAllIterationVariables0(eqs); + BackendDAE.DAE(shared=BackendDAE.SHARED(backendDAEType=backendDAEType)) := inBackendDAE; + warnings := listAllIterationVariables0(inBackendDAE.eqs); Error.addCompilerNotification("List of all iteration variables (DAE kind: " + BackendDump.printBackendDAEType2String(backendDAEType) + ")\n" + stringDelimitList(warnings, "\n")); end listAllIterationVariables; diff --git a/Compiler/BackEnd/BackendDAEUtil.mo b/Compiler/BackEnd/BackendDAEUtil.mo index 6c83252e325..0b976567f7e 100644 --- a/Compiler/BackEnd/BackendDAEUtil.mo +++ b/Compiler/BackEnd/BackendDAEUtil.mo @@ -513,27 +513,16 @@ algorithm outShared:= match (inShared) local - BackendDAE.Variables knvars,exobj,knvars1,exobj1,av; - BackendDAE.EquationArray remeqns,inieqns,remeqns1,inieqns1; - list constrs; - list clsAttrs; - FCore.Cache cache; - FCore.Graph graph; - DAE.FunctionTree funcTree; - BackendDAE.EventInfo einfo; - ExternalObjectClasses eoc; - BackendDAEType btp; - BackendDAE.SymbolicJacobians symjacs; - BackendDAE.ExtraInfo ei; + BackendDAE.Shared shared; - case (BackendDAE.SHARED(knvars,exobj,av,inieqns,remeqns,constrs,clsAttrs,cache,graph,funcTree,einfo,eoc,btp,symjacs,ei)) + case shared as BackendDAE.SHARED() equation - knvars1 = BackendVariable.copyVariables(knvars); - _ = BackendVariable.copyVariables(exobj); - inieqns1 = BackendEquation.copyEquationArray(inieqns); - remeqns1 = BackendEquation.copyEquationArray(remeqns); + shared.knownVars = BackendVariable.copyVariables(shared.knownVars); + shared.externalObjects = BackendVariable.copyVariables(shared.externalObjects); + shared.initialEqs = BackendEquation.copyEquationArray(shared.initialEqs); + shared.removedEqs = BackendEquation.copyEquationArray(shared.removedEqs); then - BackendDAE.SHARED(knvars1,exobj,av,inieqns1,remeqns1,constrs,clsAttrs,cache,graph,funcTree,einfo,eoc,btp,symjacs,ei); + shared; end match; end copyBackendDAEShared; @@ -567,18 +556,18 @@ end addVarsToEqSystem; public function numberOfZeroCrossings "author: lochel" input BackendDAE.BackendDAE inBackendDAE; - output Integer outNumZeroCrossings "number of ordinary zerocrossings" ; - output Integer outNumTimeEvents "number of zerocrossings that are time events" ; + output Integer outNumZeroCrossings "number of ordinary zero crossings" ; + output Integer outNumTimeEvents "number of zero crossings that are time events" ; output Integer outNumRelations; output Integer outNumMathEventFunctions; protected list timeEvents; list zeroCrossingLst, relationsLst; algorithm - BackendDAE.DAE(shared=BackendDAE.SHARED(eventInfo=BackendDAE.EVENT_INFO(timeEvents=timeEvents, - zeroCrossingLst=zeroCrossingLst, - relationsLst=relationsLst, - numberMathEvents=outNumMathEventFunctions))) := inBackendDAE; + BackendDAE.SHARED(eventInfo=BackendDAE.EVENT_INFO(timeEvents=timeEvents, + zeroCrossingLst=zeroCrossingLst, + relationsLst=relationsLst, + numberMathEvents=outNumMathEventFunctions)) := inBackendDAE.shared; outNumZeroCrossings := listLength(zeroCrossingLst); outNumTimeEvents := listLength(timeEvents); @@ -596,11 +585,10 @@ protected function countDiscreteVars "author: lochel" input BackendDAE.BackendDAE inDAE; output Integer outNumDiscreteVars; protected - BackendDAE.EqSystems systs; BackendDAE.Variables knownVars, alias; algorithm - BackendDAE.DAE(eqs = systs, shared = BackendDAE.SHARED(knownVars=knownVars, aliasVars=alias)) := inDAE; - outNumDiscreteVars := countDiscreteVars1(systs); + BackendDAE.SHARED(knownVars=knownVars, aliasVars=alias) := inDAE.shared; + outNumDiscreteVars := countDiscreteVars1(inDAE.eqs); outNumDiscreteVars := BackendVariable.traverseBackendDAEVars(knownVars, countDiscreteVars3, outNumDiscreteVars); outNumDiscreteVars := BackendVariable.traverseBackendDAEVars(alias, countDiscreteVars3, outNumDiscreteVars); end countDiscreteVars; @@ -645,35 +633,23 @@ protected function calculateValues "author: PA input BackendDAE.BackendDAE inBackendDAE; output BackendDAE.BackendDAE outBackendDAE; algorithm - outBackendDAE := match (inBackendDAE) + outBackendDAE := match inBackendDAE local - list knvarlst,varlst1,varlst2; - BackendDAE.Variables knvars,extVars,paramvars,av; - BackendDAE.EquationArray seqns,ie; - list constrs; - list clsAttrs; + BackendDAE.Variables knvars; FCore.Cache cache; FCore.Graph graph; - DAE.FunctionTree funcs; - BackendDAE.EventInfo wc; - ExternalObjectClasses extObjCls; EqSystems eqs; - BackendDAEType btp; - BackendDAE.SymbolicJacobians symjacs; - BackendDAE.ExtraInfo ei; - - case (BackendDAE.DAE(eqs,BackendDAE.SHARED(knownVars = knvars,externalObjects=extVars,aliasVars = av, - initialEqs = ie,removedEqs = seqns, constraints = constrs,classAttrs = clsAttrs, - cache=cache,graph=graph, functionTree = funcs, eventInfo = wc, extObjClasses=extObjCls, - backendDAEType=btp, symjacs=symjacs, info=ei))) + BackendDAE.Shared shared; + + case BackendDAE.DAE(eqs, shared as BackendDAE.SHARED(knownVars=knvars, cache=cache, graph=graph)) algorithm - knvars := BackendVariable.traverseBackendDAEVarsWithUpdate( - knvars, function calculateValueTraverser(inEnv = graph), cache); + knvars := BackendVariable.traverseBackendDAEVarsWithUpdate ( + knvars, function calculateValueTraverser(inEnv = graph), cache ); // Reverse the order of the known vars in the hashtable. This is stupid, // but things break otherwise. - knvars := BackendVariable.listVar(BackendVariable.varList(knvars)); + shared.knownVars := BackendVariable.listVar(BackendVariable.varList(knvars)); then - BackendDAE.DAE(eqs,BackendDAE.SHARED(knvars,extVars,av,ie,seqns,constrs,clsAttrs,cache,graph,funcs,wc,extObjCls,btp,symjacs,ei)); + BackendDAE.DAE(eqs, shared); end match; end calculateValues; @@ -986,25 +962,20 @@ end traversingisDiscreteExpFinder; public function isVarDiscrete "returns true if variable is discrete" - input BackendDAE.Var var; - output Boolean res; -algorithm - res := match(var) - local VarKind kind; - case(BackendDAE.VAR(varKind=kind)) then isKindDiscrete(kind); - end match; + input BackendDAE.Var inVar; + output Boolean res = isKindDiscrete(inVar.varKind); end isVarDiscrete; protected function isKindDiscrete "Returns true if VarKind is discrete." input VarKind inVarKind; output Boolean outBoolean; algorithm - outBoolean := matchcontinue (inVarKind) + outBoolean := match inVarKind case (BackendDAE.DISCRETE()) then true; case (BackendDAE.PARAM()) then true; case (BackendDAE.CONST()) then true; - case (_) then false; - end matchcontinue; + else false; + end match; end isKindDiscrete; public function statesAndVarsExp @@ -1231,118 +1202,75 @@ end rangeExprs; public function daeSize "author: Frenkel TUD - Returns the size of the dae system, wich corsopndens to the number of variables." - input BackendDAE.BackendDAE dae; - output Integer size; + Returns the size of the dae system, which correspondents to the number of variables." + input BackendDAE.BackendDAE inDAE; + output Integer outSize; protected - list systs; list sizes; algorithm - BackendDAE.DAE(eqs=systs) := dae; - sizes := List.map(systs,systemSize); - size := List.fold(sizes,intAdd,0); + sizes := List.map(inDAE.eqs, systemSize); + outSize := List.fold(sizes, intAdd, 0); end daeSize; public function systemSize -"author: Frenkel TUD - Returns the size of the dae system, the size of the equations in an BackendDAE.EquationArray, + "Returns the size of the dae system, the size of the equations in an BackendDAE.EquationArray, which not corresponds to the number of equations in a system." - input BackendDAE.EqSystem syst; - output Integer n; -algorithm - n := match(syst) - local - BackendDAE.EquationArray eqns; - case BackendDAE.EQSYSTEM(orderedEqs = eqns) - equation - n = equationSize(eqns); - then n; - end match; + input BackendDAE.EqSystem inEqSystem; + output Integer outSize = equationSize(inEqSystem.orderedEqs); end systemSize; public function numOfComps "Returns the number of StrongComponents in the EqSystem author: waurich TUD" - input BackendDAE.EqSystem syst; + input BackendDAE.EqSystem inEqSystem; output Integer num; +protected + BackendDAE.StrongComponents comps; algorithm - num:= - match (syst) - local - BackendDAE.StrongComponents comps; - Integer n; - case BackendDAE.EQSYSTEM(matching = BackendDAE.MATCHING(comps = comps)) - equation - n = listLength(comps); - then n; - end match; + BackendDAE.MATCHING(comps=comps) := inEqSystem.matching; + num := listLength(comps); end numOfComps; public function equationSize "author: PA - Returns the size of the equations in an BackendDAE.EquationArray, which not corresponds to the number of equations in a system." input BackendDAE.EquationArray inEquationArray; - output Integer outInteger; -algorithm - outInteger:= - match (inEquationArray) - local Integer n; - case (BackendDAE.EQUATION_ARRAY(size = n)) then n; - end match; + output Integer outInteger = inEquationArray.size; end equationSize; public function equationArraySizeDAE "author: Frenkel TUD Returns the number of equations in a system." - input BackendDAE.EqSystem dae; - output Integer n; -algorithm - n := match(dae) - local - BackendDAE.EquationArray eqns; - case BackendDAE.EQSYSTEM(orderedEqs = eqns) - equation - n = equationArraySize(eqns); - then n; - end match; + input BackendDAE.EqSystem inEqSystem; + output Integer n = equationArraySize(inEqSystem.orderedEqs); end equationArraySizeDAE; public function equationArraySize "author: PA - Returns the number of equations in an BackendDAE.EquationArray, which not corresponds to the number of equations in a system but not to the size of the system" input BackendDAE.EquationArray inEquationArray; - output Integer outInteger; -algorithm - outInteger:= - match (inEquationArray) - local Integer n; - case (BackendDAE.EQUATION_ARRAY(numberOfElement = n)) then n; - end match; + output Integer outInteger = inEquationArray.numberOfElement; end equationArraySize; public function hasDAEMatching -"Returns true if all system have already a matching, otherwise return false." - input BackendDAE.BackendDAE dae; + "Returns true if all system have already a matching, otherwise return false." + input BackendDAE.BackendDAE inDAE; output Boolean b; protected - list systs; list boollst; algorithm - BackendDAE.DAE(eqs=systs) := dae; - boollst := List.map(systs, hasEqSystemMatching); - b := List.fold(boollst,boolAnd,true); + boollst := List.map(inDAE.eqs, hasEqSystemMatching); + b := List.fold(boollst, boolAnd, true); end hasDAEMatching; public function hasEqSystemMatching -"Returns true if EqSystem has a matching." + "Returns true if EqSystem has a matching." input BackendDAE.EqSystem dae; output Boolean b; algorithm b := match(dae) - case BackendDAE.EQSYSTEM(matching=BackendDAE.MATCHING()) then true; - case BackendDAE.EQSYSTEM(matching=BackendDAE.NO_MATCHING()) then false; + case BackendDAE.EQSYSTEM(matching=BackendDAE.MATCHING()) then true; + case BackendDAE.EQSYSTEM(matching=BackendDAE.NO_MATCHING()) then false; end match; end hasEqSystemMatching; @@ -1855,37 +1783,20 @@ end splitoutEquationAndVars; public function whenClauseAddDAE "author: Frenkel TUD 2011-05" input list inWcLst; - input BackendDAE.Shared shared; - output BackendDAE.Shared oshared; + input BackendDAE.Shared inShared; + output BackendDAE.Shared outShared; algorithm - oshared := match (inWcLst,shared) + outShared := match inShared local - BackendDAE.Variables knvars,exobj,aliasVars; - BackendDAE.EquationArray remeqns,inieqns; - list constrs; - list clsAttrs; - FCore.Cache cache; - FCore.Graph graph; - DAE.FunctionTree funcs; - list wclst,wclst1; - list zc, rellst, smplLst; - Integer numberOfMathEventFunctions; - ExternalObjectClasses eoc; - BackendDAE.SymbolicJacobians symjacs; - BackendDAEType btp; - list timeEvents; - BackendDAE.ExtraInfo ei; - array clocks; - - case (_,BackendDAE.SHARED( knvars, exobj, aliasVars, inieqns, remeqns, constrs, clsAttrs, cache, graph, funcs, - BackendDAE.EVENT_INFO(timeEvents, wclst, zc, smplLst, rellst, numberOfMathEventFunctions, clocks), - eoc, btp, symjacs, ei )) - equation - wclst1 = listAppend(wclst,inWcLst); - then BackendDAE.SHARED( knvars, exobj, aliasVars, inieqns, remeqns, constrs, clsAttrs, cache, graph, funcs, - BackendDAE.EVENT_INFO(timeEvents, wclst1, zc, smplLst, rellst, numberOfMathEventFunctions, clocks), - eoc, btp, symjacs, ei ); + BackendDAE.Shared shared; + BackendDAE.EventInfo eventInfo; + list wclst; + case shared as BackendDAE.SHARED(eventInfo=eventInfo as BackendDAE.EVENT_INFO(whenClauseLst=wclst)) + equation + eventInfo.whenClauseLst = listAppend(wclst, inWcLst); + shared.eventInfo = eventInfo; + then shared; end match; end whenClauseAddDAE; @@ -6952,26 +6863,21 @@ protected function stateDeselectionDAE input list> args; input tuple stateDeselection; output BackendDAE.BackendDAE outDAE; -algorithm - outDAE := match(causalized,inDAE,args,stateDeselection) - local - list systs; - BackendDAE.Shared shared; - String methodstr; - BackendDAEFunc.stateDeselectionFunc sDfunc; - - case (true,BackendDAE.DAE(systs,shared),_,(_,_,sDfunc,methodstr)) - equation - // do state selection - outDAE = sDfunc(BackendDAE.DAE(systs,shared),args); - //SimCodeFunctionUtil.execStat("transformDAE -> state selection " + methodstr); - then - outDAE; - else inDAE; - end match; +protected + String methodstr; + BackendDAEFunc.stateDeselectionFunc sDfunc; +algorithm + if causalized then + // do state selection + (_, _, sDfunc, methodstr) := stateDeselection; + outDAE := sDfunc(inDAE, args); + //SimCodeFunctionUtil.execStat("transformDAE -> state selection " + methodstr); + else + outDAE := inDAE; + end if; end stateDeselectionDAE; -protected function mapSortEqnsDAE "Run Tarjans Algorithm." +protected function mapSortEqnsDAE "Run Tarjan's Algorithm." input list inSystem; input BackendDAE.Shared inShared; input list acc; @@ -8040,7 +7946,8 @@ protected DAE.FunctionTree functions = DAEUtil.avlTreeNew(); algorithm shared := BackendDAE.SHARED( emptyVars, emptyVars, emptyVars, emptyEqs, emptyEqs, {}, {}, cache, graph, - DAEUtil.avlTreeNew(), BackendDAEUtil.emptyEventInfo(), {}, backendDAEType, {}, ei); + DAEUtil.avlTreeNew(), BackendDAEUtil.emptyEventInfo(), {}, backendDAEType, {}, ei, + BackendDAE.PARTITIONS_INFO(emptyClocks()) ); end createEmptyShared; public function makeSingleEquationComp @@ -8135,15 +8042,9 @@ end setFunctionTree; public function setEqSystEqs input BackendDAE.EqSystem inSyst; input BackendDAE.EquationArray inEqs; - output BackendDAE.EqSystem outSyst; + output BackendDAE.EqSystem syst = inSyst; algorithm - outSyst := match inSyst - local - BackendDAE.EqSystem syst; - case syst as BackendDAE.EQSYSTEM() - algorithm syst.orderedEqs := inEqs; - then syst; - end match; + syst.orderedEqs := inEqs; end setEqSystEqs; public function setEqSystVars @@ -8302,10 +8203,27 @@ algorithm end match; end setSharedAliasVars; +public function setSharedOptimica + input BackendDAE.Shared inShared; + input list constraints; + input list classAttrs; + output BackendDAE.Shared outShared; +algorithm + outShared := match inShared + local + BackendDAE.Shared shared; + case shared as BackendDAE.SHARED() + equation + shared.constraints = constraints; + shared.classAttrs = classAttrs; + then shared; + end match; +end setSharedOptimica; + public function emptyEventInfo output BackendDAE.EventInfo info; algorithm - info := BackendDAE.EVENT_INFO({}, {}, {}, {}, {}, 0, emptyClocks()); + info := BackendDAE.EVENT_INFO({}, {}, {}, {}, {}, 0); end emptyEventInfo; public function emptyClocks @@ -8314,5 +8232,69 @@ algorithm clocks := arrayCreate(0, DAE.INFERRED_CLOCK()); end emptyClocks; +public function componentsEqual"outputs true if 1 strongly connected components are equal" + input BackendDAE.StrongComponent comp1; + input BackendDAE.StrongComponent comp2; + output Boolean isEqual; +algorithm + isEqual := matchcontinue(comp1,comp2) + local + Integer i1,i2, j1,j2; + list l1,l2,k1,k2; + list>> l3,k3; + case(BackendDAE.SINGLEEQUATION(eqn=i1,var=i2),BackendDAE.SINGLEEQUATION(eqn=j1,var=j2)) + equation + then intEq(i1,j1) and intEq(i2,j2); + + case(BackendDAE.EQUATIONSYSTEM(eqns=l1,vars=l2),BackendDAE.EQUATIONSYSTEM(eqns=k1,vars=k2)) + equation + then List.isEqualOnTrue(l1,k1,intEq) and List.isEqualOnTrue(l2,k2,intEq); + + case(BackendDAE.SINGLEARRAY(eqn=i1,vars=l1),BackendDAE.SINGLEARRAY(eqn=j1,vars=k1)) + equation + then intEq(i1,j1) and List.isEqualOnTrue(l1,k1,intEq); + + case(BackendDAE.SINGLEALGORITHM(eqn=i1,vars=l1),BackendDAE.SINGLEALGORITHM(eqn=j1,vars=k1)) + equation + then intEq(i1,j1) and List.isEqualOnTrue(l1,k1,intEq); + + case(BackendDAE.SINGLECOMPLEXEQUATION(eqn=i1,vars=l1),BackendDAE.SINGLECOMPLEXEQUATION(eqn=j1,vars=k1)) + equation + then intEq(i1,j1) and List.isEqualOnTrue(l1,k1,intEq); + + case(BackendDAE.SINGLEWHENEQUATION(eqn=i1,vars=l1),BackendDAE.SINGLEWHENEQUATION(eqn=j1,vars=k1)) + equation + then intEq(i1,j1) and List.isEqualOnTrue(l1,k1,intEq); + + case(BackendDAE.SINGLEIFEQUATION(eqn=i1,vars=l1),BackendDAE.SINGLEIFEQUATION(eqn=j1,vars=k1)) + equation + then intEq(i1,j1) and List.isEqualOnTrue(l1,k1,intEq); + + case(BackendDAE.TORNSYSTEM(strictTearingSet=BackendDAE.TEARINGSET(tearingvars=l1,residualequations=l2,otherEqnVarTpl=l3)),BackendDAE.TORNSYSTEM(strictTearingSet=BackendDAE.TEARINGSET(tearingvars=k1,residualequations=k2,otherEqnVarTpl=k3))) + equation + then List.isEqualOnTrue(l1,k1,intEq) and List.isEqualOnTrue(l2,k2,intEq) and List.isEqualOnTrue(l3,k3,otherEqnVarTplEqual); + else + then false; + end matchcontinue; +end componentsEqual; + +protected function otherEqnVarTplEqual"compares 2 tpls from otherEqnVarTpl in TearingSets" + input tuple> tpl1; + input tuple> tpl2; + output Boolean isEqual; +algorithm + isEqual := matchcontinue(tpl1,tpl2) + local + Integer i1,i2; + list l1,l2; + case((i1,l1),(i2,l2)) + equation + then intEq(i1,i2) and List.isEqualOnTrue(l1,l2,intEq); + + else + then false; + end matchcontinue; +end otherEqnVarTplEqual; + annotation(__OpenModelica_Interface="backend"); end BackendDAEUtil; diff --git a/Compiler/BackEnd/BackendDump.mo b/Compiler/BackEnd/BackendDump.mo index 6d92ce0b6b6..4e4cf7dc32d 100644 --- a/Compiler/BackEnd/BackendDump.mo +++ b/Compiler/BackEnd/BackendDump.mo @@ -267,7 +267,6 @@ protected BackendDAE.ExternalObjectClasses extObjClasses; BackendDAE.BackendDAEType backendDAEType; BackendDAE.SymbolicJacobians symjacs; - array clocks; algorithm BackendDAE.SHARED(knownVars=knownVars, externalObjects=externalObjects, @@ -276,7 +275,7 @@ algorithm removedEqs=removedEqs, constraints=constraints, eventInfo=BackendDAE.EVENT_INFO( timeEvents=timeEvents, relationsLst=relationsLst, zeroCrossingLst=zeroCrossingLst, - sampleLst=sampleLst, whenClauseLst=whenClauseLst, clocks = clocks ), + sampleLst=sampleLst, whenClauseLst=whenClauseLst ), extObjClasses=extObjClasses, backendDAEType=backendDAEType, symjacs=symjacs) := inShared; diff --git a/Compiler/BackEnd/BackendEquation.mo b/Compiler/BackEnd/BackendEquation.mo index 892f12d51c2..65396210a0a 100644 --- a/Compiler/BackEnd/BackendEquation.mo +++ b/Compiler/BackEnd/BackendEquation.mo @@ -171,8 +171,7 @@ algorithm end match; end equationList2; -public function getWhenEquationExpr " - Get the left and right hand parts from an equation appearing in a when clause" +public function getWhenEquationExpr "Get the left and right hand parts from an equation appearing in a when clause" input BackendDAE.WhenEquation inWhenEquation; output DAE.ComponentRef outComponentRef; output DAE.Exp outExp; @@ -180,17 +179,11 @@ algorithm BackendDAE.WHEN_EQ(left=outComponentRef, right=outExp) := inWhenEquation; end getWhenEquationExpr; -public function copyEquationArray "author: wbraun - Performs a deep copy of an expandable equation array." +public function copyEquationArray "Performs a deep copy of an expandable equation array." input BackendDAE.EquationArray inEquationArray; - output BackendDAE.EquationArray outEquationArray; -protected - Integer numberOfElement, size, arrSize; - array> equOptArr, newEquOptArr; + output BackendDAE.EquationArray outEquationArray = inEquationArray; algorithm - BackendDAE.EQUATION_ARRAY(size, numberOfElement, arrSize, equOptArr) := inEquationArray; - newEquOptArr := arrayCopy(equOptArr); - outEquationArray := BackendDAE.EQUATION_ARRAY(size, numberOfElement, arrSize, newEquOptArr); + outEquationArray.equOptArr := arrayCopy(inEquationArray.equOptArr); end copyEquationArray; public function equationsLstVars @@ -971,12 +964,9 @@ public function traverseEquationArray "author: Frenkel TUD output BackendDAE.Equation outEq; output T outA; end FuncExpType; -protected - array> equOptArr; algorithm //try - BackendDAE.EQUATION_ARRAY(equOptArr=equOptArr) := inEquationArray; - outTypeA := BackendDAEUtil.traverseArrayNoCopy(equOptArr, func, traverseOptEquation, inTypeA); + outTypeA := BackendDAEUtil.traverseArrayNoCopy(inEquationArray.equOptArr, func, traverseOptEquation, inTypeA); //else // if Flags.isSet(Flags.FAILTRACE) then // Debug.trace("- BackendEquation.traverseEquationArray failed\n"); @@ -1000,12 +990,9 @@ public function traverseEquationArray_WithStop "author: Frenkel TUD output Boolean cont; output Type_a outA; end FuncWithStop; -protected - array> equOptArr; algorithm //try - BackendDAE.EQUATION_ARRAY(equOptArr=equOptArr) := inEquationArray; - outTypeA := BackendDAEUtil.traverseArrayNoCopyWithStop(equOptArr, inFuncWithStop, traverseOptEquation_WithStop, inTypeA); + outTypeA := BackendDAEUtil.traverseArrayNoCopyWithStop(inEquationArray.equOptArr, inFuncWithStop, traverseOptEquation_WithStop, inTypeA); //else // if Flags.isSet(Flags.FAILTRACE) then // Debug.trace("- BackendEquation.traverseEquationArray_WithStop failed\n"); @@ -1076,7 +1063,7 @@ public function traverseEquationArray_WithUpdate "author: Frenkel TUD input BackendDAE.EquationArray inEquationArray; input FuncWithUpdate inFuncWithUpdate; input T inTypeA; - output BackendDAE.EquationArray outEquationArray; + output BackendDAE.EquationArray outEquationArray = inEquationArray; output T outTypeA; partial function FuncWithUpdate @@ -1086,12 +1073,10 @@ public function traverseEquationArray_WithUpdate "author: Frenkel TUD output T outA; end FuncWithUpdate; protected - Integer numberOfElement, arrSize, size; array> equOptArr; algorithm - BackendDAE.EQUATION_ARRAY(size=size, numberOfElement=numberOfElement, arrSize=arrSize, equOptArr=equOptArr) := inEquationArray; - (equOptArr, outTypeA) := BackendDAEUtil.traverseArrayNoCopyWithUpdate(equOptArr, inFuncWithUpdate, traverseOptEquation_WithUpdate, inTypeA); - outEquationArray := BackendDAE.EQUATION_ARRAY(size, numberOfElement, arrSize, equOptArr); + (equOptArr, outTypeA) := BackendDAEUtil.traverseArrayNoCopyWithUpdate(inEquationArray.equOptArr, inFuncWithUpdate, traverseOptEquation_WithUpdate, inTypeA); + outEquationArray.equOptArr := equOptArr; end traverseEquationArray_WithUpdate; protected function traverseOptEquation_WithUpdate "author: Frenkel TUD 2010-11 @@ -1226,22 +1211,21 @@ public function addEquation "author: PA input BackendDAE.EquationArray inEquationArray; output BackendDAE.EquationArray outEquationArray; algorithm - outEquationArray := matchcontinue (inEquation, inEquationArray) + outEquationArray := matchcontinue (inEquationArray) local Integer n_1, numberOfElement, arrSize, expandsize, expandsize_1, newsize, size, index; array> arr_1, equOptArr, arr_2; - BackendDAE.Equation e; Real rsize, rexpandsize; - case (e, BackendDAE.EQUATION_ARRAY(size=size, numberOfElement=numberOfElement, arrSize=arrSize, equOptArr=equOptArr)) equation + case BackendDAE.EQUATION_ARRAY(size=size, numberOfElement=numberOfElement, arrSize=arrSize, equOptArr=equOptArr) equation (numberOfElement < arrSize) = true "Have space to add array elt."; n_1 = numberOfElement + 1; index = findFirstUnusedEquOptEntry(n_1, arrSize, equOptArr); - arr_1 = arrayUpdate(equOptArr, index, SOME(e)); - size = equationSize(e) + size; + arr_1 = arrayUpdate(equOptArr, index, SOME(inEquation)); + size = equationSize(inEquation) + size; then BackendDAE.EQUATION_ARRAY(size, n_1, arrSize, arr_1); - case (e, BackendDAE.EQUATION_ARRAY(size=size, numberOfElement=numberOfElement, arrSize=arrSize, equOptArr=equOptArr)) equation /* Do NOT Have space to add array elt. Expand array 1.4 times */ + case BackendDAE.EQUATION_ARRAY(size=size, numberOfElement=numberOfElement, arrSize=arrSize, equOptArr=equOptArr) equation /* Do NOT Have space to add array elt. Expand array 1.4 times */ (numberOfElement < arrSize) = false; rsize = intReal(arrSize); rexpandsize = rsize * 0.4; @@ -1250,11 +1234,11 @@ algorithm newsize = expandsize_1 + arrSize; arr_1 = Array.expand(expandsize_1, equOptArr, NONE()); n_1 = numberOfElement + 1; - arr_2 = arrayUpdate(arr_1, n_1, SOME(e)); - size = equationSize(e) + size; + arr_2 = arrayUpdate(arr_1, n_1, SOME(inEquation)); + size = equationSize(inEquation) + size; then BackendDAE.EQUATION_ARRAY(size, n_1, newsize, arr_2); - case (_, BackendDAE.EQUATION_ARRAY(size=size, numberOfElement=numberOfElement, arrSize=arrSize, equOptArr=equOptArr)) equation + case BackendDAE.EQUATION_ARRAY(size=size, numberOfElement=numberOfElement, arrSize=arrSize, equOptArr=equOptArr) equation print("- BackendEquation.addEquation failed\nArraySize: " + intString(arrSize) + "\nnumberOfElement " + intString(numberOfElement) + "\nSize " + intString(size) + "\narraySize " + intString(arrayLength(equOptArr))); then fail(); end matchcontinue; @@ -1264,11 +1248,8 @@ public function equationAddDAE "author: Frenkel TUD 2011-05" input BackendDAE.Equation inEquation; input BackendDAE.EqSystem inEqSystem; output BackendDAE.EqSystem outEqSystem; -protected - BackendDAE.EquationArray eqs; algorithm - BackendDAE.EQSYSTEM(orderedEqs=eqs) := inEqSystem; - outEqSystem := BackendDAEUtil.setEqSystEqs(inEqSystem, addEquation(inEquation, eqs)); + outEqSystem := BackendDAEUtil.setEqSystEqs(inEqSystem, addEquation(inEquation, inEqSystem.orderedEqs)); outEqSystem := BackendDAEUtil.setEqSystMatching(outEqSystem, BackendDAE.NO_MATCHING()); end equationAddDAE; @@ -1276,11 +1257,8 @@ public function equationsAddDAE "author: Frenkel TUD 2011-05" input list inEquations; input BackendDAE.EqSystem inEqSystem; output BackendDAE.EqSystem outEqSystem; -protected - BackendDAE.EquationArray eqs; algorithm - BackendDAE.EQSYSTEM(orderedEqs=eqs) := inEqSystem; - outEqSystem := BackendDAEUtil.setEqSystEqs(inEqSystem, List.fold(inEquations, addEquation, eqs)); + outEqSystem := BackendDAEUtil.setEqSystEqs(inEqSystem, List.fold(inEquations, addEquation, inEqSystem.orderedEqs)); outEqSystem := BackendDAEUtil.setEqSystMatching(outEqSystem, BackendDAE.NO_MATCHING()); end equationsAddDAE; @@ -1291,13 +1269,9 @@ public function requationsAddDAE "author: Frenkel TUD 2012-10 input BackendDAE.Shared inShared; output BackendDAE.Shared outShared; algorithm - outShared := match (inEquations, inShared) - local - BackendDAE.EquationArray eqs; - case ({}, _) - then inShared; - case (_, BackendDAE.SHARED(removedEqs=eqs)) equation - then BackendDAEUtil.setSharedRemovedEqns(inShared, List.fold(inEquations, addEquation, eqs)); + outShared := match inEquations + case {} then inShared; + else then BackendDAEUtil.setSharedRemovedEqns(inShared, List.fold(inEquations, addEquation, inShared.removedEqs)); end match; end requationsAddDAE; @@ -1305,15 +1279,12 @@ public function removeRemovedEqs "remove removedEqs" input BackendDAE.Shared inShared; output BackendDAE.Shared outShared; protected - BackendDAE.EquationArray eqs; - Integer n; + BackendDAE.EquationArray removedEqs = inShared.removedEqs; algorithm - BackendDAE.SHARED(removedEqs=eqs) := inShared; - BackendDAE.EQUATION_ARRAY(numberOfElement=n) := eqs; - for ind in 1:n loop - eqs := equationRemove(ind, eqs); + for i in 1:removedEqs.numberOfElement loop + removedEqs := equationRemove(i, removedEqs); end for; - outShared := BackendDAEUtil.setSharedRemovedEqns(inShared, eqs); + outShared := BackendDAEUtil.setSharedRemovedEqns(inShared, removedEqs); end removeRemovedEqs; public function setAtIndex "author: lochel @@ -1322,15 +1293,10 @@ public function setAtIndex "author: lochel input BackendDAE.EquationArray inEquationArray; input Integer inPos "one-based indexing"; input BackendDAE.Equation inEquation; - output BackendDAE.EquationArray outEquationArray; -protected - array> equOptArr, newEquOptArr; - Integer size, numberOfElement, arrSize; + output BackendDAE.EquationArray outEquationArray = inEquationArray; algorithm - BackendDAE.EQUATION_ARRAY(size, numberOfElement, arrSize, equOptArr) := inEquationArray; - size := size -equationOptSize(equOptArr[inPos]) +equationSize(inEquation); - newEquOptArr := arrayUpdate(equOptArr, inPos, SOME(inEquation)); - outEquationArray := BackendDAE.EQUATION_ARRAY(size, numberOfElement, arrSize, newEquOptArr); + outEquationArray.size := inEquationArray.size -equationOptSize(arrayGet(inEquationArray.equOptArr, inPos)) +equationSize(inEquation); + outEquationArray.equOptArr := arrayUpdate(inEquationArray.equOptArr, inPos, SOME(inEquation)); end setAtIndex; public function setAtIndexFirst "author: waurich @@ -1434,25 +1400,23 @@ public function equationDelete "author: Frenkel TUD 2010-12 input list inIndices; output BackendDAE.EquationArray outEquationArray; algorithm - outEquationArray := matchcontinue (inEquationArray, inIndices) + outEquationArray := matchcontinue inIndices local list eqnlst; - Integer numberOfElement, arrSize; array> equOptArr; - case (_, {}) + case {} then inEquationArray; - case (BackendDAE.EQUATION_ARRAY(arrSize=arrSize, equOptArr=equOptArr), _) equation - equOptArr = List.fold1r(inIndices, arrayUpdate, NONE(), equOptArr); - eqnlst = equationDelete1(arrSize, equOptArr, {}); + case _ equation + equOptArr = List.fold1r(inIndices, arrayUpdate, NONE(), inEquationArray.equOptArr); + eqnlst = equationDelete1(inEquationArray.arrSize, equOptArr, {}); then listEquation(eqnlst); - else - equation - true = Flags.isSet(Flags.FAILTRACE); - Debug.trace("- BackendDAE.equationDelete failed\n"); - then fail(); + else equation + true = Flags.isSet(Flags.FAILTRACE); + Debug.trace("- BackendDAE.equationDelete failed\n"); + then fail(); end matchcontinue; end equationDelete; @@ -1770,14 +1734,11 @@ algorithm end equationInfo; public function markedEquationSource - input BackendDAE.EqSystem syst; + input BackendDAE.EqSystem inEqSystem; input Integer inPos "one-based indexing"; output DAE.ElementSource outSource; -protected - BackendDAE.EquationArray eqns; algorithm - BackendDAE.EQSYSTEM(orderedEqs=eqns) := syst; - outSource := equationSource(equationNth1(eqns, inPos)); + outSource := equationSource(equationNth1(inEqSystem.orderedEqs, inPos)); end markedEquationSource; public function equationSource " @@ -1794,9 +1755,9 @@ algorithm case BackendDAE.ALGORITHM(source=source) then source; case BackendDAE.COMPLEX_EQUATION(source=source) then source; case BackendDAE.IF_EQUATION(source=source) then source; - else - equation Error.addInternalError("BackendEquation.equationSource failed!", sourceInfo()); - then fail(); + else equation + Error.addInternalError("BackendEquation.equationSource failed!", sourceInfo()); + then fail(); end match; end equationSource; @@ -2002,7 +1963,7 @@ algorithm case BackendDAE.FOR_EQUATION(attr=attr) then attr; else equation - Error.addInternalError("./Compiler/BackEnd/BackendEquation.mo: function getEquationAttributes failed", sourceInfo()); + Error.addInternalError("function getEquationAttributes failed", sourceInfo()); then fail(); end match; end getEquationAttributes; @@ -2052,7 +2013,7 @@ algorithm then BackendDAE.IF_EQUATION(conditions, eqnstrue, eqnsfalse, source, inAttr); else equation - Error.addInternalError("./Compiler/BackEnd/BackendEquation.mo: function setEquationAttributes failed", sourceInfo()); + Error.addInternalError("function setEquationAttributes failed", sourceInfo()); then fail(); end match; end setEquationAttributes; @@ -2087,7 +2048,7 @@ algorithm then BackendDAE.ARRAY_EQUATION(dimSize, lhs, rhs, source, attr); else equation - Error.addInternalError("./Compiler/BackEnd/BackendEquation.mo: function setEquationLHS failed", sourceInfo()); + Error.addInternalError("function setEquationLHS failed", sourceInfo()); then fail(); end match; end setEquationLHS; @@ -2128,7 +2089,7 @@ algorithm then BackendDAE.RESIDUAL_EQUATION(rhs, source, attr); else equation - Error.addInternalError("./Compiler/BackEnd/BackendEquation.mo: function setEquationRHS failed", sourceInfo()); + Error.addInternalError("function setEquationRHS failed", sourceInfo()); then fail(); end match; end setEquationRHS; @@ -2416,7 +2377,7 @@ algorithm */ else equation BackendDump.dumpBackendDAEEqnList({eqn}, "function BackendEquation.solveEquation failed w.r.t " + ExpressionDump.printExpStr(crefExp), true); - Error.addInternalError("./Compiler/BackEnd/BackendEquation.mo: function solveEquation failed", sourceInfo()); + Error.addInternalError("function solveEquation failed", sourceInfo()); then fail(); end matchcontinue; end solveEquation; @@ -2433,17 +2394,13 @@ end generateRESIDUAL_EQUATION; public function getEqnsFromEqSystem " Extracts the orderedEqs attribute from an equation system." input BackendDAE.EqSystem inEqSystem; - output BackendDAE.EquationArray outOrderedEqs; -algorithm - BackendDAE.EQSYSTEM(orderedEqs=outOrderedEqs) := inEqSystem; + output BackendDAE.EquationArray outOrderedEqs = inEqSystem.orderedEqs; end getEqnsFromEqSystem; public function getInitialEqnsFromShared " Extracts the initial equations from a shared object." input BackendDAE.Shared inShared; - output BackendDAE.EquationArray outInitialEqs; -algorithm - BackendDAE.SHARED(initialEqs=outInitialEqs) := inShared; + output BackendDAE.EquationArray outInitialEqs = inShared.initialEqs; end getInitialEqnsFromShared; public function aliasEquation "author Frenkel TUD 2011-04 @@ -2985,13 +2942,9 @@ end markDifferentiated; protected function markDifferentiated2 input BackendDAE.EquationAttributes inAttr; - output BackendDAE.EquationAttributes outAttr; -protected - BackendDAE.EquationKind kind; - BackendDAE.LoopInfo loopInfo; + output BackendDAE.EquationAttributes outAttr = inAttr; algorithm - BackendDAE.EQUATION_ATTRIBUTES(kind=kind, loopInfo=loopInfo) := inAttr; - outAttr := BackendDAE.EQUATION_ATTRIBUTES(true, kind, loopInfo); + outAttr.differentiated := true; end markDifferentiated2; public function isDifferentiated diff --git a/Compiler/BackEnd/BackendInline.mo b/Compiler/BackEnd/BackendInline.mo index 8040e143dce..2c64103a35b 100644 --- a/Compiler/BackEnd/BackendInline.mo +++ b/Compiler/BackEnd/BackendInline.mo @@ -515,13 +515,12 @@ algorithm BackendDAE.EventInfo ev; Boolean b1, b2, b3; list timeEvents; - array clocks; - case(BackendDAE.EVENT_INFO(timeEvents, wclst, zclst, samples, relations, numberOfMathEvents, clocks), fns) equation + case(BackendDAE.EVENT_INFO(timeEvents, wclst, zclst, samples, relations, numberOfMathEvents), fns) equation (wclst_1, b1) = inlineWhenClauses(wclst, fns, {}, false); (zclst_1, b2) = inlineZeroCrossings(zclst, fns, {}, false); (relations, b3) = inlineZeroCrossings(relations, fns, {}, false); - ev = if b1 or b2 or b3 then BackendDAE.EVENT_INFO(timeEvents, wclst_1, zclst_1, samples, relations, numberOfMathEvents, clocks) + ev = if b1 or b2 or b3 then BackendDAE.EVENT_INFO(timeEvents, wclst_1, zclst_1, samples, relations, numberOfMathEvents) else inEventInfo; then ev; diff --git a/Compiler/BackEnd/BackendVariable.mo b/Compiler/BackEnd/BackendVariable.mo index 072871e0709..cfe8fae8a57 100644 --- a/Compiler/BackEnd/BackendVariable.mo +++ b/Compiler/BackEnd/BackendVariable.mo @@ -81,42 +81,19 @@ public function varEqual "author: PA Returns true if two vars are equal." input BackendDAE.Var inVar1; input BackendDAE.Var inVar2; - output Boolean outBoolean; -protected - DAE.ComponentRef cr1, cr2; -algorithm - BackendDAE.VAR(varName=cr1) := inVar1; - BackendDAE.VAR(varName=cr2) := inVar2; - outBoolean := ComponentReference.crefEqualNoStringCompare(cr1, cr2) "a BackendDAE.Var is identified by its component reference"; + output Boolean outBoolean = ComponentReference.crefEqualNoStringCompare(inVar1.varName, inVar2.varName) "a BackendDAE.Var is identified by its component reference"; end varEqual; public function setVarFixed "author: PA Sets the fixed attribute of a variable." input BackendDAE.Var inVar; input Boolean inBoolean; - output BackendDAE.Var outVar; + output BackendDAE.Var outVar = inVar; protected - DAE.ComponentRef a; - BackendDAE.VarKind b; - DAE.VarDirection c; - DAE.VarParallelism prl; - BackendDAE.Type d; - Option e; - Option f; - list g; - DAE.ElementSource source; - DAE.VariableAttributes attr; Option oattr; - Option ts; - Option s; - DAE.ConnectorType ct; - DAE.VarInnerOuter io; - Boolean unreplaceable; algorithm - BackendDAE.VAR(a, b, c, prl, d, e, f, g, source, oattr, ts, s, ct, io, unreplaceable) := 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, unreplaceable); + oattr := if isSome(inVar.values) then inVar.values else SOME(getVariableAttributefromType(inVar.varType)); + outVar.values := DAEUtil.setFixedAttr(oattr, SOME(DAE.BCONST(inBoolean))); end setVarFixed; public function varFixed "author: PA @@ -126,153 +103,81 @@ public function varFixed "author: PA input BackendDAE.Var inVar; output Boolean outBoolean; algorithm - outBoolean := matchcontinue(inVar) + outBoolean := match(inVar) local Boolean fixed; - case (BackendDAE.VAR(values = SOME(DAE.VAR_ATTR_REAL(fixed=SOME(DAE.BCONST(fixed)))))) then fixed; - case (BackendDAE.VAR(values = SOME(DAE.VAR_ATTR_INT(fixed=SOME(DAE.BCONST(fixed)))))) then fixed; - case (BackendDAE.VAR(values = SOME(DAE.VAR_ATTR_BOOL(fixed=SOME(DAE.BCONST(fixed)))))) then fixed; - case (BackendDAE.VAR(values = SOME(DAE.VAR_ATTR_ENUMERATION(fixed=SOME(DAE.BCONST(fixed)))))) then fixed; + case (BackendDAE.VAR(values=SOME(DAE.VAR_ATTR_REAL(fixed=SOME(DAE.BCONST(fixed)))))) then fixed; + case (BackendDAE.VAR(values=SOME(DAE.VAR_ATTR_INT(fixed=SOME(DAE.BCONST(fixed)))))) then fixed; + case (BackendDAE.VAR(values=SOME(DAE.VAR_ATTR_BOOL(fixed=SOME(DAE.BCONST(fixed)))))) then fixed; + case (BackendDAE.VAR(values=SOME(DAE.VAR_ATTR_ENUMERATION(fixed=SOME(DAE.BCONST(fixed)))))) then fixed; // params and consts are by default fixed - case (BackendDAE.VAR(varKind = BackendDAE.PARAM())) then true; - case (BackendDAE.VAR(varKind = BackendDAE.CONST(),bindExp=SOME(_))) then true; + case (BackendDAE.VAR(varKind=BackendDAE.PARAM())) then true; + case (BackendDAE.VAR(varKind=BackendDAE.CONST(),bindExp=SOME(_))) then true; // rest defaults to false else false; - end matchcontinue; + end match; end varFixed; public function setVarStartValue "author: Frenkel TUD Sets the start value attribute of a variable." input BackendDAE.Var inVar; input DAE.Exp inExp; - output BackendDAE.Var outVar; + output BackendDAE.Var outVar = inVar; protected - DAE.ComponentRef a; - BackendDAE.VarKind b; - DAE.VarDirection c; - DAE.VarParallelism prl; - BackendDAE.Type d; - Option e; - Option f; - list g; - DAE.ElementSource source; - DAE.VariableAttributes attr; Option oattr; - Option ts; - Option s; - DAE.ConnectorType ct; - DAE.VarInnerOuter io; - Boolean unreplaceable; algorithm - BackendDAE.VAR(a, b, c, prl, d, e, f, g, source, oattr, ts, s, ct,io, unreplaceable) := 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, unreplaceable); + oattr := if isSome(inVar.values) then inVar.values else SOME(getVariableAttributefromType(inVar.varType)); + outVar.values := DAEUtil.setStartAttr(oattr, inExp); end setVarStartValue; public function setVarStartValueOption "author: Frenkel TUD Sets the start value attribute of a variable." input BackendDAE.Var inVar; input Option inExp; - output BackendDAE.Var outVar; + output BackendDAE.Var outVar = inVar; protected - DAE.ComponentRef a; - BackendDAE.VarKind b; - DAE.VarDirection c; - DAE.VarParallelism prl; - BackendDAE.Type d; - Option e; - Option f; - list g; - DAE.ElementSource source; - DAE.VariableAttributes attr; Option oattr; - Option ts; - Option s; - DAE.ConnectorType ct; - DAE.VarInnerOuter io; - Boolean unreplaceable; algorithm - BackendDAE.VAR(a, b, c, prl, d, e, f, g, source, oattr, ts, s, ct, io, unreplaceable) := 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, unreplaceable); + oattr := if isSome(inVar.values) then inVar.values else SOME(getVariableAttributefromType(inVar.varType)); + outVar.values := DAEUtil.setStartAttrOption(oattr, inExp); end setVarStartValueOption; public function setVarStartOrigin "author: Frenkel TUD Sets the startOrigin attribute of a variable." input BackendDAE.Var inVar; input Option startOrigin; - output BackendDAE.Var outVar; + output BackendDAE.Var outVar = inVar; protected - DAE.ComponentRef a; - BackendDAE.VarKind b; - DAE.VarDirection c; - DAE.VarParallelism prl; - BackendDAE.Type d; - Option e; - Option f; - list g; - DAE.ElementSource source; - DAE.VariableAttributes attr; Option oattr; - Option ts; - Option s; - DAE.ConnectorType ct; - DAE.VarInnerOuter io; - Boolean unreplaceable; algorithm - BackendDAE.VAR(a, b, c, prl, d, e, f, g, source, oattr, ts, s, ct, io, unreplaceable) := 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, unreplaceable); + oattr := if isSome(inVar.values) then inVar.values else SOME(getVariableAttributefromType(inVar.varType)); + outVar.values := DAEUtil.setStartOrigin(oattr, startOrigin); end setVarStartOrigin; public function setVarAttributes "sets the variable attributes of a variable. author: Peter Aronsson (paronsson@wolfram.com)" - input BackendDAE.Var v; - input Option attr; - output BackendDAE.Var outV; -protected - DAE.ComponentRef a; - BackendDAE.VarKind b; - DAE.VarDirection c; - DAE.VarParallelism prl; - BackendDAE.Type d; - Option e; - Option f; - list g; - DAE.ElementSource source; - Option s; - Option ts; - DAE.ConnectorType ct; - DAE.VarInnerOuter io; - Boolean unreplaceable; + input BackendDAE.Var inVar; + input Option inAttr; + output BackendDAE.Var outVar = inVar; algorithm - BackendDAE.VAR(a, b, c, prl, d, e, f, g, source, _, ts, s, ct, io, unreplaceable) := v; - outV := BackendDAE.VAR(a, b, c, prl, d, e, f, g, source, attr, ts, s, ct, io, unreplaceable); + outVar.values := inAttr; end setVarAttributes; public function varStartValue "author: PA Returns the DAE.StartValue of a variable." - input BackendDAE.Var v; + input BackendDAE.Var inVar; output DAE.Exp sv; -protected - Option attr; algorithm - BackendDAE.VAR(values=attr) := v; - sv := DAEUtil.getStartAttr(attr); + sv := DAEUtil.getStartAttr(inVar.values); end varStartValue; public function varUnreplaceable "author: lochel Returns the unreplaceable attribute of a variable." input BackendDAE.Var inVar; - output Boolean outUnreplaceable; -algorithm - BackendDAE.VAR(unreplaceable=outUnreplaceable) := inVar; + output Boolean outUnreplaceable = inVar.unreplaceable; end varUnreplaceable; public function varStartValueFail "author: Frenkel TUD @@ -462,7 +367,7 @@ public function varStateSelect "author: PA input BackendDAE.Var inVar; output DAE.StateSelect outStateSelect; algorithm - outStateSelect := matchcontinue (inVar) + outStateSelect := match (inVar) local DAE.StateSelect stateselect; @@ -470,36 +375,18 @@ algorithm then stateselect; else DAE.DEFAULT(); - end matchcontinue; + end match; end varStateSelect; -public function setVarStateSelect "author: Frenkel TUD - sets the state select attribute of a variable." +public function setVarStateSelect "Sets the state select attribute of a variable." input BackendDAE.Var inVar; input DAE.StateSelect stateSelect; - output BackendDAE.Var outVar; + output BackendDAE.Var outVar = inVar; protected - DAE.ComponentRef a; - BackendDAE.VarKind b; - DAE.VarDirection c; - DAE.VarParallelism prl; - BackendDAE.Type d; - Option e; - Option f; - list g; - DAE.ElementSource source; - DAE.VariableAttributes attr; Option oattr; - Option ts; - Option s; - DAE.ConnectorType ct; - DAE.VarInnerOuter io; - Boolean unreplaceable; algorithm - BackendDAE.VAR(a, b, c, prl, d, e, f, g, source, oattr, ts, s, ct, io, unreplaceable) := 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, unreplaceable); + oattr := if isSome(inVar.values) then inVar.values else SOME(getVariableAttributefromType(inVar.varType)); + outVar.values := DAEUtil.setStateSelect(oattr, stateSelect); end setVarStateSelect; public function varStateDerivative "author: Frenkel TUD 2013-01 @@ -525,40 +412,12 @@ public function setStateDerivative "author: Frenkel TUD sets the state derivative." input BackendDAE.Var inVar; input Option dcr; - output BackendDAE.Var outVar; + output BackendDAE.Var outVar = inVar; protected - DAE.ComponentRef a; - Integer indx; - DAE.VarDirection c; - DAE.VarParallelism prl; - BackendDAE.Type d; - Option e; - Option f; - list g; - DAE.ElementSource source; - Option oattr; - Option ts; - Option s; - DAE.ConnectorType ct; - DAE.VarInnerOuter io; - Boolean unreplaceable; + Integer index; algorithm - BackendDAE.VAR(varName=a, - varKind=BackendDAE.STATE(index=indx), - varDirection=c, - varParallelism=prl, - varType=d, - bindExp=e, - bindValue=f, - arryDim=g, - source=source, - values=oattr, - tearingSelectOption = ts, - comment=s, - connectorType=ct, - innerOuter=io, - unreplaceable=unreplaceable) := inVar; - outVar := BackendDAE.VAR(a, BackendDAE.STATE(indx, dcr), c, prl, d, e, f, g, source, oattr, ts, s, ct, io, unreplaceable); + BackendDAE.STATE(index=index) := inVar.varKind; + outVar.varKind := BackendDAE.STATE(index, dcr); end setStateDerivative; public function getVariableAttributefromType @@ -581,66 +440,30 @@ algorithm end match; end getVariableAttributefromType; -public function setVarFinal "author: Frenkel TUD - Sets the final attribute of a variable." +public function setVarFinal "Sets the final attribute of a variable." input BackendDAE.Var inVar; input Boolean finalPrefix; - output BackendDAE.Var outVar; + output BackendDAE.Var outVar = inVar; protected - DAE.ComponentRef a; - BackendDAE.VarKind b; - DAE.VarDirection c; - DAE.VarParallelism prl; - BackendDAE.Type d; - Option e; - Option f; - list g; - DAE.ElementSource source; - DAE.VariableAttributes attr; Option oattr; - Option ts; - Option s; - DAE.ConnectorType ct; - DAE.VarInnerOuter io; - Boolean unreplaceable; algorithm - BackendDAE.VAR(a, b, c, prl, d, e, f, g, source, oattr, ts, s, ct, io, unreplaceable) := 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, unreplaceable); + oattr := if isSome(inVar.values) then inVar.values else SOME(getVariableAttributefromType(inVar.varType)); + outVar.values := DAEUtil.setFinalAttr(oattr, finalPrefix); end setVarFinal; -public function setVarMinMax "author: Frenkel TUD - Sets the minmax attribute of a variable." +public function setVarMinMax "Sets the min/max attribute of a variable. + lochel: This function will not clear min/max attributes if both inMin and + inMax are NONE(). Is that the intended behaviour?" input BackendDAE.Var inVar; input Option inMin; input Option inMax; - output BackendDAE.Var outVar; + output BackendDAE.Var outVar = inVar; protected - DAE.ComponentRef a; - BackendDAE.VarKind b; - DAE.VarDirection c; - DAE.VarParallelism prl; - BackendDAE.Type d; - Option e; - Option f; - list g; - DAE.ElementSource source; - DAE.VariableAttributes attr; Option oattr; - Option ts; - Option s; - DAE.ConnectorType ct; - DAE.VarInnerOuter io; - Boolean unreplaceable; algorithm if isSome(inMin) or isSome(inMax) then - BackendDAE.VAR(a, b, c, prl, d, e, f, g, source, oattr, ts, s, ct, io, unreplaceable) := 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, unreplaceable); - else - outVar := inVar; + oattr := if isSome(inVar.values) then inVar.values else SOME(getVariableAttributefromType(inVar.varType)); + outVar.values := DAEUtil.setMinMax(oattr, inMin, inMax); end if; end setVarMinMax; @@ -648,29 +471,12 @@ public function setUnit "author: jhagemann Sets the unit attribute of a variable." input BackendDAE.Var inVar; input DAE.Exp inUnit; - output BackendDAE.Var outVar; + output BackendDAE.Var outVar = inVar; protected - DAE.ComponentRef a; - BackendDAE.VarKind b; - DAE.VarDirection c; - DAE.VarParallelism prl; - BackendDAE.Type d; - Option e; - Option f; - list g; - DAE.ElementSource source; - DAE.VariableAttributes attr; Option oattr; - Option ts; - Option s; - DAE.ConnectorType ct; - DAE.VarInnerOuter io; - Boolean unreplaceable; algorithm - BackendDAE.VAR(a, b, c, prl, d, e, f, g, source, oattr, ts, s, ct, io, unreplaceable) := 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, unreplaceable); + oattr := if isSome(inVar.values) then inVar.values else SOME(getVariableAttributefromType(inVar.varType)); + outVar.values := DAEUtil.setUnitAttr(oattr, inUnit); end setUnit; public function varNominalValue "author: Frenkel TUD" @@ -684,29 +490,12 @@ public function setVarNominalValue "author: Frenkel TUD Sets the nominal value attribute of a variable." input BackendDAE.Var inVar; input DAE.Exp inExp; - output BackendDAE.Var outVar; + output BackendDAE.Var outVar = inVar; protected - DAE.ComponentRef a; - BackendDAE.VarKind b; - DAE.VarDirection c; - DAE.VarParallelism prl; - BackendDAE.Type d; - Option e; - Option f; - list g; - DAE.ElementSource source; - DAE.VariableAttributes attr; Option oattr; - Option ts; - Option s; - DAE.ConnectorType ct; - DAE.VarInnerOuter io; - Boolean unreplaceable; algorithm - BackendDAE.VAR(a, b, c, prl, d, e, f, g, source, oattr, ts, s, ct, io, unreplaceable) := 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, unreplaceable); + oattr := if isSome(inVar.values) then inVar.values else SOME(getVariableAttributefromType(inVar.varType)); + outVar.values := DAEUtil.setNominalAttr(oattr, inExp); end setVarNominalValue; public function varType "author: PA @@ -1801,78 +1590,18 @@ public function setVarKind "author: PA Sets the BackendDAE.VarKind of a variable" input BackendDAE.Var inVar; input BackendDAE.VarKind inVarKind; - output BackendDAE.Var outVar; -protected - DAE.ComponentRef cr; - DAE.VarDirection dir; - DAE.VarParallelism prl; - BackendDAE.Type tp; - Option bind; - Option v; - list dim; - DAE.ElementSource source; - Option attr; - Option ts; - Option comment; - DAE.ConnectorType ct; - BackendDAE.Var oVar; - DAE.VarInnerOuter io; - Boolean unreplaceable; + output BackendDAE.Var outVar = inVar; algorithm - BackendDAE.VAR(varName=cr, - varDirection=dir, - varParallelism=prl, - varType=tp, - bindExp=bind, - bindValue=v, - arryDim=dim, - source=source, - values=attr, - tearingSelectOption=ts, - comment=comment, - connectorType=ct, - innerOuter=io, - unreplaceable=unreplaceable) := inVar; - outVar := BackendDAE.VAR(cr, inVarKind, dir, prl, tp, bind, v, dim, source, attr, ts, comment, ct, io, unreplaceable); + outVar.varKind := inVarKind; // referenceUpdate(inVar, 2, new_kind); end setVarKind; public function setVarTS "Sets the BackendDAE.TearingSelect of a variable" input BackendDAE.Var inVar; input Option inTS; - output BackendDAE.Var outVar; -protected - DAE.ComponentRef cr; - DAE.VarDirection dir; - DAE.VarParallelism prl; - BackendDAE.Type tp; - Option bind; - Option v; - list dim; - DAE.ElementSource source; - Option attr; - Option comment; - DAE.ConnectorType ct; - BackendDAE.Var oVar; - DAE.VarInnerOuter io; - Boolean unreplaceable; - BackendDAE.VarKind varKind; + output BackendDAE.Var outVar = inVar; algorithm - BackendDAE.VAR(varName=cr, - varDirection=dir, - varParallelism=prl, - varType=tp, - varKind=varKind, - bindExp=bind, - bindValue=v, - arryDim=dim, - source=source, - values=attr, - comment=comment, - connectorType=ct, - innerOuter=io, - unreplaceable=unreplaceable) := inVar; - outVar := BackendDAE.VAR(cr, varKind, dir, prl, tp, bind, v, dim, source, attr, inTS, comment, ct, io, unreplaceable); + outVar.tearingSelectOption := inTS; // referenceUpdate(inVar, 2, new_kind); end setVarTS; @@ -1880,135 +1609,40 @@ end setVarTS; public function setBindExp "author: lochel" input BackendDAE.Var inVar; input Option inBindExp; - output BackendDAE.Var outVar; -protected - DAE.ComponentRef cr; - BackendDAE.VarKind varKind; - DAE.VarDirection dir; - DAE.VarParallelism prl; - BackendDAE.Type tp; - Option v; - list dim; - DAE.ElementSource source; - Option attr; - Option ts; - Option comment; - DAE.ConnectorType ct; - BackendDAE.Var oVar; - DAE.VarInnerOuter io; - Boolean unreplaceable; + output BackendDAE.Var outVar = inVar; algorithm - BackendDAE.VAR(varName=cr, - varKind=varKind, - varDirection=dir, - varParallelism=prl, - varType=tp, - bindValue=v, - arryDim=dim, - source=source, - values=attr, - tearingSelectOption=ts, - comment=comment, - connectorType=ct, - innerOuter=io, - unreplaceable=unreplaceable) := inVar; - outVar := BackendDAE.VAR(cr, varKind, dir, prl, tp, inBindExp, v, dim, source, attr, ts, comment, ct, io, unreplaceable); + outVar.bindExp := inBindExp; end setBindExp; public function setBindValue "author: lochel" input BackendDAE.Var inVar; input Option inBindValue; - output BackendDAE.Var outVar; -protected - DAE.ComponentRef cr; - BackendDAE.VarKind varKind; - DAE.VarDirection dir; - DAE.VarParallelism prl; - BackendDAE.Type tp; - Option bindExp; - list dim; - DAE.ElementSource source; - Option attr; - Option ts; - Option comment; - DAE.ConnectorType ct; - DAE.VarInnerOuter io; - Boolean unreplaceable; + output BackendDAE.Var outVar = inVar; algorithm - BackendDAE.VAR(varName=cr, - varKind=varKind, - varDirection=dir, - varParallelism=prl, - varType=tp, - bindExp=bindExp, - arryDim=dim, - source=source, - values=attr, - tearingSelectOption=ts, - comment=comment, - connectorType=ct, - innerOuter=io, - unreplaceable=unreplaceable) := inVar; - outVar := BackendDAE.VAR(cr, varKind, dir, prl, tp, bindExp, inBindValue, dim, source, attr, ts, comment, ct, io, unreplaceable); + outVar.bindValue := inBindValue; end setBindValue; public function setVarDirectionTpl input BackendDAE.Var inVar; input DAE.VarDirection inDir; - output BackendDAE.Var var; - output DAE.VarDirection dir; + output BackendDAE.Var outVar; + output DAE.VarDirection outDir = inDir; algorithm - var := setVarDirection(inVar, inDir); - dir := inDir; + outVar := setVarDirection(inVar, inDir); end setVarDirectionTpl; public function setVarDirection "author: lochel Sets the DAE.VarDirection of a variable" input BackendDAE.Var inVar; input DAE.VarDirection inVarDirection; - output BackendDAE.Var outVar; -protected - DAE.ComponentRef cr; - BackendDAE.VarKind kind; - DAE.VarParallelism prl; - BackendDAE.Type tp; - Option bind; - Option v; - list dim; - DAE.ElementSource source; - Option attr; - Option ts; - Option comment; - DAE.ConnectorType ct; - BackendDAE.Var oVar; - DAE.VarInnerOuter io; - Boolean unreplaceable; + output BackendDAE.Var outVar = inVar; algorithm - BackendDAE.VAR(varName=cr, - varKind=kind, - varParallelism=prl, - varType=tp, - bindExp=bind, - bindValue=v, - arryDim=dim, - source=source, - values=attr, - tearingSelectOption=ts, - comment=comment, - connectorType=ct, - innerOuter=io, - unreplaceable=unreplaceable) := inVar; - outVar := BackendDAE.VAR(cr, kind, inVarDirection, prl, tp, bind, v, dim, source, attr, ts, comment, ct, io, unreplaceable); // referenceUpdate(inVar, 3, varDirection); + outVar.varDirection := inVarDirection; // referenceUpdate(inVar, 3, varDirection); end setVarDirection; -public function getVarDirection "author: wbraun - Get the DAE.VarDirection of a variable" +public function getVarDirection "Get the DAE.VarDirection of a variable" input BackendDAE.Var inVar; - output DAE.VarDirection varDirection; -algorithm - varDirection := match (inVar) - case (BackendDAE.VAR(varDirection = varDirection)) then varDirection; - end match; + output DAE.VarDirection varDirection = inVar.varDirection; end getVarDirection; public function getVarNominalValue " @@ -2061,20 +1695,10 @@ algorithm end isVarOnTopLevelAndOutput; public function isVarOnTopLevelAndInput "and has the DAE.VarDirection = INPUT - The check for top-model is done by spliting the name at \'.\' and - check if the list-length is 1" + The check for top-model is done by splitting the name at '.' and checking if + the list-length is 1." input BackendDAE.Var inVar; - output Boolean outBoolean; -algorithm - outBoolean:= - match (inVar) - local - DAE.ComponentRef cr; - DAE.VarDirection dir; - DAE.ConnectorType ct; - case (BackendDAE.VAR(varName = cr,varDirection = dir,connectorType = ct)) - then topLevelInput(cr, dir, ct); - end match; + output Boolean outBoolean = topLevelInput(inVar.varName, inVar.varDirection, inVar.connectorType); end isVarOnTopLevelAndInput; public function isVarOnTopLevelAndInputNoDerInput @@ -2083,7 +1707,7 @@ public function isVarOnTopLevelAndInputNoDerInput end isVarOnTopLevelAndInputNoDerInput; public function topLevelInput "author: PA - Succeds if variable is input declared at the top level of the model, + Succeeds if variable is input declared at the top level of the model, or if it is an input in a connector instance at top level." input DAE.ComponentRef inComponentRef; input DAE.VarDirection inVarDirection; @@ -2113,69 +1737,30 @@ algorithm end topLevelOutput; -public function isFinalVar "author: Frenkel TUD - Returns true if var is final." - input BackendDAE.Var v; - output Boolean b; -algorithm - b := match(v) - local - Option attr; - case (BackendDAE.VAR(values = attr)) - equation - b=DAEUtil.getFinalAttr(attr); - then b; - end match; +public function isFinalVar "Returns true if the variable is final." + input BackendDAE.Var inVar; + output Boolean b = DAEUtil.getFinalAttr(inVar.values); end isFinalVar; public function isFinalOrProtectedVar - input BackendDAE.Var v; - output Boolean b; -algorithm - b := match(v) - local - Option attr; - case (BackendDAE.VAR(values = attr)) - equation - b = DAEUtil.getFinalAttr(attr) or DAEUtil.getProtectedAttr(attr); - then b; - end match; + input BackendDAE.Var inVar; + output Boolean b = DAEUtil.getFinalAttr(inVar.values) or DAEUtil.getProtectedAttr(inVar.values); end isFinalOrProtectedVar; -public function getVariableAttributes "author: Frenkel TUD 2011-04 - returns the DAE.VariableAttributes of a variable" +public function getVariableAttributes "Returns the DAE.VariableAttributes of a variable." input BackendDAE.Var inVar; - output Option outAttr; -algorithm - outAttr := match (inVar) - local - Option attr; - case BackendDAE.VAR(values = attr) then attr; - end match; + output Option outAttr = inVar.values; end getVariableAttributes; -public function getVarSource "author: Frenkel TUD 2011-04 - returns the DAE.ElementSource of a variable" +public function getVarSource "Returns the DAE.ElementSource of a variable" input BackendDAE.Var inVar; - output DAE.ElementSource outSource; -algorithm - outSource := match (inVar) - local - DAE.ElementSource source; - case BackendDAE.VAR(source = source) then source; - end match; + output DAE.ElementSource outSource = inVar.source; end getVarSource; public function getVarType "author: marcusw returns the BackendDAE.Type of the variable" input BackendDAE.Var inVar; - output BackendDAE.Type outType; -algorithm - outType := match (inVar) - local - BackendDAE.Type varType; - case BackendDAE.VAR(varType=varType) then varType; - end match; + output BackendDAE.Type outType = inVar.varType; end getVarType; public function getMinMaxAsserts "author: Frenkel TUD 2011-03" @@ -2226,18 +1811,18 @@ protected function getMinMaxAsserts1 "author: Frenkel TUD 2011-03" input DAE.Type tp; output DAE.Exp cond; algorithm - cond := - match (ominmax,e,tp) + cond := match ominmax local - DAE.Exp min,max; - case (SOME(min)::(SOME(max)::{}),_,_) - then DAE.LBINARY(DAE.RELATION(e,DAE.GREATEREQ(tp),min,-1,NONE()), - DAE.AND(DAE.T_BOOL_DEFAULT), - DAE.RELATION(e,DAE.LESSEQ(tp),max,-1,NONE())); - case (SOME(min)::(NONE()::{}),_,_) - then DAE.RELATION(e,DAE.GREATEREQ(tp),min,-1,NONE()); - case (NONE()::(SOME(max)::{}),_,_) - then DAE.RELATION(e,DAE.LESSEQ(tp),max,-1,NONE()); + DAE.Exp min, max; + + case SOME(min)::(SOME(max)::{}) + then DAE.LBINARY(DAE.RELATION(e, DAE.GREATEREQ(tp), min, -1, NONE()), DAE.AND(DAE.T_BOOL_DEFAULT), DAE.RELATION(e, DAE.LESSEQ(tp), max, -1, NONE())); + + case SOME(min)::(NONE()::{}) + then DAE.RELATION(e, DAE.GREATEREQ(tp), min, -1, NONE()); + + case NONE()::(SOME(max)::{}) + then DAE.RELATION(e, DAE.LESSEQ(tp), max, -1, NONE()); end match; end getMinMaxAsserts1; @@ -2261,7 +1846,7 @@ algorithm case BackendDAE.VAR(varKind=BackendDAE.CONST()) then inAsserts; - case BackendDAE.VAR(varName=name, values=attr as SOME(DAE.VAR_ATTR_REAL(nominal=SOME(e))), varType=varType, source=source) equation + case BackendDAE.VAR(varName=name, values=attr as SOME(DAE.VAR_ATTR_REAL(nominal=SOME(e))), varType=varType, source=source) equation minmax = DAEUtil.getMinMax(attr); tp = BackendDAEUtil.makeExpType(varType); @@ -2270,11 +1855,11 @@ algorithm (cond, _) = ExpressionSimplify.simplify(cond); false = Expression.isConstTrue(cond); - str = "Nominal " + ComponentReference.printComponentRefStr(name) + " out of [min, max] interval: "; + str = "Nominal " + ComponentReference.printComponentRefStr(name) + " out of [min, max] interval: "; str = str + ExpressionDump.printExpStr(cond) + " has value: "; // if is real use %g otherwise use %d (ints and enums) format = if Types.isRealOrSubTypeReal(tp) then "g" else "d"; - msg = DAE.BINARY(DAE.SCONST(str), DAE.ADD(DAE.T_STRING_DEFAULT), DAE.CALL(Absyn.IDENT("String"), {e, DAE.SCONST(format)}, DAE.callAttrBuiltinString)); + msg = DAE.BINARY(DAE.SCONST(str), DAE.ADD(DAE.T_STRING_DEFAULT), DAE.CALL(Absyn.IDENT("String"), {e, DAE.SCONST(format)}, DAE.callAttrBuiltinString)); BackendDAEUtil.checkAssertCondition(cond, msg, DAE.ASSERTIONLEVEL_WARNING, DAEUtil.getElementSourceFileInfo(source)); then DAE.ALGORITHM_STMTS({DAE.STMT_ASSERT(cond, msg, DAE.ASSERTIONLEVEL_WARNING, source)})::inAsserts; @@ -2352,15 +1937,10 @@ end daenumVariables; protected function copyArray "Makes a copy of a variable array." - input BackendDAE.VariableArray inArray; - output BackendDAE.VariableArray outArray; -protected - Integer num_elems, size; - array> vars; + input BackendDAE.VariableArray inVariableArray; + output BackendDAE.VariableArray outVariableArray = inVariableArray; algorithm - BackendDAE.VARIABLE_ARRAY(num_elems, size, vars) := inArray; - vars := arrayCopy(vars); - outArray := BackendDAE.VARIABLE_ARRAY(num_elems, size, vars); + outVariableArray.varOptArr := arrayCopy(inVariableArray.varOptArr); end copyArray; protected function vararrayEmpty @@ -2397,15 +1977,10 @@ protected function vararraySetnth input BackendDAE.VariableArray inVariableArray; input Integer inIndex; input BackendDAE.Var inVar; - output BackendDAE.VariableArray outVariableArray; -protected - array> arr; - Integer num_elems, size; + output BackendDAE.VariableArray outVariableArray = inVariableArray; algorithm - BackendDAE.VARIABLE_ARRAY(num_elems, size, arr) := inVariableArray; - true := inIndex <= num_elems; - arrayUpdate(arr, inIndex, SOME(inVar)); - outVariableArray := BackendDAE.VARIABLE_ARRAY(num_elems, size, arr); + true := inIndex <= inVariableArray.numberOfElements; + arrayUpdate(inVariableArray.varOptArr, inIndex, SOME(inVar)); end vararraySetnth; protected function vararrayNth @@ -2413,28 +1988,19 @@ protected function vararrayNth input BackendDAE.VariableArray inVariableArray; input Integer inIndex; output BackendDAE.Var outVar; -protected - array> arr; - Integer num_elems; algorithm - BackendDAE.VARIABLE_ARRAY(numberOfElements = num_elems, varOptArr = arr) := inVariableArray; - true := inIndex <= num_elems; - SOME(outVar) := arr[inIndex]; + true := inIndex <= inVariableArray.numberOfElements; + SOME(outVar) := arrayGet(inVariableArray.varOptArr, inIndex); end vararrayNth; protected function vararrayDelete input BackendDAE.VariableArray inVariableArray; input Integer inIndex; - output BackendDAE.VariableArray outVariableArray; + output BackendDAE.VariableArray outVariableArray = inVariableArray; output BackendDAE.Var outVar; -protected - Integer num_elems, arr_size; - array> arr; algorithm - BackendDAE.VARIABLE_ARRAY(num_elems, arr_size, arr) := inVariableArray; - SOME(outVar) := arr[inIndex]; - arrayUpdate(arr, inIndex, NONE()); - outVariableArray := BackendDAE.VARIABLE_ARRAY(num_elems, arr_size, arr); + SOME(outVar) := arrayGet(outVariableArray.varOptArr, inIndex); + arrayUpdate(outVariableArray.varOptArr, inIndex, NONE()); end vararrayDelete; protected function vararrayList @@ -2447,7 +2013,7 @@ protected BackendDAE.Var var; Option ovar; algorithm - BackendDAE.VARIABLE_ARRAY(numberOfElements = num_elems, varOptArr = arr) := inArray; + BackendDAE.VARIABLE_ARRAY(numberOfElements=num_elems, varOptArr=arr) := inArray; for i in num_elems:-1:1 loop ovar := arr[i]; @@ -2469,16 +2035,10 @@ public function copyVariables "Makes a copy of a Variables." input BackendDAE.Variables inVariables; output BackendDAE.Variables outVariables; -protected - array> indices; - BackendDAE.VariableArray varArr; - Integer buckets, num_vars, num_elems, arr_size; - array> varOptArr; -algorithm - BackendDAE.VARIABLES(indices, varArr, buckets, num_vars) := inVariables; - indices := arrayCopy(indices); - varArr := copyArray(varArr); - outVariables := BackendDAE.VARIABLES(indices, varArr, buckets, num_vars); +algorithm + outVariables := inVariables; + outVariables.crefIndices := arrayCopy(inVariables.crefIndices); + outVariables.varArr := copyArray(inVariables.varArr); end copyVariables; public function emptyVars @@ -2498,7 +2058,7 @@ algorithm end emptyVars; public function emptyVarsSized - "Returns a Variable datastructure that is empty." + "Returns a BackendDAE.Variables data structure that is empty." input Integer size; output BackendDAE.Variables outVariables = emptyVars(size); end emptyVarsSized; @@ -2512,11 +2072,8 @@ public function varList append all the variables from the sets we might get duplicates." input BackendDAE.Variables inVariables; output list outVarLst; -protected - BackendDAE.VariableArray arr; algorithm - BackendDAE.VARIABLES(varArr = arr) := inVariables; - outVarLst := vararrayList(arr); + outVarLst := vararrayList(inVariables.varArr); end varList; public function listVar @@ -2558,41 +2115,33 @@ public function equationSystemsVarsLst input list inVars; output list outVars; algorithm - outVars := match (systs,inVars) + outVars := match (systs) local BackendDAE.EqSystems rest; - list vars,vars1; + list vars, vars1; BackendDAE.Variables v; - case ({},_) then inVars; - case (BackendDAE.EQSYSTEM(orderedVars = v)::rest,_) - equation - vars = varList(v); - vars1 = listAppend(inVars,vars); - then - equationSystemsVarsLst(rest,vars1); - end match; -end equationSystemsVarsLst; + case {} then inVars; + case BackendDAE.EQSYSTEM(orderedVars=v)::rest equation + vars = varList(v); + vars1 = listAppend(inVars,vars); + then equationSystemsVarsLst(rest,vars1); + end match; +end equationSystemsVarsLst; public function daeVars - input BackendDAE.EqSystem syst; - output BackendDAE.Variables vars; -algorithm - BackendDAE.EQSYSTEM(orderedVars = vars) := syst; + input BackendDAE.EqSystem inEqSystem; + output BackendDAE.Variables vars = inEqSystem.orderedVars; end daeVars; public function daeKnVars - input BackendDAE.Shared shared; - output BackendDAE.Variables vars; -algorithm - BackendDAE.SHARED(knownVars = vars) := shared; + input BackendDAE.Shared inShared; + output BackendDAE.Variables outKnownVars = inShared.knownVars; end daeKnVars; public function daeAliasVars - input BackendDAE.Shared shared; - output BackendDAE.Variables vars; -algorithm - BackendDAE.SHARED(aliasVars = vars) := shared; + input BackendDAE.Shared inShared; + output BackendDAE.Variables outAliasVars = inShared.aliasVars; end daeAliasVars; public function varsSize @@ -2607,12 +2156,8 @@ protected function varsLoadFactor input BackendDAE.Variables inVariables; input Integer inIncrease = 0; output Real outLoadFactor; -protected - Integer buckets, num_vars; algorithm - BackendDAE.VARIABLES(bucketSize = buckets, numberOfVars = num_vars) := inVariables; - num_vars := num_vars + inIncrease; - outLoadFactor := intReal(num_vars) / buckets; + outLoadFactor := intReal(inVariables.numberOfVars + inIncrease) / intReal(inVariables.bucketSize); end varsLoadFactor; public function isVariable @@ -2631,23 +2176,21 @@ public function isVariable input BackendDAE.Variables inVariables3; algorithm _:= - matchcontinue (inComponentRef1,inVariables2,inVariables3) + matchcontinue (inComponentRef1, inVariables2, inVariables3) local DAE.ComponentRef cr; - BackendDAE.Variables vars,knvars; + BackendDAE.Variables vars, knvars; BackendDAE.VarKind kind; - case (cr,vars,_) - equation - ((BackendDAE.VAR(varKind = kind) :: _),_) = getVar(cr, vars); - isVarKindVariable(kind); - then - (); - case (cr,_,knvars) - equation - ((BackendDAE.VAR(varKind = kind) :: _),_) = getVar(cr, knvars); - isVarKindVariable(kind); - then - (); + + case (cr, vars, _) equation + ((BackendDAE.VAR(varKind=kind)::_), _) = getVar(cr, vars); + isVarKindVariable(kind); + then (); + + case (cr, _, knvars) equation + ((BackendDAE.VAR(varKind = kind) :: _), _) = getVar(cr, knvars); + isVarKindVariable(kind); + then (); end matchcontinue; end isVariable; @@ -2733,7 +2276,7 @@ algorithm case (_,_) equation true = intGt(varsSize(inDelVars),0); - newvars = traverseBackendDAEVars(inDelVars,deleteVars1,inVariables); + newvars = traverseBackendDAEVars(inDelVars, deleteVars1, inVariables); newvars = listVar1(varList(newvars)); then newvars; @@ -2746,14 +2289,10 @@ end deleteVars; protected function deleteVars1 input BackendDAE.Var inVar; input BackendDAE.Variables inVars; - output BackendDAE.Var v; - output BackendDAE.Variables vars; -protected - DAE.ComponentRef cr; + output BackendDAE.Var outVar = inVar; + output BackendDAE.Variables outVars; algorithm - v := inVar; - BackendDAE.VAR(varName = cr) := v; - vars := removeCref(cr,inVars); + outVars := removeCref(inVar.varName, inVars); end deleteVars1; public function deleteVar @@ -2842,17 +2381,14 @@ public function removeVarDAE "author: Frenkel TUD 2012-11 Removes a var from the vararray but does not scaling down the array" input Integer inVarPos "1 based index"; - input BackendDAE.EqSystem syst; - output BackendDAE.EqSystem osyst; + input BackendDAE.EqSystem inEqSystem; + output BackendDAE.EqSystem outEqSystem; output BackendDAE.Var outVar; +protected + BackendDAE.Variables vars; algorithm - (osyst,outVar) := match syst - local - BackendDAE.Variables vars; - case BackendDAE.EQSYSTEM(orderedVars=vars) - equation (vars, outVar) = removeVar(inVarPos, vars); - then (BackendDAEUtil.setEqSystVars(syst, vars), outVar); - end match; + (vars, outVar) := removeVar(inVarPos, inEqSystem.orderedVars); + outEqSystem := BackendDAEUtil.setEqSystVars(inEqSystem, vars); end removeVarDAE; public function removeAliasVars "remove alias Vars" @@ -2879,8 +2415,7 @@ algorithm (arr, outVar as BackendDAE.VAR(varName = cr)) := vararrayDelete(arr, inIndex); hash_idx := ComponentReference.hashComponentRefMod(cr, buckets) + 1; cr_indices := indices[hash_idx]; - cr_indices := List.deleteMemberOnTrue(BackendDAE.CREFINDEX(cr, inIndex - 1), - cr_indices, removeVar2); + cr_indices := List.deleteMemberOnTrue(BackendDAE.CREFINDEX(cr, inIndex - 1), cr_indices, removeVar2); arrayUpdate(indices, hash_idx, cr_indices); outVariables := BackendDAE.VARIABLES(indices, arr, buckets, num_vars); end removeVar; @@ -2889,12 +2424,8 @@ protected function removeVar2 input BackendDAE.CrefIndex inCrefIndex1; input BackendDAE.CrefIndex inCrefIndex2; output Boolean outMatch; -protected - Integer i1, i2; algorithm - BackendDAE.CREFINDEX(index = i1) := inCrefIndex1; - BackendDAE.CREFINDEX(index = i2) := inCrefIndex2; - outMatch := i1 == i2; + outMatch := inCrefIndex1.index == inCrefIndex2.index; end removeVar2; public function existsVar @@ -2926,15 +2457,10 @@ public function addVarDAE Add a variable to Variables of a BackendDAE. If the variable already exists, the function updates the variable." input BackendDAE.Var inVar; - input BackendDAE.EqSystem syst; - output BackendDAE.EqSystem osyst; + input BackendDAE.EqSystem inEqSystem; + output BackendDAE.EqSystem outEqSystem; algorithm - osyst := match syst - local - BackendDAE.Variables vars; - case BackendDAE.EQSYSTEM(orderedVars=vars) - then BackendDAEUtil.setEqSystVars(syst, addVar(inVar, vars)); - end match; + outEqSystem := BackendDAEUtil.setEqSystVars(inEqSystem, addVar(inVar, inEqSystem.orderedVars)); end addVarDAE; public function addKnVarDAE @@ -2942,15 +2468,10 @@ public function addKnVarDAE Add a variable to Variables of a BackendDAE. If the variable already exists, the function updates the variable." input BackendDAE.Var inVar; - input BackendDAE.Shared shared; - output BackendDAE.Shared oshared; + input BackendDAE.Shared inShared; + output BackendDAE.Shared outShared; algorithm - oshared := match shared - local - BackendDAE.Variables knvars; - case BackendDAE.SHARED(knownVars=knvars) - then BackendDAEUtil.setSharedKnVars(shared, addVar(inVar, knvars)); - end match; + outShared := BackendDAEUtil.setSharedKnVars(inShared, addVar(inVar, inShared.knownVars)); end addKnVarDAE; public function addNewKnVarDAE @@ -2958,15 +2479,10 @@ public function addNewKnVarDAE Add a variable to Variables of a BackendDAE. No Check if variable already exist. Use only for new variables" input BackendDAE.Var inVar; - input BackendDAE.Shared shared; - output BackendDAE.Shared oshared; + input BackendDAE.Shared inShared; + output BackendDAE.Shared outShared; algorithm - oshared := match shared - local - BackendDAE.Variables knvars; - case BackendDAE.SHARED(knownVars=knvars) - then BackendDAEUtil.setSharedKnVars(shared, addNewVar(inVar, knvars)); - end match; + outShared := BackendDAEUtil.setSharedKnVars(inShared, addNewVar(inVar, inShared.knownVars)); end addNewKnVarDAE; public function addAliasVarDAE @@ -2974,15 +2490,10 @@ public function addAliasVarDAE Add a alias variable to Variables of a BackendDAE.Shared If the variable already exists, the function updates the variable." input BackendDAE.Var inVar; - input BackendDAE.Shared shared; - output BackendDAE.Shared oshared; + input BackendDAE.Shared inShared; + output BackendDAE.Shared outShared; algorithm - oshared := match shared - local - BackendDAE.Variables aliasVars; - case BackendDAE.SHARED(aliasVars=aliasVars) - then BackendDAEUtil.setSharedAliasVars(shared, addVar(inVar, aliasVars)); - end match; + outShared := BackendDAEUtil.setSharedAliasVars(inShared, addVar(inVar, inShared.aliasVars)); end addAliasVarDAE; public function addNewAliasVarDAE @@ -2990,46 +2501,32 @@ public function addNewAliasVarDAE Add a alias variable to Variables of a BackendDAE.Shared No Check if variable already exist. Use only for new variables" input BackendDAE.Var inVar; - input BackendDAE.Shared shared; - output BackendDAE.Shared oshared; + input BackendDAE.Shared inShared; + output BackendDAE.Shared outShared; algorithm - oshared := match shared - local - BackendDAE.Variables aliasVars; - case BackendDAE.SHARED(aliasVars=aliasVars) - then BackendDAEUtil.setSharedAliasVars(shared, addNewVar(inVar, aliasVars)); - end match; + outShared := BackendDAEUtil.setSharedAliasVars(inShared, addNewVar(inVar, inShared.aliasVars)); end addNewAliasVarDAE; public function addVar "Adds a variable to the set, or updates it if it already exists." input BackendDAE.Var inVar; input BackendDAE.Variables inVariables; - output BackendDAE.Variables outVariables; + output BackendDAE.Variables outVariables = inVariables; protected - DAE.ComponentRef cr, cr2; - array> hashvec; - BackendDAE.VariableArray varr; - Integer bsize, num_vars, hash_idx, arr_idx; + Integer hash_idx, arr_idx; list indices; algorithm - BackendDAE.VAR(varName = cr) := inVar; - BackendDAE.VARIABLES(hashvec, varr, bsize, num_vars) := inVariables; - - hash_idx := ComponentReference.hashComponentRefMod(cr, bsize) + 1; - indices := hashvec[hash_idx]; + hash_idx := ComponentReference.hashComponentRefMod(inVar.varName, inVariables.bucketSize) + 1; + indices := arrayGet(inVariables.crefIndices, hash_idx); try - BackendDAE.CREFINDEX(index = arr_idx) := - List.getMemberOnTrue(cr, indices, crefIndexEqualCref); - varr := vararraySetnth(varr, arr_idx + 1, inVar); + BackendDAE.CREFINDEX(index=arr_idx) := List.getMemberOnTrue(inVar.varName, indices, crefIndexEqualCref); + outVariables.varArr := vararraySetnth(inVariables.varArr, arr_idx+1, inVar); else - varr := vararrayAdd(varr, inVar); - arrayUpdate(hashvec, hash_idx, (BackendDAE.CREFINDEX(cr, num_vars) :: indices)); - num_vars := num_vars + 1; + outVariables.varArr := vararrayAdd(outVariables.varArr, inVar); + arrayUpdate(outVariables.crefIndices, hash_idx, (BackendDAE.CREFINDEX(inVar.varName, outVariables.numberOfVars)::indices)); + outVariables.numberOfVars := outVariables.numberOfVars + 1; end try; - - outVariables := BackendDAE.VARIABLES(hashvec, varr, bsize, num_vars); end addVar; public function addVars @@ -3048,18 +2545,16 @@ public function addNewVar input BackendDAE.Variables inVariables; output BackendDAE.Variables outVariables; protected - DAE.ComponentRef cr; array> hashvec; BackendDAE.VariableArray varr; Integer bsize, num_vars, idx; list indices; algorithm - BackendDAE.VAR(varName = cr) := inVar; BackendDAE.VARIABLES(hashvec, varr, bsize, num_vars) := inVariables; - idx := ComponentReference.hashComponentRefMod(cr, bsize) + 1; + idx := ComponentReference.hashComponentRefMod(inVar.varName, bsize) + 1; varr := vararrayAdd(varr, inVar); indices := hashvec[idx]; - arrayUpdate(hashvec, idx, (BackendDAE.CREFINDEX(cr, num_vars) :: indices)); + arrayUpdate(hashvec, idx, (BackendDAE.CREFINDEX(inVar.varName, num_vars)::indices)); outVariables := BackendDAE.VARIABLES(hashvec, varr, bsize, num_vars + 1); end addNewVar; @@ -3075,8 +2570,7 @@ protected Option ovar; algorithm // TODO: Don't rehash if the sets have the same size! - BackendDAE.VARIABLES(varArr = BackendDAE.VARIABLE_ARRAY( - numberOfElements = num_vars, varOptArr = vars)) := inSrcVars; + BackendDAE.VARIABLES(varArr=BackendDAE.VARIABLE_ARRAY(numberOfElements=num_vars, varOptArr=vars)) := inSrcVars; for i in 1:num_vars loop ovar := vars[i]; @@ -3092,11 +2586,8 @@ public function getVarAt input BackendDAE.Variables inVariables; input Integer inIndex; output BackendDAE.Var outVar; -protected - BackendDAE.VariableArray arr; algorithm - BackendDAE.VARIABLES(varArr=arr) := inVariables; - outVar := vararrayNth(arr, inIndex); + outVar := vararrayNth(inVariables.varArr, inIndex); end getVarAt; public function setVarAt @@ -3104,11 +2595,8 @@ public function setVarAt input Integer inIndex; input BackendDAE.Var inVar; output BackendDAE.Variables outVariables = inVariables; -protected - BackendDAE.VariableArray arr; algorithm - BackendDAE.VARIABLES(varArr = arr) := inVariables; - vararraySetnth(arr, inIndex, inVar); + vararraySetnth(inVariables.varArr, inIndex, inVar); end setVarAt; public function getVarAtIndexFirst @@ -3125,55 +2613,32 @@ public function getVarSharedAt "author: Frenkel TUD 2012-12 return a Variable." input Integer inInteger; - input BackendDAE.Shared shared; + input BackendDAE.Shared inShared; output BackendDAE.Var outVar; -protected - BackendDAE.Variables vars; algorithm - BackendDAE.SHARED(knownVars=vars) := shared; - outVar := getVarAt(vars,inInteger); + outVar := getVarAt(inShared.knownVars, inInteger); end getVarSharedAt; public function getVarDAE "author: Frenkel TUD 2012-05 return a Variable." input DAE.ComponentRef inComponentRef; - input BackendDAE.EqSystem syst; + input BackendDAE.EqSystem inEqSystem; output list outVarLst; output list outIntegerLst; algorithm - (outVarLst,outIntegerLst) := match (inComponentRef,syst) - local - BackendDAE.Variables vars; - list varlst; - list indxlst; - case (_,BackendDAE.EQSYSTEM(orderedVars=vars)) - equation - (varlst,indxlst) = getVar(inComponentRef,vars); - then - (varlst,indxlst); - end match; + (outVarLst, outIntegerLst) := getVar(inComponentRef, inEqSystem.orderedVars); end getVarDAE; public function getVarShared "author: Frenkel TUD 2012-05 return a Variable." input DAE.ComponentRef inComponentRef; - input BackendDAE.Shared shared; + input BackendDAE.Shared inShared; output list outVarLst; output list outIntegerLst; algorithm - (outVarLst,outIntegerLst) := match (inComponentRef,shared) - local - BackendDAE.Variables vars; - list varlst; - list indxlst; - case (_,BackendDAE.SHARED(knownVars=vars)) - equation - (varlst,indxlst) = getVar(inComponentRef,vars); - then - (varlst,indxlst); - end match; + (outVarLst, outIntegerLst) := getVar(inComponentRef, inShared.knownVars); end getVarShared; public function getVar @@ -3335,12 +2800,12 @@ end computeRangeExps; public function getVarLst input list inComponentRefLst; input BackendDAE.Variables inVariables; - input list iVarLst; + input list inVarLst; input list iIntegerLst; output list outVarLst; output list outIntegerLst; algorithm - (outVarLst,outIntegerLst) := matchcontinue(inComponentRefLst,inVariables,iVarLst,iIntegerLst) + (outVarLst,outIntegerLst) := matchcontinue(inComponentRefLst,inVariables,inVarLst,iIntegerLst) local list crlst; DAE.ComponentRef cr; @@ -3348,16 +2813,16 @@ algorithm list ilst; BackendDAE.Var v; Integer indx; - case ({},_,_,_) then (iVarLst,iIntegerLst); + case ({},_,_,_) then (inVarLst,iIntegerLst); case (cr::crlst,_,_,_) equation (v,indx) = getVar2(cr, inVariables); - (varlst,ilst) = getVarLst(crlst,inVariables,v::iVarLst,indx::iIntegerLst); + (varlst,ilst) = getVarLst(crlst,inVariables,v::inVarLst,indx::iIntegerLst); then (varlst,ilst); case (_::crlst,_,_,_) equation - (varlst,ilst) = getVarLst(crlst,inVariables,iVarLst,iIntegerLst); + (varlst,ilst) = getVarLst(crlst,inVariables,inVarLst,iIntegerLst); then (varlst,ilst); end matchcontinue; @@ -3375,12 +2840,10 @@ protected list cr_indices; DAE.ComponentRef cr; algorithm - BackendDAE.VARIABLES(crefIndices = indices, varArr = arr, - bucketSize = buckets) := inVariables; + BackendDAE.VARIABLES(crefIndices=indices, varArr=arr, bucketSize=buckets) := inVariables; hash_idx := ComponentReference.hashComponentRefMod(inCref, buckets) + 1; cr_indices := indices[hash_idx]; - BackendDAE.CREFINDEX(index = outIndex) := List.getMemberOnTrue(inCref, - cr_indices, crefIndexEqualCref); + BackendDAE.CREFINDEX(index=outIndex) := List.getMemberOnTrue(inCref, cr_indices, crefIndexEqualCref); outIndex := outIndex + 1; outVar as BackendDAE.VAR(varName = cr) := vararrayNth(arr, outIndex); true := ComponentReference.crefEqualNoStringCompare(cr, inCref); @@ -3444,13 +2907,10 @@ public function mergeVariables output BackendDAE.Variables outVariables; protected Integer num_vars; - Integer b1, b2; algorithm num_vars := varsSize(inVariables2); if varsLoadFactor(inVariables1, num_vars) > 1 then - BackendDAE.VARIABLES(bucketSize = b1) := inVariables1; - BackendDAE.VARIABLES(bucketSize = b2) := inVariables2; outVariables := emptyVarsSized(varsSize(inVariables1) + num_vars); outVariables := addVariables(inVariables1, outVariables); else @@ -3491,10 +2951,8 @@ protected Integer num_vars; array> vars; algorithm - BackendDAE.VARIABLES(varArr = BackendDAE.VARIABLE_ARRAY( - numberOfElements = num_vars, varOptArr = vars)) := inVariables; - outArg := BackendDAEUtil.traverseArrayNoCopy(vars, inFunc, - traverseBackendDAEVars2, inArg, num_vars); + BackendDAE.VARIABLES(varArr=BackendDAE.VARIABLE_ARRAY(numberOfElements=num_vars, varOptArr=vars)) := inVariables; + outArg := BackendDAEUtil.traverseArrayNoCopy(vars, inFunc, traverseBackendDAEVars2, inArg, num_vars); end traverseBackendDAEVars; protected function traverseBackendDAEVars2 @@ -3542,10 +3000,8 @@ protected Integer num_vars; array> vars; algorithm - BackendDAE.VARIABLES(varArr = BackendDAE.VARIABLE_ARRAY( - numberOfElements = num_vars, varOptArr = vars)) := inVariables; - outArg := BackendDAEUtil.traverseArrayNoCopyWithStop(vars, inFunc, - traverseBackendDAEVarsWithStop2, inArg, num_vars); + BackendDAE.VARIABLES(varArr=BackendDAE.VARIABLE_ARRAY(numberOfElements=num_vars, varOptArr=vars)) := inVariables; + outArg := BackendDAEUtil.traverseArrayNoCopyWithStop(vars, inFunc,traverseBackendDAEVarsWithStop2, inArg, num_vars); end traverseBackendDAEVarsWithStop; protected function traverseBackendDAEVarsWithStop2 @@ -3594,15 +3050,16 @@ public function traverseBackendDAEVarsWithUpdate end FuncType; protected array> indices; - Integer buckets, num_vars, num_elems, arr_size; + Integer buckets, num_vars1, num_vars2, num_elems, arr_size; array> vars; algorithm - BackendDAE.VARIABLES(indices, BackendDAE.VARIABLE_ARRAY( - num_vars, arr_size, vars), buckets, num_vars) := inVariables; - (vars, outArg) := BackendDAEUtil.traverseArrayNoCopyWithUpdate(vars, inFunc, - traverseBackendDAEVarsWithUpdate2, inArg, num_vars); - outVariables := BackendDAE.VARIABLES(indices, - BackendDAE.VARIABLE_ARRAY(num_vars, arr_size, vars), buckets, num_vars); + BackendDAE.VARIABLES(indices, BackendDAE.VARIABLE_ARRAY(num_vars1, arr_size, vars), buckets, num_vars2) := inVariables; + if num_vars1 <> num_vars2 then + Error.addInternalError("function traverseBackendDAEVarsWithUpdate failed", sourceInfo()); + fail(); + end if; + (vars, outArg) := BackendDAEUtil.traverseArrayNoCopyWithUpdate(vars, inFunc, traverseBackendDAEVarsWithUpdate2, inArg, num_vars1); + outVariables := BackendDAE.VARIABLES(indices, BackendDAE.VARIABLE_ARRAY(num_vars1, arr_size, vars), buckets, num_vars2); end traverseBackendDAEVarsWithUpdate; protected function traverseBackendDAEVarsWithUpdate2 @@ -3787,43 +3244,12 @@ end traversingisAlgStateVarIndexFinder; public function mergeVariableOperations input BackendDAE.Var inVar; input list inOps; - output BackendDAE.Var outVar; + output BackendDAE.Var outVar = inVar; protected - DAE.ComponentRef a; - BackendDAE.VarKind b; - DAE.VarDirection c; - DAE.VarParallelism p; - BackendDAE.Type d; - Option e; - Option f; - list g; - DAE.ElementSource source; - Option oattr; - Option ts; - Option s; - DAE.ConnectorType ct; list ops; - DAE.VarInnerOuter io; - Boolean unreplaceable; algorithm - BackendDAE.VAR(varName=a, - varKind=b, - varDirection=c, - varParallelism=p, - varType=d, - bindExp=e, - bindValue=f, - arryDim=g, - source=source, - values=oattr, - tearingSelectOption=ts, - comment=s, - connectorType=ct, - innerOuter=io, - unreplaceable=unreplaceable) := inVar; ops := listReverse(inOps); - source := List.foldr(ops, DAEUtil.addSymbolicTransformation, source); - outVar := BackendDAE.VAR(a, b, c, p, d, e, f, g, source, oattr, ts, s, ct, io, unreplaceable); + outVar.source := List.foldr(ops, DAEUtil.addSymbolicTransformation, inVar.source); end mergeVariableOperations; public function mergeAliasVars "author: Frenkel TUD 2011-04" @@ -4166,8 +3592,7 @@ public function mergeMinMaxAttribute input Boolean negate; output BackendDAE.Var outVar; algorithm - outVar := - matchcontinue (inAVar,inVar,negate) + outVar := matchcontinue (inAVar,inVar,negate) local BackendDAE.Var v,var,var1; Option attr,attr1; @@ -4190,14 +3615,11 @@ algorithm end mergeMinMaxAttribute; public function getMinMaxAttribute - input BackendDAE.Var iVar; - output Option oMin; - output Option oMax; -protected - Option attr; + input BackendDAE.Var inVar; + output Option outMin; + output Option outMax; algorithm - BackendDAE.VAR(values = attr) := iVar; - (oMin, oMax) := DAEUtil.getMinMaxValues(attr); + (outMin, outMax) := DAEUtil.getMinMaxValues(inVar.values); end getMinMaxAttribute; protected function mergeMinMax @@ -4228,24 +3650,22 @@ protected function checkMinMax algorithm _ := matchcontinue(inMin, inMax) local - DAE.Exp min,max; - String s,s1,s2,s3,s4,s5; - Real rmin,rmax; - - case (SOME(min),SOME(max)) - equation - rmin = Expression.toReal(min); - rmax = Expression.toReal(max); - true = realGt(rmin,rmax); - s1 = ComponentReference.printComponentRefStr(cr1); - s2 = if negate then " = -" else " = "; - s3 = ComponentReference.printComponentRefStr(cr2); - s4 = ExpressionDump.printExpStr(min); - s5 = ExpressionDump.printExpStr(max); - s = stringAppendList({"Alias variables ",s1,s2,s3," with invalid limits min ",s4," > max ",s5}); - Error.addMessage(Error.COMPILER_WARNING,{s}); - then - (); + DAE.Exp min, max; + String s, s1, s2, s3, s4, s5; + Real rmin, rmax; + + case (SOME(min), SOME(max)) equation + rmin = Expression.toReal(min); + rmax = Expression.toReal(max); + true = realGt(rmin, rmax); + s1 = ComponentReference.printComponentRefStr(cr1); + s2 = if negate then " = -" else " = "; + s3 = ComponentReference.printComponentRefStr(cr2); + s4 = ExpressionDump.printExpStr(min); + s5 = ExpressionDump.printExpStr(max); + s = stringAppendList({"Alias variables ", s1, s2, s3, " with invalid limits min ", s4, " > max ", s5}); + Error.addMessage(Error.COMPILER_WARNING, {s}); + then (); // no error else (); @@ -4261,12 +3681,10 @@ algorithm local DAE.Exp min1, min2, min; - case (SOME(min1), SOME(min2)) - algorithm - min := Expression.expMaxScalar(min1, min2); - min := ExpressionSimplify.simplify(min); - then - SOME(min); + case (SOME(min1), SOME(min2)) algorithm + min := Expression.expMaxScalar(min1, min2); + min := ExpressionSimplify.simplify(min); + then SOME(min); case (NONE(), _) then inMin2; case (_, NONE()) then inMin1; @@ -4283,12 +3701,10 @@ algorithm local DAE.Exp max1, max2, max; - case (SOME(max1), SOME(max2)) - algorithm - max := Expression.expMinScalar(max1, max2); - max := ExpressionSimplify.simplify(max); - then - SOME(max); + case (SOME(max1), SOME(max2)) algorithm + max := Expression.expMinScalar(max1, max2); + max := ExpressionSimplify.simplify(max); + then SOME(max); case (NONE(), _) then inMax2; case (_, NONE()) then inMax1; @@ -4296,64 +3712,33 @@ algorithm end match; end mergeMax; -// protected function mergeDirection -// input BackendDAE.Var inAVar; -// input BackendDAE.Var inVar; -// output BackendDAE.Var outVar; -// algorithm -// outVar := -// matchcontinue (inAVar,inVar) -// local -// BackendDAE.Var v,var,var1; -// Option attr,attr1; -// DAE.Exp e,e1; -// case (v as BackendDAE.VAR(varDirection = DAE.INPUT()),var as BackendDAE.VAR(varDirection = DAE.OUTPUT())) -// equation -// var1 = setVarDirection(var,DAE.INPUT()); -// then var1; -// case (v as BackendDAE.VAR(varDirection = DAE.INPUT()),var as BackendDAE.VAR(varDirection = DAE.BIDIR())) -// equation -// var1 = setVarDirection(var,DAE.INPUT()); -// then var1; -// case (v as BackendDAE.VAR(varDirection = DAE.OUTPUT()),var as BackendDAE.VAR(varDirection = DAE.BIDIR())) -// equation -// var1 = setVarDirection(var,DAE.OUTPUT()); -// then var1; -// case(_,_) then inVar; -// end matchcontinue; -// end mergeDirection; - public function calcAliasKey "author Frenkel TUD 2011-04 - helper for selectAlias. This function is - mainly usable to chose the favorite name - of the keeped var" - input BackendDAE.Var var; + This function is mainly usable to chose the favourite name of the kept var." + input BackendDAE.Var inVar; output Integer i; protected - DAE.ComponentRef cr; Boolean b; Integer d; algorithm - BackendDAE.VAR(varName=cr) := var; // records - b := ComponentReference.isRecord(cr); + b := ComponentReference.isRecord(inVar.varName); i := if b then -1 else 0; // array elements - b := ComponentReference.isArrayElement(cr); + b := ComponentReference.isArrayElement(inVar.varName); i := intAdd(i,if b then -1 else 0); // protected - b := isProtectedVar(var); + b := isProtectedVar(inVar); i := intAdd(i,if b then 5 else 0); // connectors - b := isVarConnector(var); + b := isVarConnector(inVar); i := intAdd(i,if b then 1 else 0); // self generated var - b := isDummyDerVar(var); + b := isDummyDerVar(inVar); i := intAdd(i,if b then 10 else 0); - b := selfGeneratedVar(cr); + b := selfGeneratedVar(inVar.varName); i := intAdd(i,if b then 100 else 0); // length of name (number of dots) - d := ComponentReference.crefDepth(cr); + d := ComponentReference.crefDepth(inVar.varName); i := i+d; end calcAliasKey; @@ -4384,15 +3769,15 @@ public function stateSelectToInteger "Never: -1 Default: 1 Prefer: 2 Always: 3" - input DAE.StateSelect ss; + input DAE.StateSelect inStateSelect; output Integer prio; algorithm - prio := match(ss) - case (DAE.NEVER()) then -1; - case (DAE.AVOID()) then 0; - case (DAE.DEFAULT()) then 1; - case (DAE.PREFER()) then 2; - case (DAE.ALWAYS()) then 3; + prio := match inStateSelect + case DAE.NEVER() then -1; + case DAE.AVOID() then 0; + case DAE.DEFAULT() then 1; + case DAE.PREFER() then 2; + case DAE.ALWAYS() then 3; end match; end stateSelectToInteger; @@ -4402,85 +3787,43 @@ public function transformXToXd "author: PA input BackendDAE.Var inVar; output BackendDAE.Var outVar; algorithm - outVar := matchcontinue (inVar) - local - DAE.ComponentRef cr; - DAE.VarDirection dir; - DAE.VarParallelism prl; - BackendDAE.Type tp; - Option exp; - Option v; - list dim; - Option attr; - Option ts; - Option comment; - DAE.ConnectorType ct; - DAE.ElementSource source; - DAE.VarInnerOuter io; - Boolean unreplaceable; - - case (BackendDAE.VAR(varName=cr, - varKind=BackendDAE.STATE(), - varDirection=dir, - varParallelism=prl, - varType=tp, - bindExp=exp, - bindValue=v, - arryDim=dim, - source=source, - values=attr, - tearingSelectOption=ts, - comment=comment, - connectorType=ct, - innerOuter=io, - unreplaceable=unreplaceable)) equation - cr = ComponentReference.crefPrefixDer(cr); - then BackendDAE.VAR(cr, BackendDAE.STATE_DER(), dir, prl, tp, exp, v, dim, source, attr, ts, comment, ct, io, unreplaceable); + outVar := match inVar + case BackendDAE.VAR(varKind=BackendDAE.STATE()) equation + outVar = inVar; + outVar.varName = ComponentReference.crefPrefixDer(inVar.varName); + outVar.varKind = BackendDAE.STATE_DER(); + then outVar; else inVar; - end matchcontinue; + end match; end transformXToXd; -public function isRecordVar"outputs true if the variable belongs to a record. -author:Waurich TUD 2014-09" - input BackendDAE.Var var; - output Boolean isRec; -algorithm - isRec := match(var) - local - DAE.ComponentRef cref; - case(BackendDAE.VAR(varName=cref)) - equation - then ComponentReference.traverseCref(cref,ComponentReference.crefIsRec, false); - end match; +public function isRecordVar "outputs true if the variable belongs to a record. +author: Waurich TUD 2014-09" + input BackendDAE.Var inVar; + output Boolean isRec = ComponentReference.traverseCref(inVar.varName, ComponentReference.crefIsRec, false); end isRecordVar; public function varExp - input BackendDAE.Var var; - output DAE.Exp exp; -protected - DAE.ComponentRef cref; + input BackendDAE.Var inVar; + output DAE.Exp outExp; algorithm - BackendDAE.VAR(varName=cref) := var; - exp := Expression.crefExp(cref); + outExp := Expression.crefExp(inVar.varName); end varExp; -public function varExp2"same as varExp but adds a der()-call for state derivatives" - input BackendDAE.Var var; - output DAE.Exp exp; -algorithm - exp := match(var) - local - DAE.ComponentRef cref; - DAE.Exp exp1; - case(BackendDAE.VAR(varName=cref,varKind=BackendDAE.STATE(index=1))) - algorithm - exp1 := Expression.crefExp(cref); - then Expression.expDer(exp1); - else - algorithm - BackendDAE.VAR(varName=cref) := var; - then Expression.crefExp(cref); +public function varExp2 "same as varExp but adds a der()-call for state derivatives" + input BackendDAE.Var inVar; + output DAE.Exp outExp; +algorithm + outExp := match(inVar) + local + DAE.Exp exp; + + case(BackendDAE.VAR(varKind=BackendDAE.STATE(index=1))) equation + exp = Expression.crefExp(inVar.varName); + then Expression.expDer(exp); + + else Expression.crefExp(inVar.varName); end match; end varExp2; diff --git a/Compiler/BackEnd/Causalize.mo b/Compiler/BackEnd/Causalize.mo index 6c6c32e6c8b..82aaa6862d6 100644 --- a/Compiler/BackEnd/Causalize.mo +++ b/Compiler/BackEnd/Causalize.mo @@ -134,28 +134,27 @@ protected function singularSystemCheck1 input tuple matchingAlgorithm; input BackendDAE.StructurallySingularSystemHandlerArg arg; input BackendDAE.Shared iShared; - output BackendDAE.EqSystem outSyst; + output BackendDAE.EqSystem outSyst = iSyst; protected - BackendDAE.Variables vars; - BackendDAE.EquationArray eqns; BackendDAE.IncidenceMatrix m; BackendDAE.IncidenceMatrixT mT; - BackendDAE.StateSets stateSets; list> comps; array ass1,ass2; BackendDAEFunc.matchingAlgorithmFunc matchingFunc; - BackendDAE.BaseClockPartitionKind partitionKind; + BackendDAE.EqSystem syst; algorithm - BackendDAE.EQSYSTEM(orderedVars=vars,orderedEqs=eqns,m=SOME(m),mT=SOME(mT),stateSets=stateSets,partitionKind=partitionKind) := iSyst; + BackendDAE.EQSYSTEM(m=SOME(m), mT=SOME(mT)) := iSyst; (matchingFunc,_) := matchingAlgorithm; // get absolute Incidence Matrix m := BackendDAEUtil.absIncidenceMatrix(m); mT := BackendDAEUtil.absIncidenceMatrix(mT); // try to match - outSyst := BackendDAE.EQSYSTEM(vars,eqns,SOME(m),SOME(mT),BackendDAE.NO_MATCHING(),stateSets,partitionKind); + syst := BackendDAEUtil.setEqSystMatrices(iSyst, SOME(m), SOME(mT)); + syst.matching := BackendDAE.NO_MATCHING(); // do matching - (outSyst as BackendDAE.EQSYSTEM(matching=BackendDAE.MATCHING(ass1=ass1,ass2=ass2)),_,_) := matchingFunc(outSyst,iShared,true,(BackendDAE.INDEX_REDUCTION(),eqnConstr),foundSingularSystem,arg); - outSyst := BackendDAEUtil.setEqSystMatching(iSyst,BackendDAE.MATCHING(ass1,ass2,{})); + (syst as BackendDAE.EQSYSTEM(matching=BackendDAE.MATCHING(ass1=ass1, ass2=ass2)), _, _) := + matchingFunc(syst, iShared, true, (BackendDAE.INDEX_REDUCTION(), eqnConstr), foundSingularSystem, arg); + outSyst.matching := BackendDAE.MATCHING(ass1, ass2, {}); /* print("singularSystemCheck:\n"); BackendDump.printEqSystem(outSyst); @@ -164,7 +163,7 @@ algorithm DumpGraphML.dumpSystem(outSyst,iShared,NONE(),"SingularSystemCheck" + intString(nVars) + ".graphml",false); */ // free states matching information because there it is unkown if the state or the state derivative was matched - ((_,ass1,ass2)) := BackendVariable.traverseBackendDAEVars(vars, freeStateAssignments, (1,ass1,ass2)); + ((_,ass1,ass2)) := BackendVariable.traverseBackendDAEVars(outSyst.orderedVars, freeStateAssignments, (1,ass1,ass2)); end singularSystemCheck1; protected function freeStateAssignments "unset assignments of statevariables." diff --git a/Compiler/BackEnd/EvaluateParameter.mo b/Compiler/BackEnd/EvaluateParameter.mo index a1b9e3eebf4..0c11e3a9600 100644 --- a/Compiler/BackEnd/EvaluateParameter.mo +++ b/Compiler/BackEnd/EvaluateParameter.mo @@ -200,18 +200,11 @@ protected function evaluateParameters "author Frenkel TUD output BackendDAE.BackendDAE outDAE; output BackendVarTransform.VariableReplacements oRepl; protected - DAE.FunctionTree funcs; - BackendDAE.Variables knvars,exobj,av; - BackendDAE.EquationArray remeqns,inieqns; - list constrs; - list clsAttrs; + BackendDAE.Variables knvars, av; + BackendDAE.EquationArray inieqns; FCore.Cache cache; FCore.Graph graph; - BackendDAE.EventInfo einfo; - BackendDAE.ExternalObjectClasses eoc; - BackendDAE.SymbolicJacobians symjacs; - BackendVarTransform.VariableReplacements repl,repleval; - BackendDAE.BackendDAEType btp; + BackendVarTransform.VariableReplacements repl, repleval; BackendDAE.EqSystems systs; BackendDAE.Shared shared; list> comps; @@ -220,38 +213,53 @@ protected BackendDAE.IncidenceMatrixT m; BackendDAE.IncidenceMatrixT mt; list selectedParameter; - BackendDAE.ExtraInfo ei; algorithm - BackendDAE.DAE(systs, BackendDAE.SHARED(knvars, exobj, av, inieqns, remeqns, constrs, clsAttrs, cache, graph, funcs, einfo, eoc, btp, symjacs, ei)) := inDAE; - - // get parameters with annotation(Evaluate=true) - size := BackendVariable.varsSize(knvars); - m := arrayCreate(size, {}); - mt := arrayCreate(size, {}); - ass2 := arrayCreate(size, -1); - ((_, _, _, selectedParameter, nselect, ass2, m, mt)) := BackendVariable.traverseBackendDAEVars(knvars, getParameterIncidenceMatrix, (knvars, 1, selectParameterfunc, {}, 0, ass2, m, mt)); - - // evaluate selected parameters - size := intMax(BaseHashTable.defaultBucketSize, realInt(realMul(intReal(size), 0.7))); - nselect := intMax(BaseHashTable.defaultBucketSize, nselect*2); - repl := BackendVarTransform.emptyReplacementsSized(size); - repleval := BackendVarTransform.emptyReplacementsSized(nselect); - markarr := arrayCreate(size, -1); - (knvars, cache, repl, repleval, mark) := evaluateSelectedParameters(selectedParameter, knvars, m, inieqns, cache, graph, 1, markarr, repl, repleval); - - // replace evaluated parameter in parameters - comps := Sorting.TarjanTransposed(mt, ass2); - - // evaluate vars with bind expression consists of evaluated vars - (knvars, repl, repleval, cache, mark) := traverseParameterSorted(comps, knvars, m, inieqns, cache, graph, mark, markarr, repl, repleval); - if Flags.isSet(Flags.DUMP_EA_REPL) then - BackendVarTransform.dumpReplacements(repleval); - end if; - - // replace evaluated parameter in variables - (systs, (knvars, m, inieqns, cache, graph, mark, markarr, repl, oRepl)) := List.mapFold(systs, replaceEvaluatedParametersSystem, (knvars, m, inieqns, cache, graph, mark, markarr, repl, repleval)); - (av, _) := BackendVariable.traverseBackendDAEVarsWithUpdate(av, replaceEvaluatedParameterTraverser, (knvars, m, inieqns, cache, graph, mark, markarr, repl, oRepl)); - outDAE := BackendDAE.DAE(systs, BackendDAE.SHARED(knvars, exobj, av, inieqns, remeqns, constrs, clsAttrs, cache, graph, funcs, einfo, eoc, btp, symjacs, ei)); + (outDAE, oRepl) := match inDAE + case BackendDAE.DAE ( systs, + shared as BackendDAE.SHARED(knownVars=knvars, aliasVars=av, initialEqs=inieqns, cache=cache, graph=graph) ) + algorithm + // get parameters with annotation(Evaluate=true) + size := BackendVariable.varsSize(knvars); + m := arrayCreate(size, {}); + mt := arrayCreate(size, {}); + ass2 := arrayCreate(size, -1); + ((_, _, _, selectedParameter, nselect, ass2, m, mt)) := + BackendVariable.traverseBackendDAEVars( knvars, getParameterIncidenceMatrix, + (knvars, 1, selectParameterfunc, {}, 0, ass2, m, mt) ); + + // evaluate selected parameters + size := intMax(BaseHashTable.defaultBucketSize, realInt(realMul(intReal(size), 0.7))); + nselect := intMax(BaseHashTable.defaultBucketSize, nselect*2); + repl := BackendVarTransform.emptyReplacementsSized(size); + repleval := BackendVarTransform.emptyReplacementsSized(nselect); + markarr := arrayCreate(size, -1); + (knvars, cache, repl, repleval, mark) := + evaluateSelectedParameters(selectedParameter, knvars, m, inieqns, cache, graph, 1, markarr, repl, repleval); + + // replace evaluated parameter in parameters + comps := Sorting.TarjanTransposed(mt, ass2); + + // evaluate vars with bind expression consists of evaluated vars + (knvars, repl, repleval, cache, mark) := + traverseParameterSorted(comps, knvars, m, inieqns, cache, graph, mark, markarr, repl, repleval); + if Flags.isSet(Flags.DUMP_EA_REPL) then + BackendVarTransform.dumpReplacements(repleval); + end if; + + // replace evaluated parameter in variables + (systs, (knvars, m, inieqns, cache, graph, mark, markarr, repl, repleval)) := + List.mapFold( systs, replaceEvaluatedParametersSystem, ( knvars, m, inieqns, cache, graph, mark, + markarr, repl, repleval ) ); + (av, _) := BackendVariable.traverseBackendDAEVarsWithUpdate ( + av, replaceEvaluatedParameterTraverser, (knvars, m, inieqns, cache, graph, mark, markarr, repl, repleval) ); + + shared.knownVars := knvars; + shared.aliasVars := av; + shared.initialEqs := inieqns; + shared.graph := graph; + shared.cache := cache; + then (BackendDAE.DAE(systs, shared), repleval); + end match; end evaluateParameters; @@ -1056,38 +1064,32 @@ protected function replaceEvaluatedParametersEqns "author Frenkel TUD" input BackendVarTransform.VariableReplacements inRepl; output BackendDAE.BackendDAE outDAE; protected - DAE.FunctionTree funcs; - BackendDAE.Variables knvars, exobj, av; BackendDAE.EquationArray remeqns, inieqns; - list constrs; - list clsAttrs; - FCore.Cache cache; - FCore.Graph graph; - BackendDAE.EventInfo einfo; - BackendDAE.ExternalObjectClasses eoc; - BackendDAE.SymbolicJacobians symjacs; - BackendDAE.BackendDAEType btp; list eqnslst; BackendDAE.EqSystems systs; Boolean b; - BackendDAE.ExtraInfo ei; + BackendDAE.Shared shared; algorithm - BackendDAE.DAE(systs, BackendDAE.SHARED(knvars, exobj, av, inieqns, remeqns, constrs, clsAttrs, cache, graph, funcs, einfo, eoc, btp, symjacs, ei)) := inDAE; + BackendDAE.DAE(systs, shared as BackendDAE.SHARED(initialEqs=inieqns, removedEqs=remeqns)) := inDAE; // do replacements in initial equations eqnslst := BackendEquation.equationList(inieqns); (eqnslst, b) := BackendVarTransform.replaceEquations(eqnslst, inRepl, NONE()); - inieqns := if b then BackendEquation.listEquation(eqnslst) else inieqns; + if b then + shared := BackendDAEUtil.setSharedInitialEqns(shared, BackendEquation.listEquation(eqnslst)); + end if; // do replacements in simple equations eqnslst := BackendEquation.equationList(remeqns); (eqnslst, b) := BackendVarTransform.replaceEquations(eqnslst, inRepl, NONE()); - remeqns := if b then BackendEquation.listEquation(eqnslst) else remeqns; + if b then + shared := BackendDAEUtil.setSharedRemovedEqns(shared, BackendEquation.listEquation(eqnslst)); + end if; // do replacements in systems systs := List.map1(systs, replaceEvaluatedParametersSystemEqns, inRepl); - outDAE := BackendDAE.DAE(systs, BackendDAE.SHARED(knvars, exobj, av, inieqns, remeqns, constrs, clsAttrs, cache, graph, funcs, einfo, eoc, btp, symjacs, ei)); + outDAE := BackendDAE.DAE(systs, shared); end replaceEvaluatedParametersEqns; protected function replaceEvaluatedParametersSystemEqns diff --git a/Compiler/BackEnd/ExpressionSolve.mo b/Compiler/BackEnd/ExpressionSolve.mo index fecd5f91357..823d23deab0 100644 --- a/Compiler/BackEnd/ExpressionSolve.mo +++ b/Compiler/BackEnd/ExpressionSolve.mo @@ -98,23 +98,14 @@ protected BackendDAE.StrongComponent c; Integer i = 1; list newVars = {}; - - BackendDAE.Variables vars; - BackendDAE.Matching matching; - BackendDAE.StateSets stateSets; - BackendDAE.BaseClockPartitionKind partitionKind; - BackendDAE.EquationArray eqns; - algorithm for comp in inComps loop (osyst,oshared, newVars) := findSimpleEquationWork(osyst,oshared,comp, i, newVars); i := i + 1; end for; - if not listEmpty(newVars) then - BackendDAE.EQSYSTEM(orderedVars=vars,orderedEqs=eqns,matching=matching,stateSets=stateSets,partitionKind=partitionKind) := osyst; - vars := BackendVariable.addVars(newVars, vars); - osyst := BackendDAE.EQSYSTEM(vars,eqns,NONE(),NONE(),matching,stateSets,partitionKind); + osyst.orderedVars := BackendVariable.addVars(newVars, osyst.orderedVars); + osyst := BackendDAEUtil.setEqSystMatrices(osyst); //BackendDump.printEqSystem(osyst); end if; diff --git a/Compiler/BackEnd/FindZeroCrossings.mo b/Compiler/BackEnd/FindZeroCrossings.mo index 6fb62121ac9..987e1a045e0 100644 --- a/Compiler/BackEnd/FindZeroCrossings.mo +++ b/Compiler/BackEnd/FindZeroCrossings.mo @@ -99,20 +99,7 @@ public function encapsulateWhenConditions "author: lochel" protected BackendDAE.EqSystems systs; BackendDAE.Shared shared; - BackendDAE.Variables knownVars; - BackendDAE.Variables externalObjects; - BackendDAE.Variables aliasVars; - BackendDAE.EquationArray initialEqs; BackendDAE.EquationArray removedEqs; - list constraints; - list classAttrs; - FCore.Cache cache; - FCore.Graph graph; - DAE.FunctionTree functionTree; - BackendDAE.EventInfo eventInfo; - BackendDAE.ExternalObjectClasses extObjClasses; - BackendDAE.BackendDAEType backendDAEType; - BackendDAE.SymbolicJacobians symjacs; list timeEvents; list whenClauseLst; @@ -128,31 +115,17 @@ protected BackendDAE.Variables vars_; BackendDAE.EquationArray eqns_; BackendDAE.ExtraInfo info; - array clocks; + BackendDAE.EventInfo eventInfo; + algorithm BackendDAE.DAE(systs, shared) := inDAE; - BackendDAE.SHARED(knownVars=knownVars, - externalObjects=externalObjects, - aliasVars=aliasVars, - initialEqs=initialEqs, - removedEqs=removedEqs, - constraints=constraints, - classAttrs=classAttrs, - cache=cache, - graph=graph, - functionTree=functionTree, - eventInfo=eventInfo, - extObjClasses=extObjClasses, - backendDAEType=backendDAEType, - symjacs=symjacs, - info=info) := shared; - BackendDAE.EVENT_INFO(timeEvents=timeEvents, - whenClauseLst=whenClauseLst, - zeroCrossingLst=zeroCrossingLst, - sampleLst=sampleLst, - relationsLst=relationsLst, - numberMathEvents=numberMathEvents, - clocks=clocks) := eventInfo; + BackendDAE.SHARED(removedEqs=removedEqs, eventInfo=eventInfo) := shared; + BackendDAE.EVENT_INFO( timeEvents=timeEvents, + whenClauseLst=whenClauseLst, + zeroCrossingLst=zeroCrossingLst, + sampleLst=sampleLst, + relationsLst=relationsLst, + numberMathEvents=numberMathEvents ) := eventInfo; ht := HashTableExpToIndex.emptyHashTable(); @@ -163,7 +136,9 @@ algorithm (whenClauseLst, vars, eqns, ht, index) := encapsulateWhenConditions_WhenClause(whenClauseLst, {}, {}, {}, ht, index); // removed equations - ((removedEqs, vars, eqns, index, ht)) := BackendEquation.traverseEquationArray(removedEqs, encapsulateWhenConditions_Equation, (BackendEquation.emptyEqns(), vars, eqns, index, ht)); + ((removedEqs, vars, eqns, index, ht)) := + BackendEquation.traverseEquationArray( removedEqs, encapsulateWhenConditions_Equation, + (BackendEquation.emptyEqns(), vars, eqns, index, ht) ); vars_ := BackendVariable.listVar(vars); eqns_ := BackendEquation.listEquation(eqns); systs := listAppend(systs, {BackendDAEUtil.createEqSystem(vars_, eqns_)}); @@ -173,23 +148,11 @@ algorithm zeroCrossingLst, sampleLst, relationsLst, - numberMathEvents, - clocks); - shared := BackendDAE.SHARED(knownVars, - externalObjects, - aliasVars, - initialEqs, - removedEqs, - constraints, - classAttrs, - cache, - graph, - functionTree, - eventInfo, - extObjClasses, - backendDAEType, - symjacs, - info); + numberMathEvents); + + shared := BackendDAEUtil.setSharedEventInfo(shared, eventInfo); + shared := BackendDAEUtil.setSharedRemovedEqns(shared, removedEqs); + outDAE := if intGt(index, 1) then BackendDAE.DAE(systs, shared) else inDAE; if Flags.isSet(Flags.DUMP_ENCAPSULATECONDITIONS) then BackendDump.dumpBackendDAE(outDAE, "DAE after PreOptModule >>encapsulateWhenConditions<<"); @@ -704,14 +667,13 @@ algorithm list zero_crossings; list relations, sampleLst; Integer countMathFunctions; - array clocks; //No zero crossing for clocked discrete partitions; case BackendDAE.CLOCKED_PARTITION(subClock=BackendDAE.SUBCLOCK(solver=NONE())) then (inSyst, inShared); else algorithm BackendDAE.SHARED( knownVars=knvars, eventInfo=einfo) := inShared; - BackendDAE.EVENT_INFO( timeEvents=timeEvents, zeroCrossingLst=zero_crossings, clocks=clocks, + BackendDAE.EVENT_INFO( timeEvents=timeEvents, zeroCrossingLst=zero_crossings, sampleLst=sampleLst, whenClauseLst=whenclauses, relationsLst=relations, numberMathEvents=countMathFunctions ) := einfo; eqs_lst := BackendEquation.equationList(eqns); @@ -725,7 +687,7 @@ algorithm end if; eqns1 := BackendEquation.listEquation(eqs_lst1); einfo := BackendDAE.EVENT_INFO( timeEvents, whenclauses, zero_crossings, sampleLst, relations, - countMathFunctions, clocks ); + countMathFunctions ); then (BackendDAEUtil.setEqSystEqs(inSyst, eqns1), BackendDAEUtil.setSharedEventInfo(inShared, einfo)); end match; end findZeroCrossings1; diff --git a/Compiler/BackEnd/HpcOmEqSystems.mo b/Compiler/BackEnd/HpcOmEqSystems.mo index b7fc94cc061..de90150ddfc 100644 --- a/Compiler/BackEnd/HpcOmEqSystems.mo +++ b/Compiler/BackEnd/HpcOmEqSystems.mo @@ -169,7 +169,8 @@ algorithm list tvarIdcs, resEqIdcs, eqIdcs, varIdcs; list>> otherEqnVarTpl; BackendDAE.BaseClockPartitionKind partitionKind; - BackendDAE.EqSystem systTmp; + BackendDAE.EqSystem syst; + EqSys hpcSyst; BackendDAE.EquationArray eqs; BackendDAE.Jacobian jac; BackendDAE.JacobianType jacType; @@ -182,14 +183,13 @@ algorithm BackendVarTransform.VariableReplacements derRepl; list eqLst, eqsNew, eqsOld, resEqs, addEqs; list varLst,varLstRepl, varsNew, varsOld, tvars, addVars; - EqSys syst; case(_,_,_,_,_,_,_) equation // completed true = listLength(compsIn) < compIdx; then (systIn,tornSysIdxIn); - case(_,_,_,_,_,_,_) + case(_,_,_,_,syst,_,_) equation // strongComponent is a linear tornSystem true = listLength(compsIn) >= compIdx; @@ -204,16 +204,14 @@ algorithm // add the new vars and equations to the original EqSystem BackendDAE.MATCHING(ass1=ass1New, ass2=ass2New, comps=compsNew) = matchingNew; - BackendDAE.EQSYSTEM(orderedVars = vars, orderedEqs = eqs, stateSets = stateSets, partitionKind=partitionKind) = systIn; - varsOld = BackendVariable.varList(vars); - eqsOld = BackendEquation.equationList(eqs); + varsOld = BackendVariable.varList(syst.orderedVars); + eqsOld = BackendEquation.equationList(syst.orderedEqs); varLst = listAppend(varsOld,varsNew); eqLst = listAppend(eqsOld, eqsNew); eqLst = List.fold2(List.intRange(listLength(resEqIdcs)),replaceAtPositionFromList,resEqs,resEqIdcs,eqLst); // replaces the old residualEquations with the new ones - vars = BackendVariable.listVar1(varLst); // !!! BackendVariable.listVar outputs the reversed order therefore listVar1 - eqs = BackendEquation.listEquation(eqLst); - + syst.orderedVars = BackendVariable.listVar1(varLst); // !!! BackendVariable.listVar outputs the reversed order therefore listVar1 + syst.orderedEqs = BackendEquation.listEquation(eqLst); // build the matching ass1All = arrayCreate(listLength(varLst),-1); @@ -231,15 +229,15 @@ algorithm compsNew = listAppend(compsNew, otherComps); compsTmp = List.replaceAtWithList(compsNew,compIdx-1,compsIn); ((ass1All,ass2All)) = List.fold2(List.intRange(arrayLength(ass1New)),updateMatching,(listLength(eqsOld),listLength(varsOld)),(ass1New,ass2New),(ass1All,ass2All)); - matching = BackendDAE.MATCHING(ass1All, ass2All, compsTmp); + syst.matching = BackendDAE.MATCHING(ass1All, ass2All, compsTmp); //build new DAE-EqSystem - systTmp = BackendDAE.EQSYSTEM(vars,eqs,NONE(),NONE(),matching,stateSets,partitionKind); - (systTmp,_,_) = BackendDAEUtil.getIncidenceMatrix(systTmp, BackendDAE.NORMAL(),NONE()); - (systTmp,tornSysIdx) = reduceLinearTornSystem1(compIdx+1+numNewSingleEqs,compsTmp,ass1All,ass2All,systTmp,sharedIn,tornSysIdxIn+1); + syst = BackendDAEUtil.setEqSystMatrices(syst); + (syst,_,_) = BackendDAEUtil.getIncidenceMatrix(syst, BackendDAE.NORMAL(),NONE()); + (syst, tornSysIdx) = reduceLinearTornSystem1(compIdx+1+numNewSingleEqs,compsTmp,ass1All,ass2All,syst,sharedIn,tornSysIdxIn+1); then - (systTmp,tornSysIdx); - case(_,_,_,_,BackendDAE.EQSYSTEM(orderedVars=vars, orderedEqs = eqs, stateSets=stateSets, partitionKind=partitionKind),_,_) + (syst, tornSysIdx); + case(_,_,_,_,syst as BackendDAE.EQSYSTEM(orderedVars=vars, orderedEqs = eqs),_,_) equation // strongComponent is a system of equations true = listLength(compsIn) >= compIdx; @@ -263,9 +261,9 @@ algorithm //BackendDump.dumpEquationList(eqLst,"eqLst"); // build linear system - syst = getEqSystem(eqLst,varLstRepl); - //dumpEqSys(syst); - (eqsNew,addEqs,addVars) = CramerRule(syst); + hpcSyst = getEqSystem(eqLst, varLstRepl); + //dumpEqSys(hpcSyst); + (eqsNew,addEqs,addVars) = CramerRule(hpcSyst); (eqsNew,_) = BackendVarTransform.replaceEquations(eqsNew,derRepl,NONE());//introduce der(.) for $DER. //BackendDump.dumpEquationList(eqsNew,"eqsNew"); @@ -288,8 +286,8 @@ algorithm eqLst = listAppend(eqsOld,addEqs); varLst = listAppend(varsOld,addVars); eqLst = List.fold2(List.intRange(listLength(eqsNew)),replaceAtPositionFromList,eqsNew,eqIdcs,eqLst); // replaces the old residualEquations with the new ones - eqs = BackendEquation.listEquation(eqLst); - vars = BackendVariable.listVar1(varLst); + syst.orderedEqs = BackendEquation.listEquation(eqLst); + syst.orderedVars = BackendVariable.listVar1(varLst); // update assignments ass1All = arrayCreate(listLength(varLst),-1); @@ -297,22 +295,22 @@ algorithm ass1All = Array.copy(ass1,ass1All); // the comps before and after the tornsystem ass2All = Array.copy(ass2,ass2All); List.map2_0(compsNew,updateAssignmentsByComp,ass1All,ass2All); - matching = BackendDAE.MATCHING(ass1All, ass2All, compsTmp); + syst.matching = BackendDAE.MATCHING(ass1All, ass2All, compsTmp); //BackendDump.dumpFullMatching(matching); //build new DAE-EqSystem - systTmp = BackendDAE.EQSYSTEM(vars,eqs,NONE(),NONE(),matching,stateSets,partitionKind); + syst = BackendDAEUtil.setEqSystMatrices(syst); //(systTmp,_,_) = BackendDAEUtil.getIncidenceMatrix(systTmp, BackendDAE.NORMAL(),NONE()); - (systTmp,tornSysIdx) = reduceLinearTornSystem1(compIdx+1,compsTmp,ass1All,ass2All,systTmp,sharedIn,tornSysIdxIn+1); + (syst,tornSysIdx) = reduceLinearTornSystem1(compIdx+1,compsTmp,ass1All,ass2All,syst,sharedIn,tornSysIdxIn+1); then - (systTmp,tornSysIdx); + (syst,tornSysIdx); else // go to next StrongComponent equation - (systTmp,tornSysIdx) = reduceLinearTornSystem1(compIdx+1,compsIn,ass1,ass2,systIn,sharedIn,tornSysIdxIn); + (syst, tornSysIdx) = reduceLinearTornSystem1(compIdx+1,compsIn,ass1,ass2,systIn,sharedIn,tornSysIdxIn); then - (systTmp,tornSysIdx); + (syst, tornSysIdx); end matchcontinue; end reduceLinearTornSystem1; @@ -579,7 +577,7 @@ protected algorithm eqArr := BackendEquation.listEquation(eqsIn); varArr := BackendVariable.listVar1(varsIn); - eqSys := BackendDAE.EQSYSTEM(varArr,eqArr,NONE(),NONE(),BackendDAE.NO_MATCHING(),{},BackendDAE.UNKNOWN_PARTITION()); + eqSys := BackendDAEUtil.createEqSystem(varArr, eqArr); (m,mT) := BackendDAEUtil.incidenceMatrix(eqSys,BackendDAE.ABSOLUTE(),NONE()); size := listLength(eqsIn); (eqIdcs,varIdcs,resEqsOut) := List.fold(List.intRange(size),function simplifyNewEquations1(eqArr=eqArr,varArr=varArr,m=m,mt=mT,numAuxiliaryVars=numAuxiliaryVars),({},{},resEqsIn)); @@ -1044,7 +1042,7 @@ algorithm // get the EQSYSTEM, the incidenceMatrix and a matching vars = BackendVariable.listVar1(inVars); eqArr = BackendEquation.listEquation(inEqs); - sysTmp = BackendDAE.EQSYSTEM(vars,eqArr,NONE(),NONE(),BackendDAE.NO_MATCHING(),{},BackendDAE.UNKNOWN_PARTITION()); + sysTmp = BackendDAEUtil.createEqSystem(vars, eqArr); (sysTmp,m,mt) = BackendDAEUtil.getIncidenceMatrix(sysTmp,BackendDAE.NORMAL(),NONE()); nVars = listLength(inVars); nEqs = listLength(inEqs); @@ -1054,7 +1052,7 @@ algorithm BackendDAEEXT.matching(nVars, nEqs, 5, -1, 0.0, 1); BackendDAEEXT.getAssignment(ass2, ass1); matching = BackendDAE.MATCHING(ass1, ass2, {}); - sysTmp = BackendDAE.EQSYSTEM(vars,eqArr,SOME(m),SOME(mt),matching,{},BackendDAE.UNKNOWN_PARTITION()); + sysTmp = BackendDAEUtil.createEqSystem(vars, eqArr); // perform BLT to order the StrongComponents mapIncRowEqn = listArray(List.intRange(nEqs)); mapEqnIncRow = Array.map(mapIncRowEqn,List.create); diff --git a/Compiler/BackEnd/HpcOmMemory.mo b/Compiler/BackEnd/HpcOmMemory.mo index ebcd48de518..ec937f11c0b 100644 --- a/Compiler/BackEnd/HpcOmMemory.mo +++ b/Compiler/BackEnd/HpcOmMemory.mo @@ -1170,7 +1170,7 @@ import Util; (partlyFilledClFloat, partlyFilledClInt, partlyFilledClBool) := threadPartlyFilledCacheLines; (fullyFilledClFloat, fullyFilledClInt, fullyFilledClBool) := threadFullyFilledCacheLines; - if(Util.isSome(iMatchedCacheLine)) then //advice was given, to which CL the variable should be added + if(isSome(iMatchedCacheLine)) then //advice was given, to which CL the variable should be added clMapIdx := numOfCLs; SOME((partlyFilledCacheLine, matchedClIndex)) := iMatchedCacheLine; partlyFilledCacheLineOption := SOME(partlyFilledCacheLine); @@ -1365,7 +1365,7 @@ import Util; Integer levelIdx, threadIdx; algorithm (levelIdx, threadIdx) := iLevelThreadIdx; - if(Util.isSome(iOldPartlyFilledCacheLine)) then + if(isSome(iOldPartlyFilledCacheLine)) then SOME(PARTLYFILLEDCACHELINE_LEVEL(prefetchLevel=prefetchLevel,writeLevel=writeLevel)) := iOldPartlyFilledCacheLine; else prefetchLevel := {}; @@ -2867,7 +2867,7 @@ import Util; simVarOpt := arrayGet(iAllVarsMapping, varIdx); description := "unknown"; threadText := "Th -1"; - if(Util.isSome(simVarOpt)) then + if(isSome(simVarOpt)) then simVar := Util.getOption(simVarOpt); varCompRef := SimCodeFunctionUtil.varName(simVar); description := ComponentReference.printComponentRefStr(varCompRef); diff --git a/Compiler/BackEnd/HpcOmTaskGraph.mo b/Compiler/BackEnd/HpcOmTaskGraph.mo index b3887abe2dc..ff8d8bb6f95 100644 --- a/Compiler/BackEnd/HpcOmTaskGraph.mo +++ b/Compiler/BackEnd/HpcOmTaskGraph.mo @@ -4989,18 +4989,35 @@ protected function validateComponents "author: marcusw input list> systComps; output Boolean res; protected + Boolean isEqual; + Integer i1,i2; + BackendDAE.StrongComponent comp1,comp2; + tuple tpl1,tpl2; list> sortedGraphComps, sortedSystComps; algorithm res := matchcontinue(graphComps,systComps) case(_,_) - equation - sortedGraphComps = List.sort(graphComps,compareComponents); - sortedSystComps = List.sort(systComps,compareComponents); - true = List.isEqual(sortedGraphComps, sortedSystComps, true); + algorithm + sortedGraphComps := List.sort(graphComps,compareComponents); + sortedSystComps := List.sort(systComps,compareComponents); + //true := List.isEqual(sortedGraphComps, sortedSystComps, true); + if intNe(listLength(sortedSystComps),listLength(sortedGraphComps)) then print("the graph and the system have a difference number of components.\n"); end if; + isEqual := true; + while isEqual and not listEmpty(sortedGraphComps) loop + tpl1::sortedGraphComps := sortedGraphComps; + tpl2::sortedSystComps := sortedSystComps; + (comp1,i1) := tpl1; + (comp2,i2) := tpl2; + if BackendDAEUtil.componentsEqual(comp1,comp2) and intEq(i1,i2) then isEqual:= true; + else + isEqual := false; + print("comp"+intString(i1)+BackendDump.printComponent(comp1)+" is not equal to "+"comp"+intString(i2)+BackendDump.printComponent(comp2)+"\n"); + end if; + end while; then true; else equation - print("Different components in graph and system"); + print("Different components in graph and system\n"); then false; end matchcontinue; end validateComponents; diff --git a/Compiler/BackEnd/IndexReduction.mo b/Compiler/BackEnd/IndexReduction.mo index 4bba3b7d844..f72a46799f7 100644 --- a/Compiler/BackEnd/IndexReduction.mo +++ b/Compiler/BackEnd/IndexReduction.mo @@ -573,8 +573,8 @@ protected function differentiateEqns output array omapIncRowEqn; output list,list,list>> oNotDiffableMSS; algorithm - (osyst,oshared,outAss1,outAss2,outStateOrd,outOrgEqnsLst,omapEqnIncRow,omapIncRowEqn,oNotDiffableMSS):= - match (inEqnsTpl,inEqns,unassignedStates,unassignedEqns,inSystem,inShared,inAss1,inAss2,inStateOrd,inOrgEqnsLst,imapEqnIncRow,imapIncRowEqn,iNotDiffableMSS) + (osyst,oshared,outAss1,outAss2,outStateOrd,outOrgEqnsLst,omapEqnIncRow,omapIncRowEqn,oNotDiffableMSS) := + match (inEqnsTpl, inSystem) local Integer eqnss,eqnss1; BackendDAE.EquationArray eqns_1,eqns; @@ -592,7 +592,7 @@ algorithm DAE.FunctionTree funcs; BackendDAE.BaseClockPartitionKind partitionKind; // all equations are differentiated - case (_::_,_,_,_,BackendDAE.EQSYSTEM(v,eqns,SOME(m),SOME(mt),matching,stateSets,partitionKind),_,_,_,_,_,_,_,_) + case (_::_, syst as BackendDAE.EQSYSTEM(orderedVars=v, orderedEqs=eqns, m=SOME(m), mT=SOME(mt))) equation eqnss = BackendDAEUtil.equationArraySize(eqns); (v1,eqns_1,so,ilst,orgEqnsLst) = replaceDifferentiatedEqns(inEqnsTpl,v,eqns,inStateOrd,mt,imapIncRowEqn,{},inOrgEqnsLst); @@ -605,7 +605,8 @@ algorithm // set changed variables assignments to zero ass1 = List.fold1r(ilst,arrayUpdate,-1,inAss1); eqnslst1 = collectVarEqns(ilst,{},mt,arrayLength(mt),arrayLength(m)); - syst = BackendDAE.EQSYSTEM(v1,eqns_1,SOME(m),SOME(mt),matching,stateSets,partitionKind); + syst.orderedVars = v1; + syst.orderedEqs = eqns_1; eqnslst1 = List.map1r(eqnslst1,arrayGet,imapIncRowEqn); eqnslst1 = List.uniqueIntN(listAppend(inEqns,eqnslst1),eqnss1); eqnslst1 = listAppend(eqnslst1,eqnslst); @@ -614,11 +615,12 @@ algorithm BackendDump.debuglst(eqnslst1,intString," ","\n"); end if; funcs = BackendDAEUtil.getFunctions(inShared); - (syst,mapEqnIncRow,mapIncRowEqn) = BackendDAEUtil.updateIncidenceMatrixScalar(syst, BackendDAE.SOLVABLE() , SOME(funcs), eqnslst1, imapEqnIncRow, imapIncRowEqn); + (syst,mapEqnIncRow,mapIncRowEqn) = + BackendDAEUtil.updateIncidenceMatrixScalar(syst, BackendDAE.SOLVABLE(), SOME(funcs), eqnslst1, imapEqnIncRow, imapIncRowEqn); then (syst,inShared,ass1,ass2,so,orgEqnsLst,mapEqnIncRow,mapIncRowEqn,iNotDiffableMSS); // not all equations are differentiated - case ({},_,_,_,_,_,_,_,_,_,_,_,_) + case ({},_) then (inSystem,inShared,inAss1,inAss2,inStateOrd,inOrgEqnsLst,imapEqnIncRow,imapIncRowEqn,(inEqns,unassignedStates,unassignedEqns)::iNotDiffableMSS); end match; @@ -948,47 +950,46 @@ protected function handleundifferntiableMSS output array omapIncRowEqn; algorithm (osyst,oshared,outAss1,outAss2,outStateOrd,outOrgEqnsLst,omapEqnIncRow,omapIncRowEqn):= - matchcontinue (b,statesWithUnusedDer,inEqns,unassignedStates,unassignedEqns,inSystem,inShared,inAss1,inAss2,inStateOrd,inOrgEqnsLst,imapEqnIncRow,imapIncRowEqn) + matchcontinue (b,statesWithUnusedDer,inEqns,unassignedStates,unassignedEqns,inSystem) local Integer i; BackendDAE.EquationArray eqns; - list ilst,eqnslst,eqnslst1; + list ilst, eqnslst, eqnslst1; BackendDAE.Variables v,v1; BackendDAE.IncidenceMatrix m; BackendDAE.IncidenceMatrix mt; BackendDAE.EqSystem syst; - BackendDAE.Matching matching; - array ass1,ass2,mapIncRowEqn; + array ass1, ass2, mapIncRowEqn; array> mapEqnIncRow; list varlst; BackendDAE.Var var; - BackendDAE.StateSets stateSets; - BackendDAE.BaseClockPartitionKind partitionKind; DAE.FunctionTree funcs; // 1th try to replace final parameter - case (_,_,_,_,_,BackendDAE.EQSYSTEM(v,eqns,SOME(m),SOME(mt),matching,stateSets,partitionKind),_,_,_,_,_,_,_) + case (_,_,_,_,_,syst as BackendDAE.EQSYSTEM(m=SOME(_), mT=SOME(_))) equation - ((eqns,eqnslst as _::_,_)) = List.fold1(inEqns,replaceFinalVars,BackendVariable.daeKnVars(inShared),(eqns,{},BackendVarTransform.emptyReplacements())); + ((eqns, eqnslst as _::_, _)) = List.fold1( inEqns, replaceFinalVars, BackendVariable.daeKnVars(inShared), + (syst.orderedEqs, {}, BackendVarTransform.emptyReplacements())); + syst.orderedEqs = eqns; // unassign changed equations and assigned vars - eqnslst1 = List.flatten(List.map1r(eqnslst,arrayGet,imapEqnIncRow)); - ilst = List.map1r(eqnslst1,arrayGet,inAss2); - ilst = List.select1(ilst,intGt,0); - ass2 = List.fold1r(eqnslst1,arrayUpdate,-1,inAss2); - ass1 = List.fold1r(ilst,arrayUpdate,-1,inAss1); + eqnslst1 = List.flatten(List.map1r(eqnslst, arrayGet, imapEqnIncRow)); + ilst = List.map1r(eqnslst1, arrayGet, inAss2); + ilst = List.select1(ilst, intGt, 0); + ass2 = List.fold1r(eqnslst1, arrayUpdate, -1, inAss2); + ass1 = List.fold1r(ilst, arrayUpdate, -1, inAss1); // update IncidenceMatrix if Flags.isSet(Flags.BLT_DUMP) then print("Replaced final Parameter in Eqns\n"); print("Update Incidence Matrix: "); - BackendDump.debuglst(eqnslst,intString," ","\n"); + BackendDump.debuglst(eqnslst, intString, " ", "\n"); end if; - syst = BackendDAE.EQSYSTEM(v,eqns,SOME(m),SOME(mt),matching,stateSets,partitionKind); funcs = BackendDAEUtil.getFunctions(inShared); - (syst,mapEqnIncRow,mapIncRowEqn) = BackendDAEUtil.updateIncidenceMatrixScalar(syst, BackendDAE.SOLVABLE(), SOME(funcs), eqnslst, imapEqnIncRow, imapIncRowEqn); + (syst, mapEqnIncRow, mapIncRowEqn) = + BackendDAEUtil.updateIncidenceMatrixScalar(syst, BackendDAE.SOLVABLE(), SOME(funcs), eqnslst, imapEqnIncRow, imapIncRowEqn); then - (syst,inShared,ass1,ass2,inStateOrd,inOrgEqnsLst,mapEqnIncRow,mapIncRowEqn); + (syst, inShared, ass1, ass2, inStateOrd, inOrgEqnsLst, mapEqnIncRow, mapIncRowEqn); // if size of unmatched eqns is equal to size of states without used derivative change all to algebraic - case (true,_::_,_,_,_,BackendDAE.EQSYSTEM(v,eqns,SOME(m),SOME(mt),matching,stateSets,partitionKind),_,_,_,_,_,_,_) + case (true,_::_,_,_,_,syst as BackendDAE.EQSYSTEM(orderedVars=v, m=SOME(m), mT=SOME(mt))) equation // change varKind varlst = List.map1r(statesWithUnusedDer,BackendVariable.getVarAt,v); @@ -996,12 +997,11 @@ algorithm print("Change varKind to algebraic for\n"); BackendDump.printVarList(varlst); end if; - varlst = BackendVariable.setVarsKind(varlst,BackendDAE.VARIABLE()); - v1 = BackendVariable.addVars(varlst,v); + varlst = BackendVariable.setVarsKind(varlst, BackendDAE.VARIABLE()); + syst.orderedVars = BackendVariable.addVars(varlst, syst.orderedVars); // update IncidenceMatrix - eqnslst1 = collectVarEqns(statesWithUnusedDer,{},mt,arrayLength(mt),arrayLength(m)); - eqnslst1 = List.map1r(eqnslst1,arrayGet,imapIncRowEqn); - syst = BackendDAE.EQSYSTEM(v1,eqns,SOME(m),SOME(mt),matching,stateSets,partitionKind); + eqnslst1 = collectVarEqns(statesWithUnusedDer, {}, mt, arrayLength(mt), arrayLength(m)); + eqnslst1 = List.map1r(eqnslst1, arrayGet, imapIncRowEqn); if Flags.isSet(Flags.BLT_DUMP) then print("Update Incidence Matrix: "); BackendDump.debuglst(eqnslst1,intString," ","\n"); @@ -1012,7 +1012,7 @@ algorithm (syst,inShared,inAss1,inAss2,inStateOrd,inOrgEqnsLst,mapEqnIncRow,mapIncRowEqn); /* Debugging case - case (false,_,_,_,_,BackendDAE.EQSYSTEM(v,eqns,SOME(m),SOME(mt),matching,stateSets),_,_,_,_,_,_,_) + case (false,_,_,_,_,BackendDAE.EQSYSTEM(v,eqns,SOME(m),SOME(mt),matching,stateSets)) equation varlst = BackendEquation.equationsLstVars(notDiffedEquations,v); varlst = List.select(varlst,BackendVariable.isStateVar); @@ -1027,7 +1027,7 @@ algorithm // if size of unmatched eqns is not equal to size of states without used derivative change first to algebraic // until I have a better sulution - case (false,i::ilst,_,_,_,BackendDAE.EQSYSTEM(v,eqns,SOME(m),SOME(mt),matching,stateSets,partitionKind),_,_,_,_,_,_,_) + case (false,i::ilst,_,_,_,syst as BackendDAE.EQSYSTEM(orderedVars=v, m=SOME(m), mT=SOME(mt))) equation // change varKind var = BackendVariable.getVarAt(v,i); @@ -1037,16 +1037,15 @@ algorithm BackendDump.printVarList(varlst); end if; varlst = BackendVariable.setVarsKind(varlst,BackendDAE.VARIABLE()); - v1 = BackendVariable.addVars(varlst,v); - varlst = List.map1r(ilst,BackendVariable.getVarAt,v); + syst.orderedVars = BackendVariable.addVars(varlst, v); if Flags.isSet(Flags.BLT_DUMP) then + varlst = List.map1r(ilst, BackendVariable.getVarAt, v); print("Other Candidates are\n"); BackendDump.printVarList(varlst); end if; // update IncidenceMatrix - eqnslst1 = collectVarEqns({i},{},mt,arrayLength(mt),arrayLength(m)); - eqnslst1 = List.map1r(eqnslst1,arrayGet,imapIncRowEqn); - syst = BackendDAE.EQSYSTEM(v1,eqns,SOME(m),SOME(mt),matching,stateSets,partitionKind); + eqnslst1 = collectVarEqns({i}, {}, mt, arrayLength(mt), arrayLength(m)); + eqnslst1 = List.map1r(eqnslst1, arrayGet, imapIncRowEqn); if Flags.isSet(Flags.BLT_DUMP) then print("Update Incidence Matrix: "); BackendDump.debuglst(eqnslst1,intString," ","\n"); @@ -1057,7 +1056,7 @@ algorithm (syst,inShared,inAss1,inAss2,inStateOrd,inOrgEqnsLst,mapEqnIncRow,mapIncRowEqn); // if no state with unused derivative is in the set check global - case (_,{},_,_,_,BackendDAE.EQSYSTEM(v,_,SOME(_),SOME(mt),_,_,_),_,_,_,_,_,_,_) + case (_,{},_,_,_,syst as BackendDAE.EQSYSTEM(orderedVars=v, m=SOME(_), mT=SOME(mt))) equation ilst = Matching.getUnassigned(BackendVariable.varsSize(v), inAss1, {}); ilst = List.fold1(ilst, statesWithUnusedDerivative, mt, {}); @@ -1074,7 +1073,7 @@ algorithm then (syst,oshared,outAss1,outAss2,outStateOrd,outOrgEqnsLst,omapEqnIncRow,omapIncRowEqn); - case (_,_,_,_,_,BackendDAE.EQSYSTEM(v,_,SOME(_),SOME(_),_,_,_),_,_,_,_,_,_,_) + case (_,_,_,_,_,BackendDAE.EQSYSTEM(orderedVars=v, m=SOME(_), mT=SOME(_))) equation varlst = List.map1r(unassignedStates,BackendVariable.getVarAt,v); if Flags.isSet(Flags.BLT_DUMP) then @@ -1538,20 +1537,21 @@ protected function addStateSets algorithm (oSetIndex,oSystem) := match(iTplLst,inSystem) local + BackendDAE.EqSystem syst; + Integer setIndex; + BackendDAE.EquationArray eqs; BackendDAE.Variables vars; - BackendDAE.EquationArray eqns; - Option om; - Option omT; - BackendDAE.Matching matching; BackendDAE.StateSets stateSets; - BackendDAE.BaseClockPartitionKind partitionKind; - Integer setIndex; case ({},_) then (iSetIndex,inSystem); - case (_::_,BackendDAE.EQSYSTEM(vars,eqns,om,omT,matching,stateSets,partitionKind)) + case (_::_, syst) equation - (setIndex,vars,eqns,stateSets) = generateStateSets(iTplLst,iSetIndex,vars,eqns,stateSets); + (setIndex, vars, eqs, stateSets) = + generateStateSets(iTplLst, iSetIndex, syst.orderedVars, syst.orderedEqs, syst.stateSets); + syst.orderedVars = vars; + syst.orderedEqs = eqs; + syst.stateSets = stateSets; then - (setIndex,BackendDAE.EQSYSTEM(vars,eqns,om,omT,matching,stateSets,partitionKind)); + (setIndex, syst); end match; end addStateSets; @@ -1998,7 +1998,7 @@ algorithm // sort vars with heuristic hovvars = BackendVariable.listVar1(statecandidates); eqns1 = BackendEquation.listEquation(eqnslst); - syst = BackendDAE.EQSYSTEM(hovvars,eqns1,NONE(),NONE(),BackendDAE.NO_MATCHING(),{},BackendDAE.UNKNOWN_PARTITION()); + syst = BackendDAEUtil.createEqSystem(hovvars, eqns1); (me,meT,_,_) = BackendDAEUtil.getAdjacencyMatrixEnhancedScalar(syst,inShared,false); m1 = incidenceMatrixfromEnhanced2(me,hovvars); mT1 = BackendDAEUtil.transposeMatrix(m1,nfreeStates); @@ -2055,7 +2055,7 @@ algorithm eqns = BackendEquation.addEquations(eqnslst1, eqns); vars = BackendVariable.listVar1(vlst); vars = BackendVariable.addVars(BackendVariable.varList(hovvars), vars); - syst = BackendDAE.EQSYSTEM(vars,eqns,NONE(),NONE(),BackendDAE.NO_MATCHING(),{},BackendDAE.UNKNOWN_PARTITION()); + syst = BackendDAEUtil.createEqSystem(vars, eqns); // get advanced incidence Matrix (me,meT,mapEqnIncRow,mapIncRowEqn) = BackendDAEUtil.getAdjacencyMatrixEnhancedScalar(syst,inShared,false); if Flags.isSet(Flags.BLT_DUMP) then @@ -2524,7 +2524,7 @@ algorithm (eqnlst,varlst,ass1,ass2,eqns1) := getSetSystem(assigned,inMapEqnIncRow,inMapIncRowEqn,vec1,iVars,eqns1,flag,nassigned,eqnlst,varlst,ass1,ass2); eqns := BackendEquation.listEquation(eqnlst); vars := BackendVariable.listVar1(varlst); - syst := BackendDAE.EQSYSTEM(vars,eqns,NONE(),NONE(),BackendDAE.NO_MATCHING(),{},BackendDAE.UNKNOWN_PARTITION()); + syst := BackendDAEUtil.createEqSystem(vars, eqns); // BackendDump.printEqSystem(syst); // BackendDump.dumpMatching(listArray(ass1)); // BackendDump.dumpMatching(listArray(ass2)); @@ -3347,37 +3347,36 @@ protected function replaceHigherDerivatives "author: Frenkel TUD 2013-01 change for var:STATE(2): der(var,2) to der($DER.var), der(var) -> DER.var, add Var $DER.var:STATE(1)" input BackendDAE.EqSystem inSystem; - output BackendDAE.EqSystem osyst; + output BackendDAE.EqSystem osyst = inSystem; protected BackendDAE.Variables vars; - BackendDAE.EquationArray eqns; - Option om,omT; - BackendDAE.Matching matching; - BackendDAE.StateSets stateSets; HashTableCrIntToExp.HashTable ht; list dummyvars; - array ass1,ass2; + array ass1, ass2; list> addassign; - Integer nv1,nv; - BackendDAE.BaseClockPartitionKind partitionKind; + Integer nv1, nv; algorithm - BackendDAE.EQSYSTEM(orderedVars=vars,orderedEqs=eqns,m=om,mT=omT,matching=BackendDAE.MATCHING(ass1=ass1,ass2=ass2),stateSets=stateSets,partitionKind=partitionKind) := inSystem; // traverse vars and generate dummy vars and replacement rules ht := HashTableCrIntToExp.emptyHashTable(); - nv := BackendVariable.varsSize(vars); - (vars,(_,_,nv1,addassign,dummyvars,ht)) := BackendVariable.traverseBackendDAEVarsWithUpdate(vars,makeHigherStatesRepl,(vars,1,nv,{},{},ht)); + nv := BackendVariable.varsSize(osyst.orderedVars); + BackendDAE.MATCHING(ass1=ass1, ass2=ass2) := osyst.matching; + + (vars, (_, _, nv1, addassign, dummyvars, ht)) := + BackendVariable.traverseBackendDAEVarsWithUpdate( osyst.orderedVars, makeHigherStatesRepl, + (osyst.orderedVars, 1, nv, {}, {}, ht) ); // BaseHashTable.dumpHashTable(ht); // add dummy Vars; dummyvars := listReverse(dummyvars); - vars := BackendVariable.addVars(dummyvars,vars); + vars := BackendVariable.addVars(dummyvars, vars); // perform replacement rules - (vars,_) := BackendVariable.traverseBackendDAEVarsWithUpdate(vars,replaceDummyDerivativesVar,ht); - _ := BackendDAEUtil.traverseBackendDAEExpsEqnsWithUpdate(eqns,Expression.traverseSubexpressionsHelper,(replaceDummyDerivativesExp,ht)); + (osyst.orderedVars, _) := BackendVariable.traverseBackendDAEVarsWithUpdate(vars, replaceDummyDerivativesVar, ht); + BackendDAEUtil.traverseBackendDAEExpsEqnsWithUpdate( osyst.orderedEqs, Expression.traverseSubexpressionsHelper, + (replaceDummyDerivativesExp, ht) ); // extend assignments ass1 := Array.expand(nv1-nv, ass1, -1); // set the new assignments - List.map2_0(addassign,setHigerDerivativeAssignment,ass1,ass2); - osyst := BackendDAE.EQSYSTEM(vars,eqns,om,omT,BackendDAE.MATCHING(ass1,ass2,{}),stateSets,partitionKind); + List.map2_0(addassign, setHigerDerivativeAssignment, ass1, ass2); + osyst.matching := BackendDAE.MATCHING(ass1, ass2, {}); end replaceHigherDerivatives; protected function setHigerDerivativeAssignment @@ -3492,27 +3491,23 @@ protected function addAllDummyStates input BackendDAE.EqSystem inSystem; input BackendDAE.StateOrder so; input HashTableCrIntToExp.HashTable iHt; - output BackendDAE.EqSystem osyst; + output BackendDAE.EqSystem osyst = inSystem; output HashTableCrIntToExp.HashTable oHt; protected BackendDAE.Variables vars; - BackendDAE.EquationArray eqns; - Option om,omT; - BackendDAE.Matching matching; - BackendDAE.StateSets stateSets; list dummvars; - BackendDAE.BaseClockPartitionKind partitionKind; algorithm - BackendDAE.EQSYSTEM(orderedVars=vars,orderedEqs=eqns,m=om,mT=omT,matching=matching,stateSets=stateSets,partitionKind=partitionKind) := inSystem; // traverse vars and generate dummy vars and replacement rules - (vars,(_,_,dummvars,oHt)) := BackendVariable.traverseBackendDAEVarsWithUpdate(vars,makeAllDummyVarandDummyDerivativeRepl,(vars,so,{},iHt)); + (vars, (_, _, dummvars, oHt)) := + BackendVariable.traverseBackendDAEVarsWithUpdate( osyst.orderedVars, makeAllDummyVarandDummyDerivativeRepl, + (osyst.orderedVars, so, {}, iHt) ); // BaseHashTable.dumpHashTable(oHt); // add dummy Vars; vars := BackendVariable.addVars(dummvars,vars); // perform replacement rules - (vars,_) := BackendVariable.traverseBackendDAEVarsWithUpdate(vars,replaceDummyDerivativesVar,oHt); - _ := BackendDAEUtil.traverseBackendDAEExpsEqnsWithUpdate(eqns,Expression.traverseSubexpressionsHelper,(replaceDummyDerivativesExp,oHt)); - osyst := BackendDAE.EQSYSTEM(vars,eqns,om,omT,matching,stateSets,partitionKind); + (osyst.orderedVars, _) := BackendVariable.traverseBackendDAEVarsWithUpdate(vars, replaceDummyDerivativesVar, oHt); + BackendDAEUtil.traverseBackendDAEExpsEqnsWithUpdate( osyst.orderedEqs, Expression.traverseSubexpressionsHelper, + (replaceDummyDerivativesExp, oHt) ); end addAllDummyStates; protected function makeAllDummyVarandDummyDerivativeRepl @@ -3667,26 +3662,27 @@ protected function addDummyStates output BackendDAE.EqSystem osyst; output HashTableCrIntToExp.HashTable oHt; algorithm - (osyst,oHt) := - match (dummyStates, level, repl, inSystem, iHt) + (osyst,oHt) := match (dummyStates, inSystem) local HashTableCrIntToExp.HashTable ht; BackendDAE.Variables vars; BackendDAE.EquationArray eqns; Option om,omT; BackendDAE.Matching matching; - BackendDAE.StateSets stateSets; + BackendDAE.EqSystem syst; BackendDAE.BaseClockPartitionKind partitionKind; - case ({},_,_,_,_) then (inSystem,iHt); - case (_,_,_,BackendDAE.EQSYSTEM(orderedVars=vars,orderedEqs=eqns,m=om,mT=omT,matching=matching,stateSets=stateSets,partitionKind=partitionKind),_) + case ({}, _) + then (inSystem, iHt); + case (_, syst) equation // create dummy_der vars and change deselected states to dummy states - ((vars,ht)) = List.fold1(dummyStates,makeDummyVarandDummyDerivative,level,(vars,iHt)); - (vars,_) = BackendVariable.traverseBackendDAEVarsWithUpdate(vars,replaceDummyDerivativesVar,ht); - _ = BackendDAEUtil.traverseBackendDAEExpsEqnsWithUpdate(eqns,Expression.traverseSubexpressionsHelper,(replaceDummyDerivativesExp,ht)); - _ = BackendDAEUtil.traverseBackendDAEExpsEqnsWithUpdate(eqns,Expression.traverseSubexpressionsHelper,(replaceFirstOrderDerivativesExp,repl)); - then - (BackendDAE.EQSYSTEM(vars,eqns,om,omT,matching,stateSets,partitionKind),ht); + ((vars, ht)) = List.fold1(dummyStates, makeDummyVarandDummyDerivative, level, (syst.orderedVars, iHt)); + (syst.orderedVars, _) = BackendVariable.traverseBackendDAEVarsWithUpdate(vars, replaceDummyDerivativesVar, ht); + _ = BackendDAEUtil.traverseBackendDAEExpsEqnsWithUpdate( syst.orderedEqs, Expression.traverseSubexpressionsHelper, + (replaceDummyDerivativesExp, ht) ); + _ = BackendDAEUtil.traverseBackendDAEExpsEqnsWithUpdate( syst.orderedEqs, Expression.traverseSubexpressionsHelper, + (replaceFirstOrderDerivativesExp, repl) ); + then (syst, ht); end match; end addDummyStates; @@ -3828,45 +3824,28 @@ protected function replaceDummyDerivativesShared input HashTableCrIntToExp.HashTable ht; output BackendDAE.Shared oshared; algorithm - oshared:= match (inShared,ht) + oshared:= match inShared local - BackendDAE.Variables knvars,exobj,knvars1; - BackendDAE.Variables aliasVars; - BackendDAE.EquationArray remeqns,inieqns; - list constrs; - list clsAttrs; - FCore.Cache cache; - FCore.Graph graph; - DAE.FunctionTree funcTree; - BackendDAE.ExternalObjectClasses eoc; - BackendDAE.SymbolicJacobians symjacs; - list whenClauseLst,whenClauseLst1; - list zeroCrossingLst, relationsLst, sampleLst; - Integer numberOfMathEventFunctions; - BackendDAE.BackendDAEType btp; - list timeEvents; - BackendDAE.ExtraInfo ei; - array clocks; - - case (BackendDAE.SHARED( knvars, exobj, aliasVars, inieqns, remeqns, constrs, clsAttrs, cache, graph, funcTree, - BackendDAE.EVENT_INFO( timeEvents, whenClauseLst, zeroCrossingLst, sampleLst, - relationsLst, numberOfMathEventFunctions, clocks), - eoc, btp, symjacs, ei), _) + list whenClauseLst; + BackendDAE.Shared shared; + BackendDAE.EventInfo eventInfo; + + case shared as BackendDAE.SHARED(eventInfo=eventInfo as BackendDAE.EVENT_INFO()) equation // replace dummy_derivatives in knvars,aliases,ineqns,remeqns - (aliasVars,_) = BackendVariable.traverseBackendDAEVarsWithUpdate(aliasVars, replaceDummyDerivativesVar, ht); - (knvars1,_) = BackendVariable.traverseBackendDAEVarsWithUpdate(knvars, replaceDummyDerivativesVar, ht); - _ = BackendDAEUtil.traverseBackendDAEExpsEqnsWithUpdate( inieqns, Expression.traverseSubexpressionsHelper, - (replaceDummyDerivativesExp,ht) ); - _ = BackendDAEUtil.traverseBackendDAEExpsEqnsWithUpdate( remeqns, Expression.traverseSubexpressionsHelper, - (replaceDummyDerivativesExp,ht) ); - (whenClauseLst1,_) = BackendDAETransform.traverseBackendDAEExpsWhenClauseLst( whenClauseLst,Expression.traverseSubexpressionsHelper, - (replaceDummyDerivativesExp,ht) ); + _ = BackendVariable.traverseBackendDAEVarsWithUpdate(shared.aliasVars, replaceDummyDerivativesVar, ht); + _ = BackendVariable.traverseBackendDAEVarsWithUpdate(shared.knownVars, replaceDummyDerivativesVar, ht); + _ = BackendDAEUtil.traverseBackendDAEExpsEqnsWithUpdate( shared.initialEqs, Expression.traverseSubexpressionsHelper, + (replaceDummyDerivativesExp, ht) ); + _ = BackendDAEUtil.traverseBackendDAEExpsEqnsWithUpdate( shared.removedEqs, Expression.traverseSubexpressionsHelper, + (replaceDummyDerivativesExp, ht) ); + (whenClauseLst, _) = + BackendDAETransform.traverseBackendDAEExpsWhenClauseLst ( + eventInfo.whenClauseLst, Expression.traverseSubexpressionsHelper, (replaceDummyDerivativesExp, ht) ); + eventInfo.whenClauseLst = whenClauseLst; + shared.eventInfo = eventInfo; then - BackendDAE.SHARED( knvars1, exobj, aliasVars, inieqns, remeqns, constrs, clsAttrs, cache, graph, funcTree, - BackendDAE.EVENT_INFO( timeEvents, whenClauseLst1, zeroCrossingLst, sampleLst, relationsLst, - numberOfMathEventFunctions, clocks ), - eoc, btp, symjacs, ei ); + shared; end match; end replaceDummyDerivativesShared; @@ -4190,20 +4169,11 @@ end findStateOrder; protected function findStateOrderWork "author Frenkel TUD 2013-01" input BackendDAE.EqSystem inSystem; - output BackendDAE.EqSystem outSystem; -protected - BackendDAE.Variables vars; - BackendDAE.EquationArray eqns; - Option m; - Option mT; - BackendDAE.Matching matching; - BackendDAE.StateSets stateSets; - BackendDAE.BaseClockPartitionKind partitionKind; + output BackendDAE.EqSystem outSystem = inSystem; algorithm - BackendDAE.EQSYSTEM(vars, eqns, m, mT, matching, stateSets, partitionKind) := inSystem; // find der(s) = v - vars := BackendEquation.traverseEquationArray(eqns, traverseFindStateOrder, vars); - outSystem := BackendDAE.EQSYSTEM(vars, eqns, m, mT, matching, stateSets, partitionKind); + outSystem.orderedVars := BackendEquation.traverseEquationArray( inSystem.orderedEqs, traverseFindStateOrder, + inSystem.orderedVars ); end findStateOrderWork; protected function traverseFindStateOrder diff --git a/Compiler/BackEnd/Initialization.mo b/Compiler/BackEnd/Initialization.mo index 9ee333911f8..e54b3949993 100644 --- a/Compiler/BackEnd/Initialization.mo +++ b/Compiler/BackEnd/Initialization.mo @@ -86,22 +86,14 @@ protected BackendDAE.BackendDAE initdae; BackendDAE.EqSystem initsyst; BackendDAE.EqSystems systs; - BackendDAE.EquationArray inieqns, eqns, emptyeqns, reeqns; - BackendDAE.ExtraInfo ei; + BackendDAE.EquationArray eqns, reeqns; BackendDAE.Shared shared; BackendDAE.Variables initVars; - BackendDAE.Variables knvars, vars, fixvars, evars, eavars, avars; - Boolean b, b1, b2; - Boolean useHomotopy; - DAE.FunctionTree functionTree; - FCore.Cache cache; - FCore.Graph graph; + BackendDAE.Variables vars, fixvars; + Boolean b, b1, b2, useHomotopy; HashSet.HashSet hs "contains all pre variables"; list removedEqns; list dumpVars, dumpVars2; - list tempVar; - list classAttrs; - list constraints; list> pastOptModules; tuple daeHandler; tuple matchingAlgorithm; @@ -117,15 +109,6 @@ algorithm (initVars, outPrimaryParameters, outAllPrimaryParameters) := selectInitializationVariablesDAE(dae); // fcall2(Flags.DUMP_INITIAL_SYSTEM, BackendDump.dumpVariables, initVars, "selected initialization variables"); hs := collectPreVariables(dae); - BackendDAE.DAE(systs, shared as BackendDAE.SHARED(knownVars=knvars, - aliasVars=avars, - initialEqs=inieqns, - constraints=constraints, - classAttrs=classAttrs, - cache=cache, - graph=graph, - functionTree=functionTree, - info=ei)) := dae; // collect vars and eqns for initial system vars := BackendVariable.emptyVars(); @@ -133,13 +116,13 @@ algorithm eqns := BackendEquation.emptyEqns(); reeqns := BackendEquation.emptyEqns(); - ((vars, fixvars, eqns, _)) := BackendVariable.traverseBackendDAEVars(avars, introducePreVarsForAliasVariables, (vars, fixvars, eqns, hs)); - ((vars, fixvars, eqns, _)) := BackendVariable.traverseBackendDAEVars(knvars, collectInitialVars, (vars, fixvars, eqns, hs)); - ((eqns, reeqns)) := BackendEquation.traverseEquationArray(inieqns, collectInitialEqns, (eqns, reeqns)); + ((vars, fixvars, eqns, _)) := BackendVariable.traverseBackendDAEVars(dae.shared.aliasVars, introducePreVarsForAliasVariables, (vars, fixvars, eqns, hs)); + ((vars, fixvars, eqns, _)) := BackendVariable.traverseBackendDAEVars(dae.shared.knownVars, collectInitialVars, (vars, fixvars, eqns, hs)); + ((eqns, reeqns)) := BackendEquation.traverseEquationArray(dae.shared.initialEqs, collectInitialEqns, (eqns, reeqns)); // fcall2(Flags.DUMP_INITIAL_SYSTEM, BackendDump.dumpEquationArray, eqns, "initial equations"); - ((vars, fixvars, eqns, reeqns, _)) := List.fold(systs, collectInitialVarsEqnsSystem, ((vars, fixvars, eqns, reeqns, hs))); + ((vars, fixvars, eqns, reeqns, _)) := List.fold(dae.eqs, collectInitialVarsEqnsSystem, ((vars, fixvars, eqns, reeqns, hs))); ((eqns, reeqns)) := BackendVariable.traverseBackendDAEVars(vars, collectInitialBindings, (eqns, reeqns)); @@ -148,24 +131,11 @@ algorithm vars := BackendVariable.rehashVariables(vars); fixvars := BackendVariable.rehashVariables(fixvars); - evars := BackendVariable.emptyVars(); - eavars := BackendVariable.emptyVars(); - emptyeqns := BackendEquation.emptyEqns(); - shared := BackendDAE.SHARED(fixvars, - evars, - eavars, - emptyeqns, - reeqns, - constraints, - classAttrs, - cache, - graph, - functionTree, - BackendDAEUtil.emptyEventInfo(), - {}, - BackendDAE.INITIALSYSTEM(), - {}, - ei); + shared := BackendDAEUtil.createEmptyShared(BackendDAE.INITIALSYSTEM(), dae.shared.info, dae.shared.cache, dae.shared.graph); + shared := BackendDAEUtil.setSharedKnVars(shared, fixvars); + shared := BackendDAEUtil.setSharedOptimica(shared, dae.shared.constraints, dae.shared.classAttrs); + shared := BackendDAEUtil.setSharedRemovedEqns(shared, reeqns); + shared := BackendDAEUtil.setSharedFunctionTree(shared, dae.shared.functionTree); // generate initial system and pre-balance it initsyst := BackendDAEUtil.createEqSystem(vars, eqns); @@ -250,6 +220,7 @@ algorithm if Flags.isSet(Flags.ITERATION_VARS) then BackendDAEOptimize.listAllIterationVariables(initdae); end if; + if Flags.isSet(Flags.DUMP_BACKENDDAE_INFO) or Flags.isSet(Flags.DUMP_STATESELECTION_INFO) or Flags.isSet(Flags.DUMP_DISCRETEVARS_INFO) then BackendDump.dumpCompShort(initdae); end if; @@ -311,25 +282,18 @@ end solveInitialSystemEqSystem; protected function inlineWhenForInitialization "author: lochel This function inlines when-clauses for the initialization." input BackendDAE.BackendDAE inDAE; - output BackendDAE.BackendDAE outDAE; -protected - BackendDAE.EqSystems systs; - BackendDAE.Shared shared; + output BackendDAE.BackendDAE outDAE = inDAE; algorithm - BackendDAE.DAE(systs, shared) := inDAE; - systs := List.map(systs, inlineWhenForInitializationSystem); - outDAE := BackendDAE.DAE(systs, shared); + outDAE.eqs := List.map(inDAE.eqs, inlineWhenForInitializationSystem); end inlineWhenForInitialization; protected function inlineWhenForInitializationSystem "author: lochel" input BackendDAE.EqSystem inEqSystem; output BackendDAE.EqSystem outEqSystem; protected - BackendDAE.EquationArray eqns; list eqnlst; algorithm - BackendDAE.EQSYSTEM(orderedEqs=eqns) := inEqSystem; - eqnlst := BackendEquation.traverseEquationArray(eqns, inlineWhenForInitializationEquation, {}); + eqnlst := BackendEquation.traverseEquationArray(inEqSystem.orderedEqs, inlineWhenForInitializationEquation, {}); //print("Before: " + intString(listLength(eqnlst)) + "\n"); eqnlst := List.uniqueOnTrue(eqnlst, BackendEquation.equationEqual) "hack for #3209"; //print("After: " + intString(listLength(eqnlst)) + "\n"); @@ -362,7 +326,7 @@ algorithm then eqns; // algorithm - case BackendDAE.ALGORITHM(alg=alg, source=source,expand=crefExpand) equation + case BackendDAE.ALGORITHM(alg=alg, source=source, expand=crefExpand) equation DAE.ALGORITHM_STMTS(statementLst=stmts) = alg; (stmts, leftCrs) = inlineWhenForInitializationWhenAlgorithm(stmts, {}, HashSet.emptyHashSetSized(50)); alg = DAE.ALGORITHM_STMTS(stmts); @@ -382,27 +346,17 @@ protected function inlineWhenForInitializationWhenEquation "author: lochel" input BackendDAE.EquationAttributes inEqAttr; input list inEqns; output list outEqns; +protected + DAE.Exp crexp; + BackendDAE.Equation eqn; algorithm - outEqns := matchcontinue(inWEqn) - local - DAE.ComponentRef left; - DAE.Exp condition, right, crexp; - BackendDAE.Equation eqn; - list eqns; - - // active when equation during initialization - case BackendDAE.WHEN_EQ(condition=condition, left=left, right=right) equation - true = Expression.containsInitialCall(condition, false); // do not use Expression.traverseExpBottomUp - crexp = Expression.crefExp(left); - eqn = BackendEquation.generateEquation(crexp, right, inSource, inEqAttr); - then eqn::inEqns; - - // inactive when equation during initialization - case BackendDAE.WHEN_EQ(condition=condition, left=left) equation - false = Expression.containsInitialCall(condition, false); - eqns = generateInactiveWhenEquationForInitialization(ComponentReference.expandCref(left, true), inSource, inEqns); - then eqns; - end matchcontinue; + if Expression.containsInitialCall(inWEqn.condition, false) then + crexp := Expression.crefExp(inWEqn.left); + eqn := BackendEquation.generateEquation(crexp, inWEqn.right, inSource, inEqAttr); + outEqns := eqn::inEqns; + else + outEqns := generateInactiveWhenEquationForInitialization(ComponentReference.expandCref(inWEqn.left, true), inSource, inEqns); + end if; end inlineWhenForInitializationWhenEquation; protected function inlineWhenForInitializationWhenAlgorithm "author: lochel @@ -509,17 +463,13 @@ protected function collectPreVariables "author: lochel" input BackendDAE.BackendDAE inDAE; output HashSet.HashSet outHS; protected - BackendDAE.EqSystems systs; - BackendDAE.EquationArray ieqns, removedEqs; //list crefs; algorithm //BackendDump.dumpBackendDAE(inDAE, "inDAE"); - BackendDAE.DAE(systs, BackendDAE.SHARED(removedEqs=removedEqs, initialEqs=ieqns)) := inDAE; - outHS := HashSet.emptyHashSet(); - outHS := List.fold(systs, collectPreVariablesEqSystem, outHS); - ((_,outHS)) := BackendDAEUtil.traverseBackendDAEExpsEqns(removedEqs, Expression.traverseSubexpressionsHelper, (collectPreVariablesTraverseExp, outHS)); // ??? - ((_,outHS)) := BackendDAEUtil.traverseBackendDAEExpsEqns(ieqns, Expression.traverseSubexpressionsHelper, (collectPreVariablesTraverseExp, outHS)); + outHS := List.fold(inDAE.eqs, collectPreVariablesEqSystem, outHS); + ((_, outHS)) := BackendDAEUtil.traverseBackendDAEExpsEqns(inDAE.shared.removedEqs, Expression.traverseSubexpressionsHelper, (collectPreVariablesTraverseExp, outHS)); // ??? + ((_, outHS)) := BackendDAEUtil.traverseBackendDAEExpsEqns(inDAE.shared.initialEqs, Expression.traverseSubexpressionsHelper, (collectPreVariablesTraverseExp, outHS)); //print("collectPreVariables:\n"); //crefs := BaseHashSet.hashSetList(outHS); @@ -530,11 +480,8 @@ public function collectPreVariablesEqSystem input BackendDAE.EqSystem inEqSystem; input HashSet.HashSet inHS; output HashSet.HashSet outHS; -protected - BackendDAE.EquationArray orderedEqs; algorithm - BackendDAE.EQSYSTEM(orderedEqs=orderedEqs) := inEqSystem; - ((_, outHS)) := BackendDAEUtil.traverseBackendDAEExpsEqns(orderedEqs, Expression.traverseSubexpressionsHelper, (collectPreVariablesTraverseExp, inHS)); + ((_, outHS)) := BackendDAEUtil.traverseBackendDAEExpsEqns(inEqSystem.orderedEqs, Expression.traverseSubexpressionsHelper, (collectPreVariablesTraverseExp, inHS)); end collectPreVariablesEqSystem; public function collectPreVariablesTraverseExp @@ -587,14 +534,10 @@ end collectPreVariablesTraverseExp2; protected function warnAboutIterationVariablesWithDefaultZeroStartAttribute "author: lochel This function ... read the function name." - input BackendDAE.BackendDAE inBackendDAE; + input BackendDAE.BackendDAE inDAE; output Boolean outWarning; -protected - list eqs; algorithm - BackendDAE.DAE(eqs=eqs) := inBackendDAE; - outWarning := warnAboutIterationVariablesWithDefaultZeroStartAttribute0(eqs, - Flags.isSet(Flags.INITIALIZATION)); + outWarning := warnAboutIterationVariablesWithDefaultZeroStartAttribute0(inDAE.eqs, Flags.isSet(Flags.INITIALIZATION)); end warnAboutIterationVariablesWithDefaultZeroStartAttribute; protected function warnAboutIterationVariablesWithDefaultZeroStartAttribute0 "author: lochel" @@ -609,7 +552,7 @@ algorithm outWarning := outWarning or warn; // If we found an iteration variable with default zero start attribute but - // +initialization wasn't given, we don't need to continue searching. + // +d=initialization wasn't given, we don't need to continue searching. if warn and not inShowWarnings then return; end if; @@ -622,13 +565,11 @@ protected function warnAboutIterationVariablesWithDefaultZeroStartAttribute1 "au output Boolean outWarning = false "True if any warnings were printed."; protected BackendDAE.StrongComponents comps; - BackendDAE.Variables ordered_vars; list vlst = {}; list vars; String err; algorithm - BackendDAE.EQSYSTEM(orderedVars = ordered_vars, - matching = BackendDAE.MATCHING(comps = comps)) := inEqSystem; + BackendDAE.EQSYSTEM(matching=BackendDAE.MATCHING(comps=comps)) := inEqSystem; // Go through all the strongly connected components. for comp in comps loop @@ -648,8 +589,8 @@ algorithm if not listEmpty(vlst) then // Filter out the variables that are missing start values. - vars := List.map1r(vlst, BackendVariable.getVarAt, ordered_vars); - //vars := list(BackendVariable.getVarAt(ordered_vars, idx) for idx in vlst); + vars := List.map1r(vlst, BackendVariable.getVarAt, inEqSystem.orderedVars); + //vars := list(BackendVariable.getVarAt(inEqSystem.orderedVars, idx) for idx in vlst); vars := list(v for v guard(not BackendVariable.varHasStartValue(v)) in vars); //vars := List.filterOnTrue(vars, BackendVariable.varHasStartValue); @@ -658,10 +599,9 @@ algorithm outWarning := true; if inShowWarnings then - Error.addCompilerWarning("Iteration variables with default zero start attribute in " - + err + warnAboutVars2(vars)); + Error.addCompilerWarning("Iteration variables with default zero start attribute in " + err + warnAboutVars2(vars)); else - // If +initialization wasn't given we don't need to continue searching + // If +d=initialization wasn't given we don't need to continue searching // once we've found one. return; end if; @@ -735,8 +675,7 @@ protected function selectInitializationVariablesDAE "author: lochel output list outPrimaryParameters = {}; output list outAllPrimaryParameters = {}; protected - list systs; - BackendDAE.Variables knownVars, alias, allParameters; + BackendDAE.Variables allParameters; BackendDAE.EquationArray allParameterEqns; BackendDAE.EqSystem paramSystem; BackendDAE.IncidenceMatrix m, mT; @@ -749,15 +688,14 @@ protected BackendDAE.Var p; DAE.Exp bindExp; algorithm - BackendDAE.DAE(systs, BackendDAE.SHARED(knownVars=knownVars, aliasVars=alias)) := inDAE; - outVars := selectInitializationVariables(systs); - outVars := BackendVariable.traverseBackendDAEVars(knownVars, selectInitializationVariables2, outVars); - outVars := BackendVariable.traverseBackendDAEVars(alias, selectInitializationVariables2, outVars); + outVars := selectInitializationVariables(inDAE.eqs); + outVars := BackendVariable.traverseBackendDAEVars(inDAE.shared.knownVars, selectInitializationVariables2, outVars); + outVars := BackendVariable.traverseBackendDAEVars(inDAE.shared.aliasVars, selectInitializationVariables2, outVars); // select all parameters allParameters := BackendVariable.emptyVars(); allParameterEqns := BackendEquation.emptyEqns(); - (allParameters, allParameterEqns) := BackendVariable.traverseBackendDAEVars(knownVars, selectParameter2, (allParameters, allParameterEqns)); + (allParameters, allParameterEqns) := BackendVariable.traverseBackendDAEVars(inDAE.shared.knownVars, selectParameter2, (allParameters, allParameterEqns)); nParam := BackendVariable.varsSize(allParameters); if nParam > 0 then @@ -884,11 +822,8 @@ protected function selectInitializationVariables1 "author: lochel" input BackendDAE.EqSystem inEqSystem; input BackendDAE.Variables inVars; output BackendDAE.Variables outVars; -protected - BackendDAE.Variables orderedVars; algorithm - BackendDAE.EQSYSTEM(orderedVars=orderedVars) := inEqSystem; - outVars := BackendVariable.traverseBackendDAEVars(orderedVars, selectInitializationVariables2, inVars); + outVars := BackendVariable.traverseBackendDAEVars(inEqSystem.orderedVars, selectInitializationVariables2, inVars); end selectInitializationVariables1; protected function selectParameter2 "author: lochel" @@ -982,7 +917,7 @@ protected function simplifyInitialFunctionsExp output DAE.Exp outExp; output Boolean outUseHomotopy; algorithm - (outExp,outUseHomotopy) := match (inExp,useHomotopy) + (outExp, outUseHomotopy) := match (inExp, useHomotopy) local DAE.Exp e1, e2, e3, actual, simplified; @@ -1016,28 +951,22 @@ end simplifyInitialFunctionsExp; // ============================================================================= protected function preBalanceInitialSystem "author: lochel" - input BackendDAE.EqSystem inSystem; - output BackendDAE.EqSystem outSystem; + input BackendDAE.EqSystem inEqSystem; + output BackendDAE.EqSystem outEqSystem = inEqSystem; output list outDumpVars; +protected + BackendDAE.Variables orderedVars; + BackendDAE.EquationArray orderedEqs; + Boolean b; + BackendDAE.IncidenceMatrix mt; algorithm - outSystem := match inSystem - local - BackendDAE.EqSystem syst; - BackendDAE.Variables orderedVars; - BackendDAE.EquationArray orderedEqs; - Boolean b; - BackendDAE.IncidenceMatrix mt; - - case syst as BackendDAE.EQSYSTEM(orderedVars=orderedVars, orderedEqs=orderedEqs) algorithm - (_, mt) := BackendDAEUtil.incidenceMatrix(syst, BackendDAE.NORMAL(), NONE()); - (orderedVars, orderedEqs, b, outDumpVars) := preBalanceInitialSystem1(arrayLength(mt), mt, orderedVars, orderedEqs, false, {}); - if b then - syst.orderedEqs := orderedEqs; - syst.orderedVars := orderedVars; - syst := BackendDAEUtil.clearEqSyst(syst); - end if; - then syst; - end match; + (_, mt) := BackendDAEUtil.incidenceMatrix(inEqSystem, BackendDAE.NORMAL(), NONE()); + (orderedVars, orderedEqs, b, outDumpVars) := preBalanceInitialSystem1(arrayLength(mt), mt, inEqSystem.orderedVars, inEqSystem.orderedEqs, false, {}); + if b then + outEqSystem.orderedEqs := orderedEqs; + outEqSystem.orderedVars := orderedVars; + outEqSystem := BackendDAEUtil.clearEqSyst(outEqSystem); + end if; end preBalanceInitialSystem; protected function preBalanceInitialSystem1 "author: lochel" @@ -1124,23 +1053,19 @@ protected function analyzeInitialSystem "author: lochel protected BackendDAE.BackendDAE dae; BackendDAE.EqSystem syst; - list systs, systs2; - BackendDAE.Shared shared; - BackendDAE.EquationArray orderedEqs; + list eqs; algorithm // filter empty systems - BackendDAE.DAE(systs, shared) := initDAE; - systs2 := {}; + eqs := {}; outRemovedEqns := {}; - for syst in systs loop + for syst in initDAE.eqs loop if BackendDAEUtil.nonEmptySystem(syst) then - systs2 := syst::systs2; + eqs := syst::eqs; else - BackendDAE.EQSYSTEM(orderedEqs=orderedEqs) := syst; - outRemovedEqns := listAppend(outRemovedEqns, BackendEquation.equationList(orderedEqs)); + outRemovedEqns := listAppend(outRemovedEqns, BackendEquation.equationList(syst.orderedEqs)); end if; end for; - dae := BackendDAE.DAE(systs2, shared); + dae := BackendDAE.DAE(eqs, initDAE.shared); (outDAE, (_, _, outDumpVars, outRemovedEqns)) := BackendDAEUtil.mapEqSystemAndFold(dae, analyzeInitialSystem2, (inDAE, inInitVars, {}, outRemovedEqns)); end analyzeInitialSystem; @@ -1159,80 +1084,68 @@ algorithm end getInitEqIndex; protected function analyzeInitialSystem2 "author: lochel" - input BackendDAE.EqSystem isyst; + input BackendDAE.EqSystem inEqSystem; input BackendDAE.Shared inShared; input tuple, list> inTpl; - output BackendDAE.EqSystem osyst; + output BackendDAE.EqSystem outEqSystem; output BackendDAE.Shared outShared = inShared; output tuple, list> outTpl; algorithm - (osyst, outTpl) := matchcontinue (isyst, inTpl) + outTpl := matchcontinue inTpl local BackendDAE.BackendDAE inDAE; - BackendDAE.EqSystem system, sys; - BackendDAE.EquationArray eqns, eqns2; - BackendDAE.Shared shared; - BackendDAE.Variables vars, initVars; - Integer nVars, nEqns; + BackendDAE.EquationArray eqns2; + BackendDAE.Variables initVars; list dumpVars, dumpVars2; - DAE.FunctionTree funcs; - BackendDAE.IncidenceMatrix m, m1, mOrig; - BackendDAE.IncidenceMatrixT mt, mt1; - BackendDAE.AdjacencyMatrixEnhanced me; - BackendDAE.AdjacencyMatrixTEnhanced meT; - array> mapEqnIncRow; - array mapIncRowEqn; list removedEqns, removedEqns2; - list unassigned; - BackendDAE.EqSystem syst; // (regular) determined system - case (BackendDAE.EQSYSTEM(orderedVars=vars, orderedEqs=eqns), (inDAE, initVars, dumpVars, removedEqns)) equation + case ((inDAE, initVars, dumpVars, removedEqns)) equation // print("index-0 start\n"); - (eqns2, dumpVars2, removedEqns2) = fixInitialSystem(vars, eqns, initVars, inShared, 0); + (eqns2, dumpVars2, removedEqns2) = fixInitialSystem(inEqSystem.orderedVars, inEqSystem.orderedEqs, initVars, inShared, 0); // print("index-0 ende\n"); // add dummy var + dummy eqn dumpVars = listAppend(dumpVars, dumpVars2); removedEqns = listAppend(removedEqns, removedEqns2); - system = BackendDAEUtil.setEqSystEqs(isyst, eqns2); - then (system, (inDAE, initVars, dumpVars, removedEqns)); + outEqSystem = BackendDAEUtil.setEqSystEqs(inEqSystem, eqns2); + then ((inDAE, initVars, dumpVars, removedEqns)); // (index-1) mixed-determined system - case (BackendDAE.EQSYSTEM(orderedVars=vars, orderedEqs=eqns), (inDAE, initVars, dumpVars, removedEqns)) equation + case ((inDAE, initVars, dumpVars, removedEqns)) equation // print("index-1 start\n"); - (eqns2, dumpVars2, removedEqns2) = fixInitialSystem(vars, eqns, initVars, inShared, 1); + (eqns2, dumpVars2, removedEqns2) = fixInitialSystem(inEqSystem.orderedVars, inEqSystem.orderedEqs, initVars, inShared, 1); // print("index-1 ende\n"); // add dummy var + dummy eqn dumpVars = listAppend(dumpVars, dumpVars2); removedEqns = listAppend(removedEqns, removedEqns2); - system = BackendDAEUtil.setEqSystEqs(isyst, eqns2); - then (system, (inDAE, initVars, dumpVars, removedEqns)); + outEqSystem = BackendDAEUtil.setEqSystEqs(inEqSystem, eqns2); + then ((inDAE, initVars, dumpVars, removedEqns)); // (index-2) mixed-determined system - case (BackendDAE.EQSYSTEM(orderedVars=vars, orderedEqs=eqns), (inDAE, initVars, dumpVars, removedEqns)) equation + case ((inDAE, initVars, dumpVars, removedEqns)) equation // print("index-2 start\n"); - (eqns2, dumpVars2, removedEqns2) = fixInitialSystem(vars, eqns, initVars, inShared, 2); + (eqns2, dumpVars2, removedEqns2) = fixInitialSystem(inEqSystem.orderedVars, inEqSystem.orderedEqs, initVars, inShared, 2); // print("index-2 ende\n"); // add dummy var + dummy eqn dumpVars = listAppend(dumpVars, dumpVars2); removedEqns = listAppend(removedEqns, removedEqns2); - system = BackendDAEUtil.setEqSystEqs(isyst, eqns2); - then (system, (inDAE, initVars, dumpVars, removedEqns)); + outEqSystem = BackendDAEUtil.setEqSystEqs(inEqSystem, eqns2); + then ((inDAE, initVars, dumpVars, removedEqns)); // (index-3) mixed-determined system - case (BackendDAE.EQSYSTEM(orderedVars=vars, orderedEqs=eqns), (inDAE, initVars, dumpVars, removedEqns)) equation + case ((inDAE, initVars, dumpVars, removedEqns)) equation // print("index-3 start\n"); - (eqns2, dumpVars2, removedEqns2) = fixInitialSystem(vars, eqns, initVars, inShared, 3); + (eqns2, dumpVars2, removedEqns2) = fixInitialSystem(inEqSystem.orderedVars, inEqSystem.orderedEqs, initVars, inShared, 3); // print("index-3 ende\n"); // add dummy var + dummy eqn dumpVars = listAppend(dumpVars, dumpVars2); removedEqns = listAppend(removedEqns, removedEqns2); - system = BackendDAEUtil.setEqSystEqs(isyst, eqns2); - then (system, (inDAE, initVars, dumpVars, removedEqns)); + outEqSystem = BackendDAEUtil.setEqSystEqs(inEqSystem, eqns2); + then ((inDAE, initVars, dumpVars, removedEqns)); else fail(); end matchcontinue; @@ -1273,14 +1186,14 @@ algorithm // get state-index list stateIndices := BackendVariable.getVarIndexFromVariables(inInitVars, inVars); -//print("{" + stringDelimitList(List.map(stateIndices, intString),",") + "}\n"); +//print("{" + stringDelimitList(List.map(stateIndices, intString), ",") + "}\n"); // get initial equation-index list //(initEqs, _) := List.extractOnTrue(BackendEquation.equationList(inEqns), BackendEquation.isInitialEquation); //nInitEqs := BackendDAEUtil.equationSize(BackendEquation.listEquation(initEqs)); ((_, initEqsIndices)) := List.fold(BackendEquation.equationList(inEqns), getInitEqIndex, (1, {})); nInitEqs := listLength(initEqsIndices); -//print("{" + stringDelimitList(List.map(initEqsIndices, intString),",") + "}\n"); +//print("{" + stringDelimitList(List.map(initEqsIndices, intString), ",") + "}\n"); // modify incidence matrix for under-determined systems nAddEqs := intMax(nVars-nEqns + inIndex, inIndex); @@ -1314,10 +1227,10 @@ algorithm // map artificial variables to redundant equations range := if nAddVars > 0 then List.intRange2(nVars+1, nVars+nAddVars) else {}; redundantEqns := mapIndices(range, ass1); -//print("{" + stringDelimitList(List.map(redundantEqns, intString),",") + "}\n"); +//print("{" + stringDelimitList(List.map(redundantEqns, intString), ",") + "}\n"); // symbolic consistency check - (me, _, _, _) := BackendDAEUtil.getAdjacencyMatrixEnhancedScalar(syst, inShared,false); + (me, _, _, _) := BackendDAEUtil.getAdjacencyMatrixEnhancedScalar(syst, inShared, false); (_, _, _) := consistencyCheck(redundantEqns, inEqns, inVars, inShared, nAddVars, m_, me, ass1, ass2, mapIncRowEqn); // remove redundant equations @@ -1329,7 +1242,7 @@ algorithm // map artificial equations to unfixed states range := if nAddEqs > 0 then List.intRange2(nEqns+1, nEqns+nAddEqs) else {}; range := mapIndices(range, ass2); -//print("{" + stringDelimitList(List.map(range, intString),",") + "}\n"); +//print("{" + stringDelimitList(List.map(range, intString), ",") + "}\n"); // introduce additional initial equations initVarList := List.map1r(range, BackendVariable.getVarAt, inVars); @@ -1343,27 +1256,21 @@ protected function fixUnderDeterminedSystem "author: lochel" input Integer inNEqns; input Integer inNAddEqns; output BackendDAE.IncidenceMatrix outM; +protected + list newEqIndices; algorithm - outM := match(inM, inInitVarIndices, inNEqns, inNAddEqns) - local - BackendDAE.IncidenceMatrix m; - list newEqIndices; - - case (_, _, _, 0) - then inM; - - //case (_, {}, _, _) equation - // print("Error!!!!\n"); - //then fail(); - - case (_, _, _, _) equation - true = (inNAddEqns > 0) "just to be careful"; - m = arrayCreate(inNEqns+inNAddEqns, {}); - m = Array.copy(inM, m); - newEqIndices = List.intRange2(inNEqns+1, inNEqns+inNAddEqns); - m = List.fold1(newEqIndices, squareIncidenceMatrix1, inInitVarIndices, m); - then m; - end match; + if inNAddEqns < 0 then + Error.addInternalError("function fixUnderDeterminedSystem failed due to invalid input", sourceInfo()); + fail(); + end if; + + outM := arrayCreate(inNEqns+inNAddEqns, {}); + outM := Array.copy(inM, outM); + + if inNAddEqns > 0 then + newEqIndices := List.intRange2(inNEqns+1, inNEqns+inNAddEqns); + outM := List.fold1(newEqIndices, squareIncidenceMatrix1, inInitVarIndices, outM); + end if; end fixUnderDeterminedSystem; protected function squareIncidenceMatrix1 "author: lochel" @@ -1381,25 +1288,20 @@ protected function fixOverDeterminedSystem "author: lochel" input Integer inNVars; input Integer inNAddVars; output BackendDAE.IncidenceMatrix outM; +protected + list newVarIndices; algorithm - outM := match(inM, inInitEqnIndices, inNVars, inNAddVars) - local - BackendDAE.IncidenceMatrix m; - list newVarIndices; - - case (_, _, _, 0) - then inM; - - //case (_, {}, _, _) equation - // print("Error!!!!\n"); - //then fail(); + if inNAddVars < 0 then + Error.addInternalError("function fixOverDeterminedSystem failed due to invalid input", sourceInfo()); + fail(); + end if; - case (_, _, _, _) equation - true = (inNAddVars > 0) "just to be careful"; - newVarIndices = List.intRange2(inNVars+1, inNVars+inNAddVars); - m = List.fold1(inInitEqnIndices, squareIncidenceMatrix2, newVarIndices, inM); - then m; - end match; + if inNAddVars > 0 then + newVarIndices := List.intRange2(inNVars+1, inNVars+inNAddVars); + outM := List.fold1(inInitEqnIndices, squareIncidenceMatrix2, newVarIndices, inM); + else + outM := inM; + end if; end fixOverDeterminedSystem; protected function squareIncidenceMatrix2 "author: lochel" @@ -1749,7 +1651,6 @@ algorithm DAE.ComponentRef cref; BackendDAE.Type type_; DAE.Exp exp, exp1, x; - DAE.FunctionTree funcs; case {} then inRepls; @@ -1765,8 +1666,7 @@ algorithm cref = BackendVariable.varCref(var); type_ = BackendVariable.varType(var); x = DAE.CREF(cref, type_); - BackendDAE.SHARED(functionTree = funcs) = inShared; - (eqn as BackendDAE.EQUATION(scalar=exp)) = BackendEquation.solveEquation(eqn, x, SOME(funcs)); + (eqn as BackendDAE.EQUATION(scalar=exp)) = BackendEquation.solveEquation(eqn, x, SOME(inShared.functionTree)); varName = BackendVariable.varCref(var); (exp1, _) = Expression.traverseExpBottomUp(exp, BackendDAEUtil.replaceCrefsWithValues, (inVars, varName)); @@ -1961,7 +1861,7 @@ protected function introducePreVarsForAliasVariables "author: lochel output BackendDAE.Var outVar; output tuple outTpl; algorithm - (outVar,outTpl) := matchcontinue(inVar, inTpl) + (outVar, outTpl) := matchcontinue(inVar, inTpl) local BackendDAE.Var var; DAE.ComponentRef cr; @@ -2023,23 +1923,21 @@ end introducePreVarsForAliasVariables; protected function collectInitialVarsEqnsSystem "author: lochel This function collects variables and equations for the initial system out of an given EqSystem." - input BackendDAE.EqSystem isyst; - input tuple iTpl; - output tuple oTpl; + input BackendDAE.EqSystem inEqSystem; + input tuple inTpl; + output tuple outTpl; protected - BackendDAE.Variables orderedVars, vars, fixvars; - BackendDAE.EquationArray orderedEqs, eqns, reqns; - BackendDAE.StateSets stateSets; + BackendDAE.Variables vars, fixvars; + BackendDAE.EquationArray eqns, reqns; HashSet.HashSet hs; algorithm - BackendDAE.EQSYSTEM(orderedVars=orderedVars, orderedEqs=orderedEqs, stateSets=stateSets) := isyst; - (vars, fixvars, eqns, reqns, hs) := iTpl; + (vars, fixvars, eqns, reqns, hs) := inTpl; - ((vars, fixvars, eqns, hs)) := BackendVariable.traverseBackendDAEVars(orderedVars, collectInitialVars, (vars, fixvars, eqns, hs)); - ((eqns, reqns)) := BackendEquation.traverseEquationArray(orderedEqs, collectInitialEqns, (eqns, reqns)); - //((fixvars, eqns)) := List.fold(stateSets, collectInitialStateSetVars, (fixvars, eqns)); + ((vars, fixvars, eqns, hs)) := BackendVariable.traverseBackendDAEVars(inEqSystem.orderedVars, collectInitialVars, (vars, fixvars, eqns, hs)); + ((eqns, reqns)) := BackendEquation.traverseEquationArray(inEqSystem.orderedEqs, collectInitialEqns, (eqns, reqns)); + //((fixvars, eqns)) := List.fold(inEqSystem.stateSets, collectInitialStateSetVars, (fixvars, eqns)); - oTpl := (vars, fixvars, eqns, reqns, hs); + outTpl := (vars, fixvars, eqns, reqns, hs); end collectInitialVarsEqnsSystem; protected function collectInitialVars "author: lochel @@ -2361,7 +2259,7 @@ protected function collectInitialBindings "author: lochel output BackendDAE.Var outVar; output tuple outTpl; algorithm - (outVar,outTpl) := match (inVar, inTpl) + (outVar, outTpl) := match (inVar, inTpl) local BackendDAE.Var var; DAE.ComponentRef cr; diff --git a/Compiler/BackEnd/Matching.mo b/Compiler/BackEnd/Matching.mo index c9084b93b49..1f79d7146b3 100644 --- a/Compiler/BackEnd/Matching.mo +++ b/Compiler/BackEnd/Matching.mo @@ -34,7 +34,7 @@ encapsulated package Matching package: Matching description: Matching contains functions for matching algorithms - RCS: $Id: Matching.mo 11428 2012-03-14 17:38:09Z Frenkel TUD $" + RCS: $Id: Matching.mo $" public import BackendDAE; @@ -117,9 +117,9 @@ public function BBMatching input BackendDAE.MatchingOptions inMatchingOptions; input BackendDAEFunc.StructurallySingularSystemHandlerFunc sssHandler; input BackendDAE.StructurallySingularSystemHandlerArg inArg; - output BackendDAE.EqSystem outSys=inSys; - output BackendDAE.Shared outShared=inShared; - output BackendDAE.StructurallySingularSystemHandlerArg outArg=inArg; + output BackendDAE.EqSystem outSys = inSys; + output BackendDAE.Shared outShared = inShared; + output BackendDAE.StructurallySingularSystemHandlerArg outArg = inArg; protected Integer i; Boolean success = true; @@ -132,7 +132,7 @@ protected list mEqns; algorithm //BackendDAE.EQSYSTEM(m=SOME(m), matching=BackendDAE.MATCHING(ass1=ass1, ass2=ass2)) := outSys; - BackendDAE.EQSYSTEM(m=SOME(m)) := outSys; + SOME(m) := outSys.m; nEqns := BackendDAEUtil.systemSize(outSys); nVars := BackendVariable.daenumVariables(outSys); // Be carefull, since matching may have been generated with not distinguishing between @@ -162,7 +162,7 @@ algorithm end if; end for; (_, i, outSys, outShared, ass1, ass2, outArg) := sssHandler({mEqns}, i, outSys, outShared, ass1, ass2, outArg); - BackendDAE.EQSYSTEM(m=SOME(m)) := outSys; + SOME(m) := outSys.m; //nEqns := BackendDAEUtil.systemSize(outSys); //nVars := BackendVariable.daenumVariables(outSys); //ass1 := assignmentsArrayExpand(ass1, nVars, arrayLength(ass1), -1); @@ -264,7 +264,7 @@ end invertMatching; // ============================================================================= public function DFSLH -"deapth first search with look ahead feature. basically the same like MC21A." +"depth first search with look ahead feature. basically the same like MC21A." input BackendDAE.EqSystem isyst; input BackendDAE.Shared ishared; input Boolean clearMatching; diff --git a/Compiler/BackEnd/RemoveSimpleEquations.mo b/Compiler/BackEnd/RemoveSimpleEquations.mo index 86a22664895..520d08fd1fa 100644 --- a/Compiler/BackEnd/RemoveSimpleEquations.mo +++ b/Compiler/BackEnd/RemoveSimpleEquations.mo @@ -3539,33 +3539,24 @@ algorithm outDAE:= match (b, inDAE) local - BackendDAE.Variables knvars, exobj, knvars1; + BackendDAE.Variables knvars; BackendDAE.Variables aliasVars; BackendDAE.EquationArray remeqns, inieqns, remeqns1; list constraintsLst; list clsAttrsLst; - FCore.Cache cache; - FCore.Graph graph; - DAE.FunctionTree funcTree; - BackendDAE.ExternalObjectClasses eoc; - BackendDAE.SymbolicJacobians symjacs; - list whenClauseLst, whenClauseLst1; - list zeroCrossingLst, relationsLst, sampleLst; - Integer numMathFunctions; - BackendDAE.BackendDAEType btp; + list whenClauseLst; + BackendDAE.EqSystems systs, systs1; list eqnslst; list varlst; Boolean b1; - list timeEvents; - BackendDAE.ExtraInfo ei; - array clocks; + BackendDAE.Shared shared; + BackendDAE.EventInfo eventInfo; case (false, _) then inDAE; - case (true, BackendDAE.DAE(systs, BackendDAE.SHARED( knvars, exobj, aliasVars, inieqns, remeqns, constraintsLst, clsAttrsLst, cache, graph, funcTree, - BackendDAE.EVENT_INFO( timeEvents, whenClauseLst, zeroCrossingLst, sampleLst, relationsLst, - numMathFunctions, clocks ), - eoc, btp, symjacs, ei ))) + case (true, BackendDAE.DAE(systs, shared as BackendDAE.SHARED( knownVars=knvars, aliasVars=aliasVars, initialEqs=inieqns, + removedEqs=remeqns, constraints=constraintsLst, classAttrs=clsAttrsLst, + eventInfo=eventInfo as BackendDAE.EVENT_INFO(whenClauseLst=whenClauseLst) ))) equation if Flags.isSet(Flags.DUMP_REPL) then BackendVarTransform.dumpReplacements(repl); @@ -3573,24 +3564,32 @@ algorithm BackendVarTransform.dumpDerConstReplacements(repl); end if; // replace moved vars in knvars, remeqns - (aliasVars, (_, varlst)) = BackendVariable.traverseBackendDAEVarsWithUpdate(aliasVars, replaceAliasVarTraverser, (repl, {})); + (_, (_, varlst)) = BackendVariable.traverseBackendDAEVarsWithUpdate(aliasVars, replaceAliasVarTraverser, (repl, {})); aliasVars = List.fold(varlst, fixAliasConstBindings, aliasVars); - (knvars1, _) = BackendVariable.traverseBackendDAEVarsWithUpdate(knvars, replaceVarTraverser, repl); + shared.aliasVars = aliasVars; + + (_, _) = BackendVariable.traverseBackendDAEVarsWithUpdate(knvars, replaceVarTraverser, repl); + ((_, eqnslst, b1)) = BackendEquation.traverseEquationArray(inieqns, replaceEquationTraverser, (repl, {}, false)); - inieqns = if b1 then BackendEquation.listEquation(eqnslst) else inieqns; + shared.initialEqs = if b1 then BackendEquation.listEquation(eqnslst) else inieqns; + ((_, eqnslst, b1)) = BackendEquation.traverseEquationArray(remeqns, replaceEquationTraverser, (repl, {}, false)); remeqns1 = if b1 then BackendEquation.listEquation(eqnslst) else remeqns; - (whenClauseLst1, _) = BackendVarTransform.replaceWhenClauses(whenClauseLst, repl, SOME(BackendVarTransform.skipPreChangeEdgeOperator)); - // remove optimica contraints and classAttributes + // remove asserts with condition=true from removed equations + shared.removedEqs = BackendEquation.listEquation(List.select(BackendEquation.equationList(remeqns1), assertWithCondTrue)); + + (eventInfo.whenClauseLst, _) = + BackendVarTransform.replaceWhenClauses(whenClauseLst, repl, SOME(BackendVarTransform.skipPreChangeEdgeOperator)); + shared.eventInfo = eventInfo; + (constraintsLst, clsAttrsLst) = replaceOptimicaExps(constraintsLst, clsAttrsLst, repl); + shared.constraints = constraintsLst; + shared.classAttrs = clsAttrsLst; + systs1 = removeSimpleEquationsShared1(systs, {}, repl, NONE(), aliasVars); - // remove asserts with condition=true from removed equations - remeqns1 = BackendEquation.listEquation(List.select(BackendEquation.equationList(remeqns1), assertWithCondTrue)); + then - BackendDAE.DAE(systs1, BackendDAE.SHARED( knvars1, exobj, aliasVars, inieqns, remeqns1, constraintsLst, clsAttrsLst, cache, graph, funcTree, - BackendDAE.EVENT_INFO( timeEvents, whenClauseLst1, zeroCrossingLst, sampleLst, relationsLst, - numMathFunctions, clocks ), - eoc, btp, symjacs, ei )); + BackendDAE.DAE(systs1, shared); end match; end removeSimpleEquationsShared; diff --git a/Compiler/BackEnd/ResolveLoops.mo b/Compiler/BackEnd/ResolveLoops.mo index fbb392c770c..e5b411459ed 100644 --- a/Compiler/BackEnd/ResolveLoops.mo +++ b/Compiler/BackEnd/ResolveLoops.mo @@ -65,22 +65,16 @@ public function resolveLoops "author:Waurich TUD 2013-12 current law can be applied." input BackendDAE.BackendDAE inDAE; output BackendDAE.BackendDAE outDAE; +protected + BackendDAE.EqSystems eqSysts; + BackendDAE.Shared shared; algorithm - outDAE := matchcontinue(inDAE) - local - BackendDAE.EqSystems eqSysts; - BackendDAE.Shared shared; - - case (_) equation - true = Flags.isSet(Flags.RESOLVE_LOOPS); - BackendDAE.DAE(eqs=eqSysts, shared=shared) = inDAE; - (eqSysts, shared, _) = List.mapFold2(eqSysts, resolveLoops_main, shared, 1); - outDAE = BackendDAE.DAE(eqSysts, shared); - then outDAE; - - else - then inDAE; - end matchcontinue; + if Flags.isSet(Flags.RESOLVE_LOOPS) then + (eqSysts, shared, _) := List.mapFold2(inDAE.eqs, resolveLoops_main, inDAE.shared, 1); + outDAE := BackendDAE.DAE(eqSysts, shared); + else + outDAE := inDAE; + end if; end resolveLoops; protected function resolveLoops_main "author: Waurich TUD 2014-01 @@ -1753,24 +1747,16 @@ public function reshuffling_post output BackendDAE.BackendDAE outDAE; protected BackendDAE.EqSystems eqSystems; - BackendDAE.Shared shared; algorithm - outDAE := matchcontinue(inDAE) - local - BackendDAE.BackendDAE dae; - case(_) - equation - true = Flags.isSet(Flags.RESHUFFLE_POST); - //print("RESHUFFLING\n"); - //BackendDump.dumpBackendDAE(inDAE,"INDAE"); - BackendDAE.DAE(eqs=eqSystems, shared=shared) = inDAE; - eqSystems = List.map1(eqSystems,reshuffling_post0,shared); - dae = BackendDAE.DAE(eqSystems,shared); - //BackendDump.dumpBackendDAE(dae,"OUTDAE"); - then dae; + if Flags.isSet(Flags.RESHUFFLE_POST) then + //print("RESHUFFLING\n"); + //BackendDump.dumpBackendDAE(inDAE,"INDAE"); + eqSystems := List.map1(inDAE.eqs,reshuffling_post0, inDAE.shared); + outDAE := BackendDAE.DAE(eqSystems, inDAE.shared); + //BackendDump.dumpBackendDAE(outDAE,"OUTDAE"); else - then inDAE; - end matchcontinue; + outDAE := inDAE; + end if; end reshuffling_post; protected function reshuffling_post0 "author: waurich TUD 2014-09" diff --git a/Compiler/BackEnd/StateMachineFeatures.mo b/Compiler/BackEnd/StateMachineFeatures.mo index e9c7856a458..28a1f0fa274 100644 --- a/Compiler/BackEnd/StateMachineFeatures.mo +++ b/Compiler/BackEnd/StateMachineFeatures.mo @@ -1454,36 +1454,16 @@ protected // Fields EQSYSTEM: BackendDAE.Variables orderedVars; BackendDAE.EquationArray orderedEqs; - Option m; - Option mT; - BackendDAE.Matching matching; - BackendDAE.StateSets stateSets; - BackendDAE.BaseClockPartitionKind partitionKind; // Fields SHARED: - BackendDAE.Variables knownVars; - BackendDAE.Variables externalObjects; - BackendDAE.Variables aliasVars; - BackendDAE.EquationArray initialEqs; BackendDAE.EquationArray removedEqs; - list constraints; - list classAttrs; - FCore.Cache cache; - FCore.Graph graph; - DAE.FunctionTree functionTree; - BackendDAE.EventInfo eventInfo; - BackendDAE.ExternalObjectClasses extObjClasses; - BackendDAE.BackendDAEType backendDAEType; - BackendDAE.SymbolicJacobians symjacs; - BackendDAE.ExtraInfo info; // Fields of EQUATION_ARRAY Integer orderedSize, removedSize; Integer orderedNumberOfElement, removedNumberOfElement; Integer orderedArrSize, removedArrSize; array> orderedEquOptArr, removedEquOptArr; algorithm - BackendDAE.EQSYSTEM(orderedVars, orderedEqs, m, mT, matching, stateSets, partitionKind) := inSyst; - BackendDAE.SHARED(knownVars, externalObjects, aliasVars, initialEqs, removedEqs, constraints, - classAttrs, cache, graph, functionTree, eventInfo, extObjClasses,backendDAEType, symjacs, info) := inShared; + BackendDAE.EQSYSTEM(orderedVars=orderedVars, orderedEqs=orderedEqs) := inSyst; + BackendDAE.SHARED(removedEqs=removedEqs) := inShared; BackendDAE.EQUATION_ARRAY(orderedSize, orderedNumberOfElement, orderedArrSize, orderedEquOptArr) := orderedEqs; BackendDAE.EQUATION_ARRAY(removedSize, removedNumberOfElement, removedArrSize, removedEquOptArr) := removedEqs; @@ -1502,10 +1482,8 @@ algorithm // add output variables and (non-input) local variables to modes that declared them (_, modesOut) := Array.mapNoCopy_1(varOptArr, annotateModeOutLocal, modesOut); - // A lot of code bloat just for updating fields "orderedEqs" and "removedEqs" in "EQSYSTEM" and "SHARED" ... - outSyst := BackendDAE.EQSYSTEM(orderedVars, orderedEqsNew, m, mT, matching, stateSets, partitionKind); - outShared := BackendDAE.SHARED(knownVars, externalObjects, aliasVars, initialEqs, removedEqsNew, constraints, - classAttrs, cache, graph, functionTree, eventInfo, extObjClasses,backendDAEType, symjacs, info); + outSyst := inSyst; + outShared := inShared; end annotateModes; @@ -1788,19 +1766,13 @@ protected array> equOptArr; DAE.VarInnerOuter io1, io2; // EQSYSTEM - BackendDAE.Variables orderedVars "ordered Variables, only states and alg. vars"; - BackendDAE.EquationArray orderedEqs "ordered Equations"; - Option m; - Option mT; - BackendDAE.Matching matching; - BackendDAE.StateSets stateSets "the statesets of the system"; - BackendDAE.BaseClockPartitionKind partitionKind; + BackendDAE.Variables orderedVars; algorithm (modes,syst) := inModesSyst; (keyCref,mode) := inCrefMode; - MODE(name,isInitial,edges,eqs,outgoing,outShared,outLocal,crefPrevious) := mode; - BackendDAE.EQUATION_ARRAY(size,numberOfElement,arrSize,equOptArr) := eqs; - BackendDAE.EQSYSTEM(orderedVars,orderedEqs,m,mT,matching,stateSets,partitionKind) := syst; + MODE(name, isInitial, edges, eqs, outgoing, outShared, outLocal, crefPrevious) := mode; + BackendDAE.EQUATION_ARRAY(size, numberOfElement, arrSize, equOptArr) := eqs; + BackendDAE.EQSYSTEM(orderedVars=orderedVars) := syst; outSharedNew := {}; for outVar in outShared loop @@ -1814,18 +1786,18 @@ algorithm if isSome(innerOptCref) then // Remove the equation relating inner and outer - arrayUpdate(equOptArr,i,NONE()); + arrayUpdate(equOptArr, i, NONE()); size := size - 1; //numberOfElement := numberOfElement - 1; - eqs := BackendDAE.EQUATION_ARRAY(size,numberOfElement,arrSize,equOptArr); + eqs := BackendDAE.EQUATION_ARRAY(size, numberOfElement, arrSize, equOptArr); // replace all outer crefs by their corresponding inner cref - (eqs,_) := BackendEquation.traverseEquationArray_WithUpdate(eqs,subsOuterByInnerEq,(outCref,Util.getOption(innerOptCref))); + (eqs,_) := BackendEquation.traverseEquationArray_WithUpdate(eqs, subsOuterByInnerEq, (outCref,Util.getOption(innerOptCref))); // update outSharedNew and use that later to construct MODE - ({innerVar},_) := BackendVariable.getVar(Util.getOption(innerOptCref),orderedVars); + ({innerVar}, _) := BackendVariable.getVar(Util.getOption(innerOptCref), orderedVars); outSharedNew := innerVar :: outSharedNew; // replace possible outer crefs in "crefPrevious" by their corresponding inner - crefPrevious := List.replaceOnTrue(Util.getOption(innerOptCref),crefPrevious,function ComponentReference.crefEqual(inComponentRef1=outCref)); - + crefPrevious := List.replaceOnTrue( Util.getOption(innerOptCref), crefPrevious, + function ComponentReference.crefEqual(inComponentRef1=outCref) ); // Remove variable from BackendDAE variables (the corresponding element in the variable array is set to NONE()) orderedVars := BackendVariable.removeCref(outCref,orderedVars); success := true; @@ -1833,7 +1805,7 @@ algorithm end if; end for; - assert(success, "Expect to find inner variable corresponding to outer variable "+ComponentReference.crefStr(outCref)); + assert(success, "Expect to find inner variable corresponding to outer variable " + ComponentReference.crefStr(outCref)); end for; // Rebuild "orderedVars" in order to eliminate intermediate "NONE()" entries in variable array. @@ -1844,7 +1816,7 @@ algorithm mode := MODE(name,isInitial,edges,eqs,outgoing,listReverse(outSharedNew),outLocal,crefPrevious); modes := BaseHashTable.update((keyCref, mode), modes); - syst := BackendDAE.EQSYSTEM(orderedVars,orderedEqs,m,mT,matching,stateSets,partitionKind); + syst.orderedVars := orderedVars; outModesSyst := (modes,syst); end elaborateMode; @@ -1905,7 +1877,7 @@ protected Boolean equal; algorithm rhsExp := Util.applyOption(inEq,BackendEquation.getEquationRHS); - //print("In getOptInner: rhsExp: "+ (if Util.isSome(rhsExp) then ExpressionDump.printExpStr(Util.getOption(rhsExp)) else "NONE()") + "\n"); + //print("In getOptInner: rhsExp: "+ (if isSome(rhsExp) then ExpressionDump.printExpStr(Util.getOption(rhsExp)) else "NONE()") + "\n"); outOptInner := match rhsExp local DAE.ComponentRef crefInner; @@ -2488,38 +2460,22 @@ protected function wrapAddTimeEventHack " Author: BTH Just a workaround as long as no support of synchronous features." input list timeEventsIn; - input BackendDAE.Shared shared; - output BackendDAE.Shared oshared; + input BackendDAE.Shared inShared; + output BackendDAE.Shared outShared; algorithm - oshared := match (timeEventsIn,shared) + outShared := match inShared local - list timeEvents; - list whenClauseLst; - list zeroCrossingLst; - list sampleLst; - list relationsLst; - Integer numberMathEvents; - array clocks; + BackendDAE.Shared shared; BackendDAE.EventInfo eventInfo; - case( _, BackendDAE.SHARED( eventInfo = - BackendDAE.EVENT_INFO ( - timeEvents = timeEvents, whenClauseLst = whenClauseLst, - zeroCrossingLst = zeroCrossingLst, sampleLst = sampleLst, - relationsLst = relationsLst, numberMathEvents = numberMathEvents, - clocks = clocks ) )) - equation - timeEvents = listAppend(timeEvents,timeEventsIn); - eventInfo = BackendDAE.EVENT_INFO ( - timeEvents = timeEvents, whenClauseLst = whenClauseLst, - zeroCrossingLst = zeroCrossingLst, sampleLst = sampleLst, - relationsLst = relationsLst, numberMathEvents = numberMathEvents, - clocks = clocks ); - then BackendDAEUtil.setSharedEventInfo(shared, eventInfo); + list timeEvents; + case shared as BackendDAE.SHARED(eventInfo=eventInfo as BackendDAE.EVENT_INFO(timeEvents=timeEvents)) + algorithm + eventInfo.timeEvents := listAppend(timeEvents, timeEventsIn); + shared.eventInfo := eventInfo; + then shared; end match; end wrapAddTimeEventHack; - - protected function wrapInWhenHack " Author: BTH Just a workaround as long as no support of synchronous features." diff --git a/Compiler/BackEnd/SymbolicJacobian.mo b/Compiler/BackEnd/SymbolicJacobian.mo index 513c6ed9d3b..f822ea21480 100644 --- a/Compiler/BackEnd/SymbolicJacobian.mo +++ b/Compiler/BackEnd/SymbolicJacobian.mo @@ -370,30 +370,27 @@ protected function replaceStrongComponent "replaces the indexed component with c input Integer idx; input BackendDAE.StrongComponents compsNew; input BackendDAE.StrongComponents compsAdd; - output BackendDAE.EqSystem systOut; + output BackendDAE.EqSystem systOut = systIn; protected BackendDAE.Variables orderedVars; BackendDAE.EquationArray orderedEqs; BackendDAE.Matching matching; - BackendDAE.StateSets stateSets ; - BackendDAE.BaseClockPartitionKind partitionKind; - array ass1,ass2,ass1add,ass2add; + array ass1, ass2, ass1add, ass2add; BackendDAE.StrongComponents comps; algorithm - BackendDAE.EQSYSTEM(orderedVars=orderedVars,orderedEqs=orderedEqs,matching=matching,stateSets=stateSets,partitionKind=partitionKind) := systIn; - BackendDAE.MATCHING(ass1=ass1,ass2=ass2,comps=comps) := matching; + BackendDAE.EQSYSTEM(matching=BackendDAE.MATCHING(ass1=ass1, ass2=ass2, comps=comps)) := systIn; if not listEmpty(compsAdd) then - ass1add := arrayCreate(listLength(compsAdd),0); - ass2add := arrayCreate(listLength(compsAdd),0); - ass1 := arrayAppend(ass1,ass1add); - ass2 := arrayAppend(ass2,ass1add); - List.map2_0(compsAdd,updateAssignment,ass1,ass2); + ass1add := arrayCreate(listLength(compsAdd), 0); + ass2add := arrayCreate(listLength(compsAdd), 0); + ass1 := arrayAppend(ass1, ass1add); + ass2 := arrayAppend(ass2, ass1add); + List.map2_0(compsAdd, updateAssignment, ass1, ass2); end if; - List.map2_0(compsNew,updateAssignment,ass1,ass2); - comps := List.replaceAtWithList(compsNew,idx-1,comps); - comps := listAppend(comps,compsAdd); - matching := BackendDAE.MATCHING(ass1,ass2,comps); - systOut := BackendDAE.EQSYSTEM(orderedVars,orderedEqs,NONE(),NONE(),matching,stateSets,partitionKind); + List.map2_0(compsNew, updateAssignment, ass1, ass2); + comps := List.replaceAtWithList(compsNew, idx-1, comps); + comps := listAppend(comps, compsAdd); + systOut.matching := BackendDAE.MATCHING(ass1, ass2, comps); + systOut := BackendDAEUtil.setEqSystMatrices(systOut); end replaceStrongComponent; protected function updateAssignment @@ -739,8 +736,8 @@ protected function constantLinearSystemWork output Integer sysIdxOut; output Integer compIdxOut; algorithm - (osyst,oshared,outRunMatching,sysIdxOut,compIdxOut):= - matchcontinue (isyst,ishared,comp,sysIdxIn,compIdxIn) + (osyst, oshared, outRunMatching, sysIdxOut, compIdxOut):= + matchcontinue (isyst, ishared, comp) local BackendDAE.Variables vars; BackendDAE.EquationArray eqns; @@ -764,18 +761,22 @@ algorithm BackendDAE.StateSets stateSets; BackendDAE.BaseClockPartitionKind partitionKind; - case (syst as BackendDAE.EQSYSTEM(orderedVars=vars,orderedEqs=eqns), shared,(BackendDAE.EQUATIONSYSTEM(eqns=eindex,vars=vindx,jac=BackendDAE.FULL_JACOBIAN(SOME(jac)),jacType=BackendDAE.JAC_CONSTANT())),_,_) + case (syst, shared, (BackendDAE.EQUATIONSYSTEM( eqns=eindex, vars=vindx, jac=BackendDAE.FULL_JACOBIAN(SOME(jac)), + jacType=BackendDAE.JAC_CONSTANT() ))) equation //the A-matrix and the b-Vector are constant - eqn_lst = BackendEquation.getEqns(eindex,eqns); - var_lst = List.map1r(vindx, BackendVariable.getVarAt, vars); - (syst,shared) = solveLinearSystem(syst,shared,eqn_lst,eindex,var_lst,vindx,jac); + eqn_lst = BackendEquation.getEqns(eindex, syst.orderedEqs); + var_lst = List.map1r(vindx, BackendVariable.getVarAt, syst.orderedVars); + (syst,shared) = solveLinearSystem(syst, shared, eqn_lst, eindex, var_lst, vindx, jac); then (syst,shared,true,sysIdxIn,compIdxIn+1); - case (syst as BackendDAE.EQSYSTEM(orderedVars=vars,orderedEqs=eqns,matching=matching,stateSets=stateSets, partitionKind=partitionKind),shared,(BackendDAE.EQUATIONSYSTEM(eqns=eindex,vars=vindx,jac=BackendDAE.FULL_JACOBIAN(SOME(jac)),jacType=BackendDAE.JAC_LINEAR())),_,_) + + case ( syst as BackendDAE.EQSYSTEM(orderedVars=vars, orderedEqs=eqns), shared, + BackendDAE.EQUATIONSYSTEM( eqns=eindex, vars=vindx, jac=BackendDAE.FULL_JACOBIAN(SOME(jac)), + jacType=BackendDAE.JAC_LINEAR() ) ) equation true = BackendDAEUtil.isSimulationDAE(ishared); //only the A-matrix is constant, apply Gaussian Elimination - eqn_lst = BackendEquation.getEqns(eindex,eqns); + eqn_lst = BackendEquation.getEqns(eindex, eqns); var_lst = List.map1r(vindx, BackendVariable.getVarAt, vars); true = jacobianIsConstant(jac); true = Flags.isSet(Flags.CONSTJAC); @@ -785,7 +786,8 @@ algorithm //BackendDump.dumpEqnsSolved2({comp},eqns,vars); eqn_lst = BackendEquation.getEqns(eindex,eqns); var_lst = List.map1r(vindx, BackendVariable.getVarAt, vars); - (sysEqs,bEqs,bVars,order,sysIdx) = solveConstJacLinearSystem(syst,shared,eqn_lst,eindex,listReverse(var_lst),vindx,jac,sysIdxIn,compIdxIn); + (sysEqs, bEqs, bVars, order, sysIdx) = + solveConstJacLinearSystem(syst, shared, eqn_lst, eindex, listReverse(var_lst), vindx, jac, sysIdxIn, compIdxIn); //print("the b-vector stuff \n"); //BackendDump.printEquationList(bEqs); //BackendDump.printVarList(bVars); @@ -796,28 +798,29 @@ algorithm //print("numberOfElement"+intString(BackendDAEUtil.equationArraySize(eqns))+"\n"); //print("arrSize"+intString(BackendDAEUtil.equationArraySize2(eqns))+"\n"); //print("length"+intString(listLength(BackendEquation.equationList(eqns)))+"\n"); - bVarIdcs = List.intRange2(BackendVariable.varsSize(vars)+1,BackendVariable.varsSize(vars)+listLength(bVars)); - bEqIdcs = List.intRange2(BackendDAEUtil.equationArraySize(eqns)+1,BackendDAEUtil.equationArraySize(eqns)+listLength(bEqs)); - bComps = List.threadMap(bEqIdcs,bVarIdcs,BackendDAEUtil.makeSingleEquationComp); - sysComps = List.threadMap(List.map1(arrayList(order),List.getIndexFirst,eindex),listReverse(vindx),BackendDAEUtil.makeSingleEquationComp); + bVarIdcs = List.intRange2(BackendVariable.varsSize(vars)+1, BackendVariable.varsSize(vars)+listLength(bVars)); + bEqIdcs = List.intRange2(BackendDAEUtil.equationArraySize(eqns)+1, BackendDAEUtil.equationArraySize(eqns)+listLength(bEqs)); + bComps = List.threadMap(bEqIdcs, bVarIdcs, BackendDAEUtil.makeSingleEquationComp); + sysComps = List.threadMap( List.map1(arrayList(order), List.getIndexFirst, eindex), listReverse(vindx), + BackendDAEUtil.makeSingleEquationComp ); //print("bCOMPS\n"); //BackendDump.dumpComponents(bComps); //print("SYSCOMPS\n"); //BackendDump.dumpComponents(sysComps); //build system - vars = List.fold(bVars, BackendVariable.addVar, vars); + syst.orderedVars = List.fold(bVars, BackendVariable.addVar, vars); eqns = List.fold(bEqs, BackendEquation.addEquation, eqns); - eqns = List.threadFold(eindex,sysEqs,BackendEquation.setAtIndexFirst,eqns); - syst = BackendDAE.EQSYSTEM(vars, eqns, NONE(), NONE(), matching, stateSets, partitionKind); + syst.orderedEqs = List.threadFold(eindex, sysEqs, BackendEquation.setAtIndexFirst, eqns); + syst = BackendDAEUtil.setEqSystMatrices(syst); syst = replaceStrongComponent(syst,compIdxIn,sysComps,bComps); //print("compIdxIn"+intString(compIdxIn)+"\n"); - then (syst,ishared,false,sysIdx,compIdxIn+listLength(sysComps)); - else (isyst,ishared,false,sysIdxIn,compIdxIn+1); + then (syst, ishared, false, sysIdx, compIdxIn+listLength(sysComps)); + else (isyst, ishared, false, sysIdxIn, compIdxIn+1); end matchcontinue; end constantLinearSystemWork; protected function solveLinearSystem - input BackendDAE.EqSystem syst; + input BackendDAE.EqSystem inSyst; input BackendDAE.Shared ishared; input list eqn_lst; input list eqn_indxs; @@ -827,39 +830,39 @@ protected function solveLinearSystem output BackendDAE.EqSystem osyst; output BackendDAE.Shared oshared; algorithm - (osyst,oshared):= - match (syst,ishared,eqn_lst,eqn_indxs,var_lst,var_indxs,jac) + (osyst, oshared) := match (inSyst, ishared) local - BackendDAE.Variables vars,vars1,v; - BackendDAE.EquationArray eqns,eqns1, eqns2; + BackendDAE.Variables v; + BackendDAE.EquationArray eqns, eqns1; list beqs; list sources; list rhsVals,solvedVals; list> jacVals; Integer linInfo; list names; - BackendDAE.Matching matching; DAE.FunctionTree funcs; BackendDAE.Shared shared; - BackendDAE.StateSets stateSets; - BackendDAE.BaseClockPartitionKind partitionKind; + BackendDAE.EqSystem syst; - case (BackendDAE.EQSYSTEM(orderedVars=vars,orderedEqs=eqns,matching=matching,stateSets=stateSets,partitionKind=partitionKind),BackendDAE.SHARED(functionTree=funcs),_,_,_,_,_) + case (syst as BackendDAE.EQSYSTEM(), BackendDAE.SHARED(functionTree=funcs)) equation eqns1 = BackendEquation.listEquation(eqn_lst); v = BackendVariable.listVar1(var_lst); - (beqs,sources) = BackendDAEUtil.getEqnSysRhs(eqns1,v,SOME(funcs)); + (beqs, sources) = BackendDAEUtil.getEqnSysRhs(eqns1, v, SOME(funcs)); beqs = listReverse(beqs); - rhsVals = ValuesUtil.valueReals(List.map(beqs,Ceval.cevalSimple)); - jacVals = evaluateConstantJacobian(listLength(var_lst),jac); - (solvedVals,linInfo) = System.dgesv(jacVals,rhsVals); - names = List.map(var_lst,BackendVariable.varCref); - checkLinearSystem(linInfo,names,jacVals,rhsVals,eqn_lst); - sources = List.map1(sources, DAEUtil.addSymbolicTransformation, DAE.LINEAR_SOLVED(names,jacVals,rhsVals,solvedVals)); - (vars1,eqns2,shared) = changeConstantLinearSystemVars(var_lst,solvedVals,sources,var_indxs,vars,eqns,ishared); - eqns = List.fold(eqn_indxs,BackendEquation.equationRemove,eqns2); + rhsVals = ValuesUtil.valueReals(List.map(beqs, Ceval.cevalSimple)); + jacVals = evaluateConstantJacobian(listLength(var_lst), jac); + (solvedVals, linInfo) = System.dgesv(jacVals, rhsVals); + names = List.map(var_lst, BackendVariable.varCref); + checkLinearSystem(linInfo, names, jacVals, rhsVals, eqn_lst); + sources = List.map1( sources, DAEUtil.addSymbolicTransformation, + DAE.LINEAR_SOLVED(names, jacVals, rhsVals, solvedVals) ); + (v, eqns, shared) = changeConstantLinearSystemVars( var_lst, solvedVals, sources, var_indxs, + syst.orderedVars, syst.orderedEqs, ishared ); + syst.orderedVars = v; + syst.orderedEqs = List.fold(eqn_indxs, BackendEquation.equationRemove, eqns); then - (BackendDAE.EQSYSTEM(vars1,eqns,NONE(),NONE(),matching,stateSets,partitionKind),shared); + (BackendDAEUtil.setEqSystMatrices(syst), shared); end match; end solveLinearSystem; @@ -1749,40 +1752,35 @@ protected function optimizeJacobianMatrix "author: wbraun" input list inComRef1 "eqnvars"; input list inComRef2 "vars to differentiate"; output BackendDAE.BackendDAE outJacobian; +protected + array ea = listArray({}); + BackendDAE.Matching eMatching = BackendDAE.MATCHING(ea, ea, {}); algorithm outJacobian := matchcontinue (inBackendDAE,inComRef1,inComRef2) local BackendDAE.BackendDAE backendDAE, backendDAE2; - BackendDAE.Variables v; - BackendDAE.EquationArray e; - + BackendDAE.EqSystem syst; BackendDAE.Shared shared; - array ea; - - Option om,omT; Boolean b; - BackendDAE.StateSets stateSets; - BackendDAE.BaseClockPartitionKind partitionKind; - case (BackendDAE.DAE(BackendDAE.EQSYSTEM(orderedVars=v,orderedEqs=e,m=om,mT=omT,stateSets=stateSets,partitionKind=partitionKind)::{},shared),{},_) + case (BackendDAE.DAE(syst::{}, shared), {}, _) equation - v = BackendVariable.listVar({}); - ea = listArray({}); - then (BackendDAE.DAE(BackendDAE.EQSYSTEM(v,e,om,omT,BackendDAE.MATCHING(ea,ea,{}),stateSets,partitionKind)::{},shared)); - case (BackendDAE.DAE(BackendDAE.EQSYSTEM(orderedVars=v,orderedEqs=e,m=om,mT=omT,stateSets=stateSets,partitionKind=partitionKind)::{},shared),_,{}) + syst.orderedVars = BackendVariable.listVar({}); + syst.matching = eMatching; + then BackendDAE.DAE(syst::{}, shared); + case (BackendDAE.DAE(syst::{}, shared), _, {}) equation - v = BackendVariable.listVar({}); - ea = listArray({}); - then (BackendDAE.DAE(BackendDAE.EQSYSTEM(v,e,om,omT,BackendDAE.MATCHING(ea,ea,{}),stateSets,partitionKind)::{},shared)); - case (backendDAE,_,_) + syst.orderedVars = BackendVariable.listVar({}); + syst.matching = eMatching; + then BackendDAE.DAE(syst::{}, shared); + case (backendDAE, _, _) equation if Flags.isSet(Flags.JAC_DUMP2) then print("analytical Jacobians -> optimize jacobians time: " + realString(clock()) + "\n"); end if; b = Flags.disableDebug(Flags.EXEC_STAT); - if Flags.isSet(Flags.JAC_DUMP) then BackendDump.bltdump("Symbolic Jacobian",backendDAE); end if; @@ -2140,21 +2138,19 @@ algorithm (outSyst, outShared) := match (inSyst, inShared) local BackendDAE.EqSystem syst; - list systs; BackendDAE.Shared shared; array ass1; array ass2; BackendDAE.StrongComponents comps; BackendDAE.Variables vars; BackendDAE.EquationArray eqns; - Option m; - Option mT; - BackendDAE.StateSets stateSets; - BackendDAE.BaseClockPartitionKind partitionKind; - case (BackendDAE.EQSYSTEM(vars, eqns, m, mT, BackendDAE.MATCHING(ass1,ass2,comps), stateSets, partitionKind), shared) equation - (comps, shared) = calculateJacobiansComponents(comps, vars, eqns, shared, {}); - then (BackendDAE.EQSYSTEM(vars, eqns, m, mT, BackendDAE.MATCHING(ass1,ass2,comps), stateSets, partitionKind), shared); + case (syst as BackendDAE.EQSYSTEM( orderedVars=vars, orderedEqs=eqns, + matching=BackendDAE.MATCHING(ass1,ass2,comps) ), shared) + equation + (comps, shared) = calculateJacobiansComponents(comps, vars, eqns, shared, {}); + syst.matching = BackendDAE.MATCHING(ass1, ass2, comps); + then (syst, shared); end match; end calculateEqSystemJacobians; @@ -2568,24 +2564,18 @@ algorithm (outSyst,outShared) := match (inSyst, inShared) local BackendDAE.EqSystem syst; - list systs; BackendDAE.Shared shared; - array ass1; - array ass2; BackendDAE.StrongComponents comps; BackendDAE.Variables vars; BackendDAE.EquationArray eqns; - Option m; - Option mT; BackendDAE.StateSets stateSets; - BackendDAE.Matching matching; - BackendDAE.BaseClockPartitionKind partitionKind; - case (syst as BackendDAE.EQSYSTEM(vars, eqns, m, mT, matching, stateSets, partitionKind), shared) + case (syst as BackendDAE.EQSYSTEM(orderedVars=vars, orderedEqs = eqns, stateSets=stateSets), shared) equation comps = BackendDAEUtil.getStrongComponents(syst); (stateSets, shared) = calculateStateSetsJacobian(stateSets, vars, eqns, comps, shared, {}); - then (BackendDAE.EQSYSTEM(vars, eqns, m, mT, matching, stateSets, partitionKind), shared); + syst.stateSets = stateSets; + then (syst, shared); end match; end calculateEqSystemStateSetsJacobians; diff --git a/Compiler/BackEnd/SynchronousFeatures.mo b/Compiler/BackEnd/SynchronousFeatures.mo index 1733355b84e..ed23f3f4693 100644 --- a/Compiler/BackEnd/SynchronousFeatures.mo +++ b/Compiler/BackEnd/SynchronousFeatures.mo @@ -131,14 +131,13 @@ protected list relationsLst; Integer numberMathEvents; algorithm - BackendDAE.SHARED(eventInfo=eventInfo) := inShared; - BackendDAE.EVENT_INFO( timeEvents=timeEvents, whenClauseLst=whenClauseLst, sampleLst=sampleLst, - zeroCrossingLst=zeroCrossingLst, relationsLst=relationsLst, - numberMathEvents=numberMathEvents) := eventInfo; - eventInfo := BackendDAE.EVENT_INFO( timeEvents=timeEvents, whenClauseLst=whenClauseLst, - zeroCrossingLst=zeroCrossingLst, relationsLst=relationsLst, - numberMathEvents=numberMathEvents, sampleLst=sampleLst, clocks = inClocks ); - outShared := BackendDAEUtil.setSharedEventInfo(inShared, eventInfo); + outShared := match inShared + local + BackendDAE.Shared shared; + case shared as BackendDAE.SHARED() + algorithm shared.partitionsInfo := BackendDAE.PARTITIONS_INFO(inClocks); + then shared; + end match; end setClocks; protected type UnresolvedPartitionData = tuple; diff --git a/Compiler/BackEnd/Tearing.mo b/Compiler/BackEnd/Tearing.mo index d996aeb243e..dc0d0c27414 100644 --- a/Compiler/BackEnd/Tearing.mo +++ b/Compiler/BackEnd/Tearing.mo @@ -86,15 +86,12 @@ end TearingMethod; public function tearingSystem "author: Frenkel TUD 2012-05" input BackendDAE.BackendDAE inDAE; output BackendDAE.BackendDAE outDAE; -protected - Boolean update; algorithm outDAE := matchcontinue(inDAE) local String methodString; TearingMethod method; BackendDAE.BackendDAEType DAEtype; - BackendDAE.Shared shared; // if noTearing is selected, do nothing. case(_) equation @@ -105,11 +102,9 @@ algorithm // get method function and traveres systems case(_) equation methodString = Config.getTearingMethod(); - BackendDAE.DAE(shared=shared) = inDAE; - BackendDAE.SHARED(backendDAEType=DAEtype) = shared; + BackendDAE.SHARED(backendDAEType=DAEtype) = inDAE.shared; false = stringEqual(methodString, "shuffleTearing") and stringEq("simulation",BackendDump.printBackendDAEType2String(DAEtype)); method = getTearingMethod(methodString); - BackendDAE.DAE() = inDAE; if Flags.isSet(Flags.TEARING_DUMP) or Flags.isSet(Flags.TEARING_DUMPVERBOSE) then print("\n\n\n\n" + UNDERLINE + UNDERLINE + "\nCalling Tearing for "); BackendDump.printBackendDAEType(DAEtype); @@ -3772,7 +3767,7 @@ protected function recursiveTearingMain output BackendDAE.BackendDAE outDAE; output Boolean update = false; protected - list systlst, systlst_new = {}; + list systlst_new = {}; BackendDAE.Shared shared; DAE.FunctionTree funcs; BackendDAE.Variables vars, knownVars; @@ -3802,11 +3797,10 @@ protected Boolean maxSizeOne = Flags.getConfigInt(Flags.RTEARING) == 1; list loopT, noLoopT; algorithm - - BackendDAE.DAE(systlst, shared) := inDAE; - BackendDAE.SHARED(functionTree = funcs, knownVars = knownVars) := shared; + shared := inDAE.shared; + BackendDAE.SHARED(functionTree=funcs, knownVars=knownVars) := shared; //BackendDump.bltdump("IN:", inDAE); - for syst in systlst loop + for syst in inDAE.eqs loop BackendDAE.EQSYSTEM(orderedVars=vars,orderedEqs=eqns,matching=BackendDAE.MATCHING(comps=comps),stateSets=stateSets,partitionKind=partitionKind) := syst; (_, mm, _) := BackendDAEUtil.getIncidenceMatrix(syst, BackendDAE.SPARSE(), SOME(funcs)); tmp_update := false; diff --git a/Compiler/BackEnd/UnitCheck.mo b/Compiler/BackEnd/UnitCheck.mo index 34cd946655c..6ebf7571a11 100644 --- a/Compiler/BackEnd/UnitCheck.mo +++ b/Compiler/BackEnd/UnitCheck.mo @@ -86,77 +86,67 @@ end Token; public function unitChecking "author: jhagemann" input BackendDAE.BackendDAE inDAE; output BackendDAE.BackendDAE outDAE; -algorithm - outDAE := matchcontinue(inDAE) - local - BackendDAE.BackendDAE dae; - BackendDAE.EqSystems eqs_; - BackendDAE.Shared shared; - BackendDAE.Variables orderedVars, knownVars, aliasVars; - BackendDAE.EquationArray orderedEqs; - BackendDAE.EqSystem syst; - - list varList, paraList, aliasList; - list eqList; - - HashTableCrToUnit.HashTable HtCr2U1, HtCr2U2; - HashTableStringToUnit.HashTable HtS2U; - HashTableUnitToString.HashTable HtU2S; +protected + BackendDAE.Shared shared; + BackendDAE.Variables orderedVars, knownVars, aliasVars; + BackendDAE.EqSystem syst; + list varList, paraList, aliasList; + list eqList; - case BackendDAE.DAE( {syst as BackendDAE.EQSYSTEM(orderedVars=orderedVars, orderedEqs=orderedEqs)}, - shared as BackendDAE.SHARED(knownVars=knownVars, aliasVars=aliasVars) ) - equation - true = Flags.getConfigBool(Flags.NEW_UNIT_CHECKING); - - varList = BackendVariable.varList(orderedVars); - paraList = BackendVariable.varList(knownVars); - aliasList = BackendVariable.varList(aliasVars); - eqList = BackendEquation.equationList(orderedEqs); - - HtCr2U1=HashTableCrToUnit.emptyHashTableSized(2053); - HtS2U=foldComplexUnits(HashTableStringToUnit.emptyHashTableSized(2053)); - HtU2S=foldComplexUnits2(HashTableUnitToString.emptyHashTableSized(2053)); - - if Flags.isSet(Flags.DUMP_EQ_UNIT) then - BackendDump.dumpEquationList(eqList, "########### Equation-Liste: #########\n"); - end if; - ((HtCr2U1, HtS2U, HtU2S)) = List.fold(varList, convertUnitString2unit, (HtCr2U1, HtS2U, HtU2S)); - ((HtCr2U1, HtS2U, HtU2S)) = List.fold(paraList, convertUnitString2unit, (HtCr2U1, HtS2U, HtU2S)); - ((HtCr2U1, HtS2U, HtU2S)) = List.fold(aliasList, convertUnitString2unit, (HtCr2U1, HtS2U, HtU2S)); - - HtCr2U2=BaseHashTable.copy(HtCr2U1); - if Flags.isSet(Flags.DUMP_UNIT) then - print("#####################################\n"); - BaseHashTable.dumpHashTable(HtCr2U1); - end if; - ((HtCr2U2, HtS2U, HtU2S)) = algo(paraList, eqList, HtCr2U2, HtS2U, HtU2S); - if Flags.isSet(Flags.DUMP_UNIT) then - BaseHashTable.dumpHashTable(HtCr2U2); - print("######## UnitCheck COMPLETED ########\n"); - end if; - notification(HtCr2U1, HtCr2U2, HtU2S); - varList = List.map2(varList, returnVar, HtCr2U2, HtU2S); - paraList = List.map2(paraList, returnVar, HtCr2U2, HtU2S); - aliasList = List.map2(aliasList, returnVar, HtCr2U2, HtU2S); - - orderedVars = BackendVariable.listVar(varList); - knownVars = BackendVariable.listVar(paraList); - aliasVars = BackendVariable.listVar(aliasList); - - syst = BackendDAEUtil.setEqSystVars(syst, orderedVars); - shared = BackendDAEUtil.setSharedKnVars(shared, knownVars); - shared = BackendDAEUtil.setSharedAliasVars(shared, aliasVars); - dae = BackendDAE.DAE({syst}, shared); - then dae; - - //case _ equation - // true = Flags.getConfigBool(Flags.NEW_UNIT_CHECKING); - // Error.addInternalError("./Compiler/BackEnd/UnitCheck.mo: unit check module failed"); - //then inDAE; - - else inDAE; - end matchcontinue; + HashTableCrToUnit.HashTable HtCr2U1, HtCr2U2; + HashTableStringToUnit.HashTable HtS2U; + HashTableUnitToString.HashTable HtU2S; +algorithm + try + BackendDAE.DAE({syst}, shared) := inDAE; + true := Flags.getConfigBool(Flags.NEW_UNIT_CHECKING); + + varList := BackendVariable.varList(syst.orderedVars); + paraList := BackendVariable.varList(shared.knownVars); + aliasList := BackendVariable.varList(shared.aliasVars); + eqList := BackendEquation.equationList(syst.orderedEqs); + + HtCr2U1 := HashTableCrToUnit.emptyHashTableSized(2053); + HtS2U := foldComplexUnits(HashTableStringToUnit.emptyHashTableSized(2053)); + HtU2S := foldComplexUnits2(HashTableUnitToString.emptyHashTableSized(2053)); + + if Flags.isSet(Flags.DUMP_EQ_UNIT) then + BackendDump.dumpEquationList(eqList, "########### Equation-Liste: #########\n"); + end if; + ((HtCr2U1, HtS2U, HtU2S)) := List.fold(varList, convertUnitString2unit, (HtCr2U1, HtS2U, HtU2S)); + ((HtCr2U1, HtS2U, HtU2S)) := List.fold(paraList, convertUnitString2unit, (HtCr2U1, HtS2U, HtU2S)); + ((HtCr2U1, HtS2U, HtU2S)) := List.fold(aliasList, convertUnitString2unit, (HtCr2U1, HtS2U, HtU2S)); + + HtCr2U2 := BaseHashTable.copy(HtCr2U1); + if Flags.isSet(Flags.DUMP_UNIT) then + print("#####################################\n"); + BaseHashTable.dumpHashTable(HtCr2U1); + end if; + ((HtCr2U2, HtS2U, HtU2S)) := algo(paraList, eqList, HtCr2U2, HtS2U, HtU2S); + if Flags.isSet(Flags.DUMP_UNIT) then + BaseHashTable.dumpHashTable(HtCr2U2); + print("######## UnitCheck COMPLETED ########\n"); + end if; + notification(HtCr2U1, HtCr2U2, HtU2S); + varList := List.map2(varList, returnVar, HtCr2U2, HtU2S); + paraList := List.map2(paraList, returnVar, HtCr2U2, HtU2S); + aliasList := List.map2(aliasList, returnVar, HtCr2U2, HtU2S); + + orderedVars := BackendVariable.listVar(varList); + knownVars := BackendVariable.listVar(paraList); + aliasVars := BackendVariable.listVar(aliasList); + + syst := BackendDAEUtil.setEqSystVars(syst, orderedVars); + shared := BackendDAEUtil.setSharedKnVars(shared, knownVars); + shared := BackendDAEUtil.setSharedAliasVars(shared, aliasVars); + outDAE := BackendDAE.DAE({syst}, shared); + else + // if Flags.getConfigBool(Flags.NEW_UNIT_CHECKING) then + // Error.addInternalError("./Compiler/BackEnd/UnitCheck.mo: unit check module failed"); + // end if; + outDAE := inDAE; + end try; end unitChecking; // diff --git a/Compiler/BackEnd/Vectorization.mo b/Compiler/BackEnd/Vectorization.mo index 9993aa5abd2..066908cdf90 100644 --- a/Compiler/BackEnd/Vectorization.mo +++ b/Compiler/BackEnd/Vectorization.mo @@ -815,7 +815,7 @@ algorithm equation true = ComponentReference.isArrayElement(cref); (crefHead,idx,crefTailOpt) = ComponentReference.stripArrayCref(cref); - if Util.isSome(crefTailOpt) then + if isSome(crefTailOpt) then crefLst = {Util.getOption(crefTailOpt)}; else crefLst = {}; diff --git a/Compiler/FrontEnd/Absyn.mo b/Compiler/FrontEnd/Absyn.mo index 190ebda7cb3..fc5944597f5 100644 --- a/Compiler/FrontEnd/Absyn.mo +++ b/Compiler/FrontEnd/Absyn.mo @@ -1029,6 +1029,7 @@ uniontype Restriction "These constructors each correspond to a different kind of Path name; //Name of the uniontype Integer index; //Index in the uniontype Boolean singleton; + Boolean moved; // true if moved outside uniontype, otherwise false. end R_METARECORD; record R_UNKNOWN "Helper restriction" end R_UNKNOWN; /* added by simbj */ end Restriction; diff --git a/Compiler/FrontEnd/ClassInf.mo b/Compiler/FrontEnd/ClassInf.mo index 25e616756c1..7c642de0e09 100644 --- a/Compiler/FrontEnd/ClassInf.mo +++ b/Compiler/FrontEnd/ClassInf.mo @@ -789,7 +789,7 @@ algorithm case TYPE_ENUM(p) then (SCode.R_PREDEFINED_ENUMERATION(),p); /* Meta Modelica extensions */ case META_UNIONTYPE(p) then (SCode.R_UNIONTYPE(),p); - case META_RECORD(p) then (SCode.R_METARECORD(p, 0, false),p); + case META_RECORD(p) then (SCode.R_METARECORD(p, 0, false, false),p); end match; end stateToSCodeRestriction; diff --git a/Compiler/FrontEnd/ConnectUtil.mo b/Compiler/FrontEnd/ConnectUtil.mo index 909144c7144..c665f9ce486 100644 --- a/Compiler/FrontEnd/ConnectUtil.mo +++ b/Compiler/FrontEnd/ConnectUtil.mo @@ -488,7 +488,7 @@ algorithm case (DAE.VAR(componentRef = name, binding = bnd) :: rest_vars, _) equation potential = - if Util.isSome(bnd) + if isSome(bnd) then inAccPotential else List.consOnTrue(isExpandable(name), name, inAccPotential); potential = getExpandableVariablesWithNoBinding(rest_vars, potential); diff --git a/Compiler/FrontEnd/DAE.mo b/Compiler/FrontEnd/DAE.mo index 2ce15e7d82d..86797b27196 100644 --- a/Compiler/FrontEnd/DAE.mo +++ b/Compiler/FrontEnd/DAE.mo @@ -819,7 +819,17 @@ constant Type T_FUNCTION_DEFAULT = T_FUNCTION({},T_ANYTYPE_DEFAULT,FUNCTION_A constant Type T_METATYPE_DEFAULT = T_METATYPE(T_UNKNOWN_DEFAULT, emptyTypeSource); constant Type T_COMPLEX_DEFAULT = T_COMPLEX(ClassInf.UNKNOWN(Absyn.IDENT("")), {}, NONE(), emptyTypeSource) "default complex with unknown CiState"; constant Type T_COMPLEX_DEFAULT_RECORD = T_COMPLEX(ClassInf.RECORD(Absyn.IDENT("")), {}, NONE(), emptyTypeSource) "default complex with record CiState"; -constant Type T_SOURCEINFO_DEFAULT = T_METAUNIONTYPE({Absyn.QUALIFIED("SourceInfo",Absyn.IDENT("SOURCEINFO"))},true,Absyn.IDENT("SourceInfo")::{}); + +constant Type T_SOURCEINFO_DEFAULT_METARECORD = T_METARECORD(Absyn.QUALIFIED("SourceInfo",Absyn.IDENT("SOURCEINFO")), 1, { + TYPES_VAR("fileName", dummyAttrVar, T_STRING_DEFAULT, UNBOUND(), NONE()), + TYPES_VAR("isReadOnly", dummyAttrVar, T_BOOL_DEFAULT, UNBOUND(), NONE()), + TYPES_VAR("lineNumberStart", dummyAttrVar, T_INTEGER_DEFAULT, UNBOUND(), NONE()), + TYPES_VAR("columnNumberStart", dummyAttrVar, T_INTEGER_DEFAULT, UNBOUND(), NONE()), + TYPES_VAR("lineNumberEnd", dummyAttrVar, T_INTEGER_DEFAULT, UNBOUND(), NONE()), + TYPES_VAR("columnNumberEnd", dummyAttrVar, T_INTEGER_DEFAULT, UNBOUND(), NONE()), + TYPES_VAR("lastModification", dummyAttrVar, T_REAL_DEFAULT, UNBOUND(), NONE()) + }, true, emptyTypeSource); +constant Type T_SOURCEINFO_DEFAULT = T_METAUNIONTYPE({Absyn.QUALIFIED("SourceInfo",Absyn.IDENT("SOURCEINFO"))},true,EVAL_SINGLETON_KNOWN_TYPE(T_SOURCEINFO_DEFAULT_METARECORD),Absyn.IDENT("SourceInfo")::{}); // Arrays of unknown dimension, eg. Real[:] public constant Type T_ARRAY_REAL_NODIM = T_ARRAY(T_REAL_DEFAULT,{DIM_UNKNOWN()}, emptyTypeSource); @@ -948,8 +958,10 @@ public uniontype Type "models the different front-end and back-end types" end T_METAOPTION; record T_METAUNIONTYPE "MetaModelica Uniontype, added by simbj" + // TODO: You can't trust these fields as it seems MetaUtil.fixUniontype is sent empty elements when running dependency analysis list paths; Boolean knownSingleton "The runtime system (dynload), does not know if the value is a singleton. But optimizations are safe if this is true."; + EvaluateSingletonType singletonType; TypeSource source; end T_METAUNIONTYPE; @@ -999,6 +1011,23 @@ public uniontype CodeType end C_VARIABLENAMES; end CodeType; +uniontype EvaluateSingletonType "Is here because constants are not allowed to contain function pointers for some reason" + record EVAL_SINGLETON_TYPE_FUNCTION + EvaluateSingletonTypeFunction fun; + end EVAL_SINGLETON_TYPE_FUNCTION; + + record EVAL_SINGLETON_KNOWN_TYPE + Type ty; + end EVAL_SINGLETON_KNOWN_TYPE; + + record NOT_SINGLETON + end NOT_SINGLETON; +end EvaluateSingletonType; + +partial function EvaluateSingletonTypeFunction + output Type ty; +end EvaluateSingletonTypeFunction; + public constant FunctionAttributes FUNCTION_ATTRIBUTES_BUILTIN = FUNCTION_ATTRIBUTES(NO_INLINE(),true,false,false,FUNCTION_BUILTIN(NONE()),FP_NON_PARALLEL()); public constant FunctionAttributes FUNCTION_ATTRIBUTES_DEFAULT = FUNCTION_ATTRIBUTES(NO_INLINE(),true,false,false,FUNCTION_NOT_BUILTIN(),FP_NON_PARALLEL()); public constant FunctionAttributes FUNCTION_ATTRIBUTES_IMPURE = FUNCTION_ATTRIBUTES(NO_INLINE(),false,true,false,FUNCTION_NOT_BUILTIN(),FP_NON_PARALLEL()); @@ -1368,6 +1397,13 @@ uniontype Exp "Expressions Type ty; end TSUB; + record RSUB "Record field indexing" + Exp exp; + Integer ix; // Used when generating code for MetaModelica records + String fieldName; + Type ty; + end RSUB; + record SIZE "The size operator" Exp exp; Option sz; diff --git a/Compiler/FrontEnd/DAEUtil.mo b/Compiler/FrontEnd/DAEUtil.mo index 88795c95ba2..af866fe3d82 100644 --- a/Compiler/FrontEnd/DAEUtil.mo +++ b/Compiler/FrontEnd/DAEUtil.mo @@ -5137,7 +5137,7 @@ algorithm DAE.SOURCE(_ /* Discard */, partOfLst2, instanceOpt2, connectEquationOptLst2, typeLst2, operations2, comment2)) equation p = List.union(partOfLst1, partOfLst2); - i = if Util.isSome(instanceOpt1) then instanceOpt1 else instanceOpt2; + i = if isSome(instanceOpt1) then instanceOpt1 else instanceOpt2; c = List.union(connectEquationOptLst1, connectEquationOptLst2); t = List.union(typeLst1, typeLst2); o = listAppend(operations1, operations2); diff --git a/Compiler/FrontEnd/Expression.mo b/Compiler/FrontEnd/Expression.mo index 142fbeefd87..2971e80d60b 100644 --- a/Compiler/FrontEnd/Expression.mo +++ b/Compiler/FrontEnd/Expression.mo @@ -2228,6 +2228,7 @@ algorithm then tp; case (DAE.TSUB(ty = tp)) then tp; + case DAE.RSUB() then inExp.ty; case (DAE.CODE(ty = tp)) then tp; /* array reduction with known size */ case (DAE.REDUCTION(iterators={DAE.REDUCTIONITER(exp=e,guardExp=NONE())},reductionInfo=DAE.REDUCTIONINFO(exprType=ty as DAE.T_ARRAY(dims=dim::_),path = Absyn.IDENT("array")))) @@ -4952,6 +4953,15 @@ algorithm (e, ext_arg) = inFunc(e, ext_arg); then (e, ext_arg); + case e1 as DAE.RSUB() + algorithm + (e1_1, ext_arg) := traverseExpBottomUp(e1.exp, inFunc, inExtArg); + if not referenceEq(e1.exp, e1_1) then + e1.exp := e1_1; + end if; + (e1, ext_arg) := inFunc(e1, ext_arg); + then (e1, ext_arg); + case DAE.SIZE(exp=e1, sz=NONE()) equation (e1_1, ext_arg) = traverseExpBottomUp(e1, inFunc, inExtArg); e = if referenceEq(e1, e1_1) then inExp else DAE.SIZE(e1_1, NONE()); @@ -5492,6 +5502,14 @@ algorithm (e1_1,ext_arg_1) = traverseExpTopDown(e1, rel, ext_arg); then (DAE.TSUB(e1_1,i,tp),ext_arg_1); + case (_,e1 as DAE.RSUB(),rel,ext_arg) + algorithm + (e1_1,ext_arg_1) := traverseExpTopDown(e1.exp, rel, ext_arg); + if not referenceEq(e1.exp, e1_1) then + e1.exp := e1_1; + end if; + then (e1,ext_arg_1); + case (_,(DAE.SIZE(exp = e1,sz = NONE())),rel,ext_arg) equation (e1_1,ext_arg_1) = traverseExpTopDown(e1, rel, ext_arg); @@ -5572,7 +5590,7 @@ algorithm else equation str = ExpressionDump.printExpStr(inExp); - str = "Expression.traverseExpTopDown1 not implemented correctly: " + str; + str = getInstanceName() + " or " + System.dladdr(func) + "not implemented correctly: " + str; Error.addMessage(Error.INTERNAL_ERROR, {str}); then fail(); end match; diff --git a/Compiler/FrontEnd/ExpressionSimplify.mo b/Compiler/FrontEnd/ExpressionSimplify.mo index e6a99f593f8..7d122df0eb2 100644 --- a/Compiler/FrontEnd/ExpressionSimplify.mo +++ b/Compiler/FrontEnd/ExpressionSimplify.mo @@ -1681,12 +1681,13 @@ protected function simplifyCref algorithm exp := matchcontinue (origExp, inCREF, inType) local - Type t,t2; + Type t,t2,t3; list ssl; ComponentRef cr; - Ident idn; + Ident idn,idn2; list expl_1; DAE.Exp expCref; + Integer index; case(_,DAE.CREF_IDENT(idn,t2,(ssl as ((DAE.SLICE(DAE.ARRAY(_,_,_))) :: _))),t) equation @@ -1694,6 +1695,31 @@ algorithm expCref = Expression.makeCrefExp(cr,t); exp = simplifyCref2(expCref,ssl); then exp; + +/* + case (_, DAE.CREF_QUAL(idn,t2 as DAE.T_METATYPE(DAE.T_METAARRAY()),ssl,DAE.CREF_IDENT(idn2,t3)),t) + equation + exp = DAE.ASUB(DAE.CREF(DAE.CREF_IDENT(idn,t2,{}),t2), list(Expression.subscriptIndexExp(s) for s in ssl)); + print(ExpressionDump.printExpStr(exp) + "\n"); + index = match tt as Types.metaArrayElementType(t2) + // case DAE.T_METARECORD() then t2.fields; + case DAE.T_METAUNIONTYPE() then List.position(idn2, tt.singletonFields); + end match; + exp = DAE.RSUB(exp, index, idn2, t); + print(ExpressionDump.printExpStr(origExp) + "\n"); + print(ExpressionDump.printExpStr(exp) + "\n"); + print("CREF_QUAL: " + idn + "\n"); + print("CREF_QUAL: " + Types.unparseType(t2) + "\n"); + print("CREF_QUAL: " + Types.unparseType(t) + "\n"); + print("CREF_QUAL: " + Types.unparseType(t3) + "\n"); + then exp; +*/ + case (_, DAE.CREF_QUAL(idn, DAE.T_METATYPE(ty=t2), ssl, cr), t) + equation + exp = simplifyCrefMM1(idn, t2, ssl); + exp = simplifyCrefMM(exp, Expression.typeof(exp), cr); + then exp; + else origExp; end matchcontinue; end simplifyCref; @@ -1740,6 +1766,55 @@ algorithm end matchcontinue; end simplifyCref2; +protected function simplifyCrefMM_index + input DAE.Exp inExp; + input String ident; + input DAE.Type ty; + output DAE.Exp exp; +protected + Integer index; + DAE.Type nty,ty2; + list fields; +algorithm + fields := Types.getMetaRecordFields(ty); + index := Types.findVarIndex(ident, fields)+1; + DAE.TYPES_VAR(ty=nty) := listGet(fields, index); + exp := DAE.RSUB(inExp, index, ident, nty); +end simplifyCrefMM_index; + +protected function simplifyCrefMM + input DAE.Exp inExp; + input DAE.Type inType; + input ComponentRef inCref; + output DAE.Exp exp; +algorithm + exp := match inCref + case DAE.CREF_IDENT() + algorithm + exp := simplifyCrefMM_index(inExp, inCref.ident, inType); + exp := if listEmpty(inCref.subscriptLst) then exp else DAE.ASUB(exp, list(Expression.subscriptIndexExp(s) for s in inCref.subscriptLst)); + then exp; + case DAE.CREF_QUAL() + algorithm + exp := simplifyCrefMM_index(inExp, inCref.ident, inType); + exp := if listEmpty(inCref.subscriptLst) then exp else DAE.ASUB(exp, list(Expression.subscriptIndexExp(s) for s in inCref.subscriptLst)); + exp := simplifyCrefMM(exp, Expression.typeof(exp), inCref.componentRef); + then exp; + end match; +end simplifyCrefMM; + +protected function simplifyCrefMM1 + input String ident; + input DAE.Type ty; + input list ssl; + output DAE.Exp outExp; +algorithm + outExp := match (ssl) + case {} then DAE.CREF(DAE.CREF_IDENT(ident,ty,{}),ty); + else DAE.ASUB(DAE.CREF(DAE.CREF_IDENT(ident,ty,{}),ty), list(Expression.subscriptIndexExp(s) for s in ssl)); + end match; +end simplifyCrefMM1; + public function simplify2 "Advanced simplifications covering several terms or factors, like a +2a +3a = 5a " diff --git a/Compiler/FrontEnd/Inst.mo b/Compiler/FrontEnd/Inst.mo index 463cde84e85..5ecd170912b 100644 --- a/Compiler/FrontEnd/Inst.mo +++ b/Compiler/FrontEnd/Inst.mo @@ -1128,7 +1128,7 @@ algorithm // DAEUtil.addComponentType(dae1, fq_class); ty2 = DAE.T_ENUMERATION(NONE(), fq_class, names, tys1, tys, {fq_class}); bc = arrayBasictypeBaseclass(inst_dims, ty2); - bc = if Util.isSome(bc) then bc else SOME(ty2); + bc = if isSome(bc) then bc else SOME(ty2); ty = InstUtil.mktype(fq_class, ci_state_1, tys1, bc, eqConstraint, c); // update Enumerationtypes in environment (cache,env_3) = InstUtil.updateEnumerationEnvironment(cache,env_2,ty,c,ci_state_1); @@ -2004,12 +2004,12 @@ protected function instClassdef2 " output Connect.Sets outSets; output ClassInf.State outState; output list outTypesVarLst; - output Option outTypesTypeOption; + output Option oty; output Option optDerAttr; output DAE.EqualityConstraint outEqualityConstraint; output ConnectionGraph.ConnectionGraph outGraph; algorithm - (outCache,outEnv,outIH,outStore,outDae,outSets,outState,outTypesVarLst,outTypesTypeOption,optDerAttr,outEqualityConstraint,outGraph):= + (outCache,outEnv,outIH,outStore,outDae,outSets,outState,outTypesVarLst,oty,optDerAttr,outEqualityConstraint,outGraph):= matchcontinue (inCache,inEnv,inIH,inStore,inMod2,inPrefix3,inState5,className,inClassDef6,inRestriction7,inVisibility,inPartialPrefix,inEncapsulatedPrefix,inInstDims9,inBoolean10,inCallingScope,inGraph,inSets,instSingleCref,comment,info,stopInst) local list cdefelts,compelts,extendselts,els,extendsclasselts,compelts_2_elem; @@ -2317,9 +2317,10 @@ algorithm // Search for equalityConstraint eqConstraint = InstUtil.equalityConstraint(env5, els, info); - ci_state6 = if Util.isSome(ed) then ClassInf.assertTrans(ci_state6,ClassInf.FOUND_EXT_DECL(),info) else ci_state6; + ci_state6 = if isSome(ed) then ClassInf.assertTrans(ci_state6,ClassInf.FOUND_EXT_DECL(),info) else ci_state6; + (cache,oty) = MetaUtil.fixUniontype(cache, env5, ci_state6, inClassDef6); then - (cache,env5,ih,store,dae,csets5,ci_state6,vars,MetaUtil.fixUniontype(ci_state6,NONE()/* no basictype bc*/,inClassDef6),NONE(),eqConstraint,graph); + (cache,env5,ih,store,dae,csets5,ci_state6,vars,oty,NONE(),eqConstraint,graph); // This rule describes how to instantiate class definition derived from an enumeration case (cache,env,ih,store,mods,pre,_,_, @@ -2607,9 +2608,9 @@ algorithm re,vis,partialPrefix,encapsulatedPrefix,inst_dims,impl,_,graph,_,_,_,_,_) equation str = Util.assoc(str,{("List","list"),("Tuple","tuple"),("Array","array")}); - (outCache,outEnv,outIH,outStore,outDae,outSets,outState,outTypesVarLst,outTypesTypeOption,optDerAttr,outEqualityConstraint,outGraph) + (outCache,outEnv,outIH,outStore,outDae,outSets,outState,outTypesVarLst,oty,optDerAttr,outEqualityConstraint,outGraph) = instClassdef2(cache,env,ih,store,mods,pre,ci_state,className,SCode.DERIVED(Absyn.TCOMPLEX(Absyn.IDENT(str),tSpecs,NONE()),mod,DA),re,vis,partialPrefix,encapsulatedPrefix,inst_dims,impl,inCallingScope,graph,inSets,instSingleCref,comment,info,stopInst); - then (outCache,outEnv,outIH,outStore,outDae,outSets,outState,outTypesVarLst,outTypesTypeOption,optDerAttr,outEqualityConstraint,outGraph); + then (outCache,outEnv,outIH,outStore,outDae,outSets,outState,outTypesVarLst,oty,optDerAttr,outEqualityConstraint,outGraph); case (_,_,_,_,_,_,_,_, SCode.DERIVED(typeSpec=tSpec as Absyn.TCOMPLEX(path=cn,typeSpecs=tSpecs)), diff --git a/Compiler/FrontEnd/InstSection.mo b/Compiler/FrontEnd/InstSection.mo index 1820bbc4b3b..0e040c78f4f 100644 --- a/Compiler/FrontEnd/InstSection.mo +++ b/Compiler/FrontEnd/InstSection.mo @@ -71,7 +71,6 @@ protected import InstTypes; protected import NFInstUtil; protected import List; protected import Lookup; -protected import MetaUtil; protected import Patternm; protected import PrefixUtil; protected import Static; @@ -5015,7 +5014,7 @@ algorithm // (v1,v2,..,vn) := func(...) case (cache,env,ih,pre,Absyn.TUPLE(expressions = expl),e_1,eprop,_,source,_,impl,_,_) equation - true = MetaUtil.onlyCrefExpressions(expl); + true = List.all(expl, Absyn.isCref); (cache, e_1 as DAE.CALL(), eprop) = Ceval.cevalIfConstant(cache, env, e_1, eprop, impl, info); (cache,e_2) = PrefixUtil.prefixExp(cache, env, ih, e_1, pre); (cache,expl_1,cprops,attrs,_) = Static.elabExpCrefNoEvalList(cache, env, expl, impl, NONE(), false, pre, info); @@ -5030,7 +5029,7 @@ algorithm case (cache,env,ih,pre,Absyn.TUPLE(expressions = expl),e_1,eprop,_,source,_,impl,_,_) equation true = Config.acceptMetaModelicaGrammar(); - true = MetaUtil.onlyCrefExpressions(expl); + true = List.all(expl, Absyn.isCref); true = Types.isTuple(Types.getPropType(eprop)); (cache, e_1 as DAE.MATCHEXPRESSION(), eprop) = Ceval.cevalIfConstant(cache, env, e_1, eprop, impl, info); (cache,e_2) = PrefixUtil.prefixExp(cache, env, ih, e_1, pre); @@ -5294,7 +5293,7 @@ algorithm // Now the iterator is already removed. No need for this. // is it the iterator of the parfor loop(implicitly declared)? - // isForiterator = Util.isSome(cnstForRange); + // isForiterator = isSome(cnstForRange); //is it either a parglobal var or for iterator //true = isParglobal or isForiterator; diff --git a/Compiler/FrontEnd/InstUtil.mo b/Compiler/FrontEnd/InstUtil.mo index 5b28af633a9..e7c198da935 100644 --- a/Compiler/FrontEnd/InstUtil.mo +++ b/Compiler/FrontEnd/InstUtil.mo @@ -2309,82 +2309,25 @@ algorithm end componentElts; public function addClassdefsToEnv -"author: PA - - This function adds classdefinitions and - import statements to the environment." + "This function adds class definitions and import statements to the environment." input FCore.Cache inCache; input FCore.Graph inEnv; input InnerOuter.InstHierarchy inIH; input Prefix.Prefix inPrefix; - input list inSCodeElementLst; - input Boolean inBoolean; - input Option redeclareMod; - output FCore.Cache outCache; - output FCore.Graph outEnv; - output InnerOuter.InstHierarchy outIH; -algorithm - (outCache,outEnv,outIH) := matchcontinue (inCache,inEnv,inIH,inPrefix,inSCodeElementLst,inBoolean,redeclareMod) - local - FCore.Cache cache; - FCore.Graph env,env_1,env_2; - list els; - Boolean impl; - Prefix.Prefix pre; - InstanceHierarchy ih; - - case (cache,env,ih,pre,els,impl,_) - equation - (cache,env_1,ih) = addClassdefsToEnv2(cache,env,ih,pre,els,impl,redeclareMod); - env_2 = env_1 //env_2 = Env.updateEnvClasses(env_1,env_1) - "classes added with correct env. - This is needed to store the correct env in Env.CLASS. - It is required to get external objects to work"; - then (cache,env_2,ih); - - else - equation - true = Flags.isSet(Flags.FAILTRACE); - Debug.trace("- InstUtil.addClassdefsToEnv failed\n"); - then fail(); - - end matchcontinue; + input list inClasses; + input Boolean inImpl; + input Option inRedeclareMod; + output FCore.Cache outCache = inCache; + output FCore.Graph outEnv = inEnv; + output InnerOuter.InstHierarchy outIH = inIH; +algorithm + for c in inClasses loop + (outCache, outEnv, outIH) := + addClassdefToEnv(outCache, outEnv, outIH, inPrefix, c, inImpl, inRedeclareMod); + end for; end addClassdefsToEnv; -protected function addClassdefsToEnv2 -"author: PA - Helper relation to addClassdefsToEnv" - input FCore.Cache inCache; - input FCore.Graph inEnv; - input InnerOuter.InstHierarchy inIH; - input Prefix.Prefix inPrefix; - input list inSCodeElementLst; - input Boolean inBoolean; - input Option redeclareMod; - output FCore.Cache outCache; - output FCore.Graph outEnv; - output InnerOuter.InstHierarchy outIH; -algorithm - (outCache,outEnv,outIH) := match (inCache,inEnv,inIH,inPrefix,inSCodeElementLst,inBoolean,redeclareMod) - local - FCore.Cache cache; - FCore.Graph env; - SCode.Element elt; - list xs; - Boolean impl; - InstanceHierarchy ih; - Prefix.Prefix pre; - - case (cache,env,ih,_,{},_,_) then (cache,env,ih); - case (cache,env,ih,_,elt::xs,_,_) - equation - (cache,env,ih) = addClassdefToEnv2(cache,env,ih,inPrefix,elt,inBoolean,redeclareMod); - (cache,env,ih) = addClassdefsToEnv2(cache,env,ih,inPrefix,xs,inBoolean,redeclareMod); - then (cache,env,ih); - end match; -end addClassdefsToEnv2; - -protected function addClassdefToEnv2 +protected function addClassdefToEnv "author: PA Helper relation to addClassdefsToEnv" input FCore.Cache inCache; @@ -2398,7 +2341,7 @@ protected function addClassdefToEnv2 output FCore.Graph outEnv; output InnerOuter.InstHierarchy outIH; algorithm - (outCache,outEnv,outIH) := matchcontinue (inCache,inEnv,inIH,inPrefix,inSCodeElement,inBoolean,redeclareMod) + (outCache,outEnv,outIH) := matchcontinue (inCache,inEnv,inIH,inPrefix,inSCodeElement,redeclareMod) local FCore.Cache cache; FCore.Graph env,env_1; @@ -2415,7 +2358,7 @@ algorithm DAE.Mod m; // we do have a redeclaration of class. - case (cache,env,ih,pre,( (sel1 as SCode.CLASS())),_,SOME(m)) + case (cache,env,ih,pre,( (sel1 as SCode.CLASS())),SOME(m)) equation m = Mod.lookupCompModification(m, sel1.name); false = valueEq(m, DAE.NOMOD()); @@ -2427,7 +2370,7 @@ algorithm (cache,env_1,ih); // otherwise, extend frame with in class. - case (cache,env,ih,pre,(sel1 as SCode.CLASS()),_,_) + case (cache,env,ih,pre,(sel1 as SCode.CLASS()),_) equation // Debug.traceln("Extend frame " + FGraph.printGraphPathStr(env) + " with " + SCode.className(cl)); env_1 = FGraph.mkClassNode(env, sel1, pre, DAE.NOMOD()); @@ -2438,13 +2381,13 @@ algorithm // adrpo: we should have no imports after SCodeFlatten! // unfortunately we do because of the way we evaluate // programs for interactive evaluation - case (cache,env,ih,_,(imp as SCode.IMPORT()),_,_) + case (cache,env,ih,_,(imp as SCode.IMPORT()),_) equation env_1 = FGraph.mkImportNode(env, imp); then (cache,env_1,ih); - case(cache,env,ih,_,((elt as SCode.DEFINEUNIT())), _,_) + case(cache,env,ih,_,((elt as SCode.DEFINEUNIT())),_) equation env_1 = FGraph.mkDefunitNode(env,elt); then (cache,env_1,ih); @@ -2456,7 +2399,7 @@ algorithm then fail(); end matchcontinue; -end addClassdefToEnv2; +end addClassdefToEnv; protected function checkCompEnvPathVsCompTypePath "fails if the comp env path is NOT a prefix of comp type path" @@ -5382,7 +5325,7 @@ algorithm equation // Some weird functions pass the same output twice so we cannot check for exactly 1 occurance // Interfacing with LAPACK routines is fun, fun, fun :) - if not (List.isMemberOnTrue(v,arg::args,extArgCrefEq) or Util.isSome(binding)) then + if not (List.isMemberOnTrue(v,arg::args,extArgCrefEq) or isSome(binding)) then str = ComponentReference.printComponentRefStr(cr); Error.addSourceMessage(Error.EXTERNAL_NOT_SINGLE_RESULT,{str,name},DAEUtil.getElementSourceFileInfo(source)); fail(); @@ -7815,13 +7758,13 @@ algorithm SourceInfo info; case (SCode.COMMENT(SOME(SCode.ANNOTATION(SCode.MOD(subModLst=mods1,info=info))),str1),SCode.COMMENT(SOME(SCode.ANNOTATION(SCode.MOD(subModLst=mods2))),str2)) equation - str = if Util.isSome(str1) then str1 else str2; + str = if isSome(str1) then str1 else str2; mods = listAppend(mods1,mods2); then SCode.COMMENT(SOME(SCode.ANNOTATION(SCode.MOD(SCode.NOT_FINAL(),SCode.NOT_EACH(),mods,NONE(),info))),str); case (SCode.COMMENT(ann1,str1),SCode.COMMENT(ann2,str2)) equation - str = if Util.isSome(str1) then str1 else str2; - ann = if Util.isSome(ann1) then ann1 else ann2; + str = if isSome(str1) then str1 else str2; + ann = if isSome(ann1) then ann1 else ann2; then SCode.COMMENT(ann,str); end matchcontinue; end mergeClassComments; diff --git a/Compiler/FrontEnd/Lookup.mo b/Compiler/FrontEnd/Lookup.mo index b00c261b7bf..f6263ce656d 100644 --- a/Compiler/FrontEnd/Lookup.mo +++ b/Compiler/FrontEnd/Lookup.mo @@ -2698,7 +2698,7 @@ protected function lookupVarF output String name; algorithm (outCache,outAttributes,outType,outBinding,constOfForIteratorRange,splicedExpData,outComponentEnv,name) := - matchcontinue (inCache,inBinTree,inComponentRef,inEnv) + match (inCache,inBinTree,inComponentRef,inEnv) local String id,id2; SCode.ConnectorType ct; @@ -2723,6 +2723,7 @@ algorithm DAE.Attributes attr; list fields; Option oSplicedExp; + Absyn.Path p; // Simple identifier case (cache,ht,DAE.CREF_IDENT(ident = id,subscriptLst = ss),_) @@ -2739,52 +2740,98 @@ algorithm // Qualified variables looked up through component environment with or without spliced exp case (cache,ht,DAE.CREF_QUAL(ident = id,subscriptLst = ss,componentRef = ids), _) - equation - (DAE.TYPES_VAR(_,DAE.ATTR(variability = vt2),tyParent,parentBinding,_),_,_,_,componentEnv) = lookupVar2(ht, id, inEnv); + algorithm + (DAE.TYPES_VAR(_,DAE.ATTR(variability = vt2),tyParent,parentBinding,_),_,_,_,componentEnv) := lookupVar2(ht, id, inEnv); // leave just the last scope from component env as it SHOULD BE ONLY THERE, i.e. don't go on searching the parents! // componentEnv = FGraph.setScope(componentEnv, List.create(FGraph.lastScopeRef(componentEnv))); - (cache,DAE.ATTR(ct,prl,vt,di,io,vis),tyChild,binding,cnstForRange,InstTypes.SPLICEDEXPDATA(texp,idTp),_,componentEnv,name) = lookupVar(cache, componentEnv, ids); - - ltCref = elabComponentRecursive((texp)); - _ = match ltCref - case (tCref::_) // with a spliced exp - equation - ty = if Types.isBoxedType(tyParent) and not Types.isUnknownType(tyParent) - then Types.boxIfUnboxedType(tyChild) - else tyChild "The internal types in a metarecord are lookup up in a clean environment, so we have to box them"; - ty1 = checkSubscripts(tyParent, ss); - ty = sliceDimensionType(ty1,ty); - ty2_2 = Types.simplifyType(tyParent); - ss = addArrayDimensions(ty2_2,ss); - xCref = ComponentReference.makeCrefQual(id,ty2_2,ss,tCref); - eType = Types.simplifyType(ty); - splicedExp = Expression.makeCrefExp(xCref,eType); - oSplicedExp = SOME(splicedExp); - then (); - case ({}) // without spliced Expression - equation - oSplicedExp = NONE(); - then (); + (attr,ty,binding,cnstForRange,componentEnv,name) := match tyParent + case DAE.T_METAARRAY() + algorithm + true := listLength(Types.getDimensions(tyParent)) == listLength(ss); + (cache,attr,ty,binding,cnstForRange,name) := lookupVarFMetaModelica(cache, componentEnv, ids, Types.metaArrayElementType(tyParent)); + splicedExpData := InstTypes.SPLICEDEXPDATA(NONE(),ty); + then (attr,ty,binding,cnstForRange,componentEnv,name); + case _ guard Types.isBoxedType(tyParent) and not Types.isUnknownType(tyParent) + algorithm + {} := ss; + (cache,attr,ty,binding,cnstForRange,name) := lookupVarFMetaModelica(cache, componentEnv, ids, tyParent); + splicedExpData := InstTypes.SPLICEDEXPDATA(NONE(),ty); + then (attr,ty,binding,cnstForRange,componentEnv,name); + else + algorithm + (cache,DAE.ATTR(ct,prl,vt,di,io,vis),tyChild,binding,cnstForRange,InstTypes.SPLICEDEXPDATA(texp,idTp),_,componentEnv,name) := lookupVar(cache, componentEnv, ids); + + ltCref := elabComponentRecursive((texp)); + oSplicedExp := match ltCref + case (tCref::_) // with a spliced exp + algorithm + ty1 := checkSubscripts(tyParent, ss); + ty := sliceDimensionType(ty1,tyChild); + ty2_2 := Types.simplifyType(tyParent); + ss := addArrayDimensions(ty2_2,ss); + xCref := ComponentReference.makeCrefQual(id,ty2_2,ss,tCref); + eType := Types.simplifyType(ty); + splicedExp := Expression.makeCrefExp(xCref,eType); + then SOME(splicedExp); + case ({}) // without spliced Expression + then NONE(); + end match; + vt := SCode.variabilityOr(vt,vt2); + binding := lookupBinding(inComponentRef, tyParent, ty, parentBinding, binding); + splicedExpData := InstTypes.SPLICEDEXPDATA(oSplicedExp,idTp); + then + (DAE.ATTR(ct,prl,vt,di,io,vis),ty,binding,cnstForRange,componentEnv,name); end match; - vt = SCode.variabilityOr(vt,vt2); - binding = lookupBinding(inComponentRef, tyParent, ty, parentBinding, binding); - then - (cache,DAE.ATTR(ct,prl,vt,di,io,vis),ty,binding,cnstForRange,InstTypes.SPLICEDEXPDATA(oSplicedExp,idTp),componentEnv,name); + then (cache,attr,ty,binding,cnstForRange,splicedExpData,componentEnv,name); - // MetaModelica meta-records - case (cache,ht,(DAE.CREF_QUAL(ident = id,subscriptLst = {},componentRef = DAE.CREF_IDENT(ident=id2,subscriptLst={}))), _) - equation - true = Config.acceptMetaModelicaGrammar(); - (DAE.TYPES_VAR(ty=DAE.T_METARECORD(fields=fields)),_,_,_,componentEnv) = lookupVar2(ht, id, inEnv); - DAE.TYPES_VAR(name,attr,ty,binding,cnstForRange) = listGet(fields,Types.findVarIndex(id2,fields)+1); - then - (cache,attr,ty,binding,cnstForRange,InstTypes.SPLICEDEXPDATA(NONE(),ty),componentEnv,name); - - end matchcontinue; + end match; end lookupVarF; +protected function lookupVarFMetaModelica + input FCore.Cache inCache; + input FCore.Graph inEnv; + input DAE.ComponentRef cr; + input DAE.Type inType; + output FCore.Cache cache = inCache; + output DAE.Attributes attr; + output DAE.Type ty; + output DAE.Binding binding; + output Option cnstForRange; + output String name; +algorithm + (attr,ty,binding,cnstForRange,name) := match cr + local + list fields; + Absyn.Path p; + DAE.Type tt; + case DAE.CREF_IDENT() + algorithm + fields := Types.getMetaRecordFields(inType); + DAE.TYPES_VAR(name,attr,ty,binding,cnstForRange) := listGet(fields,Types.findVarIndex(cr.ident,fields)+1); + for s in cr.subscriptLst loop + ty := match ty + case DAE.T_METAARRAY() then ty.ty; + end match; + end for; + ty := Types.getMetaRecordIfSingleton(ty); + then (attr,ty,binding,cnstForRange,name); + case DAE.CREF_QUAL() + algorithm + fields := Types.getMetaRecordFields(inType); + DAE.TYPES_VAR(name,attr,ty,binding,cnstForRange) := listGet(fields,Types.findVarIndex(cr.ident,fields)+1); + for s in cr.subscriptLst loop + ty := match ty + case DAE.T_METAARRAY() then ty.ty; + end match; + end for; + ty := Types.getMetaRecordIfSingleton(ty); + (cache,attr,ty,binding,cnstForRange,name) := lookupVarFMetaModelica(cache, inEnv, cr.componentRef, ty); + then (attr,ty,binding,cnstForRange,name); + end match; +end lookupVarFMetaModelica; + protected function lookupBinding "@author: adrpo this function uses the binding of the parent @@ -3039,7 +3086,7 @@ algorithm end sliceDimensionType; -protected function buildMetaRecordType "common function when looking up the type of a metarecord" +public function buildMetaRecordType "common function when looking up the type of a metarecord" input FCore.Cache inCache; input FCore.Graph inEnv; input SCode.Element cdef; @@ -3102,7 +3149,7 @@ algorithm // it exists and if it's an iterator or not. id := ComponentReference.crefFirstIdent(inCref); (DAE.TYPES_VAR(constOfForIteratorRange = ic),_,_,_,_) := lookupVar2(ht, id, inEnv); - b := Util.isSome(ic); + b := isSome(ic); then (SOME(b), cache); diff --git a/Compiler/FrontEnd/MetaUtil.mo b/Compiler/FrontEnd/MetaUtil.mo index b7150e0aa78..c18e07d975a 100644 --- a/Compiler/FrontEnd/MetaUtil.mo +++ b/Compiler/FrontEnd/MetaUtil.mo @@ -33,592 +33,322 @@ encapsulated package MetaUtil " file: MetaUtil.mo package: MetaUtil description: Different MetaModelica extension functions. - - RCS: $Id$ - - " - -public import Absyn; -public import ClassInf; -public import DAE; -public import SCode; -public import SCodeUtil; - -protected import Config; -protected import Flags; -protected import List; -protected import Types; - -public function transformArrayNodesToListNodes "function: transformArrayNodesToListNodes" - input list inList; - input list accList; - output list outList; +" + +import Absyn; +import ClassInf; +import DAE; +import FCore; +import SCode; + +protected + +import Config; +import Error; +import FGraph; +import Flags; +import List; +import Lookup; +import Types; + +public function createMetaClassesInProgram + "This function goes through a program and changes all records inside of + uniontype into metarecords. It also makes a copy of them outside of the + uniontype where they are found so that they can be used without prefixing + with the uniontype name." + input Absyn.Program inProgram; + output Absyn.Program outProgram = inProgram; +protected + list classes = {}, meta_classes; algorithm - outList := matchcontinue (inList,accList) - local - list localAccList,es,restList; - Absyn.Exp firstExp; - case ({},localAccList) then listReverse(localAccList); - case (Absyn.ARRAY({}) :: restList,localAccList) - equation - localAccList = Absyn.LIST({})::localAccList; - localAccList = transformArrayNodesToListNodes(restList,localAccList); - then localAccList; - case (Absyn.ARRAY(es) :: restList,localAccList) - equation - es = transformArrayNodesToListNodes(es,{}); - localAccList = Absyn.LIST(es)::localAccList; - localAccList = transformArrayNodesToListNodes(restList,localAccList); - then localAccList; - case (firstExp :: restList,localAccList) - equation - localAccList = firstExp::localAccList; - localAccList = transformArrayNodesToListNodes(restList,localAccList); - then localAccList; - end matchcontinue; -end transformArrayNodesToListNodes; + if not Config.acceptMetaModelicaGrammar() then + return; + end if; + + _ := match outProgram + case Absyn.PROGRAM() + algorithm + for c in outProgram.classes loop + (c, meta_classes) := createMetaClasses(c); + classes := c :: listAppend(meta_classes, classes); + end for; + + outProgram.classes := listReverse(classes); + then + (); -public function createListType "function: createListType" - input DAE.Type inType; - input Integer numLists; - output DAE.Type outType; -algorithm - outType := - matchcontinue (inType,numLists) - local - DAE.Type localT; - Integer n; - DAE.Type t; - case (localT,0) then localT; - case (localT,n) - equation - t = DAE.T_METALIST(localT, DAE.emptyTypeSource); - t = createListType(t,n-1); - then t; - end matchcontinue; -end createListType; - -public function getTypeFromProp "function: getTypeFromProp" - input DAE.Properties inProp; - output DAE.Type outType; -algorithm - outType := - match (inProp) - local - DAE.Type t; - case (DAE.PROP(t,_)) equation then t; + else (); end match; -end getTypeFromProp; +end createMetaClassesInProgram; -public function getListOfStrings - input list els; - output list outStrings; +protected function createMetaClasses + "Takes a class, and if it's a uniontype it converts all records inside it into + metarecords and returns the updated uniontype and a list of all metarecords. + It then recursively applies the same operation to all subclasses." + input Absyn.Class inClass; + output Absyn.Class outClass = inClass; + output list outMetaClasses = {}; +protected + Absyn.ClassDef body; + list parts; algorithm - outStrings := match(els) - local - list rest; - list slst; - String n; - - case({}) then {}; - - case(SCode.CLASS(name = n)::rest) - equation - slst = getListOfStrings(rest); + _ := match outClass + case Absyn.CLASS(restriction = Absyn.R_UNIONTYPE(), + body = body as Absyn.PARTS(classParts = parts)) + algorithm + (parts, outMetaClasses) := fixClassParts(parts, outClass.name); + body.classParts := parts; + outClass.body := body; then - n::slst; - - end match; -end getListOfStrings; + (); + + case Absyn.CLASS(restriction = Absyn.R_UNIONTYPE(), + body = body as Absyn.CLASS_EXTENDS(parts = parts)) + algorithm + (parts, outMetaClasses) := fixClassParts(parts, outClass.name); + body.parts := parts; + outClass.body := body; + then + (); -//Check if a class has a certain restriction, added by simbj -public function classHasMetaRestriction - input SCode.Element cl; - output Boolean outBoolean; -algorithm - outBoolean := match(cl) - case(SCode.CLASS(restriction = SCode.R_METARECORD())) then true; - else false; + else (); end match; -end classHasMetaRestriction; - -//Check if a class has a certain restriction, added by simbj -public function classHasRestriction - input SCode.Element cl; - input SCode.Restriction re; - output Boolean outBoolean; -algorithm - outBoolean := matchcontinue(cl,re) - local - SCode.Restriction re1,re2; - case(SCode.CLASS(restriction = re1),re2) - equation - equality(re1 = re2); - then true; + _ := match outClass + case Absyn.CLASS(body = body as Absyn.PARTS()) + algorithm + body.classParts := createMetaClassesFromClassParts(body.classParts); + outClass.body := body; + then + (); - else false; - end matchcontinue; -end classHasRestriction; + case Absyn.CLASS(body = body as Absyn.CLASS_EXTENDS()) + algorithm + body.parts := createMetaClassesFromClassParts(body.parts); + outClass.body := body; + then + (); -public function createMetaClassesInProgram "Adds metarecord classes to the AST. This function handles a whole program, - including packages." - input Absyn.Program program; - output Absyn.Program out; -algorithm - out := match (program) - local - list classes, metaClassesFlat; - list> metaClasses; - Absyn.Program p; - - case p as Absyn.PROGRAM() guard Config.acceptMetaModelicaGrammar() - equation - metaClasses = List.map(p.classes, createMetaClasses); - metaClassesFlat = List.flatten(metaClasses); - classes = List.map(p.classes, createMetaClassesFromPackage); - p.classes = listAppend(classes, metaClassesFlat); - then p; - else program; + else (); end match; -end createMetaClassesInProgram; - -protected function createMetaClassesFromPackage "Helper function to createMetaClassesInProgram" - input Absyn.Class cl; - output Absyn.Class out; -algorithm - out := matchcontinue(cl) - local - String name; - Boolean partialPrefix; - Boolean finalPrefix; - Boolean encapsulatedPrefix; - Absyn.Restriction restriction; - Absyn.ClassDef body; - SourceInfo info; - list classParts; - Option comment; - list typeVars; - list classAttrs; - list ann; - - case (Absyn.CLASS(body=Absyn.PARTS(typeVars=typeVars,classAttrs=classAttrs,classParts=classParts,ann=ann,comment=comment),name=name,partialPrefix=partialPrefix,finalPrefix=finalPrefix,encapsulatedPrefix=encapsulatedPrefix,restriction=restriction,info=info)) - equation - classParts = List.map(classParts,createMetaClassesFromClassParts); - body = Absyn.PARTS(typeVars,classAttrs,classParts,ann,comment); - then Absyn.CLASS(name,partialPrefix,finalPrefix,encapsulatedPrefix,restriction,body,info); - - else cl; - end matchcontinue; -end createMetaClassesFromPackage; +end createMetaClasses; protected function createMetaClassesFromClassParts - input Absyn.ClassPart classPart; - output Absyn.ClassPart out; + input list inClassParts; + output list outClassParts; algorithm - out := matchcontinue (classPart) - local - list els; - list> lels; - - case (Absyn.PUBLIC(els)) - equation - lels = List.map(els, createMetaClassesFromElementItem); - els = List.flatten(lels); - then Absyn.PUBLIC(els); - - case (Absyn.PROTECTED(els)) - equation - lels = List.map(els, createMetaClassesFromElementItem); - els = List.flatten(lels); - then Absyn.PROTECTED(els); - - else classPart; - end matchcontinue; -end createMetaClassesFromClassParts; + outClassParts := list(match p + case Absyn.PUBLIC() + algorithm + p.contents := createMetaClassesFromElementItems(p.contents); + then + p; -protected function createMetaClassesFromElementItem - input Absyn.ElementItem elementItem; - output list out; -algorithm - out := matchcontinue(elementItem) - local - SourceInfo info; - Boolean replaceable_; - Absyn.Class class_, cl2; - list metaClasses, classes; - list elementItems; - case (Absyn.ELEMENTITEM(Absyn.ELEMENT(specification=Absyn.CLASSDEF(class_=class_)))) - equation - metaClasses = createMetaClasses(class_); - cl2 = createMetaClassesFromPackage(class_); - classes = cl2 :: metaClasses; - elementItems = List.map1r(classes,setElementItemClass,elementItem); - then elementItems; - else {elementItem}; - end matchcontinue; -end createMetaClassesFromElementItem; + case Absyn.PROTECTED() + algorithm + p.contents := createMetaClassesFromElementItems(p.contents); + then + p; -protected function setElementItemClass - input Absyn.ElementItem elementItem; - input Absyn.Class class_; - output Absyn.ElementItem out; -algorithm - out := match (elementItem,class_) - local - Boolean finalPrefix; - Option redeclareKeywords; - Absyn.InnerOuter innerOuter; - SourceInfo info; - Option constrainClass; - Boolean replaceable_; - case (Absyn.ELEMENTITEM(Absyn.ELEMENT(specification=Absyn.CLASSDEF(replaceable_=replaceable_),finalPrefix=finalPrefix,redeclareKeywords=redeclareKeywords,innerOuter=innerOuter,info=info,constrainClass=constrainClass)),_) - then Absyn.ELEMENTITEM(Absyn.ELEMENT(finalPrefix,redeclareKeywords,innerOuter,Absyn.CLASSDEF(replaceable_,class_),info,constrainClass)); - /* Annotations, comments */ - else elementItem; - end match; -end setElementItemClass; + else p; + end match for p in inClassParts); +end createMetaClassesFromClassParts; -//Added by simbj -//Analyze the AST, find union type and extend the AST with metarecords -public function createMetaClasses -input Absyn.Class cl; -output list clstout; +protected function createMetaClassesFromElementItems + input list inElementItems; + output list outElementItems = {}; +protected + Absyn.Class cls; + list meta_classes; + list els; algorithm - clstout := matchcontinue(cl) - local - list cls; - list els; - list cllst; - SCode.Restriction r_1; - Absyn.Class c; - String n; - Boolean p,f,e; - Absyn.Restriction r; - Absyn.ClassDef d; - SourceInfo file_info; - - case(c as Absyn.CLASS(name = n,restriction = r, - body = Absyn.PARTS(classParts = {Absyn.PUBLIC(contents = els)}))) - equation - r_1 = SCodeUtil.translateRestriction(c, r); // uniontype will not get elaborated! - SCode.R_UNIONTYPE() = r_1; - els = fixElementItems(els,n,0,listLength(els)==1); - cllst = convertElementsToClasses(els); - then cllst; - else {}; - end matchcontinue; -end createMetaClasses; + for e in listReverse(inElementItems) loop + e := match e + case Absyn.ELEMENTITEM(element = Absyn.ELEMENT(specification = + Absyn.CLASSDEF(class_ = cls))) + algorithm + (cls, meta_classes) := createMetaClasses(cls); + els := list(setElementItemClass(e, c) for c in meta_classes); + outElementItems := listAppend(els, outElementItems); + then + setElementItemClass(e, cls); + + else e; + end match; + + outElementItems := e :: outElementItems; + end for; +end createMetaClassesFromElementItems; -//Added by simbj -//Helper function -function convertElementsToClasses - input list els; - output list outcls; +protected function setElementItemClass + input Absyn.ElementItem inElementItem; + input Absyn.Class inClass; + output Absyn.ElementItem outElementItem = inElementItem; algorithm - outcls := match(els) + outElementItem := match outElementItem local - list rest; - Absyn.Class c; - list clst; - - case({}) then {}; - - case(Absyn.ELEMENTITEM(element = Absyn.ELEMENT(specification = Absyn.CLASSDEF(class_ = c)))::rest) - equation - clst = convertElementsToClasses(rest); + Absyn.Element e; + Absyn.ElementSpec es; + + case Absyn.ELEMENTITEM(element = e as Absyn.ELEMENT(specification = es as Absyn.CLASSDEF())) + algorithm + es.class_ := inClass; + e.specification := es; + outElementItem.element := e; then - c::clst; + outElementItem; - /* Strip annotation, comment */ - case(_::rest) - then convertElementsToClasses(rest); + else outElementItem; end match; -end convertElementsToClasses; - -//Added by simbj -//Reparses type and returns the real type -//NOTE: This is probably a bad way to do this, should be moved, maybe to the parser? -function reparseType - input Absyn.Path path; - output DAE.Type outType; -algorithm - outType := match(path) - local - DAE.Type t; - case(Absyn.IDENT("Integer")) then DAE.T_INTEGER_DEFAULT; - case(Absyn.IDENT("Real")) then DAE.T_REAL_DEFAULT; - case(Absyn.IDENT("String")) then DAE.T_STRING_DEFAULT; - case(Absyn.IDENT("Boolean")) then DAE.T_BOOL_DEFAULT; - // BTH - case(Absyn.IDENT("Clock")) - equation - true = intGe(Flags.getConfigEnum(Flags.LANGUAGE_STANDARD), 33); - then DAE.T_CLOCK_DEFAULT; - end match; -end reparseType; - -/* These functions are helper functions for the Uniontypes, added by simbj */ -public function getRestriction - input Absyn.Element el; - output Absyn.Restriction res; -algorithm - res := match(el) - local - Absyn.ElementSpec spec; - Absyn.Class cl; - Absyn.Restriction r; - case(Absyn.ELEMENT(specification=Absyn.CLASSDEF(class_=Absyn.CLASS(restriction=r)))) - then r; - else Absyn.R_UNKNOWN(); - end match; -end getRestriction; - -function fixRestriction - input Absyn.Restriction resin; - input String name; - input Integer index; - input Boolean singleton; - output Absyn.Restriction resout; -algorithm - resout := match(resin,name,index,singleton) - local - Absyn.Ident ident; - Absyn.Path path; - case(Absyn.R_RECORD(),_,_,_) - equation - ident = name; - path = Absyn.IDENT(ident); - then Absyn.R_METARECORD(path,index,singleton); - else resin; - end match; -end fixRestriction; - +end setElementItemClass; -function fixClass - input Absyn.Class classin; - input String name; - input Integer index; - input Boolean singleton; - output Absyn.Class classout; +protected function convertElementToClass + input Absyn.ElementItem inElementItem; + output Absyn.Class outClass; algorithm - classout := match(classin,name,index,singleton) - local - Absyn.Ident n; - Boolean p; - Boolean f; - Boolean e; - Absyn.Restriction res; - Absyn.ClassDef b; - SourceInfo i; - - case(Absyn.CLASS(n,p,f,e,res,b,i),_,_,_) - equation - res = fixRestriction(res,name,index,singleton); - then Absyn.CLASS(n,p,f,e,res,b,i); - else classin; - end match; -end fixClass; - - -function fixElementSpecification - input Absyn.ElementSpec specin; - input String name; - input Integer index; - input Boolean singleton; - output Absyn.ElementSpec specout; + Absyn.ELEMENTITEM(element = Absyn.ELEMENT( + specification = Absyn.CLASSDEF(class_ = outClass))) := inElementItem; +end convertElementToClass; + +protected function fixClassParts + input list inClassParts; + input Absyn.Ident inClassName; + output list outClassParts = {}; + output list outMetaClasses = {}; +protected + list meta_classes; + list els; algorithm - specout := match(specin,name,index,singleton) - local - Boolean rep; - Absyn.Class c; - case(Absyn.CLASSDEF(rep,c),_,_,_) - equation - c = fixClass(c,name,index,singleton); - then Absyn.CLASSDEF(rep,c); - else specin; - end match; -end fixElementSpecification; - -function fixElement - input Absyn.Element elementin; - input String name; - input Integer index; - input Boolean singleton; - output Absyn.Element elementout; + outClassParts := list(match p + case Absyn.PUBLIC() + algorithm + (els, meta_classes) := fixElementItems(p.contents, inClassName); + p.contents := els; + outMetaClasses := listAppend(meta_classes, outMetaClasses); + then + p; + case Absyn.PROTECTED() + algorithm + (els, meta_classes) := fixElementItems(p.contents, inClassName); + p.contents := els; + outMetaClasses := listAppend(meta_classes, outMetaClasses); + then + p; + + else p; + end match for p in inClassParts); +end fixClassParts; + +protected function fixElementItems + input list inElementItems; + input String inName; + output list outElementItems; + output list outMetaClasses = {}; +protected + Integer index = 0; + Boolean singleton = listLength(inElementItems) == 1; + Absyn.Class c; + Absyn.Restriction r; algorithm - elementout := match(elementin,name,index,singleton) - local - Boolean f; - Option r; - Absyn.InnerOuter i; - Absyn.ElementSpec spec; - SourceInfo inf; - Option con; - case(Absyn.ELEMENT(finalPrefix = f, redeclareKeywords = r, innerOuter=i, specification=spec, info=inf, constrainClass=con),_,_,_) - equation - spec = fixElementSpecification(spec,name,index,singleton); - then Absyn.ELEMENT(f,r,i,spec,inf,con); - end match; -end fixElement; - - + outElementItems := list(match e + case Absyn.ELEMENTITEM(element = Absyn.ELEMENT(specification = + Absyn.CLASSDEF(class_ = c as Absyn.CLASS(restriction = Absyn.R_RECORD())))) + algorithm + // Change the record into a metarecord and add it to the list of metaclasses. + r := Absyn.R_METARECORD(Absyn.IDENT(inName), index, singleton, true); + c.restriction := r; + outMetaClasses := c :: outMetaClasses; + // Change the record into a metarecord and update the original class. + r := Absyn.R_METARECORD(Absyn.IDENT(inName), index, singleton, false); + c.restriction := r; + index := index + 1; + then + setElementItemClass(e, c); -function fixElementItems - input list elementItemsin; - input String name; - input Integer index; - input Boolean singleton; - output list elementItemsout; -algorithm - elementItemsout := match (elementItemsin,name,index,singleton) - local - Absyn.Element element; - Absyn.ElementItem elementitem; - list rest; - case({},_,_,_) then {}; - case(Absyn.ELEMENTITEM(element)::rest,_,_,_) - equation - element = fixElement(element,name,index,singleton); - rest = fixElementItems(rest,name,index+1,singleton); - then (Absyn.ELEMENTITEM(element)::rest); - case (_::rest,_,_,_) then fixElementItems(rest,name,index,singleton); - end match; + else e; + end match for e in inElementItems); end fixElementItems; -/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^END^OF^HELPERFUNCTIONS^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ */ - -public function constructorCallTypeToNamesAndTypes "Fetches the field names -and types from a record call or metarecord call" - input DAE.Type inType; - output list varNames; - output list outTypes; -algorithm - (varNames,outTypes) := match (inType) - local - list names; - list types; - list fargs; - list fields; - - case (DAE.T_METARECORD(fields = fields)) - equation - names = List.map(fields, Types.getVarName); - types = List.map(fields, Types.getVarType); - then (names,types); - - case (DAE.T_FUNCTION(funcArg = fargs,funcResultType = DAE.T_COMPLEX(complexClassType = ClassInf.RECORD(_)))) - equation - names = List.map(fargs, Types.funcArgName); - types = List.map(fargs, Types.funcArgType); - then (names,types); - end match; -end constructorCallTypeToNamesAndTypes; - public function fixUniontype - input ClassInf.State st; - input Option t; - input SCode.ClassDef c; + input FCore.Cache inCache; + input FCore.Graph inEnv; + input ClassInf.State inState; + input SCode.ClassDef inClassDef; + output FCore.Cache cache = inCache; output Option outType; algorithm - outType := matchcontinue (st,t,c) + outType := match (inState, inClassDef) local - list els; - list slst; - list paths; - Absyn.Path p; Boolean b; + Absyn.Path p,p2; + list paths; + list names; DAE.TypeSource ts; - - case (ClassInf.META_UNIONTYPE(p),_,SCode.PARTS(elementLst = els)) - equation - p = Absyn.makeFullyQualified(p); - slst = getListOfStrings(els); - paths = List.map1r(slst, Absyn.pathReplaceIdent, p); - b = listLength(paths)==1; - ts = Types.mkTypeSource(SOME(p)); + DAE.EvaluateSingletonType singletonType; + SCode.Element c; + FCore.Graph env_1; + + case (ClassInf.META_UNIONTYPE(), SCode.PARTS()) + algorithm + p := Absyn.makeFullyQualified(inState.path); + names := SCode.elementNames(inClassDef.elementLst); + paths := list(Absyn.pathReplaceIdent(p, n) for n in names); + b := listLength(paths)==1; + if b then + p2 := listGet(paths, 1); + singletonType := DAE.EVAL_SINGLETON_TYPE_FUNCTION(function fixUniontype2(arr=arrayCreate(1, (cache,inEnv,p2,NONE())))); + else + singletonType := DAE.NOT_SINGLETON(); + end if; + ts := Types.mkTypeSource(SOME(p)); then - SOME(DAE.T_METAUNIONTYPE(paths,b,ts)); + SOME(DAE.T_METAUNIONTYPE(paths,b,singletonType,ts)); - else t; - end matchcontinue; + else NONE(); + end match; end fixUniontype; -public function createLhsExp "function: createLhsExp" - input list inList; - output Absyn.Exp outExp; -algorithm - outExp := matchcontinue (inList) - local - list lst; - Absyn.Exp firstExp; - case (firstExp :: {}) then firstExp; - case (lst) then Absyn.TUPLE(lst); - end matchcontinue; -end createLhsExp; - -public function onlyCrefExpressions "function: onlyCrefExpressions" - input list expList; - output Boolean boolVal; +protected function fixUniontype2 + input array>> arr; + output DAE.Type singletonType; +protected + FCore.Cache cache; + FCore.Graph env; + Absyn.Path p; + Option ot; algorithm - boolVal := - matchcontinue (expList) - local - list restList; - case ({}) then true; - case (Absyn.CREF(_) :: restList) then onlyCrefExpressions(restList); - else false; - end matchcontinue; -end onlyCrefExpressions; - -public function isTupleExp - input Absyn.Exp inExp; - output Boolean b; + (cache,env,p,ot) := arrayGet(arr, 1); + if isNone(ot) then + (_, singletonType) := Lookup.lookupType(cache, env, p, SOME(sourceInfo())); + arrayUpdate(arr, 1, (cache,env,p,SOME(singletonType))); + else + SOME(singletonType) := ot; + end if; +end fixUniontype2; + +public function checkArrayType + "Checks that an array type is valid." + input DAE.Type inType; +protected + DAE.Type el_ty; algorithm - b := match (inExp) - case Absyn.TUPLE(_) then true; - else false; - end match; -end isTupleExp; + el_ty := Types.arrayElementType(inType); + false := (not Types.isString(el_ty) and Types.isBoxedType(el_ty)) or + Flags.isSet(Flags.RML); +end checkArrayType; -public function extractListFromTuple "author: KS - Given an Absyn.Exp, this function will extract the list of expressions if the - expression is a tuple, otherwise a list of length one is created" - input Absyn.Exp inExp; - input Integer numOfExps; +public function transformArrayNodesToListNodes + input list inList; output list outList; algorithm - outList := - match (inExp,numOfExps) - local - list l; - Absyn.Exp exp; - case (Absyn.TUPLE(l),1) then {Absyn.TUPLE(l)}; - case (Absyn.TUPLE(l),_) then l; - else {inExp}; - end match; -end extractListFromTuple; - -public function tryToConvertArrayToList -"Convert an array, T[:], of a MetaModelica type into list (done by a different function). -MetaModelica types can only be of array type, not T[:]. -This is mainly to produce better error messages." - input DAE.Exp exp; - input DAE.Type ty; - output DAE.Exp outExp; - output DAE.Type outTy; -algorithm - (outExp,outTy) := match (exp,ty) - local - DAE.Type flatType; - case (_,_) - equation - (flatType,_) = Types.flattenArrayType(ty); - false = (not Types.isString(flatType) and Types.isBoxedType(flatType)) or Flags.isSet(Flags.RML) "debug flag to produce better error messages by converting all arrays into lists; the compiler does not use Modelica-style arrays anyway"; - then (exp,ty); - end match; -end tryToConvertArrayToList; + outList := list(match e + case Absyn.ARRAY({}) then Absyn.LIST({}); + case Absyn.ARRAY() + then Absyn.LIST(transformArrayNodesToListNodes(e.arrayExp)); + else e; + end match for e in inList); +end transformArrayNodesToListNodes; annotation(__OpenModelica_Interface="frontend"); end MetaUtil; diff --git a/Compiler/FrontEnd/NFEnv.mo b/Compiler/FrontEnd/NFEnv.mo index ef7d4dfbbef..1401371b49c 100644 --- a/Compiler/FrontEnd/NFEnv.mo +++ b/Compiler/FrontEnd/NFEnv.mo @@ -733,7 +733,7 @@ end getScope; // (entries, uentry) := // NFEnvAvlTree.update(entries, entry_name, replaceEntry2, (inReplacement, inOriginEnv)); // outEnv := NFInstTypes.FRAME(name, prefix, ty, entries) :: rest_env; -// outWasReplaced := Util.isSome(uentry); +// outWasReplaced := isSome(uentry); //end replaceEntry; // //protected function replaceEntry2 diff --git a/Compiler/FrontEnd/OperatorOverloading.mo b/Compiler/FrontEnd/OperatorOverloading.mo index f65757996eb..7248a23552c 100644 --- a/Compiler/FrontEnd/OperatorOverloading.mo +++ b/Compiler/FrontEnd/OperatorOverloading.mo @@ -1536,7 +1536,7 @@ algorithm case (DAE.T_FUNCTION(funcArg={_}),_) then false; // Unary functions are legal even if we are not interested in them case (DAE.T_FUNCTION(funcArg=DAE.FUNCARG(defaultBinding=NONE())::DAE.FUNCARG(defaultBinding=NONE())::rest),_) equation - isBinaryFunc = Util.boolAndList(List.mapMap(rest, Types.funcArgDefaultBinding, Util.isSome)); + isBinaryFunc = Util.boolAndList(List.mapMap(rest, Types.funcArgDefaultBinding, isSome)); // Error.assertionOrAddSourceMessage(isBinaryFunc, Error.COMPILER_WARNING, {"TODO: Better warning for: " + Types.unparseType(ty) + ", expected arguments 3..n to have default values"}, info); then isBinaryFunc; // Unary functions are legal even if we are not interested in them else @@ -1555,7 +1555,7 @@ algorithm list rest; case DAE.T_FUNCTION(funcArg=DAE.FUNCARG(defaultBinding=NONE())::rest) equation - isBinaryFunc = Util.boolAndList(List.mapMap(rest, Types.funcArgDefaultBinding, Util.isSome)); + isBinaryFunc = Util.boolAndList(List.mapMap(rest, Types.funcArgDefaultBinding, isSome)); then isBinaryFunc; else false; end match; diff --git a/Compiler/FrontEnd/Patternm.mo b/Compiler/FrontEnd/Patternm.mo index e177e7953bb..18766ce879f 100644 --- a/Compiler/FrontEnd/Patternm.mo +++ b/Compiler/FrontEnd/Patternm.mo @@ -705,7 +705,7 @@ algorithm case (cache,env,Absyn.MATCHEXP(matchTy=matchTy,inputExp=inExp,localDecls=decls,cases=cases),_,st,_,pre,_,_) equation // First do inputs - inExps = MetaUtil.extractListFromTuple(inExp, 0); + inExps = convertExpToPatterns(inExp); (inExps,inputAliases,inputAliasesAndCrefs) = List.map_3(inExps,getInputAsBinding); (cache,elabExps,elabProps,st) = Static.elabExpList(cache,env,inExps,impl,st,performVectorization,pre,info); // Then add locals @@ -2010,7 +2010,7 @@ algorithm case (cache,env,Absyn.CASE(pattern=pattern,patternGuard=patternGuard,patternInfo=patternInfo,localDecls=decls,classPart=cp,result=result,resultInfo=resultInfo,info=info),_,_,_,_,st,_,_) equation (cache,SOME((env,DAE.DAE(caseDecls),caseLocalTree))) = addLocalDecls(cache,env,decls,FCore.caseScopeName,impl,info); - patterns = MetaUtil.extractListFromTuple(pattern, 0); + patterns = convertExpToPatterns(pattern); patterns = if listLength(tys)==1 then {pattern} else patterns; (cache,elabPatterns) = elabPatternTuple(cache, env, patterns, tys, patternInfo, pattern); // open a pattern type scope @@ -2944,5 +2944,18 @@ algorithm end match; end makeTupleFromMetaTuple; +protected function convertExpToPatterns + "Converts an expression to a list of patterns. If the expression is a tuple + then the contents of the tuple are returned, otherwise the expression itself + is returned as a list." + input Absyn.Exp inExp; + output list outInputs; +algorithm + outInputs := match inExp + case Absyn.TUPLE() then inExp.expressions; + else {inExp}; + end match; +end convertExpToPatterns; + annotation(__OpenModelica_Interface="frontend"); end Patternm; diff --git a/Compiler/FrontEnd/SCode.mo b/Compiler/FrontEnd/SCode.mo index 6a55aabaf86..76e74f9c4df 100644 --- a/Compiler/FrontEnd/SCode.mo +++ b/Compiler/FrontEnd/SCode.mo @@ -88,6 +88,7 @@ uniontype Restriction Absyn.Path name; //Name of the uniontype Integer index; //Index in the uniontype Boolean singleton; + Boolean moved; // true if moved outside uniontype, otherwise false. end R_METARECORD; /* added by x07simbj */ record R_UNIONTYPE "Metamodelica extension" diff --git a/Compiler/FrontEnd/SCodeDump.mo b/Compiler/FrontEnd/SCodeDump.mo index d031b3e93a0..14f33d84d57 100644 --- a/Compiler/FrontEnd/SCodeDump.mo +++ b/Compiler/FrontEnd/SCodeDump.mo @@ -503,7 +503,7 @@ algorithm case (SCode.IMPORT(visibility=SCode.PROTECTED()),OPTIONS(stripProtectedImports=true)) then false; case (SCode.CLASS(prefixes=SCode.PREFIXES(visibility=SCode.PROTECTED())),OPTIONS(stripProtectedClasses=true)) then false; case (SCode.COMPONENT(prefixes=SCode.PREFIXES(visibility=SCode.PROTECTED())),OPTIONS(stripProtectedComponents=true)) then false; - case (SCode.CLASS(restriction=SCode.R_METARECORD()),OPTIONS(stripMetaRecords=true)) then false; + case (SCode.CLASS(restriction=SCode.R_METARECORD(moved = true)),OPTIONS(stripMetaRecords=true)) then false; else true; end match; end filterElement; diff --git a/Compiler/FrontEnd/SCodeUtil.mo b/Compiler/FrontEnd/SCodeUtil.mo index 07664990a68..125fbdb6afe 100644 --- a/Compiler/FrontEnd/SCodeUtil.mo +++ b/Compiler/FrontEnd/SCodeUtil.mo @@ -293,7 +293,7 @@ algorithm Absyn.Class d; Absyn.Path name; Integer index; - Boolean singleton, isImpure; + Boolean singleton, isImpure, moved; Absyn.FunctionPurity purity; // ?? Only normal functions can have 'external' @@ -332,8 +332,8 @@ algorithm case (_,Absyn.R_PREDEFINED_CLOCK()) then SCode.R_PREDEFINED_CLOCK(); case (_,Absyn.R_PREDEFINED_ENUMERATION()) then SCode.R_PREDEFINED_ENUMERATION(); - case (_,Absyn.R_METARECORD(name,index,singleton)) //MetaModelica extension, added by x07simbj - then SCode.R_METARECORD(name,index,singleton); + case (_,Absyn.R_METARECORD(name,index,singleton,moved)) //MetaModelica extension, added by x07simbj + then SCode.R_METARECORD(name,index,singleton,moved); case (_,Absyn.R_UNIONTYPE()) then SCode.R_UNIONTYPE(); /*MetaModelica extension added by x07simbj */ end match; @@ -2294,7 +2294,7 @@ algorithm SCode.MOD(_, _, subMods2, b2, _)) equation subMods1 = listAppend(subMods1, subMods2); - b1 = if Util.isSome(b1) then b1 else b2; + b1 = if isSome(b1) then b1 else b2; then SCode.MOD(f1, e1, subMods1, b1, info); diff --git a/Compiler/FrontEnd/Static.mo b/Compiler/FrontEnd/Static.mo index c2677e00078..01b0eb3e8eb 100644 --- a/Compiler/FrontEnd/Static.mo +++ b/Compiler/FrontEnd/Static.mo @@ -685,6 +685,13 @@ algorithm c := Types.constAnd(c, step_c); end if; + if Types.isBoxedType(start_ty) then + (start_exp, start_ty) := Types.matchType(start_exp, start_ty, Types.unboxedType(start_ty), true); + end if; + if Types.isBoxedType(stop_ty) then + (stop_exp, stop_ty) := Types.matchType(stop_exp, stop_ty, Types.unboxedType(stop_ty), true); + end if; + (start_exp, ostep_exp, stop_exp, ety) := deoverloadRange(start_exp, start_ty, ostep_exp, ostep_ty, stop_exp, stop_ty, inInfo); (outCache, ty) := elabRangeType(outCache, inEnv, start_exp, ostep_exp, @@ -718,7 +725,7 @@ algorithm (expl, DAE.PROP(ty, c)) := elabArray(expl, props, inPrefix, inInfo); // type-checking the array arr_ty := DAE.T_ARRAY(ty, {DAE.DIM_INTEGER(listLength(expl))}, DAE.emptyTypeSource); exp := DAE.ARRAY(Types.simplifyType(arr_ty), not Types.isArray(ty), expl); - (exp, arr_ty) := MetaUtil.tryToConvertArrayToList(exp, arr_ty) "converts types that cannot be arrays in ot lists."; + MetaUtil.checkArrayType(ty); exp := elabMatrixToMatrixExp(exp); then (exp, DAE.PROP(arr_ty, c)); @@ -797,7 +804,7 @@ protected String exp_str, ty1_str, ty2_str; algorithm Absyn.CONS(e1, e2) := inExp; - {e1, e2} := MetaUtil.transformArrayNodesToListNodes({e1, e2}, {}); + {e1, e2} := MetaUtil.transformArrayNodesToListNodes({e1, e2}); // Elaborate both sides of the cons expression. (outCache, exp1, prop1) := elabExpInExpression(outCache, inEnv, e1, @@ -1406,7 +1413,7 @@ algorithm // If we have a guard expression we don't determine the dimension, since the // number of elements depend on the guard. - if Util.isSome(guard_exp) then + if isSome(guard_exp) then outHasGuard := true; dim := DAE.DIM_UNKNOWN(); end if; @@ -1902,14 +1909,14 @@ algorithm algorithm (outCache, fnTypes) := Lookup.lookupFunctionsInEnv(inCache, inEnv, fn, info); (typeA,typeB,resType,defaultBinding,path) := checkReductionType1(inEnv, fn,fnTypes,info); - ty2 := if Util.isSome(defaultBinding) then typeB else inType; + ty2 := if isSome(defaultBinding) then typeB else inType; (exp,typeA,bindings) := Types.matchTypePolymorphicWithError(inExp, inType,typeA,SOME(path),{},info); (_,typeB,bindings) := Types.matchTypePolymorphicWithError(DAE.CREF(DAE.CREF_IDENT("$result",DAE.T_ANYTYPE_DEFAULT,{}),DAE.T_ANYTYPE_DEFAULT),ty2,typeB,SOME(path),bindings,info); bindings := Types.solvePolymorphicBindings(bindings, info, {path}); typeA := Types.fixPolymorphicRestype(typeA, bindings, info); typeB := Types.fixPolymorphicRestype(typeB, bindings, info); resType := Types.fixPolymorphicRestype(resType, bindings, info); - (exp,ty) := checkReductionType2(exp, inType,typeA,typeB,resType,Types.equivtypes(typeA,typeB) or Util.isSome(defaultBinding),Types.equivtypes(typeB,resType),info); + (exp,ty) := checkReductionType2(exp, inType,typeA,typeB,resType,Types.equivtypes(typeA,typeB) or isSome(defaultBinding),Types.equivtypes(typeB,resType),info); (outCache, Util.SUCCESS()) := instantiateDaeFunction(outCache, inEnv, path, false, NONE(), true); Error.assertionOrAddSourceMessage(Config.acceptMetaModelicaGrammar() or Flags.isSet(Flags.EXPERIMENTAL_REDUCTIONS), Error.COMPILER_NOTIFICATION, {"Custom reduction functions are an OpenModelica extension to the Modelica Specification. Do not use them if you need your model to compile using other tools or if you are concerned about using experimental features. Use +d=experimentalReductions to disable this message."}, info); then @@ -8058,7 +8065,7 @@ protected function instantiateDaeFunction2 output Util.Status status; protected Integer numError = Error.getNumErrorMessages(); - Boolean instOnlyForcedFunctions = Util.isSome(getGlobalRoot(Global.instOnlyForcedFunctions)); + Boolean instOnlyForcedFunctions = isSome(getGlobalRoot(Global.instOnlyForcedFunctions)); algorithm (outCache,status) := matchcontinue(builtin, clOpt, instOnlyForcedFunctions, forceFunctionInst) local @@ -10958,7 +10965,7 @@ algorithm genWarning = Types.isFixedWithNoBinding(tt, SCode.PARAM()); s = ComponentReference.printComponentRefStr(cr); genWarning = not (boolNot(genWarning) or - Util.isSome(forIteratorConstOpt) or + isSome(forIteratorConstOpt) or Flags.getConfigBool(Flags.CHECK_MODEL)); pre_str = PrefixUtil.printPrefixStr2(pre); // Don't generate warning if variable is for iterator, since it doesn't have a value (it's iterated over separately) diff --git a/Compiler/FrontEnd/Types.mo b/Compiler/FrontEnd/Types.mo index 9b5e10d293f..4fca3e7f5f7 100644 --- a/Compiler/FrontEnd/Types.mo +++ b/Compiler/FrontEnd/Types.mo @@ -5797,7 +5797,7 @@ algorithm case (DAE.T_METARECORD(knownSingleton=false,utPath = path1), DAE.T_METARECORD(knownSingleton=false,utPath=path2)) equation true = Absyn.pathEqual(path1,path2); - then DAE.T_METAUNIONTYPE({},false,{path1}); + then DAE.T_METAUNIONTYPE({},false,DAE.NOT_SINGLETON(),{path1}); case (DAE.T_INTEGER(),DAE.T_REAL()) then DAE.T_REAL_DEFAULT; @@ -7824,7 +7824,10 @@ algorithm case (DAE.T_METALIST(t, _), ts) then DAE.T_METALIST(t, ts); case (DAE.T_METATUPLE(tys, _), ts) then DAE.T_METATUPLE(tys, ts); case (DAE.T_METAOPTION(t, _), ts) then DAE.T_METAOPTION(t, ts); - case (DAE.T_METAUNIONTYPE(ps, b, _), ts) then DAE.T_METAUNIONTYPE(ps, b, ts); + case (t as DAE.T_METAUNIONTYPE(), ts) + algorithm + t.source := ts; + then t; case (DAE.T_METARECORD(p, i, v, b, _), ts) then DAE.T_METARECORD(p, i, v, b, ts); case (DAE.T_METAARRAY(t, _), ts) then DAE.T_METAARRAY(t, ts); case (DAE.T_METABOXED(t, _), ts) then DAE.T_METABOXED(t, ts); @@ -8218,7 +8221,7 @@ algorithm local Boolean b; Absyn.Path p; - case DAE.T_METARECORD(utPath=p,knownSingleton=b) then DAE.T_METAUNIONTYPE({},b,{p}); + case DAE.T_METARECORD(utPath=p,knownSingleton=b) then DAE.T_METAUNIONTYPE({},b,if b then DAE.EVAL_SINGLETON_KNOWN_TYPE(inTy) else DAE.NOT_SINGLETON(),{p}); else inTy; end match; end getUniontypeIfMetarecord; @@ -8237,7 +8240,7 @@ protected function getUniontypeIfMetarecordTraverse output Integer odummy = dummy; algorithm oty := match ty - case DAE.T_METARECORD() then DAE.T_METAUNIONTYPE({},ty.knownSingleton,{ty.utPath}); + case DAE.T_METARECORD() then DAE.T_METAUNIONTYPE({},ty.knownSingleton,if ty.knownSingleton then DAE.EVAL_SINGLETON_KNOWN_TYPE(ty) else DAE.NOT_SINGLETON(),{ty.utPath}); else ty; end match; end getUniontypeIfMetarecordTraverse; @@ -8878,5 +8881,46 @@ protected function unboxedTypeTraverseHelper output T odummy = dummy; end unboxedTypeTraverseHelper; +public function getMetaRecordFields + input DAE.Type ty; + output list fields; +algorithm + fields := match ty + local + DAE.EvaluateSingletonTypeFunction fun; + case DAE.T_METARECORD(fields=fields) then fields; + case DAE.T_METAUNIONTYPE(knownSingleton=false) + algorithm + Error.addInternalError(getInstanceName() + " called on a non-singleton uniontype: " + unparseType(ty), sourceInfo()); + then fail(); + case DAE.T_METAUNIONTYPE(singletonType=DAE.EVAL_SINGLETON_KNOWN_TYPE(ty=DAE.T_METARECORD(fields=fields))) then fields; + case DAE.T_METAUNIONTYPE(singletonType=DAE.EVAL_SINGLETON_TYPE_FUNCTION(fun=fun)) + algorithm + DAE.T_METARECORD(fields=fields) := fun(); + then fields; + else + algorithm + Error.addInternalError(getInstanceName() + " called on a non-singleton uniontype: " + unparseType(ty), sourceInfo()); + then fail(); + end match; +end getMetaRecordFields; + +public function getMetaRecordIfSingleton + input DAE.Type ty; + output DAE.Type oty; +algorithm + oty := match ty + local + DAE.EvaluateSingletonTypeFunction fun; + case DAE.T_METAUNIONTYPE(knownSingleton=false) then ty; + case DAE.T_METAUNIONTYPE(singletonType=DAE.EVAL_SINGLETON_KNOWN_TYPE(ty=oty)) then oty; + case DAE.T_METAUNIONTYPE(singletonType=DAE.EVAL_SINGLETON_TYPE_FUNCTION(fun=fun)) + algorithm + oty := fun(); + then oty; + else ty; + end match; +end getMetaRecordIfSingleton; + annotation(__OpenModelica_Interface="frontend"); end Types; diff --git a/Compiler/OpenModelicaBootstrappingHeader.h b/Compiler/OpenModelicaBootstrappingHeader.h index 2f1bd22f04e..c6f9ef8a227 100644 --- a/Compiler/OpenModelicaBootstrappingHeader.h +++ b/Compiler/OpenModelicaBootstrappingHeader.h @@ -63,35 +63,35 @@ extern struct record_description FMI_ExperimentAnnotation_EXPERIMENTANNOTATION__ #define FMI__EXPERIMENTANNOTATION_3dBOX3 3 #define FMI__EXPERIMENTANNOTATION(fmiExperimentStartTime,fmiExperimentStopTime,fmiExperimentTolerance) (mmc_mk_box4(3,&FMI_ExperimentAnnotation_EXPERIMENTANNOTATION__desc,fmiExperimentStartTime,fmiExperimentStopTime,fmiExperimentTolerance)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef FMI_ModelVariables_REALVARIABLE__desc_added -#define FMI_ModelVariables_REALVARIABLE__desc_added -ADD_METARECORD_DEFINITIONS const char* FMI_ModelVariables_REALVARIABLE__desc__fields[14] = {"instance","name","description","baseType","variability","causality","hasStartValue","startValue","isFixed","valueReference","x1Placement","x2Placement","y1Placement","y2Placement"}; -ADD_METARECORD_DEFINITIONS struct record_description FMI_ModelVariables_REALVARIABLE__desc = { - "FMI_ModelVariables_REALVARIABLE", - "FMI.ModelVariables.REALVARIABLE", - FMI_ModelVariables_REALVARIABLE__desc__fields +#ifndef FMI_ModelVariables_ENUMERATIONVARIABLE__desc_added +#define FMI_ModelVariables_ENUMERATIONVARIABLE__desc_added +ADD_METARECORD_DEFINITIONS const char* FMI_ModelVariables_ENUMERATIONVARIABLE__desc__fields[14] = {"instance","name","description","baseType","variability","causality","hasStartValue","startValue","isFixed","valueReference","x1Placement","x2Placement","y1Placement","y2Placement"}; +ADD_METARECORD_DEFINITIONS struct record_description FMI_ModelVariables_ENUMERATIONVARIABLE__desc = { + "FMI_ModelVariables_ENUMERATIONVARIABLE", + "FMI.ModelVariables.ENUMERATIONVARIABLE", + FMI_ModelVariables_ENUMERATIONVARIABLE__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description FMI_ModelVariables_REALVARIABLE__desc; +extern struct record_description FMI_ModelVariables_ENUMERATIONVARIABLE__desc; #endif -#define FMI__REALVARIABLE_3dBOX14 3 -#define FMI__REALVARIABLE(instance,name,description,baseType,variability,causality,hasStartValue,startValue,isFixed,valueReference,x1Placement,x2Placement,y1Placement,y2Placement) (mmc_mk_box(15, 3,&FMI_ModelVariables_REALVARIABLE__desc,instance,name,description,baseType,variability,causality,hasStartValue,startValue,isFixed,valueReference,x1Placement,x2Placement,y1Placement,y2Placement)) +#define FMI__ENUMERATIONVARIABLE_3dBOX14 7 +#define FMI__ENUMERATIONVARIABLE(instance,name,description,baseType,variability,causality,hasStartValue,startValue,isFixed,valueReference,x1Placement,x2Placement,y1Placement,y2Placement) (mmc_mk_box(15, 7,&FMI_ModelVariables_ENUMERATIONVARIABLE__desc,instance,name,description,baseType,variability,causality,hasStartValue,startValue,isFixed,valueReference,x1Placement,x2Placement,y1Placement,y2Placement)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef FMI_ModelVariables_INTEGERVARIABLE__desc_added -#define FMI_ModelVariables_INTEGERVARIABLE__desc_added -ADD_METARECORD_DEFINITIONS const char* FMI_ModelVariables_INTEGERVARIABLE__desc__fields[14] = {"instance","name","description","baseType","variability","causality","hasStartValue","startValue","isFixed","valueReference","x1Placement","x2Placement","y1Placement","y2Placement"}; -ADD_METARECORD_DEFINITIONS struct record_description FMI_ModelVariables_INTEGERVARIABLE__desc = { - "FMI_ModelVariables_INTEGERVARIABLE", - "FMI.ModelVariables.INTEGERVARIABLE", - FMI_ModelVariables_INTEGERVARIABLE__desc__fields +#ifndef FMI_ModelVariables_STRINGVARIABLE__desc_added +#define FMI_ModelVariables_STRINGVARIABLE__desc_added +ADD_METARECORD_DEFINITIONS const char* FMI_ModelVariables_STRINGVARIABLE__desc__fields[14] = {"instance","name","description","baseType","variability","causality","hasStartValue","startValue","isFixed","valueReference","x1Placement","x2Placement","y1Placement","y2Placement"}; +ADD_METARECORD_DEFINITIONS struct record_description FMI_ModelVariables_STRINGVARIABLE__desc = { + "FMI_ModelVariables_STRINGVARIABLE", + "FMI.ModelVariables.STRINGVARIABLE", + FMI_ModelVariables_STRINGVARIABLE__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description FMI_ModelVariables_INTEGERVARIABLE__desc; +extern struct record_description FMI_ModelVariables_STRINGVARIABLE__desc; #endif -#define FMI__INTEGERVARIABLE_3dBOX14 4 -#define FMI__INTEGERVARIABLE(instance,name,description,baseType,variability,causality,hasStartValue,startValue,isFixed,valueReference,x1Placement,x2Placement,y1Placement,y2Placement) (mmc_mk_box(15, 4,&FMI_ModelVariables_INTEGERVARIABLE__desc,instance,name,description,baseType,variability,causality,hasStartValue,startValue,isFixed,valueReference,x1Placement,x2Placement,y1Placement,y2Placement)) +#define FMI__STRINGVARIABLE_3dBOX14 6 +#define FMI__STRINGVARIABLE(instance,name,description,baseType,variability,causality,hasStartValue,startValue,isFixed,valueReference,x1Placement,x2Placement,y1Placement,y2Placement) (mmc_mk_box(15, 6,&FMI_ModelVariables_STRINGVARIABLE__desc,instance,name,description,baseType,variability,causality,hasStartValue,startValue,isFixed,valueReference,x1Placement,x2Placement,y1Placement,y2Placement)) #ifdef ADD_METARECORD_DEFINITIONS #ifndef FMI_ModelVariables_BOOLEANVARIABLE__desc_added #define FMI_ModelVariables_BOOLEANVARIABLE__desc_added @@ -108,35 +108,35 @@ extern struct record_description FMI_ModelVariables_BOOLEANVARIABLE__desc; #define FMI__BOOLEANVARIABLE_3dBOX14 5 #define FMI__BOOLEANVARIABLE(instance,name,description,baseType,variability,causality,hasStartValue,startValue,isFixed,valueReference,x1Placement,x2Placement,y1Placement,y2Placement) (mmc_mk_box(15, 5,&FMI_ModelVariables_BOOLEANVARIABLE__desc,instance,name,description,baseType,variability,causality,hasStartValue,startValue,isFixed,valueReference,x1Placement,x2Placement,y1Placement,y2Placement)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef FMI_ModelVariables_STRINGVARIABLE__desc_added -#define FMI_ModelVariables_STRINGVARIABLE__desc_added -ADD_METARECORD_DEFINITIONS const char* FMI_ModelVariables_STRINGVARIABLE__desc__fields[14] = {"instance","name","description","baseType","variability","causality","hasStartValue","startValue","isFixed","valueReference","x1Placement","x2Placement","y1Placement","y2Placement"}; -ADD_METARECORD_DEFINITIONS struct record_description FMI_ModelVariables_STRINGVARIABLE__desc = { - "FMI_ModelVariables_STRINGVARIABLE", - "FMI.ModelVariables.STRINGVARIABLE", - FMI_ModelVariables_STRINGVARIABLE__desc__fields +#ifndef FMI_ModelVariables_INTEGERVARIABLE__desc_added +#define FMI_ModelVariables_INTEGERVARIABLE__desc_added +ADD_METARECORD_DEFINITIONS const char* FMI_ModelVariables_INTEGERVARIABLE__desc__fields[14] = {"instance","name","description","baseType","variability","causality","hasStartValue","startValue","isFixed","valueReference","x1Placement","x2Placement","y1Placement","y2Placement"}; +ADD_METARECORD_DEFINITIONS struct record_description FMI_ModelVariables_INTEGERVARIABLE__desc = { + "FMI_ModelVariables_INTEGERVARIABLE", + "FMI.ModelVariables.INTEGERVARIABLE", + FMI_ModelVariables_INTEGERVARIABLE__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description FMI_ModelVariables_STRINGVARIABLE__desc; +extern struct record_description FMI_ModelVariables_INTEGERVARIABLE__desc; #endif -#define FMI__STRINGVARIABLE_3dBOX14 6 -#define FMI__STRINGVARIABLE(instance,name,description,baseType,variability,causality,hasStartValue,startValue,isFixed,valueReference,x1Placement,x2Placement,y1Placement,y2Placement) (mmc_mk_box(15, 6,&FMI_ModelVariables_STRINGVARIABLE__desc,instance,name,description,baseType,variability,causality,hasStartValue,startValue,isFixed,valueReference,x1Placement,x2Placement,y1Placement,y2Placement)) +#define FMI__INTEGERVARIABLE_3dBOX14 4 +#define FMI__INTEGERVARIABLE(instance,name,description,baseType,variability,causality,hasStartValue,startValue,isFixed,valueReference,x1Placement,x2Placement,y1Placement,y2Placement) (mmc_mk_box(15, 4,&FMI_ModelVariables_INTEGERVARIABLE__desc,instance,name,description,baseType,variability,causality,hasStartValue,startValue,isFixed,valueReference,x1Placement,x2Placement,y1Placement,y2Placement)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef FMI_ModelVariables_ENUMERATIONVARIABLE__desc_added -#define FMI_ModelVariables_ENUMERATIONVARIABLE__desc_added -ADD_METARECORD_DEFINITIONS const char* FMI_ModelVariables_ENUMERATIONVARIABLE__desc__fields[14] = {"instance","name","description","baseType","variability","causality","hasStartValue","startValue","isFixed","valueReference","x1Placement","x2Placement","y1Placement","y2Placement"}; -ADD_METARECORD_DEFINITIONS struct record_description FMI_ModelVariables_ENUMERATIONVARIABLE__desc = { - "FMI_ModelVariables_ENUMERATIONVARIABLE", - "FMI.ModelVariables.ENUMERATIONVARIABLE", - FMI_ModelVariables_ENUMERATIONVARIABLE__desc__fields +#ifndef FMI_ModelVariables_REALVARIABLE__desc_added +#define FMI_ModelVariables_REALVARIABLE__desc_added +ADD_METARECORD_DEFINITIONS const char* FMI_ModelVariables_REALVARIABLE__desc__fields[14] = {"instance","name","description","baseType","variability","causality","hasStartValue","startValue","isFixed","valueReference","x1Placement","x2Placement","y1Placement","y2Placement"}; +ADD_METARECORD_DEFINITIONS struct record_description FMI_ModelVariables_REALVARIABLE__desc = { + "FMI_ModelVariables_REALVARIABLE", + "FMI.ModelVariables.REALVARIABLE", + FMI_ModelVariables_REALVARIABLE__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description FMI_ModelVariables_ENUMERATIONVARIABLE__desc; +extern struct record_description FMI_ModelVariables_REALVARIABLE__desc; #endif -#define FMI__ENUMERATIONVARIABLE_3dBOX14 7 -#define FMI__ENUMERATIONVARIABLE(instance,name,description,baseType,variability,causality,hasStartValue,startValue,isFixed,valueReference,x1Placement,x2Placement,y1Placement,y2Placement) (mmc_mk_box(15, 7,&FMI_ModelVariables_ENUMERATIONVARIABLE__desc,instance,name,description,baseType,variability,causality,hasStartValue,startValue,isFixed,valueReference,x1Placement,x2Placement,y1Placement,y2Placement)) +#define FMI__REALVARIABLE_3dBOX14 3 +#define FMI__REALVARIABLE(instance,name,description,baseType,variability,causality,hasStartValue,startValue,isFixed,valueReference,x1Placement,x2Placement,y1Placement,y2Placement) (mmc_mk_box(15, 3,&FMI_ModelVariables_REALVARIABLE__desc,instance,name,description,baseType,variability,causality,hasStartValue,startValue,isFixed,valueReference,x1Placement,x2Placement,y1Placement,y2Placement)) #ifdef ADD_METARECORD_DEFINITIONS #ifndef FMI_FmiImport_FMIIMPORT__desc_added #define FMI_FmiImport_FMIIMPORT__desc_added @@ -168,22 +168,6 @@ extern struct record_description Util_ReplacePattern_REPLACEPATTERN__desc; #define Util__REPLACEPATTERN_3dBOX2 3 #define Util__REPLACEPATTERN(from,to) (mmc_mk_box3(3,&Util_ReplacePattern_REPLACEPATTERN__desc,from,to)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Util_Status_SUCCESS__desc_added -#define Util_Status_SUCCESS__desc_added -ADD_METARECORD_DEFINITIONS const char* Util_Status_SUCCESS__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Util_Status_SUCCESS__desc = { - "Util_Status_SUCCESS", - "Util.Status.SUCCESS", - Util_Status_SUCCESS__desc__fields -}; -#endif -#else /* Only use the file as a header */ -extern struct record_description Util_Status_SUCCESS__desc; -#endif -#define Util__SUCCESS_3dBOX0 3 -static const MMC_DEFSTRUCTLIT(Util__SUCCESS__struct,1,3) {&Util_Status_SUCCESS__desc}}; -static void *Util__SUCCESS = MMC_REFSTRUCTLIT(Util__SUCCESS__struct); -#ifdef ADD_METARECORD_DEFINITIONS #ifndef Util_Status_FAILURE__desc_added #define Util_Status_FAILURE__desc_added ADD_METARECORD_DEFINITIONS const char* Util_Status_FAILURE__desc__fields[1] = {"no fields"}; @@ -200,6 +184,22 @@ extern struct record_description Util_Status_FAILURE__desc; static const MMC_DEFSTRUCTLIT(Util__FAILURE__struct,1,4) {&Util_Status_FAILURE__desc}}; static void *Util__FAILURE = MMC_REFSTRUCTLIT(Util__FAILURE__struct); #ifdef ADD_METARECORD_DEFINITIONS +#ifndef Util_Status_SUCCESS__desc_added +#define Util_Status_SUCCESS__desc_added +ADD_METARECORD_DEFINITIONS const char* Util_Status_SUCCESS__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Util_Status_SUCCESS__desc = { + "Util_Status_SUCCESS", + "Util.Status.SUCCESS", + Util_Status_SUCCESS__desc__fields +}; +#endif +#else /* Only use the file as a header */ +extern struct record_description Util_Status_SUCCESS__desc; +#endif +#define Util__SUCCESS_3dBOX0 3 +static const MMC_DEFSTRUCTLIT(Util__SUCCESS__struct,1,3) {&Util_Status_SUCCESS__desc}}; +static void *Util__SUCCESS = MMC_REFSTRUCTLIT(Util__SUCCESS__struct); +#ifdef ADD_METARECORD_DEFINITIONS #ifndef Util_DateTime_DATETIME__desc_added #define Util_DateTime_DATETIME__desc_added ADD_METARECORD_DEFINITIONS const char* Util_DateTime_DATETIME__desc__fields[6] = {"sec","min","hour","mday","mon","year"}; @@ -215,21 +215,6 @@ extern struct record_description Util_DateTime_DATETIME__desc; #define Util__DATETIME_3dBOX6 3 #define Util__DATETIME(sec,min,hour,mday,mon,year) (mmc_mk_box7(3,&Util_DateTime_DATETIME__desc,sec,min,hour,mday,mon,year)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Util_TranslatableContent_gettext__desc_added -#define Util_TranslatableContent_gettext__desc_added -ADD_METARECORD_DEFINITIONS const char* Util_TranslatableContent_gettext__desc__fields[1] = {"msgid"}; -ADD_METARECORD_DEFINITIONS struct record_description Util_TranslatableContent_gettext__desc = { - "Util_TranslatableContent_gettext", - "Util.TranslatableContent.gettext", - Util_TranslatableContent_gettext__desc__fields -}; -#endif -#else /* Only use the file as a header */ -extern struct record_description Util_TranslatableContent_gettext__desc; -#endif -#define Util__gettext_3dBOX1 3 -#define Util__gettext(msgid) (mmc_mk_box2(3,&Util_TranslatableContent_gettext__desc,msgid)) -#ifdef ADD_METARECORD_DEFINITIONS #ifndef Util_TranslatableContent_notrans__desc_added #define Util_TranslatableContent_notrans__desc_added ADD_METARECORD_DEFINITIONS const char* Util_TranslatableContent_notrans__desc__fields[1] = {"str"}; @@ -245,69 +230,52 @@ extern struct record_description Util_TranslatableContent_notrans__desc; #define Util__notrans_3dBOX1 4 #define Util__notrans(str) (mmc_mk_box2(4,&Util_TranslatableContent_notrans__desc,str)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Config_LanguageStandard_MODELICA__1__X__desc_added -#define Config_LanguageStandard_MODELICA__1__X__desc_added -ADD_METARECORD_DEFINITIONS const char* Config_LanguageStandard_MODELICA__1__X__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Config_LanguageStandard_MODELICA__1__X__desc = { - "Config_LanguageStandard_MODELICA__1__X", - "Config.LanguageStandard.MODELICA_1_X", - Config_LanguageStandard_MODELICA__1__X__desc__fields -}; -#endif -#else /* Only use the file as a header */ -extern struct record_description Config_LanguageStandard_MODELICA__1__X__desc; -#endif -#define Config__MODELICA_5f1_5fX_3dBOX0 3 -static const MMC_DEFSTRUCTLIT(Config__MODELICA_5f1_5fX__struct,1,3) {&Config_LanguageStandard_MODELICA__1__X__desc}}; -static void *Config__MODELICA_5f1_5fX = MMC_REFSTRUCTLIT(Config__MODELICA_5f1_5fX__struct); -#ifdef ADD_METARECORD_DEFINITIONS -#ifndef Config_LanguageStandard_MODELICA__2__X__desc_added -#define Config_LanguageStandard_MODELICA__2__X__desc_added -ADD_METARECORD_DEFINITIONS const char* Config_LanguageStandard_MODELICA__2__X__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Config_LanguageStandard_MODELICA__2__X__desc = { - "Config_LanguageStandard_MODELICA__2__X", - "Config.LanguageStandard.MODELICA_2_X", - Config_LanguageStandard_MODELICA__2__X__desc__fields +#ifndef Util_TranslatableContent_gettext__desc_added +#define Util_TranslatableContent_gettext__desc_added +ADD_METARECORD_DEFINITIONS const char* Util_TranslatableContent_gettext__desc__fields[1] = {"msgid"}; +ADD_METARECORD_DEFINITIONS struct record_description Util_TranslatableContent_gettext__desc = { + "Util_TranslatableContent_gettext", + "Util.TranslatableContent.gettext", + Util_TranslatableContent_gettext__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Config_LanguageStandard_MODELICA__2__X__desc; +extern struct record_description Util_TranslatableContent_gettext__desc; #endif -#define Config__MODELICA_5f2_5fX_3dBOX0 4 -static const MMC_DEFSTRUCTLIT(Config__MODELICA_5f2_5fX__struct,1,4) {&Config_LanguageStandard_MODELICA__2__X__desc}}; -static void *Config__MODELICA_5f2_5fX = MMC_REFSTRUCTLIT(Config__MODELICA_5f2_5fX__struct); +#define Util__gettext_3dBOX1 3 +#define Util__gettext(msgid) (mmc_mk_box2(3,&Util_TranslatableContent_gettext__desc,msgid)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Config_LanguageStandard_MODELICA__3__0__desc_added -#define Config_LanguageStandard_MODELICA__3__0__desc_added -ADD_METARECORD_DEFINITIONS const char* Config_LanguageStandard_MODELICA__3__0__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Config_LanguageStandard_MODELICA__3__0__desc = { - "Config_LanguageStandard_MODELICA__3__0", - "Config.LanguageStandard.MODELICA_3_0", - Config_LanguageStandard_MODELICA__3__0__desc__fields +#ifndef Config_LanguageStandard_MODELICA__LATEST__desc_added +#define Config_LanguageStandard_MODELICA__LATEST__desc_added +ADD_METARECORD_DEFINITIONS const char* Config_LanguageStandard_MODELICA__LATEST__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Config_LanguageStandard_MODELICA__LATEST__desc = { + "Config_LanguageStandard_MODELICA__LATEST", + "Config.LanguageStandard.MODELICA_LATEST", + Config_LanguageStandard_MODELICA__LATEST__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Config_LanguageStandard_MODELICA__3__0__desc; +extern struct record_description Config_LanguageStandard_MODELICA__LATEST__desc; #endif -#define Config__MODELICA_5f3_5f0_3dBOX0 5 -static const MMC_DEFSTRUCTLIT(Config__MODELICA_5f3_5f0__struct,1,5) {&Config_LanguageStandard_MODELICA__3__0__desc}}; -static void *Config__MODELICA_5f3_5f0 = MMC_REFSTRUCTLIT(Config__MODELICA_5f3_5f0__struct); +#define Config__MODELICA_5fLATEST_3dBOX0 9 +static const MMC_DEFSTRUCTLIT(Config__MODELICA_5fLATEST__struct,1,9) {&Config_LanguageStandard_MODELICA__LATEST__desc}}; +static void *Config__MODELICA_5fLATEST = MMC_REFSTRUCTLIT(Config__MODELICA_5fLATEST__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Config_LanguageStandard_MODELICA__3__1__desc_added -#define Config_LanguageStandard_MODELICA__3__1__desc_added -ADD_METARECORD_DEFINITIONS const char* Config_LanguageStandard_MODELICA__3__1__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Config_LanguageStandard_MODELICA__3__1__desc = { - "Config_LanguageStandard_MODELICA__3__1", - "Config.LanguageStandard.MODELICA_3_1", - Config_LanguageStandard_MODELICA__3__1__desc__fields +#ifndef Config_LanguageStandard_MODELICA__3__3__desc_added +#define Config_LanguageStandard_MODELICA__3__3__desc_added +ADD_METARECORD_DEFINITIONS const char* Config_LanguageStandard_MODELICA__3__3__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Config_LanguageStandard_MODELICA__3__3__desc = { + "Config_LanguageStandard_MODELICA__3__3", + "Config.LanguageStandard.MODELICA_3_3", + Config_LanguageStandard_MODELICA__3__3__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Config_LanguageStandard_MODELICA__3__1__desc; +extern struct record_description Config_LanguageStandard_MODELICA__3__3__desc; #endif -#define Config__MODELICA_5f3_5f1_3dBOX0 6 -static const MMC_DEFSTRUCTLIT(Config__MODELICA_5f3_5f1__struct,1,6) {&Config_LanguageStandard_MODELICA__3__1__desc}}; -static void *Config__MODELICA_5f3_5f1 = MMC_REFSTRUCTLIT(Config__MODELICA_5f3_5f1__struct); +#define Config__MODELICA_5f3_5f3_3dBOX0 8 +static const MMC_DEFSTRUCTLIT(Config__MODELICA_5f3_5f3__struct,1,8) {&Config_LanguageStandard_MODELICA__3__3__desc}}; +static void *Config__MODELICA_5f3_5f3 = MMC_REFSTRUCTLIT(Config__MODELICA_5f3_5f3__struct); #ifdef ADD_METARECORD_DEFINITIONS #ifndef Config_LanguageStandard_MODELICA__3__2__desc_added #define Config_LanguageStandard_MODELICA__3__2__desc_added @@ -325,69 +293,85 @@ extern struct record_description Config_LanguageStandard_MODELICA__3__2__desc; static const MMC_DEFSTRUCTLIT(Config__MODELICA_5f3_5f2__struct,1,7) {&Config_LanguageStandard_MODELICA__3__2__desc}}; static void *Config__MODELICA_5f3_5f2 = MMC_REFSTRUCTLIT(Config__MODELICA_5f3_5f2__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Config_LanguageStandard_MODELICA__3__3__desc_added -#define Config_LanguageStandard_MODELICA__3__3__desc_added -ADD_METARECORD_DEFINITIONS const char* Config_LanguageStandard_MODELICA__3__3__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Config_LanguageStandard_MODELICA__3__3__desc = { - "Config_LanguageStandard_MODELICA__3__3", - "Config.LanguageStandard.MODELICA_3_3", - Config_LanguageStandard_MODELICA__3__3__desc__fields +#ifndef Config_LanguageStandard_MODELICA__3__1__desc_added +#define Config_LanguageStandard_MODELICA__3__1__desc_added +ADD_METARECORD_DEFINITIONS const char* Config_LanguageStandard_MODELICA__3__1__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Config_LanguageStandard_MODELICA__3__1__desc = { + "Config_LanguageStandard_MODELICA__3__1", + "Config.LanguageStandard.MODELICA_3_1", + Config_LanguageStandard_MODELICA__3__1__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Config_LanguageStandard_MODELICA__3__3__desc; +extern struct record_description Config_LanguageStandard_MODELICA__3__1__desc; #endif -#define Config__MODELICA_5f3_5f3_3dBOX0 8 -static const MMC_DEFSTRUCTLIT(Config__MODELICA_5f3_5f3__struct,1,8) {&Config_LanguageStandard_MODELICA__3__3__desc}}; -static void *Config__MODELICA_5f3_5f3 = MMC_REFSTRUCTLIT(Config__MODELICA_5f3_5f3__struct); +#define Config__MODELICA_5f3_5f1_3dBOX0 6 +static const MMC_DEFSTRUCTLIT(Config__MODELICA_5f3_5f1__struct,1,6) {&Config_LanguageStandard_MODELICA__3__1__desc}}; +static void *Config__MODELICA_5f3_5f1 = MMC_REFSTRUCTLIT(Config__MODELICA_5f3_5f1__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Config_LanguageStandard_MODELICA__LATEST__desc_added -#define Config_LanguageStandard_MODELICA__LATEST__desc_added -ADD_METARECORD_DEFINITIONS const char* Config_LanguageStandard_MODELICA__LATEST__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Config_LanguageStandard_MODELICA__LATEST__desc = { - "Config_LanguageStandard_MODELICA__LATEST", - "Config.LanguageStandard.MODELICA_LATEST", - Config_LanguageStandard_MODELICA__LATEST__desc__fields +#ifndef Config_LanguageStandard_MODELICA__3__0__desc_added +#define Config_LanguageStandard_MODELICA__3__0__desc_added +ADD_METARECORD_DEFINITIONS const char* Config_LanguageStandard_MODELICA__3__0__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Config_LanguageStandard_MODELICA__3__0__desc = { + "Config_LanguageStandard_MODELICA__3__0", + "Config.LanguageStandard.MODELICA_3_0", + Config_LanguageStandard_MODELICA__3__0__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Config_LanguageStandard_MODELICA__LATEST__desc; +extern struct record_description Config_LanguageStandard_MODELICA__3__0__desc; #endif -#define Config__MODELICA_5fLATEST_3dBOX0 9 -static const MMC_DEFSTRUCTLIT(Config__MODELICA_5fLATEST__struct,1,9) {&Config_LanguageStandard_MODELICA__LATEST__desc}}; -static void *Config__MODELICA_5fLATEST = MMC_REFSTRUCTLIT(Config__MODELICA_5fLATEST__struct); +#define Config__MODELICA_5f3_5f0_3dBOX0 5 +static const MMC_DEFSTRUCTLIT(Config__MODELICA_5f3_5f0__struct,1,5) {&Config_LanguageStandard_MODELICA__3__0__desc}}; +static void *Config__MODELICA_5f3_5f0 = MMC_REFSTRUCTLIT(Config__MODELICA_5f3_5f0__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Error_Severity_INTERNAL__desc_added -#define Error_Severity_INTERNAL__desc_added -ADD_METARECORD_DEFINITIONS const char* Error_Severity_INTERNAL__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Error_Severity_INTERNAL__desc = { - "Error_Severity_INTERNAL", - "Error.Severity.INTERNAL", - Error_Severity_INTERNAL__desc__fields +#ifndef Config_LanguageStandard_MODELICA__2__X__desc_added +#define Config_LanguageStandard_MODELICA__2__X__desc_added +ADD_METARECORD_DEFINITIONS const char* Config_LanguageStandard_MODELICA__2__X__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Config_LanguageStandard_MODELICA__2__X__desc = { + "Config_LanguageStandard_MODELICA__2__X", + "Config.LanguageStandard.MODELICA_2_X", + Config_LanguageStandard_MODELICA__2__X__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Error_Severity_INTERNAL__desc; +extern struct record_description Config_LanguageStandard_MODELICA__2__X__desc; #endif -#define Error__INTERNAL_3dBOX0 3 -static const MMC_DEFSTRUCTLIT(Error__INTERNAL__struct,1,3) {&Error_Severity_INTERNAL__desc}}; -static void *Error__INTERNAL = MMC_REFSTRUCTLIT(Error__INTERNAL__struct); +#define Config__MODELICA_5f2_5fX_3dBOX0 4 +static const MMC_DEFSTRUCTLIT(Config__MODELICA_5f2_5fX__struct,1,4) {&Config_LanguageStandard_MODELICA__2__X__desc}}; +static void *Config__MODELICA_5f2_5fX = MMC_REFSTRUCTLIT(Config__MODELICA_5f2_5fX__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Error_Severity_ERROR__desc_added -#define Error_Severity_ERROR__desc_added -ADD_METARECORD_DEFINITIONS const char* Error_Severity_ERROR__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Error_Severity_ERROR__desc = { - "Error_Severity_ERROR", - "Error.Severity.ERROR", - Error_Severity_ERROR__desc__fields +#ifndef Config_LanguageStandard_MODELICA__1__X__desc_added +#define Config_LanguageStandard_MODELICA__1__X__desc_added +ADD_METARECORD_DEFINITIONS const char* Config_LanguageStandard_MODELICA__1__X__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Config_LanguageStandard_MODELICA__1__X__desc = { + "Config_LanguageStandard_MODELICA__1__X", + "Config.LanguageStandard.MODELICA_1_X", + Config_LanguageStandard_MODELICA__1__X__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Error_Severity_ERROR__desc; +extern struct record_description Config_LanguageStandard_MODELICA__1__X__desc; #endif -#define Error__ERROR_3dBOX0 4 -static const MMC_DEFSTRUCTLIT(Error__ERROR__struct,1,4) {&Error_Severity_ERROR__desc}}; -static void *Error__ERROR = MMC_REFSTRUCTLIT(Error__ERROR__struct); +#define Config__MODELICA_5f1_5fX_3dBOX0 3 +static const MMC_DEFSTRUCTLIT(Config__MODELICA_5f1_5fX__struct,1,3) {&Config_LanguageStandard_MODELICA__1__X__desc}}; +static void *Config__MODELICA_5f1_5fX = MMC_REFSTRUCTLIT(Config__MODELICA_5f1_5fX__struct); +#ifdef ADD_METARECORD_DEFINITIONS +#ifndef Error_Severity_NOTIFICATION__desc_added +#define Error_Severity_NOTIFICATION__desc_added +ADD_METARECORD_DEFINITIONS const char* Error_Severity_NOTIFICATION__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Error_Severity_NOTIFICATION__desc = { + "Error_Severity_NOTIFICATION", + "Error.Severity.NOTIFICATION", + Error_Severity_NOTIFICATION__desc__fields +}; +#endif +#else /* Only use the file as a header */ +extern struct record_description Error_Severity_NOTIFICATION__desc; +#endif +#define Error__NOTIFICATION_3dBOX0 6 +static const MMC_DEFSTRUCTLIT(Error__NOTIFICATION__struct,1,6) {&Error_Severity_NOTIFICATION__desc}}; +static void *Error__NOTIFICATION = MMC_REFSTRUCTLIT(Error__NOTIFICATION__struct); #ifdef ADD_METARECORD_DEFINITIONS #ifndef Error_Severity_WARNING__desc_added #define Error_Severity_WARNING__desc_added @@ -405,69 +389,69 @@ extern struct record_description Error_Severity_WARNING__desc; static const MMC_DEFSTRUCTLIT(Error__WARNING__struct,1,5) {&Error_Severity_WARNING__desc}}; static void *Error__WARNING = MMC_REFSTRUCTLIT(Error__WARNING__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Error_Severity_NOTIFICATION__desc_added -#define Error_Severity_NOTIFICATION__desc_added -ADD_METARECORD_DEFINITIONS const char* Error_Severity_NOTIFICATION__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Error_Severity_NOTIFICATION__desc = { - "Error_Severity_NOTIFICATION", - "Error.Severity.NOTIFICATION", - Error_Severity_NOTIFICATION__desc__fields +#ifndef Error_Severity_ERROR__desc_added +#define Error_Severity_ERROR__desc_added +ADD_METARECORD_DEFINITIONS const char* Error_Severity_ERROR__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Error_Severity_ERROR__desc = { + "Error_Severity_ERROR", + "Error.Severity.ERROR", + Error_Severity_ERROR__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Error_Severity_NOTIFICATION__desc; +extern struct record_description Error_Severity_ERROR__desc; #endif -#define Error__NOTIFICATION_3dBOX0 6 -static const MMC_DEFSTRUCTLIT(Error__NOTIFICATION__struct,1,6) {&Error_Severity_NOTIFICATION__desc}}; -static void *Error__NOTIFICATION = MMC_REFSTRUCTLIT(Error__NOTIFICATION__struct); +#define Error__ERROR_3dBOX0 4 +static const MMC_DEFSTRUCTLIT(Error__ERROR__struct,1,4) {&Error_Severity_ERROR__desc}}; +static void *Error__ERROR = MMC_REFSTRUCTLIT(Error__ERROR__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Error_MessageType_SYNTAX__desc_added -#define Error_MessageType_SYNTAX__desc_added -ADD_METARECORD_DEFINITIONS const char* Error_MessageType_SYNTAX__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Error_MessageType_SYNTAX__desc = { - "Error_MessageType_SYNTAX", - "Error.MessageType.SYNTAX", - Error_MessageType_SYNTAX__desc__fields +#ifndef Error_Severity_INTERNAL__desc_added +#define Error_Severity_INTERNAL__desc_added +ADD_METARECORD_DEFINITIONS const char* Error_Severity_INTERNAL__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Error_Severity_INTERNAL__desc = { + "Error_Severity_INTERNAL", + "Error.Severity.INTERNAL", + Error_Severity_INTERNAL__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Error_MessageType_SYNTAX__desc; +extern struct record_description Error_Severity_INTERNAL__desc; #endif -#define Error__SYNTAX_3dBOX0 3 -static const MMC_DEFSTRUCTLIT(Error__SYNTAX__struct,1,3) {&Error_MessageType_SYNTAX__desc}}; -static void *Error__SYNTAX = MMC_REFSTRUCTLIT(Error__SYNTAX__struct); +#define Error__INTERNAL_3dBOX0 3 +static const MMC_DEFSTRUCTLIT(Error__INTERNAL__struct,1,3) {&Error_Severity_INTERNAL__desc}}; +static void *Error__INTERNAL = MMC_REFSTRUCTLIT(Error__INTERNAL__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Error_MessageType_GRAMMAR__desc_added -#define Error_MessageType_GRAMMAR__desc_added -ADD_METARECORD_DEFINITIONS const char* Error_MessageType_GRAMMAR__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Error_MessageType_GRAMMAR__desc = { - "Error_MessageType_GRAMMAR", - "Error.MessageType.GRAMMAR", - Error_MessageType_GRAMMAR__desc__fields +#ifndef Error_MessageType_SCRIPTING__desc_added +#define Error_MessageType_SCRIPTING__desc_added +ADD_METARECORD_DEFINITIONS const char* Error_MessageType_SCRIPTING__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Error_MessageType_SCRIPTING__desc = { + "Error_MessageType_SCRIPTING", + "Error.MessageType.SCRIPTING", + Error_MessageType_SCRIPTING__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Error_MessageType_GRAMMAR__desc; +extern struct record_description Error_MessageType_SCRIPTING__desc; #endif -#define Error__GRAMMAR_3dBOX0 4 -static const MMC_DEFSTRUCTLIT(Error__GRAMMAR__struct,1,4) {&Error_MessageType_GRAMMAR__desc}}; -static void *Error__GRAMMAR = MMC_REFSTRUCTLIT(Error__GRAMMAR__struct); +#define Error__SCRIPTING_3dBOX0 8 +static const MMC_DEFSTRUCTLIT(Error__SCRIPTING__struct,1,8) {&Error_MessageType_SCRIPTING__desc}}; +static void *Error__SCRIPTING = MMC_REFSTRUCTLIT(Error__SCRIPTING__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Error_MessageType_TRANSLATION__desc_added -#define Error_MessageType_TRANSLATION__desc_added -ADD_METARECORD_DEFINITIONS const char* Error_MessageType_TRANSLATION__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Error_MessageType_TRANSLATION__desc = { - "Error_MessageType_TRANSLATION", - "Error.MessageType.TRANSLATION", - Error_MessageType_TRANSLATION__desc__fields +#ifndef Error_MessageType_SIMULATION__desc_added +#define Error_MessageType_SIMULATION__desc_added +ADD_METARECORD_DEFINITIONS const char* Error_MessageType_SIMULATION__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Error_MessageType_SIMULATION__desc = { + "Error_MessageType_SIMULATION", + "Error.MessageType.SIMULATION", + Error_MessageType_SIMULATION__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Error_MessageType_TRANSLATION__desc; +extern struct record_description Error_MessageType_SIMULATION__desc; #endif -#define Error__TRANSLATION_3dBOX0 5 -static const MMC_DEFSTRUCTLIT(Error__TRANSLATION__struct,1,5) {&Error_MessageType_TRANSLATION__desc}}; -static void *Error__TRANSLATION = MMC_REFSTRUCTLIT(Error__TRANSLATION__struct); +#define Error__SIMULATION_3dBOX0 7 +static const MMC_DEFSTRUCTLIT(Error__SIMULATION__struct,1,7) {&Error_MessageType_SIMULATION__desc}}; +static void *Error__SIMULATION = MMC_REFSTRUCTLIT(Error__SIMULATION__struct); #ifdef ADD_METARECORD_DEFINITIONS #ifndef Error_MessageType_SYMBOLIC__desc_added #define Error_MessageType_SYMBOLIC__desc_added @@ -485,37 +469,53 @@ extern struct record_description Error_MessageType_SYMBOLIC__desc; static const MMC_DEFSTRUCTLIT(Error__SYMBOLIC__struct,1,6) {&Error_MessageType_SYMBOLIC__desc}}; static void *Error__SYMBOLIC = MMC_REFSTRUCTLIT(Error__SYMBOLIC__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Error_MessageType_SIMULATION__desc_added -#define Error_MessageType_SIMULATION__desc_added -ADD_METARECORD_DEFINITIONS const char* Error_MessageType_SIMULATION__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Error_MessageType_SIMULATION__desc = { - "Error_MessageType_SIMULATION", - "Error.MessageType.SIMULATION", - Error_MessageType_SIMULATION__desc__fields +#ifndef Error_MessageType_TRANSLATION__desc_added +#define Error_MessageType_TRANSLATION__desc_added +ADD_METARECORD_DEFINITIONS const char* Error_MessageType_TRANSLATION__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Error_MessageType_TRANSLATION__desc = { + "Error_MessageType_TRANSLATION", + "Error.MessageType.TRANSLATION", + Error_MessageType_TRANSLATION__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Error_MessageType_SIMULATION__desc; +extern struct record_description Error_MessageType_TRANSLATION__desc; #endif -#define Error__SIMULATION_3dBOX0 7 -static const MMC_DEFSTRUCTLIT(Error__SIMULATION__struct,1,7) {&Error_MessageType_SIMULATION__desc}}; -static void *Error__SIMULATION = MMC_REFSTRUCTLIT(Error__SIMULATION__struct); +#define Error__TRANSLATION_3dBOX0 5 +static const MMC_DEFSTRUCTLIT(Error__TRANSLATION__struct,1,5) {&Error_MessageType_TRANSLATION__desc}}; +static void *Error__TRANSLATION = MMC_REFSTRUCTLIT(Error__TRANSLATION__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Error_MessageType_SCRIPTING__desc_added -#define Error_MessageType_SCRIPTING__desc_added -ADD_METARECORD_DEFINITIONS const char* Error_MessageType_SCRIPTING__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Error_MessageType_SCRIPTING__desc = { - "Error_MessageType_SCRIPTING", - "Error.MessageType.SCRIPTING", - Error_MessageType_SCRIPTING__desc__fields +#ifndef Error_MessageType_GRAMMAR__desc_added +#define Error_MessageType_GRAMMAR__desc_added +ADD_METARECORD_DEFINITIONS const char* Error_MessageType_GRAMMAR__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Error_MessageType_GRAMMAR__desc = { + "Error_MessageType_GRAMMAR", + "Error.MessageType.GRAMMAR", + Error_MessageType_GRAMMAR__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Error_MessageType_SCRIPTING__desc; +extern struct record_description Error_MessageType_GRAMMAR__desc; #endif -#define Error__SCRIPTING_3dBOX0 8 -static const MMC_DEFSTRUCTLIT(Error__SCRIPTING__struct,1,8) {&Error_MessageType_SCRIPTING__desc}}; -static void *Error__SCRIPTING = MMC_REFSTRUCTLIT(Error__SCRIPTING__struct); +#define Error__GRAMMAR_3dBOX0 4 +static const MMC_DEFSTRUCTLIT(Error__GRAMMAR__struct,1,4) {&Error_MessageType_GRAMMAR__desc}}; +static void *Error__GRAMMAR = MMC_REFSTRUCTLIT(Error__GRAMMAR__struct); +#ifdef ADD_METARECORD_DEFINITIONS +#ifndef Error_MessageType_SYNTAX__desc_added +#define Error_MessageType_SYNTAX__desc_added +ADD_METARECORD_DEFINITIONS const char* Error_MessageType_SYNTAX__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Error_MessageType_SYNTAX__desc = { + "Error_MessageType_SYNTAX", + "Error.MessageType.SYNTAX", + Error_MessageType_SYNTAX__desc__fields +}; +#endif +#else /* Only use the file as a header */ +extern struct record_description Error_MessageType_SYNTAX__desc; +#endif +#define Error__SYNTAX_3dBOX0 3 +static const MMC_DEFSTRUCTLIT(Error__SYNTAX__struct,1,3) {&Error_MessageType_SYNTAX__desc}}; +static void *Error__SYNTAX = MMC_REFSTRUCTLIT(Error__SYNTAX__struct); #ifdef ADD_METARECORD_DEFINITIONS #ifndef Error_Message_MESSAGE__desc_added #define Error_Message_MESSAGE__desc_added @@ -547,125 +547,127 @@ extern struct record_description Error_TotalMessage_TOTALMESSAGE__desc; #define Error__TOTALMESSAGE_3dBOX2 3 #define Error__TOTALMESSAGE(msg,info) (mmc_mk_box3(3,&Error_TotalMessage_TOTALMESSAGE__desc,msg,info)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Values_Value_INTEGER__desc_added -#define Values_Value_INTEGER__desc_added -ADD_METARECORD_DEFINITIONS const char* Values_Value_INTEGER__desc__fields[1] = {"integer"}; -ADD_METARECORD_DEFINITIONS struct record_description Values_Value_INTEGER__desc = { - "Values_Value_INTEGER", - "Values.Value.INTEGER", - Values_Value_INTEGER__desc__fields +#ifndef Values_Value_EMPTY__desc_added +#define Values_Value_EMPTY__desc_added +ADD_METARECORD_DEFINITIONS const char* Values_Value_EMPTY__desc__fields[4] = {"scope","name","ty","tyStr"}; +ADD_METARECORD_DEFINITIONS struct record_description Values_Value_EMPTY__desc = { + "Values_Value_EMPTY", + "Values.Value.EMPTY", + Values_Value_EMPTY__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Values_Value_INTEGER__desc; +extern struct record_description Values_Value_EMPTY__desc; #endif -#define Values__INTEGER_3dBOX1 3 -#define Values__INTEGER(integer) (mmc_mk_box2(3,&Values_Value_INTEGER__desc,integer)) +#define Values__EMPTY_3dBOX4 19 +#define Values__EMPTY(scope,name,ty,tyStr) (mmc_mk_box5(19,&Values_Value_EMPTY__desc,scope,name,ty,tyStr)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Values_Value_REAL__desc_added -#define Values_Value_REAL__desc_added -ADD_METARECORD_DEFINITIONS const char* Values_Value_REAL__desc__fields[1] = {"real"}; -ADD_METARECORD_DEFINITIONS struct record_description Values_Value_REAL__desc = { - "Values_Value_REAL", - "Values.Value.REAL", - Values_Value_REAL__desc__fields +#ifndef Values_Value_META__FAIL__desc_added +#define Values_Value_META__FAIL__desc_added +ADD_METARECORD_DEFINITIONS const char* Values_Value_META__FAIL__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Values_Value_META__FAIL__desc = { + "Values_Value_META__FAIL", + "Values.Value.META_FAIL", + Values_Value_META__FAIL__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Values_Value_REAL__desc; +extern struct record_description Values_Value_META__FAIL__desc; #endif -#define Values__REAL_3dBOX1 4 -#define Values__REAL(real) (mmc_mk_box2(4,&Values_Value_REAL__desc,real)) +#define Values__META_5fFAIL_3dBOX0 18 +static const MMC_DEFSTRUCTLIT(Values__META_5fFAIL__struct,1,18) {&Values_Value_META__FAIL__desc}}; +static void *Values__META_5fFAIL = MMC_REFSTRUCTLIT(Values__META_5fFAIL__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Values_Value_STRING__desc_added -#define Values_Value_STRING__desc_added -ADD_METARECORD_DEFINITIONS const char* Values_Value_STRING__desc__fields[1] = {"string"}; -ADD_METARECORD_DEFINITIONS struct record_description Values_Value_STRING__desc = { - "Values_Value_STRING", - "Values.Value.STRING", - Values_Value_STRING__desc__fields -}; -#endif -#else /* Only use the file as a header */ -extern struct record_description Values_Value_STRING__desc; +#ifndef Values_Value_META__BOX__desc_added +#define Values_Value_META__BOX__desc_added +ADD_METARECORD_DEFINITIONS const char* Values_Value_META__BOX__desc__fields[1] = {"value"}; +ADD_METARECORD_DEFINITIONS struct record_description Values_Value_META__BOX__desc = { + "Values_Value_META__BOX", + "Values.Value.META_BOX", + Values_Value_META__BOX__desc__fields +}; #endif -#define Values__STRING_3dBOX1 5 -#define Values__STRING(string) (mmc_mk_box2(5,&Values_Value_STRING__desc,string)) +#else /* Only use the file as a header */ +extern struct record_description Values_Value_META__BOX__desc; +#endif +#define Values__META_5fBOX_3dBOX1 17 +#define Values__META_5fBOX(value) (mmc_mk_box2(17,&Values_Value_META__BOX__desc,value)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Values_Value_BOOL__desc_added -#define Values_Value_BOOL__desc_added -ADD_METARECORD_DEFINITIONS const char* Values_Value_BOOL__desc__fields[1] = {"boolean"}; -ADD_METARECORD_DEFINITIONS struct record_description Values_Value_BOOL__desc = { - "Values_Value_BOOL", - "Values.Value.BOOL", - Values_Value_BOOL__desc__fields +#ifndef Values_Value_NORETCALL__desc_added +#define Values_Value_NORETCALL__desc_added +ADD_METARECORD_DEFINITIONS const char* Values_Value_NORETCALL__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Values_Value_NORETCALL__desc = { + "Values_Value_NORETCALL", + "Values.Value.NORETCALL", + Values_Value_NORETCALL__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Values_Value_BOOL__desc; +extern struct record_description Values_Value_NORETCALL__desc; #endif -#define Values__BOOL_3dBOX1 6 -#define Values__BOOL(boolean) (mmc_mk_box2(6,&Values_Value_BOOL__desc,boolean)) +#define Values__NORETCALL_3dBOX0 16 +static const MMC_DEFSTRUCTLIT(Values__NORETCALL__struct,1,16) {&Values_Value_NORETCALL__desc}}; +static void *Values__NORETCALL = MMC_REFSTRUCTLIT(Values__NORETCALL__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Values_Value_ENUM__LITERAL__desc_added -#define Values_Value_ENUM__LITERAL__desc_added -ADD_METARECORD_DEFINITIONS const char* Values_Value_ENUM__LITERAL__desc__fields[2] = {"name","index"}; -ADD_METARECORD_DEFINITIONS struct record_description Values_Value_ENUM__LITERAL__desc = { - "Values_Value_ENUM__LITERAL", - "Values.Value.ENUM_LITERAL", - Values_Value_ENUM__LITERAL__desc__fields +#ifndef Values_Value_CODE__desc_added +#define Values_Value_CODE__desc_added +ADD_METARECORD_DEFINITIONS const char* Values_Value_CODE__desc__fields[1] = {"A"}; +ADD_METARECORD_DEFINITIONS struct record_description Values_Value_CODE__desc = { + "Values_Value_CODE", + "Values.Value.CODE", + Values_Value_CODE__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Values_Value_ENUM__LITERAL__desc; +extern struct record_description Values_Value_CODE__desc; #endif -#define Values__ENUM_5fLITERAL_3dBOX2 7 -#define Values__ENUM_5fLITERAL(name,index) (mmc_mk_box3(7,&Values_Value_ENUM__LITERAL__desc,name,index)) +#define Values__CODE_3dBOX1 15 +#define Values__CODE(A) (mmc_mk_box2(15,&Values_Value_CODE__desc,A)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Values_Value_ARRAY__desc_added -#define Values_Value_ARRAY__desc_added -ADD_METARECORD_DEFINITIONS const char* Values_Value_ARRAY__desc__fields[2] = {"valueLst","dimLst"}; -ADD_METARECORD_DEFINITIONS struct record_description Values_Value_ARRAY__desc = { - "Values_Value_ARRAY", - "Values.Value.ARRAY", - Values_Value_ARRAY__desc__fields +#ifndef Values_Value_OPTION__desc_added +#define Values_Value_OPTION__desc_added +ADD_METARECORD_DEFINITIONS const char* Values_Value_OPTION__desc__fields[1] = {"some"}; +ADD_METARECORD_DEFINITIONS struct record_description Values_Value_OPTION__desc = { + "Values_Value_OPTION", + "Values.Value.OPTION", + Values_Value_OPTION__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Values_Value_ARRAY__desc; +extern struct record_description Values_Value_OPTION__desc; #endif -#define Values__ARRAY_3dBOX2 8 -#define Values__ARRAY(valueLst,dimLst) (mmc_mk_box3(8,&Values_Value_ARRAY__desc,valueLst,dimLst)) +#define Values__OPTION_3dBOX1 14 +#define Values__OPTION(some) (mmc_mk_box2(14,&Values_Value_OPTION__desc,some)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Values_Value_LIST__desc_added -#define Values_Value_LIST__desc_added -ADD_METARECORD_DEFINITIONS const char* Values_Value_LIST__desc__fields[1] = {"valueLst"}; -ADD_METARECORD_DEFINITIONS struct record_description Values_Value_LIST__desc = { - "Values_Value_LIST", - "Values.Value.LIST", - Values_Value_LIST__desc__fields +#ifndef Values_Value_RECORD__desc_added +#define Values_Value_RECORD__desc_added +ADD_METARECORD_DEFINITIONS const char* Values_Value_RECORD__desc__fields[4] = {"record_","orderd","comp","index"}; +ADD_METARECORD_DEFINITIONS struct record_description Values_Value_RECORD__desc = { + "Values_Value_RECORD", + "Values.Value.RECORD", + Values_Value_RECORD__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Values_Value_LIST__desc; +extern struct record_description Values_Value_RECORD__desc; #endif -#define Values__LIST_3dBOX1 9 -#define Values__LIST(valueLst) (mmc_mk_box2(9,&Values_Value_LIST__desc,valueLst)) +#define Values__RECORD_3dBOX4 13 +#define Values__RECORD(record_,orderd,comp,index) (mmc_mk_box5(13,&Values_Value_RECORD__desc,record_,orderd,comp,index)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Values_Value_META__ARRAY__desc_added -#define Values_Value_META__ARRAY__desc_added -ADD_METARECORD_DEFINITIONS const char* Values_Value_META__ARRAY__desc__fields[1] = {"valueLst"}; -ADD_METARECORD_DEFINITIONS struct record_description Values_Value_META__ARRAY__desc = { - "Values_Value_META__ARRAY", - "Values.Value.META_ARRAY", - Values_Value_META__ARRAY__desc__fields +#ifndef Values_Value_META__TUPLE__desc_added +#define Values_Value_META__TUPLE__desc_added +ADD_METARECORD_DEFINITIONS const char* Values_Value_META__TUPLE__desc__fields[1] = {"valueLst"}; +ADD_METARECORD_DEFINITIONS struct record_description Values_Value_META__TUPLE__desc = { + "Values_Value_META__TUPLE", + "Values.Value.META_TUPLE", + Values_Value_META__TUPLE__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Values_Value_META__ARRAY__desc; +extern struct record_description Values_Value_META__TUPLE__desc; #endif -#define Values__META_5fARRAY_3dBOX1 10 -#define Values__META_5fARRAY(valueLst) (mmc_mk_box2(10,&Values_Value_META__ARRAY__desc,valueLst)) +#define Values__META_5fTUPLE_3dBOX1 12 +#define Values__META_5fTUPLE(valueLst) (mmc_mk_box2(12,&Values_Value_META__TUPLE__desc,valueLst)) #ifdef ADD_METARECORD_DEFINITIONS #ifndef Values_Value_TUPLE__desc_added #define Values_Value_TUPLE__desc_added @@ -682,175 +684,157 @@ extern struct record_description Values_Value_TUPLE__desc; #define Values__TUPLE_3dBOX1 11 #define Values__TUPLE(valueLst) (mmc_mk_box2(11,&Values_Value_TUPLE__desc,valueLst)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Values_Value_META__TUPLE__desc_added -#define Values_Value_META__TUPLE__desc_added -ADD_METARECORD_DEFINITIONS const char* Values_Value_META__TUPLE__desc__fields[1] = {"valueLst"}; -ADD_METARECORD_DEFINITIONS struct record_description Values_Value_META__TUPLE__desc = { - "Values_Value_META__TUPLE", - "Values.Value.META_TUPLE", - Values_Value_META__TUPLE__desc__fields +#ifndef Values_Value_META__ARRAY__desc_added +#define Values_Value_META__ARRAY__desc_added +ADD_METARECORD_DEFINITIONS const char* Values_Value_META__ARRAY__desc__fields[1] = {"valueLst"}; +ADD_METARECORD_DEFINITIONS struct record_description Values_Value_META__ARRAY__desc = { + "Values_Value_META__ARRAY", + "Values.Value.META_ARRAY", + Values_Value_META__ARRAY__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Values_Value_META__TUPLE__desc; +extern struct record_description Values_Value_META__ARRAY__desc; #endif -#define Values__META_5fTUPLE_3dBOX1 12 -#define Values__META_5fTUPLE(valueLst) (mmc_mk_box2(12,&Values_Value_META__TUPLE__desc,valueLst)) +#define Values__META_5fARRAY_3dBOX1 10 +#define Values__META_5fARRAY(valueLst) (mmc_mk_box2(10,&Values_Value_META__ARRAY__desc,valueLst)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Values_Value_RECORD__desc_added -#define Values_Value_RECORD__desc_added -ADD_METARECORD_DEFINITIONS const char* Values_Value_RECORD__desc__fields[4] = {"record_","orderd","comp","index"}; -ADD_METARECORD_DEFINITIONS struct record_description Values_Value_RECORD__desc = { - "Values_Value_RECORD", - "Values.Value.RECORD", - Values_Value_RECORD__desc__fields +#ifndef Values_Value_LIST__desc_added +#define Values_Value_LIST__desc_added +ADD_METARECORD_DEFINITIONS const char* Values_Value_LIST__desc__fields[1] = {"valueLst"}; +ADD_METARECORD_DEFINITIONS struct record_description Values_Value_LIST__desc = { + "Values_Value_LIST", + "Values.Value.LIST", + Values_Value_LIST__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Values_Value_RECORD__desc; +extern struct record_description Values_Value_LIST__desc; #endif -#define Values__RECORD_3dBOX4 13 -#define Values__RECORD(record_,orderd,comp,index) (mmc_mk_box5(13,&Values_Value_RECORD__desc,record_,orderd,comp,index)) +#define Values__LIST_3dBOX1 9 +#define Values__LIST(valueLst) (mmc_mk_box2(9,&Values_Value_LIST__desc,valueLst)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Values_Value_OPTION__desc_added -#define Values_Value_OPTION__desc_added -ADD_METARECORD_DEFINITIONS const char* Values_Value_OPTION__desc__fields[1] = {"some"}; -ADD_METARECORD_DEFINITIONS struct record_description Values_Value_OPTION__desc = { - "Values_Value_OPTION", - "Values.Value.OPTION", - Values_Value_OPTION__desc__fields +#ifndef Values_Value_ARRAY__desc_added +#define Values_Value_ARRAY__desc_added +ADD_METARECORD_DEFINITIONS const char* Values_Value_ARRAY__desc__fields[2] = {"valueLst","dimLst"}; +ADD_METARECORD_DEFINITIONS struct record_description Values_Value_ARRAY__desc = { + "Values_Value_ARRAY", + "Values.Value.ARRAY", + Values_Value_ARRAY__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Values_Value_OPTION__desc; +extern struct record_description Values_Value_ARRAY__desc; #endif -#define Values__OPTION_3dBOX1 14 -#define Values__OPTION(some) (mmc_mk_box2(14,&Values_Value_OPTION__desc,some)) +#define Values__ARRAY_3dBOX2 8 +#define Values__ARRAY(valueLst,dimLst) (mmc_mk_box3(8,&Values_Value_ARRAY__desc,valueLst,dimLst)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Values_Value_CODE__desc_added -#define Values_Value_CODE__desc_added -ADD_METARECORD_DEFINITIONS const char* Values_Value_CODE__desc__fields[1] = {"A"}; -ADD_METARECORD_DEFINITIONS struct record_description Values_Value_CODE__desc = { - "Values_Value_CODE", - "Values.Value.CODE", - Values_Value_CODE__desc__fields +#ifndef Values_Value_ENUM__LITERAL__desc_added +#define Values_Value_ENUM__LITERAL__desc_added +ADD_METARECORD_DEFINITIONS const char* Values_Value_ENUM__LITERAL__desc__fields[2] = {"name","index"}; +ADD_METARECORD_DEFINITIONS struct record_description Values_Value_ENUM__LITERAL__desc = { + "Values_Value_ENUM__LITERAL", + "Values.Value.ENUM_LITERAL", + Values_Value_ENUM__LITERAL__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Values_Value_CODE__desc; +extern struct record_description Values_Value_ENUM__LITERAL__desc; #endif -#define Values__CODE_3dBOX1 15 -#define Values__CODE(A) (mmc_mk_box2(15,&Values_Value_CODE__desc,A)) +#define Values__ENUM_5fLITERAL_3dBOX2 7 +#define Values__ENUM_5fLITERAL(name,index) (mmc_mk_box3(7,&Values_Value_ENUM__LITERAL__desc,name,index)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Values_Value_NORETCALL__desc_added -#define Values_Value_NORETCALL__desc_added -ADD_METARECORD_DEFINITIONS const char* Values_Value_NORETCALL__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Values_Value_NORETCALL__desc = { - "Values_Value_NORETCALL", - "Values.Value.NORETCALL", - Values_Value_NORETCALL__desc__fields +#ifndef Values_Value_BOOL__desc_added +#define Values_Value_BOOL__desc_added +ADD_METARECORD_DEFINITIONS const char* Values_Value_BOOL__desc__fields[1] = {"boolean"}; +ADD_METARECORD_DEFINITIONS struct record_description Values_Value_BOOL__desc = { + "Values_Value_BOOL", + "Values.Value.BOOL", + Values_Value_BOOL__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Values_Value_NORETCALL__desc; +extern struct record_description Values_Value_BOOL__desc; #endif -#define Values__NORETCALL_3dBOX0 16 -static const MMC_DEFSTRUCTLIT(Values__NORETCALL__struct,1,16) {&Values_Value_NORETCALL__desc}}; -static void *Values__NORETCALL = MMC_REFSTRUCTLIT(Values__NORETCALL__struct); +#define Values__BOOL_3dBOX1 6 +#define Values__BOOL(boolean) (mmc_mk_box2(6,&Values_Value_BOOL__desc,boolean)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Values_Value_META__BOX__desc_added -#define Values_Value_META__BOX__desc_added -ADD_METARECORD_DEFINITIONS const char* Values_Value_META__BOX__desc__fields[1] = {"value"}; -ADD_METARECORD_DEFINITIONS struct record_description Values_Value_META__BOX__desc = { - "Values_Value_META__BOX", - "Values.Value.META_BOX", - Values_Value_META__BOX__desc__fields +#ifndef Values_Value_STRING__desc_added +#define Values_Value_STRING__desc_added +ADD_METARECORD_DEFINITIONS const char* Values_Value_STRING__desc__fields[1] = {"string"}; +ADD_METARECORD_DEFINITIONS struct record_description Values_Value_STRING__desc = { + "Values_Value_STRING", + "Values.Value.STRING", + Values_Value_STRING__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Values_Value_META__BOX__desc; +extern struct record_description Values_Value_STRING__desc; #endif -#define Values__META_5fBOX_3dBOX1 17 -#define Values__META_5fBOX(value) (mmc_mk_box2(17,&Values_Value_META__BOX__desc,value)) +#define Values__STRING_3dBOX1 5 +#define Values__STRING(string) (mmc_mk_box2(5,&Values_Value_STRING__desc,string)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Values_Value_META__FAIL__desc_added -#define Values_Value_META__FAIL__desc_added -ADD_METARECORD_DEFINITIONS const char* Values_Value_META__FAIL__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Values_Value_META__FAIL__desc = { - "Values_Value_META__FAIL", - "Values.Value.META_FAIL", - Values_Value_META__FAIL__desc__fields +#ifndef Values_Value_REAL__desc_added +#define Values_Value_REAL__desc_added +ADD_METARECORD_DEFINITIONS const char* Values_Value_REAL__desc__fields[1] = {"real"}; +ADD_METARECORD_DEFINITIONS struct record_description Values_Value_REAL__desc = { + "Values_Value_REAL", + "Values.Value.REAL", + Values_Value_REAL__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Values_Value_META__FAIL__desc; +extern struct record_description Values_Value_REAL__desc; #endif -#define Values__META_5fFAIL_3dBOX0 18 -static const MMC_DEFSTRUCTLIT(Values__META_5fFAIL__struct,1,18) {&Values_Value_META__FAIL__desc}}; -static void *Values__META_5fFAIL = MMC_REFSTRUCTLIT(Values__META_5fFAIL__struct); -#ifdef ADD_METARECORD_DEFINITIONS -#ifndef Values_Value_EMPTY__desc_added -#define Values_Value_EMPTY__desc_added -ADD_METARECORD_DEFINITIONS const char* Values_Value_EMPTY__desc__fields[4] = {"scope","name","ty","tyStr"}; -ADD_METARECORD_DEFINITIONS struct record_description Values_Value_EMPTY__desc = { - "Values_Value_EMPTY", - "Values.Value.EMPTY", - Values_Value_EMPTY__desc__fields -}; -#endif -#else /* Only use the file as a header */ -extern struct record_description Values_Value_EMPTY__desc; -#endif -#define Values__EMPTY_3dBOX4 19 -#define Values__EMPTY(scope,name,ty,tyStr) (mmc_mk_box5(19,&Values_Value_EMPTY__desc,scope,name,ty,tyStr)) +#define Values__REAL_3dBOX1 4 +#define Values__REAL(real) (mmc_mk_box2(4,&Values_Value_REAL__desc,real)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Values_IntRealOp_MULOP__desc_added -#define Values_IntRealOp_MULOP__desc_added -ADD_METARECORD_DEFINITIONS const char* Values_IntRealOp_MULOP__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Values_IntRealOp_MULOP__desc = { - "Values_IntRealOp_MULOP", - "Values.IntRealOp.MULOP", - Values_IntRealOp_MULOP__desc__fields +#ifndef Values_Value_INTEGER__desc_added +#define Values_Value_INTEGER__desc_added +ADD_METARECORD_DEFINITIONS const char* Values_Value_INTEGER__desc__fields[1] = {"integer"}; +ADD_METARECORD_DEFINITIONS struct record_description Values_Value_INTEGER__desc = { + "Values_Value_INTEGER", + "Values.Value.INTEGER", + Values_Value_INTEGER__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Values_IntRealOp_MULOP__desc; +extern struct record_description Values_Value_INTEGER__desc; #endif -#define Values__MULOP_3dBOX0 3 -static const MMC_DEFSTRUCTLIT(Values__MULOP__struct,1,3) {&Values_IntRealOp_MULOP__desc}}; -static void *Values__MULOP = MMC_REFSTRUCTLIT(Values__MULOP__struct); +#define Values__INTEGER_3dBOX1 3 +#define Values__INTEGER(integer) (mmc_mk_box2(3,&Values_Value_INTEGER__desc,integer)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Values_IntRealOp_DIVOP__desc_added -#define Values_IntRealOp_DIVOP__desc_added -ADD_METARECORD_DEFINITIONS const char* Values_IntRealOp_DIVOP__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Values_IntRealOp_DIVOP__desc = { - "Values_IntRealOp_DIVOP", - "Values.IntRealOp.DIVOP", - Values_IntRealOp_DIVOP__desc__fields +#ifndef Values_IntRealOp_LESSEQOP__desc_added +#define Values_IntRealOp_LESSEQOP__desc_added +ADD_METARECORD_DEFINITIONS const char* Values_IntRealOp_LESSEQOP__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Values_IntRealOp_LESSEQOP__desc = { + "Values_IntRealOp_LESSEQOP", + "Values.IntRealOp.LESSEQOP", + Values_IntRealOp_LESSEQOP__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Values_IntRealOp_DIVOP__desc; +extern struct record_description Values_IntRealOp_LESSEQOP__desc; #endif -#define Values__DIVOP_3dBOX0 4 -static const MMC_DEFSTRUCTLIT(Values__DIVOP__struct,1,4) {&Values_IntRealOp_DIVOP__desc}}; -static void *Values__DIVOP = MMC_REFSTRUCTLIT(Values__DIVOP__struct); +#define Values__LESSEQOP_3dBOX0 8 +static const MMC_DEFSTRUCTLIT(Values__LESSEQOP__struct,1,8) {&Values_IntRealOp_LESSEQOP__desc}}; +static void *Values__LESSEQOP = MMC_REFSTRUCTLIT(Values__LESSEQOP__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Values_IntRealOp_ADDOP__desc_added -#define Values_IntRealOp_ADDOP__desc_added -ADD_METARECORD_DEFINITIONS const char* Values_IntRealOp_ADDOP__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Values_IntRealOp_ADDOP__desc = { - "Values_IntRealOp_ADDOP", - "Values.IntRealOp.ADDOP", - Values_IntRealOp_ADDOP__desc__fields +#ifndef Values_IntRealOp_POWOP__desc_added +#define Values_IntRealOp_POWOP__desc_added +ADD_METARECORD_DEFINITIONS const char* Values_IntRealOp_POWOP__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Values_IntRealOp_POWOP__desc = { + "Values_IntRealOp_POWOP", + "Values.IntRealOp.POWOP", + Values_IntRealOp_POWOP__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Values_IntRealOp_ADDOP__desc; +extern struct record_description Values_IntRealOp_POWOP__desc; #endif -#define Values__ADDOP_3dBOX0 5 -static const MMC_DEFSTRUCTLIT(Values__ADDOP__struct,1,5) {&Values_IntRealOp_ADDOP__desc}}; -static void *Values__ADDOP = MMC_REFSTRUCTLIT(Values__ADDOP__struct); +#define Values__POWOP_3dBOX0 7 +static const MMC_DEFSTRUCTLIT(Values__POWOP__struct,1,7) {&Values_IntRealOp_POWOP__desc}}; +static void *Values__POWOP = MMC_REFSTRUCTLIT(Values__POWOP__struct); #ifdef ADD_METARECORD_DEFINITIONS #ifndef Values_IntRealOp_SUBOP__desc_added #define Values_IntRealOp_SUBOP__desc_added @@ -868,37 +852,53 @@ extern struct record_description Values_IntRealOp_SUBOP__desc; static const MMC_DEFSTRUCTLIT(Values__SUBOP__struct,1,6) {&Values_IntRealOp_SUBOP__desc}}; static void *Values__SUBOP = MMC_REFSTRUCTLIT(Values__SUBOP__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Values_IntRealOp_POWOP__desc_added -#define Values_IntRealOp_POWOP__desc_added -ADD_METARECORD_DEFINITIONS const char* Values_IntRealOp_POWOP__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Values_IntRealOp_POWOP__desc = { - "Values_IntRealOp_POWOP", - "Values.IntRealOp.POWOP", - Values_IntRealOp_POWOP__desc__fields +#ifndef Values_IntRealOp_ADDOP__desc_added +#define Values_IntRealOp_ADDOP__desc_added +ADD_METARECORD_DEFINITIONS const char* Values_IntRealOp_ADDOP__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Values_IntRealOp_ADDOP__desc = { + "Values_IntRealOp_ADDOP", + "Values.IntRealOp.ADDOP", + Values_IntRealOp_ADDOP__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Values_IntRealOp_POWOP__desc; +extern struct record_description Values_IntRealOp_ADDOP__desc; #endif -#define Values__POWOP_3dBOX0 7 -static const MMC_DEFSTRUCTLIT(Values__POWOP__struct,1,7) {&Values_IntRealOp_POWOP__desc}}; -static void *Values__POWOP = MMC_REFSTRUCTLIT(Values__POWOP__struct); +#define Values__ADDOP_3dBOX0 5 +static const MMC_DEFSTRUCTLIT(Values__ADDOP__struct,1,5) {&Values_IntRealOp_ADDOP__desc}}; +static void *Values__ADDOP = MMC_REFSTRUCTLIT(Values__ADDOP__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Values_IntRealOp_LESSEQOP__desc_added -#define Values_IntRealOp_LESSEQOP__desc_added -ADD_METARECORD_DEFINITIONS const char* Values_IntRealOp_LESSEQOP__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Values_IntRealOp_LESSEQOP__desc = { - "Values_IntRealOp_LESSEQOP", - "Values.IntRealOp.LESSEQOP", - Values_IntRealOp_LESSEQOP__desc__fields +#ifndef Values_IntRealOp_DIVOP__desc_added +#define Values_IntRealOp_DIVOP__desc_added +ADD_METARECORD_DEFINITIONS const char* Values_IntRealOp_DIVOP__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Values_IntRealOp_DIVOP__desc = { + "Values_IntRealOp_DIVOP", + "Values.IntRealOp.DIVOP", + Values_IntRealOp_DIVOP__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Values_IntRealOp_LESSEQOP__desc; +extern struct record_description Values_IntRealOp_DIVOP__desc; #endif -#define Values__LESSEQOP_3dBOX0 8 -static const MMC_DEFSTRUCTLIT(Values__LESSEQOP__struct,1,8) {&Values_IntRealOp_LESSEQOP__desc}}; -static void *Values__LESSEQOP = MMC_REFSTRUCTLIT(Values__LESSEQOP__struct); +#define Values__DIVOP_3dBOX0 4 +static const MMC_DEFSTRUCTLIT(Values__DIVOP__struct,1,4) {&Values_IntRealOp_DIVOP__desc}}; +static void *Values__DIVOP = MMC_REFSTRUCTLIT(Values__DIVOP__struct); +#ifdef ADD_METARECORD_DEFINITIONS +#ifndef Values_IntRealOp_MULOP__desc_added +#define Values_IntRealOp_MULOP__desc_added +ADD_METARECORD_DEFINITIONS const char* Values_IntRealOp_MULOP__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Values_IntRealOp_MULOP__desc = { + "Values_IntRealOp_MULOP", + "Values.IntRealOp.MULOP", + Values_IntRealOp_MULOP__desc__fields +}; +#endif +#else /* Only use the file as a header */ +extern struct record_description Values_IntRealOp_MULOP__desc; +#endif +#define Values__MULOP_3dBOX0 3 +static const MMC_DEFSTRUCTLIT(Values__MULOP__struct,1,3) {&Values_IntRealOp_MULOP__desc}}; +static void *Values__MULOP = MMC_REFSTRUCTLIT(Values__MULOP__struct); #ifdef ADD_METARECORD_DEFINITIONS #ifndef GlobalScript_SimulationOptions_SIMULATION__OPTIONS__desc_added #define GlobalScript_SimulationOptions_SIMULATION__OPTIONS__desc_added @@ -930,21 +930,6 @@ extern struct record_description GlobalScript_CompiledCFunction_CFunction__desc; #define GlobalScript__CFunction_3dBOX5 3 #define GlobalScript__CFunction(path,retType,funcHandle,buildTime,loadedFromFile) (mmc_mk_box6(3,&GlobalScript_CompiledCFunction_CFunction__desc,path,retType,funcHandle,buildTime,loadedFromFile)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef GlobalScript_Statement_IALG__desc_added -#define GlobalScript_Statement_IALG__desc_added -ADD_METARECORD_DEFINITIONS const char* GlobalScript_Statement_IALG__desc__fields[1] = {"algItem"}; -ADD_METARECORD_DEFINITIONS struct record_description GlobalScript_Statement_IALG__desc = { - "GlobalScript_Statement_IALG", - "GlobalScript.Statement.IALG", - GlobalScript_Statement_IALG__desc__fields -}; -#endif -#else /* Only use the file as a header */ -extern struct record_description GlobalScript_Statement_IALG__desc; -#endif -#define GlobalScript__IALG_3dBOX1 3 -#define GlobalScript__IALG(algItem) (mmc_mk_box2(3,&GlobalScript_Statement_IALG__desc,algItem)) -#ifdef ADD_METARECORD_DEFINITIONS #ifndef GlobalScript_Statement_IEXP__desc_added #define GlobalScript_Statement_IEXP__desc_added ADD_METARECORD_DEFINITIONS const char* GlobalScript_Statement_IEXP__desc__fields[2] = {"exp","info"}; @@ -960,6 +945,21 @@ extern struct record_description GlobalScript_Statement_IEXP__desc; #define GlobalScript__IEXP_3dBOX2 4 #define GlobalScript__IEXP(exp,info) (mmc_mk_box3(4,&GlobalScript_Statement_IEXP__desc,exp,info)) #ifdef ADD_METARECORD_DEFINITIONS +#ifndef GlobalScript_Statement_IALG__desc_added +#define GlobalScript_Statement_IALG__desc_added +ADD_METARECORD_DEFINITIONS const char* GlobalScript_Statement_IALG__desc__fields[1] = {"algItem"}; +ADD_METARECORD_DEFINITIONS struct record_description GlobalScript_Statement_IALG__desc = { + "GlobalScript_Statement_IALG", + "GlobalScript.Statement.IALG", + GlobalScript_Statement_IALG__desc__fields +}; +#endif +#else /* Only use the file as a header */ +extern struct record_description GlobalScript_Statement_IALG__desc; +#endif +#define GlobalScript__IALG_3dBOX1 3 +#define GlobalScript__IALG(algItem) (mmc_mk_box2(3,&GlobalScript_Statement_IALG__desc,algItem)) +#ifdef ADD_METARECORD_DEFINITIONS #ifndef GlobalScript_Statements_ISTMTS__desc_added #define GlobalScript_Statements_ISTMTS__desc_added ADD_METARECORD_DEFINITIONS const char* GlobalScript_Statements_ISTMTS__desc__fields[2] = {"interactiveStmtLst","semicolon"}; @@ -1035,21 +1035,6 @@ extern struct record_description GlobalScript_SymbolTable_SYMBOLTABLE__desc; #define GlobalScript__SYMBOLTABLE_3dBOX6 3 #define GlobalScript__SYMBOLTABLE(ast,explodedAst,instClsLst,lstVarVal,compiledFunctions,loadedFiles) (mmc_mk_box7(3,&GlobalScript_SymbolTable_SYMBOLTABLE__desc,ast,explodedAst,instClsLst,lstVarVal,compiledFunctions,loadedFiles)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef GlobalScript_Component_COMPONENTITEM__desc_added -#define GlobalScript_Component_COMPONENTITEM__desc_added -ADD_METARECORD_DEFINITIONS const char* GlobalScript_Component_COMPONENTITEM__desc__fields[3] = {"the1","the2","the3"}; -ADD_METARECORD_DEFINITIONS struct record_description GlobalScript_Component_COMPONENTITEM__desc = { - "GlobalScript_Component_COMPONENTITEM", - "GlobalScript.Component.COMPONENTITEM", - GlobalScript_Component_COMPONENTITEM__desc__fields -}; -#endif -#else /* Only use the file as a header */ -extern struct record_description GlobalScript_Component_COMPONENTITEM__desc; -#endif -#define GlobalScript__COMPONENTITEM_3dBOX3 3 -#define GlobalScript__COMPONENTITEM(the1,the2,the3) (mmc_mk_box4(3,&GlobalScript_Component_COMPONENTITEM__desc,the1,the2,the3)) -#ifdef ADD_METARECORD_DEFINITIONS #ifndef GlobalScript_Component_EXTENDSITEM__desc_added #define GlobalScript_Component_EXTENDSITEM__desc_added ADD_METARECORD_DEFINITIONS const char* GlobalScript_Component_EXTENDSITEM__desc__fields[2] = {"the1","the2"}; @@ -1065,6 +1050,21 @@ extern struct record_description GlobalScript_Component_EXTENDSITEM__desc; #define GlobalScript__EXTENDSITEM_3dBOX2 4 #define GlobalScript__EXTENDSITEM(the1,the2) (mmc_mk_box3(4,&GlobalScript_Component_EXTENDSITEM__desc,the1,the2)) #ifdef ADD_METARECORD_DEFINITIONS +#ifndef GlobalScript_Component_COMPONENTITEM__desc_added +#define GlobalScript_Component_COMPONENTITEM__desc_added +ADD_METARECORD_DEFINITIONS const char* GlobalScript_Component_COMPONENTITEM__desc__fields[3] = {"the1","the2","the3"}; +ADD_METARECORD_DEFINITIONS struct record_description GlobalScript_Component_COMPONENTITEM__desc = { + "GlobalScript_Component_COMPONENTITEM", + "GlobalScript.Component.COMPONENTITEM", + GlobalScript_Component_COMPONENTITEM__desc__fields +}; +#endif +#else /* Only use the file as a header */ +extern struct record_description GlobalScript_Component_COMPONENTITEM__desc; +#endif +#define GlobalScript__COMPONENTITEM_3dBOX3 3 +#define GlobalScript__COMPONENTITEM(the1,the2,the3) (mmc_mk_box4(3,&GlobalScript_Component_COMPONENTITEM__desc,the1,the2,the3)) +#ifdef ADD_METARECORD_DEFINITIONS #ifndef GlobalScript_Components_COMPONENTS__desc_added #define GlobalScript_Components_COMPONENTS__desc_added ADD_METARECORD_DEFINITIONS const char* GlobalScript_Components_COMPONENTS__desc__fields[2] = {"componentLst","the"}; @@ -1140,21 +1140,6 @@ extern struct record_description Absyn_Program_PROGRAM__desc; #define Absyn__PROGRAM_3dBOX2 3 #define Absyn__PROGRAM(classes,within_) (mmc_mk_box3(3,&Absyn_Program_PROGRAM__desc,classes,within_)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Within_WITHIN__desc_added -#define Absyn_Within_WITHIN__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Within_WITHIN__desc__fields[1] = {"path"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Within_WITHIN__desc = { - "Absyn_Within_WITHIN", - "Absyn.Within.WITHIN", - Absyn_Within_WITHIN__desc__fields -}; -#endif -#else /* Only use the file as a header */ -extern struct record_description Absyn_Within_WITHIN__desc; -#endif -#define Absyn__WITHIN_3dBOX1 3 -#define Absyn__WITHIN(path) (mmc_mk_box2(3,&Absyn_Within_WITHIN__desc,path)) -#ifdef ADD_METARECORD_DEFINITIONS #ifndef Absyn_Within_TOP__desc_added #define Absyn_Within_TOP__desc_added ADD_METARECORD_DEFINITIONS const char* Absyn_Within_TOP__desc__fields[1] = {"no fields"}; @@ -1171,6 +1156,21 @@ extern struct record_description Absyn_Within_TOP__desc; static const MMC_DEFSTRUCTLIT(Absyn__TOP__struct,1,4) {&Absyn_Within_TOP__desc}}; static void *Absyn__TOP = MMC_REFSTRUCTLIT(Absyn__TOP__struct); #ifdef ADD_METARECORD_DEFINITIONS +#ifndef Absyn_Within_WITHIN__desc_added +#define Absyn_Within_WITHIN__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Within_WITHIN__desc__fields[1] = {"path"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Within_WITHIN__desc = { + "Absyn_Within_WITHIN", + "Absyn.Within.WITHIN", + Absyn_Within_WITHIN__desc__fields +}; +#endif +#else /* Only use the file as a header */ +extern struct record_description Absyn_Within_WITHIN__desc; +#endif +#define Absyn__WITHIN_3dBOX1 3 +#define Absyn__WITHIN(path) (mmc_mk_box2(3,&Absyn_Within_WITHIN__desc,path)) +#ifdef ADD_METARECORD_DEFINITIONS #ifndef Absyn_Class_CLASS__desc_added #define Absyn_Class_CLASS__desc_added ADD_METARECORD_DEFINITIONS const char* Absyn_Class_CLASS__desc__fields[7] = {"name","partialPrefix","finalPrefix","encapsulatedPrefix","restriction","body","info"}; @@ -1186,50 +1186,35 @@ extern struct record_description Absyn_Class_CLASS__desc; #define Absyn__CLASS_3dBOX7 3 #define Absyn__CLASS(name,partialPrefix,finalPrefix,encapsulatedPrefix,restriction,body,info) (mmc_mk_box8(3,&Absyn_Class_CLASS__desc,name,partialPrefix,finalPrefix,encapsulatedPrefix,restriction,body,info)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_ClassDef_PARTS__desc_added -#define Absyn_ClassDef_PARTS__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_ClassDef_PARTS__desc__fields[5] = {"typeVars","classAttrs","classParts","ann","comment"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_ClassDef_PARTS__desc = { - "Absyn_ClassDef_PARTS", - "Absyn.ClassDef.PARTS", - Absyn_ClassDef_PARTS__desc__fields +#ifndef Absyn_ClassDef_PDER__desc_added +#define Absyn_ClassDef_PDER__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_ClassDef_PDER__desc__fields[3] = {"functionName","vars","comment"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_ClassDef_PDER__desc = { + "Absyn_ClassDef_PDER", + "Absyn.ClassDef.PDER", + Absyn_ClassDef_PDER__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_ClassDef_PARTS__desc; +extern struct record_description Absyn_ClassDef_PDER__desc; #endif -#define Absyn__PARTS_3dBOX5 3 -#define Absyn__PARTS(typeVars,classAttrs,classParts,ann,comment) (mmc_mk_box6(3,&Absyn_ClassDef_PARTS__desc,typeVars,classAttrs,classParts,ann,comment)) +#define Absyn__PDER_3dBOX3 8 +#define Absyn__PDER(functionName,vars,comment) (mmc_mk_box4(8,&Absyn_ClassDef_PDER__desc,functionName,vars,comment)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_ClassDef_DERIVED__desc_added -#define Absyn_ClassDef_DERIVED__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_ClassDef_DERIVED__desc__fields[4] = {"typeSpec","attributes","arguments","comment"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_ClassDef_DERIVED__desc = { - "Absyn_ClassDef_DERIVED", - "Absyn.ClassDef.DERIVED", - Absyn_ClassDef_DERIVED__desc__fields -}; -#endif -#else /* Only use the file as a header */ -extern struct record_description Absyn_ClassDef_DERIVED__desc; -#endif -#define Absyn__DERIVED_3dBOX4 4 -#define Absyn__DERIVED(typeSpec,attributes,arguments,comment) (mmc_mk_box5(4,&Absyn_ClassDef_DERIVED__desc,typeSpec,attributes,arguments,comment)) -#ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_ClassDef_ENUMERATION__desc_added -#define Absyn_ClassDef_ENUMERATION__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_ClassDef_ENUMERATION__desc__fields[2] = {"enumLiterals","comment"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_ClassDef_ENUMERATION__desc = { - "Absyn_ClassDef_ENUMERATION", - "Absyn.ClassDef.ENUMERATION", - Absyn_ClassDef_ENUMERATION__desc__fields +#ifndef Absyn_ClassDef_CLASS__EXTENDS__desc_added +#define Absyn_ClassDef_CLASS__EXTENDS__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_ClassDef_CLASS__EXTENDS__desc__fields[5] = {"baseClassName","modifications","comment","parts","ann"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_ClassDef_CLASS__EXTENDS__desc = { + "Absyn_ClassDef_CLASS__EXTENDS", + "Absyn.ClassDef.CLASS_EXTENDS", + Absyn_ClassDef_CLASS__EXTENDS__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_ClassDef_ENUMERATION__desc; +extern struct record_description Absyn_ClassDef_CLASS__EXTENDS__desc; #endif -#define Absyn__ENUMERATION_3dBOX2 5 -#define Absyn__ENUMERATION(enumLiterals,comment) (mmc_mk_box3(5,&Absyn_ClassDef_ENUMERATION__desc,enumLiterals,comment)) +#define Absyn__CLASS_5fEXTENDS_3dBOX5 7 +#define Absyn__CLASS_5fEXTENDS(baseClassName,modifications,comment,parts,ann) (mmc_mk_box6(7,&Absyn_ClassDef_CLASS__EXTENDS__desc,baseClassName,modifications,comment,parts,ann)) #ifdef ADD_METARECORD_DEFINITIONS #ifndef Absyn_ClassDef_OVERLOAD__desc_added #define Absyn_ClassDef_OVERLOAD__desc_added @@ -1246,50 +1231,50 @@ extern struct record_description Absyn_ClassDef_OVERLOAD__desc; #define Absyn__OVERLOAD_3dBOX2 6 #define Absyn__OVERLOAD(functionNames,comment) (mmc_mk_box3(6,&Absyn_ClassDef_OVERLOAD__desc,functionNames,comment)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_ClassDef_CLASS__EXTENDS__desc_added -#define Absyn_ClassDef_CLASS__EXTENDS__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_ClassDef_CLASS__EXTENDS__desc__fields[5] = {"baseClassName","modifications","comment","parts","ann"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_ClassDef_CLASS__EXTENDS__desc = { - "Absyn_ClassDef_CLASS__EXTENDS", - "Absyn.ClassDef.CLASS_EXTENDS", - Absyn_ClassDef_CLASS__EXTENDS__desc__fields +#ifndef Absyn_ClassDef_ENUMERATION__desc_added +#define Absyn_ClassDef_ENUMERATION__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_ClassDef_ENUMERATION__desc__fields[2] = {"enumLiterals","comment"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_ClassDef_ENUMERATION__desc = { + "Absyn_ClassDef_ENUMERATION", + "Absyn.ClassDef.ENUMERATION", + Absyn_ClassDef_ENUMERATION__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_ClassDef_CLASS__EXTENDS__desc; +extern struct record_description Absyn_ClassDef_ENUMERATION__desc; #endif -#define Absyn__CLASS_5fEXTENDS_3dBOX5 7 -#define Absyn__CLASS_5fEXTENDS(baseClassName,modifications,comment,parts,ann) (mmc_mk_box6(7,&Absyn_ClassDef_CLASS__EXTENDS__desc,baseClassName,modifications,comment,parts,ann)) +#define Absyn__ENUMERATION_3dBOX2 5 +#define Absyn__ENUMERATION(enumLiterals,comment) (mmc_mk_box3(5,&Absyn_ClassDef_ENUMERATION__desc,enumLiterals,comment)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_ClassDef_PDER__desc_added -#define Absyn_ClassDef_PDER__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_ClassDef_PDER__desc__fields[3] = {"functionName","vars","comment"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_ClassDef_PDER__desc = { - "Absyn_ClassDef_PDER", - "Absyn.ClassDef.PDER", - Absyn_ClassDef_PDER__desc__fields +#ifndef Absyn_ClassDef_DERIVED__desc_added +#define Absyn_ClassDef_DERIVED__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_ClassDef_DERIVED__desc__fields[4] = {"typeSpec","attributes","arguments","comment"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_ClassDef_DERIVED__desc = { + "Absyn_ClassDef_DERIVED", + "Absyn.ClassDef.DERIVED", + Absyn_ClassDef_DERIVED__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_ClassDef_PDER__desc; +extern struct record_description Absyn_ClassDef_DERIVED__desc; #endif -#define Absyn__PDER_3dBOX3 8 -#define Absyn__PDER(functionName,vars,comment) (mmc_mk_box4(8,&Absyn_ClassDef_PDER__desc,functionName,vars,comment)) +#define Absyn__DERIVED_3dBOX4 4 +#define Absyn__DERIVED(typeSpec,attributes,arguments,comment) (mmc_mk_box5(4,&Absyn_ClassDef_DERIVED__desc,typeSpec,attributes,arguments,comment)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_TypeSpec_TPATH__desc_added -#define Absyn_TypeSpec_TPATH__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_TypeSpec_TPATH__desc__fields[2] = {"path","arrayDim"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_TypeSpec_TPATH__desc = { - "Absyn_TypeSpec_TPATH", - "Absyn.TypeSpec.TPATH", - Absyn_TypeSpec_TPATH__desc__fields +#ifndef Absyn_ClassDef_PARTS__desc_added +#define Absyn_ClassDef_PARTS__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_ClassDef_PARTS__desc__fields[5] = {"typeVars","classAttrs","classParts","ann","comment"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_ClassDef_PARTS__desc = { + "Absyn_ClassDef_PARTS", + "Absyn.ClassDef.PARTS", + Absyn_ClassDef_PARTS__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_TypeSpec_TPATH__desc; +extern struct record_description Absyn_ClassDef_PARTS__desc; #endif -#define Absyn__TPATH_3dBOX2 3 -#define Absyn__TPATH(path,arrayDim) (mmc_mk_box3(3,&Absyn_TypeSpec_TPATH__desc,path,arrayDim)) +#define Absyn__PARTS_3dBOX5 3 +#define Absyn__PARTS(typeVars,classAttrs,classParts,ann,comment) (mmc_mk_box6(3,&Absyn_ClassDef_PARTS__desc,typeVars,classAttrs,classParts,ann,comment)) #ifdef ADD_METARECORD_DEFINITIONS #ifndef Absyn_TypeSpec_TCOMPLEX__desc_added #define Absyn_TypeSpec_TCOMPLEX__desc_added @@ -1306,20 +1291,20 @@ extern struct record_description Absyn_TypeSpec_TCOMPLEX__desc; #define Absyn__TCOMPLEX_3dBOX3 4 #define Absyn__TCOMPLEX(path,typeSpecs,arrayDim) (mmc_mk_box4(4,&Absyn_TypeSpec_TCOMPLEX__desc,path,typeSpecs,arrayDim)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_EnumDef_ENUMLITERALS__desc_added -#define Absyn_EnumDef_ENUMLITERALS__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_EnumDef_ENUMLITERALS__desc__fields[1] = {"enumLiterals"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_EnumDef_ENUMLITERALS__desc = { - "Absyn_EnumDef_ENUMLITERALS", - "Absyn.EnumDef.ENUMLITERALS", - Absyn_EnumDef_ENUMLITERALS__desc__fields +#ifndef Absyn_TypeSpec_TPATH__desc_added +#define Absyn_TypeSpec_TPATH__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_TypeSpec_TPATH__desc__fields[2] = {"path","arrayDim"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_TypeSpec_TPATH__desc = { + "Absyn_TypeSpec_TPATH", + "Absyn.TypeSpec.TPATH", + Absyn_TypeSpec_TPATH__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_EnumDef_ENUMLITERALS__desc; +extern struct record_description Absyn_TypeSpec_TPATH__desc; #endif -#define Absyn__ENUMLITERALS_3dBOX1 3 -#define Absyn__ENUMLITERALS(enumLiterals) (mmc_mk_box2(3,&Absyn_EnumDef_ENUMLITERALS__desc,enumLiterals)) +#define Absyn__TPATH_3dBOX2 3 +#define Absyn__TPATH(path,arrayDim) (mmc_mk_box3(3,&Absyn_TypeSpec_TPATH__desc,path,arrayDim)) #ifdef ADD_METARECORD_DEFINITIONS #ifndef Absyn_EnumDef_ENUM__COLON__desc_added #define Absyn_EnumDef_ENUM__COLON__desc_added @@ -1337,6 +1322,21 @@ extern struct record_description Absyn_EnumDef_ENUM__COLON__desc; static const MMC_DEFSTRUCTLIT(Absyn__ENUM_5fCOLON__struct,1,4) {&Absyn_EnumDef_ENUM__COLON__desc}}; static void *Absyn__ENUM_5fCOLON = MMC_REFSTRUCTLIT(Absyn__ENUM_5fCOLON__struct); #ifdef ADD_METARECORD_DEFINITIONS +#ifndef Absyn_EnumDef_ENUMLITERALS__desc_added +#define Absyn_EnumDef_ENUMLITERALS__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_EnumDef_ENUMLITERALS__desc__fields[1] = {"enumLiterals"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_EnumDef_ENUMLITERALS__desc = { + "Absyn_EnumDef_ENUMLITERALS", + "Absyn.EnumDef.ENUMLITERALS", + Absyn_EnumDef_ENUMLITERALS__desc__fields +}; +#endif +#else /* Only use the file as a header */ +extern struct record_description Absyn_EnumDef_ENUMLITERALS__desc; +#endif +#define Absyn__ENUMLITERALS_3dBOX1 3 +#define Absyn__ENUMLITERALS(enumLiterals) (mmc_mk_box2(3,&Absyn_EnumDef_ENUMLITERALS__desc,enumLiterals)) +#ifdef ADD_METARECORD_DEFINITIONS #ifndef Absyn_EnumLiteral_ENUMLITERAL__desc_added #define Absyn_EnumLiteral_ENUMLITERAL__desc_added ADD_METARECORD_DEFINITIONS const char* Absyn_EnumLiteral_ENUMLITERAL__desc__fields[2] = {"literal","comment"}; @@ -1352,65 +1352,50 @@ extern struct record_description Absyn_EnumLiteral_ENUMLITERAL__desc; #define Absyn__ENUMLITERAL_3dBOX2 3 #define Absyn__ENUMLITERAL(literal,comment) (mmc_mk_box3(3,&Absyn_EnumLiteral_ENUMLITERAL__desc,literal,comment)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_ClassPart_PUBLIC__desc_added -#define Absyn_ClassPart_PUBLIC__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_ClassPart_PUBLIC__desc__fields[1] = {"contents"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_ClassPart_PUBLIC__desc = { - "Absyn_ClassPart_PUBLIC", - "Absyn.ClassPart.PUBLIC", - Absyn_ClassPart_PUBLIC__desc__fields -}; -#endif -#else /* Only use the file as a header */ -extern struct record_description Absyn_ClassPart_PUBLIC__desc; -#endif -#define Absyn__PUBLIC_3dBOX1 3 -#define Absyn__PUBLIC(contents) (mmc_mk_box2(3,&Absyn_ClassPart_PUBLIC__desc,contents)) -#ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_ClassPart_PROTECTED__desc_added -#define Absyn_ClassPart_PROTECTED__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_ClassPart_PROTECTED__desc__fields[1] = {"contents"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_ClassPart_PROTECTED__desc = { - "Absyn_ClassPart_PROTECTED", - "Absyn.ClassPart.PROTECTED", - Absyn_ClassPart_PROTECTED__desc__fields +#ifndef Absyn_ClassPart_EXTERNAL__desc_added +#define Absyn_ClassPart_EXTERNAL__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_ClassPart_EXTERNAL__desc__fields[2] = {"externalDecl","annotation_"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_ClassPart_EXTERNAL__desc = { + "Absyn_ClassPart_EXTERNAL", + "Absyn.ClassPart.EXTERNAL", + Absyn_ClassPart_EXTERNAL__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_ClassPart_PROTECTED__desc; +extern struct record_description Absyn_ClassPart_EXTERNAL__desc; #endif -#define Absyn__PROTECTED_3dBOX1 4 -#define Absyn__PROTECTED(contents) (mmc_mk_box2(4,&Absyn_ClassPart_PROTECTED__desc,contents)) +#define Absyn__EXTERNAL_3dBOX2 10 +#define Absyn__EXTERNAL(externalDecl,annotation_) (mmc_mk_box3(10,&Absyn_ClassPart_EXTERNAL__desc,externalDecl,annotation_)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_ClassPart_CONSTRAINTS__desc_added -#define Absyn_ClassPart_CONSTRAINTS__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_ClassPart_CONSTRAINTS__desc__fields[1] = {"contents"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_ClassPart_CONSTRAINTS__desc = { - "Absyn_ClassPart_CONSTRAINTS", - "Absyn.ClassPart.CONSTRAINTS", - Absyn_ClassPart_CONSTRAINTS__desc__fields +#ifndef Absyn_ClassPart_INITIALALGORITHMS__desc_added +#define Absyn_ClassPart_INITIALALGORITHMS__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_ClassPart_INITIALALGORITHMS__desc__fields[1] = {"contents"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_ClassPart_INITIALALGORITHMS__desc = { + "Absyn_ClassPart_INITIALALGORITHMS", + "Absyn.ClassPart.INITIALALGORITHMS", + Absyn_ClassPart_INITIALALGORITHMS__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_ClassPart_CONSTRAINTS__desc; +extern struct record_description Absyn_ClassPart_INITIALALGORITHMS__desc; #endif -#define Absyn__CONSTRAINTS_3dBOX1 5 -#define Absyn__CONSTRAINTS(contents) (mmc_mk_box2(5,&Absyn_ClassPart_CONSTRAINTS__desc,contents)) +#define Absyn__INITIALALGORITHMS_3dBOX1 9 +#define Absyn__INITIALALGORITHMS(contents) (mmc_mk_box2(9,&Absyn_ClassPart_INITIALALGORITHMS__desc,contents)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_ClassPart_EQUATIONS__desc_added -#define Absyn_ClassPart_EQUATIONS__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_ClassPart_EQUATIONS__desc__fields[1] = {"contents"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_ClassPart_EQUATIONS__desc = { - "Absyn_ClassPart_EQUATIONS", - "Absyn.ClassPart.EQUATIONS", - Absyn_ClassPart_EQUATIONS__desc__fields +#ifndef Absyn_ClassPart_ALGORITHMS__desc_added +#define Absyn_ClassPart_ALGORITHMS__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_ClassPart_ALGORITHMS__desc__fields[1] = {"contents"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_ClassPart_ALGORITHMS__desc = { + "Absyn_ClassPart_ALGORITHMS", + "Absyn.ClassPart.ALGORITHMS", + Absyn_ClassPart_ALGORITHMS__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_ClassPart_EQUATIONS__desc; +extern struct record_description Absyn_ClassPart_ALGORITHMS__desc; #endif -#define Absyn__EQUATIONS_3dBOX1 6 -#define Absyn__EQUATIONS(contents) (mmc_mk_box2(6,&Absyn_ClassPart_EQUATIONS__desc,contents)) +#define Absyn__ALGORITHMS_3dBOX1 8 +#define Absyn__ALGORITHMS(contents) (mmc_mk_box2(8,&Absyn_ClassPart_ALGORITHMS__desc,contents)) #ifdef ADD_METARECORD_DEFINITIONS #ifndef Absyn_ClassPart_INITIALEQUATIONS__desc_added #define Absyn_ClassPart_INITIALEQUATIONS__desc_added @@ -1427,65 +1412,65 @@ extern struct record_description Absyn_ClassPart_INITIALEQUATIONS__desc; #define Absyn__INITIALEQUATIONS_3dBOX1 7 #define Absyn__INITIALEQUATIONS(contents) (mmc_mk_box2(7,&Absyn_ClassPart_INITIALEQUATIONS__desc,contents)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_ClassPart_ALGORITHMS__desc_added -#define Absyn_ClassPart_ALGORITHMS__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_ClassPart_ALGORITHMS__desc__fields[1] = {"contents"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_ClassPart_ALGORITHMS__desc = { - "Absyn_ClassPart_ALGORITHMS", - "Absyn.ClassPart.ALGORITHMS", - Absyn_ClassPart_ALGORITHMS__desc__fields +#ifndef Absyn_ClassPart_EQUATIONS__desc_added +#define Absyn_ClassPart_EQUATIONS__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_ClassPart_EQUATIONS__desc__fields[1] = {"contents"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_ClassPart_EQUATIONS__desc = { + "Absyn_ClassPart_EQUATIONS", + "Absyn.ClassPart.EQUATIONS", + Absyn_ClassPart_EQUATIONS__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_ClassPart_ALGORITHMS__desc; +extern struct record_description Absyn_ClassPart_EQUATIONS__desc; #endif -#define Absyn__ALGORITHMS_3dBOX1 8 -#define Absyn__ALGORITHMS(contents) (mmc_mk_box2(8,&Absyn_ClassPart_ALGORITHMS__desc,contents)) +#define Absyn__EQUATIONS_3dBOX1 6 +#define Absyn__EQUATIONS(contents) (mmc_mk_box2(6,&Absyn_ClassPart_EQUATIONS__desc,contents)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_ClassPart_INITIALALGORITHMS__desc_added -#define Absyn_ClassPart_INITIALALGORITHMS__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_ClassPart_INITIALALGORITHMS__desc__fields[1] = {"contents"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_ClassPart_INITIALALGORITHMS__desc = { - "Absyn_ClassPart_INITIALALGORITHMS", - "Absyn.ClassPart.INITIALALGORITHMS", - Absyn_ClassPart_INITIALALGORITHMS__desc__fields +#ifndef Absyn_ClassPart_CONSTRAINTS__desc_added +#define Absyn_ClassPart_CONSTRAINTS__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_ClassPart_CONSTRAINTS__desc__fields[1] = {"contents"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_ClassPart_CONSTRAINTS__desc = { + "Absyn_ClassPart_CONSTRAINTS", + "Absyn.ClassPart.CONSTRAINTS", + Absyn_ClassPart_CONSTRAINTS__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_ClassPart_INITIALALGORITHMS__desc; +extern struct record_description Absyn_ClassPart_CONSTRAINTS__desc; #endif -#define Absyn__INITIALALGORITHMS_3dBOX1 9 -#define Absyn__INITIALALGORITHMS(contents) (mmc_mk_box2(9,&Absyn_ClassPart_INITIALALGORITHMS__desc,contents)) +#define Absyn__CONSTRAINTS_3dBOX1 5 +#define Absyn__CONSTRAINTS(contents) (mmc_mk_box2(5,&Absyn_ClassPart_CONSTRAINTS__desc,contents)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_ClassPart_EXTERNAL__desc_added -#define Absyn_ClassPart_EXTERNAL__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_ClassPart_EXTERNAL__desc__fields[2] = {"externalDecl","annotation_"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_ClassPart_EXTERNAL__desc = { - "Absyn_ClassPart_EXTERNAL", - "Absyn.ClassPart.EXTERNAL", - Absyn_ClassPart_EXTERNAL__desc__fields +#ifndef Absyn_ClassPart_PROTECTED__desc_added +#define Absyn_ClassPart_PROTECTED__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_ClassPart_PROTECTED__desc__fields[1] = {"contents"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_ClassPart_PROTECTED__desc = { + "Absyn_ClassPart_PROTECTED", + "Absyn.ClassPart.PROTECTED", + Absyn_ClassPart_PROTECTED__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_ClassPart_EXTERNAL__desc; +extern struct record_description Absyn_ClassPart_PROTECTED__desc; #endif -#define Absyn__EXTERNAL_3dBOX2 10 -#define Absyn__EXTERNAL(externalDecl,annotation_) (mmc_mk_box3(10,&Absyn_ClassPart_EXTERNAL__desc,externalDecl,annotation_)) +#define Absyn__PROTECTED_3dBOX1 4 +#define Absyn__PROTECTED(contents) (mmc_mk_box2(4,&Absyn_ClassPart_PROTECTED__desc,contents)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_ElementItem_ELEMENTITEM__desc_added -#define Absyn_ElementItem_ELEMENTITEM__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_ElementItem_ELEMENTITEM__desc__fields[1] = {"element"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_ElementItem_ELEMENTITEM__desc = { - "Absyn_ElementItem_ELEMENTITEM", - "Absyn.ElementItem.ELEMENTITEM", - Absyn_ElementItem_ELEMENTITEM__desc__fields +#ifndef Absyn_ClassPart_PUBLIC__desc_added +#define Absyn_ClassPart_PUBLIC__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_ClassPart_PUBLIC__desc__fields[1] = {"contents"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_ClassPart_PUBLIC__desc = { + "Absyn_ClassPart_PUBLIC", + "Absyn.ClassPart.PUBLIC", + Absyn_ClassPart_PUBLIC__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_ElementItem_ELEMENTITEM__desc; +extern struct record_description Absyn_ClassPart_PUBLIC__desc; #endif -#define Absyn__ELEMENTITEM_3dBOX1 3 -#define Absyn__ELEMENTITEM(element) (mmc_mk_box2(3,&Absyn_ElementItem_ELEMENTITEM__desc,element)) +#define Absyn__PUBLIC_3dBOX1 3 +#define Absyn__PUBLIC(contents) (mmc_mk_box2(3,&Absyn_ClassPart_PUBLIC__desc,contents)) #ifdef ADD_METARECORD_DEFINITIONS #ifndef Absyn_ElementItem_LEXER__COMMENT__desc_added #define Absyn_ElementItem_LEXER__COMMENT__desc_added @@ -1502,20 +1487,35 @@ extern struct record_description Absyn_ElementItem_LEXER__COMMENT__desc; #define Absyn__LEXER_5fCOMMENT_3dBOX1 4 #define Absyn__LEXER_5fCOMMENT(comment) (mmc_mk_box2(4,&Absyn_ElementItem_LEXER__COMMENT__desc,comment)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Element_ELEMENT__desc_added -#define Absyn_Element_ELEMENT__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Element_ELEMENT__desc__fields[6] = {"finalPrefix","redeclareKeywords","innerOuter","specification","info","constrainClass"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Element_ELEMENT__desc = { - "Absyn_Element_ELEMENT", - "Absyn.Element.ELEMENT", - Absyn_Element_ELEMENT__desc__fields +#ifndef Absyn_ElementItem_ELEMENTITEM__desc_added +#define Absyn_ElementItem_ELEMENTITEM__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_ElementItem_ELEMENTITEM__desc__fields[1] = {"element"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_ElementItem_ELEMENTITEM__desc = { + "Absyn_ElementItem_ELEMENTITEM", + "Absyn.ElementItem.ELEMENTITEM", + Absyn_ElementItem_ELEMENTITEM__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Element_ELEMENT__desc; +extern struct record_description Absyn_ElementItem_ELEMENTITEM__desc; #endif -#define Absyn__ELEMENT_3dBOX6 3 -#define Absyn__ELEMENT(finalPrefix,redeclareKeywords,innerOuter,specification,info,constrainClass) (mmc_mk_box7(3,&Absyn_Element_ELEMENT__desc,finalPrefix,redeclareKeywords,innerOuter,specification,info,constrainClass)) +#define Absyn__ELEMENTITEM_3dBOX1 3 +#define Absyn__ELEMENTITEM(element) (mmc_mk_box2(3,&Absyn_ElementItem_ELEMENTITEM__desc,element)) +#ifdef ADD_METARECORD_DEFINITIONS +#ifndef Absyn_Element_TEXT__desc_added +#define Absyn_Element_TEXT__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Element_TEXT__desc__fields[3] = {"optName","string","info"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Element_TEXT__desc = { + "Absyn_Element_TEXT", + "Absyn.Element.TEXT", + Absyn_Element_TEXT__desc__fields +}; +#endif +#else /* Only use the file as a header */ +extern struct record_description Absyn_Element_TEXT__desc; +#endif +#define Absyn__TEXT_3dBOX3 5 +#define Absyn__TEXT(optName,string,info) (mmc_mk_box4(5,&Absyn_Element_TEXT__desc,optName,string,info)) #ifdef ADD_METARECORD_DEFINITIONS #ifndef Absyn_Element_DEFINEUNIT__desc_added #define Absyn_Element_DEFINEUNIT__desc_added @@ -1532,20 +1532,20 @@ extern struct record_description Absyn_Element_DEFINEUNIT__desc; #define Absyn__DEFINEUNIT_3dBOX2 4 #define Absyn__DEFINEUNIT(name,args) (mmc_mk_box3(4,&Absyn_Element_DEFINEUNIT__desc,name,args)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Element_TEXT__desc_added -#define Absyn_Element_TEXT__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Element_TEXT__desc__fields[3] = {"optName","string","info"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Element_TEXT__desc = { - "Absyn_Element_TEXT", - "Absyn.Element.TEXT", - Absyn_Element_TEXT__desc__fields +#ifndef Absyn_Element_ELEMENT__desc_added +#define Absyn_Element_ELEMENT__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Element_ELEMENT__desc__fields[6] = {"finalPrefix","redeclareKeywords","innerOuter","specification","info","constrainClass"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Element_ELEMENT__desc = { + "Absyn_Element_ELEMENT", + "Absyn.Element.ELEMENT", + Absyn_Element_ELEMENT__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Element_TEXT__desc; +extern struct record_description Absyn_Element_ELEMENT__desc; #endif -#define Absyn__TEXT_3dBOX3 5 -#define Absyn__TEXT(optName,string,info) (mmc_mk_box4(5,&Absyn_Element_TEXT__desc,optName,string,info)) +#define Absyn__ELEMENT_3dBOX6 3 +#define Absyn__ELEMENT(finalPrefix,redeclareKeywords,innerOuter,specification,info,constrainClass) (mmc_mk_box7(3,&Absyn_Element_ELEMENT__desc,finalPrefix,redeclareKeywords,innerOuter,specification,info,constrainClass)) #ifdef ADD_METARECORD_DEFINITIONS #ifndef Absyn_ConstrainClass_CONSTRAINCLASS__desc_added #define Absyn_ConstrainClass_CONSTRAINCLASS__desc_added @@ -1562,35 +1562,20 @@ extern struct record_description Absyn_ConstrainClass_CONSTRAINCLASS__desc; #define Absyn__CONSTRAINCLASS_3dBOX2 3 #define Absyn__CONSTRAINCLASS(elementSpec,comment) (mmc_mk_box3(3,&Absyn_ConstrainClass_CONSTRAINCLASS__desc,elementSpec,comment)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_ElementSpec_CLASSDEF__desc_added -#define Absyn_ElementSpec_CLASSDEF__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_ElementSpec_CLASSDEF__desc__fields[2] = {"replaceable_","class_"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_ElementSpec_CLASSDEF__desc = { - "Absyn_ElementSpec_CLASSDEF", - "Absyn.ElementSpec.CLASSDEF", - Absyn_ElementSpec_CLASSDEF__desc__fields -}; -#endif -#else /* Only use the file as a header */ -extern struct record_description Absyn_ElementSpec_CLASSDEF__desc; -#endif -#define Absyn__CLASSDEF_3dBOX2 3 -#define Absyn__CLASSDEF(replaceable_,class_) (mmc_mk_box3(3,&Absyn_ElementSpec_CLASSDEF__desc,replaceable_,class_)) -#ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_ElementSpec_EXTENDS__desc_added -#define Absyn_ElementSpec_EXTENDS__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_ElementSpec_EXTENDS__desc__fields[3] = {"path","elementArg","annotationOpt"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_ElementSpec_EXTENDS__desc = { - "Absyn_ElementSpec_EXTENDS", - "Absyn.ElementSpec.EXTENDS", - Absyn_ElementSpec_EXTENDS__desc__fields +#ifndef Absyn_ElementSpec_COMPONENTS__desc_added +#define Absyn_ElementSpec_COMPONENTS__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_ElementSpec_COMPONENTS__desc__fields[3] = {"attributes","typeSpec","components"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_ElementSpec_COMPONENTS__desc = { + "Absyn_ElementSpec_COMPONENTS", + "Absyn.ElementSpec.COMPONENTS", + Absyn_ElementSpec_COMPONENTS__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_ElementSpec_EXTENDS__desc; +extern struct record_description Absyn_ElementSpec_COMPONENTS__desc; #endif -#define Absyn__EXTENDS_3dBOX3 4 -#define Absyn__EXTENDS(path,elementArg,annotationOpt) (mmc_mk_box4(4,&Absyn_ElementSpec_EXTENDS__desc,path,elementArg,annotationOpt)) +#define Absyn__COMPONENTS_3dBOX3 6 +#define Absyn__COMPONENTS(attributes,typeSpec,components) (mmc_mk_box4(6,&Absyn_ElementSpec_COMPONENTS__desc,attributes,typeSpec,components)) #ifdef ADD_METARECORD_DEFINITIONS #ifndef Absyn_ElementSpec_IMPORT__desc_added #define Absyn_ElementSpec_IMPORT__desc_added @@ -1607,52 +1592,51 @@ extern struct record_description Absyn_ElementSpec_IMPORT__desc; #define Absyn__IMPORT_3dBOX3 5 #define Absyn__IMPORT(import_,comment,info) (mmc_mk_box4(5,&Absyn_ElementSpec_IMPORT__desc,import_,comment,info)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_ElementSpec_COMPONENTS__desc_added -#define Absyn_ElementSpec_COMPONENTS__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_ElementSpec_COMPONENTS__desc__fields[3] = {"attributes","typeSpec","components"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_ElementSpec_COMPONENTS__desc = { - "Absyn_ElementSpec_COMPONENTS", - "Absyn.ElementSpec.COMPONENTS", - Absyn_ElementSpec_COMPONENTS__desc__fields +#ifndef Absyn_ElementSpec_EXTENDS__desc_added +#define Absyn_ElementSpec_EXTENDS__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_ElementSpec_EXTENDS__desc__fields[3] = {"path","elementArg","annotationOpt"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_ElementSpec_EXTENDS__desc = { + "Absyn_ElementSpec_EXTENDS", + "Absyn.ElementSpec.EXTENDS", + Absyn_ElementSpec_EXTENDS__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_ElementSpec_COMPONENTS__desc; +extern struct record_description Absyn_ElementSpec_EXTENDS__desc; #endif -#define Absyn__COMPONENTS_3dBOX3 6 -#define Absyn__COMPONENTS(attributes,typeSpec,components) (mmc_mk_box4(6,&Absyn_ElementSpec_COMPONENTS__desc,attributes,typeSpec,components)) +#define Absyn__EXTENDS_3dBOX3 4 +#define Absyn__EXTENDS(path,elementArg,annotationOpt) (mmc_mk_box4(4,&Absyn_ElementSpec_EXTENDS__desc,path,elementArg,annotationOpt)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_InnerOuter_INNER__desc_added -#define Absyn_InnerOuter_INNER__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_InnerOuter_INNER__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_InnerOuter_INNER__desc = { - "Absyn_InnerOuter_INNER", - "Absyn.InnerOuter.INNER", - Absyn_InnerOuter_INNER__desc__fields +#ifndef Absyn_ElementSpec_CLASSDEF__desc_added +#define Absyn_ElementSpec_CLASSDEF__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_ElementSpec_CLASSDEF__desc__fields[2] = {"replaceable_","class_"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_ElementSpec_CLASSDEF__desc = { + "Absyn_ElementSpec_CLASSDEF", + "Absyn.ElementSpec.CLASSDEF", + Absyn_ElementSpec_CLASSDEF__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_InnerOuter_INNER__desc; +extern struct record_description Absyn_ElementSpec_CLASSDEF__desc; #endif -#define Absyn__INNER_3dBOX0 3 -static const MMC_DEFSTRUCTLIT(Absyn__INNER__struct,1,3) {&Absyn_InnerOuter_INNER__desc}}; -static void *Absyn__INNER = MMC_REFSTRUCTLIT(Absyn__INNER__struct); +#define Absyn__CLASSDEF_3dBOX2 3 +#define Absyn__CLASSDEF(replaceable_,class_) (mmc_mk_box3(3,&Absyn_ElementSpec_CLASSDEF__desc,replaceable_,class_)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_InnerOuter_OUTER__desc_added -#define Absyn_InnerOuter_OUTER__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_InnerOuter_OUTER__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_InnerOuter_OUTER__desc = { - "Absyn_InnerOuter_OUTER", - "Absyn.InnerOuter.OUTER", - Absyn_InnerOuter_OUTER__desc__fields +#ifndef Absyn_InnerOuter_NOT__INNER__OUTER__desc_added +#define Absyn_InnerOuter_NOT__INNER__OUTER__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_InnerOuter_NOT__INNER__OUTER__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_InnerOuter_NOT__INNER__OUTER__desc = { + "Absyn_InnerOuter_NOT__INNER__OUTER", + "Absyn.InnerOuter.NOT_INNER_OUTER", + Absyn_InnerOuter_NOT__INNER__OUTER__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_InnerOuter_OUTER__desc; +extern struct record_description Absyn_InnerOuter_NOT__INNER__OUTER__desc; #endif -#define Absyn__OUTER_3dBOX0 4 -static const MMC_DEFSTRUCTLIT(Absyn__OUTER__struct,1,4) {&Absyn_InnerOuter_OUTER__desc}}; -static void *Absyn__OUTER = MMC_REFSTRUCTLIT(Absyn__OUTER__struct); +#define Absyn__NOT_5fINNER_5fOUTER_3dBOX0 6 +static const MMC_DEFSTRUCTLIT(Absyn__NOT_5fINNER_5fOUTER__struct,1,6) {&Absyn_InnerOuter_NOT__INNER__OUTER__desc}}; +static void *Absyn__NOT_5fINNER_5fOUTER = MMC_REFSTRUCTLIT(Absyn__NOT_5fINNER_5fOUTER__struct); #ifdef ADD_METARECORD_DEFINITIONS #ifndef Absyn_InnerOuter_INNER__OUTER__desc_added #define Absyn_InnerOuter_INNER__OUTER__desc_added @@ -1670,51 +1654,52 @@ extern struct record_description Absyn_InnerOuter_INNER__OUTER__desc; static const MMC_DEFSTRUCTLIT(Absyn__INNER_5fOUTER__struct,1,5) {&Absyn_InnerOuter_INNER__OUTER__desc}}; static void *Absyn__INNER_5fOUTER = MMC_REFSTRUCTLIT(Absyn__INNER_5fOUTER__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_InnerOuter_NOT__INNER__OUTER__desc_added -#define Absyn_InnerOuter_NOT__INNER__OUTER__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_InnerOuter_NOT__INNER__OUTER__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_InnerOuter_NOT__INNER__OUTER__desc = { - "Absyn_InnerOuter_NOT__INNER__OUTER", - "Absyn.InnerOuter.NOT_INNER_OUTER", - Absyn_InnerOuter_NOT__INNER__OUTER__desc__fields +#ifndef Absyn_InnerOuter_OUTER__desc_added +#define Absyn_InnerOuter_OUTER__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_InnerOuter_OUTER__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_InnerOuter_OUTER__desc = { + "Absyn_InnerOuter_OUTER", + "Absyn.InnerOuter.OUTER", + Absyn_InnerOuter_OUTER__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_InnerOuter_NOT__INNER__OUTER__desc; +extern struct record_description Absyn_InnerOuter_OUTER__desc; #endif -#define Absyn__NOT_5fINNER_5fOUTER_3dBOX0 6 -static const MMC_DEFSTRUCTLIT(Absyn__NOT_5fINNER_5fOUTER__struct,1,6) {&Absyn_InnerOuter_NOT__INNER__OUTER__desc}}; -static void *Absyn__NOT_5fINNER_5fOUTER = MMC_REFSTRUCTLIT(Absyn__NOT_5fINNER_5fOUTER__struct); +#define Absyn__OUTER_3dBOX0 4 +static const MMC_DEFSTRUCTLIT(Absyn__OUTER__struct,1,4) {&Absyn_InnerOuter_OUTER__desc}}; +static void *Absyn__OUTER = MMC_REFSTRUCTLIT(Absyn__OUTER__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Import_NAMED__IMPORT__desc_added -#define Absyn_Import_NAMED__IMPORT__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Import_NAMED__IMPORT__desc__fields[2] = {"name","path"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Import_NAMED__IMPORT__desc = { - "Absyn_Import_NAMED__IMPORT", - "Absyn.Import.NAMED_IMPORT", - Absyn_Import_NAMED__IMPORT__desc__fields +#ifndef Absyn_InnerOuter_INNER__desc_added +#define Absyn_InnerOuter_INNER__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_InnerOuter_INNER__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_InnerOuter_INNER__desc = { + "Absyn_InnerOuter_INNER", + "Absyn.InnerOuter.INNER", + Absyn_InnerOuter_INNER__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Import_NAMED__IMPORT__desc; +extern struct record_description Absyn_InnerOuter_INNER__desc; #endif -#define Absyn__NAMED_5fIMPORT_3dBOX2 3 -#define Absyn__NAMED_5fIMPORT(name,path) (mmc_mk_box3(3,&Absyn_Import_NAMED__IMPORT__desc,name,path)) +#define Absyn__INNER_3dBOX0 3 +static const MMC_DEFSTRUCTLIT(Absyn__INNER__struct,1,3) {&Absyn_InnerOuter_INNER__desc}}; +static void *Absyn__INNER = MMC_REFSTRUCTLIT(Absyn__INNER__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Import_QUAL__IMPORT__desc_added -#define Absyn_Import_QUAL__IMPORT__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Import_QUAL__IMPORT__desc__fields[1] = {"path"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Import_QUAL__IMPORT__desc = { - "Absyn_Import_QUAL__IMPORT", - "Absyn.Import.QUAL_IMPORT", - Absyn_Import_QUAL__IMPORT__desc__fields +#ifndef Absyn_Import_GROUP__IMPORT__desc_added +#define Absyn_Import_GROUP__IMPORT__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Import_GROUP__IMPORT__desc__fields[2] = {"prefix","groups"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Import_GROUP__IMPORT__desc = { + "Absyn_Import_GROUP__IMPORT", + "Absyn.Import.GROUP_IMPORT", + Absyn_Import_GROUP__IMPORT__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Import_QUAL__IMPORT__desc; +extern struct record_description Absyn_Import_GROUP__IMPORT__desc; #endif -#define Absyn__QUAL_5fIMPORT_3dBOX1 4 -#define Absyn__QUAL_5fIMPORT(path) (mmc_mk_box2(4,&Absyn_Import_QUAL__IMPORT__desc,path)) +#define Absyn__GROUP_5fIMPORT_3dBOX2 6 +#define Absyn__GROUP_5fIMPORT(prefix,groups) (mmc_mk_box3(6,&Absyn_Import_GROUP__IMPORT__desc,prefix,groups)) #ifdef ADD_METARECORD_DEFINITIONS #ifndef Absyn_Import_UNQUAL__IMPORT__desc_added #define Absyn_Import_UNQUAL__IMPORT__desc_added @@ -1731,35 +1716,35 @@ extern struct record_description Absyn_Import_UNQUAL__IMPORT__desc; #define Absyn__UNQUAL_5fIMPORT_3dBOX1 5 #define Absyn__UNQUAL_5fIMPORT(path) (mmc_mk_box2(5,&Absyn_Import_UNQUAL__IMPORT__desc,path)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Import_GROUP__IMPORT__desc_added -#define Absyn_Import_GROUP__IMPORT__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Import_GROUP__IMPORT__desc__fields[2] = {"prefix","groups"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Import_GROUP__IMPORT__desc = { - "Absyn_Import_GROUP__IMPORT", - "Absyn.Import.GROUP_IMPORT", - Absyn_Import_GROUP__IMPORT__desc__fields +#ifndef Absyn_Import_QUAL__IMPORT__desc_added +#define Absyn_Import_QUAL__IMPORT__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Import_QUAL__IMPORT__desc__fields[1] = {"path"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Import_QUAL__IMPORT__desc = { + "Absyn_Import_QUAL__IMPORT", + "Absyn.Import.QUAL_IMPORT", + Absyn_Import_QUAL__IMPORT__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Import_GROUP__IMPORT__desc; +extern struct record_description Absyn_Import_QUAL__IMPORT__desc; #endif -#define Absyn__GROUP_5fIMPORT_3dBOX2 6 -#define Absyn__GROUP_5fIMPORT(prefix,groups) (mmc_mk_box3(6,&Absyn_Import_GROUP__IMPORT__desc,prefix,groups)) +#define Absyn__QUAL_5fIMPORT_3dBOX1 4 +#define Absyn__QUAL_5fIMPORT(path) (mmc_mk_box2(4,&Absyn_Import_QUAL__IMPORT__desc,path)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_GroupImport_GROUP__IMPORT__NAME__desc_added -#define Absyn_GroupImport_GROUP__IMPORT__NAME__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_GroupImport_GROUP__IMPORT__NAME__desc__fields[1] = {"name"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_GroupImport_GROUP__IMPORT__NAME__desc = { - "Absyn_GroupImport_GROUP__IMPORT__NAME", - "Absyn.GroupImport.GROUP_IMPORT_NAME", - Absyn_GroupImport_GROUP__IMPORT__NAME__desc__fields +#ifndef Absyn_Import_NAMED__IMPORT__desc_added +#define Absyn_Import_NAMED__IMPORT__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Import_NAMED__IMPORT__desc__fields[2] = {"name","path"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Import_NAMED__IMPORT__desc = { + "Absyn_Import_NAMED__IMPORT", + "Absyn.Import.NAMED_IMPORT", + Absyn_Import_NAMED__IMPORT__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_GroupImport_GROUP__IMPORT__NAME__desc; +extern struct record_description Absyn_Import_NAMED__IMPORT__desc; #endif -#define Absyn__GROUP_5fIMPORT_5fNAME_3dBOX1 3 -#define Absyn__GROUP_5fIMPORT_5fNAME(name) (mmc_mk_box2(3,&Absyn_GroupImport_GROUP__IMPORT__NAME__desc,name)) +#define Absyn__NAMED_5fIMPORT_3dBOX2 3 +#define Absyn__NAMED_5fIMPORT(name,path) (mmc_mk_box3(3,&Absyn_Import_NAMED__IMPORT__desc,name,path)) #ifdef ADD_METARECORD_DEFINITIONS #ifndef Absyn_GroupImport_GROUP__IMPORT__RENAME__desc_added #define Absyn_GroupImport_GROUP__IMPORT__RENAME__desc_added @@ -1776,6 +1761,21 @@ extern struct record_description Absyn_GroupImport_GROUP__IMPORT__RENAME__desc; #define Absyn__GROUP_5fIMPORT_5fRENAME_3dBOX2 4 #define Absyn__GROUP_5fIMPORT_5fRENAME(rename,name) (mmc_mk_box3(4,&Absyn_GroupImport_GROUP__IMPORT__RENAME__desc,rename,name)) #ifdef ADD_METARECORD_DEFINITIONS +#ifndef Absyn_GroupImport_GROUP__IMPORT__NAME__desc_added +#define Absyn_GroupImport_GROUP__IMPORT__NAME__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_GroupImport_GROUP__IMPORT__NAME__desc__fields[1] = {"name"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_GroupImport_GROUP__IMPORT__NAME__desc = { + "Absyn_GroupImport_GROUP__IMPORT__NAME", + "Absyn.GroupImport.GROUP_IMPORT_NAME", + Absyn_GroupImport_GROUP__IMPORT__NAME__desc__fields +}; +#endif +#else /* Only use the file as a header */ +extern struct record_description Absyn_GroupImport_GROUP__IMPORT__NAME__desc; +#endif +#define Absyn__GROUP_5fIMPORT_5fNAME_3dBOX1 3 +#define Absyn__GROUP_5fIMPORT_5fNAME(name) (mmc_mk_box2(3,&Absyn_GroupImport_GROUP__IMPORT__NAME__desc,name)) +#ifdef ADD_METARECORD_DEFINITIONS #ifndef Absyn_ComponentItem_COMPONENTITEM__desc_added #define Absyn_ComponentItem_COMPONENTITEM__desc_added ADD_METARECORD_DEFINITIONS const char* Absyn_ComponentItem_COMPONENTITEM__desc__fields[3] = {"component","condition","comment"}; @@ -1806,21 +1806,6 @@ extern struct record_description Absyn_Component_COMPONENT__desc; #define Absyn__COMPONENT_3dBOX3 3 #define Absyn__COMPONENT(name,arrayDim,modification) (mmc_mk_box4(3,&Absyn_Component_COMPONENT__desc,name,arrayDim,modification)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_EquationItem_EQUATIONITEM__desc_added -#define Absyn_EquationItem_EQUATIONITEM__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_EquationItem_EQUATIONITEM__desc__fields[3] = {"equation_","comment","info"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_EquationItem_EQUATIONITEM__desc = { - "Absyn_EquationItem_EQUATIONITEM", - "Absyn.EquationItem.EQUATIONITEM", - Absyn_EquationItem_EQUATIONITEM__desc__fields -}; -#endif -#else /* Only use the file as a header */ -extern struct record_description Absyn_EquationItem_EQUATIONITEM__desc; -#endif -#define Absyn__EQUATIONITEM_3dBOX3 3 -#define Absyn__EQUATIONITEM(equation_,comment,info) (mmc_mk_box4(3,&Absyn_EquationItem_EQUATIONITEM__desc,equation_,comment,info)) -#ifdef ADD_METARECORD_DEFINITIONS #ifndef Absyn_EquationItem_EQUATIONITEMCOMMENT__desc_added #define Absyn_EquationItem_EQUATIONITEMCOMMENT__desc_added ADD_METARECORD_DEFINITIONS const char* Absyn_EquationItem_EQUATIONITEMCOMMENT__desc__fields[1] = {"comment"}; @@ -1836,20 +1821,20 @@ extern struct record_description Absyn_EquationItem_EQUATIONITEMCOMMENT__desc; #define Absyn__EQUATIONITEMCOMMENT_3dBOX1 4 #define Absyn__EQUATIONITEMCOMMENT(comment) (mmc_mk_box2(4,&Absyn_EquationItem_EQUATIONITEMCOMMENT__desc,comment)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_AlgorithmItem_ALGORITHMITEM__desc_added -#define Absyn_AlgorithmItem_ALGORITHMITEM__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_AlgorithmItem_ALGORITHMITEM__desc__fields[3] = {"algorithm_","comment","info"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_AlgorithmItem_ALGORITHMITEM__desc = { - "Absyn_AlgorithmItem_ALGORITHMITEM", - "Absyn.AlgorithmItem.ALGORITHMITEM", - Absyn_AlgorithmItem_ALGORITHMITEM__desc__fields +#ifndef Absyn_EquationItem_EQUATIONITEM__desc_added +#define Absyn_EquationItem_EQUATIONITEM__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_EquationItem_EQUATIONITEM__desc__fields[3] = {"equation_","comment","info"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_EquationItem_EQUATIONITEM__desc = { + "Absyn_EquationItem_EQUATIONITEM", + "Absyn.EquationItem.EQUATIONITEM", + Absyn_EquationItem_EQUATIONITEM__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_AlgorithmItem_ALGORITHMITEM__desc; +extern struct record_description Absyn_EquationItem_EQUATIONITEM__desc; #endif -#define Absyn__ALGORITHMITEM_3dBOX3 3 -#define Absyn__ALGORITHMITEM(algorithm_,comment,info) (mmc_mk_box4(3,&Absyn_AlgorithmItem_ALGORITHMITEM__desc,algorithm_,comment,info)) +#define Absyn__EQUATIONITEM_3dBOX3 3 +#define Absyn__EQUATIONITEM(equation_,comment,info) (mmc_mk_box4(3,&Absyn_EquationItem_EQUATIONITEM__desc,equation_,comment,info)) #ifdef ADD_METARECORD_DEFINITIONS #ifndef Absyn_AlgorithmItem_ALGORITHMITEMCOMMENT__desc_added #define Absyn_AlgorithmItem_ALGORITHMITEMCOMMENT__desc_added @@ -1866,65 +1851,50 @@ extern struct record_description Absyn_AlgorithmItem_ALGORITHMITEMCOMMENT__desc; #define Absyn__ALGORITHMITEMCOMMENT_3dBOX1 4 #define Absyn__ALGORITHMITEMCOMMENT(comment) (mmc_mk_box2(4,&Absyn_AlgorithmItem_ALGORITHMITEMCOMMENT__desc,comment)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Equation_EQ__IF__desc_added -#define Absyn_Equation_EQ__IF__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Equation_EQ__IF__desc__fields[4] = {"ifExp","equationTrueItems","elseIfBranches","equationElseItems"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Equation_EQ__IF__desc = { - "Absyn_Equation_EQ__IF", - "Absyn.Equation.EQ_IF", - Absyn_Equation_EQ__IF__desc__fields -}; -#endif -#else /* Only use the file as a header */ -extern struct record_description Absyn_Equation_EQ__IF__desc; -#endif -#define Absyn__EQ_5fIF_3dBOX4 3 -#define Absyn__EQ_5fIF(ifExp,equationTrueItems,elseIfBranches,equationElseItems) (mmc_mk_box5(3,&Absyn_Equation_EQ__IF__desc,ifExp,equationTrueItems,elseIfBranches,equationElseItems)) -#ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Equation_EQ__EQUALS__desc_added -#define Absyn_Equation_EQ__EQUALS__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Equation_EQ__EQUALS__desc__fields[2] = {"leftSide","rightSide"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Equation_EQ__EQUALS__desc = { - "Absyn_Equation_EQ__EQUALS", - "Absyn.Equation.EQ_EQUALS", - Absyn_Equation_EQ__EQUALS__desc__fields +#ifndef Absyn_AlgorithmItem_ALGORITHMITEM__desc_added +#define Absyn_AlgorithmItem_ALGORITHMITEM__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_AlgorithmItem_ALGORITHMITEM__desc__fields[3] = {"algorithm_","comment","info"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_AlgorithmItem_ALGORITHMITEM__desc = { + "Absyn_AlgorithmItem_ALGORITHMITEM", + "Absyn.AlgorithmItem.ALGORITHMITEM", + Absyn_AlgorithmItem_ALGORITHMITEM__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Equation_EQ__EQUALS__desc; +extern struct record_description Absyn_AlgorithmItem_ALGORITHMITEM__desc; #endif -#define Absyn__EQ_5fEQUALS_3dBOX2 4 -#define Absyn__EQ_5fEQUALS(leftSide,rightSide) (mmc_mk_box3(4,&Absyn_Equation_EQ__EQUALS__desc,leftSide,rightSide)) +#define Absyn__ALGORITHMITEM_3dBOX3 3 +#define Absyn__ALGORITHMITEM(algorithm_,comment,info) (mmc_mk_box4(3,&Absyn_AlgorithmItem_ALGORITHMITEM__desc,algorithm_,comment,info)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Equation_EQ__CONNECT__desc_added -#define Absyn_Equation_EQ__CONNECT__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Equation_EQ__CONNECT__desc__fields[2] = {"connector1","connector2"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Equation_EQ__CONNECT__desc = { - "Absyn_Equation_EQ__CONNECT", - "Absyn.Equation.EQ_CONNECT", - Absyn_Equation_EQ__CONNECT__desc__fields +#ifndef Absyn_Equation_EQ__FAILURE__desc_added +#define Absyn_Equation_EQ__FAILURE__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Equation_EQ__FAILURE__desc__fields[1] = {"equ"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Equation_EQ__FAILURE__desc = { + "Absyn_Equation_EQ__FAILURE", + "Absyn.Equation.EQ_FAILURE", + Absyn_Equation_EQ__FAILURE__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Equation_EQ__CONNECT__desc; +extern struct record_description Absyn_Equation_EQ__FAILURE__desc; #endif -#define Absyn__EQ_5fCONNECT_3dBOX2 5 -#define Absyn__EQ_5fCONNECT(connector1,connector2) (mmc_mk_box3(5,&Absyn_Equation_EQ__CONNECT__desc,connector1,connector2)) +#define Absyn__EQ_5fFAILURE_3dBOX1 9 +#define Absyn__EQ_5fFAILURE(equ) (mmc_mk_box2(9,&Absyn_Equation_EQ__FAILURE__desc,equ)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Equation_EQ__FOR__desc_added -#define Absyn_Equation_EQ__FOR__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Equation_EQ__FOR__desc__fields[2] = {"iterators","forEquations"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Equation_EQ__FOR__desc = { - "Absyn_Equation_EQ__FOR", - "Absyn.Equation.EQ_FOR", - Absyn_Equation_EQ__FOR__desc__fields +#ifndef Absyn_Equation_EQ__NORETCALL__desc_added +#define Absyn_Equation_EQ__NORETCALL__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Equation_EQ__NORETCALL__desc__fields[2] = {"functionName","functionArgs"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Equation_EQ__NORETCALL__desc = { + "Absyn_Equation_EQ__NORETCALL", + "Absyn.Equation.EQ_NORETCALL", + Absyn_Equation_EQ__NORETCALL__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Equation_EQ__FOR__desc; +extern struct record_description Absyn_Equation_EQ__NORETCALL__desc; #endif -#define Absyn__EQ_5fFOR_3dBOX2 6 -#define Absyn__EQ_5fFOR(iterators,forEquations) (mmc_mk_box3(6,&Absyn_Equation_EQ__FOR__desc,iterators,forEquations)) +#define Absyn__EQ_5fNORETCALL_3dBOX2 8 +#define Absyn__EQ_5fNORETCALL(functionName,functionArgs) (mmc_mk_box3(8,&Absyn_Equation_EQ__NORETCALL__desc,functionName,functionArgs)) #ifdef ADD_METARECORD_DEFINITIONS #ifndef Absyn_Equation_EQ__WHEN__E__desc_added #define Absyn_Equation_EQ__WHEN__E__desc_added @@ -1941,125 +1911,143 @@ extern struct record_description Absyn_Equation_EQ__WHEN__E__desc; #define Absyn__EQ_5fWHEN_5fE_3dBOX3 7 #define Absyn__EQ_5fWHEN_5fE(whenExp,whenEquations,elseWhenEquations) (mmc_mk_box4(7,&Absyn_Equation_EQ__WHEN__E__desc,whenExp,whenEquations,elseWhenEquations)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Equation_EQ__NORETCALL__desc_added -#define Absyn_Equation_EQ__NORETCALL__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Equation_EQ__NORETCALL__desc__fields[2] = {"functionName","functionArgs"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Equation_EQ__NORETCALL__desc = { - "Absyn_Equation_EQ__NORETCALL", - "Absyn.Equation.EQ_NORETCALL", - Absyn_Equation_EQ__NORETCALL__desc__fields +#ifndef Absyn_Equation_EQ__FOR__desc_added +#define Absyn_Equation_EQ__FOR__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Equation_EQ__FOR__desc__fields[2] = {"iterators","forEquations"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Equation_EQ__FOR__desc = { + "Absyn_Equation_EQ__FOR", + "Absyn.Equation.EQ_FOR", + Absyn_Equation_EQ__FOR__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Equation_EQ__NORETCALL__desc; +extern struct record_description Absyn_Equation_EQ__FOR__desc; #endif -#define Absyn__EQ_5fNORETCALL_3dBOX2 8 -#define Absyn__EQ_5fNORETCALL(functionName,functionArgs) (mmc_mk_box3(8,&Absyn_Equation_EQ__NORETCALL__desc,functionName,functionArgs)) +#define Absyn__EQ_5fFOR_3dBOX2 6 +#define Absyn__EQ_5fFOR(iterators,forEquations) (mmc_mk_box3(6,&Absyn_Equation_EQ__FOR__desc,iterators,forEquations)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Equation_EQ__FAILURE__desc_added -#define Absyn_Equation_EQ__FAILURE__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Equation_EQ__FAILURE__desc__fields[1] = {"equ"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Equation_EQ__FAILURE__desc = { - "Absyn_Equation_EQ__FAILURE", - "Absyn.Equation.EQ_FAILURE", - Absyn_Equation_EQ__FAILURE__desc__fields +#ifndef Absyn_Equation_EQ__CONNECT__desc_added +#define Absyn_Equation_EQ__CONNECT__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Equation_EQ__CONNECT__desc__fields[2] = {"connector1","connector2"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Equation_EQ__CONNECT__desc = { + "Absyn_Equation_EQ__CONNECT", + "Absyn.Equation.EQ_CONNECT", + Absyn_Equation_EQ__CONNECT__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Equation_EQ__FAILURE__desc; +extern struct record_description Absyn_Equation_EQ__CONNECT__desc; #endif -#define Absyn__EQ_5fFAILURE_3dBOX1 9 -#define Absyn__EQ_5fFAILURE(equ) (mmc_mk_box2(9,&Absyn_Equation_EQ__FAILURE__desc,equ)) +#define Absyn__EQ_5fCONNECT_3dBOX2 5 +#define Absyn__EQ_5fCONNECT(connector1,connector2) (mmc_mk_box3(5,&Absyn_Equation_EQ__CONNECT__desc,connector1,connector2)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Algorithm_ALG__ASSIGN__desc_added -#define Absyn_Algorithm_ALG__ASSIGN__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Algorithm_ALG__ASSIGN__desc__fields[2] = {"assignComponent","value"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Algorithm_ALG__ASSIGN__desc = { - "Absyn_Algorithm_ALG__ASSIGN", - "Absyn.Algorithm.ALG_ASSIGN", - Absyn_Algorithm_ALG__ASSIGN__desc__fields +#ifndef Absyn_Equation_EQ__EQUALS__desc_added +#define Absyn_Equation_EQ__EQUALS__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Equation_EQ__EQUALS__desc__fields[2] = {"leftSide","rightSide"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Equation_EQ__EQUALS__desc = { + "Absyn_Equation_EQ__EQUALS", + "Absyn.Equation.EQ_EQUALS", + Absyn_Equation_EQ__EQUALS__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Algorithm_ALG__ASSIGN__desc; +extern struct record_description Absyn_Equation_EQ__EQUALS__desc; #endif -#define Absyn__ALG_5fASSIGN_3dBOX2 3 -#define Absyn__ALG_5fASSIGN(assignComponent,value) (mmc_mk_box3(3,&Absyn_Algorithm_ALG__ASSIGN__desc,assignComponent,value)) +#define Absyn__EQ_5fEQUALS_3dBOX2 4 +#define Absyn__EQ_5fEQUALS(leftSide,rightSide) (mmc_mk_box3(4,&Absyn_Equation_EQ__EQUALS__desc,leftSide,rightSide)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Algorithm_ALG__IF__desc_added -#define Absyn_Algorithm_ALG__IF__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Algorithm_ALG__IF__desc__fields[4] = {"ifExp","trueBranch","elseIfAlgorithmBranch","elseBranch"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Algorithm_ALG__IF__desc = { - "Absyn_Algorithm_ALG__IF", - "Absyn.Algorithm.ALG_IF", - Absyn_Algorithm_ALG__IF__desc__fields +#ifndef Absyn_Equation_EQ__IF__desc_added +#define Absyn_Equation_EQ__IF__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Equation_EQ__IF__desc__fields[4] = {"ifExp","equationTrueItems","elseIfBranches","equationElseItems"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Equation_EQ__IF__desc = { + "Absyn_Equation_EQ__IF", + "Absyn.Equation.EQ_IF", + Absyn_Equation_EQ__IF__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Algorithm_ALG__IF__desc; +extern struct record_description Absyn_Equation_EQ__IF__desc; #endif -#define Absyn__ALG_5fIF_3dBOX4 4 -#define Absyn__ALG_5fIF(ifExp,trueBranch,elseIfAlgorithmBranch,elseBranch) (mmc_mk_box5(4,&Absyn_Algorithm_ALG__IF__desc,ifExp,trueBranch,elseIfAlgorithmBranch,elseBranch)) +#define Absyn__EQ_5fIF_3dBOX4 3 +#define Absyn__EQ_5fIF(ifExp,equationTrueItems,elseIfBranches,equationElseItems) (mmc_mk_box5(3,&Absyn_Equation_EQ__IF__desc,ifExp,equationTrueItems,elseIfBranches,equationElseItems)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Algorithm_ALG__FOR__desc_added -#define Absyn_Algorithm_ALG__FOR__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Algorithm_ALG__FOR__desc__fields[2] = {"iterators","forBody"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Algorithm_ALG__FOR__desc = { - "Absyn_Algorithm_ALG__FOR", - "Absyn.Algorithm.ALG_FOR", - Absyn_Algorithm_ALG__FOR__desc__fields +#ifndef Absyn_Algorithm_ALG__CONTINUE__desc_added +#define Absyn_Algorithm_ALG__CONTINUE__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Algorithm_ALG__CONTINUE__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Algorithm_ALG__CONTINUE__desc = { + "Absyn_Algorithm_ALG__CONTINUE", + "Absyn.Algorithm.ALG_CONTINUE", + Absyn_Algorithm_ALG__CONTINUE__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Algorithm_ALG__FOR__desc; +extern struct record_description Absyn_Algorithm_ALG__CONTINUE__desc; #endif -#define Absyn__ALG_5fFOR_3dBOX2 5 -#define Absyn__ALG_5fFOR(iterators,forBody) (mmc_mk_box3(5,&Absyn_Algorithm_ALG__FOR__desc,iterators,forBody)) +#define Absyn__ALG_5fCONTINUE_3dBOX0 14 +static const MMC_DEFSTRUCTLIT(Absyn__ALG_5fCONTINUE__struct,1,14) {&Absyn_Algorithm_ALG__CONTINUE__desc}}; +static void *Absyn__ALG_5fCONTINUE = MMC_REFSTRUCTLIT(Absyn__ALG_5fCONTINUE__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Algorithm_ALG__PARFOR__desc_added -#define Absyn_Algorithm_ALG__PARFOR__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Algorithm_ALG__PARFOR__desc__fields[2] = {"iterators","parforBody"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Algorithm_ALG__PARFOR__desc = { - "Absyn_Algorithm_ALG__PARFOR", - "Absyn.Algorithm.ALG_PARFOR", - Absyn_Algorithm_ALG__PARFOR__desc__fields +#ifndef Absyn_Algorithm_ALG__TRY__desc_added +#define Absyn_Algorithm_ALG__TRY__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Algorithm_ALG__TRY__desc__fields[2] = {"body","elseBody"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Algorithm_ALG__TRY__desc = { + "Absyn_Algorithm_ALG__TRY", + "Absyn.Algorithm.ALG_TRY", + Absyn_Algorithm_ALG__TRY__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Algorithm_ALG__PARFOR__desc; +extern struct record_description Absyn_Algorithm_ALG__TRY__desc; #endif -#define Absyn__ALG_5fPARFOR_3dBOX2 6 -#define Absyn__ALG_5fPARFOR(iterators,parforBody) (mmc_mk_box3(6,&Absyn_Algorithm_ALG__PARFOR__desc,iterators,parforBody)) +#define Absyn__ALG_5fTRY_3dBOX2 13 +#define Absyn__ALG_5fTRY(body,elseBody) (mmc_mk_box3(13,&Absyn_Algorithm_ALG__TRY__desc,body,elseBody)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Algorithm_ALG__WHILE__desc_added -#define Absyn_Algorithm_ALG__WHILE__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Algorithm_ALG__WHILE__desc__fields[2] = {"boolExpr","whileBody"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Algorithm_ALG__WHILE__desc = { - "Absyn_Algorithm_ALG__WHILE", - "Absyn.Algorithm.ALG_WHILE", - Absyn_Algorithm_ALG__WHILE__desc__fields +#ifndef Absyn_Algorithm_ALG__FAILURE__desc_added +#define Absyn_Algorithm_ALG__FAILURE__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Algorithm_ALG__FAILURE__desc__fields[1] = {"equ"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Algorithm_ALG__FAILURE__desc = { + "Absyn_Algorithm_ALG__FAILURE", + "Absyn.Algorithm.ALG_FAILURE", + Absyn_Algorithm_ALG__FAILURE__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Algorithm_ALG__WHILE__desc; +extern struct record_description Absyn_Algorithm_ALG__FAILURE__desc; #endif -#define Absyn__ALG_5fWHILE_3dBOX2 7 -#define Absyn__ALG_5fWHILE(boolExpr,whileBody) (mmc_mk_box3(7,&Absyn_Algorithm_ALG__WHILE__desc,boolExpr,whileBody)) +#define Absyn__ALG_5fFAILURE_3dBOX1 12 +#define Absyn__ALG_5fFAILURE(equ) (mmc_mk_box2(12,&Absyn_Algorithm_ALG__FAILURE__desc,equ)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Algorithm_ALG__WHEN__A__desc_added -#define Absyn_Algorithm_ALG__WHEN__A__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Algorithm_ALG__WHEN__A__desc__fields[3] = {"boolExpr","whenBody","elseWhenAlgorithmBranch"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Algorithm_ALG__WHEN__A__desc = { - "Absyn_Algorithm_ALG__WHEN__A", - "Absyn.Algorithm.ALG_WHEN_A", - Absyn_Algorithm_ALG__WHEN__A__desc__fields +#ifndef Absyn_Algorithm_ALG__BREAK__desc_added +#define Absyn_Algorithm_ALG__BREAK__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Algorithm_ALG__BREAK__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Algorithm_ALG__BREAK__desc = { + "Absyn_Algorithm_ALG__BREAK", + "Absyn.Algorithm.ALG_BREAK", + Absyn_Algorithm_ALG__BREAK__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Algorithm_ALG__WHEN__A__desc; +extern struct record_description Absyn_Algorithm_ALG__BREAK__desc; #endif -#define Absyn__ALG_5fWHEN_5fA_3dBOX3 8 -#define Absyn__ALG_5fWHEN_5fA(boolExpr,whenBody,elseWhenAlgorithmBranch) (mmc_mk_box4(8,&Absyn_Algorithm_ALG__WHEN__A__desc,boolExpr,whenBody,elseWhenAlgorithmBranch)) +#define Absyn__ALG_5fBREAK_3dBOX0 11 +static const MMC_DEFSTRUCTLIT(Absyn__ALG_5fBREAK__struct,1,11) {&Absyn_Algorithm_ALG__BREAK__desc}}; +static void *Absyn__ALG_5fBREAK = MMC_REFSTRUCTLIT(Absyn__ALG_5fBREAK__struct); +#ifdef ADD_METARECORD_DEFINITIONS +#ifndef Absyn_Algorithm_ALG__RETURN__desc_added +#define Absyn_Algorithm_ALG__RETURN__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Algorithm_ALG__RETURN__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Algorithm_ALG__RETURN__desc = { + "Absyn_Algorithm_ALG__RETURN", + "Absyn.Algorithm.ALG_RETURN", + Absyn_Algorithm_ALG__RETURN__desc__fields +}; +#endif +#else /* Only use the file as a header */ +extern struct record_description Absyn_Algorithm_ALG__RETURN__desc; +#endif +#define Absyn__ALG_5fRETURN_3dBOX0 10 +static const MMC_DEFSTRUCTLIT(Absyn__ALG_5fRETURN__struct,1,10) {&Absyn_Algorithm_ALG__RETURN__desc}}; +static void *Absyn__ALG_5fRETURN = MMC_REFSTRUCTLIT(Absyn__ALG_5fRETURN__struct); #ifdef ADD_METARECORD_DEFINITIONS #ifndef Absyn_Algorithm_ALG__NORETCALL__desc_added #define Absyn_Algorithm_ALG__NORETCALL__desc_added @@ -2076,83 +2064,95 @@ extern struct record_description Absyn_Algorithm_ALG__NORETCALL__desc; #define Absyn__ALG_5fNORETCALL_3dBOX2 9 #define Absyn__ALG_5fNORETCALL(functionCall,functionArgs) (mmc_mk_box3(9,&Absyn_Algorithm_ALG__NORETCALL__desc,functionCall,functionArgs)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Algorithm_ALG__RETURN__desc_added -#define Absyn_Algorithm_ALG__RETURN__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Algorithm_ALG__RETURN__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Algorithm_ALG__RETURN__desc = { - "Absyn_Algorithm_ALG__RETURN", - "Absyn.Algorithm.ALG_RETURN", - Absyn_Algorithm_ALG__RETURN__desc__fields +#ifndef Absyn_Algorithm_ALG__WHEN__A__desc_added +#define Absyn_Algorithm_ALG__WHEN__A__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Algorithm_ALG__WHEN__A__desc__fields[3] = {"boolExpr","whenBody","elseWhenAlgorithmBranch"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Algorithm_ALG__WHEN__A__desc = { + "Absyn_Algorithm_ALG__WHEN__A", + "Absyn.Algorithm.ALG_WHEN_A", + Absyn_Algorithm_ALG__WHEN__A__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Algorithm_ALG__RETURN__desc; +extern struct record_description Absyn_Algorithm_ALG__WHEN__A__desc; #endif -#define Absyn__ALG_5fRETURN_3dBOX0 10 -static const MMC_DEFSTRUCTLIT(Absyn__ALG_5fRETURN__struct,1,10) {&Absyn_Algorithm_ALG__RETURN__desc}}; -static void *Absyn__ALG_5fRETURN = MMC_REFSTRUCTLIT(Absyn__ALG_5fRETURN__struct); +#define Absyn__ALG_5fWHEN_5fA_3dBOX3 8 +#define Absyn__ALG_5fWHEN_5fA(boolExpr,whenBody,elseWhenAlgorithmBranch) (mmc_mk_box4(8,&Absyn_Algorithm_ALG__WHEN__A__desc,boolExpr,whenBody,elseWhenAlgorithmBranch)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Algorithm_ALG__BREAK__desc_added -#define Absyn_Algorithm_ALG__BREAK__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Algorithm_ALG__BREAK__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Algorithm_ALG__BREAK__desc = { - "Absyn_Algorithm_ALG__BREAK", - "Absyn.Algorithm.ALG_BREAK", - Absyn_Algorithm_ALG__BREAK__desc__fields +#ifndef Absyn_Algorithm_ALG__WHILE__desc_added +#define Absyn_Algorithm_ALG__WHILE__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Algorithm_ALG__WHILE__desc__fields[2] = {"boolExpr","whileBody"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Algorithm_ALG__WHILE__desc = { + "Absyn_Algorithm_ALG__WHILE", + "Absyn.Algorithm.ALG_WHILE", + Absyn_Algorithm_ALG__WHILE__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Algorithm_ALG__BREAK__desc; +extern struct record_description Absyn_Algorithm_ALG__WHILE__desc; #endif -#define Absyn__ALG_5fBREAK_3dBOX0 11 -static const MMC_DEFSTRUCTLIT(Absyn__ALG_5fBREAK__struct,1,11) {&Absyn_Algorithm_ALG__BREAK__desc}}; -static void *Absyn__ALG_5fBREAK = MMC_REFSTRUCTLIT(Absyn__ALG_5fBREAK__struct); +#define Absyn__ALG_5fWHILE_3dBOX2 7 +#define Absyn__ALG_5fWHILE(boolExpr,whileBody) (mmc_mk_box3(7,&Absyn_Algorithm_ALG__WHILE__desc,boolExpr,whileBody)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Algorithm_ALG__FAILURE__desc_added -#define Absyn_Algorithm_ALG__FAILURE__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Algorithm_ALG__FAILURE__desc__fields[1] = {"equ"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Algorithm_ALG__FAILURE__desc = { - "Absyn_Algorithm_ALG__FAILURE", - "Absyn.Algorithm.ALG_FAILURE", - Absyn_Algorithm_ALG__FAILURE__desc__fields +#ifndef Absyn_Algorithm_ALG__PARFOR__desc_added +#define Absyn_Algorithm_ALG__PARFOR__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Algorithm_ALG__PARFOR__desc__fields[2] = {"iterators","parforBody"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Algorithm_ALG__PARFOR__desc = { + "Absyn_Algorithm_ALG__PARFOR", + "Absyn.Algorithm.ALG_PARFOR", + Absyn_Algorithm_ALG__PARFOR__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Algorithm_ALG__FAILURE__desc; +extern struct record_description Absyn_Algorithm_ALG__PARFOR__desc; #endif -#define Absyn__ALG_5fFAILURE_3dBOX1 12 -#define Absyn__ALG_5fFAILURE(equ) (mmc_mk_box2(12,&Absyn_Algorithm_ALG__FAILURE__desc,equ)) +#define Absyn__ALG_5fPARFOR_3dBOX2 6 +#define Absyn__ALG_5fPARFOR(iterators,parforBody) (mmc_mk_box3(6,&Absyn_Algorithm_ALG__PARFOR__desc,iterators,parforBody)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Algorithm_ALG__TRY__desc_added -#define Absyn_Algorithm_ALG__TRY__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Algorithm_ALG__TRY__desc__fields[2] = {"body","elseBody"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Algorithm_ALG__TRY__desc = { - "Absyn_Algorithm_ALG__TRY", - "Absyn.Algorithm.ALG_TRY", - Absyn_Algorithm_ALG__TRY__desc__fields +#ifndef Absyn_Algorithm_ALG__FOR__desc_added +#define Absyn_Algorithm_ALG__FOR__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Algorithm_ALG__FOR__desc__fields[2] = {"iterators","forBody"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Algorithm_ALG__FOR__desc = { + "Absyn_Algorithm_ALG__FOR", + "Absyn.Algorithm.ALG_FOR", + Absyn_Algorithm_ALG__FOR__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Algorithm_ALG__TRY__desc; +extern struct record_description Absyn_Algorithm_ALG__FOR__desc; #endif -#define Absyn__ALG_5fTRY_3dBOX2 13 -#define Absyn__ALG_5fTRY(body,elseBody) (mmc_mk_box3(13,&Absyn_Algorithm_ALG__TRY__desc,body,elseBody)) +#define Absyn__ALG_5fFOR_3dBOX2 5 +#define Absyn__ALG_5fFOR(iterators,forBody) (mmc_mk_box3(5,&Absyn_Algorithm_ALG__FOR__desc,iterators,forBody)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Algorithm_ALG__CONTINUE__desc_added -#define Absyn_Algorithm_ALG__CONTINUE__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Algorithm_ALG__CONTINUE__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Algorithm_ALG__CONTINUE__desc = { - "Absyn_Algorithm_ALG__CONTINUE", - "Absyn.Algorithm.ALG_CONTINUE", - Absyn_Algorithm_ALG__CONTINUE__desc__fields +#ifndef Absyn_Algorithm_ALG__IF__desc_added +#define Absyn_Algorithm_ALG__IF__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Algorithm_ALG__IF__desc__fields[4] = {"ifExp","trueBranch","elseIfAlgorithmBranch","elseBranch"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Algorithm_ALG__IF__desc = { + "Absyn_Algorithm_ALG__IF", + "Absyn.Algorithm.ALG_IF", + Absyn_Algorithm_ALG__IF__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Algorithm_ALG__CONTINUE__desc; +extern struct record_description Absyn_Algorithm_ALG__IF__desc; #endif -#define Absyn__ALG_5fCONTINUE_3dBOX0 14 -static const MMC_DEFSTRUCTLIT(Absyn__ALG_5fCONTINUE__struct,1,14) {&Absyn_Algorithm_ALG__CONTINUE__desc}}; -static void *Absyn__ALG_5fCONTINUE = MMC_REFSTRUCTLIT(Absyn__ALG_5fCONTINUE__struct); +#define Absyn__ALG_5fIF_3dBOX4 4 +#define Absyn__ALG_5fIF(ifExp,trueBranch,elseIfAlgorithmBranch,elseBranch) (mmc_mk_box5(4,&Absyn_Algorithm_ALG__IF__desc,ifExp,trueBranch,elseIfAlgorithmBranch,elseBranch)) +#ifdef ADD_METARECORD_DEFINITIONS +#ifndef Absyn_Algorithm_ALG__ASSIGN__desc_added +#define Absyn_Algorithm_ALG__ASSIGN__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Algorithm_ALG__ASSIGN__desc__fields[2] = {"assignComponent","value"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Algorithm_ALG__ASSIGN__desc = { + "Absyn_Algorithm_ALG__ASSIGN", + "Absyn.Algorithm.ALG_ASSIGN", + Absyn_Algorithm_ALG__ASSIGN__desc__fields +}; +#endif +#else /* Only use the file as a header */ +extern struct record_description Absyn_Algorithm_ALG__ASSIGN__desc; +#endif +#define Absyn__ALG_5fASSIGN_3dBOX2 3 +#define Absyn__ALG_5fASSIGN(assignComponent,value) (mmc_mk_box3(3,&Absyn_Algorithm_ALG__ASSIGN__desc,assignComponent,value)) #ifdef ADD_METARECORD_DEFINITIONS #ifndef Absyn_Modification_CLASSMOD__desc_added #define Absyn_Modification_CLASSMOD__desc_added @@ -2169,6 +2169,21 @@ extern struct record_description Absyn_Modification_CLASSMOD__desc; #define Absyn__CLASSMOD_3dBOX2 3 #define Absyn__CLASSMOD(elementArgLst,eqMod) (mmc_mk_box3(3,&Absyn_Modification_CLASSMOD__desc,elementArgLst,eqMod)) #ifdef ADD_METARECORD_DEFINITIONS +#ifndef Absyn_EqMod_EQMOD__desc_added +#define Absyn_EqMod_EQMOD__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_EqMod_EQMOD__desc__fields[2] = {"exp","info"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_EqMod_EQMOD__desc = { + "Absyn_EqMod_EQMOD", + "Absyn.EqMod.EQMOD", + Absyn_EqMod_EQMOD__desc__fields +}; +#endif +#else /* Only use the file as a header */ +extern struct record_description Absyn_EqMod_EQMOD__desc; +#endif +#define Absyn__EQMOD_3dBOX2 4 +#define Absyn__EQMOD(exp,info) (mmc_mk_box3(4,&Absyn_EqMod_EQMOD__desc,exp,info)) +#ifdef ADD_METARECORD_DEFINITIONS #ifndef Absyn_EqMod_NOMOD__desc_added #define Absyn_EqMod_NOMOD__desc_added ADD_METARECORD_DEFINITIONS const char* Absyn_EqMod_NOMOD__desc__fields[1] = {"no fields"}; @@ -2185,20 +2200,20 @@ extern struct record_description Absyn_EqMod_NOMOD__desc; static const MMC_DEFSTRUCTLIT(Absyn__NOMOD__struct,1,3) {&Absyn_EqMod_NOMOD__desc}}; static void *Absyn__NOMOD = MMC_REFSTRUCTLIT(Absyn__NOMOD__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_EqMod_EQMOD__desc_added -#define Absyn_EqMod_EQMOD__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_EqMod_EQMOD__desc__fields[2] = {"exp","info"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_EqMod_EQMOD__desc = { - "Absyn_EqMod_EQMOD", - "Absyn.EqMod.EQMOD", - Absyn_EqMod_EQMOD__desc__fields +#ifndef Absyn_ElementArg_REDECLARATION__desc_added +#define Absyn_ElementArg_REDECLARATION__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_ElementArg_REDECLARATION__desc__fields[6] = {"finalPrefix","redeclareKeywords","eachPrefix","elementSpec","constrainClass","info"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_ElementArg_REDECLARATION__desc = { + "Absyn_ElementArg_REDECLARATION", + "Absyn.ElementArg.REDECLARATION", + Absyn_ElementArg_REDECLARATION__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_EqMod_EQMOD__desc; +extern struct record_description Absyn_ElementArg_REDECLARATION__desc; #endif -#define Absyn__EQMOD_3dBOX2 4 -#define Absyn__EQMOD(exp,info) (mmc_mk_box3(4,&Absyn_EqMod_EQMOD__desc,exp,info)) +#define Absyn__REDECLARATION_3dBOX6 4 +#define Absyn__REDECLARATION(finalPrefix,redeclareKeywords,eachPrefix,elementSpec,constrainClass,info) (mmc_mk_box7(4,&Absyn_ElementArg_REDECLARATION__desc,finalPrefix,redeclareKeywords,eachPrefix,elementSpec,constrainClass,info)) #ifdef ADD_METARECORD_DEFINITIONS #ifndef Absyn_ElementArg_MODIFICATION__desc_added #define Absyn_ElementArg_MODIFICATION__desc_added @@ -2215,36 +2230,21 @@ extern struct record_description Absyn_ElementArg_MODIFICATION__desc; #define Absyn__MODIFICATION_3dBOX6 3 #define Absyn__MODIFICATION(finalPrefix,eachPrefix,path,modification,comment,info) (mmc_mk_box7(3,&Absyn_ElementArg_MODIFICATION__desc,finalPrefix,eachPrefix,path,modification,comment,info)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_ElementArg_REDECLARATION__desc_added -#define Absyn_ElementArg_REDECLARATION__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_ElementArg_REDECLARATION__desc__fields[6] = {"finalPrefix","redeclareKeywords","eachPrefix","elementSpec","constrainClass","info"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_ElementArg_REDECLARATION__desc = { - "Absyn_ElementArg_REDECLARATION", - "Absyn.ElementArg.REDECLARATION", - Absyn_ElementArg_REDECLARATION__desc__fields +#ifndef Absyn_RedeclareKeywords_REDECLARE__REPLACEABLE__desc_added +#define Absyn_RedeclareKeywords_REDECLARE__REPLACEABLE__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_RedeclareKeywords_REDECLARE__REPLACEABLE__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_RedeclareKeywords_REDECLARE__REPLACEABLE__desc = { + "Absyn_RedeclareKeywords_REDECLARE__REPLACEABLE", + "Absyn.RedeclareKeywords.REDECLARE_REPLACEABLE", + Absyn_RedeclareKeywords_REDECLARE__REPLACEABLE__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_ElementArg_REDECLARATION__desc; +extern struct record_description Absyn_RedeclareKeywords_REDECLARE__REPLACEABLE__desc; #endif -#define Absyn__REDECLARATION_3dBOX6 4 -#define Absyn__REDECLARATION(finalPrefix,redeclareKeywords,eachPrefix,elementSpec,constrainClass,info) (mmc_mk_box7(4,&Absyn_ElementArg_REDECLARATION__desc,finalPrefix,redeclareKeywords,eachPrefix,elementSpec,constrainClass,info)) -#ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_RedeclareKeywords_REDECLARE__desc_added -#define Absyn_RedeclareKeywords_REDECLARE__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_RedeclareKeywords_REDECLARE__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_RedeclareKeywords_REDECLARE__desc = { - "Absyn_RedeclareKeywords_REDECLARE", - "Absyn.RedeclareKeywords.REDECLARE", - Absyn_RedeclareKeywords_REDECLARE__desc__fields -}; -#endif -#else /* Only use the file as a header */ -extern struct record_description Absyn_RedeclareKeywords_REDECLARE__desc; -#endif -#define Absyn__REDECLARE_3dBOX0 3 -static const MMC_DEFSTRUCTLIT(Absyn__REDECLARE__struct,1,3) {&Absyn_RedeclareKeywords_REDECLARE__desc}}; -static void *Absyn__REDECLARE = MMC_REFSTRUCTLIT(Absyn__REDECLARE__struct); +#define Absyn__REDECLARE_5fREPLACEABLE_3dBOX0 5 +static const MMC_DEFSTRUCTLIT(Absyn__REDECLARE_5fREPLACEABLE__struct,1,5) {&Absyn_RedeclareKeywords_REDECLARE__REPLACEABLE__desc}}; +static void *Absyn__REDECLARE_5fREPLACEABLE = MMC_REFSTRUCTLIT(Absyn__REDECLARE_5fREPLACEABLE__struct); #ifdef ADD_METARECORD_DEFINITIONS #ifndef Absyn_RedeclareKeywords_REPLACEABLE__desc_added #define Absyn_RedeclareKeywords_REPLACEABLE__desc_added @@ -2262,37 +2262,21 @@ extern struct record_description Absyn_RedeclareKeywords_REPLACEABLE__desc; static const MMC_DEFSTRUCTLIT(Absyn__REPLACEABLE__struct,1,4) {&Absyn_RedeclareKeywords_REPLACEABLE__desc}}; static void *Absyn__REPLACEABLE = MMC_REFSTRUCTLIT(Absyn__REPLACEABLE__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_RedeclareKeywords_REDECLARE__REPLACEABLE__desc_added -#define Absyn_RedeclareKeywords_REDECLARE__REPLACEABLE__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_RedeclareKeywords_REDECLARE__REPLACEABLE__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_RedeclareKeywords_REDECLARE__REPLACEABLE__desc = { - "Absyn_RedeclareKeywords_REDECLARE__REPLACEABLE", - "Absyn.RedeclareKeywords.REDECLARE_REPLACEABLE", - Absyn_RedeclareKeywords_REDECLARE__REPLACEABLE__desc__fields -}; -#endif -#else /* Only use the file as a header */ -extern struct record_description Absyn_RedeclareKeywords_REDECLARE__REPLACEABLE__desc; -#endif -#define Absyn__REDECLARE_5fREPLACEABLE_3dBOX0 5 -static const MMC_DEFSTRUCTLIT(Absyn__REDECLARE_5fREPLACEABLE__struct,1,5) {&Absyn_RedeclareKeywords_REDECLARE__REPLACEABLE__desc}}; -static void *Absyn__REDECLARE_5fREPLACEABLE = MMC_REFSTRUCTLIT(Absyn__REDECLARE_5fREPLACEABLE__struct); -#ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Each_EACH__desc_added -#define Absyn_Each_EACH__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Each_EACH__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Each_EACH__desc = { - "Absyn_Each_EACH", - "Absyn.Each.EACH", - Absyn_Each_EACH__desc__fields +#ifndef Absyn_RedeclareKeywords_REDECLARE__desc_added +#define Absyn_RedeclareKeywords_REDECLARE__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_RedeclareKeywords_REDECLARE__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_RedeclareKeywords_REDECLARE__desc = { + "Absyn_RedeclareKeywords_REDECLARE", + "Absyn.RedeclareKeywords.REDECLARE", + Absyn_RedeclareKeywords_REDECLARE__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Each_EACH__desc; +extern struct record_description Absyn_RedeclareKeywords_REDECLARE__desc; #endif -#define Absyn__EACH_3dBOX0 3 -static const MMC_DEFSTRUCTLIT(Absyn__EACH__struct,1,3) {&Absyn_Each_EACH__desc}}; -static void *Absyn__EACH = MMC_REFSTRUCTLIT(Absyn__EACH__struct); +#define Absyn__REDECLARE_3dBOX0 3 +static const MMC_DEFSTRUCTLIT(Absyn__REDECLARE__struct,1,3) {&Absyn_RedeclareKeywords_REDECLARE__desc}}; +static void *Absyn__REDECLARE = MMC_REFSTRUCTLIT(Absyn__REDECLARE__struct); #ifdef ADD_METARECORD_DEFINITIONS #ifndef Absyn_Each_NON__EACH__desc_added #define Absyn_Each_NON__EACH__desc_added @@ -2310,6 +2294,22 @@ extern struct record_description Absyn_Each_NON__EACH__desc; static const MMC_DEFSTRUCTLIT(Absyn__NON_5fEACH__struct,1,4) {&Absyn_Each_NON__EACH__desc}}; static void *Absyn__NON_5fEACH = MMC_REFSTRUCTLIT(Absyn__NON_5fEACH__struct); #ifdef ADD_METARECORD_DEFINITIONS +#ifndef Absyn_Each_EACH__desc_added +#define Absyn_Each_EACH__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Each_EACH__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Each_EACH__desc = { + "Absyn_Each_EACH", + "Absyn.Each.EACH", + Absyn_Each_EACH__desc__fields +}; +#endif +#else /* Only use the file as a header */ +extern struct record_description Absyn_Each_EACH__desc; +#endif +#define Absyn__EACH_3dBOX0 3 +static const MMC_DEFSTRUCTLIT(Absyn__EACH__struct,1,3) {&Absyn_Each_EACH__desc}}; +static void *Absyn__EACH = MMC_REFSTRUCTLIT(Absyn__EACH__struct); +#ifdef ADD_METARECORD_DEFINITIONS #ifndef Absyn_ElementAttributes_ATTR__desc_added #define Absyn_ElementAttributes_ATTR__desc_added ADD_METARECORD_DEFINITIONS const char* Absyn_ElementAttributes_ATTR__desc__fields[6] = {"flowPrefix","streamPrefix","parallelism","variability","direction","arrayDim"}; @@ -2325,21 +2325,21 @@ extern struct record_description Absyn_ElementAttributes_ATTR__desc; #define Absyn__ATTR_3dBOX6 3 #define Absyn__ATTR(flowPrefix,streamPrefix,parallelism,variability,direction,arrayDim) (mmc_mk_box7(3,&Absyn_ElementAttributes_ATTR__desc,flowPrefix,streamPrefix,parallelism,variability,direction,arrayDim)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Parallelism_PARGLOBAL__desc_added -#define Absyn_Parallelism_PARGLOBAL__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Parallelism_PARGLOBAL__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Parallelism_PARGLOBAL__desc = { - "Absyn_Parallelism_PARGLOBAL", - "Absyn.Parallelism.PARGLOBAL", - Absyn_Parallelism_PARGLOBAL__desc__fields +#ifndef Absyn_Parallelism_NON__PARALLEL__desc_added +#define Absyn_Parallelism_NON__PARALLEL__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Parallelism_NON__PARALLEL__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Parallelism_NON__PARALLEL__desc = { + "Absyn_Parallelism_NON__PARALLEL", + "Absyn.Parallelism.NON_PARALLEL", + Absyn_Parallelism_NON__PARALLEL__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Parallelism_PARGLOBAL__desc; +extern struct record_description Absyn_Parallelism_NON__PARALLEL__desc; #endif -#define Absyn__PARGLOBAL_3dBOX0 3 -static const MMC_DEFSTRUCTLIT(Absyn__PARGLOBAL__struct,1,3) {&Absyn_Parallelism_PARGLOBAL__desc}}; -static void *Absyn__PARGLOBAL = MMC_REFSTRUCTLIT(Absyn__PARGLOBAL__struct); +#define Absyn__NON_5fPARALLEL_3dBOX0 5 +static const MMC_DEFSTRUCTLIT(Absyn__NON_5fPARALLEL__struct,1,5) {&Absyn_Parallelism_NON__PARALLEL__desc}}; +static void *Absyn__NON_5fPARALLEL = MMC_REFSTRUCTLIT(Absyn__NON_5fPARALLEL__struct); #ifdef ADD_METARECORD_DEFINITIONS #ifndef Absyn_Parallelism_PARLOCAL__desc_added #define Absyn_Parallelism_PARLOCAL__desc_added @@ -2357,37 +2357,37 @@ extern struct record_description Absyn_Parallelism_PARLOCAL__desc; static const MMC_DEFSTRUCTLIT(Absyn__PARLOCAL__struct,1,4) {&Absyn_Parallelism_PARLOCAL__desc}}; static void *Absyn__PARLOCAL = MMC_REFSTRUCTLIT(Absyn__PARLOCAL__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Parallelism_NON__PARALLEL__desc_added -#define Absyn_Parallelism_NON__PARALLEL__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Parallelism_NON__PARALLEL__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Parallelism_NON__PARALLEL__desc = { - "Absyn_Parallelism_NON__PARALLEL", - "Absyn.Parallelism.NON_PARALLEL", - Absyn_Parallelism_NON__PARALLEL__desc__fields +#ifndef Absyn_Parallelism_PARGLOBAL__desc_added +#define Absyn_Parallelism_PARGLOBAL__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Parallelism_PARGLOBAL__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Parallelism_PARGLOBAL__desc = { + "Absyn_Parallelism_PARGLOBAL", + "Absyn.Parallelism.PARGLOBAL", + Absyn_Parallelism_PARGLOBAL__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Parallelism_NON__PARALLEL__desc; +extern struct record_description Absyn_Parallelism_PARGLOBAL__desc; #endif -#define Absyn__NON_5fPARALLEL_3dBOX0 5 -static const MMC_DEFSTRUCTLIT(Absyn__NON_5fPARALLEL__struct,1,5) {&Absyn_Parallelism_NON__PARALLEL__desc}}; -static void *Absyn__NON_5fPARALLEL = MMC_REFSTRUCTLIT(Absyn__NON_5fPARALLEL__struct); +#define Absyn__PARGLOBAL_3dBOX0 3 +static const MMC_DEFSTRUCTLIT(Absyn__PARGLOBAL__struct,1,3) {&Absyn_Parallelism_PARGLOBAL__desc}}; +static void *Absyn__PARGLOBAL = MMC_REFSTRUCTLIT(Absyn__PARGLOBAL__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_FlowStream_FLOW__desc_added -#define Absyn_FlowStream_FLOW__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_FlowStream_FLOW__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_FlowStream_FLOW__desc = { - "Absyn_FlowStream_FLOW", - "Absyn.FlowStream.FLOW", - Absyn_FlowStream_FLOW__desc__fields +#ifndef Absyn_FlowStream_NOT__FLOW__STREAM__desc_added +#define Absyn_FlowStream_NOT__FLOW__STREAM__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_FlowStream_NOT__FLOW__STREAM__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_FlowStream_NOT__FLOW__STREAM__desc = { + "Absyn_FlowStream_NOT__FLOW__STREAM", + "Absyn.FlowStream.NOT_FLOW_STREAM", + Absyn_FlowStream_NOT__FLOW__STREAM__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_FlowStream_FLOW__desc; +extern struct record_description Absyn_FlowStream_NOT__FLOW__STREAM__desc; #endif -#define Absyn__FLOW_3dBOX0 3 -static const MMC_DEFSTRUCTLIT(Absyn__FLOW__struct,1,3) {&Absyn_FlowStream_FLOW__desc}}; -static void *Absyn__FLOW = MMC_REFSTRUCTLIT(Absyn__FLOW__struct); +#define Absyn__NOT_5fFLOW_5fSTREAM_3dBOX0 5 +static const MMC_DEFSTRUCTLIT(Absyn__NOT_5fFLOW_5fSTREAM__struct,1,5) {&Absyn_FlowStream_NOT__FLOW__STREAM__desc}}; +static void *Absyn__NOT_5fFLOW_5fSTREAM = MMC_REFSTRUCTLIT(Absyn__NOT_5fFLOW_5fSTREAM__struct); #ifdef ADD_METARECORD_DEFINITIONS #ifndef Absyn_FlowStream_STREAM__desc_added #define Absyn_FlowStream_STREAM__desc_added @@ -2405,53 +2405,37 @@ extern struct record_description Absyn_FlowStream_STREAM__desc; static const MMC_DEFSTRUCTLIT(Absyn__STREAM__struct,1,4) {&Absyn_FlowStream_STREAM__desc}}; static void *Absyn__STREAM = MMC_REFSTRUCTLIT(Absyn__STREAM__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_FlowStream_NOT__FLOW__STREAM__desc_added -#define Absyn_FlowStream_NOT__FLOW__STREAM__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_FlowStream_NOT__FLOW__STREAM__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_FlowStream_NOT__FLOW__STREAM__desc = { - "Absyn_FlowStream_NOT__FLOW__STREAM", - "Absyn.FlowStream.NOT_FLOW_STREAM", - Absyn_FlowStream_NOT__FLOW__STREAM__desc__fields -}; -#endif -#else /* Only use the file as a header */ -extern struct record_description Absyn_FlowStream_NOT__FLOW__STREAM__desc; -#endif -#define Absyn__NOT_5fFLOW_5fSTREAM_3dBOX0 5 -static const MMC_DEFSTRUCTLIT(Absyn__NOT_5fFLOW_5fSTREAM__struct,1,5) {&Absyn_FlowStream_NOT__FLOW__STREAM__desc}}; -static void *Absyn__NOT_5fFLOW_5fSTREAM = MMC_REFSTRUCTLIT(Absyn__NOT_5fFLOW_5fSTREAM__struct); -#ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Variability_VAR__desc_added -#define Absyn_Variability_VAR__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Variability_VAR__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Variability_VAR__desc = { - "Absyn_Variability_VAR", - "Absyn.Variability.VAR", - Absyn_Variability_VAR__desc__fields +#ifndef Absyn_FlowStream_FLOW__desc_added +#define Absyn_FlowStream_FLOW__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_FlowStream_FLOW__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_FlowStream_FLOW__desc = { + "Absyn_FlowStream_FLOW", + "Absyn.FlowStream.FLOW", + Absyn_FlowStream_FLOW__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Variability_VAR__desc; +extern struct record_description Absyn_FlowStream_FLOW__desc; #endif -#define Absyn__VAR_3dBOX0 3 -static const MMC_DEFSTRUCTLIT(Absyn__VAR__struct,1,3) {&Absyn_Variability_VAR__desc}}; -static void *Absyn__VAR = MMC_REFSTRUCTLIT(Absyn__VAR__struct); +#define Absyn__FLOW_3dBOX0 3 +static const MMC_DEFSTRUCTLIT(Absyn__FLOW__struct,1,3) {&Absyn_FlowStream_FLOW__desc}}; +static void *Absyn__FLOW = MMC_REFSTRUCTLIT(Absyn__FLOW__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Variability_DISCRETE__desc_added -#define Absyn_Variability_DISCRETE__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Variability_DISCRETE__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Variability_DISCRETE__desc = { - "Absyn_Variability_DISCRETE", - "Absyn.Variability.DISCRETE", - Absyn_Variability_DISCRETE__desc__fields +#ifndef Absyn_Variability_CONST__desc_added +#define Absyn_Variability_CONST__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Variability_CONST__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Variability_CONST__desc = { + "Absyn_Variability_CONST", + "Absyn.Variability.CONST", + Absyn_Variability_CONST__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Variability_DISCRETE__desc; +extern struct record_description Absyn_Variability_CONST__desc; #endif -#define Absyn__DISCRETE_3dBOX0 4 -static const MMC_DEFSTRUCTLIT(Absyn__DISCRETE__struct,1,4) {&Absyn_Variability_DISCRETE__desc}}; -static void *Absyn__DISCRETE = MMC_REFSTRUCTLIT(Absyn__DISCRETE__struct); +#define Absyn__CONST_3dBOX0 6 +static const MMC_DEFSTRUCTLIT(Absyn__CONST__struct,1,6) {&Absyn_Variability_CONST__desc}}; +static void *Absyn__CONST = MMC_REFSTRUCTLIT(Absyn__CONST__struct); #ifdef ADD_METARECORD_DEFINITIONS #ifndef Absyn_Variability_PARAM__desc_added #define Absyn_Variability_PARAM__desc_added @@ -2469,53 +2453,37 @@ extern struct record_description Absyn_Variability_PARAM__desc; static const MMC_DEFSTRUCTLIT(Absyn__PARAM__struct,1,5) {&Absyn_Variability_PARAM__desc}}; static void *Absyn__PARAM = MMC_REFSTRUCTLIT(Absyn__PARAM__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Variability_CONST__desc_added -#define Absyn_Variability_CONST__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Variability_CONST__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Variability_CONST__desc = { - "Absyn_Variability_CONST", - "Absyn.Variability.CONST", - Absyn_Variability_CONST__desc__fields -}; -#endif -#else /* Only use the file as a header */ -extern struct record_description Absyn_Variability_CONST__desc; -#endif -#define Absyn__CONST_3dBOX0 6 -static const MMC_DEFSTRUCTLIT(Absyn__CONST__struct,1,6) {&Absyn_Variability_CONST__desc}}; -static void *Absyn__CONST = MMC_REFSTRUCTLIT(Absyn__CONST__struct); -#ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Direction_INPUT__desc_added -#define Absyn_Direction_INPUT__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Direction_INPUT__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Direction_INPUT__desc = { - "Absyn_Direction_INPUT", - "Absyn.Direction.INPUT", - Absyn_Direction_INPUT__desc__fields +#ifndef Absyn_Variability_DISCRETE__desc_added +#define Absyn_Variability_DISCRETE__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Variability_DISCRETE__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Variability_DISCRETE__desc = { + "Absyn_Variability_DISCRETE", + "Absyn.Variability.DISCRETE", + Absyn_Variability_DISCRETE__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Direction_INPUT__desc; +extern struct record_description Absyn_Variability_DISCRETE__desc; #endif -#define Absyn__INPUT_3dBOX0 3 -static const MMC_DEFSTRUCTLIT(Absyn__INPUT__struct,1,3) {&Absyn_Direction_INPUT__desc}}; -static void *Absyn__INPUT = MMC_REFSTRUCTLIT(Absyn__INPUT__struct); +#define Absyn__DISCRETE_3dBOX0 4 +static const MMC_DEFSTRUCTLIT(Absyn__DISCRETE__struct,1,4) {&Absyn_Variability_DISCRETE__desc}}; +static void *Absyn__DISCRETE = MMC_REFSTRUCTLIT(Absyn__DISCRETE__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Direction_OUTPUT__desc_added -#define Absyn_Direction_OUTPUT__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Direction_OUTPUT__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Direction_OUTPUT__desc = { - "Absyn_Direction_OUTPUT", - "Absyn.Direction.OUTPUT", - Absyn_Direction_OUTPUT__desc__fields +#ifndef Absyn_Variability_VAR__desc_added +#define Absyn_Variability_VAR__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Variability_VAR__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Variability_VAR__desc = { + "Absyn_Variability_VAR", + "Absyn.Variability.VAR", + Absyn_Variability_VAR__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Direction_OUTPUT__desc; +extern struct record_description Absyn_Variability_VAR__desc; #endif -#define Absyn__OUTPUT_3dBOX0 4 -static const MMC_DEFSTRUCTLIT(Absyn__OUTPUT__struct,1,4) {&Absyn_Direction_OUTPUT__desc}}; -static void *Absyn__OUTPUT = MMC_REFSTRUCTLIT(Absyn__OUTPUT__struct); +#define Absyn__VAR_3dBOX0 3 +static const MMC_DEFSTRUCTLIT(Absyn__VAR__struct,1,3) {&Absyn_Variability_VAR__desc}}; +static void *Absyn__VAR = MMC_REFSTRUCTLIT(Absyn__VAR__struct); #ifdef ADD_METARECORD_DEFINITIONS #ifndef Absyn_Direction_BIDIR__desc_added #define Absyn_Direction_BIDIR__desc_added @@ -2533,200 +2501,188 @@ extern struct record_description Absyn_Direction_BIDIR__desc; static const MMC_DEFSTRUCTLIT(Absyn__BIDIR__struct,1,5) {&Absyn_Direction_BIDIR__desc}}; static void *Absyn__BIDIR = MMC_REFSTRUCTLIT(Absyn__BIDIR__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Exp_INTEGER__desc_added -#define Absyn_Exp_INTEGER__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Exp_INTEGER__desc__fields[1] = {"value"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Exp_INTEGER__desc = { - "Absyn_Exp_INTEGER", - "Absyn.Exp.INTEGER", - Absyn_Exp_INTEGER__desc__fields -}; -#endif -#else /* Only use the file as a header */ -extern struct record_description Absyn_Exp_INTEGER__desc; -#endif -#define Absyn__INTEGER_3dBOX1 3 -#define Absyn__INTEGER(value) (mmc_mk_box2(3,&Absyn_Exp_INTEGER__desc,value)) -#ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Exp_REAL__desc_added -#define Absyn_Exp_REAL__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Exp_REAL__desc__fields[1] = {"value"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Exp_REAL__desc = { - "Absyn_Exp_REAL", - "Absyn.Exp.REAL", - Absyn_Exp_REAL__desc__fields +#ifndef Absyn_Direction_OUTPUT__desc_added +#define Absyn_Direction_OUTPUT__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Direction_OUTPUT__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Direction_OUTPUT__desc = { + "Absyn_Direction_OUTPUT", + "Absyn.Direction.OUTPUT", + Absyn_Direction_OUTPUT__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Exp_REAL__desc; +extern struct record_description Absyn_Direction_OUTPUT__desc; #endif -#define Absyn__REAL_3dBOX1 4 -#define Absyn__REAL(value) (mmc_mk_box2(4,&Absyn_Exp_REAL__desc,value)) +#define Absyn__OUTPUT_3dBOX0 4 +static const MMC_DEFSTRUCTLIT(Absyn__OUTPUT__struct,1,4) {&Absyn_Direction_OUTPUT__desc}}; +static void *Absyn__OUTPUT = MMC_REFSTRUCTLIT(Absyn__OUTPUT__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Exp_CREF__desc_added -#define Absyn_Exp_CREF__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Exp_CREF__desc__fields[1] = {"componentRef"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Exp_CREF__desc = { - "Absyn_Exp_CREF", - "Absyn.Exp.CREF", - Absyn_Exp_CREF__desc__fields +#ifndef Absyn_Direction_INPUT__desc_added +#define Absyn_Direction_INPUT__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Direction_INPUT__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Direction_INPUT__desc = { + "Absyn_Direction_INPUT", + "Absyn.Direction.INPUT", + Absyn_Direction_INPUT__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Exp_CREF__desc; +extern struct record_description Absyn_Direction_INPUT__desc; #endif -#define Absyn__CREF_3dBOX1 5 -#define Absyn__CREF(componentRef) (mmc_mk_box2(5,&Absyn_Exp_CREF__desc,componentRef)) +#define Absyn__INPUT_3dBOX0 3 +static const MMC_DEFSTRUCTLIT(Absyn__INPUT__struct,1,3) {&Absyn_Direction_INPUT__desc}}; +static void *Absyn__INPUT = MMC_REFSTRUCTLIT(Absyn__INPUT__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Exp_STRING__desc_added -#define Absyn_Exp_STRING__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Exp_STRING__desc__fields[1] = {"value"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Exp_STRING__desc = { - "Absyn_Exp_STRING", - "Absyn.Exp.STRING", - Absyn_Exp_STRING__desc__fields +#ifndef Absyn_Exp_DOT__desc_added +#define Absyn_Exp_DOT__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Exp_DOT__desc__fields[2] = {"exp","index"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Exp_DOT__desc = { + "Absyn_Exp_DOT", + "Absyn.Exp.DOT", + Absyn_Exp_DOT__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Exp_STRING__desc; +extern struct record_description Absyn_Exp_DOT__desc; #endif -#define Absyn__STRING_3dBOX1 6 -#define Absyn__STRING(value) (mmc_mk_box2(6,&Absyn_Exp_STRING__desc,value)) +#define Absyn__DOT_3dBOX2 26 +#define Absyn__DOT(exp,index) (mmc_mk_box3(26,&Absyn_Exp_DOT__desc,exp,index)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Exp_BOOL__desc_added -#define Absyn_Exp_BOOL__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Exp_BOOL__desc__fields[1] = {"value"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Exp_BOOL__desc = { - "Absyn_Exp_BOOL", - "Absyn.Exp.BOOL", - Absyn_Exp_BOOL__desc__fields +#ifndef Absyn_Exp_LIST__desc_added +#define Absyn_Exp_LIST__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Exp_LIST__desc__fields[1] = {"exps"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Exp_LIST__desc = { + "Absyn_Exp_LIST", + "Absyn.Exp.LIST", + Absyn_Exp_LIST__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Exp_BOOL__desc; +extern struct record_description Absyn_Exp_LIST__desc; #endif -#define Absyn__BOOL_3dBOX1 7 -#define Absyn__BOOL(value) (mmc_mk_box2(7,&Absyn_Exp_BOOL__desc,value)) +#define Absyn__LIST_3dBOX1 25 +#define Absyn__LIST(exps) (mmc_mk_box2(25,&Absyn_Exp_LIST__desc,exps)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Exp_BINARY__desc_added -#define Absyn_Exp_BINARY__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Exp_BINARY__desc__fields[3] = {"exp1","op","exp2"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Exp_BINARY__desc = { - "Absyn_Exp_BINARY", - "Absyn.Exp.BINARY", - Absyn_Exp_BINARY__desc__fields +#ifndef Absyn_Exp_MATCHEXP__desc_added +#define Absyn_Exp_MATCHEXP__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Exp_MATCHEXP__desc__fields[5] = {"matchTy","inputExp","localDecls","cases","comment"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Exp_MATCHEXP__desc = { + "Absyn_Exp_MATCHEXP", + "Absyn.Exp.MATCHEXP", + Absyn_Exp_MATCHEXP__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Exp_BINARY__desc; +extern struct record_description Absyn_Exp_MATCHEXP__desc; #endif -#define Absyn__BINARY_3dBOX3 8 -#define Absyn__BINARY(exp1,op,exp2) (mmc_mk_box4(8,&Absyn_Exp_BINARY__desc,exp1,op,exp2)) +#define Absyn__MATCHEXP_3dBOX5 24 +#define Absyn__MATCHEXP(matchTy,inputExp,localDecls,cases,comment) (mmc_mk_box6(24,&Absyn_Exp_MATCHEXP__desc,matchTy,inputExp,localDecls,cases,comment)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Exp_UNARY__desc_added -#define Absyn_Exp_UNARY__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Exp_UNARY__desc__fields[2] = {"op","exp"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Exp_UNARY__desc = { - "Absyn_Exp_UNARY", - "Absyn.Exp.UNARY", - Absyn_Exp_UNARY__desc__fields +#ifndef Absyn_Exp_CONS__desc_added +#define Absyn_Exp_CONS__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Exp_CONS__desc__fields[2] = {"head","rest"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Exp_CONS__desc = { + "Absyn_Exp_CONS", + "Absyn.Exp.CONS", + Absyn_Exp_CONS__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Exp_UNARY__desc; +extern struct record_description Absyn_Exp_CONS__desc; #endif -#define Absyn__UNARY_3dBOX2 9 -#define Absyn__UNARY(op,exp) (mmc_mk_box3(9,&Absyn_Exp_UNARY__desc,op,exp)) +#define Absyn__CONS_3dBOX2 23 +#define Absyn__CONS(head,rest) (mmc_mk_box3(23,&Absyn_Exp_CONS__desc,head,rest)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Exp_LBINARY__desc_added -#define Absyn_Exp_LBINARY__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Exp_LBINARY__desc__fields[3] = {"exp1","op","exp2"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Exp_LBINARY__desc = { - "Absyn_Exp_LBINARY", - "Absyn.Exp.LBINARY", - Absyn_Exp_LBINARY__desc__fields +#ifndef Absyn_Exp_AS__desc_added +#define Absyn_Exp_AS__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Exp_AS__desc__fields[2] = {"id","exp"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Exp_AS__desc = { + "Absyn_Exp_AS", + "Absyn.Exp.AS", + Absyn_Exp_AS__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Exp_LBINARY__desc; +extern struct record_description Absyn_Exp_AS__desc; #endif -#define Absyn__LBINARY_3dBOX3 10 -#define Absyn__LBINARY(exp1,op,exp2) (mmc_mk_box4(10,&Absyn_Exp_LBINARY__desc,exp1,op,exp2)) +#define Absyn__AS_3dBOX2 22 +#define Absyn__AS(id,exp) (mmc_mk_box3(22,&Absyn_Exp_AS__desc,id,exp)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Exp_LUNARY__desc_added -#define Absyn_Exp_LUNARY__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Exp_LUNARY__desc__fields[2] = {"op","exp"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Exp_LUNARY__desc = { - "Absyn_Exp_LUNARY", - "Absyn.Exp.LUNARY", - Absyn_Exp_LUNARY__desc__fields +#ifndef Absyn_Exp_CODE__desc_added +#define Absyn_Exp_CODE__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Exp_CODE__desc__fields[1] = {"code"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Exp_CODE__desc = { + "Absyn_Exp_CODE", + "Absyn.Exp.CODE", + Absyn_Exp_CODE__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Exp_LUNARY__desc; +extern struct record_description Absyn_Exp_CODE__desc; #endif -#define Absyn__LUNARY_3dBOX2 11 -#define Absyn__LUNARY(op,exp) (mmc_mk_box3(11,&Absyn_Exp_LUNARY__desc,op,exp)) +#define Absyn__CODE_3dBOX1 21 +#define Absyn__CODE(code) (mmc_mk_box2(21,&Absyn_Exp_CODE__desc,code)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Exp_RELATION__desc_added -#define Absyn_Exp_RELATION__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Exp_RELATION__desc__fields[3] = {"exp1","op","exp2"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Exp_RELATION__desc = { - "Absyn_Exp_RELATION", - "Absyn.Exp.RELATION", - Absyn_Exp_RELATION__desc__fields +#ifndef Absyn_Exp_END__desc_added +#define Absyn_Exp_END__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Exp_END__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Exp_END__desc = { + "Absyn_Exp_END", + "Absyn.Exp.END", + Absyn_Exp_END__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Exp_RELATION__desc; +extern struct record_description Absyn_Exp_END__desc; #endif -#define Absyn__RELATION_3dBOX3 12 -#define Absyn__RELATION(exp1,op,exp2) (mmc_mk_box4(12,&Absyn_Exp_RELATION__desc,exp1,op,exp2)) +#define Absyn__END_3dBOX0 20 +static const MMC_DEFSTRUCTLIT(Absyn__END__struct,1,20) {&Absyn_Exp_END__desc}}; +static void *Absyn__END = MMC_REFSTRUCTLIT(Absyn__END__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Exp_IFEXP__desc_added -#define Absyn_Exp_IFEXP__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Exp_IFEXP__desc__fields[4] = {"ifExp","trueBranch","elseBranch","elseIfBranch"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Exp_IFEXP__desc = { - "Absyn_Exp_IFEXP", - "Absyn.Exp.IFEXP", - Absyn_Exp_IFEXP__desc__fields +#ifndef Absyn_Exp_TUPLE__desc_added +#define Absyn_Exp_TUPLE__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Exp_TUPLE__desc__fields[1] = {"expressions"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Exp_TUPLE__desc = { + "Absyn_Exp_TUPLE", + "Absyn.Exp.TUPLE", + Absyn_Exp_TUPLE__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Exp_IFEXP__desc; +extern struct record_description Absyn_Exp_TUPLE__desc; #endif -#define Absyn__IFEXP_3dBOX4 13 -#define Absyn__IFEXP(ifExp,trueBranch,elseBranch,elseIfBranch) (mmc_mk_box5(13,&Absyn_Exp_IFEXP__desc,ifExp,trueBranch,elseBranch,elseIfBranch)) +#define Absyn__TUPLE_3dBOX1 19 +#define Absyn__TUPLE(expressions) (mmc_mk_box2(19,&Absyn_Exp_TUPLE__desc,expressions)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Exp_CALL__desc_added -#define Absyn_Exp_CALL__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Exp_CALL__desc__fields[2] = {"function_","functionArgs"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Exp_CALL__desc = { - "Absyn_Exp_CALL", - "Absyn.Exp.CALL", - Absyn_Exp_CALL__desc__fields +#ifndef Absyn_Exp_RANGE__desc_added +#define Absyn_Exp_RANGE__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Exp_RANGE__desc__fields[3] = {"start","step","stop"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Exp_RANGE__desc = { + "Absyn_Exp_RANGE", + "Absyn.Exp.RANGE", + Absyn_Exp_RANGE__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Exp_CALL__desc; +extern struct record_description Absyn_Exp_RANGE__desc; #endif -#define Absyn__CALL_3dBOX2 14 -#define Absyn__CALL(function_,functionArgs) (mmc_mk_box3(14,&Absyn_Exp_CALL__desc,function_,functionArgs)) +#define Absyn__RANGE_3dBOX3 18 +#define Absyn__RANGE(start,step,stop) (mmc_mk_box4(18,&Absyn_Exp_RANGE__desc,start,step,stop)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Exp_PARTEVALFUNCTION__desc_added -#define Absyn_Exp_PARTEVALFUNCTION__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Exp_PARTEVALFUNCTION__desc__fields[2] = {"function_","functionArgs"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Exp_PARTEVALFUNCTION__desc = { - "Absyn_Exp_PARTEVALFUNCTION", - "Absyn.Exp.PARTEVALFUNCTION", - Absyn_Exp_PARTEVALFUNCTION__desc__fields +#ifndef Absyn_Exp_MATRIX__desc_added +#define Absyn_Exp_MATRIX__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Exp_MATRIX__desc__fields[1] = {"matrix"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Exp_MATRIX__desc = { + "Absyn_Exp_MATRIX", + "Absyn.Exp.MATRIX", + Absyn_Exp_MATRIX__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Exp_PARTEVALFUNCTION__desc; +extern struct record_description Absyn_Exp_MATRIX__desc; #endif -#define Absyn__PARTEVALFUNCTION_3dBOX2 15 -#define Absyn__PARTEVALFUNCTION(function_,functionArgs) (mmc_mk_box3(15,&Absyn_Exp_PARTEVALFUNCTION__desc,function_,functionArgs)) +#define Absyn__MATRIX_3dBOX1 17 +#define Absyn__MATRIX(matrix) (mmc_mk_box2(17,&Absyn_Exp_MATRIX__desc,matrix)) #ifdef ADD_METARECORD_DEFINITIONS #ifndef Absyn_Exp_ARRAY__desc_added #define Absyn_Exp_ARRAY__desc_added @@ -2743,171 +2699,200 @@ extern struct record_description Absyn_Exp_ARRAY__desc; #define Absyn__ARRAY_3dBOX1 16 #define Absyn__ARRAY(arrayExp) (mmc_mk_box2(16,&Absyn_Exp_ARRAY__desc,arrayExp)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Exp_MATRIX__desc_added -#define Absyn_Exp_MATRIX__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Exp_MATRIX__desc__fields[1] = {"matrix"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Exp_MATRIX__desc = { - "Absyn_Exp_MATRIX", - "Absyn.Exp.MATRIX", - Absyn_Exp_MATRIX__desc__fields -}; +#ifndef Absyn_Exp_PARTEVALFUNCTION__desc_added +#define Absyn_Exp_PARTEVALFUNCTION__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Exp_PARTEVALFUNCTION__desc__fields[2] = {"function_","functionArgs"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Exp_PARTEVALFUNCTION__desc = { + "Absyn_Exp_PARTEVALFUNCTION", + "Absyn.Exp.PARTEVALFUNCTION", + Absyn_Exp_PARTEVALFUNCTION__desc__fields +}; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Exp_MATRIX__desc; +extern struct record_description Absyn_Exp_PARTEVALFUNCTION__desc; #endif -#define Absyn__MATRIX_3dBOX1 17 -#define Absyn__MATRIX(matrix) (mmc_mk_box2(17,&Absyn_Exp_MATRIX__desc,matrix)) +#define Absyn__PARTEVALFUNCTION_3dBOX2 15 +#define Absyn__PARTEVALFUNCTION(function_,functionArgs) (mmc_mk_box3(15,&Absyn_Exp_PARTEVALFUNCTION__desc,function_,functionArgs)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Exp_RANGE__desc_added -#define Absyn_Exp_RANGE__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Exp_RANGE__desc__fields[3] = {"start","step","stop"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Exp_RANGE__desc = { - "Absyn_Exp_RANGE", - "Absyn.Exp.RANGE", - Absyn_Exp_RANGE__desc__fields +#ifndef Absyn_Exp_CALL__desc_added +#define Absyn_Exp_CALL__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Exp_CALL__desc__fields[2] = {"function_","functionArgs"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Exp_CALL__desc = { + "Absyn_Exp_CALL", + "Absyn.Exp.CALL", + Absyn_Exp_CALL__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Exp_RANGE__desc; +extern struct record_description Absyn_Exp_CALL__desc; #endif -#define Absyn__RANGE_3dBOX3 18 -#define Absyn__RANGE(start,step,stop) (mmc_mk_box4(18,&Absyn_Exp_RANGE__desc,start,step,stop)) +#define Absyn__CALL_3dBOX2 14 +#define Absyn__CALL(function_,functionArgs) (mmc_mk_box3(14,&Absyn_Exp_CALL__desc,function_,functionArgs)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Exp_TUPLE__desc_added -#define Absyn_Exp_TUPLE__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Exp_TUPLE__desc__fields[1] = {"expressions"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Exp_TUPLE__desc = { - "Absyn_Exp_TUPLE", - "Absyn.Exp.TUPLE", - Absyn_Exp_TUPLE__desc__fields +#ifndef Absyn_Exp_IFEXP__desc_added +#define Absyn_Exp_IFEXP__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Exp_IFEXP__desc__fields[4] = {"ifExp","trueBranch","elseBranch","elseIfBranch"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Exp_IFEXP__desc = { + "Absyn_Exp_IFEXP", + "Absyn.Exp.IFEXP", + Absyn_Exp_IFEXP__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Exp_TUPLE__desc; +extern struct record_description Absyn_Exp_IFEXP__desc; #endif -#define Absyn__TUPLE_3dBOX1 19 -#define Absyn__TUPLE(expressions) (mmc_mk_box2(19,&Absyn_Exp_TUPLE__desc,expressions)) +#define Absyn__IFEXP_3dBOX4 13 +#define Absyn__IFEXP(ifExp,trueBranch,elseBranch,elseIfBranch) (mmc_mk_box5(13,&Absyn_Exp_IFEXP__desc,ifExp,trueBranch,elseBranch,elseIfBranch)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Exp_END__desc_added -#define Absyn_Exp_END__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Exp_END__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Exp_END__desc = { - "Absyn_Exp_END", - "Absyn.Exp.END", - Absyn_Exp_END__desc__fields +#ifndef Absyn_Exp_RELATION__desc_added +#define Absyn_Exp_RELATION__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Exp_RELATION__desc__fields[3] = {"exp1","op","exp2"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Exp_RELATION__desc = { + "Absyn_Exp_RELATION", + "Absyn.Exp.RELATION", + Absyn_Exp_RELATION__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Exp_END__desc; +extern struct record_description Absyn_Exp_RELATION__desc; #endif -#define Absyn__END_3dBOX0 20 -static const MMC_DEFSTRUCTLIT(Absyn__END__struct,1,20) {&Absyn_Exp_END__desc}}; -static void *Absyn__END = MMC_REFSTRUCTLIT(Absyn__END__struct); +#define Absyn__RELATION_3dBOX3 12 +#define Absyn__RELATION(exp1,op,exp2) (mmc_mk_box4(12,&Absyn_Exp_RELATION__desc,exp1,op,exp2)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Exp_CODE__desc_added -#define Absyn_Exp_CODE__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Exp_CODE__desc__fields[1] = {"code"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Exp_CODE__desc = { - "Absyn_Exp_CODE", - "Absyn.Exp.CODE", - Absyn_Exp_CODE__desc__fields +#ifndef Absyn_Exp_LUNARY__desc_added +#define Absyn_Exp_LUNARY__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Exp_LUNARY__desc__fields[2] = {"op","exp"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Exp_LUNARY__desc = { + "Absyn_Exp_LUNARY", + "Absyn.Exp.LUNARY", + Absyn_Exp_LUNARY__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Exp_CODE__desc; +extern struct record_description Absyn_Exp_LUNARY__desc; #endif -#define Absyn__CODE_3dBOX1 21 -#define Absyn__CODE(code) (mmc_mk_box2(21,&Absyn_Exp_CODE__desc,code)) +#define Absyn__LUNARY_3dBOX2 11 +#define Absyn__LUNARY(op,exp) (mmc_mk_box3(11,&Absyn_Exp_LUNARY__desc,op,exp)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Exp_AS__desc_added -#define Absyn_Exp_AS__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Exp_AS__desc__fields[2] = {"id","exp"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Exp_AS__desc = { - "Absyn_Exp_AS", - "Absyn.Exp.AS", - Absyn_Exp_AS__desc__fields +#ifndef Absyn_Exp_LBINARY__desc_added +#define Absyn_Exp_LBINARY__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Exp_LBINARY__desc__fields[3] = {"exp1","op","exp2"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Exp_LBINARY__desc = { + "Absyn_Exp_LBINARY", + "Absyn.Exp.LBINARY", + Absyn_Exp_LBINARY__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Exp_AS__desc; +extern struct record_description Absyn_Exp_LBINARY__desc; #endif -#define Absyn__AS_3dBOX2 22 -#define Absyn__AS(id,exp) (mmc_mk_box3(22,&Absyn_Exp_AS__desc,id,exp)) +#define Absyn__LBINARY_3dBOX3 10 +#define Absyn__LBINARY(exp1,op,exp2) (mmc_mk_box4(10,&Absyn_Exp_LBINARY__desc,exp1,op,exp2)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Exp_CONS__desc_added -#define Absyn_Exp_CONS__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Exp_CONS__desc__fields[2] = {"head","rest"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Exp_CONS__desc = { - "Absyn_Exp_CONS", - "Absyn.Exp.CONS", - Absyn_Exp_CONS__desc__fields +#ifndef Absyn_Exp_UNARY__desc_added +#define Absyn_Exp_UNARY__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Exp_UNARY__desc__fields[2] = {"op","exp"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Exp_UNARY__desc = { + "Absyn_Exp_UNARY", + "Absyn.Exp.UNARY", + Absyn_Exp_UNARY__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Exp_CONS__desc; +extern struct record_description Absyn_Exp_UNARY__desc; #endif -#define Absyn__CONS_3dBOX2 23 -#define Absyn__CONS(head,rest) (mmc_mk_box3(23,&Absyn_Exp_CONS__desc,head,rest)) +#define Absyn__UNARY_3dBOX2 9 +#define Absyn__UNARY(op,exp) (mmc_mk_box3(9,&Absyn_Exp_UNARY__desc,op,exp)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Exp_MATCHEXP__desc_added -#define Absyn_Exp_MATCHEXP__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Exp_MATCHEXP__desc__fields[5] = {"matchTy","inputExp","localDecls","cases","comment"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Exp_MATCHEXP__desc = { - "Absyn_Exp_MATCHEXP", - "Absyn.Exp.MATCHEXP", - Absyn_Exp_MATCHEXP__desc__fields +#ifndef Absyn_Exp_BINARY__desc_added +#define Absyn_Exp_BINARY__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Exp_BINARY__desc__fields[3] = {"exp1","op","exp2"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Exp_BINARY__desc = { + "Absyn_Exp_BINARY", + "Absyn.Exp.BINARY", + Absyn_Exp_BINARY__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Exp_MATCHEXP__desc; +extern struct record_description Absyn_Exp_BINARY__desc; #endif -#define Absyn__MATCHEXP_3dBOX5 24 -#define Absyn__MATCHEXP(matchTy,inputExp,localDecls,cases,comment) (mmc_mk_box6(24,&Absyn_Exp_MATCHEXP__desc,matchTy,inputExp,localDecls,cases,comment)) +#define Absyn__BINARY_3dBOX3 8 +#define Absyn__BINARY(exp1,op,exp2) (mmc_mk_box4(8,&Absyn_Exp_BINARY__desc,exp1,op,exp2)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Exp_LIST__desc_added -#define Absyn_Exp_LIST__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Exp_LIST__desc__fields[1] = {"exps"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Exp_LIST__desc = { - "Absyn_Exp_LIST", - "Absyn.Exp.LIST", - Absyn_Exp_LIST__desc__fields +#ifndef Absyn_Exp_BOOL__desc_added +#define Absyn_Exp_BOOL__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Exp_BOOL__desc__fields[1] = {"value"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Exp_BOOL__desc = { + "Absyn_Exp_BOOL", + "Absyn.Exp.BOOL", + Absyn_Exp_BOOL__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Exp_LIST__desc; +extern struct record_description Absyn_Exp_BOOL__desc; #endif -#define Absyn__LIST_3dBOX1 25 -#define Absyn__LIST(exps) (mmc_mk_box2(25,&Absyn_Exp_LIST__desc,exps)) +#define Absyn__BOOL_3dBOX1 7 +#define Absyn__BOOL(value) (mmc_mk_box2(7,&Absyn_Exp_BOOL__desc,value)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Exp_DOT__desc_added -#define Absyn_Exp_DOT__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Exp_DOT__desc__fields[2] = {"exp","index"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Exp_DOT__desc = { - "Absyn_Exp_DOT", - "Absyn.Exp.DOT", - Absyn_Exp_DOT__desc__fields +#ifndef Absyn_Exp_STRING__desc_added +#define Absyn_Exp_STRING__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Exp_STRING__desc__fields[1] = {"value"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Exp_STRING__desc = { + "Absyn_Exp_STRING", + "Absyn.Exp.STRING", + Absyn_Exp_STRING__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Exp_DOT__desc; +extern struct record_description Absyn_Exp_STRING__desc; #endif -#define Absyn__DOT_3dBOX2 26 -#define Absyn__DOT(exp,index) (mmc_mk_box3(26,&Absyn_Exp_DOT__desc,exp,index)) +#define Absyn__STRING_3dBOX1 6 +#define Absyn__STRING(value) (mmc_mk_box2(6,&Absyn_Exp_STRING__desc,value)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Case_CASE__desc_added -#define Absyn_Case_CASE__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Case_CASE__desc__fields[9] = {"pattern","patternGuard","patternInfo","localDecls","classPart","result","resultInfo","comment","info"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Case_CASE__desc = { - "Absyn_Case_CASE", - "Absyn.Case.CASE", - Absyn_Case_CASE__desc__fields +#ifndef Absyn_Exp_CREF__desc_added +#define Absyn_Exp_CREF__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Exp_CREF__desc__fields[1] = {"componentRef"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Exp_CREF__desc = { + "Absyn_Exp_CREF", + "Absyn.Exp.CREF", + Absyn_Exp_CREF__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Case_CASE__desc; +extern struct record_description Absyn_Exp_CREF__desc; #endif -#define Absyn__CASE_3dBOX9 3 -#define Absyn__CASE(pattern,patternGuard,patternInfo,localDecls,classPart,result,resultInfo,comment,info) (mmc_mk_box(10, 3,&Absyn_Case_CASE__desc,pattern,patternGuard,patternInfo,localDecls,classPart,result,resultInfo,comment,info)) +#define Absyn__CREF_3dBOX1 5 +#define Absyn__CREF(componentRef) (mmc_mk_box2(5,&Absyn_Exp_CREF__desc,componentRef)) +#ifdef ADD_METARECORD_DEFINITIONS +#ifndef Absyn_Exp_REAL__desc_added +#define Absyn_Exp_REAL__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Exp_REAL__desc__fields[1] = {"value"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Exp_REAL__desc = { + "Absyn_Exp_REAL", + "Absyn.Exp.REAL", + Absyn_Exp_REAL__desc__fields +}; +#endif +#else /* Only use the file as a header */ +extern struct record_description Absyn_Exp_REAL__desc; +#endif +#define Absyn__REAL_3dBOX1 4 +#define Absyn__REAL(value) (mmc_mk_box2(4,&Absyn_Exp_REAL__desc,value)) +#ifdef ADD_METARECORD_DEFINITIONS +#ifndef Absyn_Exp_INTEGER__desc_added +#define Absyn_Exp_INTEGER__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Exp_INTEGER__desc__fields[1] = {"value"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Exp_INTEGER__desc = { + "Absyn_Exp_INTEGER", + "Absyn.Exp.INTEGER", + Absyn_Exp_INTEGER__desc__fields +}; +#endif +#else /* Only use the file as a header */ +extern struct record_description Absyn_Exp_INTEGER__desc; +#endif +#define Absyn__INTEGER_3dBOX1 3 +#define Absyn__INTEGER(value) (mmc_mk_box2(3,&Absyn_Exp_INTEGER__desc,value)) #ifdef ADD_METARECORD_DEFINITIONS #ifndef Absyn_Case_ELSE__desc_added #define Absyn_Case_ELSE__desc_added @@ -2924,21 +2909,20 @@ extern struct record_description Absyn_Case_ELSE__desc; #define Absyn__ELSE_3dBOX6 4 #define Absyn__ELSE(localDecls,classPart,result,resultInfo,comment,info) (mmc_mk_box7(4,&Absyn_Case_ELSE__desc,localDecls,classPart,result,resultInfo,comment,info)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_MatchType_MATCH__desc_added -#define Absyn_MatchType_MATCH__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_MatchType_MATCH__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_MatchType_MATCH__desc = { - "Absyn_MatchType_MATCH", - "Absyn.MatchType.MATCH", - Absyn_MatchType_MATCH__desc__fields -}; -#endif -#else /* Only use the file as a header */ -extern struct record_description Absyn_MatchType_MATCH__desc; +#ifndef Absyn_Case_CASE__desc_added +#define Absyn_Case_CASE__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Case_CASE__desc__fields[9] = {"pattern","patternGuard","patternInfo","localDecls","classPart","result","resultInfo","comment","info"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Case_CASE__desc = { + "Absyn_Case_CASE", + "Absyn.Case.CASE", + Absyn_Case_CASE__desc__fields +}; #endif -#define Absyn__MATCH_3dBOX0 3 -static const MMC_DEFSTRUCTLIT(Absyn__MATCH__struct,1,3) {&Absyn_MatchType_MATCH__desc}}; -static void *Absyn__MATCH = MMC_REFSTRUCTLIT(Absyn__MATCH__struct); +#else /* Only use the file as a header */ +extern struct record_description Absyn_Case_CASE__desc; +#endif +#define Absyn__CASE_3dBOX9 3 +#define Absyn__CASE(pattern,patternGuard,patternInfo,localDecls,classPart,result,resultInfo,comment,info) (mmc_mk_box(10, 3,&Absyn_Case_CASE__desc,pattern,patternGuard,patternInfo,localDecls,classPart,result,resultInfo,comment,info)) #ifdef ADD_METARECORD_DEFINITIONS #ifndef Absyn_MatchType_MATCHCONTINUE__desc_added #define Absyn_MatchType_MATCHCONTINUE__desc_added @@ -2956,65 +2940,66 @@ extern struct record_description Absyn_MatchType_MATCHCONTINUE__desc; static const MMC_DEFSTRUCTLIT(Absyn__MATCHCONTINUE__struct,1,4) {&Absyn_MatchType_MATCHCONTINUE__desc}}; static void *Absyn__MATCHCONTINUE = MMC_REFSTRUCTLIT(Absyn__MATCHCONTINUE__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_CodeNode_C__TYPENAME__desc_added -#define Absyn_CodeNode_C__TYPENAME__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_CodeNode_C__TYPENAME__desc__fields[1] = {"path"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_CodeNode_C__TYPENAME__desc = { - "Absyn_CodeNode_C__TYPENAME", - "Absyn.CodeNode.C_TYPENAME", - Absyn_CodeNode_C__TYPENAME__desc__fields +#ifndef Absyn_MatchType_MATCH__desc_added +#define Absyn_MatchType_MATCH__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_MatchType_MATCH__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_MatchType_MATCH__desc = { + "Absyn_MatchType_MATCH", + "Absyn.MatchType.MATCH", + Absyn_MatchType_MATCH__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_CodeNode_C__TYPENAME__desc; +extern struct record_description Absyn_MatchType_MATCH__desc; #endif -#define Absyn__C_5fTYPENAME_3dBOX1 3 -#define Absyn__C_5fTYPENAME(path) (mmc_mk_box2(3,&Absyn_CodeNode_C__TYPENAME__desc,path)) +#define Absyn__MATCH_3dBOX0 3 +static const MMC_DEFSTRUCTLIT(Absyn__MATCH__struct,1,3) {&Absyn_MatchType_MATCH__desc}}; +static void *Absyn__MATCH = MMC_REFSTRUCTLIT(Absyn__MATCH__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_CodeNode_C__VARIABLENAME__desc_added -#define Absyn_CodeNode_C__VARIABLENAME__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_CodeNode_C__VARIABLENAME__desc__fields[1] = {"componentRef"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_CodeNode_C__VARIABLENAME__desc = { - "Absyn_CodeNode_C__VARIABLENAME", - "Absyn.CodeNode.C_VARIABLENAME", - Absyn_CodeNode_C__VARIABLENAME__desc__fields +#ifndef Absyn_CodeNode_C__MODIFICATION__desc_added +#define Absyn_CodeNode_C__MODIFICATION__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_CodeNode_C__MODIFICATION__desc__fields[1] = {"modification"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_CodeNode_C__MODIFICATION__desc = { + "Absyn_CodeNode_C__MODIFICATION", + "Absyn.CodeNode.C_MODIFICATION", + Absyn_CodeNode_C__MODIFICATION__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_CodeNode_C__VARIABLENAME__desc; +extern struct record_description Absyn_CodeNode_C__MODIFICATION__desc; #endif -#define Absyn__C_5fVARIABLENAME_3dBOX1 4 -#define Absyn__C_5fVARIABLENAME(componentRef) (mmc_mk_box2(4,&Absyn_CodeNode_C__VARIABLENAME__desc,componentRef)) +#define Absyn__C_5fMODIFICATION_3dBOX1 10 +#define Absyn__C_5fMODIFICATION(modification) (mmc_mk_box2(10,&Absyn_CodeNode_C__MODIFICATION__desc,modification)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_CodeNode_C__CONSTRAINTSECTION__desc_added -#define Absyn_CodeNode_C__CONSTRAINTSECTION__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_CodeNode_C__CONSTRAINTSECTION__desc__fields[2] = {"boolean","equationItemLst"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_CodeNode_C__CONSTRAINTSECTION__desc = { - "Absyn_CodeNode_C__CONSTRAINTSECTION", - "Absyn.CodeNode.C_CONSTRAINTSECTION", - Absyn_CodeNode_C__CONSTRAINTSECTION__desc__fields +#ifndef Absyn_CodeNode_C__EXPRESSION__desc_added +#define Absyn_CodeNode_C__EXPRESSION__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_CodeNode_C__EXPRESSION__desc__fields[1] = {"exp"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_CodeNode_C__EXPRESSION__desc = { + "Absyn_CodeNode_C__EXPRESSION", + "Absyn.CodeNode.C_EXPRESSION", + Absyn_CodeNode_C__EXPRESSION__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_CodeNode_C__CONSTRAINTSECTION__desc; +extern struct record_description Absyn_CodeNode_C__EXPRESSION__desc; #endif -#define Absyn__C_5fCONSTRAINTSECTION_3dBOX2 5 -#define Absyn__C_5fCONSTRAINTSECTION(boolean,equationItemLst) (mmc_mk_box3(5,&Absyn_CodeNode_C__CONSTRAINTSECTION__desc,boolean,equationItemLst)) +#define Absyn__C_5fEXPRESSION_3dBOX1 9 +#define Absyn__C_5fEXPRESSION(exp) (mmc_mk_box2(9,&Absyn_CodeNode_C__EXPRESSION__desc,exp)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_CodeNode_C__EQUATIONSECTION__desc_added -#define Absyn_CodeNode_C__EQUATIONSECTION__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_CodeNode_C__EQUATIONSECTION__desc__fields[2] = {"boolean","equationItemLst"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_CodeNode_C__EQUATIONSECTION__desc = { - "Absyn_CodeNode_C__EQUATIONSECTION", - "Absyn.CodeNode.C_EQUATIONSECTION", - Absyn_CodeNode_C__EQUATIONSECTION__desc__fields +#ifndef Absyn_CodeNode_C__ELEMENT__desc_added +#define Absyn_CodeNode_C__ELEMENT__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_CodeNode_C__ELEMENT__desc__fields[1] = {"element"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_CodeNode_C__ELEMENT__desc = { + "Absyn_CodeNode_C__ELEMENT", + "Absyn.CodeNode.C_ELEMENT", + Absyn_CodeNode_C__ELEMENT__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_CodeNode_C__EQUATIONSECTION__desc; +extern struct record_description Absyn_CodeNode_C__ELEMENT__desc; #endif -#define Absyn__C_5fEQUATIONSECTION_3dBOX2 6 -#define Absyn__C_5fEQUATIONSECTION(boolean,equationItemLst) (mmc_mk_box3(6,&Absyn_CodeNode_C__EQUATIONSECTION__desc,boolean,equationItemLst)) +#define Absyn__C_5fELEMENT_3dBOX1 8 +#define Absyn__C_5fELEMENT(element) (mmc_mk_box2(8,&Absyn_CodeNode_C__ELEMENT__desc,element)) #ifdef ADD_METARECORD_DEFINITIONS #ifndef Absyn_CodeNode_C__ALGORITHMSECTION__desc_added #define Absyn_CodeNode_C__ALGORITHMSECTION__desc_added @@ -3031,65 +3016,65 @@ extern struct record_description Absyn_CodeNode_C__ALGORITHMSECTION__desc; #define Absyn__C_5fALGORITHMSECTION_3dBOX2 7 #define Absyn__C_5fALGORITHMSECTION(boolean,algorithmItemLst) (mmc_mk_box3(7,&Absyn_CodeNode_C__ALGORITHMSECTION__desc,boolean,algorithmItemLst)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_CodeNode_C__ELEMENT__desc_added -#define Absyn_CodeNode_C__ELEMENT__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_CodeNode_C__ELEMENT__desc__fields[1] = {"element"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_CodeNode_C__ELEMENT__desc = { - "Absyn_CodeNode_C__ELEMENT", - "Absyn.CodeNode.C_ELEMENT", - Absyn_CodeNode_C__ELEMENT__desc__fields +#ifndef Absyn_CodeNode_C__EQUATIONSECTION__desc_added +#define Absyn_CodeNode_C__EQUATIONSECTION__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_CodeNode_C__EQUATIONSECTION__desc__fields[2] = {"boolean","equationItemLst"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_CodeNode_C__EQUATIONSECTION__desc = { + "Absyn_CodeNode_C__EQUATIONSECTION", + "Absyn.CodeNode.C_EQUATIONSECTION", + Absyn_CodeNode_C__EQUATIONSECTION__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_CodeNode_C__ELEMENT__desc; +extern struct record_description Absyn_CodeNode_C__EQUATIONSECTION__desc; #endif -#define Absyn__C_5fELEMENT_3dBOX1 8 -#define Absyn__C_5fELEMENT(element) (mmc_mk_box2(8,&Absyn_CodeNode_C__ELEMENT__desc,element)) +#define Absyn__C_5fEQUATIONSECTION_3dBOX2 6 +#define Absyn__C_5fEQUATIONSECTION(boolean,equationItemLst) (mmc_mk_box3(6,&Absyn_CodeNode_C__EQUATIONSECTION__desc,boolean,equationItemLst)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_CodeNode_C__EXPRESSION__desc_added -#define Absyn_CodeNode_C__EXPRESSION__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_CodeNode_C__EXPRESSION__desc__fields[1] = {"exp"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_CodeNode_C__EXPRESSION__desc = { - "Absyn_CodeNode_C__EXPRESSION", - "Absyn.CodeNode.C_EXPRESSION", - Absyn_CodeNode_C__EXPRESSION__desc__fields +#ifndef Absyn_CodeNode_C__CONSTRAINTSECTION__desc_added +#define Absyn_CodeNode_C__CONSTRAINTSECTION__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_CodeNode_C__CONSTRAINTSECTION__desc__fields[2] = {"boolean","equationItemLst"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_CodeNode_C__CONSTRAINTSECTION__desc = { + "Absyn_CodeNode_C__CONSTRAINTSECTION", + "Absyn.CodeNode.C_CONSTRAINTSECTION", + Absyn_CodeNode_C__CONSTRAINTSECTION__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_CodeNode_C__EXPRESSION__desc; +extern struct record_description Absyn_CodeNode_C__CONSTRAINTSECTION__desc; #endif -#define Absyn__C_5fEXPRESSION_3dBOX1 9 -#define Absyn__C_5fEXPRESSION(exp) (mmc_mk_box2(9,&Absyn_CodeNode_C__EXPRESSION__desc,exp)) +#define Absyn__C_5fCONSTRAINTSECTION_3dBOX2 5 +#define Absyn__C_5fCONSTRAINTSECTION(boolean,equationItemLst) (mmc_mk_box3(5,&Absyn_CodeNode_C__CONSTRAINTSECTION__desc,boolean,equationItemLst)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_CodeNode_C__MODIFICATION__desc_added -#define Absyn_CodeNode_C__MODIFICATION__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_CodeNode_C__MODIFICATION__desc__fields[1] = {"modification"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_CodeNode_C__MODIFICATION__desc = { - "Absyn_CodeNode_C__MODIFICATION", - "Absyn.CodeNode.C_MODIFICATION", - Absyn_CodeNode_C__MODIFICATION__desc__fields +#ifndef Absyn_CodeNode_C__VARIABLENAME__desc_added +#define Absyn_CodeNode_C__VARIABLENAME__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_CodeNode_C__VARIABLENAME__desc__fields[1] = {"componentRef"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_CodeNode_C__VARIABLENAME__desc = { + "Absyn_CodeNode_C__VARIABLENAME", + "Absyn.CodeNode.C_VARIABLENAME", + Absyn_CodeNode_C__VARIABLENAME__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_CodeNode_C__MODIFICATION__desc; +extern struct record_description Absyn_CodeNode_C__VARIABLENAME__desc; #endif -#define Absyn__C_5fMODIFICATION_3dBOX1 10 -#define Absyn__C_5fMODIFICATION(modification) (mmc_mk_box2(10,&Absyn_CodeNode_C__MODIFICATION__desc,modification)) +#define Absyn__C_5fVARIABLENAME_3dBOX1 4 +#define Absyn__C_5fVARIABLENAME(componentRef) (mmc_mk_box2(4,&Absyn_CodeNode_C__VARIABLENAME__desc,componentRef)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_FunctionArgs_FUNCTIONARGS__desc_added -#define Absyn_FunctionArgs_FUNCTIONARGS__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_FunctionArgs_FUNCTIONARGS__desc__fields[2] = {"args","argNames"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_FunctionArgs_FUNCTIONARGS__desc = { - "Absyn_FunctionArgs_FUNCTIONARGS", - "Absyn.FunctionArgs.FUNCTIONARGS", - Absyn_FunctionArgs_FUNCTIONARGS__desc__fields +#ifndef Absyn_CodeNode_C__TYPENAME__desc_added +#define Absyn_CodeNode_C__TYPENAME__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_CodeNode_C__TYPENAME__desc__fields[1] = {"path"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_CodeNode_C__TYPENAME__desc = { + "Absyn_CodeNode_C__TYPENAME", + "Absyn.CodeNode.C_TYPENAME", + Absyn_CodeNode_C__TYPENAME__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_FunctionArgs_FUNCTIONARGS__desc; +extern struct record_description Absyn_CodeNode_C__TYPENAME__desc; #endif -#define Absyn__FUNCTIONARGS_3dBOX2 3 -#define Absyn__FUNCTIONARGS(args,argNames) (mmc_mk_box3(3,&Absyn_FunctionArgs_FUNCTIONARGS__desc,args,argNames)) +#define Absyn__C_5fTYPENAME_3dBOX1 3 +#define Absyn__C_5fTYPENAME(path) (mmc_mk_box2(3,&Absyn_CodeNode_C__TYPENAME__desc,path)) #ifdef ADD_METARECORD_DEFINITIONS #ifndef Absyn_FunctionArgs_FOR__ITER__FARG__desc_added #define Absyn_FunctionArgs_FOR__ITER__FARG__desc_added @@ -3106,21 +3091,20 @@ extern struct record_description Absyn_FunctionArgs_FOR__ITER__FARG__desc; #define Absyn__FOR_5fITER_5fFARG_3dBOX3 4 #define Absyn__FOR_5fITER_5fFARG(exp,iterType,iterators) (mmc_mk_box4(4,&Absyn_FunctionArgs_FOR__ITER__FARG__desc,exp,iterType,iterators)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_ReductionIterType_COMBINE__desc_added -#define Absyn_ReductionIterType_COMBINE__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_ReductionIterType_COMBINE__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_ReductionIterType_COMBINE__desc = { - "Absyn_ReductionIterType_COMBINE", - "Absyn.ReductionIterType.COMBINE", - Absyn_ReductionIterType_COMBINE__desc__fields +#ifndef Absyn_FunctionArgs_FUNCTIONARGS__desc_added +#define Absyn_FunctionArgs_FUNCTIONARGS__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_FunctionArgs_FUNCTIONARGS__desc__fields[2] = {"args","argNames"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_FunctionArgs_FUNCTIONARGS__desc = { + "Absyn_FunctionArgs_FUNCTIONARGS", + "Absyn.FunctionArgs.FUNCTIONARGS", + Absyn_FunctionArgs_FUNCTIONARGS__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_ReductionIterType_COMBINE__desc; +extern struct record_description Absyn_FunctionArgs_FUNCTIONARGS__desc; #endif -#define Absyn__COMBINE_3dBOX0 3 -static const MMC_DEFSTRUCTLIT(Absyn__COMBINE__struct,1,3) {&Absyn_ReductionIterType_COMBINE__desc}}; -static void *Absyn__COMBINE = MMC_REFSTRUCTLIT(Absyn__COMBINE__struct); +#define Absyn__FUNCTIONARGS_3dBOX2 3 +#define Absyn__FUNCTIONARGS(args,argNames) (mmc_mk_box3(3,&Absyn_FunctionArgs_FUNCTIONARGS__desc,args,argNames)) #ifdef ADD_METARECORD_DEFINITIONS #ifndef Absyn_ReductionIterType_THREAD__desc_added #define Absyn_ReductionIterType_THREAD__desc_added @@ -3138,6 +3122,22 @@ extern struct record_description Absyn_ReductionIterType_THREAD__desc; static const MMC_DEFSTRUCTLIT(Absyn__THREAD__struct,1,4) {&Absyn_ReductionIterType_THREAD__desc}}; static void *Absyn__THREAD = MMC_REFSTRUCTLIT(Absyn__THREAD__struct); #ifdef ADD_METARECORD_DEFINITIONS +#ifndef Absyn_ReductionIterType_COMBINE__desc_added +#define Absyn_ReductionIterType_COMBINE__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_ReductionIterType_COMBINE__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_ReductionIterType_COMBINE__desc = { + "Absyn_ReductionIterType_COMBINE", + "Absyn.ReductionIterType.COMBINE", + Absyn_ReductionIterType_COMBINE__desc__fields +}; +#endif +#else /* Only use the file as a header */ +extern struct record_description Absyn_ReductionIterType_COMBINE__desc; +#endif +#define Absyn__COMBINE_3dBOX0 3 +static const MMC_DEFSTRUCTLIT(Absyn__COMBINE__struct,1,3) {&Absyn_ReductionIterType_COMBINE__desc}}; +static void *Absyn__COMBINE = MMC_REFSTRUCTLIT(Absyn__COMBINE__struct); +#ifdef ADD_METARECORD_DEFINITIONS #ifndef Absyn_NamedArg_NAMEDARG__desc_added #define Absyn_NamedArg_NAMEDARG__desc_added ADD_METARECORD_DEFINITIONS const char* Absyn_NamedArg_NAMEDARG__desc__fields[2] = {"argName","argValue"}; @@ -3153,181 +3153,181 @@ extern struct record_description Absyn_NamedArg_NAMEDARG__desc; #define Absyn__NAMEDARG_3dBOX2 3 #define Absyn__NAMEDARG(argName,argValue) (mmc_mk_box3(3,&Absyn_NamedArg_NAMEDARG__desc,argName,argValue)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Operator_ADD__desc_added -#define Absyn_Operator_ADD__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Operator_ADD__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Operator_ADD__desc = { - "Absyn_Operator_ADD", - "Absyn.Operator.ADD", - Absyn_Operator_ADD__desc__fields +#ifndef Absyn_Operator_NEQUAL__desc_added +#define Absyn_Operator_NEQUAL__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Operator_NEQUAL__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Operator_NEQUAL__desc = { + "Absyn_Operator_NEQUAL", + "Absyn.Operator.NEQUAL", + Absyn_Operator_NEQUAL__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Operator_ADD__desc; +extern struct record_description Absyn_Operator_NEQUAL__desc; #endif -#define Absyn__ADD_3dBOX0 3 -static const MMC_DEFSTRUCTLIT(Absyn__ADD__struct,1,3) {&Absyn_Operator_ADD__desc}}; -static void *Absyn__ADD = MMC_REFSTRUCTLIT(Absyn__ADD__struct); +#define Absyn__NEQUAL_3dBOX0 25 +static const MMC_DEFSTRUCTLIT(Absyn__NEQUAL__struct,1,25) {&Absyn_Operator_NEQUAL__desc}}; +static void *Absyn__NEQUAL = MMC_REFSTRUCTLIT(Absyn__NEQUAL__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Operator_SUB__desc_added -#define Absyn_Operator_SUB__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Operator_SUB__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Operator_SUB__desc = { - "Absyn_Operator_SUB", - "Absyn.Operator.SUB", - Absyn_Operator_SUB__desc__fields +#ifndef Absyn_Operator_EQUAL__desc_added +#define Absyn_Operator_EQUAL__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Operator_EQUAL__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Operator_EQUAL__desc = { + "Absyn_Operator_EQUAL", + "Absyn.Operator.EQUAL", + Absyn_Operator_EQUAL__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Operator_SUB__desc; +extern struct record_description Absyn_Operator_EQUAL__desc; #endif -#define Absyn__SUB_3dBOX0 4 -static const MMC_DEFSTRUCTLIT(Absyn__SUB__struct,1,4) {&Absyn_Operator_SUB__desc}}; -static void *Absyn__SUB = MMC_REFSTRUCTLIT(Absyn__SUB__struct); -#ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Operator_MUL__desc_added -#define Absyn_Operator_MUL__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Operator_MUL__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Operator_MUL__desc = { - "Absyn_Operator_MUL", - "Absyn.Operator.MUL", - Absyn_Operator_MUL__desc__fields +#define Absyn__EQUAL_3dBOX0 24 +static const MMC_DEFSTRUCTLIT(Absyn__EQUAL__struct,1,24) {&Absyn_Operator_EQUAL__desc}}; +static void *Absyn__EQUAL = MMC_REFSTRUCTLIT(Absyn__EQUAL__struct); +#ifdef ADD_METARECORD_DEFINITIONS +#ifndef Absyn_Operator_GREATEREQ__desc_added +#define Absyn_Operator_GREATEREQ__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Operator_GREATEREQ__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Operator_GREATEREQ__desc = { + "Absyn_Operator_GREATEREQ", + "Absyn.Operator.GREATEREQ", + Absyn_Operator_GREATEREQ__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Operator_MUL__desc; +extern struct record_description Absyn_Operator_GREATEREQ__desc; #endif -#define Absyn__MUL_3dBOX0 5 -static const MMC_DEFSTRUCTLIT(Absyn__MUL__struct,1,5) {&Absyn_Operator_MUL__desc}}; -static void *Absyn__MUL = MMC_REFSTRUCTLIT(Absyn__MUL__struct); +#define Absyn__GREATEREQ_3dBOX0 23 +static const MMC_DEFSTRUCTLIT(Absyn__GREATEREQ__struct,1,23) {&Absyn_Operator_GREATEREQ__desc}}; +static void *Absyn__GREATEREQ = MMC_REFSTRUCTLIT(Absyn__GREATEREQ__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Operator_DIV__desc_added -#define Absyn_Operator_DIV__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Operator_DIV__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Operator_DIV__desc = { - "Absyn_Operator_DIV", - "Absyn.Operator.DIV", - Absyn_Operator_DIV__desc__fields +#ifndef Absyn_Operator_GREATER__desc_added +#define Absyn_Operator_GREATER__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Operator_GREATER__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Operator_GREATER__desc = { + "Absyn_Operator_GREATER", + "Absyn.Operator.GREATER", + Absyn_Operator_GREATER__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Operator_DIV__desc; +extern struct record_description Absyn_Operator_GREATER__desc; #endif -#define Absyn__DIV_3dBOX0 6 -static const MMC_DEFSTRUCTLIT(Absyn__DIV__struct,1,6) {&Absyn_Operator_DIV__desc}}; -static void *Absyn__DIV = MMC_REFSTRUCTLIT(Absyn__DIV__struct); +#define Absyn__GREATER_3dBOX0 22 +static const MMC_DEFSTRUCTLIT(Absyn__GREATER__struct,1,22) {&Absyn_Operator_GREATER__desc}}; +static void *Absyn__GREATER = MMC_REFSTRUCTLIT(Absyn__GREATER__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Operator_POW__desc_added -#define Absyn_Operator_POW__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Operator_POW__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Operator_POW__desc = { - "Absyn_Operator_POW", - "Absyn.Operator.POW", - Absyn_Operator_POW__desc__fields +#ifndef Absyn_Operator_LESSEQ__desc_added +#define Absyn_Operator_LESSEQ__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Operator_LESSEQ__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Operator_LESSEQ__desc = { + "Absyn_Operator_LESSEQ", + "Absyn.Operator.LESSEQ", + Absyn_Operator_LESSEQ__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Operator_POW__desc; +extern struct record_description Absyn_Operator_LESSEQ__desc; #endif -#define Absyn__POW_3dBOX0 7 -static const MMC_DEFSTRUCTLIT(Absyn__POW__struct,1,7) {&Absyn_Operator_POW__desc}}; -static void *Absyn__POW = MMC_REFSTRUCTLIT(Absyn__POW__struct); +#define Absyn__LESSEQ_3dBOX0 21 +static const MMC_DEFSTRUCTLIT(Absyn__LESSEQ__struct,1,21) {&Absyn_Operator_LESSEQ__desc}}; +static void *Absyn__LESSEQ = MMC_REFSTRUCTLIT(Absyn__LESSEQ__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Operator_UPLUS__desc_added -#define Absyn_Operator_UPLUS__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Operator_UPLUS__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Operator_UPLUS__desc = { - "Absyn_Operator_UPLUS", - "Absyn.Operator.UPLUS", - Absyn_Operator_UPLUS__desc__fields +#ifndef Absyn_Operator_LESS__desc_added +#define Absyn_Operator_LESS__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Operator_LESS__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Operator_LESS__desc = { + "Absyn_Operator_LESS", + "Absyn.Operator.LESS", + Absyn_Operator_LESS__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Operator_UPLUS__desc; +extern struct record_description Absyn_Operator_LESS__desc; #endif -#define Absyn__UPLUS_3dBOX0 8 -static const MMC_DEFSTRUCTLIT(Absyn__UPLUS__struct,1,8) {&Absyn_Operator_UPLUS__desc}}; -static void *Absyn__UPLUS = MMC_REFSTRUCTLIT(Absyn__UPLUS__struct); +#define Absyn__LESS_3dBOX0 20 +static const MMC_DEFSTRUCTLIT(Absyn__LESS__struct,1,20) {&Absyn_Operator_LESS__desc}}; +static void *Absyn__LESS = MMC_REFSTRUCTLIT(Absyn__LESS__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Operator_UMINUS__desc_added -#define Absyn_Operator_UMINUS__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Operator_UMINUS__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Operator_UMINUS__desc = { - "Absyn_Operator_UMINUS", - "Absyn.Operator.UMINUS", - Absyn_Operator_UMINUS__desc__fields +#ifndef Absyn_Operator_NOT__desc_added +#define Absyn_Operator_NOT__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Operator_NOT__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Operator_NOT__desc = { + "Absyn_Operator_NOT", + "Absyn.Operator.NOT", + Absyn_Operator_NOT__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Operator_UMINUS__desc; +extern struct record_description Absyn_Operator_NOT__desc; #endif -#define Absyn__UMINUS_3dBOX0 9 -static const MMC_DEFSTRUCTLIT(Absyn__UMINUS__struct,1,9) {&Absyn_Operator_UMINUS__desc}}; -static void *Absyn__UMINUS = MMC_REFSTRUCTLIT(Absyn__UMINUS__struct); +#define Absyn__NOT_3dBOX0 19 +static const MMC_DEFSTRUCTLIT(Absyn__NOT__struct,1,19) {&Absyn_Operator_NOT__desc}}; +static void *Absyn__NOT = MMC_REFSTRUCTLIT(Absyn__NOT__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Operator_ADD__EW__desc_added -#define Absyn_Operator_ADD__EW__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Operator_ADD__EW__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Operator_ADD__EW__desc = { - "Absyn_Operator_ADD__EW", - "Absyn.Operator.ADD_EW", - Absyn_Operator_ADD__EW__desc__fields +#ifndef Absyn_Operator_OR__desc_added +#define Absyn_Operator_OR__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Operator_OR__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Operator_OR__desc = { + "Absyn_Operator_OR", + "Absyn.Operator.OR", + Absyn_Operator_OR__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Operator_ADD__EW__desc; +extern struct record_description Absyn_Operator_OR__desc; #endif -#define Absyn__ADD_5fEW_3dBOX0 10 -static const MMC_DEFSTRUCTLIT(Absyn__ADD_5fEW__struct,1,10) {&Absyn_Operator_ADD__EW__desc}}; -static void *Absyn__ADD_5fEW = MMC_REFSTRUCTLIT(Absyn__ADD_5fEW__struct); +#define Absyn__OR_3dBOX0 18 +static const MMC_DEFSTRUCTLIT(Absyn__OR__struct,1,18) {&Absyn_Operator_OR__desc}}; +static void *Absyn__OR = MMC_REFSTRUCTLIT(Absyn__OR__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Operator_SUB__EW__desc_added -#define Absyn_Operator_SUB__EW__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Operator_SUB__EW__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Operator_SUB__EW__desc = { - "Absyn_Operator_SUB__EW", - "Absyn.Operator.SUB_EW", - Absyn_Operator_SUB__EW__desc__fields +#ifndef Absyn_Operator_AND__desc_added +#define Absyn_Operator_AND__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Operator_AND__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Operator_AND__desc = { + "Absyn_Operator_AND", + "Absyn.Operator.AND", + Absyn_Operator_AND__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Operator_SUB__EW__desc; +extern struct record_description Absyn_Operator_AND__desc; #endif -#define Absyn__SUB_5fEW_3dBOX0 11 -static const MMC_DEFSTRUCTLIT(Absyn__SUB_5fEW__struct,1,11) {&Absyn_Operator_SUB__EW__desc}}; -static void *Absyn__SUB_5fEW = MMC_REFSTRUCTLIT(Absyn__SUB_5fEW__struct); +#define Absyn__AND_3dBOX0 17 +static const MMC_DEFSTRUCTLIT(Absyn__AND__struct,1,17) {&Absyn_Operator_AND__desc}}; +static void *Absyn__AND = MMC_REFSTRUCTLIT(Absyn__AND__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Operator_MUL__EW__desc_added -#define Absyn_Operator_MUL__EW__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Operator_MUL__EW__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Operator_MUL__EW__desc = { - "Absyn_Operator_MUL__EW", - "Absyn.Operator.MUL_EW", - Absyn_Operator_MUL__EW__desc__fields +#ifndef Absyn_Operator_UMINUS__EW__desc_added +#define Absyn_Operator_UMINUS__EW__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Operator_UMINUS__EW__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Operator_UMINUS__EW__desc = { + "Absyn_Operator_UMINUS__EW", + "Absyn.Operator.UMINUS_EW", + Absyn_Operator_UMINUS__EW__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Operator_MUL__EW__desc; +extern struct record_description Absyn_Operator_UMINUS__EW__desc; #endif -#define Absyn__MUL_5fEW_3dBOX0 12 -static const MMC_DEFSTRUCTLIT(Absyn__MUL_5fEW__struct,1,12) {&Absyn_Operator_MUL__EW__desc}}; -static void *Absyn__MUL_5fEW = MMC_REFSTRUCTLIT(Absyn__MUL_5fEW__struct); +#define Absyn__UMINUS_5fEW_3dBOX0 16 +static const MMC_DEFSTRUCTLIT(Absyn__UMINUS_5fEW__struct,1,16) {&Absyn_Operator_UMINUS__EW__desc}}; +static void *Absyn__UMINUS_5fEW = MMC_REFSTRUCTLIT(Absyn__UMINUS_5fEW__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Operator_DIV__EW__desc_added -#define Absyn_Operator_DIV__EW__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Operator_DIV__EW__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Operator_DIV__EW__desc = { - "Absyn_Operator_DIV__EW", - "Absyn.Operator.DIV_EW", - Absyn_Operator_DIV__EW__desc__fields +#ifndef Absyn_Operator_UPLUS__EW__desc_added +#define Absyn_Operator_UPLUS__EW__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Operator_UPLUS__EW__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Operator_UPLUS__EW__desc = { + "Absyn_Operator_UPLUS__EW", + "Absyn.Operator.UPLUS_EW", + Absyn_Operator_UPLUS__EW__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Operator_DIV__EW__desc; +extern struct record_description Absyn_Operator_UPLUS__EW__desc; #endif -#define Absyn__DIV_5fEW_3dBOX0 13 -static const MMC_DEFSTRUCTLIT(Absyn__DIV_5fEW__struct,1,13) {&Absyn_Operator_DIV__EW__desc}}; -static void *Absyn__DIV_5fEW = MMC_REFSTRUCTLIT(Absyn__DIV_5fEW__struct); +#define Absyn__UPLUS_5fEW_3dBOX0 15 +static const MMC_DEFSTRUCTLIT(Absyn__UPLUS_5fEW__struct,1,15) {&Absyn_Operator_UPLUS__EW__desc}}; +static void *Absyn__UPLUS_5fEW = MMC_REFSTRUCTLIT(Absyn__UPLUS_5fEW__struct); #ifdef ADD_METARECORD_DEFINITIONS #ifndef Absyn_Operator_POW__EW__desc_added #define Absyn_Operator_POW__EW__desc_added @@ -3345,197 +3345,181 @@ extern struct record_description Absyn_Operator_POW__EW__desc; static const MMC_DEFSTRUCTLIT(Absyn__POW_5fEW__struct,1,14) {&Absyn_Operator_POW__EW__desc}}; static void *Absyn__POW_5fEW = MMC_REFSTRUCTLIT(Absyn__POW_5fEW__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Operator_UPLUS__EW__desc_added -#define Absyn_Operator_UPLUS__EW__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Operator_UPLUS__EW__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Operator_UPLUS__EW__desc = { - "Absyn_Operator_UPLUS__EW", - "Absyn.Operator.UPLUS_EW", - Absyn_Operator_UPLUS__EW__desc__fields -}; -#endif -#else /* Only use the file as a header */ -extern struct record_description Absyn_Operator_UPLUS__EW__desc; -#endif -#define Absyn__UPLUS_5fEW_3dBOX0 15 -static const MMC_DEFSTRUCTLIT(Absyn__UPLUS_5fEW__struct,1,15) {&Absyn_Operator_UPLUS__EW__desc}}; -static void *Absyn__UPLUS_5fEW = MMC_REFSTRUCTLIT(Absyn__UPLUS_5fEW__struct); -#ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Operator_UMINUS__EW__desc_added -#define Absyn_Operator_UMINUS__EW__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Operator_UMINUS__EW__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Operator_UMINUS__EW__desc = { - "Absyn_Operator_UMINUS__EW", - "Absyn.Operator.UMINUS_EW", - Absyn_Operator_UMINUS__EW__desc__fields +#ifndef Absyn_Operator_DIV__EW__desc_added +#define Absyn_Operator_DIV__EW__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Operator_DIV__EW__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Operator_DIV__EW__desc = { + "Absyn_Operator_DIV__EW", + "Absyn.Operator.DIV_EW", + Absyn_Operator_DIV__EW__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Operator_UMINUS__EW__desc; +extern struct record_description Absyn_Operator_DIV__EW__desc; #endif -#define Absyn__UMINUS_5fEW_3dBOX0 16 -static const MMC_DEFSTRUCTLIT(Absyn__UMINUS_5fEW__struct,1,16) {&Absyn_Operator_UMINUS__EW__desc}}; -static void *Absyn__UMINUS_5fEW = MMC_REFSTRUCTLIT(Absyn__UMINUS_5fEW__struct); +#define Absyn__DIV_5fEW_3dBOX0 13 +static const MMC_DEFSTRUCTLIT(Absyn__DIV_5fEW__struct,1,13) {&Absyn_Operator_DIV__EW__desc}}; +static void *Absyn__DIV_5fEW = MMC_REFSTRUCTLIT(Absyn__DIV_5fEW__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Operator_AND__desc_added -#define Absyn_Operator_AND__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Operator_AND__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Operator_AND__desc = { - "Absyn_Operator_AND", - "Absyn.Operator.AND", - Absyn_Operator_AND__desc__fields +#ifndef Absyn_Operator_MUL__EW__desc_added +#define Absyn_Operator_MUL__EW__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Operator_MUL__EW__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Operator_MUL__EW__desc = { + "Absyn_Operator_MUL__EW", + "Absyn.Operator.MUL_EW", + Absyn_Operator_MUL__EW__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Operator_AND__desc; +extern struct record_description Absyn_Operator_MUL__EW__desc; #endif -#define Absyn__AND_3dBOX0 17 -static const MMC_DEFSTRUCTLIT(Absyn__AND__struct,1,17) {&Absyn_Operator_AND__desc}}; -static void *Absyn__AND = MMC_REFSTRUCTLIT(Absyn__AND__struct); +#define Absyn__MUL_5fEW_3dBOX0 12 +static const MMC_DEFSTRUCTLIT(Absyn__MUL_5fEW__struct,1,12) {&Absyn_Operator_MUL__EW__desc}}; +static void *Absyn__MUL_5fEW = MMC_REFSTRUCTLIT(Absyn__MUL_5fEW__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Operator_OR__desc_added -#define Absyn_Operator_OR__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Operator_OR__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Operator_OR__desc = { - "Absyn_Operator_OR", - "Absyn.Operator.OR", - Absyn_Operator_OR__desc__fields +#ifndef Absyn_Operator_SUB__EW__desc_added +#define Absyn_Operator_SUB__EW__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Operator_SUB__EW__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Operator_SUB__EW__desc = { + "Absyn_Operator_SUB__EW", + "Absyn.Operator.SUB_EW", + Absyn_Operator_SUB__EW__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Operator_OR__desc; +extern struct record_description Absyn_Operator_SUB__EW__desc; #endif -#define Absyn__OR_3dBOX0 18 -static const MMC_DEFSTRUCTLIT(Absyn__OR__struct,1,18) {&Absyn_Operator_OR__desc}}; -static void *Absyn__OR = MMC_REFSTRUCTLIT(Absyn__OR__struct); +#define Absyn__SUB_5fEW_3dBOX0 11 +static const MMC_DEFSTRUCTLIT(Absyn__SUB_5fEW__struct,1,11) {&Absyn_Operator_SUB__EW__desc}}; +static void *Absyn__SUB_5fEW = MMC_REFSTRUCTLIT(Absyn__SUB_5fEW__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Operator_NOT__desc_added -#define Absyn_Operator_NOT__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Operator_NOT__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Operator_NOT__desc = { - "Absyn_Operator_NOT", - "Absyn.Operator.NOT", - Absyn_Operator_NOT__desc__fields +#ifndef Absyn_Operator_ADD__EW__desc_added +#define Absyn_Operator_ADD__EW__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Operator_ADD__EW__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Operator_ADD__EW__desc = { + "Absyn_Operator_ADD__EW", + "Absyn.Operator.ADD_EW", + Absyn_Operator_ADD__EW__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Operator_NOT__desc; +extern struct record_description Absyn_Operator_ADD__EW__desc; #endif -#define Absyn__NOT_3dBOX0 19 -static const MMC_DEFSTRUCTLIT(Absyn__NOT__struct,1,19) {&Absyn_Operator_NOT__desc}}; -static void *Absyn__NOT = MMC_REFSTRUCTLIT(Absyn__NOT__struct); +#define Absyn__ADD_5fEW_3dBOX0 10 +static const MMC_DEFSTRUCTLIT(Absyn__ADD_5fEW__struct,1,10) {&Absyn_Operator_ADD__EW__desc}}; +static void *Absyn__ADD_5fEW = MMC_REFSTRUCTLIT(Absyn__ADD_5fEW__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Operator_LESS__desc_added -#define Absyn_Operator_LESS__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Operator_LESS__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Operator_LESS__desc = { - "Absyn_Operator_LESS", - "Absyn.Operator.LESS", - Absyn_Operator_LESS__desc__fields +#ifndef Absyn_Operator_UMINUS__desc_added +#define Absyn_Operator_UMINUS__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Operator_UMINUS__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Operator_UMINUS__desc = { + "Absyn_Operator_UMINUS", + "Absyn.Operator.UMINUS", + Absyn_Operator_UMINUS__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Operator_LESS__desc; +extern struct record_description Absyn_Operator_UMINUS__desc; #endif -#define Absyn__LESS_3dBOX0 20 -static const MMC_DEFSTRUCTLIT(Absyn__LESS__struct,1,20) {&Absyn_Operator_LESS__desc}}; -static void *Absyn__LESS = MMC_REFSTRUCTLIT(Absyn__LESS__struct); +#define Absyn__UMINUS_3dBOX0 9 +static const MMC_DEFSTRUCTLIT(Absyn__UMINUS__struct,1,9) {&Absyn_Operator_UMINUS__desc}}; +static void *Absyn__UMINUS = MMC_REFSTRUCTLIT(Absyn__UMINUS__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Operator_LESSEQ__desc_added -#define Absyn_Operator_LESSEQ__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Operator_LESSEQ__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Operator_LESSEQ__desc = { - "Absyn_Operator_LESSEQ", - "Absyn.Operator.LESSEQ", - Absyn_Operator_LESSEQ__desc__fields +#ifndef Absyn_Operator_UPLUS__desc_added +#define Absyn_Operator_UPLUS__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Operator_UPLUS__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Operator_UPLUS__desc = { + "Absyn_Operator_UPLUS", + "Absyn.Operator.UPLUS", + Absyn_Operator_UPLUS__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Operator_LESSEQ__desc; +extern struct record_description Absyn_Operator_UPLUS__desc; #endif -#define Absyn__LESSEQ_3dBOX0 21 -static const MMC_DEFSTRUCTLIT(Absyn__LESSEQ__struct,1,21) {&Absyn_Operator_LESSEQ__desc}}; -static void *Absyn__LESSEQ = MMC_REFSTRUCTLIT(Absyn__LESSEQ__struct); +#define Absyn__UPLUS_3dBOX0 8 +static const MMC_DEFSTRUCTLIT(Absyn__UPLUS__struct,1,8) {&Absyn_Operator_UPLUS__desc}}; +static void *Absyn__UPLUS = MMC_REFSTRUCTLIT(Absyn__UPLUS__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Operator_GREATER__desc_added -#define Absyn_Operator_GREATER__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Operator_GREATER__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Operator_GREATER__desc = { - "Absyn_Operator_GREATER", - "Absyn.Operator.GREATER", - Absyn_Operator_GREATER__desc__fields +#ifndef Absyn_Operator_POW__desc_added +#define Absyn_Operator_POW__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Operator_POW__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Operator_POW__desc = { + "Absyn_Operator_POW", + "Absyn.Operator.POW", + Absyn_Operator_POW__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Operator_GREATER__desc; +extern struct record_description Absyn_Operator_POW__desc; #endif -#define Absyn__GREATER_3dBOX0 22 -static const MMC_DEFSTRUCTLIT(Absyn__GREATER__struct,1,22) {&Absyn_Operator_GREATER__desc}}; -static void *Absyn__GREATER = MMC_REFSTRUCTLIT(Absyn__GREATER__struct); +#define Absyn__POW_3dBOX0 7 +static const MMC_DEFSTRUCTLIT(Absyn__POW__struct,1,7) {&Absyn_Operator_POW__desc}}; +static void *Absyn__POW = MMC_REFSTRUCTLIT(Absyn__POW__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Operator_GREATEREQ__desc_added -#define Absyn_Operator_GREATEREQ__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Operator_GREATEREQ__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Operator_GREATEREQ__desc = { - "Absyn_Operator_GREATEREQ", - "Absyn.Operator.GREATEREQ", - Absyn_Operator_GREATEREQ__desc__fields +#ifndef Absyn_Operator_DIV__desc_added +#define Absyn_Operator_DIV__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Operator_DIV__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Operator_DIV__desc = { + "Absyn_Operator_DIV", + "Absyn.Operator.DIV", + Absyn_Operator_DIV__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Operator_GREATEREQ__desc; +extern struct record_description Absyn_Operator_DIV__desc; #endif -#define Absyn__GREATEREQ_3dBOX0 23 -static const MMC_DEFSTRUCTLIT(Absyn__GREATEREQ__struct,1,23) {&Absyn_Operator_GREATEREQ__desc}}; -static void *Absyn__GREATEREQ = MMC_REFSTRUCTLIT(Absyn__GREATEREQ__struct); +#define Absyn__DIV_3dBOX0 6 +static const MMC_DEFSTRUCTLIT(Absyn__DIV__struct,1,6) {&Absyn_Operator_DIV__desc}}; +static void *Absyn__DIV = MMC_REFSTRUCTLIT(Absyn__DIV__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Operator_EQUAL__desc_added -#define Absyn_Operator_EQUAL__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Operator_EQUAL__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Operator_EQUAL__desc = { - "Absyn_Operator_EQUAL", - "Absyn.Operator.EQUAL", - Absyn_Operator_EQUAL__desc__fields +#ifndef Absyn_Operator_MUL__desc_added +#define Absyn_Operator_MUL__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Operator_MUL__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Operator_MUL__desc = { + "Absyn_Operator_MUL", + "Absyn.Operator.MUL", + Absyn_Operator_MUL__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Operator_EQUAL__desc; +extern struct record_description Absyn_Operator_MUL__desc; #endif -#define Absyn__EQUAL_3dBOX0 24 -static const MMC_DEFSTRUCTLIT(Absyn__EQUAL__struct,1,24) {&Absyn_Operator_EQUAL__desc}}; -static void *Absyn__EQUAL = MMC_REFSTRUCTLIT(Absyn__EQUAL__struct); +#define Absyn__MUL_3dBOX0 5 +static const MMC_DEFSTRUCTLIT(Absyn__MUL__struct,1,5) {&Absyn_Operator_MUL__desc}}; +static void *Absyn__MUL = MMC_REFSTRUCTLIT(Absyn__MUL__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Operator_NEQUAL__desc_added -#define Absyn_Operator_NEQUAL__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Operator_NEQUAL__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Operator_NEQUAL__desc = { - "Absyn_Operator_NEQUAL", - "Absyn.Operator.NEQUAL", - Absyn_Operator_NEQUAL__desc__fields +#ifndef Absyn_Operator_SUB__desc_added +#define Absyn_Operator_SUB__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Operator_SUB__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Operator_SUB__desc = { + "Absyn_Operator_SUB", + "Absyn.Operator.SUB", + Absyn_Operator_SUB__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Operator_NEQUAL__desc; +extern struct record_description Absyn_Operator_SUB__desc; #endif -#define Absyn__NEQUAL_3dBOX0 25 -static const MMC_DEFSTRUCTLIT(Absyn__NEQUAL__struct,1,25) {&Absyn_Operator_NEQUAL__desc}}; -static void *Absyn__NEQUAL = MMC_REFSTRUCTLIT(Absyn__NEQUAL__struct); +#define Absyn__SUB_3dBOX0 4 +static const MMC_DEFSTRUCTLIT(Absyn__SUB__struct,1,4) {&Absyn_Operator_SUB__desc}}; +static void *Absyn__SUB = MMC_REFSTRUCTLIT(Absyn__SUB__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Subscript_NOSUB__desc_added -#define Absyn_Subscript_NOSUB__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Subscript_NOSUB__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Subscript_NOSUB__desc = { - "Absyn_Subscript_NOSUB", - "Absyn.Subscript.NOSUB", - Absyn_Subscript_NOSUB__desc__fields +#ifndef Absyn_Operator_ADD__desc_added +#define Absyn_Operator_ADD__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Operator_ADD__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Operator_ADD__desc = { + "Absyn_Operator_ADD", + "Absyn.Operator.ADD", + Absyn_Operator_ADD__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Subscript_NOSUB__desc; +extern struct record_description Absyn_Operator_ADD__desc; #endif -#define Absyn__NOSUB_3dBOX0 3 -static const MMC_DEFSTRUCTLIT(Absyn__NOSUB__struct,1,3) {&Absyn_Subscript_NOSUB__desc}}; -static void *Absyn__NOSUB = MMC_REFSTRUCTLIT(Absyn__NOSUB__struct); +#define Absyn__ADD_3dBOX0 3 +static const MMC_DEFSTRUCTLIT(Absyn__ADD__struct,1,3) {&Absyn_Operator_ADD__desc}}; +static void *Absyn__ADD = MMC_REFSTRUCTLIT(Absyn__ADD__struct); #ifdef ADD_METARECORD_DEFINITIONS #ifndef Absyn_Subscript_SUBSCRIPT__desc_added #define Absyn_Subscript_SUBSCRIPT__desc_added @@ -3550,52 +3534,39 @@ ADD_METARECORD_DEFINITIONS struct record_description Absyn_Subscript_SUBSCRIPT__ extern struct record_description Absyn_Subscript_SUBSCRIPT__desc; #endif #define Absyn__SUBSCRIPT_3dBOX1 4 -#define Absyn__SUBSCRIPT(subscript) (mmc_mk_box2(4,&Absyn_Subscript_SUBSCRIPT__desc,subscript)) -#ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_ComponentRef_CREF__FULLYQUALIFIED__desc_added -#define Absyn_ComponentRef_CREF__FULLYQUALIFIED__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_ComponentRef_CREF__FULLYQUALIFIED__desc__fields[1] = {"componentRef"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_ComponentRef_CREF__FULLYQUALIFIED__desc = { - "Absyn_ComponentRef_CREF__FULLYQUALIFIED", - "Absyn.ComponentRef.CREF_FULLYQUALIFIED", - Absyn_ComponentRef_CREF__FULLYQUALIFIED__desc__fields -}; -#endif -#else /* Only use the file as a header */ -extern struct record_description Absyn_ComponentRef_CREF__FULLYQUALIFIED__desc; -#endif -#define Absyn__CREF_5fFULLYQUALIFIED_3dBOX1 3 -#define Absyn__CREF_5fFULLYQUALIFIED(componentRef) (mmc_mk_box2(3,&Absyn_ComponentRef_CREF__FULLYQUALIFIED__desc,componentRef)) -#ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_ComponentRef_CREF__QUAL__desc_added -#define Absyn_ComponentRef_CREF__QUAL__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_ComponentRef_CREF__QUAL__desc__fields[3] = {"name","subscripts","componentRef"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_ComponentRef_CREF__QUAL__desc = { - "Absyn_ComponentRef_CREF__QUAL", - "Absyn.ComponentRef.CREF_QUAL", - Absyn_ComponentRef_CREF__QUAL__desc__fields +#define Absyn__SUBSCRIPT(subscript) (mmc_mk_box2(4,&Absyn_Subscript_SUBSCRIPT__desc,subscript)) +#ifdef ADD_METARECORD_DEFINITIONS +#ifndef Absyn_Subscript_NOSUB__desc_added +#define Absyn_Subscript_NOSUB__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Subscript_NOSUB__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Subscript_NOSUB__desc = { + "Absyn_Subscript_NOSUB", + "Absyn.Subscript.NOSUB", + Absyn_Subscript_NOSUB__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_ComponentRef_CREF__QUAL__desc; +extern struct record_description Absyn_Subscript_NOSUB__desc; #endif -#define Absyn__CREF_5fQUAL_3dBOX3 4 -#define Absyn__CREF_5fQUAL(name,subscripts,componentRef) (mmc_mk_box4(4,&Absyn_ComponentRef_CREF__QUAL__desc,name,subscripts,componentRef)) +#define Absyn__NOSUB_3dBOX0 3 +static const MMC_DEFSTRUCTLIT(Absyn__NOSUB__struct,1,3) {&Absyn_Subscript_NOSUB__desc}}; +static void *Absyn__NOSUB = MMC_REFSTRUCTLIT(Absyn__NOSUB__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_ComponentRef_CREF__IDENT__desc_added -#define Absyn_ComponentRef_CREF__IDENT__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_ComponentRef_CREF__IDENT__desc__fields[2] = {"name","subscripts"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_ComponentRef_CREF__IDENT__desc = { - "Absyn_ComponentRef_CREF__IDENT", - "Absyn.ComponentRef.CREF_IDENT", - Absyn_ComponentRef_CREF__IDENT__desc__fields +#ifndef Absyn_ComponentRef_ALLWILD__desc_added +#define Absyn_ComponentRef_ALLWILD__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_ComponentRef_ALLWILD__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_ComponentRef_ALLWILD__desc = { + "Absyn_ComponentRef_ALLWILD", + "Absyn.ComponentRef.ALLWILD", + Absyn_ComponentRef_ALLWILD__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_ComponentRef_CREF__IDENT__desc; +extern struct record_description Absyn_ComponentRef_ALLWILD__desc; #endif -#define Absyn__CREF_5fIDENT_3dBOX2 5 -#define Absyn__CREF_5fIDENT(name,subscripts) (mmc_mk_box3(5,&Absyn_ComponentRef_CREF__IDENT__desc,name,subscripts)) +#define Absyn__ALLWILD_3dBOX0 7 +static const MMC_DEFSTRUCTLIT(Absyn__ALLWILD__struct,1,7) {&Absyn_ComponentRef_ALLWILD__desc}}; +static void *Absyn__ALLWILD = MMC_REFSTRUCTLIT(Absyn__ALLWILD__struct); #ifdef ADD_METARECORD_DEFINITIONS #ifndef Absyn_ComponentRef_WILD__desc_added #define Absyn_ComponentRef_WILD__desc_added @@ -3613,51 +3584,50 @@ extern struct record_description Absyn_ComponentRef_WILD__desc; static const MMC_DEFSTRUCTLIT(Absyn__WILD__struct,1,6) {&Absyn_ComponentRef_WILD__desc}}; static void *Absyn__WILD = MMC_REFSTRUCTLIT(Absyn__WILD__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_ComponentRef_ALLWILD__desc_added -#define Absyn_ComponentRef_ALLWILD__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_ComponentRef_ALLWILD__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_ComponentRef_ALLWILD__desc = { - "Absyn_ComponentRef_ALLWILD", - "Absyn.ComponentRef.ALLWILD", - Absyn_ComponentRef_ALLWILD__desc__fields +#ifndef Absyn_ComponentRef_CREF__IDENT__desc_added +#define Absyn_ComponentRef_CREF__IDENT__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_ComponentRef_CREF__IDENT__desc__fields[2] = {"name","subscripts"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_ComponentRef_CREF__IDENT__desc = { + "Absyn_ComponentRef_CREF__IDENT", + "Absyn.ComponentRef.CREF_IDENT", + Absyn_ComponentRef_CREF__IDENT__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_ComponentRef_ALLWILD__desc; +extern struct record_description Absyn_ComponentRef_CREF__IDENT__desc; #endif -#define Absyn__ALLWILD_3dBOX0 7 -static const MMC_DEFSTRUCTLIT(Absyn__ALLWILD__struct,1,7) {&Absyn_ComponentRef_ALLWILD__desc}}; -static void *Absyn__ALLWILD = MMC_REFSTRUCTLIT(Absyn__ALLWILD__struct); +#define Absyn__CREF_5fIDENT_3dBOX2 5 +#define Absyn__CREF_5fIDENT(name,subscripts) (mmc_mk_box3(5,&Absyn_ComponentRef_CREF__IDENT__desc,name,subscripts)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Path_QUALIFIED__desc_added -#define Absyn_Path_QUALIFIED__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Path_QUALIFIED__desc__fields[2] = {"name","path"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Path_QUALIFIED__desc = { - "Absyn_Path_QUALIFIED", - "Absyn.Path.QUALIFIED", - Absyn_Path_QUALIFIED__desc__fields +#ifndef Absyn_ComponentRef_CREF__QUAL__desc_added +#define Absyn_ComponentRef_CREF__QUAL__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_ComponentRef_CREF__QUAL__desc__fields[3] = {"name","subscripts","componentRef"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_ComponentRef_CREF__QUAL__desc = { + "Absyn_ComponentRef_CREF__QUAL", + "Absyn.ComponentRef.CREF_QUAL", + Absyn_ComponentRef_CREF__QUAL__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Path_QUALIFIED__desc; +extern struct record_description Absyn_ComponentRef_CREF__QUAL__desc; #endif -#define Absyn__QUALIFIED_3dBOX2 3 -#define Absyn__QUALIFIED(name,path) (mmc_mk_box3(3,&Absyn_Path_QUALIFIED__desc,name,path)) +#define Absyn__CREF_5fQUAL_3dBOX3 4 +#define Absyn__CREF_5fQUAL(name,subscripts,componentRef) (mmc_mk_box4(4,&Absyn_ComponentRef_CREF__QUAL__desc,name,subscripts,componentRef)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Path_IDENT__desc_added -#define Absyn_Path_IDENT__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Path_IDENT__desc__fields[1] = {"name"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Path_IDENT__desc = { - "Absyn_Path_IDENT", - "Absyn.Path.IDENT", - Absyn_Path_IDENT__desc__fields +#ifndef Absyn_ComponentRef_CREF__FULLYQUALIFIED__desc_added +#define Absyn_ComponentRef_CREF__FULLYQUALIFIED__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_ComponentRef_CREF__FULLYQUALIFIED__desc__fields[1] = {"componentRef"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_ComponentRef_CREF__FULLYQUALIFIED__desc = { + "Absyn_ComponentRef_CREF__FULLYQUALIFIED", + "Absyn.ComponentRef.CREF_FULLYQUALIFIED", + Absyn_ComponentRef_CREF__FULLYQUALIFIED__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Path_IDENT__desc; +extern struct record_description Absyn_ComponentRef_CREF__FULLYQUALIFIED__desc; #endif -#define Absyn__IDENT_3dBOX1 4 -#define Absyn__IDENT(name) (mmc_mk_box2(4,&Absyn_Path_IDENT__desc,name)) +#define Absyn__CREF_5fFULLYQUALIFIED_3dBOX1 3 +#define Absyn__CREF_5fFULLYQUALIFIED(componentRef) (mmc_mk_box2(3,&Absyn_ComponentRef_CREF__FULLYQUALIFIED__desc,componentRef)) #ifdef ADD_METARECORD_DEFINITIONS #ifndef Absyn_Path_FULLYQUALIFIED__desc_added #define Absyn_Path_FULLYQUALIFIED__desc_added @@ -3674,196 +3644,178 @@ extern struct record_description Absyn_Path_FULLYQUALIFIED__desc; #define Absyn__FULLYQUALIFIED_3dBOX1 5 #define Absyn__FULLYQUALIFIED(path) (mmc_mk_box2(5,&Absyn_Path_FULLYQUALIFIED__desc,path)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Restriction_R__CLASS__desc_added -#define Absyn_Restriction_R__CLASS__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Restriction_R__CLASS__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Restriction_R__CLASS__desc = { - "Absyn_Restriction_R__CLASS", - "Absyn.Restriction.R_CLASS", - Absyn_Restriction_R__CLASS__desc__fields -}; -#endif -#else /* Only use the file as a header */ -extern struct record_description Absyn_Restriction_R__CLASS__desc; -#endif -#define Absyn__R_5fCLASS_3dBOX0 3 -static const MMC_DEFSTRUCTLIT(Absyn__R_5fCLASS__struct,1,3) {&Absyn_Restriction_R__CLASS__desc}}; -static void *Absyn__R_5fCLASS = MMC_REFSTRUCTLIT(Absyn__R_5fCLASS__struct); -#ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Restriction_R__OPTIMIZATION__desc_added -#define Absyn_Restriction_R__OPTIMIZATION__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Restriction_R__OPTIMIZATION__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Restriction_R__OPTIMIZATION__desc = { - "Absyn_Restriction_R__OPTIMIZATION", - "Absyn.Restriction.R_OPTIMIZATION", - Absyn_Restriction_R__OPTIMIZATION__desc__fields +#ifndef Absyn_Path_IDENT__desc_added +#define Absyn_Path_IDENT__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Path_IDENT__desc__fields[1] = {"name"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Path_IDENT__desc = { + "Absyn_Path_IDENT", + "Absyn.Path.IDENT", + Absyn_Path_IDENT__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Restriction_R__OPTIMIZATION__desc; +extern struct record_description Absyn_Path_IDENT__desc; #endif -#define Absyn__R_5fOPTIMIZATION_3dBOX0 4 -static const MMC_DEFSTRUCTLIT(Absyn__R_5fOPTIMIZATION__struct,1,4) {&Absyn_Restriction_R__OPTIMIZATION__desc}}; -static void *Absyn__R_5fOPTIMIZATION = MMC_REFSTRUCTLIT(Absyn__R_5fOPTIMIZATION__struct); +#define Absyn__IDENT_3dBOX1 4 +#define Absyn__IDENT(name) (mmc_mk_box2(4,&Absyn_Path_IDENT__desc,name)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Restriction_R__MODEL__desc_added -#define Absyn_Restriction_R__MODEL__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Restriction_R__MODEL__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Restriction_R__MODEL__desc = { - "Absyn_Restriction_R__MODEL", - "Absyn.Restriction.R_MODEL", - Absyn_Restriction_R__MODEL__desc__fields +#ifndef Absyn_Path_QUALIFIED__desc_added +#define Absyn_Path_QUALIFIED__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Path_QUALIFIED__desc__fields[2] = {"name","path"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Path_QUALIFIED__desc = { + "Absyn_Path_QUALIFIED", + "Absyn.Path.QUALIFIED", + Absyn_Path_QUALIFIED__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Restriction_R__MODEL__desc; +extern struct record_description Absyn_Path_QUALIFIED__desc; #endif -#define Absyn__R_5fMODEL_3dBOX0 5 -static const MMC_DEFSTRUCTLIT(Absyn__R_5fMODEL__struct,1,5) {&Absyn_Restriction_R__MODEL__desc}}; -static void *Absyn__R_5fMODEL = MMC_REFSTRUCTLIT(Absyn__R_5fMODEL__struct); +#define Absyn__QUALIFIED_3dBOX2 3 +#define Absyn__QUALIFIED(name,path) (mmc_mk_box3(3,&Absyn_Path_QUALIFIED__desc,name,path)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Restriction_R__RECORD__desc_added -#define Absyn_Restriction_R__RECORD__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Restriction_R__RECORD__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Restriction_R__RECORD__desc = { - "Absyn_Restriction_R__RECORD", - "Absyn.Restriction.R_RECORD", - Absyn_Restriction_R__RECORD__desc__fields +#ifndef Absyn_Restriction_R__UNKNOWN__desc_added +#define Absyn_Restriction_R__UNKNOWN__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Restriction_R__UNKNOWN__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Restriction_R__UNKNOWN__desc = { + "Absyn_Restriction_R__UNKNOWN", + "Absyn.Restriction.R_UNKNOWN", + Absyn_Restriction_R__UNKNOWN__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Restriction_R__RECORD__desc; +extern struct record_description Absyn_Restriction_R__UNKNOWN__desc; #endif -#define Absyn__R_5fRECORD_3dBOX0 6 -static const MMC_DEFSTRUCTLIT(Absyn__R_5fRECORD__struct,1,6) {&Absyn_Restriction_R__RECORD__desc}}; -static void *Absyn__R_5fRECORD = MMC_REFSTRUCTLIT(Absyn__R_5fRECORD__struct); +#define Absyn__R_5fUNKNOWN_3dBOX0 24 +static const MMC_DEFSTRUCTLIT(Absyn__R_5fUNKNOWN__struct,1,24) {&Absyn_Restriction_R__UNKNOWN__desc}}; +static void *Absyn__R_5fUNKNOWN = MMC_REFSTRUCTLIT(Absyn__R_5fUNKNOWN__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Restriction_R__BLOCK__desc_added -#define Absyn_Restriction_R__BLOCK__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Restriction_R__BLOCK__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Restriction_R__BLOCK__desc = { - "Absyn_Restriction_R__BLOCK", - "Absyn.Restriction.R_BLOCK", - Absyn_Restriction_R__BLOCK__desc__fields +#ifndef Absyn_Restriction_R__METARECORD__desc_added +#define Absyn_Restriction_R__METARECORD__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Restriction_R__METARECORD__desc__fields[4] = {"name","index","singleton","moved"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Restriction_R__METARECORD__desc = { + "Absyn_Restriction_R__METARECORD", + "Absyn.Restriction.R_METARECORD", + Absyn_Restriction_R__METARECORD__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Restriction_R__BLOCK__desc; +extern struct record_description Absyn_Restriction_R__METARECORD__desc; #endif -#define Absyn__R_5fBLOCK_3dBOX0 7 -static const MMC_DEFSTRUCTLIT(Absyn__R_5fBLOCK__struct,1,7) {&Absyn_Restriction_R__BLOCK__desc}}; -static void *Absyn__R_5fBLOCK = MMC_REFSTRUCTLIT(Absyn__R_5fBLOCK__struct); +#define Absyn__R_5fMETARECORD_3dBOX4 23 +#define Absyn__R_5fMETARECORD(name,index,singleton,moved) (mmc_mk_box5(23,&Absyn_Restriction_R__METARECORD__desc,name,index,singleton,moved)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Restriction_R__CONNECTOR__desc_added -#define Absyn_Restriction_R__CONNECTOR__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Restriction_R__CONNECTOR__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Restriction_R__CONNECTOR__desc = { - "Absyn_Restriction_R__CONNECTOR", - "Absyn.Restriction.R_CONNECTOR", - Absyn_Restriction_R__CONNECTOR__desc__fields +#ifndef Absyn_Restriction_R__UNIONTYPE__desc_added +#define Absyn_Restriction_R__UNIONTYPE__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Restriction_R__UNIONTYPE__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Restriction_R__UNIONTYPE__desc = { + "Absyn_Restriction_R__UNIONTYPE", + "Absyn.Restriction.R_UNIONTYPE", + Absyn_Restriction_R__UNIONTYPE__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Restriction_R__CONNECTOR__desc; +extern struct record_description Absyn_Restriction_R__UNIONTYPE__desc; #endif -#define Absyn__R_5fCONNECTOR_3dBOX0 8 -static const MMC_DEFSTRUCTLIT(Absyn__R_5fCONNECTOR__struct,1,8) {&Absyn_Restriction_R__CONNECTOR__desc}}; -static void *Absyn__R_5fCONNECTOR = MMC_REFSTRUCTLIT(Absyn__R_5fCONNECTOR__struct); +#define Absyn__R_5fUNIONTYPE_3dBOX0 22 +static const MMC_DEFSTRUCTLIT(Absyn__R_5fUNIONTYPE__struct,1,22) {&Absyn_Restriction_R__UNIONTYPE__desc}}; +static void *Absyn__R_5fUNIONTYPE = MMC_REFSTRUCTLIT(Absyn__R_5fUNIONTYPE__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Restriction_R__EXP__CONNECTOR__desc_added -#define Absyn_Restriction_R__EXP__CONNECTOR__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Restriction_R__EXP__CONNECTOR__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Restriction_R__EXP__CONNECTOR__desc = { - "Absyn_Restriction_R__EXP__CONNECTOR", - "Absyn.Restriction.R_EXP_CONNECTOR", - Absyn_Restriction_R__EXP__CONNECTOR__desc__fields +#ifndef Absyn_Restriction_R__PREDEFINED__CLOCK__desc_added +#define Absyn_Restriction_R__PREDEFINED__CLOCK__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Restriction_R__PREDEFINED__CLOCK__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Restriction_R__PREDEFINED__CLOCK__desc = { + "Absyn_Restriction_R__PREDEFINED__CLOCK", + "Absyn.Restriction.R_PREDEFINED_CLOCK", + Absyn_Restriction_R__PREDEFINED__CLOCK__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Restriction_R__EXP__CONNECTOR__desc; +extern struct record_description Absyn_Restriction_R__PREDEFINED__CLOCK__desc; #endif -#define Absyn__R_5fEXP_5fCONNECTOR_3dBOX0 9 -static const MMC_DEFSTRUCTLIT(Absyn__R_5fEXP_5fCONNECTOR__struct,1,9) {&Absyn_Restriction_R__EXP__CONNECTOR__desc}}; -static void *Absyn__R_5fEXP_5fCONNECTOR = MMC_REFSTRUCTLIT(Absyn__R_5fEXP_5fCONNECTOR__struct); +#define Absyn__R_5fPREDEFINED_5fCLOCK_3dBOX0 21 +static const MMC_DEFSTRUCTLIT(Absyn__R_5fPREDEFINED_5fCLOCK__struct,1,21) {&Absyn_Restriction_R__PREDEFINED__CLOCK__desc}}; +static void *Absyn__R_5fPREDEFINED_5fCLOCK = MMC_REFSTRUCTLIT(Absyn__R_5fPREDEFINED_5fCLOCK__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Restriction_R__TYPE__desc_added -#define Absyn_Restriction_R__TYPE__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Restriction_R__TYPE__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Restriction_R__TYPE__desc = { - "Absyn_Restriction_R__TYPE", - "Absyn.Restriction.R_TYPE", - Absyn_Restriction_R__TYPE__desc__fields +#ifndef Absyn_Restriction_R__PREDEFINED__ENUMERATION__desc_added +#define Absyn_Restriction_R__PREDEFINED__ENUMERATION__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Restriction_R__PREDEFINED__ENUMERATION__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Restriction_R__PREDEFINED__ENUMERATION__desc = { + "Absyn_Restriction_R__PREDEFINED__ENUMERATION", + "Absyn.Restriction.R_PREDEFINED_ENUMERATION", + Absyn_Restriction_R__PREDEFINED__ENUMERATION__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Restriction_R__TYPE__desc; +extern struct record_description Absyn_Restriction_R__PREDEFINED__ENUMERATION__desc; #endif -#define Absyn__R_5fTYPE_3dBOX0 10 -static const MMC_DEFSTRUCTLIT(Absyn__R_5fTYPE__struct,1,10) {&Absyn_Restriction_R__TYPE__desc}}; -static void *Absyn__R_5fTYPE = MMC_REFSTRUCTLIT(Absyn__R_5fTYPE__struct); +#define Absyn__R_5fPREDEFINED_5fENUMERATION_3dBOX0 20 +static const MMC_DEFSTRUCTLIT(Absyn__R_5fPREDEFINED_5fENUMERATION__struct,1,20) {&Absyn_Restriction_R__PREDEFINED__ENUMERATION__desc}}; +static void *Absyn__R_5fPREDEFINED_5fENUMERATION = MMC_REFSTRUCTLIT(Absyn__R_5fPREDEFINED_5fENUMERATION__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Restriction_R__PACKAGE__desc_added -#define Absyn_Restriction_R__PACKAGE__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Restriction_R__PACKAGE__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Restriction_R__PACKAGE__desc = { - "Absyn_Restriction_R__PACKAGE", - "Absyn.Restriction.R_PACKAGE", - Absyn_Restriction_R__PACKAGE__desc__fields +#ifndef Absyn_Restriction_R__PREDEFINED__BOOLEAN__desc_added +#define Absyn_Restriction_R__PREDEFINED__BOOLEAN__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Restriction_R__PREDEFINED__BOOLEAN__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Restriction_R__PREDEFINED__BOOLEAN__desc = { + "Absyn_Restriction_R__PREDEFINED__BOOLEAN", + "Absyn.Restriction.R_PREDEFINED_BOOLEAN", + Absyn_Restriction_R__PREDEFINED__BOOLEAN__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Restriction_R__PACKAGE__desc; +extern struct record_description Absyn_Restriction_R__PREDEFINED__BOOLEAN__desc; #endif -#define Absyn__R_5fPACKAGE_3dBOX0 11 -static const MMC_DEFSTRUCTLIT(Absyn__R_5fPACKAGE__struct,1,11) {&Absyn_Restriction_R__PACKAGE__desc}}; -static void *Absyn__R_5fPACKAGE = MMC_REFSTRUCTLIT(Absyn__R_5fPACKAGE__struct); +#define Absyn__R_5fPREDEFINED_5fBOOLEAN_3dBOX0 19 +static const MMC_DEFSTRUCTLIT(Absyn__R_5fPREDEFINED_5fBOOLEAN__struct,1,19) {&Absyn_Restriction_R__PREDEFINED__BOOLEAN__desc}}; +static void *Absyn__R_5fPREDEFINED_5fBOOLEAN = MMC_REFSTRUCTLIT(Absyn__R_5fPREDEFINED_5fBOOLEAN__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Restriction_R__FUNCTION__desc_added -#define Absyn_Restriction_R__FUNCTION__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Restriction_R__FUNCTION__desc__fields[1] = {"functionRestriction"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Restriction_R__FUNCTION__desc = { - "Absyn_Restriction_R__FUNCTION", - "Absyn.Restriction.R_FUNCTION", - Absyn_Restriction_R__FUNCTION__desc__fields +#ifndef Absyn_Restriction_R__PREDEFINED__STRING__desc_added +#define Absyn_Restriction_R__PREDEFINED__STRING__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Restriction_R__PREDEFINED__STRING__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Restriction_R__PREDEFINED__STRING__desc = { + "Absyn_Restriction_R__PREDEFINED__STRING", + "Absyn.Restriction.R_PREDEFINED_STRING", + Absyn_Restriction_R__PREDEFINED__STRING__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Restriction_R__FUNCTION__desc; +extern struct record_description Absyn_Restriction_R__PREDEFINED__STRING__desc; #endif -#define Absyn__R_5fFUNCTION_3dBOX1 12 -#define Absyn__R_5fFUNCTION(functionRestriction) (mmc_mk_box2(12,&Absyn_Restriction_R__FUNCTION__desc,functionRestriction)) +#define Absyn__R_5fPREDEFINED_5fSTRING_3dBOX0 18 +static const MMC_DEFSTRUCTLIT(Absyn__R_5fPREDEFINED_5fSTRING__struct,1,18) {&Absyn_Restriction_R__PREDEFINED__STRING__desc}}; +static void *Absyn__R_5fPREDEFINED_5fSTRING = MMC_REFSTRUCTLIT(Absyn__R_5fPREDEFINED_5fSTRING__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Restriction_R__OPERATOR__desc_added -#define Absyn_Restriction_R__OPERATOR__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Restriction_R__OPERATOR__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Restriction_R__OPERATOR__desc = { - "Absyn_Restriction_R__OPERATOR", - "Absyn.Restriction.R_OPERATOR", - Absyn_Restriction_R__OPERATOR__desc__fields +#ifndef Absyn_Restriction_R__PREDEFINED__REAL__desc_added +#define Absyn_Restriction_R__PREDEFINED__REAL__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Restriction_R__PREDEFINED__REAL__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Restriction_R__PREDEFINED__REAL__desc = { + "Absyn_Restriction_R__PREDEFINED__REAL", + "Absyn.Restriction.R_PREDEFINED_REAL", + Absyn_Restriction_R__PREDEFINED__REAL__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Restriction_R__OPERATOR__desc; +extern struct record_description Absyn_Restriction_R__PREDEFINED__REAL__desc; #endif -#define Absyn__R_5fOPERATOR_3dBOX0 13 -static const MMC_DEFSTRUCTLIT(Absyn__R_5fOPERATOR__struct,1,13) {&Absyn_Restriction_R__OPERATOR__desc}}; -static void *Absyn__R_5fOPERATOR = MMC_REFSTRUCTLIT(Absyn__R_5fOPERATOR__struct); +#define Absyn__R_5fPREDEFINED_5fREAL_3dBOX0 17 +static const MMC_DEFSTRUCTLIT(Absyn__R_5fPREDEFINED_5fREAL__struct,1,17) {&Absyn_Restriction_R__PREDEFINED__REAL__desc}}; +static void *Absyn__R_5fPREDEFINED_5fREAL = MMC_REFSTRUCTLIT(Absyn__R_5fPREDEFINED_5fREAL__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Restriction_R__OPERATOR__RECORD__desc_added -#define Absyn_Restriction_R__OPERATOR__RECORD__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Restriction_R__OPERATOR__RECORD__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Restriction_R__OPERATOR__RECORD__desc = { - "Absyn_Restriction_R__OPERATOR__RECORD", - "Absyn.Restriction.R_OPERATOR_RECORD", - Absyn_Restriction_R__OPERATOR__RECORD__desc__fields +#ifndef Absyn_Restriction_R__PREDEFINED__INTEGER__desc_added +#define Absyn_Restriction_R__PREDEFINED__INTEGER__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Restriction_R__PREDEFINED__INTEGER__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Restriction_R__PREDEFINED__INTEGER__desc = { + "Absyn_Restriction_R__PREDEFINED__INTEGER", + "Absyn.Restriction.R_PREDEFINED_INTEGER", + Absyn_Restriction_R__PREDEFINED__INTEGER__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Restriction_R__OPERATOR__RECORD__desc; +extern struct record_description Absyn_Restriction_R__PREDEFINED__INTEGER__desc; #endif -#define Absyn__R_5fOPERATOR_5fRECORD_3dBOX0 14 -static const MMC_DEFSTRUCTLIT(Absyn__R_5fOPERATOR_5fRECORD__struct,1,14) {&Absyn_Restriction_R__OPERATOR__RECORD__desc}}; -static void *Absyn__R_5fOPERATOR_5fRECORD = MMC_REFSTRUCTLIT(Absyn__R_5fOPERATOR_5fRECORD__struct); +#define Absyn__R_5fPREDEFINED_5fINTEGER_3dBOX0 16 +static const MMC_DEFSTRUCTLIT(Absyn__R_5fPREDEFINED_5fINTEGER__struct,1,16) {&Absyn_Restriction_R__PREDEFINED__INTEGER__desc}}; +static void *Absyn__R_5fPREDEFINED_5fINTEGER = MMC_REFSTRUCTLIT(Absyn__R_5fPREDEFINED_5fINTEGER__struct); #ifdef ADD_METARECORD_DEFINITIONS #ifndef Absyn_Restriction_R__ENUMERATION__desc_added #define Absyn_Restriction_R__ENUMERATION__desc_added @@ -3881,180 +3833,196 @@ extern struct record_description Absyn_Restriction_R__ENUMERATION__desc; static const MMC_DEFSTRUCTLIT(Absyn__R_5fENUMERATION__struct,1,15) {&Absyn_Restriction_R__ENUMERATION__desc}}; static void *Absyn__R_5fENUMERATION = MMC_REFSTRUCTLIT(Absyn__R_5fENUMERATION__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Restriction_R__PREDEFINED__INTEGER__desc_added -#define Absyn_Restriction_R__PREDEFINED__INTEGER__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Restriction_R__PREDEFINED__INTEGER__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Restriction_R__PREDEFINED__INTEGER__desc = { - "Absyn_Restriction_R__PREDEFINED__INTEGER", - "Absyn.Restriction.R_PREDEFINED_INTEGER", - Absyn_Restriction_R__PREDEFINED__INTEGER__desc__fields +#ifndef Absyn_Restriction_R__OPERATOR__RECORD__desc_added +#define Absyn_Restriction_R__OPERATOR__RECORD__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Restriction_R__OPERATOR__RECORD__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Restriction_R__OPERATOR__RECORD__desc = { + "Absyn_Restriction_R__OPERATOR__RECORD", + "Absyn.Restriction.R_OPERATOR_RECORD", + Absyn_Restriction_R__OPERATOR__RECORD__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Restriction_R__PREDEFINED__INTEGER__desc; +extern struct record_description Absyn_Restriction_R__OPERATOR__RECORD__desc; #endif -#define Absyn__R_5fPREDEFINED_5fINTEGER_3dBOX0 16 -static const MMC_DEFSTRUCTLIT(Absyn__R_5fPREDEFINED_5fINTEGER__struct,1,16) {&Absyn_Restriction_R__PREDEFINED__INTEGER__desc}}; -static void *Absyn__R_5fPREDEFINED_5fINTEGER = MMC_REFSTRUCTLIT(Absyn__R_5fPREDEFINED_5fINTEGER__struct); +#define Absyn__R_5fOPERATOR_5fRECORD_3dBOX0 14 +static const MMC_DEFSTRUCTLIT(Absyn__R_5fOPERATOR_5fRECORD__struct,1,14) {&Absyn_Restriction_R__OPERATOR__RECORD__desc}}; +static void *Absyn__R_5fOPERATOR_5fRECORD = MMC_REFSTRUCTLIT(Absyn__R_5fOPERATOR_5fRECORD__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Restriction_R__PREDEFINED__REAL__desc_added -#define Absyn_Restriction_R__PREDEFINED__REAL__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Restriction_R__PREDEFINED__REAL__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Restriction_R__PREDEFINED__REAL__desc = { - "Absyn_Restriction_R__PREDEFINED__REAL", - "Absyn.Restriction.R_PREDEFINED_REAL", - Absyn_Restriction_R__PREDEFINED__REAL__desc__fields +#ifndef Absyn_Restriction_R__OPERATOR__desc_added +#define Absyn_Restriction_R__OPERATOR__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Restriction_R__OPERATOR__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Restriction_R__OPERATOR__desc = { + "Absyn_Restriction_R__OPERATOR", + "Absyn.Restriction.R_OPERATOR", + Absyn_Restriction_R__OPERATOR__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Restriction_R__PREDEFINED__REAL__desc; +extern struct record_description Absyn_Restriction_R__OPERATOR__desc; #endif -#define Absyn__R_5fPREDEFINED_5fREAL_3dBOX0 17 -static const MMC_DEFSTRUCTLIT(Absyn__R_5fPREDEFINED_5fREAL__struct,1,17) {&Absyn_Restriction_R__PREDEFINED__REAL__desc}}; -static void *Absyn__R_5fPREDEFINED_5fREAL = MMC_REFSTRUCTLIT(Absyn__R_5fPREDEFINED_5fREAL__struct); +#define Absyn__R_5fOPERATOR_3dBOX0 13 +static const MMC_DEFSTRUCTLIT(Absyn__R_5fOPERATOR__struct,1,13) {&Absyn_Restriction_R__OPERATOR__desc}}; +static void *Absyn__R_5fOPERATOR = MMC_REFSTRUCTLIT(Absyn__R_5fOPERATOR__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Restriction_R__PREDEFINED__STRING__desc_added -#define Absyn_Restriction_R__PREDEFINED__STRING__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Restriction_R__PREDEFINED__STRING__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Restriction_R__PREDEFINED__STRING__desc = { - "Absyn_Restriction_R__PREDEFINED__STRING", - "Absyn.Restriction.R_PREDEFINED_STRING", - Absyn_Restriction_R__PREDEFINED__STRING__desc__fields +#ifndef Absyn_Restriction_R__FUNCTION__desc_added +#define Absyn_Restriction_R__FUNCTION__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Restriction_R__FUNCTION__desc__fields[1] = {"functionRestriction"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Restriction_R__FUNCTION__desc = { + "Absyn_Restriction_R__FUNCTION", + "Absyn.Restriction.R_FUNCTION", + Absyn_Restriction_R__FUNCTION__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Restriction_R__PREDEFINED__STRING__desc; +extern struct record_description Absyn_Restriction_R__FUNCTION__desc; #endif -#define Absyn__R_5fPREDEFINED_5fSTRING_3dBOX0 18 -static const MMC_DEFSTRUCTLIT(Absyn__R_5fPREDEFINED_5fSTRING__struct,1,18) {&Absyn_Restriction_R__PREDEFINED__STRING__desc}}; -static void *Absyn__R_5fPREDEFINED_5fSTRING = MMC_REFSTRUCTLIT(Absyn__R_5fPREDEFINED_5fSTRING__struct); +#define Absyn__R_5fFUNCTION_3dBOX1 12 +#define Absyn__R_5fFUNCTION(functionRestriction) (mmc_mk_box2(12,&Absyn_Restriction_R__FUNCTION__desc,functionRestriction)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Restriction_R__PREDEFINED__BOOLEAN__desc_added -#define Absyn_Restriction_R__PREDEFINED__BOOLEAN__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Restriction_R__PREDEFINED__BOOLEAN__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Restriction_R__PREDEFINED__BOOLEAN__desc = { - "Absyn_Restriction_R__PREDEFINED__BOOLEAN", - "Absyn.Restriction.R_PREDEFINED_BOOLEAN", - Absyn_Restriction_R__PREDEFINED__BOOLEAN__desc__fields +#ifndef Absyn_Restriction_R__PACKAGE__desc_added +#define Absyn_Restriction_R__PACKAGE__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Restriction_R__PACKAGE__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Restriction_R__PACKAGE__desc = { + "Absyn_Restriction_R__PACKAGE", + "Absyn.Restriction.R_PACKAGE", + Absyn_Restriction_R__PACKAGE__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Restriction_R__PREDEFINED__BOOLEAN__desc; +extern struct record_description Absyn_Restriction_R__PACKAGE__desc; #endif -#define Absyn__R_5fPREDEFINED_5fBOOLEAN_3dBOX0 19 -static const MMC_DEFSTRUCTLIT(Absyn__R_5fPREDEFINED_5fBOOLEAN__struct,1,19) {&Absyn_Restriction_R__PREDEFINED__BOOLEAN__desc}}; -static void *Absyn__R_5fPREDEFINED_5fBOOLEAN = MMC_REFSTRUCTLIT(Absyn__R_5fPREDEFINED_5fBOOLEAN__struct); +#define Absyn__R_5fPACKAGE_3dBOX0 11 +static const MMC_DEFSTRUCTLIT(Absyn__R_5fPACKAGE__struct,1,11) {&Absyn_Restriction_R__PACKAGE__desc}}; +static void *Absyn__R_5fPACKAGE = MMC_REFSTRUCTLIT(Absyn__R_5fPACKAGE__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Restriction_R__PREDEFINED__ENUMERATION__desc_added -#define Absyn_Restriction_R__PREDEFINED__ENUMERATION__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Restriction_R__PREDEFINED__ENUMERATION__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Restriction_R__PREDEFINED__ENUMERATION__desc = { - "Absyn_Restriction_R__PREDEFINED__ENUMERATION", - "Absyn.Restriction.R_PREDEFINED_ENUMERATION", - Absyn_Restriction_R__PREDEFINED__ENUMERATION__desc__fields +#ifndef Absyn_Restriction_R__TYPE__desc_added +#define Absyn_Restriction_R__TYPE__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Restriction_R__TYPE__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Restriction_R__TYPE__desc = { + "Absyn_Restriction_R__TYPE", + "Absyn.Restriction.R_TYPE", + Absyn_Restriction_R__TYPE__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Restriction_R__PREDEFINED__ENUMERATION__desc; +extern struct record_description Absyn_Restriction_R__TYPE__desc; #endif -#define Absyn__R_5fPREDEFINED_5fENUMERATION_3dBOX0 20 -static const MMC_DEFSTRUCTLIT(Absyn__R_5fPREDEFINED_5fENUMERATION__struct,1,20) {&Absyn_Restriction_R__PREDEFINED__ENUMERATION__desc}}; -static void *Absyn__R_5fPREDEFINED_5fENUMERATION = MMC_REFSTRUCTLIT(Absyn__R_5fPREDEFINED_5fENUMERATION__struct); +#define Absyn__R_5fTYPE_3dBOX0 10 +static const MMC_DEFSTRUCTLIT(Absyn__R_5fTYPE__struct,1,10) {&Absyn_Restriction_R__TYPE__desc}}; +static void *Absyn__R_5fTYPE = MMC_REFSTRUCTLIT(Absyn__R_5fTYPE__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Restriction_R__PREDEFINED__CLOCK__desc_added -#define Absyn_Restriction_R__PREDEFINED__CLOCK__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Restriction_R__PREDEFINED__CLOCK__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Restriction_R__PREDEFINED__CLOCK__desc = { - "Absyn_Restriction_R__PREDEFINED__CLOCK", - "Absyn.Restriction.R_PREDEFINED_CLOCK", - Absyn_Restriction_R__PREDEFINED__CLOCK__desc__fields +#ifndef Absyn_Restriction_R__EXP__CONNECTOR__desc_added +#define Absyn_Restriction_R__EXP__CONNECTOR__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Restriction_R__EXP__CONNECTOR__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Restriction_R__EXP__CONNECTOR__desc = { + "Absyn_Restriction_R__EXP__CONNECTOR", + "Absyn.Restriction.R_EXP_CONNECTOR", + Absyn_Restriction_R__EXP__CONNECTOR__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Restriction_R__PREDEFINED__CLOCK__desc; +extern struct record_description Absyn_Restriction_R__EXP__CONNECTOR__desc; #endif -#define Absyn__R_5fPREDEFINED_5fCLOCK_3dBOX0 21 -static const MMC_DEFSTRUCTLIT(Absyn__R_5fPREDEFINED_5fCLOCK__struct,1,21) {&Absyn_Restriction_R__PREDEFINED__CLOCK__desc}}; -static void *Absyn__R_5fPREDEFINED_5fCLOCK = MMC_REFSTRUCTLIT(Absyn__R_5fPREDEFINED_5fCLOCK__struct); +#define Absyn__R_5fEXP_5fCONNECTOR_3dBOX0 9 +static const MMC_DEFSTRUCTLIT(Absyn__R_5fEXP_5fCONNECTOR__struct,1,9) {&Absyn_Restriction_R__EXP__CONNECTOR__desc}}; +static void *Absyn__R_5fEXP_5fCONNECTOR = MMC_REFSTRUCTLIT(Absyn__R_5fEXP_5fCONNECTOR__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Restriction_R__UNIONTYPE__desc_added -#define Absyn_Restriction_R__UNIONTYPE__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Restriction_R__UNIONTYPE__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Restriction_R__UNIONTYPE__desc = { - "Absyn_Restriction_R__UNIONTYPE", - "Absyn.Restriction.R_UNIONTYPE", - Absyn_Restriction_R__UNIONTYPE__desc__fields +#ifndef Absyn_Restriction_R__CONNECTOR__desc_added +#define Absyn_Restriction_R__CONNECTOR__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Restriction_R__CONNECTOR__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Restriction_R__CONNECTOR__desc = { + "Absyn_Restriction_R__CONNECTOR", + "Absyn.Restriction.R_CONNECTOR", + Absyn_Restriction_R__CONNECTOR__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Restriction_R__UNIONTYPE__desc; +extern struct record_description Absyn_Restriction_R__CONNECTOR__desc; +#endif +#define Absyn__R_5fCONNECTOR_3dBOX0 8 +static const MMC_DEFSTRUCTLIT(Absyn__R_5fCONNECTOR__struct,1,8) {&Absyn_Restriction_R__CONNECTOR__desc}}; +static void *Absyn__R_5fCONNECTOR = MMC_REFSTRUCTLIT(Absyn__R_5fCONNECTOR__struct); +#ifdef ADD_METARECORD_DEFINITIONS +#ifndef Absyn_Restriction_R__BLOCK__desc_added +#define Absyn_Restriction_R__BLOCK__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Restriction_R__BLOCK__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Restriction_R__BLOCK__desc = { + "Absyn_Restriction_R__BLOCK", + "Absyn.Restriction.R_BLOCK", + Absyn_Restriction_R__BLOCK__desc__fields +}; +#endif +#else /* Only use the file as a header */ +extern struct record_description Absyn_Restriction_R__BLOCK__desc; #endif -#define Absyn__R_5fUNIONTYPE_3dBOX0 22 -static const MMC_DEFSTRUCTLIT(Absyn__R_5fUNIONTYPE__struct,1,22) {&Absyn_Restriction_R__UNIONTYPE__desc}}; -static void *Absyn__R_5fUNIONTYPE = MMC_REFSTRUCTLIT(Absyn__R_5fUNIONTYPE__struct); +#define Absyn__R_5fBLOCK_3dBOX0 7 +static const MMC_DEFSTRUCTLIT(Absyn__R_5fBLOCK__struct,1,7) {&Absyn_Restriction_R__BLOCK__desc}}; +static void *Absyn__R_5fBLOCK = MMC_REFSTRUCTLIT(Absyn__R_5fBLOCK__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Restriction_R__METARECORD__desc_added -#define Absyn_Restriction_R__METARECORD__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Restriction_R__METARECORD__desc__fields[3] = {"name","index","singleton"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Restriction_R__METARECORD__desc = { - "Absyn_Restriction_R__METARECORD", - "Absyn.Restriction.R_METARECORD", - Absyn_Restriction_R__METARECORD__desc__fields +#ifndef Absyn_Restriction_R__RECORD__desc_added +#define Absyn_Restriction_R__RECORD__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Restriction_R__RECORD__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Restriction_R__RECORD__desc = { + "Absyn_Restriction_R__RECORD", + "Absyn.Restriction.R_RECORD", + Absyn_Restriction_R__RECORD__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Restriction_R__METARECORD__desc; +extern struct record_description Absyn_Restriction_R__RECORD__desc; #endif -#define Absyn__R_5fMETARECORD_3dBOX3 23 -#define Absyn__R_5fMETARECORD(name,index,singleton) (mmc_mk_box4(23,&Absyn_Restriction_R__METARECORD__desc,name,index,singleton)) +#define Absyn__R_5fRECORD_3dBOX0 6 +static const MMC_DEFSTRUCTLIT(Absyn__R_5fRECORD__struct,1,6) {&Absyn_Restriction_R__RECORD__desc}}; +static void *Absyn__R_5fRECORD = MMC_REFSTRUCTLIT(Absyn__R_5fRECORD__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Restriction_R__UNKNOWN__desc_added -#define Absyn_Restriction_R__UNKNOWN__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Restriction_R__UNKNOWN__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Restriction_R__UNKNOWN__desc = { - "Absyn_Restriction_R__UNKNOWN", - "Absyn.Restriction.R_UNKNOWN", - Absyn_Restriction_R__UNKNOWN__desc__fields +#ifndef Absyn_Restriction_R__MODEL__desc_added +#define Absyn_Restriction_R__MODEL__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Restriction_R__MODEL__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Restriction_R__MODEL__desc = { + "Absyn_Restriction_R__MODEL", + "Absyn.Restriction.R_MODEL", + Absyn_Restriction_R__MODEL__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Restriction_R__UNKNOWN__desc; +extern struct record_description Absyn_Restriction_R__MODEL__desc; #endif -#define Absyn__R_5fUNKNOWN_3dBOX0 24 -static const MMC_DEFSTRUCTLIT(Absyn__R_5fUNKNOWN__struct,1,24) {&Absyn_Restriction_R__UNKNOWN__desc}}; -static void *Absyn__R_5fUNKNOWN = MMC_REFSTRUCTLIT(Absyn__R_5fUNKNOWN__struct); +#define Absyn__R_5fMODEL_3dBOX0 5 +static const MMC_DEFSTRUCTLIT(Absyn__R_5fMODEL__struct,1,5) {&Absyn_Restriction_R__MODEL__desc}}; +static void *Absyn__R_5fMODEL = MMC_REFSTRUCTLIT(Absyn__R_5fMODEL__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_FunctionPurity_PURE__desc_added -#define Absyn_FunctionPurity_PURE__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_FunctionPurity_PURE__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_FunctionPurity_PURE__desc = { - "Absyn_FunctionPurity_PURE", - "Absyn.FunctionPurity.PURE", - Absyn_FunctionPurity_PURE__desc__fields +#ifndef Absyn_Restriction_R__OPTIMIZATION__desc_added +#define Absyn_Restriction_R__OPTIMIZATION__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Restriction_R__OPTIMIZATION__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Restriction_R__OPTIMIZATION__desc = { + "Absyn_Restriction_R__OPTIMIZATION", + "Absyn.Restriction.R_OPTIMIZATION", + Absyn_Restriction_R__OPTIMIZATION__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_FunctionPurity_PURE__desc; +extern struct record_description Absyn_Restriction_R__OPTIMIZATION__desc; #endif -#define Absyn__PURE_3dBOX0 3 -static const MMC_DEFSTRUCTLIT(Absyn__PURE__struct,1,3) {&Absyn_FunctionPurity_PURE__desc}}; -static void *Absyn__PURE = MMC_REFSTRUCTLIT(Absyn__PURE__struct); +#define Absyn__R_5fOPTIMIZATION_3dBOX0 4 +static const MMC_DEFSTRUCTLIT(Absyn__R_5fOPTIMIZATION__struct,1,4) {&Absyn_Restriction_R__OPTIMIZATION__desc}}; +static void *Absyn__R_5fOPTIMIZATION = MMC_REFSTRUCTLIT(Absyn__R_5fOPTIMIZATION__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_FunctionPurity_IMPURE__desc_added -#define Absyn_FunctionPurity_IMPURE__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_FunctionPurity_IMPURE__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_FunctionPurity_IMPURE__desc = { - "Absyn_FunctionPurity_IMPURE", - "Absyn.FunctionPurity.IMPURE", - Absyn_FunctionPurity_IMPURE__desc__fields +#ifndef Absyn_Restriction_R__CLASS__desc_added +#define Absyn_Restriction_R__CLASS__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Restriction_R__CLASS__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Restriction_R__CLASS__desc = { + "Absyn_Restriction_R__CLASS", + "Absyn.Restriction.R_CLASS", + Absyn_Restriction_R__CLASS__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_FunctionPurity_IMPURE__desc; +extern struct record_description Absyn_Restriction_R__CLASS__desc; #endif -#define Absyn__IMPURE_3dBOX0 4 -static const MMC_DEFSTRUCTLIT(Absyn__IMPURE__struct,1,4) {&Absyn_FunctionPurity_IMPURE__desc}}; -static void *Absyn__IMPURE = MMC_REFSTRUCTLIT(Absyn__IMPURE__struct); +#define Absyn__R_5fCLASS_3dBOX0 3 +static const MMC_DEFSTRUCTLIT(Absyn__R_5fCLASS__struct,1,3) {&Absyn_Restriction_R__CLASS__desc}}; +static void *Absyn__R_5fCLASS = MMC_REFSTRUCTLIT(Absyn__R_5fCLASS__struct); #ifdef ADD_METARECORD_DEFINITIONS #ifndef Absyn_FunctionPurity_NO__PURITY__desc_added #define Absyn_FunctionPurity_NO__PURITY__desc_added @@ -4072,36 +4040,53 @@ extern struct record_description Absyn_FunctionPurity_NO__PURITY__desc; static const MMC_DEFSTRUCTLIT(Absyn__NO_5fPURITY__struct,1,5) {&Absyn_FunctionPurity_NO__PURITY__desc}}; static void *Absyn__NO_5fPURITY = MMC_REFSTRUCTLIT(Absyn__NO_5fPURITY__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_FunctionRestriction_FR__NORMAL__FUNCTION__desc_added -#define Absyn_FunctionRestriction_FR__NORMAL__FUNCTION__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_FunctionRestriction_FR__NORMAL__FUNCTION__desc__fields[1] = {"purity"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_FunctionRestriction_FR__NORMAL__FUNCTION__desc = { - "Absyn_FunctionRestriction_FR__NORMAL__FUNCTION", - "Absyn.FunctionRestriction.FR_NORMAL_FUNCTION", - Absyn_FunctionRestriction_FR__NORMAL__FUNCTION__desc__fields +#ifndef Absyn_FunctionPurity_IMPURE__desc_added +#define Absyn_FunctionPurity_IMPURE__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_FunctionPurity_IMPURE__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_FunctionPurity_IMPURE__desc = { + "Absyn_FunctionPurity_IMPURE", + "Absyn.FunctionPurity.IMPURE", + Absyn_FunctionPurity_IMPURE__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_FunctionRestriction_FR__NORMAL__FUNCTION__desc; +extern struct record_description Absyn_FunctionPurity_IMPURE__desc; #endif -#define Absyn__FR_5fNORMAL_5fFUNCTION_3dBOX1 3 -#define Absyn__FR_5fNORMAL_5fFUNCTION(purity) (mmc_mk_box2(3,&Absyn_FunctionRestriction_FR__NORMAL__FUNCTION__desc,purity)) +#define Absyn__IMPURE_3dBOX0 4 +static const MMC_DEFSTRUCTLIT(Absyn__IMPURE__struct,1,4) {&Absyn_FunctionPurity_IMPURE__desc}}; +static void *Absyn__IMPURE = MMC_REFSTRUCTLIT(Absyn__IMPURE__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_FunctionRestriction_FR__OPERATOR__FUNCTION__desc_added -#define Absyn_FunctionRestriction_FR__OPERATOR__FUNCTION__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_FunctionRestriction_FR__OPERATOR__FUNCTION__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_FunctionRestriction_FR__OPERATOR__FUNCTION__desc = { - "Absyn_FunctionRestriction_FR__OPERATOR__FUNCTION", - "Absyn.FunctionRestriction.FR_OPERATOR_FUNCTION", - Absyn_FunctionRestriction_FR__OPERATOR__FUNCTION__desc__fields +#ifndef Absyn_FunctionPurity_PURE__desc_added +#define Absyn_FunctionPurity_PURE__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_FunctionPurity_PURE__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_FunctionPurity_PURE__desc = { + "Absyn_FunctionPurity_PURE", + "Absyn.FunctionPurity.PURE", + Absyn_FunctionPurity_PURE__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_FunctionRestriction_FR__OPERATOR__FUNCTION__desc; +extern struct record_description Absyn_FunctionPurity_PURE__desc; #endif -#define Absyn__FR_5fOPERATOR_5fFUNCTION_3dBOX0 4 -static const MMC_DEFSTRUCTLIT(Absyn__FR_5fOPERATOR_5fFUNCTION__struct,1,4) {&Absyn_FunctionRestriction_FR__OPERATOR__FUNCTION__desc}}; -static void *Absyn__FR_5fOPERATOR_5fFUNCTION = MMC_REFSTRUCTLIT(Absyn__FR_5fOPERATOR_5fFUNCTION__struct); +#define Absyn__PURE_3dBOX0 3 +static const MMC_DEFSTRUCTLIT(Absyn__PURE__struct,1,3) {&Absyn_FunctionPurity_PURE__desc}}; +static void *Absyn__PURE = MMC_REFSTRUCTLIT(Absyn__PURE__struct); +#ifdef ADD_METARECORD_DEFINITIONS +#ifndef Absyn_FunctionRestriction_FR__KERNEL__FUNCTION__desc_added +#define Absyn_FunctionRestriction_FR__KERNEL__FUNCTION__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_FunctionRestriction_FR__KERNEL__FUNCTION__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_FunctionRestriction_FR__KERNEL__FUNCTION__desc = { + "Absyn_FunctionRestriction_FR__KERNEL__FUNCTION", + "Absyn.FunctionRestriction.FR_KERNEL_FUNCTION", + Absyn_FunctionRestriction_FR__KERNEL__FUNCTION__desc__fields +}; +#endif +#else /* Only use the file as a header */ +extern struct record_description Absyn_FunctionRestriction_FR__KERNEL__FUNCTION__desc; +#endif +#define Absyn__FR_5fKERNEL_5fFUNCTION_3dBOX0 6 +static const MMC_DEFSTRUCTLIT(Absyn__FR_5fKERNEL_5fFUNCTION__struct,1,6) {&Absyn_FunctionRestriction_FR__KERNEL__FUNCTION__desc}}; +static void *Absyn__FR_5fKERNEL_5fFUNCTION = MMC_REFSTRUCTLIT(Absyn__FR_5fKERNEL_5fFUNCTION__struct); #ifdef ADD_METARECORD_DEFINITIONS #ifndef Absyn_FunctionRestriction_FR__PARALLEL__FUNCTION__desc_added #define Absyn_FunctionRestriction_FR__PARALLEL__FUNCTION__desc_added @@ -4119,21 +4104,36 @@ extern struct record_description Absyn_FunctionRestriction_FR__PARALLEL__FUNCTIO static const MMC_DEFSTRUCTLIT(Absyn__FR_5fPARALLEL_5fFUNCTION__struct,1,5) {&Absyn_FunctionRestriction_FR__PARALLEL__FUNCTION__desc}}; static void *Absyn__FR_5fPARALLEL_5fFUNCTION = MMC_REFSTRUCTLIT(Absyn__FR_5fPARALLEL_5fFUNCTION__struct); #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_FunctionRestriction_FR__KERNEL__FUNCTION__desc_added -#define Absyn_FunctionRestriction_FR__KERNEL__FUNCTION__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_FunctionRestriction_FR__KERNEL__FUNCTION__desc__fields[1] = {"no fields"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_FunctionRestriction_FR__KERNEL__FUNCTION__desc = { - "Absyn_FunctionRestriction_FR__KERNEL__FUNCTION", - "Absyn.FunctionRestriction.FR_KERNEL_FUNCTION", - Absyn_FunctionRestriction_FR__KERNEL__FUNCTION__desc__fields +#ifndef Absyn_FunctionRestriction_FR__OPERATOR__FUNCTION__desc_added +#define Absyn_FunctionRestriction_FR__OPERATOR__FUNCTION__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_FunctionRestriction_FR__OPERATOR__FUNCTION__desc__fields[1] = {"no fields"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_FunctionRestriction_FR__OPERATOR__FUNCTION__desc = { + "Absyn_FunctionRestriction_FR__OPERATOR__FUNCTION", + "Absyn.FunctionRestriction.FR_OPERATOR_FUNCTION", + Absyn_FunctionRestriction_FR__OPERATOR__FUNCTION__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_FunctionRestriction_FR__KERNEL__FUNCTION__desc; +extern struct record_description Absyn_FunctionRestriction_FR__OPERATOR__FUNCTION__desc; #endif -#define Absyn__FR_5fKERNEL_5fFUNCTION_3dBOX0 6 -static const MMC_DEFSTRUCTLIT(Absyn__FR_5fKERNEL_5fFUNCTION__struct,1,6) {&Absyn_FunctionRestriction_FR__KERNEL__FUNCTION__desc}}; -static void *Absyn__FR_5fKERNEL_5fFUNCTION = MMC_REFSTRUCTLIT(Absyn__FR_5fKERNEL_5fFUNCTION__struct); +#define Absyn__FR_5fOPERATOR_5fFUNCTION_3dBOX0 4 +static const MMC_DEFSTRUCTLIT(Absyn__FR_5fOPERATOR_5fFUNCTION__struct,1,4) {&Absyn_FunctionRestriction_FR__OPERATOR__FUNCTION__desc}}; +static void *Absyn__FR_5fOPERATOR_5fFUNCTION = MMC_REFSTRUCTLIT(Absyn__FR_5fOPERATOR_5fFUNCTION__struct); +#ifdef ADD_METARECORD_DEFINITIONS +#ifndef Absyn_FunctionRestriction_FR__NORMAL__FUNCTION__desc_added +#define Absyn_FunctionRestriction_FR__NORMAL__FUNCTION__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_FunctionRestriction_FR__NORMAL__FUNCTION__desc__fields[1] = {"purity"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_FunctionRestriction_FR__NORMAL__FUNCTION__desc = { + "Absyn_FunctionRestriction_FR__NORMAL__FUNCTION", + "Absyn.FunctionRestriction.FR_NORMAL_FUNCTION", + Absyn_FunctionRestriction_FR__NORMAL__FUNCTION__desc__fields +}; +#endif +#else /* Only use the file as a header */ +extern struct record_description Absyn_FunctionRestriction_FR__NORMAL__FUNCTION__desc; +#endif +#define Absyn__FR_5fNORMAL_5fFUNCTION_3dBOX1 3 +#define Absyn__FR_5fNORMAL_5fFUNCTION(purity) (mmc_mk_box2(3,&Absyn_FunctionRestriction_FR__NORMAL__FUNCTION__desc,purity)) #ifdef ADD_METARECORD_DEFINITIONS #ifndef Absyn_Annotation_ANNOTATION__desc_added #define Absyn_Annotation_ANNOTATION__desc_added @@ -4180,20 +4180,20 @@ extern struct record_description Absyn_ExternalDecl_EXTERNALDECL__desc; #define Absyn__EXTERNALDECL_3dBOX5 3 #define Absyn__EXTERNALDECL(funcName,lang,output_,args,annotation_) (mmc_mk_box6(3,&Absyn_ExternalDecl_EXTERNALDECL__desc,funcName,lang,output_,args,annotation_)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Ref_RCR__desc_added -#define Absyn_Ref_RCR__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Ref_RCR__desc__fields[1] = {"cr"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Ref_RCR__desc = { - "Absyn_Ref_RCR", - "Absyn.Ref.RCR", - Absyn_Ref_RCR__desc__fields +#ifndef Absyn_Ref_RIM__desc_added +#define Absyn_Ref_RIM__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Ref_RIM__desc__fields[1] = {"im"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Ref_RIM__desc = { + "Absyn_Ref_RIM", + "Absyn.Ref.RIM", + Absyn_Ref_RIM__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Ref_RCR__desc; +extern struct record_description Absyn_Ref_RIM__desc; #endif -#define Absyn__RCR_3dBOX1 3 -#define Absyn__RCR(cr) (mmc_mk_box2(3,&Absyn_Ref_RCR__desc,cr)) +#define Absyn__RIM_3dBOX1 5 +#define Absyn__RIM(im) (mmc_mk_box2(5,&Absyn_Ref_RIM__desc,im)) #ifdef ADD_METARECORD_DEFINITIONS #ifndef Absyn_Ref_RTS__desc_added #define Absyn_Ref_RTS__desc_added @@ -4210,35 +4210,20 @@ extern struct record_description Absyn_Ref_RTS__desc; #define Absyn__RTS_3dBOX1 4 #define Absyn__RTS(ts) (mmc_mk_box2(4,&Absyn_Ref_RTS__desc,ts)) #ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Ref_RIM__desc_added -#define Absyn_Ref_RIM__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Ref_RIM__desc__fields[1] = {"im"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Ref_RIM__desc = { - "Absyn_Ref_RIM", - "Absyn.Ref.RIM", - Absyn_Ref_RIM__desc__fields -}; -#endif -#else /* Only use the file as a header */ -extern struct record_description Absyn_Ref_RIM__desc; -#endif -#define Absyn__RIM_3dBOX1 5 -#define Absyn__RIM(im) (mmc_mk_box2(5,&Absyn_Ref_RIM__desc,im)) -#ifdef ADD_METARECORD_DEFINITIONS -#ifndef Absyn_Msg_MSG__desc_added -#define Absyn_Msg_MSG__desc_added -ADD_METARECORD_DEFINITIONS const char* Absyn_Msg_MSG__desc__fields[1] = {"info"}; -ADD_METARECORD_DEFINITIONS struct record_description Absyn_Msg_MSG__desc = { - "Absyn_Msg_MSG", - "Absyn.Msg.MSG", - Absyn_Msg_MSG__desc__fields +#ifndef Absyn_Ref_RCR__desc_added +#define Absyn_Ref_RCR__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Ref_RCR__desc__fields[1] = {"cr"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Ref_RCR__desc = { + "Absyn_Ref_RCR", + "Absyn.Ref.RCR", + Absyn_Ref_RCR__desc__fields }; #endif #else /* Only use the file as a header */ -extern struct record_description Absyn_Msg_MSG__desc; +extern struct record_description Absyn_Ref_RCR__desc; #endif -#define Absyn__MSG_3dBOX1 3 -#define Absyn__MSG(info) (mmc_mk_box2(3,&Absyn_Msg_MSG__desc,info)) +#define Absyn__RCR_3dBOX1 3 +#define Absyn__RCR(cr) (mmc_mk_box2(3,&Absyn_Ref_RCR__desc,cr)) #ifdef ADD_METARECORD_DEFINITIONS #ifndef Absyn_Msg_NO__MSG__desc_added #define Absyn_Msg_NO__MSG__desc_added @@ -4255,6 +4240,21 @@ extern struct record_description Absyn_Msg_NO__MSG__desc; #define Absyn__NO_5fMSG_3dBOX0 4 static const MMC_DEFSTRUCTLIT(Absyn__NO_5fMSG__struct,1,4) {&Absyn_Msg_NO__MSG__desc}}; static void *Absyn__NO_5fMSG = MMC_REFSTRUCTLIT(Absyn__NO_5fMSG__struct); +#ifdef ADD_METARECORD_DEFINITIONS +#ifndef Absyn_Msg_MSG__desc_added +#define Absyn_Msg_MSG__desc_added +ADD_METARECORD_DEFINITIONS const char* Absyn_Msg_MSG__desc__fields[1] = {"info"}; +ADD_METARECORD_DEFINITIONS struct record_description Absyn_Msg_MSG__desc = { + "Absyn_Msg_MSG", + "Absyn.Msg.MSG", + Absyn_Msg_MSG__desc__fields +}; +#endif +#else /* Only use the file as a header */ +extern struct record_description Absyn_Msg_MSG__desc; +#endif +#define Absyn__MSG_3dBOX1 3 +#define Absyn__MSG(info) (mmc_mk_box2(3,&Absyn_Msg_MSG__desc,info)) #ifdef __cplusplus } #endif diff --git a/Compiler/Script/CevalScript.mo b/Compiler/Script/CevalScript.mo index 812168d3bf8..da5711957a2 100644 --- a/Compiler/Script/CevalScript.mo +++ b/Compiler/Script/CevalScript.mo @@ -1459,7 +1459,7 @@ algorithm case (cache,_,"classAnnotationExists",{Values.CODE(Absyn.C_TYPENAME(classpath)),Values.CODE(Absyn.C_TYPENAME(path))},st as GlobalScript.SYMBOLTABLE(ast=p),_) equation - b = Interactive.getNamedAnnotation(classpath, p, path, SOME(false), Util.isSome); + b = Interactive.getNamedAnnotation(classpath, p, path, SOME(false), isSome); then (cache,Values.BOOL(b),st); diff --git a/Compiler/Script/RewriteRules.mo b/Compiler/Script/RewriteRules.mo index 61d0cc30346..cb1cfa8f628 100644 --- a/Compiler/Script/RewriteRules.mo +++ b/Compiler/Script/RewriteRules.mo @@ -1077,7 +1077,7 @@ algorithm case _ equation oR = getGlobalRoot(Global.rewriteRulesIndex); - true = Util.isSome(oR); + true = isSome(oR); then (); // not loaded, load it diff --git a/Compiler/SimCode/HpcOmSimCodeMain.mo b/Compiler/SimCode/HpcOmSimCodeMain.mo index 164af6e321b..2f8dd627689 100644 --- a/Compiler/SimCode/HpcOmSimCodeMain.mo +++ b/Compiler/SimCode/HpcOmSimCodeMain.mo @@ -329,9 +329,9 @@ algorithm //Apply filters //------------- - (taskGraphDaeSimplified,taskGraphDataDaeSimplified) = (taskGraphDae,taskGraphDataDae); - (taskGraphOdeSimplified,taskGraphDataOdeSimplified) = applyGRS(taskGraphOde,taskGraphDataOde, sccSimEqMapping, inBackendDAE); - (taskGraphZeroFuncSimplified,taskGraphDataZeroFuncSimplified) = (taskGraphZeroFuncs,taskGraphDataZeroFuncs); + (taskGraphDaeSimplified,taskGraphDataDaeSimplified) = applyGRS(taskGraphDae,taskGraphDataDae); + (taskGraphOdeSimplified,taskGraphDataOdeSimplified) = applyGRS(taskGraphOde,taskGraphDataOde); + (taskGraphZeroFuncSimplified,taskGraphDataZeroFuncSimplified) = applyGRS(taskGraphZeroFuncs,taskGraphDataZeroFuncs); SimCodeUtil.execStat("hpcom GRS"); fileName = ("taskGraph"+filenamePrefix+"ODE_merged.graphml"); @@ -348,8 +348,19 @@ algorithm (numProc,_) = setNumProc(numProc,cpCostsWoC,taskGraphDataOde);//in case n-flag is not set (scheduleDae,simCode,taskGraphDaeScheduled,taskGraphDataDaeScheduled,sccSimEqMapping) = createSchedule(taskGraphDaeSimplified,taskGraphDataDaeSimplified,daeSccSimEqMapping,simVarMapping,filenamePrefix,numProc,simCode,scheduledTasksDae,"DAE system",Flags.getConfigString(Flags.HPCOM_SCHEDULER)); + //criticalPathInfo = HpcOmScheduler.analyseScheduledTaskGraph(scheduleDae,numProc,taskGraphDaeScheduled,taskGraphDataDaeScheduled,"DAE system"); + //schedulerInfo = HpcOmScheduler.convertScheduleStrucToInfo(scheduleDae,arrayLength(taskGraphDaeScheduled)); + //HpcOmTaskGraph.dumpAsGraphMLSccLevel(taskGraphDaeScheduled, taskGraphDataDaeScheduled, fileName+"_schedDAE.graphml", criticalPathInfo, HpcOmTaskGraph.convertNodeListToEdgeTuples(listHead(criticalPaths)), HpcOmTaskGraph.convertNodeListToEdgeTuples(listHead(criticalPathsWoC)), sccSimEqMapping, schedulerInfo, HpcOmTaskGraph.GRAPHDUMPOPTIONS(false,false,false,false)); + (scheduleOde,simCode,taskGraphOdeScheduled,taskGraphDataOdeScheduled,sccSimEqMapping) = createSchedule(taskGraphOdeSimplified,taskGraphDataOdeSimplified,sccSimEqMapping,simVarMapping,filenamePrefix,numProc,simCode,scheduledTasksOde,"ODE system",Flags.getConfigString(Flags.HPCOM_SCHEDULER)); + //criticalPathInfo = HpcOmScheduler.analyseScheduledTaskGraph(scheduleOde,numProc,taskGraphOdeScheduled,taskGraphDataOdeScheduled,"DAE system"); + //schedulerInfo = HpcOmScheduler.convertScheduleStrucToInfo(scheduleOde,arrayLength(taskGraphOdeScheduled)); + //HpcOmTaskGraph.dumpAsGraphMLSccLevel(taskGraphOdeScheduled, taskGraphDataOdeScheduled, fileName+"_schedODE.graphml", criticalPathInfo, HpcOmTaskGraph.convertNodeListToEdgeTuples(listHead(criticalPaths)), HpcOmTaskGraph.convertNodeListToEdgeTuples(listHead(criticalPathsWoC)), sccSimEqMapping, schedulerInfo, HpcOmTaskGraph.GRAPHDUMPOPTIONS(false,false,false,false)); + (scheduleZeroFunc,simCode,taskGraphZeroFuncScheduled,taskGraphDataZeroFuncScheduled,sccSimEqMapping) = createSchedule(taskGraphZeroFuncSimplified,taskGraphDataZeroFuncSimplified,daeSccSimEqMapping,simVarMapping,filenamePrefix,numProc,simCode,scheduledTasksZeroFunc,"ZeroFunc system",Flags.getConfigString(Flags.HPCOM_SCHEDULER)); + //criticalPathInfo = HpcOmScheduler.analyseScheduledTaskGraph(scheduleZeroFunc,numProc,taskGraphZeroFuncScheduled,taskGraphDataZeroFuncScheduled,"DAE system"); + //schedulerInfo = HpcOmScheduler.convertScheduleStrucToInfo(scheduleZeroFunc,arrayLength(taskGraphZeroFuncScheduled)); + //HpcOmTaskGraph.dumpAsGraphMLSccLevel(taskGraphZeroFuncScheduled, taskGraphDataZeroFuncScheduled, fileName+"_schedZE.graphml", criticalPathInfo, HpcOmTaskGraph.convertNodeListToEdgeTuples(listHead(criticalPaths)), HpcOmTaskGraph.convertNodeListToEdgeTuples(listHead(criticalPathsWoC)), sccSimEqMapping, schedulerInfo, HpcOmTaskGraph.GRAPHDUMPOPTIONS(false,false,false,false)); SimCode.SIMCODE( modelInfo, simCodeLiterals, simCodeRecordDecls, simCodeExternalFunctionIncludes, allEquations, odeEquations, algebraicEquations, partitionsKind, baseClocks, useHomotopy, initialEquations, removedInitialEquations, startValueEquations, @@ -378,7 +389,7 @@ algorithm System.realtimeTick(ClockIndexes.RT_CLOCK_EXECSTAT_HPCOM_MODULES); //HpcOmTaskGraph.printTaskGraphMeta(taskGraphDataScheduled); - checkOdeSystemSize(taskGraphDataOdeScheduled,odeEquations); + checkOdeSystemSize(taskGraphDataOdeScheduled,odeEquations,sccSimEqMapping); SimCodeFunctionUtil.execStat("hpcom check ODE system size"); //Create Memory-Map and Sim-Code @@ -483,8 +494,6 @@ public function applyGRS"applies several task graph rewriting rules to merge tas author:Waurich 2014-11" input HpcOmTaskGraph.TaskGraph iTaskGraph; input HpcOmTaskGraph.TaskGraphMeta iTaskGraphMeta; - input array> iSccSimEqMapping; - input BackendDAE.BackendDAE iBackendDAE; output HpcOmTaskGraph.TaskGraph oTaskGraph; output HpcOmTaskGraph.TaskGraphMeta oTaskGraphMeta; protected @@ -1249,8 +1258,10 @@ Remark: this can occur when asserts are added to the ode-system. author:marcusw" input HpcOmTaskGraph.TaskGraphMeta iTaskGraphMeta; input list> iOdeEqs; + input array> iSccSimEqMapping; output Boolean oIsCorrect; protected + Integer scc; list sccs; Integer actualSizePre, actualSize; Integer targetSize; @@ -1261,12 +1272,18 @@ algorithm if(intNe(actualSizePre, actualSize)) then print("There are simCode-equations multiple times in the graph structure.\n"); end if; + actualSize := 0; + for scc in sccs loop + actualSize := actualSize + listLength(arrayGet(iSccSimEqMapping, scc)); + end for; + targetSize := listLength(List.flatten(iOdeEqs)); oIsCorrect := intEq(targetSize,actualSize); if(oIsCorrect) then //print("the ODE-system size is correct("+intString(actualSize)+")\n"); else - print("the size should be "+intString(targetSize)+" but it is "+intString(actualSize)+"!\n"); + print("the size of the ODE-system should be "+intString(targetSize)+" but it is "+intString(actualSize)+"!\n"); + print("expected the following sim code equations: " + stringDelimitList(List.map(List.map(List.flatten(iOdeEqs), SimCodeUtil.simEqSystemIndex), intString), ",") + "\n"); print("the ODE-system is NOT correct\n"); end if; end checkOdeSystemSize; diff --git a/Compiler/SimCode/SimCodeMain.mo b/Compiler/SimCode/SimCodeMain.mo index c36b225e843..7aaf61b3440 100644 --- a/Compiler/SimCode/SimCodeMain.mo +++ b/Compiler/SimCode/SimCodeMain.mo @@ -62,6 +62,7 @@ import CevalScriptBackend; import CodegenC; import CodegenFMU; import CodegenFMUCpp; +import CodegenFMUCppHpcom; import CodegenQSS; import CodegenAdevs; import CodegenSparseFMI; @@ -142,7 +143,7 @@ algorithm fileDir := CevalScriptBackend.getFileDir(a_cref, p); (libs,libPaths,includes, includeDirs, recordDecls, functions, outIndexedBackendDAE, _, literals) := SimCodeUtil.createFunctions(p, dae, inBackendDAE, className); - (simCode,_) := SimCodeUtil.createSimCode(outIndexedBackendDAE, + simCode := createSimCode(outIndexedBackendDAE, className, filenamePrefix, fileDir, functions, includes, includeDirs, libs, libPaths,simSettingsOpt, recordDecls, literals,Absyn.FUNCTIONARGS({},{})); timeSimCode := System.realtimeTock(ClockIndexes.RT_CLOCK_SIMCODE); SimCodeFunctionUtil.execStat("SimCode"); @@ -574,7 +575,11 @@ algorithm then (); case (_,"Cpp") equation - Tpl.tplNoret3(CodegenFMUCpp.translateModel, simCode, FMUVersion, FMUType); + if(Flags.isSet(Flags.HPCOM)) then + Tpl.tplNoret3(CodegenFMUCppHpcom.translateModel, simCode, FMUVersion, FMUType); + else + Tpl.tplNoret3(CodegenFMUCpp.translateModel, simCode, FMUVersion, FMUType); + end if; then (); else equation diff --git a/Compiler/SimCode/SimCodeUtil.mo b/Compiler/SimCode/SimCodeUtil.mo index 901b7d0ca01..0ab44158dbf 100644 --- a/Compiler/SimCode/SimCodeUtil.mo +++ b/Compiler/SimCode/SimCodeUtil.mo @@ -148,7 +148,7 @@ public function createSimCode "entry point to create SimCode from BackendDAE." input BackendDAE.BackendDAE inBackendDAE; input Absyn.Path inClassName; input String filenamePrefix; - input String inString11; + input String inFileDir; input list functions; input list externalFunctionIncludes; input list includeDirs; @@ -159,323 +159,314 @@ public function createSimCode "entry point to create SimCode from BackendDAE." input tuple> literals; input Absyn.FunctionArgs args; output SimCode.SimCode simCode; - output tuple>> oMapping; //The highest simEqIndex in the mapping and the mapping simEq-Index -> scc-Index itself + output tuple>> outMapping; //The highest simEqIndex in the mapping and the mapping simEq-Index -> scc-Index itself +protected + BackendDAE.BackendDAE dlow; + BackendDAE.BackendDAE initDAE; + BackendDAE.EqSystems systs; + BackendDAE.EquationArray removedEqs; + BackendDAE.Shared shared; + BackendDAE.SymbolicJacobians symJacs; + BackendDAE.Variables knownVars; + Boolean ifcpp; + Boolean useHomotopy; // true if homotopy(...) is used during initialization + DAE.FunctionTree functionTree; + HashTableCrIListArray.HashTable varToArrayIndexMapping; //maps each array-variable to a array of positions + HashTableCrILst.HashTable varToIndexMapping; //maps each variable to an array position + Integer maxDelayedExpIndex, uniqueEqIndex, numberofEqns, numStateSets, numberOfJacobians; + Integer numberofLinearSys, numberofNonLinearSys, numberofMixedSys; + Option modelStruct; + SimCode.BackendMapping backendMapping; + SimCode.ExtObjInfo extObjInfo; + SimCode.HashTableCrefToSimVar crefToSimVarHT; + SimCode.MakefileParams makefileParams; + SimCode.ModelInfo modelInfo; + array baseClocks; + array systemIndexMap; + list partitionsKind; + list removedInitialEquationLst, paramAsserts, remEqLst; + list timeEvents; + list allPrimaryParameters "already sorted"; + list primaryParameters "already sorted"; + list zeroCrossings, sampleZC, relations; + list classAttributes; + list discreteModelVars; + list constraints; + list lits; + list LinearMatrices, SymbolicJacs, SymbolicJacsTemp, SymbolicJacsStateSelect, SymbolicJacsNLS; + list algorithmAndEquationAsserts; + list allEquations; + list equationsForZeroCrossings; + list initialEquations; // --> initial_equations + list jacobianEquations; + list maxValueEquations; // --> updateBoundMaxValues + list minValueEquations; // --> updateBoundMinValues + list nominalValueEquations; // --> updateBoundNominalValues + list paramAssertSimEqs; + list parameterEquations; // --> updateBoundParameters + list removedEquations; + list removedInitialEquations; // --> + list startValueEquations; // --> updateBoundStartValues + list whenClauses; + list stateSets; + list mixedArrayVars; + list tempvars, jacobianSimvars; + list> algebraicEquations; // --> functionAlgebraics + list> odeEquations; // --> functionODE + list>> delayedExps; + list> equationSccMapping, eqBackendSimCodeMapping; algorithm - (simCode,oMapping) := - matchcontinue (inBackendDAE, inClassName, filenamePrefix, inString11, functions, externalFunctionIncludes, includeDirs, libs,libPaths, simSettingsOpt, recordDecls, literals, args) - local - String cname, fileDir; - Integer maxDelayedExpIndex, uniqueEqIndex, numberofEqns, numStateSets, numberOfJacobians; - Integer numberofLinearSys, numberofNonLinearSys, numberofMixedSys; - BackendDAE.BackendDAE dlow; - BackendDAE.BackendDAE initDAE; - DAE.FunctionTree functionTree; - BackendDAE.SymbolicJacobians symJacs; - Absyn.Path class_; - // new variables - SimCode.ModelInfo modelInfo; - list allEquations; - list> odeEquations; // --> functionODE - list> algebraicEquations; // --> functionAlgebraics - Boolean useHomotopy; // true if homotopy(...) is used during initialization - list initialEquations; // --> initial_equations - list removedInitialEquations; // --> - list startValueEquations; // --> updateBoundStartValues - list nominalValueEquations; // --> updateBoundNominalValues - list minValueEquations; // --> updateBoundMinValues - list maxValueEquations; // --> updateBoundMaxValues - list parameterEquations; // --> updateBoundParameters - list removedEquations; - list algorithmAndEquationAsserts; - list equationsForZeroCrossings; - list jacobianEquations; - // list algorithmAndEquationAsserts; - list constraints; - list classAttributes; - list zeroCrossings, sampleZC, relations; - list whenClauses; - list discreteModelVars; - SimCode.ExtObjInfo extObjInfo; - SimCode.MakefileParams makefileParams; - list>> delayedExps; - - list partitionsKind; - array baseClocks; - - list LinearMatrices, SymbolicJacs, SymbolicJacsTemp, SymbolicJacsStateSelect, SymbolicJacsNLS; - SimCode.HashTableCrefToSimVar crefToSimVarHT; - Boolean ifcpp; - BackendDAE.EqSystems systs; - BackendDAE.Shared shared; - BackendDAE.EquationArray removedEqs; - BackendDAE.Variables knownVars; - list removedInitialEquationLst, paramAsserts, remEqLst; - list paramAssertSimEqs; - - list lits; - list tempvars, jacobianSimvars; - - list stateSets; - array systemIndexMap; - list timeEvents; - list> equationSccMapping, eqBackendSimCodeMapping; - Integer highestSimEqIndex; - SimCode.BackendMapping backendMapping; - list primaryParameters "already sorted"; - list allPrimaryParameters "already sorted"; - - Option modelStruct; - list mixedArrayVars; - HashTableCrIListArray.HashTable varToArrayIndexMapping; //maps each array-variable to a array of positions - HashTableCrILst.HashTable varToIndexMapping; //maps each variable to an array position - case (dlow, class_, _, fileDir, _,_, _, _, _, _, _, _, _) equation - System.tmpTickReset(0); - uniqueEqIndex = 1; - ifcpp = stringEqual(Config.simCodeTarget(), "Cpp"); - - if Flags.isSet(Flags.VECTORIZE) then - // prepare the equations - dlow = BackendDAEUtil.mapEqSystem(dlow, Vectorization.prepareVectorizedDAE0); - end if; + try + dlow := inBackendDAE; + System.tmpTickReset(0); + uniqueEqIndex := 1; + ifcpp := stringEqual(Config.simCodeTarget(), "Cpp"); - backendMapping = setUpBackendMapping(inBackendDAE); - if Flags.isSet(Flags.VISUAL_XML) then - VisualXML.visualizationInfoXML(dlow, filenamePrefix); - end if; + if Flags.isSet(Flags.VECTORIZE) then + // prepare the equations + dlow := BackendDAEUtil.mapEqSystem(dlow, Vectorization.prepareVectorizedDAE0); + end if; - // fcall(Flags.FAILTRACE, print, "is that Cpp? : " + Dump.printBoolStr(ifcpp) + "\n"); - // generate initDAE before replacing pre(alias)! - (initDAE, useHomotopy, removedInitialEquationLst, primaryParameters, allPrimaryParameters) = Initialization.solveInitialSystem(dlow); + backendMapping := setUpBackendMapping(inBackendDAE); + if Flags.isSet(Flags.VISUAL_XML) then + VisualXML.visualizationInfoXML(dlow, filenamePrefix); + end if; - if Flags.isSet(Flags.ITERATION_VARS) then - BackendDAEOptimize.listAllIterationVariables(dlow); - end if; + // fcall(Flags.FAILTRACE, print, "is that Cpp? : " + Dump.printBoolStr(ifcpp) + "\n"); + else + Error.addInternalError("function createSimCode failed [Transformation from optimised DAE to simulation code structure failed]", sourceInfo()); + fail(); + end try; - // replace pre(alias) in time-equations - dlow = BackendDAEOptimize.simplifyTimeIndepFuncCalls(dlow); - - // initialization stuff - (initialEquations, removedInitialEquations, uniqueEqIndex, tempvars) = createInitialEquations(initDAE, removedInitialEquationLst, uniqueEqIndex, {}); - - // addInitialStmtsToAlgorithms - dlow = BackendDAEOptimize.addInitialStmtsToAlgorithms(dlow); - - BackendDAE.DAE(systs, shared as BackendDAE.SHARED(knownVars=knownVars, - removedEqs=removedEqs, - constraints=constraints, - classAttrs=classAttributes, - symjacs=symJacs, - eventInfo=BackendDAE.EVENT_INFO(timeEvents=timeEvents))) = dlow; - - - // created event suff e.g. zeroCrossings, samples, ... - whenClauses = createSimWhenClauses(dlow); - zeroCrossings = if ifcpp then FindZeroCrossings.getRelations(dlow) else FindZeroCrossings.getZeroCrossings(dlow); - relations = FindZeroCrossings.getRelations(dlow); - sampleZC = FindZeroCrossings.getSamples(dlow); - zeroCrossings = if ifcpp then listAppend(zeroCrossings, sampleZC) else zeroCrossings; - - // equation generation for euler, dassl2, rungekutta - ( uniqueEqIndex, odeEquations, algebraicEquations, allEquations, equationsForZeroCrossings, tempvars, - equationSccMapping, eqBackendSimCodeMapping, backendMapping) = - createEquationsForSystems( systs, shared, uniqueEqIndex, {}, {}, {}, {}, zeroCrossings, tempvars, 1, {}, {},backendMapping); - highestSimEqIndex = uniqueEqIndex; - - //(remEqLst,paramAsserts) = List.fold1(BackendEquation.equationList(removedEqs), getParamAsserts,knownVars,({},{})); - //((uniqueEqIndex, removedEquations)) = BackendEquation.traverseEquationArray(BackendEquation.listEquation(remEqLst), traversedlowEqToSimEqSystem, (uniqueEqIndex, {})); - ((uniqueEqIndex, removedEquations)) = BackendEquation.traverseEquationArray(removedEqs, traversedlowEqToSimEqSystem, (uniqueEqIndex, {})); - // Assertions and crap - // create parameter equations - partitionsKind = BackendDAEUtil.foldEqSystem(dlow, collectPartitions, {}); - BackendDAE.DAE(shared=BackendDAE.SHARED(eventInfo=BackendDAE.EVENT_INFO(clocks=baseClocks))) = dlow; - ((uniqueEqIndex, startValueEquations)) = BackendDAEUtil.foldEqSystem(dlow, createStartValueEquations, (uniqueEqIndex, {})); - ((uniqueEqIndex, nominalValueEquations)) = BackendDAEUtil.foldEqSystem(dlow, createNominalValueEquations, (uniqueEqIndex, {})); - ((uniqueEqIndex, minValueEquations)) = BackendDAEUtil.foldEqSystem(dlow, createMinValueEquations, (uniqueEqIndex, {})); - ((uniqueEqIndex, maxValueEquations)) = BackendDAEUtil.foldEqSystem(dlow, createMaxValueEquations, (uniqueEqIndex, {})); - ((uniqueEqIndex, parameterEquations)) = BackendDAEUtil.foldEqSystem(dlow, createVarNominalAssertFromVars, (uniqueEqIndex, {})); - (uniqueEqIndex, parameterEquations) = createParameterEquations(uniqueEqIndex, parameterEquations, primaryParameters, allPrimaryParameters); - //((uniqueEqIndex, paramAssertSimEqs)) = BackendEquation.traverseEquationArray(BackendEquation.listEquation(paramAsserts), traversedlowEqToSimEqSystem, (uniqueEqIndex, {})); - //parameterEquations = listAppend(parameterEquations,paramAssertSimEqs); - - ((uniqueEqIndex, algorithmAndEquationAsserts)) = BackendDAEUtil.foldEqSystem(dlow, createAlgorithmAndEquationAsserts, (uniqueEqIndex, {})); - discreteModelVars = BackendDAEUtil.foldEqSystem(dlow, extractDiscreteModelVars, {}); - makefileParams = SimCodeFunctionUtil.createMakefileParams(includeDirs, libs, libPaths,false); - (delayedExps, maxDelayedExpIndex) = extractDelayedExpressions(dlow); - - // append removed equation to all equations, since these are actually - // just the algorithms without outputs - - algebraicEquations = listAppend(algebraicEquations, removedEquations::{}); - allEquations = listAppend(allEquations, removedEquations); - - // state set stuff - (dlow, stateSets, uniqueEqIndex, tempvars, numStateSets) = createStateSets(dlow, {}, uniqueEqIndex, tempvars); - - // create model info - if Flags.isSet(Flags.VECTORIZE) then - // prepare the variables - //dlow = BackendDAEUtil.mapEqSystem(dlow, Vectorization.prepareVectorizedDAE1); - dlow = BackendDAEUtil.mapEqSystem(dlow, Vectorization.enlargeIteratedArrayVars); - end if; + // generate initDAE before replacing pre(alias)! + (initDAE, useHomotopy, removedInitialEquationLst, primaryParameters, allPrimaryParameters) := Initialization.solveInitialSystem(dlow); - modelInfo = createModelInfo(class_, dlow, functions, {}, numStateSets, fileDir); - modelInfo = addTempVars(tempvars, modelInfo); + try + if Flags.isSet(Flags.ITERATION_VARS) then + BackendDAEOptimize.listAllIterationVariables(dlow); + end if; - // external objects - extObjInfo = createExtObjInfo(shared); + // replace pre(alias) in time-equations + dlow := BackendDAEOptimize.simplifyTimeIndepFuncCalls(dlow); + + // initialization stuff + (initialEquations, removedInitialEquations, uniqueEqIndex, tempvars) := createInitialEquations(initDAE, removedInitialEquationLst, uniqueEqIndex, {}); + + // addInitialStmtsToAlgorithms + dlow := BackendDAEOptimize.addInitialStmtsToAlgorithms(dlow); + + BackendDAE.DAE(shared=shared as BackendDAE.SHARED(knownVars=knownVars, + removedEqs=removedEqs, + constraints=constraints, + classAttrs=classAttributes, + symjacs=symJacs, + partitionsInfo=BackendDAE.PARTITIONS_INFO(baseClocks), + eventInfo=BackendDAE.EVENT_INFO(timeEvents=timeEvents))) := dlow; + + // created event suff e.g. zeroCrossings, samples, ... + whenClauses := createSimWhenClauses(dlow); + zeroCrossings := if ifcpp then FindZeroCrossings.getRelations(dlow) else FindZeroCrossings.getZeroCrossings(dlow); + relations := FindZeroCrossings.getRelations(dlow); + sampleZC := FindZeroCrossings.getSamples(dlow); + zeroCrossings := if ifcpp then listAppend(zeroCrossings, sampleZC) else zeroCrossings; + + // equation generation for euler, dassl2, rungekutta + ( uniqueEqIndex, odeEquations, algebraicEquations, allEquations, equationsForZeroCrossings, tempvars, + equationSccMapping, eqBackendSimCodeMapping, backendMapping) := + createEquationsForSystems(dlow.eqs, shared, uniqueEqIndex, {}, {}, {}, {}, zeroCrossings, tempvars, 1, {}, {},backendMapping); + outMapping := (uniqueEqIndex /* highestSimEqIndex */, equationSccMapping); + + //(remEqLst,paramAsserts) := List.fold1(BackendEquation.equationList(removedEqs), getParamAsserts, knownVars,({},{})); + //((uniqueEqIndex, removedEquations)) := BackendEquation.traverseEquationArray(BackendEquation.listEquation(remEqLst), traversedlowEqToSimEqSystem, (uniqueEqIndex, {})); + ((uniqueEqIndex, removedEquations)) := BackendEquation.traverseEquationArray(removedEqs, traversedlowEqToSimEqSystem, (uniqueEqIndex, {})); + // Assertions and crap + // create parameter equations + partitionsKind := BackendDAEUtil.foldEqSystem(dlow, collectPartitions, {}); + ((uniqueEqIndex, startValueEquations)) := BackendDAEUtil.foldEqSystem(dlow, createStartValueEquations, (uniqueEqIndex, {})); + ((uniqueEqIndex, nominalValueEquations)) := BackendDAEUtil.foldEqSystem(dlow, createNominalValueEquations, (uniqueEqIndex, {})); + ((uniqueEqIndex, minValueEquations)) := BackendDAEUtil.foldEqSystem(dlow, createMinValueEquations, (uniqueEqIndex, {})); + ((uniqueEqIndex, maxValueEquations)) := BackendDAEUtil.foldEqSystem(dlow, createMaxValueEquations, (uniqueEqIndex, {})); + ((uniqueEqIndex, parameterEquations)) := BackendDAEUtil.foldEqSystem(dlow, createVarNominalAssertFromVars, (uniqueEqIndex, {})); + (uniqueEqIndex, parameterEquations) := createParameterEquations(uniqueEqIndex, parameterEquations, primaryParameters, allPrimaryParameters); + //((uniqueEqIndex, paramAssertSimEqs)) := BackendEquation.traverseEquationArray(BackendEquation.listEquation(paramAsserts), traversedlowEqToSimEqSystem, (uniqueEqIndex, {})); + //parameterEquations := listAppend(parameterEquations,paramAssertSimEqs); + + ((uniqueEqIndex, algorithmAndEquationAsserts)) := BackendDAEUtil.foldEqSystem(dlow, createAlgorithmAndEquationAsserts, (uniqueEqIndex, {})); + discreteModelVars := BackendDAEUtil.foldEqSystem(dlow, extractDiscreteModelVars, {}); + makefileParams := SimCodeFunctionUtil.createMakefileParams(includeDirs, libs, libPaths,false); + (delayedExps, maxDelayedExpIndex) := extractDelayedExpressions(dlow); + + // append removed equation to all equations, since these are actually + // just the algorithms without outputs + + algebraicEquations := listAppend(algebraicEquations, removedEquations::{}); + allEquations := listAppend(allEquations, removedEquations); + + // state set stuff + (dlow, stateSets, uniqueEqIndex, tempvars, numStateSets) := createStateSets(dlow, {}, uniqueEqIndex, tempvars); + + // create model info + if Flags.isSet(Flags.VECTORIZE) then + // prepare the variables + //dlow := BackendDAEUtil.mapEqSystem(dlow, Vectorization.prepareVectorizedDAE1); + dlow := BackendDAEUtil.mapEqSystem(dlow, Vectorization.enlargeIteratedArrayVars); + end if; - // update index of zero-Crossings after equations are created - zeroCrossings = updateZeroCrossEqnIndex(zeroCrossings, eqBackendSimCodeMapping, BackendDAEUtil.daeSize(dlow)); + modelInfo := createModelInfo(inClassName, dlow, functions, {}, numStateSets, inFileDir); + modelInfo := addTempVars(tempvars, modelInfo); - // update indexNonLinear in SES_NONLINEAR and count - SymbolicJacsNLS = {}; - (initialEquations, numberofLinearSys, numberofNonLinearSys, numberofMixedSys, numberOfJacobians, SymbolicJacsTemp) = countandIndexAlgebraicLoops(initialEquations, 0, 0, 0, 0, {}); - SymbolicJacsNLS = listAppend(SymbolicJacsTemp, SymbolicJacsNLS); - (parameterEquations, numberofLinearSys, numberofNonLinearSys, numberofMixedSys, numberOfJacobians, SymbolicJacsTemp) = countandIndexAlgebraicLoops(parameterEquations, numberofLinearSys, numberofNonLinearSys, numberofMixedSys, numberOfJacobians, {}); - SymbolicJacsNLS = listAppend(SymbolicJacsTemp, SymbolicJacsNLS); - (allEquations, numberofLinearSys, numberofNonLinearSys, numberofMixedSys, numberOfJacobians, SymbolicJacsTemp) = countandIndexAlgebraicLoops(allEquations, numberofLinearSys, numberofNonLinearSys, numberofMixedSys, numberOfJacobians, {}); - SymbolicJacsNLS = listAppend(SymbolicJacsTemp, SymbolicJacsNLS); + // external objects + extObjInfo := createExtObjInfo(shared); - if Flags.isSet(Flags.DYNAMIC_TEARING_INFO) then - print("\n\n*********************\n* SimCode Equations *\n*********************\n\ninitialEquations:\n=================\n" + dumpSimEqSystemLst(initialEquations) + "\n"); - print("\n\nparameterEquations:\n===================\n" + dumpSimEqSystemLst(parameterEquations) + "\n"); - print("\n\nallEquations:\n=============\n" + dumpSimEqSystemLst(allEquations) + "\n\n"); - end if; + // update index of zero-Crossings after equations are created + zeroCrossings := updateZeroCrossEqnIndex(zeroCrossings, eqBackendSimCodeMapping, BackendDAEUtil.daeSize(dlow)); - // collect symbolic jacobians from state selection - (stateSets, SymbolicJacsStateSelect, numberOfJacobians) = indexStateSets(stateSets, {}, numberOfJacobians, {}); - - // generate jacobian or linear model matrices - (LinearMatrices,uniqueEqIndex) = createJacobianLinearCode(symJacs, modelInfo, uniqueEqIndex); - - // collect jacobian equation only for equantion info file - jacobianEquations = collectAllJacobianEquations(LinearMatrices, {}); - - // collect symbolic jacobians in linear loops of the overall jacobians - (_, numberofLinearSys, numberofNonLinearSys, numberofMixedSys, numberOfJacobians, SymbolicJacs) = countandIndexAlgebraicLoops({}, numberofLinearSys, numberofNonLinearSys, numberofMixedSys, numberOfJacobians, LinearMatrices); - - jacobianEquations = collectAllJacobianEquations(SymbolicJacsStateSelect, jacobianEquations); - SymbolicJacsNLS = listAppend(SymbolicJacsNLS, SymbolicJacsStateSelect); - SymbolicJacs = listAppend(SymbolicJacsNLS, SymbolicJacs); - jacobianSimvars = collectAllJacobianVars(SymbolicJacs, {}); - modelInfo = setJacobianVars(jacobianSimvars, modelInfo); - - // map index also odeEquations and algebraicEquations - systemIndexMap = List.fold(allEquations, getSystemIndexMap, arrayCreate(uniqueEqIndex, -1)); - odeEquations = List.mapList1_1(odeEquations, setSystemIndexMap, systemIndexMap); - algebraicEquations = List.mapList1_1(algebraicEquations, setSystemIndexMap, systemIndexMap); - numberofEqns = uniqueEqIndex; /* This is a *much* better estimate than the guessed number of equations */ - - // create model info - modelInfo = addNumEqnsandNumofSystems(modelInfo, numberofEqns, numberofLinearSys, numberofNonLinearSys, numberofMixedSys, numberOfJacobians); - - // replace div operator with div operator with check of Division by zero - allEquations = List.map(allEquations, addDivExpErrorMsgtoSimEqSystem); - odeEquations = List.mapList(odeEquations, addDivExpErrorMsgtoSimEqSystem); - algebraicEquations = List.mapList(algebraicEquations, addDivExpErrorMsgtoSimEqSystem); - startValueEquations = List.map(startValueEquations, addDivExpErrorMsgtoSimEqSystem); - nominalValueEquations = List.map(nominalValueEquations, addDivExpErrorMsgtoSimEqSystem); - minValueEquations = List.map(minValueEquations, addDivExpErrorMsgtoSimEqSystem); - maxValueEquations = List.map(maxValueEquations, addDivExpErrorMsgtoSimEqSystem); - parameterEquations = List.map(parameterEquations, addDivExpErrorMsgtoSimEqSystem); - removedEquations = List.map(removedEquations, addDivExpErrorMsgtoSimEqSystem); - initialEquations = List.map(initialEquations, addDivExpErrorMsgtoSimEqSystem); - removedInitialEquations = List.map(removedInitialEquations, addDivExpErrorMsgtoSimEqSystem); - - odeEquations = makeEqualLengthLists(odeEquations, Config.noProc()); - algebraicEquations = makeEqualLengthLists(algebraicEquations, Config.noProc()); - - // Filter out empty systems to improve code generation - odeEquations = List.filterOnFalse(odeEquations, listEmpty); - algebraicEquations = List.filterOnFalse(algebraicEquations, listEmpty); - - if Flags.isSet(Flags.EXEC_HASH) then - print("*** SimCode -> generate cref2simVar hastable: " + realString(clock()) + "\n"); - end if; - (crefToSimVarHT,mixedArrayVars) = createCrefToSimVarHT(modelInfo); - modelInfo = setMixedArrayVars(mixedArrayVars, modelInfo); - if Flags.isSet(Flags.EXEC_HASH) then - print("*** SimCode -> generate cref2simVar hastable done!: " + realString(clock()) + "\n"); - end if; + // update indexNonLinear in SES_NONLINEAR and count + SymbolicJacsNLS := {}; + (initialEquations, numberofLinearSys, numberofNonLinearSys, numberofMixedSys, numberOfJacobians, SymbolicJacsTemp) := countandIndexAlgebraicLoops(initialEquations, 0, 0, 0, 0, {}); + SymbolicJacsNLS := listAppend(SymbolicJacsTemp, SymbolicJacsNLS); + (parameterEquations, numberofLinearSys, numberofNonLinearSys, numberofMixedSys, numberOfJacobians, SymbolicJacsTemp) := countandIndexAlgebraicLoops(parameterEquations, numberofLinearSys, numberofNonLinearSys, numberofMixedSys, numberOfJacobians, {}); + SymbolicJacsNLS := listAppend(SymbolicJacsTemp, SymbolicJacsNLS); + (allEquations, numberofLinearSys, numberofNonLinearSys, numberofMixedSys, numberOfJacobians, SymbolicJacsTemp) := countandIndexAlgebraicLoops(allEquations, numberofLinearSys, numberofNonLinearSys, numberofMixedSys, numberOfJacobians, {}); + SymbolicJacsNLS := listAppend(SymbolicJacsTemp, SymbolicJacsNLS); - backendMapping = setBackendVarMapping(inBackendDAE,crefToSimVarHT,modelInfo,backendMapping); - //dumpBackendMapping(backendMapping); - - modelStruct = createFMIModelStructure(symJacs, modelInfo); - - (varToArrayIndexMapping, varToIndexMapping) = createVarToArrayIndexMapping(modelInfo); - //print("HASHTABLE MAPPING\n\n"); - //BaseHashTable.dumpHashTable(varToArrayIndexMapping); - //print("END MAPPING\n\n"); - - simCode = SimCode.SIMCODE(modelInfo, - {}, // Set by the traversal below... - recordDecls, - externalFunctionIncludes, - allEquations, - odeEquations, - algebraicEquations, - partitionsKind, arrayList(baseClocks), - useHomotopy, - initialEquations, - removedInitialEquations, - startValueEquations, - nominalValueEquations, - minValueEquations, - maxValueEquations, - parameterEquations, - removedEquations, - algorithmAndEquationAsserts, - equationsForZeroCrossings, - jacobianEquations, - stateSets, - constraints, - classAttributes, - zeroCrossings, - relations, - timeEvents, - whenClauses, - discreteModelVars, - extObjInfo, - makefileParams, - SimCode.DELAYED_EXPRESSIONS(delayedExps, maxDelayedExpIndex), - SymbolicJacs, - simSettingsOpt, - filenamePrefix, - HpcOmSimCode.emptyHpcomData, - varToArrayIndexMapping, - varToIndexMapping, - crefToSimVarHT, - SOME(backendMapping), - modelStruct); - - (simCode, (_, _, lits)) = traverseExpsSimCode(simCode, SimCodeFunctionUtil.findLiteralsHelper, literals); - - simCode = setSimCodeLiterals(simCode, listReverse(lits)); - - if Flags.isSet(Flags.VECTORIZE) then - // update simCode equations - simCode = Vectorization.updateSimCode(simCode); - end if; + if Flags.isSet(Flags.DYNAMIC_TEARING_INFO) then + print("\n\n*********************\n* SimCode Equations *\n*********************\n\ninitialEquations:\n:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=\n" + dumpSimEqSystemLst(initialEquations) + "\n"); + print("\n\nparameterEquations:\n:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=\n" + dumpSimEqSystemLst(parameterEquations) + "\n"); + print("\n\nallEquations:\n:=:=:=:=:=:=:=:=:=:=:=:=:=\n" + dumpSimEqSystemLst(allEquations) + "\n\n"); + end if; - //dumpCrefToSimVarHashTable(crefToSimVarHT); - // print("*** SimCode -> collect all files started: " + realString(clock()) + "\n"); - // adrpo: collect all the files from SourceInfo and DAE.ElementSource - // simCode = collectAllFiles(simCode); - // print("*** SimCode -> collect all files done!: " + realString(clock()) + "\n"); + // collect symbolic jacobians from state selection + (stateSets, SymbolicJacsStateSelect, numberOfJacobians) := indexStateSets(stateSets, {}, numberOfJacobians, {}); + + // generate jacobian or linear model matrices + (LinearMatrices,uniqueEqIndex) := createJacobianLinearCode(symJacs, modelInfo, uniqueEqIndex); + + // collect jacobian equation only for equantion info file + jacobianEquations := collectAllJacobianEquations(LinearMatrices, {}); + + // collect symbolic jacobians in linear loops of the overall jacobians + (_, numberofLinearSys, numberofNonLinearSys, numberofMixedSys, numberOfJacobians, SymbolicJacs) := countandIndexAlgebraicLoops({}, numberofLinearSys, numberofNonLinearSys, numberofMixedSys, numberOfJacobians, LinearMatrices); + + jacobianEquations := collectAllJacobianEquations(SymbolicJacsStateSelect, jacobianEquations); + SymbolicJacsNLS := listAppend(SymbolicJacsNLS, SymbolicJacsStateSelect); + SymbolicJacs := listAppend(SymbolicJacsNLS, SymbolicJacs); + jacobianSimvars := collectAllJacobianVars(SymbolicJacs, {}); + modelInfo := setJacobianVars(jacobianSimvars, modelInfo); + + // map index also odeEquations and algebraicEquations + systemIndexMap := List.fold(allEquations, getSystemIndexMap, arrayCreate(uniqueEqIndex, -1)); + odeEquations := List.mapList1_1(odeEquations, setSystemIndexMap, systemIndexMap); + algebraicEquations := List.mapList1_1(algebraicEquations, setSystemIndexMap, systemIndexMap); + numberofEqns := uniqueEqIndex; /* This is a *much* better estimate than the guessed number of equations */ + + // create model info + modelInfo := addNumEqnsandNumofSystems(modelInfo, numberofEqns, numberofLinearSys, numberofNonLinearSys, numberofMixedSys, numberOfJacobians); + + // replace div operator with div operator with check of Division by zero + allEquations := List.map(allEquations, addDivExpErrorMsgtoSimEqSystem); + odeEquations := List.mapList(odeEquations, addDivExpErrorMsgtoSimEqSystem); + algebraicEquations := List.mapList(algebraicEquations, addDivExpErrorMsgtoSimEqSystem); + startValueEquations := List.map(startValueEquations, addDivExpErrorMsgtoSimEqSystem); + nominalValueEquations := List.map(nominalValueEquations, addDivExpErrorMsgtoSimEqSystem); + minValueEquations := List.map(minValueEquations, addDivExpErrorMsgtoSimEqSystem); + maxValueEquations := List.map(maxValueEquations, addDivExpErrorMsgtoSimEqSystem); + parameterEquations := List.map(parameterEquations, addDivExpErrorMsgtoSimEqSystem); + removedEquations := List.map(removedEquations, addDivExpErrorMsgtoSimEqSystem); + initialEquations := List.map(initialEquations, addDivExpErrorMsgtoSimEqSystem); + removedInitialEquations := List.map(removedInitialEquations, addDivExpErrorMsgtoSimEqSystem); + + odeEquations := makeEqualLengthLists(odeEquations, Config.noProc()); + algebraicEquations := makeEqualLengthLists(algebraicEquations, Config.noProc()); + + // Filter out empty systems to improve code generation + odeEquations := List.filterOnFalse(odeEquations, listEmpty); + algebraicEquations := List.filterOnFalse(algebraicEquations, listEmpty); + + if Flags.isSet(Flags.EXEC_HASH) then + print("*** SimCode -> generate cref2simVar hastable: " + realString(clock()) + "\n"); + end if; + (crefToSimVarHT,mixedArrayVars) := createCrefToSimVarHT(modelInfo); + modelInfo := setMixedArrayVars(mixedArrayVars, modelInfo); + if Flags.isSet(Flags.EXEC_HASH) then + print("*** SimCode -> generate cref2simVar hastable done!: " + realString(clock()) + "\n"); + end if; + backendMapping := setBackendVarMapping(inBackendDAE,crefToSimVarHT,modelInfo,backendMapping); + //dumpBackendMapping(backendMapping); + + modelStruct := createFMIModelStructure(symJacs, modelInfo); + + (varToArrayIndexMapping, varToIndexMapping) := createVarToArrayIndexMapping(modelInfo); + //print("HASHTABLE MAPPING\n\n"); + //BaseHashTable.dumpHashTable(varToArrayIndexMapping); + //print("END MAPPING\n\n"); + + simCode := SimCode.SIMCODE(modelInfo, + {}, // Set by the traversal below... + recordDecls, + externalFunctionIncludes, + allEquations, + odeEquations, + algebraicEquations, + partitionsKind, arrayList(baseClocks), + useHomotopy, + initialEquations, + removedInitialEquations, + startValueEquations, + nominalValueEquations, + minValueEquations, + maxValueEquations, + parameterEquations, + removedEquations, + algorithmAndEquationAsserts, + equationsForZeroCrossings, + jacobianEquations, + stateSets, + constraints, + classAttributes, + zeroCrossings, + relations, + timeEvents, + whenClauses, + discreteModelVars, + extObjInfo, + makefileParams, + SimCode.DELAYED_EXPRESSIONS(delayedExps, maxDelayedExpIndex), + SymbolicJacs, + simSettingsOpt, + filenamePrefix, + HpcOmSimCode.emptyHpcomData, + varToArrayIndexMapping, + varToIndexMapping, + crefToSimVarHT, + SOME(backendMapping), + modelStruct); + + (simCode, (_, _, lits)) := traverseExpsSimCode(simCode, SimCodeFunctionUtil.findLiteralsHelper, literals); + + simCode := setSimCodeLiterals(simCode, listReverse(lits)); + + if Flags.isSet(Flags.VECTORIZE) then + // update simCode equations + simCode := Vectorization.updateSimCode(simCode); + end if; - if Flags.isSet(Flags.DUMP_SIMCODE) then - dumpSimCode(simCode); - end if; - then (simCode, (highestSimEqIndex, equationSccMapping)); + // dumpCrefToSimVarHashTable(crefToSimVarHT); + // print("*** SimCode -> collect all files started: " + realString(clock()) + "\n"); + // adrpo: collect all the files from SourceInfo and DAE.ElementSource + // simCode := collectAllFiles(simCode); + // print("*** SimCode -> collect all files done!: " + realString(clock()) + "\n"); - else equation - Error.addInternalError("function createSimCode failed [Transformation from optimised DAE to simulation code structure failed]", sourceInfo()); - then fail(); - end matchcontinue; + if Flags.isSet(Flags.DUMP_SIMCODE) then + dumpSimCode(simCode); + end if; + else + Error.addInternalError("function createSimCode failed [Transformation from optimised DAE to simulation code structure failed]", sourceInfo()); + fail(); + end try; end createSimCode; public function createFunctions @@ -1790,21 +1781,21 @@ end updateZeroCrossEqnIndexHelp; protected function convertListMappingToArray input list> iMapping; // input Integer numOfBackendEqs; - output array oMapping; + output array outMapping; algorithm - oMapping := arrayCreate(numOfBackendEqs, -1); - oMapping := List.fold(iMapping, convertListMappingToArray1, oMapping); + outMapping := arrayCreate(numOfBackendEqs, -1); + outMapping := List.fold(iMapping, convertListMappingToArray1, outMapping); end convertListMappingToArray; protected function convertListMappingToArray1 input tuple iMapping; // input array iMappingArray; - output array oMappingArray; + output array outMappingArray; protected Integer simEqIdx,BackendEqnIdx; algorithm (simEqIdx,BackendEqnIdx) := iMapping; - oMappingArray := arrayUpdate(iMappingArray,BackendEqnIdx,simEqIdx); + outMappingArray := arrayUpdate(iMappingArray,BackendEqnIdx,simEqIdx); end convertListMappingToArray1; protected function convertListIndx @@ -3468,11 +3459,8 @@ algorithm local BackendDAE.Variables vars; BackendDAE.EquationArray eqns; - Option m; - Option mT; - BackendDAE.Matching matching; BackendDAE.StateSets stateSets; - BackendDAE.BaseClockPartitionKind partitionKind; + BackendDAE.EqSystem syst; list equations; Integer uniqueEqIndex, numStateSets; list tempvars; @@ -3480,12 +3468,14 @@ algorithm // no stateSet case (BackendDAE.EQSYSTEM(stateSets={}), _) then (isyst, inTpl); // sets - case (BackendDAE.EQSYSTEM(orderedVars=vars, orderedEqs=eqns, m=m, mT=mT, matching=matching as BackendDAE.MATCHING(comps=comps), stateSets=stateSets, partitionKind=partitionKind), + case (syst as BackendDAE.EQSYSTEM(orderedVars=vars, orderedEqs=eqns, matching=BackendDAE.MATCHING(comps=comps), stateSets=stateSets), (equations, uniqueEqIndex, tempvars, numStateSets)) equation - (vars, equations, uniqueEqIndex, tempvars, numStateSets) = createStateSetsSets(stateSets, vars, eqns, inShared, comps, equations, uniqueEqIndex, tempvars, numStateSets); + (vars, equations, uniqueEqIndex, tempvars, numStateSets) = + createStateSetsSets(stateSets, vars, eqns, inShared, comps, equations, uniqueEqIndex, tempvars, numStateSets); + syst.orderedVars = vars; then - (BackendDAE.EQSYSTEM(vars, eqns, m, mT, matching, stateSets, partitionKind), (equations, uniqueEqIndex, tempvars, numStateSets)); + (syst, (equations, uniqueEqIndex, tempvars, numStateSets)); end match; end createStateSetsSystem; @@ -4653,13 +4643,10 @@ protected function createEquationsfromList output Integer ouniqueEqIndex; output list otempvars; algorithm - (equations_, ouniqueEqIndex, otempvars) := matchcontinue(inEquations, inVars, genDiscrete, iuniqueEqIndex, itempvars, iextra) + (equations_, ouniqueEqIndex, otempvars) := matchcontinue inEquations local - BackendDAE.Variables evars, vars1; - BackendDAE.EquationArray eeqns, eqns_1; - FCore.Cache cache; - FCore.Graph graph; - DAE.FunctionTree funcs; + BackendDAE.Variables vars1; + BackendDAE.EquationArray eqns_1; BackendDAE.BackendDAE subsystem_dae; BackendDAE.StrongComponents comps; BackendDAE.EqSystem syst; @@ -4667,23 +4654,20 @@ algorithm Integer uniqueEqIndex; list tempvars; - case ({}, _, _, _, _, _) + case {} then ({}, iuniqueEqIndex, itempvars); - case (_, _, _, _, _, _) equation + case _ equation eqns_1 = BackendEquation.listEquation(inEquations); vars1 = BackendVariable.listVar1(inVars); - evars = BackendVariable.emptyVars(); - eeqns = BackendEquation.emptyEqns(); - cache = FCore.emptyCache(); - graph = FGraph.empty(); - funcs = DAEUtil.avlTreeNew(); - syst = BackendDAE.EQSYSTEM(vars1, eqns_1, NONE(), NONE(), BackendDAE.NO_MATCHING(), {}, BackendDAE.UNKNOWN_PARTITION()); - shared = BackendDAE.SHARED( evars, evars, evars, eeqns, eeqns, {}, {}, cache, graph, funcs, BackendDAEUtil.emptyEventInfo(), {}, - BackendDAE.ARRAYSYSTEM(), {}, iextra ); + syst = BackendDAEUtil.createEqSystem(vars1, eqns_1); + shared = BackendDAEUtil.createEmptyShared(BackendDAE.ARRAYSYSTEM(), iextra, FCore.emptyCache(), FGraph.empty()); subsystem_dae = BackendDAE.DAE({syst}, shared); - (BackendDAE.DAE({syst as BackendDAE.EQSYSTEM(matching=BackendDAE.MATCHING(comps=comps))}, shared)) = BackendDAEUtil.transformBackendDAE(subsystem_dae, SOME((BackendDAE.NO_INDEX_REDUCTION(), BackendDAE.ALLOW_UNDERCONSTRAINED())), NONE(), NONE()); - (equations_, _, uniqueEqIndex, tempvars) = createEquations(false, false, genDiscrete, false, syst, shared, comps, iuniqueEqIndex, itempvars); + (BackendDAE.DAE({syst as BackendDAE.EQSYSTEM(matching=BackendDAE.MATCHING(comps=comps))}, shared)) = + BackendDAEUtil.transformBackendDAE( subsystem_dae, SOME((BackendDAE.NO_INDEX_REDUCTION(), + BackendDAE.ALLOW_UNDERCONSTRAINED())), NONE(), NONE() ); + (equations_, _, uniqueEqIndex, tempvars) = + createEquations(false, false, genDiscrete, false, syst, shared, comps, iuniqueEqIndex, itempvars); then (equations_, uniqueEqIndex, tempvars); else equation @@ -5759,25 +5743,21 @@ author:Waurich TUD 2015-01" protected list varMap; array varMapArr; - BackendDAE.Variables vars,allVars,vars1; - BackendDAE.EquationArray eqs,eqs1; + BackendDAE.Variables vars, allVars, vars1; + BackendDAE.EquationArray eqs, eqs1; BackendDAE.Matching matching; BackendDAE.IncidenceMatrix mStart; BackendDAE.IncidenceMatrixT mTStart; - Option m; - Option mT; BackendDAE.StrongComponents comps; - BackendDAE.StateSets stateSets; - BackendDAE.BaseClockPartitionKind partitionKind; BackendDAE.EqSystem syst; list eqLst; - list varLst,noStartVarLst; + list varLst, noStartVarLst; list> stateInfo; list stateIdcs; list stateKinds; algorithm - BackendDAE.EQSYSTEM(orderedVars=vars, orderedEqs=eqs, m=m, mT=mT, stateSets=stateSets, partitionKind=partitionKind, matching=matching) := systIn; + BackendDAE.EQSYSTEM(orderedVars=vars, orderedEqs=eqs) := systIn; // set the varkInd for states to variable, reverse this later with the help of the stateinfo stateInfo := List.fold1(List.intRange(BackendVariable.varsSize(vars)),getStateInfo,vars,{});// which var is a state and save the kind (vars,_) := BackendVariable.traverseBackendDAEVarsWithUpdate(vars,setVarKindForStates,BackendDAE.VARIABLE()); @@ -5792,24 +5772,24 @@ algorithm // insert start values for crefs and build incidence matrix //BackendDump.dumpVariables(vars,"VAR BEFORE"); //BackendDump.dumpEquationList(eqLst,"EQS BEFORE"); - (eqLst,_) := BackendEquation.traverseExpsOfEquationList(eqLst,replaceCrefWithStartValue,allVars); + (eqLst, _) := BackendEquation.traverseExpsOfEquationList(eqLst,replaceCrefWithStartValue,allVars); //BackendDump.dumpEquationList(eqLst,"EQS AFTER"); eqs1 := BackendEquation.listEquation(eqLst); vars1 := BackendVariable.listVar1(noStartVarLst); - syst := BackendDAE.EQSYSTEM(vars1,eqs1,NONE(),NONE(),BackendDAE.NO_MATCHING(),stateSets,partitionKind); - (syst,mStart,mTStart) := BackendDAEUtil.getIncidenceMatrix(syst,BackendDAE.NORMAL(),NONE()); + syst := BackendDAEUtil.createEqSystem(vars1, eqs1); + (syst, mStart, mTStart) := BackendDAEUtil.getIncidenceMatrix(syst,BackendDAE.NORMAL(),NONE()); //BackendDump.dumpIncidenceMatrix(mStart); //BackendDump.dumpIncidenceMatrixT(mTStart); // solve equations for new start values and assign start values to variables varMapArr := listArray(varMap); - vars := preCalculateStartValues1(List.intRange(arrayLength(mStart)),mStart,mTStart,varMapArr,eqs1,vars); + vars := preCalculateStartValues1(List.intRange(arrayLength(mStart)), mStart, mTStart, varMapArr, eqs1, vars); // reset the varKinds for the states - stateIdcs := List.map(stateInfo,Util.tuple21); - stateKinds := List.map(stateInfo,Util.tuple22); - vars := List.threadFold(stateIdcs,stateKinds,BackendVariable.setVarKindForVar,vars); + stateIdcs := List.map(stateInfo, Util.tuple21); + stateKinds := List.map(stateInfo, Util.tuple22); + vars := List.threadFold(stateIdcs, stateKinds,BackendVariable.setVarKindForVar, vars); //BackendDump.dumpVariables(vars,"VAR AFTER"); - systOut := BackendDAE.EQSYSTEM(vars, eqs,m, mT, matching, stateSets, partitionKind); + systOut := BackendDAEUtil.setEqSystVars(systIn, vars); end preCalculateStartValues; protected function preCalculateStartValues1"try to solve the start equation for a var and set the resulting start value for it." @@ -10063,20 +10043,44 @@ algorithm end getVarToArrayIndexByType; public function getVarIndexListByMapping "author: marcusw + Return the variable indices stored for the given variable in the mapping-table. If the variable is part of an array, all array indices are returned. This function is used by susan." + input HashTableCrIListArray.HashTable iVarToArrayIndexMapping; + input DAE.ComponentRef iVarName; + input String iIndexForUndefinedReferences; + output list oVarIndexList; //if the variable is part of an array, all array indices are returned in this list (the list contains one element if the variable is a scalar) +algorithm + ((oVarIndexList,_)) := getVarIndexInfosByMapping(iVarToArrayIndexMapping, iVarName, iIndexForUndefinedReferences); +end getVarIndexListByMapping; + +public function getVarIndexByMapping "author: marcusw + Return the variable index stored for the given variable in the mapping-table. This function is used by susan." + input HashTableCrIListArray.HashTable iVarToArrayIndexMapping; + input DAE.ComponentRef iVarName; + input String iIndexForUndefinedReferences; + output String oConcreteVarIndex; //the scalar index of the variable (this value is always part of oVarIndexList) +algorithm + ((_,oConcreteVarIndex)) := getVarIndexInfosByMapping(iVarToArrayIndexMapping, iVarName, iIndexForUndefinedReferences); +end getVarIndexByMapping; + +protected function getVarIndexInfosByMapping "author: marcusw Return the variable indices stored for the given variable in the mapping-table. This function is used by susan." input HashTableCrIListArray.HashTable iVarToArrayIndexMapping; input DAE.ComponentRef iVarName; input String iIndexForUndefinedReferences; - output list oVarIndexList; + output list oVarIndexList; //if the variable is part of an array, all array indices are returned in this list (the list contains one element if the variable is a scalar) + output String oConcreteVarIndex; //the scalar index of the variable (this value is always part of oVarIndexList) protected DAE.ComponentRef varName = iVarName; - Integer arrayIdx, idx, arraySize; + Integer arrayIdx, idx, arraySize, concreteVarIndex; array varIndices; list tmpVarIndexListNew = {}; + list arraySubscripts; + list arrayDimensions; algorithm + arraySubscripts := ComponentReference.crefLastSubs(varName); varName := ComponentReference.crefStripLastSubs(varName);//removeSubscripts(varName); if(BaseHashTable.hasKey(varName, iVarToArrayIndexMapping)) then - ((_,varIndices)) := BaseHashTable.get(varName, iVarToArrayIndexMapping); + ((arrayDimensions,varIndices)) := BaseHashTable.get(varName, iVarToArrayIndexMapping); arraySize := arrayLength(varIndices); for arrayIdx in 0:(arraySize-1) loop idx := arrayGet(varIndices, arraySize-arrayIdx); @@ -10091,13 +10095,28 @@ algorithm end if; end if; end for; + ((concreteVarIndex,_,_)) := List.fold(listReverse(arraySubscripts), getUnrolledArrayIndex, (0, 1, listReverse(arrayDimensions))); + + // ignore all values that are undefined references and part of the same array + idx := 1; + while intLe (idx, concreteVarIndex) loop + if(intLt(arrayGet(varIndices, idx), 1)) then + concreteVarIndex := concreteVarIndex - 1; + end if; + idx := idx + 1; + end while; + + concreteVarIndex := intAbs(arrayGet(varIndices, 1)) - 1 + concreteVarIndex; + oConcreteVarIndex := intString(concreteVarIndex); end if; if(listEmpty(tmpVarIndexListNew)) then Error.addMessage(Error.INTERNAL_ERROR, {"GetVarIndexListByMapping: No Element for " + ComponentReference.printComponentRefStr(varName) + " found!"}); tmpVarIndexListNew := {iIndexForUndefinedReferences}; + oConcreteVarIndex := iIndexForUndefinedReferences; end if; + //print("SimCodeUtil.getVarIndexInfosByMapping: Variable " + ComponentReference.printComponentRefStr(iVarName) + " has variable indices {" + stringDelimitList(tmpVarIndexListNew, ",") + "} and concrete index " + oConcreteVarIndex + "\n"); oVarIndexList := tmpVarIndexListNew; -end getVarIndexListByMapping; +end getVarIndexInfosByMapping; public function isVarIndexListConsecutive "author: marcusw Check if all variable indices of the given variables, stored in the hash table, are consecutive." @@ -10178,7 +10197,7 @@ end getUnrolledArrayIndex; public function createIdxSCVarMapping "author: marcusw Create a mapping from the SCVar-Index (array-Index) to the SCVariable, as it is used in the c-runtime." input SimCodeVar.SimVars simVars; - output array> oMapping; + output array> outMapping; protected Integer numStateVars; list stateVars; @@ -10247,7 +10266,7 @@ algorithm mappingArray := arrayCreate(highestIdx, NONE()); mappingArray := List.fold(idxSimVarMappingTplList, createAllSCVarMapping1, mappingArray); - oMapping := mappingArray; + outMapping := mappingArray; end createIdxSCVarMapping; protected function createAllSCVarMapping0 "author: marcusw @@ -10274,13 +10293,13 @@ protected function createAllSCVarMapping1 "author: marcusw Set the arrayIndex (iMapping) to the value given by the tuple." input tuple iSimVarIdxTpl; // input array> iMapping; - output array> oMapping; + output array> outMapping; protected Integer simVarIdx; SimCodeVar.SimVar simVar; algorithm (simVarIdx,simVar) := iSimVarIdxTpl; - oMapping := arrayUpdate(iMapping,simVarIdx,SOME(simVar)); + outMapping := arrayUpdate(iMapping,simVarIdx,SOME(simVar)); end createAllSCVarMapping1; public function getEnumerationTypes @@ -11638,7 +11657,7 @@ protected function getDaeEqsNotPartOfOdeSystem0 "Add the given equation system o author: marcusw" input SimCode.SimEqSystem iEqSystem; input tuple>, Integer> iMappingWithHighestIdx; // SimEqSystem, highestIdx> - output tuple>, Integer> oMappingWithHighestIdx; + output tuple>, Integer> outMappingWithHighestIdx; protected Integer index, highestIdx; list> allEqIdxMapping; @@ -11647,7 +11666,7 @@ algorithm (allEqIdxMapping, highestIdx) := iMappingWithHighestIdx; allEqIdxMapping := (index, iEqSystem)::allEqIdxMapping; highestIdx := intMax(highestIdx, index); - oMappingWithHighestIdx := (allEqIdxMapping, highestIdx); + outMappingWithHighestIdx := (allEqIdxMapping, highestIdx); end getDaeEqsNotPartOfOdeSystem0; protected function getDaeEqsNotPartOfOdeSystem1 "Set the array at position simEqIdx to the simEqSystem-object. diff --git a/Compiler/Template/CodegenC.tpl b/Compiler/Template/CodegenC.tpl index 114c5965be8..42bb9a7a025 100644 --- a/Compiler/Template/CodegenC.tpl +++ b/Compiler/Template/CodegenC.tpl @@ -2526,20 +2526,13 @@ template genreinits(SimWhenClause whenClauses, Text &varDecls, Text &auxFunction ::= match whenClauses case SIM_WHEN_CLAUSE(__) then - let helpIf = (conditions |> e => ' || (<%cref(e)%> && !$P$PRE<%cref(e)%> /* edge */)') - let ifthen = functionWhenReinitStatementThen(false, reinits, &varDecls, &auxFunction) - let initial_assign = match initialCall - case true then functionWhenReinitStatementThen(true, reinits, &varDecls, &auxFunction) - else '; /* nothing to do */' + let helpIf = (conditions |> e => '(<%cref(e)%> && !$P$PRE<%cref(e)%> /* edge */)';separator=" || ") + let ifthen = functionWhenReinitStatementThen(reinits, &varDecls, &auxFunction) - if reinits then + if boolAnd(intGt(listLength(conditions), 0), intGt(listLength(reinits), 0)) then << /* for whenclause index <%int%> */ - if(initial()) - { - <%initial_assign%> - } - else if(0<%helpIf%>) + if(<%helpIf%>) { <%ifthen%> } @@ -2547,7 +2540,7 @@ template genreinits(SimWhenClause whenClauses, Text &varDecls, Text &auxFunction end genreinits; -template functionWhenReinitStatementThen(Boolean initialCall, list reinits, Text &varDecls, Text &auxFunction) +template functionWhenReinitStatementThen(list reinits, Text &varDecls, Text &auxFunction) "Generates re-init statement for when equation." ::= let body = (reinits |> reinit => @@ -2560,14 +2553,11 @@ template functionWhenReinitStatementThen(Boolean initialCall, list 'copy_real_array_data_mem(<%val%>, &<%cref(stateVar)%>);' else '<%cref(stateVar)%> = <%val%>;' - let needToIterate = - if not initialCall then - "data->simulationInfo.needToIterate = 1;" << - infoStreamPrint(LOG_EVENTS, 0, "reinit <%cref(stateVar)%> = %f", <%val%>); <%preExp%> <%lhs%> - <%needToIterate%> + infoStreamPrint(LOG_EVENTS, 0, "reinit <%cref(stateVar)%> = <%crefToPrintfArg(stateVar)%>", <%cref(stateVar)%>); + data->simulationInfo.needToIterate = 1; >> case TERMINATE(__) then let &preExp = buffer "" @@ -3323,7 +3313,6 @@ template functionODE(list> derivativEquations, Text method, Op data->simulationInfo.callStatistics.functionODE++; - data->simulationInfo.discreteCall = 0; <%if Flags.isSet(Flags.PARMODAUTO) then 'PM_functionODE(<%nrfuncs%>, data, functionODE_systems);' else '<%fncalls%>' %> @@ -3355,7 +3344,6 @@ template functionAlgebraic(list> algebraicEquations, String mo TRACE_PUSH <%varDecls%> - data->simulationInfo.discreteCall = 0; <%if Flags.isSet(Flags.PARMODAUTO) then 'PM_functionAlg(<%nrfuncs%>, data, functionAlg_systems);' else '<%fncalls%>' %> @@ -3416,6 +3404,7 @@ template functionDAE(list allEquationsPlusWhen, list <%if Flags.isSet(Flags.PARMODAUTO) then 'PM_functionDAE(<%nrfuncs%>, data, functionDAE_systems);' else '<%fncalls%>' %> <%reinit%> + data->simulationInfo.discreteCall = 0; TRACE_POP return 0; @@ -3477,7 +3466,6 @@ template functionZeroCrossing(list zeroCrossings, listsimulationInfo.callStatistics.functionZeroCrossingsEquations++; - data->simulationInfo.discreteCall = 0; <%eqs%> TRACE_POP diff --git a/Compiler/Template/CodegenCFunctions.tpl b/Compiler/Template/CodegenCFunctions.tpl index 25ba47106dd..b54b4feb114 100644 --- a/Compiler/Template/CodegenCFunctions.tpl +++ b/Compiler/Template/CodegenCFunctions.tpl @@ -2398,13 +2398,16 @@ template algStmtAssign(DAE.Statement stmt, Context context, Text &varDecls, Text << <%preExp%> >> - case STMT_ASSIGN(exp1=CREF(componentRef=cr as CREF_QUAL(identType=T_METATYPE(ty=t1 as T_METARECORD(__)), componentRef=cr2 as CREF_IDENT(__)),ty=t2)) then + case STMT_ASSIGN(exp1=RSUB(exp=explhs as CREF(ty=t1 as T_METARECORD(__)), fieldName=fieldName)) + case STMT_ASSIGN(exp1=RSUB(exp=explhs as CREF(ty=t1 as T_METAUNIONTYPE(__)), fieldName=fieldName)) + case STMT_ASSIGN(exp1=explhs as CREF(componentRef=CREF_QUAL(identType=T_METATYPE(ty=t1 as T_METAUNIONTYPE(__)), componentRef=cr2 as CREF_IDENT(ident=fieldName)), ty=t2)) + case STMT_ASSIGN(exp1=explhs as CREF(componentRef=CREF_QUAL(identType=T_METATYPE(ty=t1 as T_METARECORD(__)), componentRef=cr2 as CREF_IDENT(ident=fieldName)),ty=t2)) then let &preExp = buffer "" let tmp = tempDecl("modelica_metatype",&varDecls) - let varPart = '_<%cr.ident%>' // So it only works in function context? + let varPart = daeExp(explhs, context, &preExp, &varDecls, &auxFunction) let expPart = daeExp(exp, context, &preExp, &varDecls, &auxFunction) - let indexInRecord = intAdd(1, lookupIndexInMetaRecord(t1.fields, cr2.ident)) - let len = intAdd(2, listLength(t1.fields)) + let indexInRecord = intAdd(1, lookupIndexInMetaRecord(getMetaRecordFields(t1), fieldName)) + let len = intAdd(2, listLength(getMetaRecordFields(t1))) << <%preExp%> <%tmp%> = MMC_TAGPTR(mmc_alloc_words(<%len%>)); @@ -2412,6 +2415,10 @@ template algStmtAssign(DAE.Statement stmt, Context context, Text &varDecls, Text ((modelica_metatype*)MMC_UNTAGPTR(<%tmp%>))[<%indexInRecord%>] = <%expPart%>; <%varPart%> = <%tmp%>; >> + + case STMT_ASSIGN(exp1=RSUB(__)) then + error(sourceInfo(), 'Code generation not implemented for lhs assignment <%printExpStr(exp1)%>') + case STMT_ASSIGN(exp1=CREF(ty = T_FUNCTION_REFERENCE_VAR(__))) case STMT_ASSIGN(exp1=CREF(ty = T_FUNCTION_REFERENCE_FUNC(__))) then let &preExp = buffer "" @@ -2658,7 +2665,7 @@ match stmt let call = daeExpCallTuple(exp, lhsCrefs2, context, &preExp, &varDecls, &auxFunction) let callassign = algStmtAssignWithRhsExpStr(firstexp, call, context, &preExp, &postExp, &varDecls, &auxFunction) << - /* tuple assignment <%expExpLst |> e => Util.escapeModelicaStringToCString(printExpStr(e)) ; separator=", "%>*/ + /* tuple assignment <%expExpLst |> e => escapeCComments(printExpStr(e)) ; separator=", "%>*/ <%preExp%> <%callassign%> <%postExp%> @@ -2976,6 +2983,7 @@ template algStmtForGeneric_impl(Exp exp, Ident iterator, String type, <% match type case "modelica_metatype" then (match typeof(exp) + case T_METAARRAY(__) case T_METATYPE(ty=T_METAARRAY(__)) then let tmp = tempDecl("modelica_integer",&varDecls) let len = tempDecl("modelica_integer",&varDecls) @@ -2986,6 +2994,7 @@ template algStmtForGeneric_impl(Exp exp, Ident iterator, String type, <%body%> } >> + case T_METALIST(__) case T_METATYPE(ty=T_METALIST(__)) then << for (<%tvar%> = <%evar%>; !listEmpty(<%tvar%>); <%tvar%>=listRest(<%tvar%>)) @@ -3602,6 +3611,7 @@ template expTypeFromExpFlag(Exp exp, Integer flag) case META_OPTION(__) case MATCHEXPRESSION(__) case METARECORDCALL(__) + case RSUB(__) case BOX(__) then match flag case 1 then "metatype" else "modelica_metatype" case c as UNBOX(__) then expTypeFlag(c.ty, flag) case c as SHARED_LITERAL(__) then expTypeFromExpFlag(c.exp, flag) @@ -4139,6 +4149,7 @@ end getTempDeclMatchOutputName; case e as CAST(__) then daeExpCast(e, context, &preExp, &varDecls, &auxFunction) case e as ASUB(__) then daeExpAsub(e, context, &preExp, &varDecls, &auxFunction) case e as TSUB(__) then daeExpTsub(e, context, &preExp, &varDecls, &auxFunction) + case e as RSUB(__) then daeExpRsub(e, context, &preExp, &varDecls, &auxFunction) case e as SIZE(__) then daeExpSize(e, context, &preExp, &varDecls, &auxFunction) case e as REDUCTION(__) then daeExpReduction(e, context, &preExp, &varDecls, &auxFunction) case e as TUPLE(__) then daeExpTuple(e, context, &preExp, &varDecls, &auxFunction) @@ -4372,8 +4383,9 @@ template daeExpCrefRhs(Exp exp, Context context, Text &preExp, 'boxvar_<%crefFunctionName(cr)%>' case CREF(componentRef = cr, ty = T_FUNCTION_REFERENCE_VAR(__)) then '((modelica_fnptr) _<%crefStr(cr)%>)' + case CREF(componentRef = cr as CREF_QUAL(subscriptLst={}, identType = T_METATYPE(ty=ty as T_METAUNIONTYPE(__)), componentRef=cri as CREF_IDENT(__))) case CREF(componentRef = cr as CREF_QUAL(subscriptLst={}, identType = T_METATYPE(ty=ty as T_METARECORD(__)), componentRef=cri as CREF_IDENT(__))) then - let offset = intAdd(findVarIndex(cri.ident,ty.fields),2) + let offset = intAdd(findVarIndex(cri.ident,getMetaRecordFields(ty)),2) // 0-based '(MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_<%cr.ident%>), <%offset%>)))' else match context @@ -5882,6 +5894,19 @@ template daeExpTsub(Exp inExp, Context context, Text &preExp, error(sourceInfo(), '<%printExpStr(inExp)%>: TSUB only makes sense if the subscripted expression is a function call of tuple type') end daeExpTsub; +template daeExpRsub(Exp inExp, Context context, Text &preExp, + Text &varDecls, Text &auxFunction) + "Generates code for an tsub expression." +::= + match inExp + case RSUB(__) then + let res = daeExp(exp, context, &preExp, &varDecls, &auxFunction) + let offset = intAdd(ix,1) // 1-based + '(MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(<%res%>), <%offset%>)))' + case RSUB(__) then + error(sourceInfo(), '<%printExpStr(inExp)%>: failed') +end daeExpRsub; + template daeExpAsub(Exp inExp, Context context, Text &preExp, Text &varDecls, Text &auxFunction) "Generates code for an asub expression." diff --git a/Compiler/Template/CodegenCpp.tpl b/Compiler/Template/CodegenCpp.tpl index 37c7be587c9..bb2d6418053 100644 --- a/Compiler/Template/CodegenCpp.tpl +++ b/Compiler/Template/CodegenCpp.tpl @@ -26,8 +26,8 @@ template translateModel(SimCode simCode) '<%numRealVars%> - 1', '<%numIntVars%> - 1', '<%numBoolVars%> - 1', &extraFuncs, &extraFuncsDecl, className, "", "", "", stateDerVectorName, false), 'OMCpp<%fileNamePrefix%>.cpp') let()= textFile(simulationHeaderFile(simCode , contextOther,&extraFuncs , &extraFuncsDecl, className, "", "", "", - memberVariableDefine(modelInfo, varToArrayIndexMapping, '<%numRealVars%> - 1', '<%numIntVars%> - 1', '<%numBoolVars%> - 1', false), - memberVariableDefinePreVariables(modelInfo, varToArrayIndexMapping, '<%numRealVars%> - 1', '<%numIntVars%> - 1', '<%numBoolVars%> - 1', false), + memberVariableDefine(modelInfo, varToArrayIndexMapping, '<%numRealVars%> - 1', '<%numIntVars%> - 1', '<%numBoolVars%> - 1', Flags.isSet(Flags.GEN_DEBUG_SYMBOLS), false), + memberVariableDefinePreVariables(modelInfo, varToArrayIndexMapping, '<%numRealVars%> - 1', '<%numIntVars%> - 1', '<%numBoolVars%> - 1', Flags.isSet(Flags.GEN_DEBUG_SYMBOLS), false), false), 'OMCpp<%fileNamePrefix%>.h') let()= textFile(simulationTypesHeaderFile(simCode, &extraFuncs, &extraFuncsDecl, "", modelInfo.functions, literals, stateDerVectorName, false), 'OMCpp<%fileNamePrefix%>Types.h') let()= textFile(simulationMakefile(target,simCode , &extraFuncs , &extraFuncsDecl, "","","","","",false), '<%fileNamePrefix%>.makefile') @@ -58,7 +58,7 @@ template translateModel(SimCode simCode) let()= textFile(simulationWriteOutputParameterCppFile(simCode , &extraFuncs , &extraFuncsDecl, "", false),'OMCpp<%fileNamePrefix%>WriteOutputParameter.cpp') let()= textFile(simulationWriteOutputAliasVarsCppFile(simCode , &extraFuncs , &extraFuncsDecl, "", stateDerVectorName, false),'OMCpp<%fileNamePrefix%>WriteOutputAliasVars.cpp') let()= textFile(simulationFactoryFile(simCode , &extraFuncs , &extraFuncsDecl, ""),'OMCpp<%fileNamePrefix%>FactoryExport.cpp') - let()= textFile(modelInitXMLFile(simCode, numRealVars, numIntVars, numBoolVars),'OMCpp<%fileNamePrefix%>Init.xml') + //let()= textFile(modelInitXMLFile(simCode, numRealVars, numIntVars, numBoolVars),'OMCpp<%fileNamePrefix%>Init.xml') let()= textFile(simulationMainRunScript(simCode , &extraFuncs , &extraFuncsDecl, "", "", "", "exec"), '<%fileNamePrefix%><%simulationMainRunScriptSuffix(simCode , &extraFuncs , &extraFuncsDecl, "")%>') let jac = (jacobianMatrixes |> (mat, _, _, _, _, _, _) => (mat |> (eqs,_,_) => algloopfiles(eqs,simCode , &extraFuncs , &extraFuncsDecl, "",contextAlgloopJacobian, stateDerVectorName, false) ;separator="") @@ -144,7 +144,7 @@ let initeqs = generateEquationMemberFuncDecls(initialEquations,"initEquation") void initializeIntAlgVars(); void initializeBoolAlgVars(); - <%List.partition(vars.aliasVars, 100) |> ls hasindex idx => 'void initializeAliasVars_<%idx%>();';separator="\n"%> + <%/*List.partition(vars.aliasVars, 100) |> ls hasindex idx => 'void initializeAliasVars_<%idx%>();';separator="\n"*/%> <%List.partition(vars.stringAliasVars, 100) |> ls hasindex idx => 'void initializeStringAliasVars_<%idx%>();';separator="\n"%> void initializeStringAliasVars(); void initializeAliasVars(); @@ -568,9 +568,9 @@ case modelInfo as MODELINFO(vars=SIMVARS(__)) then let &varDecls9 = buffer "" /*BUFD*/ let &varDecls10 = buffer "" /*BUFD*/ let &varDecls11 = buffer "" /*BUFD*/ - let init7 = initAliasValstWithSplit("Real", '<%lastIdentOfPath(modelInfo.name)%>Initialize::initializeAliasVars', vars.aliasVars, simCode, &extraFuncs, &extraFuncsDecl, extraFuncsNamespace, contextOther, stateDerVectorName, useFlatArrayNotation) - let init8 = initAliasValst(varDecls8, "Int", vars.intAliasVars, simCode, &extraFuncs, &extraFuncsDecl, extraFuncsNamespace, contextOther, stateDerVectorName, useFlatArrayNotation) - let init9 = initValst(varDecls9, "Bool",vars.boolAliasVars, simCode, &extraFuncs, &extraFuncsDecl, extraFuncsNamespace, contextOther, stateDerVectorName, useFlatArrayNotation) + let init7 = ""//initAliasValstWithSplit("Real", '<%lastIdentOfPath(modelInfo.name)%>Initialize::initializeAliasVars', vars.aliasVars, simCode, &extraFuncs, &extraFuncsDecl, extraFuncsNamespace, contextOther, stateDerVectorName, useFlatArrayNotation) + let init8 = ""//initAliasValst(varDecls8, "Int", vars.intAliasVars, simCode, &extraFuncs, &extraFuncsDecl, extraFuncsNamespace, contextOther, stateDerVectorName, useFlatArrayNotation) + let init9 = ""//initValst(varDecls9, "Bool",vars.boolAliasVars, simCode, &extraFuncs, &extraFuncsDecl, extraFuncsNamespace, contextOther, stateDerVectorName, useFlatArrayNotation) let init10 = initStringAliasValstWithSplit("String", '<%lastIdentOfPath(modelInfo.name)%>Initialize::initializeStringAliasVars', vars.stringAliasVars, simCode, &extraFuncs, &extraFuncsDecl, extraFuncsNamespace, contextOther, stateDerVectorName, useFlatArrayNotation) @@ -733,10 +733,11 @@ case SIMCODE(modelInfo = MODELINFO(__)) then void <%lastIdentOfPath(modelInfo.name)%>WriteOutput::initialize() { - _historyImpl->init(); - - - _historyImpl->clear(); + if(getGlobalSettings()->getOutputPointType()!= OPT_NONE) + { + _historyImpl->init(); + _historyImpl->clear(); + } } <%writeoutput(simCode , &extraFuncs , &extraFuncsDecl, extraFuncsNamespace, stateDerVectorName, useFlatArrayNotation)%> >> @@ -1480,7 +1481,8 @@ template simulationMainRunScript(SimCode simCode ,Text& extraFuncs,Text& extraFu let solver = settings.method let moLib = makefileParams.compileDir let home = makefileParams.omhome - let execParameters = '-s <%start%> -e <%end%> -f <%stepsize%> -v <%intervals%> -y <%tol%> -i <%solver%> -r <%simulationLibDir(simulationCodeTarget(),simCode , &extraFuncs , &extraFuncsDecl, extraFuncsNamespace)%> -m <%moLib%> -R <%simulationResults(getRunningTestsuite(),simCode , &extraFuncs , &extraFuncsDecl, extraFuncsNamespace)%> -o <%settings.outputFormat%>' + let execParameters = '-s <%start%> -e <%end%> -f <%stepsize%> -v <%intervals%> -y <%tol%> -i <%solver%> -r <%simulationLibDir(simulationCodeTarget(),simCode , &extraFuncs , &extraFuncsDecl, extraFuncsNamespace)%> -m <%moLib%> -R <%simulationResults(getRunningTestsuite(),simCode , &extraFuncs , &extraFuncsDecl, extraFuncsNamespace)%>' + let outputParameter = if (stringEq(settings.outputFormat, "empty")) then "-O none" else "" let fileNamePrefixx = fileNamePrefix let libFolder =simulationLibDir(simulationCodeTarget(),simCode , &extraFuncs , &extraFuncsDecl, extraFuncsNamespace) @@ -1492,7 +1494,7 @@ template simulationMainRunScript(SimCode simCode ,Text& extraFuncs,Text& extraFu << #!/bin/sh <%preRunCommandLinux%> - <%execCommandLinux%> ./<%fileNamePrefixx%> <%execParameters%> $* + <%execCommandLinux%> ./<%fileNamePrefixx%> <%execParameters%> <%outputParameter%> $* >> case "win32" case "win64" then @@ -1501,7 +1503,7 @@ template simulationMainRunScript(SimCode simCode ,Text& extraFuncs,Text& extraFu <%preRunCommandWindows%> REM ::export PATH=<%libFolder%>:$PATH REPLACE C: with /C/ SET PATH=<%home%>/bin;<%libFolder%>;<%libPaths%>;%PATH% - <%moLib%>/<%fileNamePrefixx%>.exe <%execParameters%> + <%moLib%>/<%fileNamePrefixx%>.exe <%execParameters%> <%outputParameter%> >> end match end match @@ -2110,8 +2112,7 @@ case SIMCODE(modelInfo=MODELINFO(__), makefileParams=MAKEFILE_PARAMS(__), simula opts["-r"] = "<%simulationLibDir(simulationCodeTarget(),simCode , &extraFuncs , &extraFuncsDecl, extraFuncsNamespace)%>"; opts["-m"] = "<%moLib%>"; opts["-R"] = "<%simulationResults(getRunningTestsuite(),simCode , &extraFuncs , &extraFuncsDecl, extraFuncsNamespace)%>"; - opts["-o"] = "<%settings.outputFormat%>"; - + <%if (stringEq(settings.outputFormat, "empty")) then 'opts["-O"] = "none";' else ""%> <% match(getConfigString(PROFILING_LEVEL)) case("none") then '//no profiling used' @@ -3331,7 +3332,7 @@ match simCode case SIMCODE(modelInfo = MODELINFO(__)) then let className = lastIdentOfPath(modelInfo.name) let &additionalConstructorVarDefsBuffer = buffer additionalConstructorVarDefs - let memberVariableInitialize = memberVariableInitialize(modelInfo, varToArrayIndexMapping, indexForUndefinedReferencesReal, indexForUndefinedReferencesInt, indexForUndefinedReferencesBool, useFlatArrayNotation, additionalConstructorVarDefsBuffer, extraFuncsDecl) + let memberVariableInitialize = memberVariableInitialize(modelInfo, varToArrayIndexMapping, indexForUndefinedReferencesReal, indexForUndefinedReferencesInt, indexForUndefinedReferencesBool, Flags.isSet(Flags.GEN_DEBUG_SYMBOLS), useFlatArrayNotation, additionalConstructorVarDefsBuffer, extraFuncsDecl) let constVariableInitialize = simulationInitFile(simCode, &extraFuncsDecl, stateDerVectorName, false) << #if defined(__TRICORE__) || defined(__vxworks) @@ -6272,41 +6273,41 @@ case SIMCODE(modelInfo = MODELINFO(__),simulationSettingsOpt = SOME(settings as writeDerivativeVarsResultNames(varsnames); <% - match settings.outputFormat case "mat" - then - << - writeParametertNames(paramnames); - writeIntParameterNames(paramnames); - writeBoolParameterNames(paramnames); - writeAlgVarsResultDescription(vardescs); - writeDiscreteAlgVarsResultDescription(vardescs); - writeIntAlgVarsResultDescription(vardescs); - writeBoolAlgVarsResultDescription(vardescs); - writeAliasVarsResultDescription(vardescs); - writeIntAliasVarsResultDescription(vardescs); - writeBoolAliasVarsResultDescription(vardescs); - writeStateVarsResultDescription(vardescs); - writeDerivativeVarsResultDescription(vardescs); - writeParameterDescription(paramdecs); - writeIntParameterDescription(paramdecs); - writeBoolParameterDescription(paramdecs); - >> + match settings.outputFormat + case "mat" then + << + writeParametertNames(paramnames); + writeIntParameterNames(paramnames); + writeBoolParameterNames(paramnames); + writeAlgVarsResultDescription(vardescs); + writeDiscreteAlgVarsResultDescription(vardescs); + writeIntAlgVarsResultDescription(vardescs); + writeBoolAlgVarsResultDescription(vardescs); + writeAliasVarsResultDescription(vardescs); + writeIntAliasVarsResultDescription(vardescs); + writeBoolAliasVarsResultDescription(vardescs); + writeStateVarsResultDescription(vardescs); + writeDerivativeVarsResultDescription(vardescs); + writeParameterDescription(paramdecs); + writeIntParameterDescription(paramdecs); + writeBoolParameterDescription(paramdecs); + >> %> _historyImpl->write(varsnames,vardescs,paramnames,paramdecs); <% - match settings.outputFormat case "mat" - then - << + match settings.outputFormat + case "mat" then + << HistoryImplType::value_type_p params; writeParams(params); - >> - else - << - HistoryImplType::value_type_p params; - >> + >> + else + << + HistoryImplType::value_type_p params; + >> %> - _historyImpl->write(params,_global_settings->getStartTime(),_global_settings->getEndTime()); + _historyImpl->write(params,_global_settings->getStartTime(),_global_settings->getEndTime()); } //Write the current values else @@ -7277,7 +7278,7 @@ case SIMCODE(modelInfo = MODELINFO(__)) then end generateAlgloopMethodDeclarationCode; template memberVariableDefine(ModelInfo modelInfo, HashTableCrIListArray.HashTable varToArrayIndexMapping, Text indexForUndefinedReferencesReal, Text indexForUndefinedReferencesInt, - Text indexForUndefinedReferencesBool, Boolean useFlatArrayNotation) + Text indexForUndefinedReferencesBool, Boolean createDebugCode, Boolean useFlatArrayNotation) /*Define membervariable in simulation file.*/ ::= match modelInfo @@ -7285,49 +7286,49 @@ case MODELINFO(vars=SIMVARS(__)) then << /*parameter real vars*/ <%vars.paramVars |> var => - memberVariableDefine2(var, varToArrayIndexMapping, indexForUndefinedReferencesReal, useFlatArrayNotation, "Real", true) + memberVariableDefine2(var, varToArrayIndexMapping, indexForUndefinedReferencesReal, useFlatArrayNotation, createDebugCode, "Real", true) ;separator="\n"%> /*parameter int vars*/ <%vars.intParamVars |> var => - memberVariableDefine2(var, varToArrayIndexMapping, indexForUndefinedReferencesInt, useFlatArrayNotation, "Int", true) + memberVariableDefine2(var, varToArrayIndexMapping, indexForUndefinedReferencesInt, useFlatArrayNotation, createDebugCode, "Int", true) ;separator="\n"%> /*parameter bool vars*/ <%vars.boolParamVars |> var => - memberVariableDefine2(var, varToArrayIndexMapping, indexForUndefinedReferencesBool, useFlatArrayNotation, "Bool", true) + memberVariableDefine2(var, varToArrayIndexMapping, indexForUndefinedReferencesBool, useFlatArrayNotation, createDebugCode, "Bool", true) ;separator="\n"%> /*string parameter variables*/ <%vars.stringParamVars |> var => - memberVariableDefine2(var, varToArrayIndexMapping, "0", useFlatArrayNotation, "String", false) + memberVariableDefine2(var, varToArrayIndexMapping, "0", useFlatArrayNotation, createDebugCode, "String", false) ;separator="\n"%> /*string alias variables*/ <%vars.stringAliasVars |> var => - memberVariableDefine2(var, varToArrayIndexMapping, "0", useFlatArrayNotation, "String", false) + memberVariableDefine2(var, varToArrayIndexMapping, "0", useFlatArrayNotation, createDebugCode, "String", false) ;separator="\n"%> /*external variables*/ <%vars.extObjVars |> var => - memberVariableDefine2(var, varToArrayIndexMapping, indexForUndefinedReferencesReal, useFlatArrayNotation, "Real", false) + memberVariableDefine2(var, varToArrayIndexMapping, indexForUndefinedReferencesReal, useFlatArrayNotation, createDebugCode, "Real", false) ;separator="\n"%> /*alias real vars*/ <%vars.aliasVars |> var => - memberVariableDefine2(var, varToArrayIndexMapping, indexForUndefinedReferencesReal, useFlatArrayNotation, "Real", true) + memberVariableDefine2(var, varToArrayIndexMapping, indexForUndefinedReferencesReal, useFlatArrayNotation, createDebugCode, "Real", true) ;separator="\n"%> /*alias int vars*/ <%vars.intAliasVars |> var => - memberVariableDefine2(var, varToArrayIndexMapping, indexForUndefinedReferencesInt, useFlatArrayNotation, "Int", true) + memberVariableDefine2(var, varToArrayIndexMapping, indexForUndefinedReferencesInt, useFlatArrayNotation, createDebugCode, "Int", true) ;separator="\n"%> /*alias bool vars*/ <%vars.boolAliasVars |> var => - memberVariableDefine2(var, varToArrayIndexMapping, indexForUndefinedReferencesBool, useFlatArrayNotation, "Bool", true) + memberVariableDefine2(var, varToArrayIndexMapping, indexForUndefinedReferencesBool, useFlatArrayNotation, createDebugCode, "Bool", true) ;separator="\n"%> /*string algvars*/ <%vars.stringAlgVars |> var => - memberVariableDefine2(var, varToArrayIndexMapping, "0", useFlatArrayNotation, "String", true) + memberVariableDefine2(var, varToArrayIndexMapping, "0", useFlatArrayNotation, createDebugCode, "String", true) ;separator="\n"%> >> end memberVariableDefine; template memberVariableDefinePreVariables(ModelInfo modelInfo, HashTableCrIListArray.HashTable varToArrayIndexMapping, Text indexForUndefinedReferencesReal, Text indexForUndefinedReferencesInt, - Text indexForUndefinedReferencesBool, Boolean useFlatArrayNotation) + Text indexForUndefinedReferencesBool, Boolean createDebugCode, Boolean useFlatArrayNotation) "Define membervariable in simulation file." ::= match modelInfo @@ -7336,29 +7337,29 @@ case MODELINFO(vars=SIMVARS(__)) then //Variables saved for pre, edge and change operator /*real algvars*/ <%vars.algVars |> var => - memberVariableDefine2(var, varToArrayIndexMapping, indexForUndefinedReferencesReal, useFlatArrayNotation, "Real", true) + memberVariableDefine2(var, varToArrayIndexMapping, indexForUndefinedReferencesReal, useFlatArrayNotation, createDebugCode, "Real", true) ;separator="\n"%> /*discrete algvars*/ <%vars.discreteAlgVars |> var => - memberVariableDefine2(var, varToArrayIndexMapping, indexForUndefinedReferencesReal, useFlatArrayNotation, "Real", true) + memberVariableDefine2(var, varToArrayIndexMapping, indexForUndefinedReferencesReal, useFlatArrayNotation, createDebugCode, "Real", true) ;separator="\n"%> /*int algvars*/ <%vars.intAlgVars |> var => - memberVariableDefine2(var, varToArrayIndexMapping, indexForUndefinedReferencesInt, useFlatArrayNotation, "Int", true) + memberVariableDefine2(var, varToArrayIndexMapping, indexForUndefinedReferencesInt, useFlatArrayNotation, createDebugCode, "Int", true) ;separator="\n"%> /*bool algvars*/ <%vars.boolAlgVars |> var => - memberVariableDefine2(var, varToArrayIndexMapping, indexForUndefinedReferencesBool, useFlatArrayNotation, "Bool", true) + memberVariableDefine2(var, varToArrayIndexMapping, indexForUndefinedReferencesBool, useFlatArrayNotation, createDebugCode, "Bool", true) ;separator="\n"%> /*mixed array variables*/ <%vars.mixedArrayVars |> var => - memberVariableDefine2(var, varToArrayIndexMapping, indexForUndefinedReferencesReal, useFlatArrayNotation, "Real", true) + memberVariableDefine2(var, varToArrayIndexMapping, indexForUndefinedReferencesReal, useFlatArrayNotation, createDebugCode, "Real", true) ;separator="\n"%> >> end memberVariableDefinePreVariables; template memberVariableInitialize(ModelInfo modelInfo, HashTableCrIListArray.HashTable varToArrayIndexMapping, Text indexForUndefinedReferencesReal, Text indexForUndefinedReferencesInt, - Text indexForUndefinedReferencesBool, Boolean useFlatArrayNotation, Text& additionalConstructorVariables, Text& additionalFunctionDefinitions) + Text indexForUndefinedReferencesBool, Boolean createDebugCode, Boolean useFlatArrayNotation, Text& additionalConstructorVariables, Text& additionalFunctionDefinitions) ::= match modelInfo case MODELINFO(vars=SIMVARS(__),name=name) then @@ -7379,8 +7380,8 @@ template memberVariableInitialize(ModelInfo modelInfo, HashTableCrIListArray.Has << //AlgVars <%List.partition(vars.algVars, 100) |> varPartition hasindex i0 => - memberVariableInitializeWithSplit(varPartition, i0, "defineAlgVars", classname, varToArrayIndexMapping, indexForUndefinedReferencesReal, useFlatArrayNotation, "Real", - true, additionalAlgVarFunctionCalls,additionalConstructorVariables,additionalFunctionDefinitions) ;separator="\n"%> + memberVariableInitializeWithSplit(varPartition, i0, "defineAlgVars", classname, varToArrayIndexMapping, indexForUndefinedReferencesReal, useFlatArrayNotation, createDebugCode, "Real", + additionalAlgVarFunctionCalls,additionalConstructorVariables,additionalFunctionDefinitions) ;separator="\n"%> void <%classname%>::defineAlgVars() { @@ -7389,8 +7390,8 @@ template memberVariableInitialize(ModelInfo modelInfo, HashTableCrIListArray.Has //DiscreteAlgVars <%List.partition(vars.discreteAlgVars, 100) |> varPartition hasindex i0 => - memberVariableInitializeWithSplit(varPartition, i0, "defineDiscreteAlgVars", classname, varToArrayIndexMapping, indexForUndefinedReferencesReal, useFlatArrayNotation, "Real", - true, additionalDiscreteAlgVarFunctionCalls,additionalConstructorVariables,additionalFunctionDefinitions) ;separator="\n"%> + memberVariableInitializeWithSplit(varPartition, i0, "defineDiscreteAlgVars", classname, varToArrayIndexMapping, indexForUndefinedReferencesReal, useFlatArrayNotation, createDebugCode, "Real", + additionalDiscreteAlgVarFunctionCalls,additionalConstructorVariables,additionalFunctionDefinitions) ;separator="\n"%> void <%classname%>::defineDiscreteAlgVars() { @@ -7399,8 +7400,8 @@ template memberVariableInitialize(ModelInfo modelInfo, HashTableCrIListArray.Has //IntAlgVars <%List.partition(vars.intAlgVars, 100) |> varPartition hasindex i0 => - memberVariableInitializeWithSplit(varPartition, i0, "defineIntAlgVars", classname, varToArrayIndexMapping, indexForUndefinedReferencesInt, useFlatArrayNotation, "Int", - true, additionalIntAlgVarFunctionCalls,additionalConstructorVariables,additionalFunctionDefinitions) ;separator="\n"%> + memberVariableInitializeWithSplit(varPartition, i0, "defineIntAlgVars", classname, varToArrayIndexMapping, indexForUndefinedReferencesInt, useFlatArrayNotation, createDebugCode, "Int", + additionalIntAlgVarFunctionCalls,additionalConstructorVariables,additionalFunctionDefinitions) ;separator="\n"%> void <%classname%>::defineIntAlgVars() { <%additionalIntAlgVarFunctionCalls%> @@ -7408,8 +7409,8 @@ template memberVariableInitialize(ModelInfo modelInfo, HashTableCrIListArray.Has //BoolAlgVars <%List.partition(vars.boolAlgVars, 100) |> varPartition hasindex i0 => - memberVariableInitializeWithSplit(varPartition, i0, "defineBoolAlgVars", classname, varToArrayIndexMapping, indexForUndefinedReferencesBool, useFlatArrayNotation, "Bool", - true, additionalBoolAlgVarFunctionCalls,additionalConstructorVariables,additionalFunctionDefinitions) ;separator="\n"%> + memberVariableInitializeWithSplit(varPartition, i0, "defineBoolAlgVars", classname, varToArrayIndexMapping, indexForUndefinedReferencesBool, useFlatArrayNotation, createDebugCode, "Bool", + additionalBoolAlgVarFunctionCalls,additionalConstructorVariables,additionalFunctionDefinitions) ;separator="\n"%> void <%classname%>::defineBoolAlgVars() { <%additionalBoolAlgVarFunctionCalls%> @@ -7417,8 +7418,8 @@ template memberVariableInitialize(ModelInfo modelInfo, HashTableCrIListArray.Has //ParameterRealVars <%List.partition(vars.paramVars, 100) |> varPartition hasindex i0 => - memberVariableInitializeWithSplit(varPartition, i0, "defineParameterRealVars", classname, varToArrayIndexMapping, indexForUndefinedReferencesReal, useFlatArrayNotation, "Real", - true, additionalParameterRealVarFunctionCalls,additionalConstructorVariables,additionalFunctionDefinitions) ;separator="\n"%> + memberVariableInitializeWithSplit(varPartition, i0, "defineParameterRealVars", classname, varToArrayIndexMapping, indexForUndefinedReferencesReal, useFlatArrayNotation, createDebugCode, "Real", + additionalParameterRealVarFunctionCalls,additionalConstructorVariables,additionalFunctionDefinitions) ;separator="\n"%> void <%classname%>::defineParameterRealVars() { <%additionalParameterRealVarFunctionCalls%> @@ -7426,8 +7427,8 @@ template memberVariableInitialize(ModelInfo modelInfo, HashTableCrIListArray.Has //ParameterIntVars <%List.partition(vars.intParamVars, 100) |> varPartition hasindex i0 => - memberVariableInitializeWithSplit(varPartition, i0, "defineParameterIntVars", classname, varToArrayIndexMapping, indexForUndefinedReferencesInt, useFlatArrayNotation, "Int", - true, additionalParameterIntVarFunctionCalls,additionalConstructorVariables,additionalFunctionDefinitions) ;separator="\n"%> + memberVariableInitializeWithSplit(varPartition, i0, "defineParameterIntVars", classname, varToArrayIndexMapping, indexForUndefinedReferencesInt, useFlatArrayNotation, createDebugCode, "Int", + additionalParameterIntVarFunctionCalls,additionalConstructorVariables,additionalFunctionDefinitions) ;separator="\n"%> void <%classname%>::defineParameterIntVars() { <%additionalParameterIntVarFunctionCalls%> @@ -7435,8 +7436,8 @@ template memberVariableInitialize(ModelInfo modelInfo, HashTableCrIListArray.Has //ParameterBoolVars <%List.partition(vars.boolParamVars, 100) |> varPartition hasindex i0 => - memberVariableInitializeWithSplit(varPartition, i0, "defineParameterBoolVars", classname, varToArrayIndexMapping, indexForUndefinedReferencesBool, useFlatArrayNotation, "Bool", - true, additionalParameterBoolVarFunctionCalls,additionalConstructorVariables,additionalFunctionDefinitions) ;separator="\n"%> + memberVariableInitializeWithSplit(varPartition, i0, "defineParameterBoolVars", classname, varToArrayIndexMapping, indexForUndefinedReferencesBool, useFlatArrayNotation, createDebugCode, "Bool", + additionalParameterBoolVarFunctionCalls,additionalConstructorVariables,additionalFunctionDefinitions) ;separator="\n"%> void <%classname%>::defineParameterBoolVars() { <%additionalParameterBoolVarFunctionCalls%> @@ -7444,8 +7445,8 @@ template memberVariableInitialize(ModelInfo modelInfo, HashTableCrIListArray.Has //AliasRealVars <%List.partition(vars.aliasVars, 100) |> varPartition hasindex i0 => - memberVariableInitializeWithSplit(varPartition, i0, "defineAliasRealVars", classname, varToArrayIndexMapping, indexForUndefinedReferencesReal, useFlatArrayNotation, "Real", - true, additionalAliasRealVarFunctionCalls,additionalConstructorVariables,additionalFunctionDefinitions) ;separator="\n"%> + memberVariableInitializeWithSplit(varPartition, i0, "defineAliasRealVars", classname, varToArrayIndexMapping, indexForUndefinedReferencesReal, useFlatArrayNotation, createDebugCode, "Real", + additionalAliasRealVarFunctionCalls,additionalConstructorVariables,additionalFunctionDefinitions) ;separator="\n"%> void <%classname%>::defineAliasRealVars() { <%additionalAliasRealVarFunctionCalls%> @@ -7453,8 +7454,8 @@ template memberVariableInitialize(ModelInfo modelInfo, HashTableCrIListArray.Has //AliasIntVars <%List.partition(vars.intAliasVars, 100) |> varPartition hasindex i0 => - memberVariableInitializeWithSplit(varPartition, i0, "defineAliasIntVars", classname, varToArrayIndexMapping, indexForUndefinedReferencesInt, useFlatArrayNotation, "Int", - true, additionalAliasIntVarFunctionCalls,additionalConstructorVariables,additionalFunctionDefinitions) ;separator="\n"%> + memberVariableInitializeWithSplit(varPartition, i0, "defineAliasIntVars", classname, varToArrayIndexMapping, indexForUndefinedReferencesInt, useFlatArrayNotation, createDebugCode, "Int", + additionalAliasIntVarFunctionCalls,additionalConstructorVariables,additionalFunctionDefinitions) ;separator="\n"%> void <%classname%>::defineAliasIntVars() { <%additionalAliasIntVarFunctionCalls%> @@ -7462,8 +7463,8 @@ template memberVariableInitialize(ModelInfo modelInfo, HashTableCrIListArray.Has //AliasBoolVars <%List.partition(vars.boolAliasVars, 100) |> varPartition hasindex i0 => - memberVariableInitializeWithSplit(varPartition, i0, "defineAliasBoolVars", classname, varToArrayIndexMapping, indexForUndefinedReferencesBool, useFlatArrayNotation, "Bool", - true, additionalAliasBoolVarFunctionCalls,additionalConstructorVariables,additionalFunctionDefinitions) ;separator="\n"%> + memberVariableInitializeWithSplit(varPartition, i0, "defineAliasBoolVars", classname, varToArrayIndexMapping, indexForUndefinedReferencesBool, useFlatArrayNotation, createDebugCode, "Bool", + additionalAliasBoolVarFunctionCalls,additionalConstructorVariables,additionalFunctionDefinitions) ;separator="\n"%> void <%classname%>::defineAliasBoolVars() { <%additionalAliasBoolVarFunctionCalls%> @@ -7471,8 +7472,8 @@ template memberVariableInitialize(ModelInfo modelInfo, HashTableCrIListArray.Has //MixedArrayVars <%List.partition(vars.mixedArrayVars, 100) |> varPartition hasindex i0 => - memberVariableInitializeWithSplit(varPartition, i0, "defineMixedArrayVars", classname, varToArrayIndexMapping, indexForUndefinedReferencesReal, useFlatArrayNotation, "Real", - true, additionalMixedArrayVarFunctionCalls,additionalConstructorVariables,additionalFunctionDefinitions) ;separator="\n"%> + memberVariableInitializeWithSplit(varPartition, i0, "defineMixedArrayVars", classname, varToArrayIndexMapping, indexForUndefinedReferencesReal, useFlatArrayNotation, createDebugCode, "Real", + additionalMixedArrayVarFunctionCalls,additionalConstructorVariables,additionalFunctionDefinitions) ;separator="\n"%> void <%classname%>::defineMixedArrayVars() { <%additionalMixedArrayVarFunctionCalls%> @@ -7481,7 +7482,7 @@ template memberVariableInitialize(ModelInfo modelInfo, HashTableCrIListArray.Has end memberVariableInitialize; template memberVariableInitializeWithSplit(list simVars, Text idx, Text functionPrefix, Text className, HashTableCrIListArray.HashTable varToArrayIndexMapping, Text indexForUndefinedReferences, Boolean useFlatArrayNotation, - String type, Boolean createRefVar, Text& additionalFunctionCalls, Text& additionalConstructorVariables, Text& additionalFunctionDefinitions) + Boolean createDebugCode, String type, Text& additionalFunctionCalls, Text& additionalConstructorVariables, Text& additionalFunctionDefinitions) ::= let &additionalFunctionCalls += ' <%functionPrefix%>_<%idx%>();<%\n%>' let &additionalFunctionDefinitions += 'void <%functionPrefix%>_<%idx%>();<%\n%>' @@ -7489,23 +7490,25 @@ template memberVariableInitializeWithSplit(list simVars, Text idx, Text void <%className%>::<%functionPrefix%>_<%idx%>() { <%simVars |> var => - memberVariableInitialize2(var, varToArrayIndexMapping, indexForUndefinedReferences, useFlatArrayNotation, type, createRefVar, additionalConstructorVariables) + memberVariableInitialize2(var, varToArrayIndexMapping, indexForUndefinedReferences, useFlatArrayNotation, createDebugCode, type, additionalConstructorVariables) ;separator="\n"%> } >> end memberVariableInitializeWithSplit; template memberVariableInitialize2(SimVar simVar, HashTableCrIListArray.HashTable varToArrayIndexMapping, Text indexForUndefinedReferences, Boolean useFlatArrayNotation, - String type, Boolean createRefVar, Text& additionalConstructorVariables) + Boolean createDebugCode, String type, Text& additionalConstructorVariables) ::= - -match simVar + match simVar case SIMVAR(numArrayElement={},arrayCref=NONE(),name=CREF_IDENT(subscriptLst=_::_)) then '' - case SIMVAR(numArrayElement={},arrayCref=NONE()) then - //let index = '<%listHead(SimCodeUtil.getVarIndexListByMapping(varToArrayIndexMapping,name,indexForUndefinedReferences))%>' - //let &additionalConstructorVariables += ',<%cref(name,useFlatArrayNotation)%>(_sim_vars->init<%type%>Var(<%index%>))<%\n%>' - "" + case SIMVAR(numArrayElement={},arrayCref=NONE(),name=name) then + match(createDebugCode) + case true then + let index = '<%listHead(SimCodeUtil.getVarIndexListByMapping(varToArrayIndexMapping,name,indexForUndefinedReferences))%>' + let &additionalConstructorVariables += ',<%cref(name,useFlatArrayNotation)%>(_sim_vars->init<%type%>Var(<%index%>))<%\n%>' + "" + else "" case v as SIMVAR(name=CREF_IDENT(__),arrayCref=SOME(_),numArrayElement=num) case v as SIMVAR(name=CREF_QUAL(__),arrayCref=SOME(_),numArrayElement=num) then let &dims = buffer "" /*BUFD*/ @@ -7518,9 +7521,12 @@ match simVar else match dims case "0" then - //let index = '<%listHead(SimCodeUtil.getVarIndexListByMapping(varToArrayIndexMapping,name,indexForUndefinedReferences))%>' - //let& additionalConstructorVariables += ',<%arrayName%>(_sim_vars->init<%type%>Var(<%index%>))' - "" + match(createDebugCode) + case true then + let index = '<%listHead(SimCodeUtil.getVarIndexListByMapping(varToArrayIndexMapping,name,indexForUndefinedReferences))%>' + let& additionalConstructorVariables += ',<%arrayName%>(_sim_vars->init<%type%>Var(<%index%>))' + "" + else "" else let size = Util.mulStringDelimit2Int(array_num_elem,",") if SimCodeUtil.isVarIndexListConsecutive(varToArrayIndexMapping,name) then @@ -7543,9 +7549,12 @@ match simVar let varType = variableType(type_) match dims case "0" then - //let index = '<%listHead(SimCodeUtil.getVarIndexListByMapping(varToArrayIndexMapping,name,indexForUndefinedReferences))%>' - //let& additionalConstructorVariables += ',<%varName%>(_sim_vars->init<%type%>Var(<%index%>))' - "" + match createDebugCode + case true then + let index = '<%listHead(SimCodeUtil.getVarIndexListByMapping(varToArrayIndexMapping,name,indexForUndefinedReferences))%>' + let& additionalConstructorVariables += ',<%varName%>(_sim_vars->init<%type%>Var(<%index%>))' + "" + else "" else '' end match end memberVariableInitialize2; @@ -7740,24 +7749,25 @@ end memberVariableDefineReference; template memberVariableDefine2(SimVar simVar, HashTableCrIListArray.HashTable varToArrayIndexMapping, Text indexForUndefinedReferences, - Boolean useFlatArrayNotation, String type, Boolean createRefVar) + Boolean useFlatArrayNotation, Boolean createDebugCode, String type, Boolean createRefVar) ::= match simVar case SIMVAR(numArrayElement={},arrayCref=NONE(),name=CREF_IDENT(subscriptLst=_::_)) then '' - case SIMVAR(numArrayElement={},arrayCref=NONE()) then - /* - << - <%variableType(type_)%><%if createRefVar then '&' else ''%> <%cref(name,useFlatArrayNotation)%>; - >> - */ - if createRefVar then - let index = '<%listHead(SimCodeUtil.getVarIndexListByMapping(varToArrayIndexMapping,name,indexForUndefinedReferences))%>' - << - #define <%cref(name,useFlatArrayNotation)%> _pointerTo<%type%>Vars[<%index%>] - >> - else - '<%variableType(type_)%> <%cref(name,useFlatArrayNotation)%>;' + case SIMVAR(numArrayElement={},arrayCref=NONE(),name=name,type_=type_) then + match createDebugCode + case true then + << + <%variableType(type_)%><%if createRefVar then '&' else ''%> <%cref(name,useFlatArrayNotation)%>; + >> + else + if createRefVar then + let index = '<%listHead(SimCodeUtil.getVarIndexListByMapping(varToArrayIndexMapping,name,indexForUndefinedReferences))%>' + << + #define <%cref(name,useFlatArrayNotation)%> _pointerTo<%type%>Vars[<%index%>] + >> + else + '<%variableType(type_)%> <%cref(name,useFlatArrayNotation)%>;' case v as SIMVAR(name=CREF_IDENT(__),arrayCref=SOME(_),numArrayElement=num) case v as SIMVAR(name=CREF_QUAL(__),arrayCref=SOME(_),numArrayElement=num) then @@ -7767,18 +7777,19 @@ template memberVariableDefine2(SimVar simVar, HashTableCrIListArray.HashTable va let array_dimensions = arrayextentDims(name, v.numArrayElement) match dims case "0" then - /* - << - <%typeString%><%if createRefVar then '&' else ''%> <%arrayName%>; - >> - */ - if createRefVar then - let index = '<%listHead(SimCodeUtil.getVarIndexListByMapping(varToArrayIndexMapping,name,indexForUndefinedReferences))%>' - << - #define <%arrayName%> _pointerTo<%type%>Vars[<%index%>] - >> - else - '<%typeString%> <%arrayName%>;' + match createDebugCode + case true then + << + <%typeString%><%if createRefVar then '&' else ''%> <%arrayName%>; + >> + else + if createRefVar then + let index = '<%listHead(SimCodeUtil.getVarIndexListByMapping(varToArrayIndexMapping,name,indexForUndefinedReferences))%>' + << + #define <%arrayName%> _pointerTo<%type%>Vars[<%index%>] + >> + else + '<%typeString%> <%arrayName%>;' else if SimCodeUtil.isVarIndexListConsecutive(varToArrayIndexMapping,name) then << @@ -7795,12 +7806,15 @@ template memberVariableDefine2(SimVar simVar, HashTableCrIListArray.HashTable va let varType = variableType(type_) match dims case "0" then - //'<%varType%><%if createRefVar then '&' else ''%> <%varName%>;' - if createRefVar then - let index = '<%listHead(SimCodeUtil.getVarIndexListByMapping(varToArrayIndexMapping,name,indexForUndefinedReferences))%>' - '#define <%varName%> _pointerTo<%type%>Vars[<%index%>]' - else - '<%varType%> <%varName%>;' + match createDebugCode + case true then + '<%varType%><%if createRefVar then '&' else ''%> <%varName%>;' + else + if createRefVar then + let index = '<%listHead(SimCodeUtil.getVarIndexListByMapping(varToArrayIndexMapping,name,indexForUndefinedReferences))%>' + '#define <%varName%> _pointerTo<%type%>Vars[<%index%>]' + else + '<%varType%> <%varName%>;' else '' end match end memberVariableDefine2; @@ -15283,9 +15297,6 @@ template algStatement(DAE.Statement stmt, Context context, Text &varDecls,SimCod <%res%> <%endModelicaLine()%> >> - - - end algStatement; template algStmtWhile(DAE.Statement stmt, Context context, Text &varDecls /*BUFP*/,SimCode simCode ,Text& extraFuncs,Text& extraFuncsDecl, Text extraFuncsNamespace, Text stateDerVectorName /*=__zDot*/, Boolean useFlatArrayNotation) diff --git a/Compiler/Template/CodegenCppHpcom.tpl b/Compiler/Template/CodegenCppHpcom.tpl index f8a9ddff265..518a17a70f7 100644 --- a/Compiler/Template/CodegenCppHpcom.tpl +++ b/Compiler/Template/CodegenCppHpcom.tpl @@ -25,10 +25,10 @@ template translateModel(SimCode simCode) let useMemoryOptimization = Flags.isSet(Flags.HPCOM_MEMORY_OPT) let className = lastIdentOfPath(modelInfo.name) - let numRealVars = numRealvars(modelInfo, hpcomData.hpcOmMemory) - let numIntVars = numIntvars(modelInfo, hpcomData.hpcOmMemory) - let numBoolVars = numBoolvars(modelInfo, hpcomData.hpcOmMemory) - let numPreVars = getPreVarsCount(modelInfo, hpcomData.hpcOmMemory) + let numRealVars = numRealvarsHpcom(modelInfo, hpcomData.hpcOmMemory) + let numIntVars = numIntvarsHpcom(modelInfo, hpcomData.hpcOmMemory) + let numBoolVars = numBoolvarsHpcom(modelInfo, hpcomData.hpcOmMemory) + let numPreVars = numPreVarsHpcom(modelInfo, hpcomData.hpcOmMemory) let() = textFile(simulationMainFile(target, simCode, &extraFuncs, &extraFuncsDecl, "", (if Flags.isSet(USEMPI) then "#include " else ""), @@ -36,19 +36,19 @@ template translateModel(SimCode simCode) (if Flags.isSet(USEMPI) then mpiFinalize() else ""), numRealVars, numIntVars, numBoolVars, numPreVars), 'OMCpp<%fileNamePrefix%>Main.cpp') - let() = textFile(simulationCppFile(simCode, contextOther, update(allEquations, whenClauses, simCode, &extraFuncs, &extraFuncsDecl, "", contextOther, stateDerVectorName, false), + let() = textFile(simulationCppFile(simCode, contextOther, updateHpcom(allEquations, whenClauses, simCode, &extraFuncs, &extraFuncsDecl, "", contextOther, stateDerVectorName, false), '<%numRealVars%>-1', '<%numIntVars%>-1', '<%numBoolVars%>-1', &extraFuncs, &extraFuncsDecl, className, - generateAdditionalConstructorDefinitions(hpcomData.schedules), - generateAdditionalConstructorBodyStatements(hpcomData.schedules, className, dotPath(modelInfo.name)), - generateAdditionalDestructorBodyStatements(hpcomData.schedules), + additionalHpcomConstructorDefinitions(hpcomData.schedules), + additionalHpcomConstructorBodyStatements(hpcomData.schedules, className, dotPath(modelInfo.name)), + additionalHpcomDestructorBodyStatements(hpcomData.schedules), stateDerVectorName, false), 'OMCpp<%fileNamePrefix%>.cpp') let() = textFile(simulationHeaderFile(simCode ,contextOther, &extraFuncs, &extraFuncsDecl, "", - generateAdditionalIncludes(simCode, &extraFuncs, &extraFuncsDecl, className, false), + additionalHpcomIncludes(simCode, &extraFuncs, &extraFuncsDecl, className, false), "", - generateAdditionalProtectedMemberDeclaration(simCode, &extraFuncs, &extraFuncsDecl, "", false), - memberVariableDefine(modelInfo, varToArrayIndexMapping, '<%numRealVars%>-1', '<%numIntVars%>-1', '<%numBoolVars%>-1', false), - memberVariableDefinePreVariables(modelInfo, varToArrayIndexMapping, '<%numRealVars%>-1', '<%numIntVars%>-1', '<%numBoolVars%>-1', false), false), + additionalHpcomProtectedMemberDeclaration(simCode, &extraFuncs, &extraFuncsDecl, "", false), + memberVariableDefine(modelInfo, varToArrayIndexMapping, '<%numRealVars%>-1', '<%numIntVars%>-1', '<%numBoolVars%>-1', Flags.isSet(Flags.GEN_DEBUG_SYMBOLS), false), + memberVariableDefinePreVariables(modelInfo, varToArrayIndexMapping, '<%numRealVars%>-1', '<%numIntVars%>-1', '<%numBoolVars%>-1', Flags.isSet(Flags.GEN_DEBUG_SYMBOLS), false), false), //CodegenCpp.MemberVariablePreVariables(modelInfo,false), false), 'OMCpp<%fileNamePrefix%>.h') @@ -93,18 +93,18 @@ template translateModel(SimCode simCode) end translateModel; // HEADER -template generateAdditionalIncludes(SimCode simCode, Text& extraFuncs, Text& extraFuncsDecl, Text extraFuncsNamespace, Boolean useFlatArrayNotation) +template additionalHpcomIncludes(SimCode simCode, Text& extraFuncs, Text& extraFuncsDecl, Text extraFuncsNamespace, Boolean useFlatArrayNotation) "Generates code for header file for simulation target." ::= match simCode case SIMCODE(__) then << - <%generateAdditionalIncludesForParallelCode(simCode, extraFuncs, extraFuncsDecl, extraFuncsNamespace)%> + <%additionalHpcomIncludesForParallelCode(simCode, extraFuncs, extraFuncsDecl, extraFuncsNamespace)%> >> end match -end generateAdditionalIncludes; +end additionalHpcomIncludes; -template generateAdditionalIncludesForParallelCode(SimCode simCode, Text& extraFuncs, Text& extraFuncsDecl, Text extraFuncsNamespace) +template additionalHpcomIncludesForParallelCode(SimCode simCode, Text& extraFuncs, Text& extraFuncsDecl, Text extraFuncsNamespace) ::= let type = getConfigString(HPCOM_CODE) match type @@ -139,9 +139,9 @@ template generateAdditionalIncludesForParallelCode(SimCode simCode, Text& extraF #include >> end match -end generateAdditionalIncludesForParallelCode; +end additionalHpcomIncludesForParallelCode; -template generateAdditionalProtectedMemberDeclaration(SimCode simCode, Text& extraFuncs, Text& extraFuncsDecl, Text extraFuncsNamespace, Boolean useFlatArrayNotation) +template additionalHpcomProtectedMemberDeclaration(SimCode simCode, Text& extraFuncs, Text& extraFuncsDecl, Text extraFuncsNamespace, Boolean useFlatArrayNotation) "Generates class declarations." ::= match simCode @@ -196,7 +196,7 @@ template generateAdditionalProtectedMemberDeclaration(SimCode simCode, Text& ext >>%> >> end match -end generateAdditionalProtectedMemberDeclaration; +end additionalHpcomProtectedMemberDeclaration; template generateAdditionalStructHeaders(Schedule odeSchedule) ::= @@ -407,7 +407,7 @@ template generateThreadFunctionHeaderDecl(Integer threadIdx) >> end generateThreadFunctionHeaderDecl; -template generateAdditionalConstructorDefinitions(Option> scheduleOpt) +template additionalHpcomConstructorDefinitions(Option> scheduleOpt) ::= let type = getConfigString(HPCOM_CODE) match scheduleOpt @@ -435,9 +435,9 @@ template generateAdditionalConstructorDefinitions(Option> schedulesOpt, String modelNamePrefixStr, String fullModelName) +template additionalHpcomConstructorBodyStatements(Option> schedulesOpt, String modelNamePrefixStr, String fullModelName) ::= let type = getConfigString(HPCOM_CODE) match schedulesOpt @@ -524,7 +524,7 @@ template generateAdditionalConstructorBodyStatements(Option> end destroyArrayLocks; -template generateAdditionalDestructorBodyStatements(Option> schedulesOpt) +template additionalHpcomDestructorBodyStatements(Option> schedulesOpt) ::= let type = getConfigString(HPCOM_CODE) match schedulesOpt @@ -694,29 +694,27 @@ template generateAdditionalDestructorBodyStatements(Option allEquationsPlusWhen, list whenClauses, SimCode simCode, Text& extraFuncs, Text& extraFuncsDecl, Text extraFuncsNamespace, Context context, Text stateDerVectorName /*=__zDot*/, Boolean useFlatArrayNotation) +template updateHpcom(list allEquationsPlusWhen, list whenClauses, SimCode simCode, Text& extraFuncs, Text& extraFuncsDecl, Text extraFuncsNamespace, Context context, Text stateDerVectorName /*=__zDot*/, Boolean useFlatArrayNotation) ::= let &varDecls = buffer "" /*BUFD*/ match simCode case SIMCODE(modelInfo = MODELINFO(__), hpcomData=HPCOMDATA(__)) then - let parCode = generateParallelEvaluate(allEquationsPlusWhen, modelInfo.name, whenClauses, simCode, extraFuncs ,extraFuncsDecl, extraFuncsNamespace, hpcomData.schedules, context, stateDerVectorName, lastIdentOfPath(modelInfo.name), useFlatArrayNotation) + let &extraFuncsPar = buffer "" + let parCode = generateParallelEvaluate(allEquationsPlusWhen, modelInfo.name, whenClauses, simCode, extraFuncsPar ,extraFuncsDecl, extraFuncsNamespace, hpcomData.schedules, context, stateDerVectorName, lastIdentOfPath(modelInfo.name), useFlatArrayNotation) << <%equationFunctions(allEquations,whenClauses, simCode, &extraFuncs, &extraFuncsDecl, extraFuncsNamespace, contextSimulationDiscrete,stateDerVectorName,useFlatArrayNotation,false)%> <%createEvaluateConditions(allEquations,whenClauses, simCode, &extraFuncs, &extraFuncsDecl, extraFuncsNamespace, contextOther, stateDerVectorName, useFlatArrayNotation)%> - /* - <%createEvaluateZeroFuncs(equationsForZeroCrossings,simCode , &extraFuncs , &extraFuncsDecl, extraFuncsNamespace,contextOther)%> - <%createEvaluateAll(allEquations,whenClauses,simCode , &extraFuncs , &extraFuncsDecl, extraFuncsNamespace,contextOther, stateDerVectorName, useFlatArrayNotation, boolNot(stringEq(getConfigString(PROFILING_LEVEL),"none")))%> - */ <%parCode%> + + <%extraFuncsPar%> >> end match -end update; +end updateHpcom; template generateParallelEvaluate(list allEquationsPlusWhen, Absyn.Path name, list whenClauses, SimCode simCode, Text& extraFuncs, Text& extraFuncsDecl, Text extraFuncsNamespace, Option> schedulesOpt, Context context, Text stateDerVectorName /*=__zDot*/, @@ -1880,41 +1878,41 @@ template simulationMakefile(String target, SimCode simCode, Text& extraFuncs, Te additionalLinkerFlags_MSVC, Flags.isSet(Flags.USEMPI)) end simulationMakefile; -template getPreVarsCount(ModelInfo modelInfo, Option hpcOmMemoryOpt) +template numPreVarsHpcom(ModelInfo modelInfo, Option hpcOmMemoryOpt) ::= match(hpcOmMemoryOpt) case(SOME(hpcomMemory as MEMORYMAP_ARRAY(floatArraySize=floatArraySize,intArraySize=intArraySize,boolArraySize=boolArraySize))) then '<%floatArraySize%> + <%intArraySize%> + <%boolArraySize%>' else CodegenCpp.getPreVarsCount(modelInfo) -end getPreVarsCount; +end numPreVarsHpcom; -template numRealvars(ModelInfo modelInfo, Option hpcOmMemoryOpt) +template numRealvarsHpcom(ModelInfo modelInfo, Option hpcOmMemoryOpt) ::= match(hpcOmMemoryOpt) case(SOME(hpcomMemory as MEMORYMAP_ARRAY(floatArraySize=floatArraySize))) then '<%floatArraySize%>' else '<%CodegenCpp.numRealvars(modelInfo)%>' -end numRealvars; +end numRealvarsHpcom; -template numIntvars(ModelInfo modelInfo, Option hpcOmMemoryOpt) +template numIntvarsHpcom(ModelInfo modelInfo, Option hpcOmMemoryOpt) ::= match(hpcOmMemoryOpt) case(SOME(hpcomMemory as MEMORYMAP_ARRAY(intArraySize=intArraySize))) then '<%intArraySize%>' else CodegenCpp.numIntvars(modelInfo) -end numIntvars; +end numIntvarsHpcom; -template numBoolvars(ModelInfo modelInfo, Option hpcOmMemoryOpt) +template numBoolvarsHpcom(ModelInfo modelInfo, Option hpcOmMemoryOpt) ::= match(hpcOmMemoryOpt) case(SOME(hpcomMemory as MEMORYMAP_ARRAY(boolArraySize=boolArraySize))) then '<%boolArraySize%>' else CodegenCpp.numBoolvars(modelInfo) -end numBoolvars; +end numBoolvarsHpcom; annotation(__OpenModelica_Interface="backend"); end CodegenCppHpcom; diff --git a/Compiler/Template/CodegenCppInit.tpl b/Compiler/Template/CodegenCppInit.tpl index b605d929f3d..9a8a766ca02 100644 --- a/Compiler/Template/CodegenCppInit.tpl +++ b/Compiler/Template/CodegenCppInit.tpl @@ -1,55 +1,77 @@ package CodegenCppInit import interface SimCodeTV; +import interface SimCodeBackendTV; import CodegenUtil.*; +import CodegenFMUCommon; +import CodegenFMU2; +import CodegenFMU1; -template modelInitXMLFile(SimCode simCode, String numRealVars, String numIntVars, String numBoolVars) +template modelInitXMLFile(SimCode simCode, String numRealVars, String numIntVars, String numBoolVars, String FMUVersion, String FMUType, String FMUGuid, Boolean generateFMUModelDescription, String generatorComments) + "Generate a xml file that contains informations for initialization or for the FMU-structure" ::= match simCode case SIMCODE(modelInfo = MODELINFO(__)) then - let variables = modelVariablesXML(modelInfo, varToArrayIndexMapping, '<%numRealVars%> - 1', '<%numIntVars%> - 1', '<%numBoolVars%> - 1') + let variables = modelVariablesXML(modelInfo, varToArrayIndexMapping, '<%numRealVars%> - 1', '<%numIntVars%> - 1', '<%numBoolVars%> - 1', generateFMUModelDescription) let algLoops = (listAppend(allEquations,initialEquations) |> eq => algLoopXML(eq, simCode, varToArrayIndexMapping, '<%numRealVars%> - 1') ;separator="\n") let jacobianMatrixes = jacobianMatrixesXML(simCode.jacobianMatrixes) + let descriptionTag = if generateFMUModelDescription then "fmiModelDescription" else "ModelDescription" + let fmiDescriptionAttributes = if generateFMUModelDescription then fmuDescriptionAttributes(simCode, FMUVersion, FMUType, FMUGuid) else 'modelName="<%dotPath(modelInfo.name)%>"' + let fmiTypeDefinitions = if generateFMUModelDescription then CodegenFMUCommon.fmiTypeDefinitions(modelInfo, FMUVersion) + let fmiDefaultExperiment = if generateFMUModelDescription then CodegenFMUCommon.DefaultExperiment(simulationSettingsOpt) << - - + + + <<%descriptionTag%> <%fmiDescriptionAttributes%>> + <%fmiTypeDefinitions%> + <%fmiDefaultExperiment%> <%variables%> + <%if boolNot(generateFMUModelDescription) then + << <%algLoops%> <%jacobianMatrixes%> - + >> + %> + > >> end modelInitXMLFile; -template modelVariablesXML(ModelInfo modelInfo, HashTableCrIListArray.HashTable varToArrayIndexMapping, String indexForUndefinedReferencesReal, String indexForUndefinedReferencesInt, String indexForUndefinedReferencesBool) +template fmuDescriptionAttributes(SimCode simCode, String FMUVersion, String FMUType, String FMUGuid) +::= + if isFMIVersion20(FMUVersion) then CodegenFMU2.fmiModelDescriptionAttributes(simCode,FMUGuid) + else CodegenFMU1.fmiModelDescriptionAttributes(simCode,FMUGuid) +end fmuDescriptionAttributes; + +template modelVariablesXML(ModelInfo modelInfo, HashTableCrIListArray.HashTable varToArrayIndexMapping, String indexForUndefinedReferencesReal, String indexForUndefinedReferencesInt, String indexForUndefinedReferencesBool, Boolean generateFMUModelDescription) "Generates the xml code for the variable defintions." ::= match modelInfo case MODELINFO(vars=SIMVARS(__),varInfo=VARINFO(numAlgVars= numAlgVars, numDiscreteReal = numDiscreteReal, numOptimizeConstraints = numOptimizeConstraints)) then << - <%vars.stateVars |> var => scalarVariableXML(var, varToArrayIndexMapping, indexForUndefinedReferencesReal) ;separator="\n";empty%> - <%vars.derivativeVars |> var => scalarVariableXML(var, varToArrayIndexMapping, indexForUndefinedReferencesReal) ;separator="\n";empty%> - <%vars.algVars |> var => scalarVariableXML(var, varToArrayIndexMapping, indexForUndefinedReferencesReal) ;separator="\n";empty%> - <%vars.discreteAlgVars |> var => scalarVariableXML(var, varToArrayIndexMapping, indexForUndefinedReferencesReal) ;separator="\n";empty%> + <%vars.stateVars |> var => scalarVariableXML(var, varToArrayIndexMapping, indexForUndefinedReferencesReal, generateFMUModelDescription) ;separator="\n";empty%> + <%vars.derivativeVars |> var => scalarVariableXML(var, varToArrayIndexMapping, indexForUndefinedReferencesReal, generateFMUModelDescription) ;separator="\n";empty%> + <%vars.algVars |> var => scalarVariableXML(var, varToArrayIndexMapping, indexForUndefinedReferencesReal, generateFMUModelDescription) ;separator="\n";empty%> + <%vars.discreteAlgVars |> var => scalarVariableXML(var, varToArrayIndexMapping, indexForUndefinedReferencesReal, generateFMUModelDescription) ;separator="\n";empty%> <%/*vars.realOptimizeConstraintsVars - |> var hasindex i0 => scalarVariableXML(var,varToArrayIndexMapping, indexForUndefinedReferencesReal) ;separator="\n";empty*/%> + |> var hasindex i0 => scalarVariableXML(var,varToArrayIndexMapping, indexForUndefinedReferencesReal, generateFMUModelDescription) ;separator="\n";empty*/%> <%/*vars.realOptimizeFinalConstraintsVars - |> var => scalarVariableXML(var,varToArrayIndexMapping, indexForUndefinedReferencesReal) ;separator="\n";empty*/%> - <%vars.paramVars |> var => scalarVariableXML(var,varToArrayIndexMapping, indexForUndefinedReferencesReal) ;separator="\n";empty%> - <%vars.aliasVars |> var => scalarVariableXML(var,varToArrayIndexMapping, indexForUndefinedReferencesReal) ;separator="\n";empty%> + |> var => scalarVariableXML(var,varToArrayIndexMapping, indexForUndefinedReferencesReal, generateFMUModelDescription) ;separator="\n";empty*/%> + <%vars.paramVars |> var => scalarVariableXML(var,varToArrayIndexMapping, indexForUndefinedReferencesReal, generateFMUModelDescription) ;separator="\n";empty%> + <%vars.aliasVars |> var => scalarVariableXML(var,varToArrayIndexMapping, indexForUndefinedReferencesReal, generateFMUModelDescription) ;separator="\n";empty%> - <%vars.intAlgVars |> var => scalarVariableXML(var,varToArrayIndexMapping, indexForUndefinedReferencesInt) ;separator="\n";empty%> - <%vars.intParamVars |> var => scalarVariableXML(var,varToArrayIndexMapping, indexForUndefinedReferencesInt) ;separator="\n";empty%> - <%vars.intAliasVars |> var => scalarVariableXML(var,varToArrayIndexMapping, indexForUndefinedReferencesInt) ;separator="\n";empty%> + <%vars.intAlgVars |> var => scalarVariableXML(var,varToArrayIndexMapping, indexForUndefinedReferencesInt, generateFMUModelDescription) ;separator="\n";empty%> + <%vars.intParamVars |> var => scalarVariableXML(var,varToArrayIndexMapping, indexForUndefinedReferencesInt, generateFMUModelDescription) ;separator="\n";empty%> + <%vars.intAliasVars |> var => scalarVariableXML(var,varToArrayIndexMapping, indexForUndefinedReferencesInt, generateFMUModelDescription) ;separator="\n";empty%> - <%vars.boolAlgVars |> var => scalarVariableXML(var,varToArrayIndexMapping, indexForUndefinedReferencesBool) ;separator="\n";empty%> - <%vars.boolParamVars |> var => scalarVariableXML(var,varToArrayIndexMapping, indexForUndefinedReferencesBool) ;separator="\n";empty%> - <%vars.boolAliasVars |> var => scalarVariableXML(var,varToArrayIndexMapping, indexForUndefinedReferencesBool) ;separator="\n";empty%> + <%vars.boolAlgVars |> var => scalarVariableXML(var,varToArrayIndexMapping, indexForUndefinedReferencesBool, generateFMUModelDescription) ;separator="\n";empty%> + <%vars.boolParamVars |> var => scalarVariableXML(var,varToArrayIndexMapping, indexForUndefinedReferencesBool, generateFMUModelDescription) ;separator="\n";empty%> + <%vars.boolAliasVars |> var => scalarVariableXML(var,varToArrayIndexMapping, indexForUndefinedReferencesBool, generateFMUModelDescription) ;separator="\n";empty%> >> /* <%vars.stringAlgVars |> var hasindex i0 => ScalarVariable(var,i0,"sAlg") ;separator="\n";empty%> @@ -58,31 +80,46 @@ template modelVariablesXML(ModelInfo modelInfo, HashTableCrIListArray.HashTable */ end modelVariablesXML; -template scalarVariableXML(SimVar simVar, HashTableCrIListArray.HashTable varToArrayIndexMapping, String indexForUndefinedReferences) +template scalarVariableXML(SimVar simVar, HashTableCrIListArray.HashTable varToArrayIndexMapping, String indexForUndefinedReferences, Boolean generateFMUModelDescription) "Generates code for ScalarVariable file for FMU target." ::= match simVar case SIMVAR(__) then + let variableCode = if generateFMUModelDescription then CodegenFMUCommon.ScalarVariableType(simVar) else + ScalarVariableType(unit, displayUnit, minValue, maxValue, initialValue, nominalValue, isFixed, type_) << - > - <%ScalarVariableType(unit, displayUnit, minValue, maxValue, initialValue, nominalValue, isFixed, type_)%> + > + <%variableCode%> >> end scalarVariableXML; -template scalarVariableAttributeXML(SimVar simVar, HashTableCrIListArray.HashTable varToArrayIndexMapping, String indexForUndefinedReferences) +template scalarVariableAttributeXML(SimVar simVar, HashTableCrIListArray.HashTable varToArrayIndexMapping, String indexForUndefinedReferences, Boolean generateFMUModelDescription) "Generates code for ScalarVariable Attribute file for FMU target." ::= match simVar case SIMVAR(source = SOURCE(info = info)) then - let valueReference = SimCodeUtil.getVarIndexListByMapping(varToArrayIndexMapping,name,indexForUndefinedReferences) + let valueReference = SimCodeUtil.getVarIndexByMapping(varToArrayIndexMapping,name,indexForUndefinedReferences) + let alias = getAliasVar(aliasvar) + let causalityAtt = CodegenFMUCommon.getCausality(causality) let variability = getVariablity(varKind) - let description = if comment then 'description = "<%Util.escapeModelicaStringToXmlString(comment)%>"' + let description = if comment then 'description="<%Util.escapeModelicaStringToXmlString(comment)%>"' + let additionalAttributes = if generateFMUModelDescription then '' else 'isProtected="<%isProtected%>' << - name = "<%Util.escapeModelicaStringToXmlString(crefStrNoUnderscore(name))%>" valueReference = "<%valueReference%>" <%description%> variability = "<%variability%>" isProtected = "<%isProtected%>" + name="<%Util.escapeModelicaStringToXmlString(crefStrNoUnderscore(name))%>" valueReference="<%valueReference%>" <%description%> variability="<%variability%>" causality="<%causalityAtt%>" alias="<%alias%>" <%additionalAttributes%> >> end scalarVariableAttributeXML; +template getAliasVar(AliasVariable aliasvar) + "Returns the alias Attribute of ScalarVariable." + ::= + match aliasvar + case NOALIAS(__) then "noAlias" + case ALIAS(__) then "alias" + case NEGATEDALIAS(__) then "negatedAlias" + else "noAlias" +end getAliasVar; + template algLoopXML(SimEqSystem eqs, SimCode simCode, HashTableCrIListArray.HashTable varToArrayIndexMapping, String indexForUndefinedReferences) ::= << diff --git a/Compiler/Template/CodegenFMUCppHpcom.tpl b/Compiler/Template/CodegenFMUCppHpcom.tpl new file mode 100644 index 00000000000..93b433ba862 --- /dev/null +++ b/Compiler/Template/CodegenFMUCppHpcom.tpl @@ -0,0 +1,109 @@ +// This file defines templates for transforming Modelica/MetaModelica code to FMU +// code. They are used in the code generator phase of the compiler to write +// target code. +// +// There are one root template intended to be called from the code generator: +// translateModel. These template do not return any +// result but instead write the result to files. All other templates return +// text and are used by the root templates (most of them indirectly). +// +// To future maintainers of this file: +// +// - A line like this +// # var = "" /*BUFD*/ +// declares a text buffer that you can later append text to. It can also be +// passed to other templates that in turn can append text to it. In the new +// version of Susan it should be written like this instead: +// let &var = buffer "" +// +// - A line like this +// ..., Text var /*BUFP*/, ... +// declares that a template takes a text buffer as input parameter. In the +// new version of Susan it should be written like this instead: +// ..., Text &var, ... +// +// - A line like this: +// ..., var /*BUFC*/, ... +// passes a text buffer to a template. In the new version of Susan it should +// be written like this instead: +// ..., &var, ... +// +// - Style guidelines: +// +// - Try (hard) to limit each row to 80 characters +// +// - Code for a template should be indented with 2 spaces +// +// - Exception to this rule is if you have only a single case, then that +// single case can be written using no indentation +// +// This single case can be seen as a clarification of the input to the +// template +// +// - Code after a case should be indented with 2 spaces if not written on the +// same line + +package CodegenFMUCppHpcom + + + +import interface SimCodeBackendTV; +import interface SimCodeTV; +import CodegenFMUCpp.*; +import CodegenCppHpcom.*; +import CodegenUtil; +import CodegenCpp; +import CodegenCppInit; + +template translateModel(SimCode simCode, String FMUVersion, String FMUType) + "Generates C++ code and Makefile for compiling an FMU of a Modelica model. + Calls CodegenCpp.translateModel for the actual model code." +::= + match simCode + case SIMCODE(modelInfo = MODELINFO(__), makefileParams = MAKEFILE_PARAMS(__), hpcomData = HPCOMDATA(__)) then + let guid = getUUIDStr() + let target = simulationCodeTarget() + let stateDerVectorName = "__zDot" + let &extraFuncs = buffer "" /*BUFD*/ + let &extraFuncsDecl = buffer "" /*BUFD*/ + + let className = CodegenCpp.lastIdentOfPath(modelInfo.name) + let numRealVars = numRealvarsHpcom(modelInfo, hpcomData.hpcOmMemory) + let numIntVars = numIntvarsHpcom(modelInfo, hpcomData.hpcOmMemory) + let numBoolVars = numBoolvarsHpcom(modelInfo, hpcomData.hpcOmMemory) + let numPreVars = numPreVarsHpcom(modelInfo, hpcomData.hpcOmMemory) + + let()= textFile(CodegenCppInit.modelInitXMLFile(simCode, numRealVars, numIntVars, numBoolVars, FMUVersion, FMUType, guid, true, "hpcom cpp-runtime"), 'modelDescription.xml') + let cpp = CodegenCpp.translateModel(simCode) + let()= textFile(fmuWriteOutputHeaderFile(simCode , &extraFuncs , &extraFuncsDecl, ""),'OMCpp<%fileNamePrefix%>WriteOutput.h') + let()= textFile(fmuModelHeaderFile(simCode, extraFuncs, extraFuncsDecl, "",guid, FMUVersion), 'OMCpp<%fileNamePrefix%>FMU.h') + let()= textFile(fmuModelCppFile(simCode, extraFuncs, extraFuncsDecl, "",guid, FMUVersion), 'OMCpp<%fileNamePrefix%>FMU.cpp') + //let()= textFile(modelInitXMLFile(simCode, numRealVars, numIntVars, numBoolVars, true, FMUVersion, FMUType, guid), '') + // Def file is only used on windows, to define exported symbols + //let()= textFile(fmudeffile(simCode, FMUVersion), '<%fileNamePrefix%>.def') + let()= textFile(fmuMakefile(target,simCode, extraFuncs, extraFuncsDecl, "", FMUVersion), '<%fileNamePrefix%>_FMU.makefile') + let()= textFile(fmuCalcHelperMainfile(simCode), 'OMCpp<%fileNamePrefix%>CalcHelperMain.cpp') + + let() = textFile(CodegenCpp.simulationCppFile(simCode, contextOther, updateHpcom(allEquations, whenClauses, simCode, &extraFuncs, &extraFuncsDecl, "", contextOther, stateDerVectorName, false), + '<%numRealVars%>-1', '<%numIntVars%>-1', '<%numBoolVars%>-1', &extraFuncs, &extraFuncsDecl, className, + additionalHpcomConstructorDefinitions(hpcomData.schedules), + additionalHpcomConstructorBodyStatements(hpcomData.schedules, className, CodegenUtil.dotPath(modelInfo.name)), + additionalHpcomDestructorBodyStatements(hpcomData.schedules), + stateDerVectorName, false), 'OMCpp<%fileNamePrefix%>.cpp') + + let() = textFile(CodegenCpp.simulationHeaderFile(simCode ,contextOther, &extraFuncs, &extraFuncsDecl, "", + additionalHpcomIncludes(simCode, &extraFuncs, &extraFuncsDecl, className, false), + "", + additionalHpcomProtectedMemberDeclaration(simCode, &extraFuncs, &extraFuncsDecl, "", false), + CodegenCpp.memberVariableDefine(modelInfo, varToArrayIndexMapping, '<%numRealVars%>-1', '<%numIntVars%>-1', '<%numBoolVars%>-1', Flags.isSet(Flags.GEN_DEBUG_SYMBOLS), false), + CodegenCpp.memberVariableDefinePreVariables(modelInfo, varToArrayIndexMapping, '<%numRealVars%>-1', '<%numIntVars%>-1', '<%numBoolVars%>-1', Flags.isSet(Flags.GEN_DEBUG_SYMBOLS), false), false), + 'OMCpp<%fileNamePrefix%>.h') + "" + // empty result of the top-level template .., only side effects + end match +end translateModel; + +annotation(__OpenModelica_Interface="backend"); +end CodegenFMUCppHpcom; + +// vim: filetype=susan sw=2 sts=2 \ No newline at end of file diff --git a/Compiler/Template/ExpressionDumpTV.mo b/Compiler/Template/ExpressionDumpTV.mo index 0b021de8cdb..b5b3bb518a5 100644 --- a/Compiler/Template/ExpressionDumpTV.mo +++ b/Compiler/Template/ExpressionDumpTV.mo @@ -349,6 +349,12 @@ package DAE Type ty; end TSUB; + record RSUB + Exp exp; + String fieldName; + Type ty; + end RSUB; + record SIZE Exp exp; Option sz; diff --git a/Compiler/Template/ExpressionDumpTpl.tpl b/Compiler/Template/ExpressionDumpTpl.tpl index a40d99a324e..ea1c8a2e930 100644 --- a/Compiler/Template/ExpressionDumpTpl.tpl +++ b/Compiler/Template/ExpressionDumpTpl.tpl @@ -92,6 +92,12 @@ match exp let rparen = if needs_paren then ")" let exp_str = dumpExp(exp, stringDelimiter) '<%lparen%><%exp_str%><%rparen%>[<%ix%>]' + case RSUB(__) then + let needs_paren = parenthesizeSubExp(exp) + let lparen = if needs_paren then "(" + let rparen = if needs_paren then ")" + let exp_str = dumpExp(exp, stringDelimiter) + '<%if typeinfo() then '/*RSUB: <%unparseType(ty)%>*/'%><%lparen%><%exp_str%><%rparen%>.<%fieldName%>' case SIZE(__) then let exp_str = dumpExp(exp, stringDelimiter) let dim_str = match sz case SOME(dim) then ', <%dumpExp(dim, stringDelimiter)%>' diff --git a/Compiler/Template/Makefile.common b/Compiler/Template/Makefile.common index cd07f0dd911..c8015fb593d 100644 --- a/Compiler/Template/Makefile.common +++ b/Compiler/Template/Makefile.common @@ -1,6 +1,6 @@ .PHONY : all -GENERATED_FILES=AbsynDumpTpl.mo CodegenUtil.mo CodegenC.mo CodegenCFunctions.mo CodegenFMUCommon.mo CodegenFMU.mo CodegenFMU1.mo CodegenFMU2.mo CodegenCSharp.mo CodegenQSS.mo CodegenCpp.mo CodegenCppHpcom.mo CodegenFMUCpp.mo CodegenCppInit.mo CodegenModelica.mo DAEDumpTpl.mo ExpressionDumpTpl.mo GraphvizDump.mo GraphMLDumpTpl.mo NFInstDumpTpl.mo SimCodeDump.mo Unparsing.mo SCodeDumpTpl.mo CodegenAdevs.mo CodegenSparseFMI.mo CodegenXML.mo CodegenJava.mo CodegenJS.mo TplCodegen.mo TaskSystemDump.mo GenerateAPIFunctionsTpl.mo VisualXMLTpl.mo +GENERATED_FILES=AbsynDumpTpl.mo CodegenUtil.mo CodegenC.mo CodegenCFunctions.mo CodegenFMUCommon.mo CodegenFMU.mo CodegenFMU1.mo CodegenFMU2.mo CodegenCSharp.mo CodegenQSS.mo CodegenCpp.mo CodegenCppHpcom.mo CodegenFMUCpp.mo CodegenFMUCppHpcom.mo CodegenCppInit.mo CodegenModelica.mo DAEDumpTpl.mo ExpressionDumpTpl.mo GraphvizDump.mo GraphMLDumpTpl.mo NFInstDumpTpl.mo SimCodeDump.mo Unparsing.mo SCodeDumpTpl.mo CodegenAdevs.mo CodegenSparseFMI.mo CodegenXML.mo CodegenJava.mo CodegenJS.mo TplCodegen.mo TaskSystemDump.mo GenerateAPIFunctionsTpl.mo VisualXMLTpl.mo all : $(GENERATED_FILES) @@ -56,6 +56,14 @@ CodegenFMU2.mo : CodegenFMU2.tpl CodegenFMUCommon.tpl CodegenFMUCommon.mo SimCod @echo " ** CodegenFMU2 template compilation ** " $(OMC) $< > $@.log || (cat $@.log && false) @echo " " +CodegenFMUCpp.mo : CodegenFMUCpp.tpl SimCodeTV.mo SimCodeBackendTV.mo CodegenC.tpl CodegenUtil.tpl CodegenCpp.tpl CodegenFMU.tpl + @echo " ** CodegenFMUCpp template compilation ** " + $(OMC) $< > $@.log || (cat $@.log && false) + @echo " " +CodegenFMUCppHpcom.mo : CodegenFMUCppHpcom.tpl CodegenFMUCpp.tpl SimCodeTV.mo SimCodeBackendTV.mo CodegenCppHpcom.tpl CodegenUtil.tpl CodegenCpp.tpl CodegenFMU.tpl + @echo " ** CodegenFMUCppHpcom template compilation ** " + $(OMC) $< > $@.log || (cat $@.log && false) + @echo " " CodegenModelica.mo : CodegenModelica.tpl @echo " ** CodegenModelica template compilation ** " @@ -97,12 +105,7 @@ CodegenCppHpcom.mo : CodegenCppHpcom.tpl SimCodeTV.mo SimCodeBackendTV.mo Codege $(OMC) $< > $@.log || (cat $@.log && false) @echo " " -CodegenFMUCpp.mo : CodegenFMUCpp.tpl SimCodeTV.mo SimCodeBackendTV.mo CodegenC.tpl CodegenUtil.tpl CodegenCpp.tpl CodegenFMU.tpl - @echo " ** CodegenFMUCpp template compilation ** " - $(OMC) $< > $@.log || (cat $@.log && false) - @echo " " - -CodegenCppInit.mo : CodegenCppInit.tpl SimCodeTV.mo CodegenUtil.tpl +CodegenCppInit.mo : CodegenCppInit.tpl SimCodeTV.mo SimCodeBackendTV.mo CodegenUtil.tpl CodegenFMUCommon.tpl @echo " ** CodegenCppInit template compilation ** " $(OMC) $< > $@.log || (cat $@.log && false) @echo " " diff --git a/Compiler/Template/SimCodeTV.mo b/Compiler/Template/SimCodeTV.mo index 9ec3bfd3543..7431c7afee8 100644 --- a/Compiler/Template/SimCodeTV.mo +++ b/Compiler/Template/SimCodeTV.mo @@ -813,6 +813,13 @@ package SimCodeUtil output list oVarIndexList; end getVarIndexListByMapping; + function getVarIndexByMapping + input HashTableCrIListArray.HashTable iVarToArrayIndexMapping; + input DAE.ComponentRef iVarName; + input String iIndexForUndefinedReferences; + output String oVarIndex; + end getVarIndexByMapping; + function isVarIndexListConsecutive input HashTableCrIListArray.HashTable iVarToArrayIndexMapping; input DAE.ComponentRef iVarName; @@ -1364,6 +1371,12 @@ package DAE Integer ix; Type ty; end TSUB; + record RSUB + Exp exp; + Integer ix; + String fieldName; + Type ty; + end RSUB; record SIZE Exp exp; Option sz; @@ -2196,6 +2209,7 @@ uniontype Restriction record R_METARECORD "Metamodelica extension" Absyn.Path name; //Name of the uniontype Integer index; //Index in the uniontype + Boolean moved; end R_METARECORD; /* added by x07simbj */ record R_UNIONTYPE "Metamodelica extension" @@ -3187,6 +3201,10 @@ package Types input DAE.Type ty; output Boolean b; end isArrayWithUnknownDimension; + function getMetaRecordFields + input DAE.Type ty; + output list fields; + end getMetaRecordFields; end Types; package HashTableCrIListArray diff --git a/Compiler/Template/Unparsing.tpl b/Compiler/Template/Unparsing.tpl index 740f85af031..29339cc6190 100644 --- a/Compiler/Template/Unparsing.tpl +++ b/Compiler/Template/Unparsing.tpl @@ -51,7 +51,7 @@ end metaHelperBoxStart; template elementExternalHeader(SCode.Element elt, String pack) ::= match elt - case c as SCode.CLASS(restriction=r as SCode.R_METARECORD(__),classDef=p as SCode.PARTS(__)) + case c as SCode.CLASS(restriction=r as SCode.R_METARECORD(moved = true),classDef=p as SCode.PARTS(__)) then let fields=(p.elementLst |> SCode.COMPONENT(__) => name; separator=",") let fieldsStr=(p.elementLst |> SCode.COMPONENT(__) => '"<%name%>"'; separator=",") diff --git a/Compiler/Util/List.mo b/Compiler/Util/List.mo index 512ac0daf9f..b6c17391f60 100644 --- a/Compiler/Util/List.mo +++ b/Compiler/Util/List.mo @@ -4667,9 +4667,9 @@ algorithm if valueEq(e, inElement) then return; end if; - outPosition := outPosition + 1; end for; + fail(); end position; public function positionOnTrue diff --git a/Compiler/Util/Util.mo b/Compiler/Util/Util.mo index 3022f35d70a..bad9d1ea102 100644 --- a/Compiler/Util/Util.mo +++ b/Compiler/Util/Util.mo @@ -861,17 +861,6 @@ algorithm end match; end getOptionOrDefault; -public function isSome - "Returns true if SOME, otherwise false" - input Option inOption; - output Boolean outIsSome; -algorithm - outIsSome := match(inOption) - case(SOME(_)) then true; - else then false; - end match; -end isSome; - public function intGreaterZero "Returns true if integer value is greater zero (> 0)" input Integer v; diff --git a/Compiler/Util/VisualXML.mo b/Compiler/Util/VisualXML.mo index cd63b60bf14..7a6069520d6 100644 --- a/Compiler/Util/VisualXML.mo +++ b/Compiler/Util/VisualXML.mo @@ -128,18 +128,11 @@ This is needed since protected, time-dependent variables are not stored in resul protected array ass1; BackendDAE.Variables vars; - Option m; - Option mT; - BackendDAE.Matching matching; - BackendDAE.StateSets stateSets; - BackendDAE.BaseClockPartitionKind partitionKind; BackendDAE.EquationArray eqs; - list varLst; algorithm - BackendDAE.EQSYSTEM(orderedVars = vars, orderedEqs = eqs, m=m, mT=mT, matching=matching, stateSets=stateSets, partitionKind=partitionKind) := eqSysIn; - BackendDAE.MATCHING(ass1=ass1) := matching; - (vars,_) := BackendVariable.traverseBackendDAEVarsWithUpdate(vars,setBindingForProtectedVars1,(1,ass1,eqs)); - eqSysOut := BackendDAE.EQSYSTEM(vars,eqs,m,mT,matching,stateSets,partitionKind); + BackendDAE.EQSYSTEM(orderedEqs=eqs, orderedVars=vars, matching=BackendDAE.MATCHING(ass1=ass1)) := eqSysIn; + BackendVariable.traverseBackendDAEVarsWithUpdate(vars, setBindingForProtectedVars1, (1, ass1, eqs)); + eqSysOut := eqSysIn; end setBindingForProtectedVars; protected function setBindingForProtectedVars1"checks if the var is protected and sets the binding (i.e. the solved equation)" @@ -301,7 +294,7 @@ algorithm case(DAE.CREF_QUAL(ident="R",componentRef=DAE.CREF_IDENT(ident="T", subscriptLst = {DAE.INDEX(DAE.ICONST(pos)),DAE.INDEX(DAE.ICONST(pos1))})),BackendDAE.VAR(bindExp=bind), SHAPE(ident=ident, shapeType=shapeType, T=T, r=r, r_shape=r_shape, lengthDir=lengthDir, widthDir=widthDir, length=length, width=width, height=height, extra=extra, color=color, specularCoeff=specularCoeff)) algorithm - if Util.isSome(bind) then exp := Util.getOption(bind); + if isSome(bind) then exp := Util.getOption(bind); else exp := BackendVariable.varExp(var); end if; T0 := arrayGet(T,pos); @@ -311,7 +304,7 @@ algorithm case(DAE.CREF_IDENT(ident="r", subscriptLst = {DAE.INDEX(DAE.ICONST(pos))}),BackendDAE.VAR(bindExp=bind), SHAPE(ident=ident, shapeType=shapeType, T=T, r=r, r_shape=r_shape, lengthDir=lengthDir, widthDir=widthDir, length=length, width=width, height=height, extra=extra, color=color, specularCoeff=specularCoeff)) algorithm - if Util.isSome(bind) then exp := Util.getOption(bind); + if isSome(bind) then exp := Util.getOption(bind); else exp := BackendVariable.varExp(var); end if; r := arrayUpdate(r,pos,exp); @@ -319,7 +312,7 @@ algorithm case(DAE.CREF_IDENT(ident="r_shape", subscriptLst = {DAE.INDEX(DAE.ICONST(pos))}),BackendDAE.VAR(bindExp=bind), SHAPE(ident=ident, shapeType=shapeType, T=T, r=r, r_shape=r_shape, lengthDir=lengthDir, widthDir=widthDir, length=length, width=width, height=height, extra=extra, color=color, specularCoeff=specularCoeff)) algorithm - if Util.isSome(bind) then exp := Util.getOption(bind); + if isSome(bind) then exp := Util.getOption(bind); else exp := BackendVariable.varExp(var); end if; r_shape := arrayUpdate(r_shape,pos,exp); @@ -327,7 +320,7 @@ algorithm case(DAE.CREF_IDENT(ident="lengthDirection", subscriptLst = {DAE.INDEX(DAE.ICONST(pos))}),BackendDAE.VAR(bindExp=bind), SHAPE(ident=ident, shapeType=shapeType, T=T, r=r, r_shape=r_shape, lengthDir=lengthDir, widthDir=widthDir, length=length, width=width, height=height, extra=extra, color=color, specularCoeff=specularCoeff)) algorithm - if Util.isSome(bind) then exp := Util.getOption(bind); + if isSome(bind) then exp := Util.getOption(bind); else exp := BackendVariable.varExp(var); end if; lengthDir := arrayUpdate(lengthDir,pos,exp); @@ -335,7 +328,7 @@ algorithm case(DAE.CREF_IDENT(ident="widthDirection", subscriptLst = {DAE.INDEX(DAE.ICONST(pos))}),BackendDAE.VAR(bindExp=bind), SHAPE(ident=ident, shapeType=shapeType, T=T, r=r, r_shape=r_shape, lengthDir=lengthDir, widthDir=widthDir, length=length, width=width, height=height, extra=extra, color=color, specularCoeff=specularCoeff)) algorithm - if Util.isSome(bind) then exp := Util.getOption(bind); + if isSome(bind) then exp := Util.getOption(bind); else exp := BackendVariable.varExp(var); end if; widthDir := arrayUpdate(widthDir,pos,exp); @@ -343,35 +336,35 @@ algorithm case(DAE.CREF_IDENT(ident="length"),BackendDAE.VAR(bindExp=bind), SHAPE(ident=ident, shapeType=shapeType, T=T, r=r, r_shape=r_shape, lengthDir=lengthDir, widthDir=widthDir, length=length, width=width, height=height, extra=extra, color=color, specularCoeff=specularCoeff)) algorithm - if Util.isSome(bind) then length := Util.getOption(bind); + if isSome(bind) then length := Util.getOption(bind); else length := BackendVariable.varExp(var); end if; then (SHAPE(ident, shapeType, T, r, r_shape, lengthDir, widthDir, length, width, height, extra, color, specularCoeff)); case(DAE.CREF_IDENT(ident="width"),BackendDAE.VAR(bindExp=bind), SHAPE(ident=ident, shapeType=shapeType, T=T, r=r, r_shape=r_shape, lengthDir=lengthDir, widthDir=widthDir, length=length, width=width, height=height, extra=extra, color=color, specularCoeff=specularCoeff)) algorithm - if Util.isSome(bind) then width := Util.getOption(bind); + if isSome(bind) then width := Util.getOption(bind); else width := BackendVariable.varExp(var); end if; then (SHAPE(ident, shapeType, T, r, r_shape, lengthDir, widthDir, length, width, height, extra, color, specularCoeff)); case(DAE.CREF_IDENT(ident="height"),BackendDAE.VAR(bindExp=bind), SHAPE(ident=ident, shapeType=shapeType, T=T, r=r, r_shape=r_shape, lengthDir=lengthDir, widthDir=widthDir, length=length, width=width, height=height, extra=extra, color=color, specularCoeff=specularCoeff)) algorithm - if Util.isSome(bind) then height := Util.getOption(bind); + if isSome(bind) then height := Util.getOption(bind); else height := BackendVariable.varExp(var); end if; then (SHAPE(ident, shapeType, T, r, r_shape, lengthDir, widthDir, length, width, height, extra, color, specularCoeff)); case(DAE.CREF_IDENT(ident="extra"),BackendDAE.VAR(bindExp=bind), SHAPE(ident=ident, shapeType=shapeType, T=T, r=r, r_shape=r_shape, lengthDir=lengthDir, widthDir=widthDir, length=length, width=width, height=height, extra=extra, color=color, specularCoeff=specularCoeff)) algorithm - if Util.isSome(bind) then extra := Util.getOption(bind); + if isSome(bind) then extra := Util.getOption(bind); else extra := BackendVariable.varExp(var); end if; then (SHAPE(ident, shapeType, T, r, r_shape, lengthDir, widthDir, length, width, height, extra, color, specularCoeff)); case(DAE.CREF_IDENT(ident="color", subscriptLst = {DAE.INDEX(DAE.ICONST(pos))}),BackendDAE.VAR(bindExp=bind), SHAPE(ident=ident, shapeType=shapeType, T=T, r=r, r_shape=r_shape, lengthDir=lengthDir, widthDir=widthDir, length=length, width=width, height=height, extra=extra, color=color, specularCoeff=specularCoeff)) algorithm - if Util.isSome(bind) then exp := Util.getOption(bind); + if isSome(bind) then exp := Util.getOption(bind); else exp := BackendVariable.varExp(var); end if; color := arrayUpdate(color,pos,exp); @@ -379,7 +372,7 @@ algorithm case(DAE.CREF_IDENT(ident="specularCoefficient"),BackendDAE.VAR(bindExp=bind), SHAPE(ident=ident, shapeType=shapeType, T=T, r=r, r_shape=r_shape, lengthDir=lengthDir, widthDir=widthDir, length=length, width=width, height=height, extra=extra, color=color, specularCoeff=specularCoeff)) algorithm - if Util.isSome(bind) then specularCoeff := Util.getOption(bind); + if isSome(bind) then specularCoeff := Util.getOption(bind); else specularCoeff := BackendVariable.varExp(var); end if; then (SHAPE(ident, shapeType, T, r, r_shape, lengthDir, widthDir, length, width, height, extra, color, specularCoeff)); @@ -387,7 +380,7 @@ algorithm else algorithm BackendDAE.VAR(bindExp=bind) := var; - if Util.isSome(bind) then exp := Util.getOption(bind); + if isSome(bind) then exp := Util.getOption(bind); else exp := DAE.SCONST("NO_BINDING"); end if; //print("whats this? :"+ComponentReference.printComponentRefStr(cref)+" with binding: "+ExpressionDump.printExpStr(exp)+"\n"); diff --git a/Compiler/boot/LoadCompilerSources.mos b/Compiler/boot/LoadCompilerSources.mos index 0d6238bad3b..9a084f080cc 100644 --- a/Compiler/boot/LoadCompilerSources.mos +++ b/Compiler/boot/LoadCompilerSources.mos @@ -299,6 +299,7 @@ if true then /* Suppress output */ "../Template/CodegenFMU2.mo", "../Template/CodegenFMUCommon.mo", "../Template/CodegenFMUCpp.mo", + "../Template/CodegenFMUCppHpcom.mo", "../Template/CodegenJava.mo", "../Template/CodegenJS.mo", "../Template/CodegenModelica.mo", diff --git a/Makefile.omdev.mingw b/Makefile.omdev.mingw index 0b5546e5bf8..62645bfc1d7 100644 --- a/Makefile.omdev.mingw +++ b/Makefile.omdev.mingw @@ -218,6 +218,10 @@ fmil_msvc: (cp -puf 3rdParty/FMIL/install_msvc/lib/fmilib_shared.dll $(OMBUILDDIR)/bin/fmilib.dll) (cp -puf 3rdParty/FMIL/install_msvc/lib/fmilib_shared.dll $(OMBUILDDIR)/lib/omc/msvc/fmilib.dll) (cp -puf 3rdParty/FMIL/install_msvc/lib/fmilib_shared.lib $(OMBUILDDIR)/lib/omc/msvc/fmilib.lib) + # copy the dll with the actual name: fmilib_shared.dll as the fmilib.lib contains that name and the exe will look for it + (cp -puf 3rdParty/FMIL/install_msvc/lib/fmilib_shared.dll $(OMBUILDDIR)/bin/fmilib_shared.dll) + (cp -puf 3rdParty/FMIL/install_msvc/lib/fmilib_shared.dll $(OMBUILDDIR)/lib/omc/msvc/fmilib_shared.dll) + (cp -puf 3rdParty/FMIL/install_msvc/lib/fmilib_shared.lib $(OMBUILDDIR)/lib/omc/msvc/fmilib_shared.lib) CMinpack_msvc: rm -f $(OMBUILDDIR)/lib/omc/msvc/cminpack.* diff --git a/SimulationRuntime/c/meta/meta_modelica_builtin.c b/SimulationRuntime/c/meta/meta_modelica_builtin.c index 805295c1c8a..6a19382a1c6 100644 --- a/SimulationRuntime/c/meta/meta_modelica_builtin.c +++ b/SimulationRuntime/c/meta/meta_modelica_builtin.c @@ -38,13 +38,6 @@ #include #include -#if defined(_MSC_VER) -#include -#define isinf(d) (!_finite(d) && !_isnan(d)) -#define isnan _isnan -#define snprintf _snprintf -#endif - #define GEN_META_MODELICA_BUILTIN_BOXPTR #include "meta_modelica_builtin_boxptr.h" diff --git a/SimulationRuntime/c/simulation/solver/perform_qss_simulation.c b/SimulationRuntime/c/simulation/solver/perform_qss_simulation.c index eea4d63390b..6b777ec6502 100644 --- a/SimulationRuntime/c/simulation/solver/perform_qss_simulation.c +++ b/SimulationRuntime/c/simulation/solver/perform_qss_simulation.c @@ -112,22 +112,22 @@ modelica_integer prefixedName_performQSSSimulation(DATA* data, SOLVER_INFO* solv modelica_real* dQ = NULL; /* change in quantity of every state, default = nominal*10^-4 */ /* allocate memory*/ - qik = calloc(STATES, sizeof(modelica_real)); - fail = (qik == NULL) ? 1 : ( 0 | fail); - xik = calloc(STATES, sizeof(modelica_real)); - fail = (xik == NULL) ? 1 : ( 0 | fail); - derXik = calloc(STATES, sizeof(modelica_real)); - fail = (derXik == NULL) ? 1 : ( 0 | fail); - tq = calloc(STATES, sizeof(modelica_real)); - fail = (tq == NULL) ? 1 : ( 0 | fail); - tx = calloc(STATES, sizeof(modelica_real)); - fail = (tx == NULL) ? 1 : ( 0 | fail); - tqp = calloc(STATES, sizeof(modelica_real)); - fail = (tqp == NULL) ? 1 : ( 0 | fail); - nQh = calloc(STATES, sizeof(modelica_real)); - fail = (nQh == NULL) ? 1 : ( 0 | fail); - dQ = calloc(STATES, sizeof(modelica_real)); - fail = (dQ == NULL) ? 1 : ( 0 | fail); + qik = (modelica_real*)calloc(STATES, sizeof(modelica_real)); + fail = (qik == NULL) ? 1 : ( 0 | fail); + xik = (modelica_real*)calloc(STATES, sizeof(modelica_real)); + fail = (xik == NULL) ? 1 : ( 0 | fail); + derXik = (modelica_real*)calloc(STATES, sizeof(modelica_real)); + fail = (derXik == NULL) ? 1 : ( 0 | fail); + tq = (modelica_real*)calloc(STATES, sizeof(modelica_real)); + fail = (tq == NULL) ? 1 : ( 0 | fail); + tx = (modelica_real*)calloc(STATES, sizeof(modelica_real)); + fail = (tx == NULL) ? 1 : ( 0 | fail); + tqp = (modelica_real*)calloc(STATES, sizeof(modelica_real)); + fail = (tqp == NULL) ? 1 : ( 0 | fail); + nQh = (modelica_real*)calloc(STATES, sizeof(modelica_real)); + fail = (nQh == NULL) ? 1 : ( 0 | fail); + dQ = (modelica_real*)calloc(STATES, sizeof(modelica_real)); + fail = (dQ == NULL) ? 1 : ( 0 | fail); if (fail) @@ -152,7 +152,7 @@ modelica_integer prefixedName_performQSSSimulation(DATA* data, SOLVER_INFO* solv } /* Transform the sparsity pattern into a data structure for an index based access. */ - modelica_integer* der = calloc(ROWS, sizeof(modelica_integer)); + modelica_integer* der = (modelica_integer*)calloc(ROWS, sizeof(modelica_integer)); if (NULL==der) return OO_MEMORY; for (i = 0; i < ROWS; i++) @@ -507,14 +507,15 @@ static modelica_integer getStatesInDer(const unsigned int* index, const unsigned { uinteger i = 0, k = 0; /* loop var */ uinteger numDer = 0; - modelica_integer* der = calloc(ROWS, sizeof(modelica_integer)); + modelica_integer* der = (modelica_integer*)calloc(ROWS, sizeof(modelica_integer)); + uinteger* stackPointer = (uinteger*)calloc(ROWS, sizeof(uinteger)); + if (NULL == der) return OO_MEMORY; for (i = 0; i < ROWS; i++) der[i] = -1; - uinteger stackPointer[ROWS]; for (i = 0; i < ROWS; i++) stackPointer[i] = 0; @@ -534,6 +535,7 @@ static modelica_integer getStatesInDer(const unsigned int* index, const unsigned } free(der); + free(stackPointer); return OK; } @@ -548,7 +550,12 @@ static uinteger minStep(const modelica_real* tqp, const uinteger size ) { uinteger i = 0; uinteger ind = i; - modelica_real tmin = 1.0/0.0; /* Wwe can have a QNAN at any index and tqp[i] < QNAN will fail in every case. */ + modelica_real tmin = +#if defined(_MSC_VER) + NAN; +#else + 1.0/0.0; /* We can have a QNAN at any index and tqp[i] < QNAN will fail in every case. */ +#endif for (i = 0; i < size; i++) { diff --git a/SimulationRuntime/c/simulation/solver/radau.c b/SimulationRuntime/c/simulation/solver/radau.c index 00bf29b2151..26172174a7a 100644 --- a/SimulationRuntime/c/simulation/solver/radau.c +++ b/SimulationRuntime/c/simulation/solver/radau.c @@ -32,13 +32,6 @@ * author: team Bielefeld :) */ -#if defined(_MSC_VER) -#include -#define isinf(d) (!_finite(d) && !_isnan(d)) -#define isnan _isnan -#define snprintf _snprintf -#endif - #include #include "radau.h" diff --git a/SimulationRuntime/c/util/division.c b/SimulationRuntime/c/util/division.c index 78c7a871135..a6b002e0b01 100644 --- a/SimulationRuntime/c/util/division.c +++ b/SimulationRuntime/c/util/division.c @@ -74,11 +74,6 @@ modelica_real division_error(threadData_t *threadData, modelica_real b, const ch return b; } -#if defined(_MSC_VER) -#include -#define isnan _isnan -#endif - modelica_real isnan_error(threadData_t *threadData,modelica_real b, const char* division_str, const char* file, long line) { if(isnan(b)) diff --git a/SimulationRuntime/c/util/omc_msvc.h b/SimulationRuntime/c/util/omc_msvc.h index 3dac109c284..64f7b3e36dd 100644 --- a/SimulationRuntime/c/util/omc_msvc.h +++ b/SimulationRuntime/c/util/omc_msvc.h @@ -84,6 +84,15 @@ int vasprintf(char **strp, const char *fmt, va_list ap); unsigned int alarm (unsigned int seconds); +#include +#define isinf(d) (!_finite(d) && !_isnan(d)) +#define isnan _isnan +#define fpu_error(x) (isinf(x) || isnan(x)) + +#if !defined(snprintf) +#define snprintf snprintf_s +#endif + #else /* not msvc */ /* define inline for non-MSVC */ diff --git a/SimulationRuntime/cpp/Core/SimController/SimController.cpp b/SimulationRuntime/cpp/Core/SimController/SimController.cpp index 24e0132dc07..58142c90750 100644 --- a/SimulationRuntime/cpp/Core/SimController/SimController.cpp +++ b/SimulationRuntime/cpp/Core/SimController/SimController.cpp @@ -187,7 +187,6 @@ void SimController::StartVxWorks(SimSettings simsettings,string modelKey) global_settings->setSelectedLinSolver(simsettings.linear_solver_name); global_settings->setSelectedNonLinSolver(simsettings.nonlinear_solver_name); global_settings->setSelectedSolver(simsettings.solver_name); - global_settings->setOutputFormat(simsettings.outputFormat); global_settings->setAlarmTime(simsettings.timeOut); global_settings->setLogSettings(simsettings.logSettings); global_settings->setOutputPointType(simsettings.outputPointType); @@ -240,7 +239,6 @@ void SimController::Start(SimSettings simsettings, string modelKey) global_settings->setSelectedLinSolver(simsettings.linear_solver_name); global_settings->setSelectedNonLinSolver(simsettings.nonlinear_solver_name); global_settings->setSelectedSolver(simsettings.solver_name); - global_settings->setOutputFormat(simsettings.outputFormat); global_settings->setLogSettings(simsettings.logSettings); global_settings->setAlarmTime(simsettings.timeOut); global_settings->setOutputPointType(simsettings.outputPointType); @@ -277,29 +275,28 @@ void SimController::Start(SimSettings simsettings, string modelKey) boost::shared_ptr writeoutput_system = boost::dynamic_pointer_cast(mixedsystem); - if((global_settings->getOutputFormat()==OF_BUFFER) && writeoutput_system) + boost::shared_ptr simData = getSimData(modelKey).lock(); + //get history object to query simulation results + IHistory* history = writeoutput_system->getHistory(); + //simulation results (output variables) + ublas::matrix Ro; + //query simulation result otuputs + history->getOutputResults(Ro); + vector output_names; + history->getOutputNames(output_names); + string name; + int j=0; + + BOOST_FOREACH(name,output_names) { - boost::shared_ptr simData = getSimData(modelKey).lock(); - //get history object to query simulation results - IHistory* history = writeoutput_system->getHistory(); - //simulation results (output variables) - ublas::matrix Ro; - //query simulation result otuputs - history->getOutputResults(Ro); - vector output_names; - history->getOutputNames(output_names); - string name; - int j=0; - BOOST_FOREACH(name,output_names) - { - ublas::vector o_j; - o_j = ublas::row(Ro,j); - simData->addOutputResults(name,o_j); - j++; - } - vector time_values = history->getTimeEntries(); - simData->addTimeEntries(time_values); + ublas::vector o_j; + o_j = ublas::row(Ro,j); + simData->addOutputResults(name,o_j); + j++; } + + vector time_values = history->getTimeEntries(); + simData->addTimeEntries(time_values); } catch(ModelicaSimulationError & ex) { diff --git a/SimulationRuntime/cpp/Core/SimulationSettings/GlobalSettings.cpp b/SimulationRuntime/cpp/Core/SimulationSettings/GlobalSettings.cpp index 5bb325f0010..31fe5efcb94 100644 --- a/SimulationRuntime/cpp/Core/SimulationSettings/GlobalSettings.cpp +++ b/SimulationRuntime/cpp/Core/SimulationSettings/GlobalSettings.cpp @@ -19,7 +19,6 @@ GlobalSettings::GlobalSettings() , _selected_nonlin_solver("Newton") , _resultsfile_name("results.csv") , _endless_sim(false) - , _outputFormat(OF_EMPTY) , _outputPointType(OPT_ALL) , _alarm_time(0) { @@ -72,16 +71,6 @@ void GlobalSettings::useEndlessSim(bool endles) _endless_sim = endles; } -OutputFormat GlobalSettings::getOutputFormat() -{ - return _outputFormat; -} - -void GlobalSettings::setOutputFormat(OutputFormat format) -{ - _outputFormat = format; -} - OutputPointType GlobalSettings::getOutputPointType() { return _outputPointType; diff --git a/SimulationRuntime/cpp/Core/Solver/SolverDefaultImplementation.cpp b/SimulationRuntime/cpp/Core/Solver/SolverDefaultImplementation.cpp index 695803281a2..39c0dc2daf7 100644 --- a/SimulationRuntime/cpp/Core/Solver/SolverDefaultImplementation.cpp +++ b/SimulationRuntime/cpp/Core/Solver/SolverDefaultImplementation.cpp @@ -111,7 +111,7 @@ void SolverDefaultImplementation::initialize() timeevent_system->setTime(_tCurrent); - if(_settings->getGlobalSettings()->getOutputPointType() != OPT_EMPTY && _settings->getGlobalSettings()->getOutputFormat() != OF_EMPTY) + if(_settings->getGlobalSettings()->getOutputPointType() != OPT_NONE) writeoutput_system->writeOutput(IWriteOutput::HEAD_LINE); // Allocate array with values of zero functions @@ -192,7 +192,7 @@ void SolverDefaultImplementation::writeToFile(const int& stp, const double& t, c } #endif - if(_settings->getGlobalSettings()->getOutputFormat()!= OF_EMPTY) + if(_settings->getGlobalSettings()->getOutputPointType()!= OPT_NONE) { IWriteOutput* writeoutput_system = dynamic_cast(_system); diff --git a/SimulationRuntime/cpp/Include/Core/SimController/ISimController.h b/SimulationRuntime/cpp/Include/Core/SimController/ISimController.h index 54bba21b02d..94b41cec575 100644 --- a/SimulationRuntime/cpp/Include/Core/SimController/ISimController.h +++ b/SimulationRuntime/cpp/Include/Core/SimController/ISimController.h @@ -16,7 +16,6 @@ struct SimSettings double upper_limit; double tolerance; string outputfile_name; - OutputFormat outputFormat; unsigned int timeOut; OutputPointType outputPointType; LogSettings logSettings; diff --git a/SimulationRuntime/cpp/Include/Core/SimulationSettings/GlobalSettings.h b/SimulationRuntime/cpp/Include/Core/SimulationSettings/GlobalSettings.h index 071e2035c7f..7c3dda87998 100644 --- a/SimulationRuntime/cpp/Include/Core/SimulationSettings/GlobalSettings.h +++ b/SimulationRuntime/cpp/Include/Core/SimulationSettings/GlobalSettings.h @@ -32,8 +32,6 @@ class GlobalSettings : public IGlobalSettings ///path for simulation results in textfile virtual string getOutputPath(); virtual void setOutputPath(string); - virtual OutputFormat getOutputFormat(); - virtual void setOutputFormat(OutputFormat format); virtual OutputPointType getOutputPointType(); virtual void setOutputPointType(OutputPointType); virtual LogSettings getLogSettings(); @@ -71,7 +69,6 @@ class GlobalSettings : public IGlobalSettings _selected_nonlin_solver, _resultsfile_name, _runtimeLibraryPath; - OutputFormat _outputFormat; OutputPointType _outputPointType; LogSettings _log_settings; unsigned int _alarm_time; diff --git a/SimulationRuntime/cpp/Include/Core/SimulationSettings/IGlobalSettings.h b/SimulationRuntime/cpp/Include/Core/SimulationSettings/IGlobalSettings.h index 815a2abf065..0a153fd2395 100644 --- a/SimulationRuntime/cpp/Include/Core/SimulationSettings/IGlobalSettings.h +++ b/SimulationRuntime/cpp/Include/Core/SimulationSettings/IGlobalSettings.h @@ -25,11 +25,10 @@ using std::string; #include -enum OutputFormat {OF_CSV, OF_MAT, OF_BUFFER, OF_EMPTY}; - - enum LogCategory {LC_INIT = 0, LC_NLS = 1, LC_LS = 2, LC_SOLV = 3, LC_OUT = 4, LC_EVT = 5, LC_OTHER = 6, LC_MOD = 7}; enum LogLevel {LL_ERROR = 0, LL_WARNING = 1, LL_INFO = 2, LL_DEBUG = 3}; +enum OutputPointType {OPT_ALL, OPT_STEP, OPT_NONE}; + struct LogSettings { std::vector modes; @@ -46,7 +45,6 @@ struct LogSettings } }; -enum OutputPointType {OPT_ALL, OPT_STEP, OPT_EMPTY}; class IGlobalSettings { public: @@ -63,8 +61,6 @@ class IGlobalSettings ///< Write out results ([false,true]; default: true) virtual bool getResultsOutput() = 0; virtual void setResultsOutput(bool) = 0; - virtual OutputFormat getOutputFormat() = 0; - virtual void setOutputFormat(OutputFormat) = 0; virtual OutputPointType getOutputPointType() = 0; virtual void setOutputPointType(OutputPointType) = 0; virtual LogSettings getLogSettings() = 0; diff --git a/SimulationRuntime/cpp/Include/FMU/FMUGlobalSettings.h b/SimulationRuntime/cpp/Include/FMU/FMUGlobalSettings.h index fbce7a666fd..205565a0b05 100644 --- a/SimulationRuntime/cpp/Include/FMU/FMUGlobalSettings.h +++ b/SimulationRuntime/cpp/Include/FMU/FMUGlobalSettings.h @@ -27,12 +27,10 @@ class FMUGlobalSettings : public IGlobalSettings virtual bool getInfoOutput() { return false; } virtual void setInfoOutput(bool) {} virtual string getOutputPath() { return "./"; } - virtual OutputFormat getOutputFormat(){return OF_EMPTY;} virtual LogSettings getLogSettings() {return LogSettings();} virtual void setLogSettings(LogSettings) {} virtual OutputPointType getOutputPointType() { return OPT_ALL; }; virtual void setOutputPointType(OutputPointType) {}; - virtual void setOutputFormat(OutputFormat) {} virtual void setOutputPath(string) {} virtual string getSelectedSolver() { return "euler"; } virtual void setSelectedSolver(string) {} diff --git a/SimulationRuntime/cpp/Include/FMU2/FMU2GlobalSettings.h b/SimulationRuntime/cpp/Include/FMU2/FMU2GlobalSettings.h index ef6d7f84d4e..dd581fc2347 100644 --- a/SimulationRuntime/cpp/Include/FMU2/FMU2GlobalSettings.h +++ b/SimulationRuntime/cpp/Include/FMU2/FMU2GlobalSettings.h @@ -63,12 +63,10 @@ class FMU2GlobalSettings : public IGlobalSettings virtual bool getInfoOutput() { return false; } virtual void setInfoOutput(bool) {} virtual string getOutputPath() { return "./"; } - virtual OutputFormat getOutputFormat() { return OF_EMPTY; } virtual LogSettings getLogSettings() { return LogSettings(); } virtual void setLogSettings(LogSettings) {} virtual OutputPointType getOutputPointType() { return OPT_ALL; }; virtual void setOutputPointType(OutputPointType) {}; - virtual void setOutputFormat(OutputFormat) {} virtual void setOutputPath(string) {} virtual string getSelectedSolver() { return "euler"; } virtual void setSelectedSolver(string) {} diff --git a/SimulationRuntime/cpp/SimCoreFactory/OMCFactory/OMCFactory.cpp b/SimulationRuntime/cpp/SimCoreFactory/OMCFactory/OMCFactory.cpp index 925e918e2b6..ffa31945790 100644 --- a/SimulationRuntime/cpp/SimCoreFactory/OMCFactory/OMCFactory.cpp +++ b/SimulationRuntime/cpp/SimCoreFactory/OMCFactory/OMCFactory.cpp @@ -55,10 +55,9 @@ SimSettings OMCFactory::readSimulationParameter(int argc, const char* argv[]) { int opt; int portnum; - std::map outputFormatMap = map_list_of("csv", OF_CSV)("mat", OF_MAT)("buffer", OF_BUFFER)("empty", OF_EMPTY); - std::map logCatMap = map_list_of("init", LC_INIT)("nls", LC_NLS)("ls",LC_LS)("solv", LC_SOLV)("output", LC_OUT)("event",LC_EVT)("modell",LC_MOD)("other",LC_OTHER); + std::map logCatMap = map_list_of("init", LC_INIT)("nls", LC_NLS)("ls",LC_LS)("solv", LC_SOLV)("output", LC_OUT)("event",LC_EVT)("model",LC_MOD)("other",LC_OTHER); std::map logLvlMap = map_list_of("error", LL_ERROR)("warning", LL_WARNING)("info", LL_INFO)("debug", LL_DEBUG); - std::map outputPointTypeMap = map_list_of("all", OPT_ALL)("step", OPT_STEP)("empty", OPT_EMPTY); + std::map outputPointTypeMap = map_list_of("all", OPT_ALL)("step", OPT_STEP)("none", OPT_NONE); po::options_description desc("Allowed options"); desc.add_options() ("help", "produce help message") @@ -66,17 +65,16 @@ SimSettings OMCFactory::readSimulationParameter(int argc, const char* argv[]) ("runtime-library,r", po::value(),"path to cpp runtime libraries") ("Modelica-system-library,m", po::value(), "path to Modelica library") ("results-file,R", po::value(),"name of results file") - ("config-path,c", po::value< string >(), "path to xml files") + //("config-path,c", po::value< string >(), "path to xml files") ("start-time,s", po::value< double >()->default_value(0.0), "simulation start time") ("stop-time,e", po::value< double >()->default_value(1.0), "simulation stop time") ("step-size,f", po::value< double >()->default_value(0.0), "simulation step size") ("solver,i", po::value< string >()->default_value("euler"), "solver method") ("lin-solver,L", po::value< string >()->default_value(_defaultLinSolver), "linear solver method") ("non-lin-solver,N", po::value< string >()->default_value(_defaultNonLinSolver), "non linear solver method") - ("OutputFormat,o", po::value< string >()->default_value("csv"), "output Format [csv,mat,empty]") ("number-of-intervals,v", po::value< int >()->default_value(500), "number of intervals") ("tolerance,y", po::value< double >()->default_value(1e-6), "solver tolerance") - ("log-settings,l", po::value< std::vector >(), "log information: init, nls, ls, solv, output, event, modell, other") + ("log-settings,l", po::value< std::vector >(), "log information: init, nls, ls, solv, output, event, model, other") ("alarm,a", po::value()->default_value(360), "sets timeout in seconds for simulation") ("output-type,O", po::value< string >()->default_value("all"), "the points in time written to result file: all (output steps + events), step (just output points), none") ("OMEdit", po::value >(), "OMEdit options") @@ -107,9 +105,11 @@ SimSettings OMCFactory::readSimulationParameter(int argc, const char* argv[]) string modelica_lib_path; double starttime = vm["start-time"].as(); double stoptime = vm["stop-time"].as(); - double stepsize =vm["step-size"].as(); - if (!(stepsize > 0.0)) - stepsize = stoptime/vm["number-of-intervals"].as(); + double stepsize =vm["step-size"].as(); + + if (!(stepsize > 0.0)) + stepsize = stoptime/vm["number-of-intervals"].as(); + double tolerance =vm["tolerance"].as(); string solver = vm["solver"].as(); string nonLinSolver = vm["non-lin-solver"].as(); @@ -150,23 +150,6 @@ SimSettings OMCFactory::readSimulationParameter(int argc, const char* argv[]) throw ModelicaSimulationError(MODEL_FACTORY,"results-filename is not set"); } - string outputFormat_str; - OutputFormat outputFomat; - if (vm.count("OutputFormat")) - { - //cout << "results file: " << vm["results-file"].as() << std::endl; - outputFormat_str = vm["OutputFormat"].as(); - outputFomat = outputFormatMap[outputFormat_str]; - if(!((outputFomat==OF_CSV) || (outputFomat==OF_EMPTY) || (outputFomat==OF_BUFFER) || (outputFomat==OF_MAT))) - { - std::string eception_msg = "The output format is not supported yet. Please use outputFormat=\"csv\" or outputFormat=\"empty\" or outputFormat=\"matlab\"in simulate command "; - throw ModelicaSimulationError(MODEL_FACTORY,eception_msg.c_str()); - } - } - else - { - throw ModelicaSimulationError(MODEL_FACTORY,"results-filename is not set"); - } string outputPointType_str; OutputPointType outputPointType; @@ -207,13 +190,6 @@ SimSettings OMCFactory::readSimulationParameter(int argc, const char* argv[]) } - /*fs::path results_file_path = fs::path( resultsfilename) ; - if(!(results_file_path.extension().string() == ".csv")) - { - std::string eception_msg = "The output format is not supported yet. Please use outputFormat=\"csv\" in simulate command "; - throw ModelicaSimulationError(MODEL_FACTORY,eception_msg.c_str(); - - }*/ fs::path libraries_path = fs::path( runtime_lib_path) ; fs::path modelica_path = fs::path( modelica_lib_path) ; @@ -223,7 +199,7 @@ SimSettings OMCFactory::readSimulationParameter(int argc, const char* argv[]) - SimSettings settings = {solver,linSolver,nonLinSolver,starttime,stoptime,stepsize,1e-24,0.01,tolerance,resultsfilename,outputFomat,time_out,outputPointType,logSet}; + SimSettings settings = {solver,linSolver,nonLinSolver,starttime,stoptime,stepsize,1e-24,0.01,tolerance,resultsfilename,time_out,outputPointType,logSet}; _library_path = libraries_path; @@ -247,7 +223,7 @@ std::vector OMCFactory::modifyArguments(int argc, const char* argv else if (strncmp(argv[i], "-override=", 10) == 0) { std::map supported = map_list_of ("startTime", "-s")("stopTime", "-e")("stepSize", "-f") - ("tolerance", "-y")("solver", "-i")("outputFormat", "-o"); + ("tolerance", "-y")("solver", "-i"); std::vector strs; boost::split(strs, argv[i], boost::is_any_of(",=")); for (int j = 1; j < strs.size(); j++) { diff --git a/SimulationRuntime/cpp/Solver/CVode/CVode.cpp b/SimulationRuntime/cpp/Solver/CVode/CVode.cpp index 0f58e15cda1..e492c63850f 100644 --- a/SimulationRuntime/cpp/Solver/CVode/CVode.cpp +++ b/SimulationRuntime/cpp/Solver/CVode/CVode.cpp @@ -315,7 +315,7 @@ void Cvode::initialize() void Cvode::solve(const SOLVERCALL action) { bool writeEventOutput = (_settings->getGlobalSettings()->getOutputPointType() == OPT_ALL); - bool writeOutput = !(_settings->getGlobalSettings()->getOutputFormat() == OF_EMPTY) && !(_settings->getGlobalSettings()->getOutputPointType() == OPT_EMPTY); + bool writeOutput = !(_settings->getGlobalSettings()->getOutputPointType() == OPT_NONE); #ifdef RUNTIME_PROFILING MEASURETIME_REGION_DEFINE(cvodeSolveFunctionHandler, "solve"); @@ -455,7 +455,7 @@ void Cvode::CVodeCore() throw ModelicaSimulationError(SOLVER,"CVode::ReInit"); bool writeEventOutput = (_settings->getGlobalSettings()->getOutputPointType() == OPT_ALL); - bool writeOutput = !(_settings->getGlobalSettings()->getOutputFormat() == OF_EMPTY) && !(_settings->getGlobalSettings()->getOutputPointType() == OPT_EMPTY); + bool writeOutput = !(_settings->getGlobalSettings()->getOutputPointType() == OPT_NONE); while (_solverStatus & ISolver::CONTINUE && !_interrupt ) { diff --git a/SimulationRuntime/cpp/Solver/IDA/IDA.cpp b/SimulationRuntime/cpp/Solver/IDA/IDA.cpp index 1e30735117e..01dcc5e8c0b 100644 --- a/SimulationRuntime/cpp/Solver/IDA/IDA.cpp +++ b/SimulationRuntime/cpp/Solver/IDA/IDA.cpp @@ -283,7 +283,7 @@ void Ida::initialize() void Ida::solve(const SOLVERCALL action) { bool writeEventOutput = (_settings->getGlobalSettings()->getOutputPointType() == OPT_ALL); - bool writeOutput = !(_settings->getGlobalSettings()->getOutputFormat() == OF_EMPTY) && !(_settings->getGlobalSettings()->getOutputPointType() == OPT_EMPTY); + bool writeOutput = !(_settings->getGlobalSettings()->getOutputPointType() == OPT_NONE); #ifdef RUNTIME_PROFILING MEASURETIME_REGION_DEFINE(idaSolveFunctionHandler, "solve"); @@ -423,7 +423,7 @@ void Ida::IDACore() throw std::runtime_error("IDA::ReInit"); bool writeEventOutput = (_settings->getGlobalSettings()->getOutputPointType() == OPT_ALL); - bool writeOutput = !(_settings->getGlobalSettings()->getOutputFormat() == OF_EMPTY) && !(_settings->getGlobalSettings()->getOutputPointType() == OPT_EMPTY); + bool writeOutput = !(_settings->getGlobalSettings()->getOutputPointType() == OPT_NONE); while (_solverStatus & ISolver::CONTINUE && !_interrupt ) {