﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
1227	Perform constant evaluation only for bindings of structural parameters	Adrian Pop	Per Östlund	"Right now constant evaluation is performed always if the expression given to Ceval.ceval is constant.\\
This takes a lot of time and is not needed during instantiation.\\
\\
Constant evaluation should only be performed for bindings of structural parameters.\\
A parameter is structural if:\\
- is used in an array dimension: {{{Real x[structParam];}}}\\
- is used in a condition of a conditional component: {{{Real x if structParam;}}}\\
- is used in a condition of an if equation: {{{equation if structParam then ... ;}}}\\
- has a binding that is a structural parameter (from an outside modification): 
  {{{Type x(structParamam=structParamOutside);}}}\\
\\
A possible implementation would extend Env.VAR with a new boolean component: isStructuralParameter.\\
Lookup.lookupVar would return this boolean too.\\
Static.elabExp will only perform constant evaluation if the given expression is a component reference that
is a structural parameter.\\
During instantiation when Static.elabExp is called on expressions that appear in arrays dimensions, if, etc. (see above) you first update the component reference in the environment and set isStructuralParameter to true.\\
\\
Cheers,\\
Adrian Pop/"	defect	closed	critical	2.0.0	Instantiation		fixed		Adrian Pop Per Östlund
