﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
5171	EvaluateFunctions.getStatementLHSScalar generates too large lists	Per Östlund	Volker Waurich	"There seems to be some issues with how `EvaluateFunctions.getStatementLHSScalar` generates the list of assigned scalars in a statement. This affects the HelmholtzMedia library in particular,  for example the model `HelmholtzMedia.Examples.ConvergenceTest.SinglePhase_setState_b` (note: only works with `-d=newInst`).

`SinglePhase_setState_b` uses the function `HelmholtzMedia.Interfaces.PartialHelmholtzMedium` which contains two large if-statements. When `EvaluateFunctions.evaluateFunctions_updateStatement` processes the second of these if-statements it uses `getStatementLHSScalar` to generate a list of outputs (currently EvaluateFunctions.mo:2664):
{{{#!mo
  lhs_expl := List.fold1(statements, getStatementLHSScalar, funcTree, {});
}}}
This generates a list of 2,874,978 expressions, which seems a bit excessive. Obviously this causes the compiler to slow to a crawl, and this is just one of many such lists generated by `getStatementLHSScalar`. The list of outputs generated seem to be full of gibberish such as `f.rt.r.i.liq.s.rd.rt.r.it.liq.d.Tsat.Tsat`, which I assume isn't intended.

(I optimized the code a bit in [changeset:765d7e8/OMCompiler 765d7e8] since List.unique would otherwise take forever on the large lists generated, but the huge lists generated are still a big issue.)"	defect	closed	high	1.16.0	Backend	v1.13.0-dev-nightly	fixed		m.thorade@…
