This repository was archived by the owner on May 18, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +7
-13
lines changed Expand file tree Collapse file tree 5 files changed +7
-13
lines changed Original file line number Diff line number Diff line change @@ -167,7 +167,6 @@ algorithm
167167 algorithm
168168 (outExp, outChanged) := Expression . mapFoldShallow(exp,
169169 function evaluateExpTraverser(isExternalArg = Call . isExternal(exp. call)), false );
170- evaluateFunction(Call . typedFunction(exp. call));
171170 then
172171 outExp;
173172
@@ -443,12 +442,6 @@ algorithm
443442 then
444443 outExp;
445444
446- case Expression . CALL ()
447- algorithm
448- evaluateFunction(Call . typedFunction(e. call));
449- then
450- e;
451-
452445 else if outChanged then Expression . retype(e) else e;
453446 end match;
454447
Original file line number Diff line number Diff line change @@ -86,6 +86,8 @@ import Ceval = NFCeval;
8686import NFTyping.ExpOrigin ;
8787import SimplifyExp = NFSimplifyExp ;
8888import Restriction = NFRestriction ;
89+ import EvalConstants = NFEvalConstants ;
90+ import SimplifyModel = NFSimplifyModel ;
8991
9092public
9193type FunctionTree = FunctionTreeImpl . Tree ;
@@ -1505,6 +1507,8 @@ function flattenFunction
15051507 input output FunctionTree funcs;
15061508algorithm
15071509 if not Function . isCollected(fn) then
1510+ EvalConstants . evaluateFunction(fn);
1511+ SimplifyModel . simplifyFunction(fn);
15081512 Function . collect(fn);
15091513
15101514 if not InstNode . isPartial(fn. node) then
Original file line number Diff line number Diff line change @@ -491,7 +491,7 @@ uniontype Function
491491 input Function fn;
492492 algorithm
493493 if Pointer . access(fn. status) <> FunctionStatus . BUILTIN then
494- Pointer . update(fn. status, FunctionStatus . COLLECTED );
494+ Pointer . update(fn. status, FunctionStatus . SIMPLIFIED );
495495 end if ;
496496 end markSimplified;
497497
Original file line number Diff line number Diff line change @@ -157,8 +157,6 @@ algorithm
157157 flat_model := EvalConstants . evaluate(flat_model);
158158 flat_model := SimplifyModel . simplify(flat_model);
159159 funcs := Flatten . collectFunctions(flat_model, name);
160- funcs := FunctionTree . map(funcs, SimplifyModel . simplifyFunction);
161- execStat("SimplifyModel.simplifyFunction" );
162160
163161 // Collect package constants that couldn't be substituted with their values
164162 // (e.g. because they where used with non-constant subscripts), and add them
Original file line number Diff line number Diff line change @@ -450,8 +450,7 @@ algorithm
450450end simplifyIfStmtBranches;
451451
452452function simplifyFunction
453- input Absyn . Path name;
454- input output Function func ;
453+ input Function func ;
455454protected
456455 Class cls;
457456 Algorithm fn_body;
@@ -485,7 +484,7 @@ algorithm
485484
486485 for fn_der in func . derivatives loop
487486 for der_fn in Function . getCachedFuncs(fn_der. derivativeFn) loop
488- simplifyFunction(Function . name(der_fn), der_fn);
487+ simplifyFunction(der_fn);
489488 end for ;
490489 end for ;
491490 end if ;
You can’t perform that action at this time.
0 commit comments