Opened 8 years ago

Last modified 4 years ago

#4138 closed task

New FrontEnd — at Version 78

Reported by: Per Östlund Owned by: Per Östlund
Priority: blocker Milestone: 1.17.0
Component: New Instantiation Version:
Keywords: Cc: Mahder Alemseged Gebremedhin, Adrian Pop

Description (last modified by Adrian Pop)

This ticket is tracking the progress on the the new frontend. Some documentation on the new frontend development is available on wiki:NewFrontEnd.

The current status is:

Instantiation (Per, Adrian) 80%
Instantiation of long and short class definitions are implemented. Still missing are overloaded functions and partial derivative functions. Basic support for class extends is implemented.
Extends (Per) 90%
Support for extends is implemented. More error checking is needed though, e.g. for duplicate elements (handling implemented, but the check whether two elements are identical needs to be improved) and illegal class types.
Lookup (Per) 90%
Basic lookup is implemented, both for class names and crefs. Very little error checking is done beyond "name could not be found" though.
Modifiers (Per) 80%
Support of modifiers on components, extends clauses and class modifiers is implemented, more testing is needed.
Redeclare (Per) 80%
Basic redeclare of components and classes, both as modifiers and elements, is implemented. Merging of modifiers, constraining type, etc., needs more work.
Imports (Per, Adrian) 95%
Imports are now mostly handled, both for classes and components. More error checking is needed:
  • Enforce that imports use the form [package.]definition.
  • Handle shadowing correctly.
Conditional Components (Per or Adrian)
Basic support for evaluating conditions and removing components with condition false is implemented, but connections involving such components are not yet removed.
Inner/Outer (Per) 90%
Inner/outer support is implemented, except for checking that outer elements are subtypes of inner.
Functions (Per, Adrian, Peter, Mahder) 75%
Partial support for functions. Instantiation and typing of functions is implemented. Positional arguments and named arguments are supported. *Vectorization support needs do be adapted*. Preliminary support for reductions is implemented. Support for function trees exists. Allow arrays of unknown size in functions.
Records (Per) 50%
Record bindings should be implemented, #4872.
Builtin (Per, Mahder, Martin) 80%
So far only support for the basic types and time is implemented. Support for all the builtin functions and other builtin things (e.g. StateSelect (implemented), ExternalObject (implemented), etc.) needs to be implemented. As much as possible should be implemented via ModelicaBuiltin. Tests added. Support for functions with variable number of arguments not yet implemented.
Reduction operators and Builtin Array functions (Mahder) 80%
First the function handling needs to be completed by Mahder. Adapt the old Static.mo to the new expressions types in the NF. matrix, vector, scalar, {}, [].
Typing (Per, Mahder) 100%
The infrastructure for typing expressions is implemented, what remains is mostly bug fixing and applying typing when implementing new features.
Type Checking (Mahder, Peter, Per) 80%
Type checking is mostly implemented, but probably needs to be improved to make sure it handles all cases.
Flattening (Per) 70%
Handling of array bindings needs to be improved, otherwise it's mostly working.
Connection Handling (Per) 60%
Handling of connect equations using the DAE and the instance tree. Basic handling of connections is implemented, missing:
  • some stream connectors cases (inStream works, not actualStream)
  • expandable connectors
Unit checking (Arun, Martin, Mahder) 100%
Ported the backend unit checking to the new frontend. Added tests. Based on the DAE intermediate form. Some more improvements. Scalability is not that good.
Operator Overloading (Mahder & Martin) 90%
The support for operator overloading from the current front-end (or the previous implementation of the new front-end) should be ported to the new front-end. Most of the Operator Overloading resolution is done, lookup of actual deoverloaded functions is needed.
Constant Evaluation (Lennart) 90%
Constant evaluate structural parameters (minimal) or any other constant/parameter bindings (not by default). Per implemented a new type of DAE component reference that contains links to the instantiated component tree on which one can do evaluation of bindings. Support for evaluating expressions has been implemented except ranges, sizes, records. We should ONLY evaluate what we need and nothing more.
Function Evaluation (Per) 20%
Sometimes to evaluate structural parameters one needs to evaluate functions. This will port the function interpretation from the current front-end to the new front-end.
Expression Simplification (Per) 50%
Support expression simplification needed to transform the expressions in such a way that the backend can handle them.
Local balance checking (Mahder)
This will check the balance checking for each model so that errors can be detected sooner. We had no such support in the current front-end.
Synchronous Features (BernhardT)
The handling of the synchronous features (Clocks, etc) and state machines should be ported from the current front-end to the new front-end. This functionality needs function, builtin and inner/outer support.
OMC <-> OMEdit Communication (Adeel, Adrian) 70%
The new front-end should be used by OMEdit to query information about a model instantiation. A new OMC API is needed to handle the GUI in a much faster way than with the current front-end. OMEdit should query the instantiated class directly to retrieve components, annotations, etc.

This is a list of all tickets opened for New Instantiation. Note that tickets with id > 4000 were opened specifically during the development of the new front end, while older ones refer to old issues with the old front end that are expected to be fixed by the new one.

Number of tickets: 57

Priority: blocker (14 matches)

Ticket Summary Status Owner Type Milestone Version
#2484 Expandable connector resolution misses components assigned Per Östlund defect 2.0.0 trunk
#3977 Better diagnostics for non-balanced models new Lennart Ochel enhancement 2.0.0
#4120 Out-of-bounds array elements undetected by front-end assigned Per Östlund defect 2.0.0
#4496 Complex 'sum' does not work assigned Per Östlund defect 2.0.0
#5240 NFEvalFunction.evaluateExternal is not yet implemented reopened Per Östlund defect 2.0.0
#5597 Two examples of the new Modelica.Electrical.Batteries package do not work with the new frontend new Per Östlund defect 2.0.0 v1.14.0-dev-nightly
#5605 Parameter with only start value not accepted new Per Östlund defect 2.0.0
#5837 Unit checking is not performed on operator record equations new Per Östlund defect 2.0.0
#5847 Constant is used without having been given a value new Per Östlund defect 2.0.0 v1.16.0-dev
#5866 Update Save Total to NF new Per Östlund defect 2.0.0
#6047 The NF incorrectly infers the variability of a function call in Modelica.Media new Per Östlund defect 2.0.0
#6126 Error while compiling wind turbine model from PowerSystems library assigned Per Östlund defect 1.19.0
#6149 The NF accepts illegal type declarations? new Per Östlund defect 2.0.0
#6383 Omc doesn't check correctly the constraining-clause new Per Östlund defect 2.0.0 1.18.0-dev

Priority: critical (2 matches)

Ticket Summary Status Owner Type Milestone Version
#3186 Partial binding of record sub-components in functions are lost assigned Per Östlund defect 2.0.0 trunk
#6373 Electrical Quasistationary MutualInductor in standard library not working in OM assigned Per Östlund defect 1.16.2

Priority: high (26 matches)

Ticket Summary Status Owner Type Milestone Version
#1842 Illegal redeclare should be rejected by the NF with appropriate error message assigned Per Östlund defect 2.1.0
#2010 Prefix rules needs more work in new instantiation new Per Östlund defect 2.1.0 trunk
#2153 Better analysis for function completion new Per Östlund defect 2.1.0 trunk
#2367 Record with vectors, zeros(), size() accepted Adrian Pop defect Future trunk
#2385 Missing variable declarations in instantiated model when using expandable connectors reopened Adrian Pop defect 2.0.0 trunk
#2387 Operator overloading fails for matrices assigned Per Östlund defect 2.0.0 trunk
#2447 Let OM automatically load packages as specified in import statements reopened Per Östlund enhancement 1.19.0 trunk
#4442 Incorrect evaluation of inner/outer and record dependencies assigned Per Östlund defect 2.0.0 v1.11.0
#4515 Automatic inference of nominal attributes for scaling new Per Östlund discussion 2.0.0
#4526 Propagate displayUnits on simple equations new Mahder Alemseged Gebremedhin enhancement
#4603 Provide support for start-value selection according to the Modelica Specification assigned Karim Adbdelhak defect
#4901 The NF does not check if redeclared functions are legal new Per Östlund defect 2.1.0
#4905 Restriction on input connection is not enforced by OMC assigned Per Östlund defect 2.1.0
#4908 [NF] Issues with inner/outer with redeclare new Per Östlund defect Future
#4960 Evaluate all parameters except some new Per Östlund enhancement 2.0.0
#5061 [NF] Are public parameters allowed in functions by the Modelica spec? new Per Östlund defect 2.0.0
#5334 Check for wrong annotations new Per Östlund enhancement 2.1.0
#5474 [NF] Lookup of inner class fails new Per Östlund defect
#5545 Improve diagnostics for wrong connectors new Per Östlund enhancement 2.1.0
#5579 New Frontend does not check for circular dependencies in parameter bindings new Per Östlund defect Future
#5667 Arrays of records insufficiently type checked new Per Östlund defect 2.1.0 v1.14.0-dev-nightly
#5730 Issue with operator record constructors in NF new Per Östlund defect
#6163 Constrainedby clause not verified by the NF new Per Östlund defect 2.1.0
#6213 Lookup in wrong scope when redeclaring function field in a function accepted Per Östlund defect v1.17.0-dev
#6325 Support for ExternData assigned Per Östlund defect 1.16.0
#6423 Optionally list all empty connection sets new Per Östlund enhancement 1.16.2

Priority: normal (11 matches)

Ticket Summary Status Owner Type Milestone Version
#1080 Constraining type on redeclarations (from MathCore) new krsta defect 2.1.0 trunk
#1939 Duplicate class detection not working when loading MSL reopened Per Östlund defect trunk
#2276 detecting size mismatch for output arguments in functions reopened somebody defect 2.1.0 trunk
#3221 Equation count of models containing expandable connectors assigned Mahder Alemseged Gebremedhin defect 2.0.0 trunk
#4648 Add support for annotation for turning off replaceable check new Per Östlund enhancement Future v1.13.0-dev-nightly
#4843 NF doesn't evaluate size expression of function input parameters new Per Östlund defect 2.1.0 v1.13.0-dev-nightly
#5178 Incorrect Warning - not balanced connector reopened Per Östlund defect 2.1.0
#5598 redeclaration of input as output with NF assigned Per Östlund discussion v1.14.0-dev-nightly
#5688 Use of removed conditional component not reported new Per Östlund defect Future
#5852 getCommandLineOptions fails with newInst new Per Östlund defect v1.16.0-dev
#6114 Unit checking scales with O(2^N) in case of large expressions involving +-*/ operators assigned Per Östlund defect 2.0.0 v1.16.0-dev

Priority: low (4 matches)

Ticket Summary Status Owner Type Milestone Version
#1747 Implement checks for all connection rules in chapter 9 new Per Östlund task Future
#3121 Missing bindings in flattened operator overloading example assigned Per Östlund defect 2.1.0 trunk
#6293 Function non-inputs are initialized in the wrong order new Per Östlund defect v1.17.0-dev
#6390 Cannot extend from RealOutput new Per Östlund defect 1.16.2


Change History (79)

comment:1 by Per Östlund, 8 years ago

Cc: Mahder Alemseged Gebremedhin Adrian Pop added

comment:2 by Per Östlund, 8 years ago

Description: modified (diff)

comment:3 by Per Östlund, 8 years ago

Description: modified (diff)

comment:4 by Francesco Casella, 8 years ago

Still some problems with component modifiers. Running the following test script

loadString("
package P
  model A
    parameter Real p;
  end A;
  model B
    parameter Real q = 2;
    A a1(p = q);
  end B;
  model C
    parameter Real q = 2;
    A a1(p = q);
    A a2(p = q);
  end C;
end P;
");
setCommandLineOptions("-d=newInst");
instantiateModel(P.B);
instantiateModel(P.C);

returns

true
true
"class B
  parameter Real q = 2;
  parameter Real a1.p = q;
end B;
"
""

so for some reason model C is not instantiated at all.

in reply to:  4 ; comment:5 by Per Östlund, 8 years ago

Replying to casella:

Still some problems with component modifiers.

I am well aware of that, and have already fixed this particular issue locally a while ago. At the moment I'm not really interested in bug reports though, the new instantiation is not ready for public testing yet.

in reply to:  5 ; comment:6 by Francesco Casella, 8 years ago

Replying to perost:

At the moment I'm not really interested in bug reports though, the new instantiation is not ready for public testing yet.

Q1: Can you give a reasonable estimate of when this will be possible?

Q2: Is the interface towards the other tasks of Phase 2 already stabilized? If not, when will it reasonably be?

in reply to:  6 comment:7 by Per Östlund, 8 years ago

Replying to casella:

Q1: Can you give a reasonable estimate of when this will be possible?

No

Q2: Is the interface towards the other tasks of Phase 2 already stabilized? If not, when will it reasonably be?

Maybe

comment:8 by Per Östlund, 8 years ago

Class modifiers have been implemented now, but needs more testing.

in reply to:  4 comment:9 by Francesco Casella, 8 years ago

The test case reported in comment:4 now produces the expected result

comment:10 by Francesco Casella, 8 years ago

However, instantiating P.S in the attached test case still fails

by Francesco Casella, 8 years ago

Attachment: P.mo added

in reply to:  10 ; comment:11 by Per Östlund, 8 years ago

Replying to casella:

However, instantiating P.S in the attached test case still fails

It works fine for me, are you using the latest nightly build?

in reply to:  11 comment:12 by Francesco Casella, 8 years ago

Replying to perost:

Replying to casella:

However, instantiating P.S in the attached test case still fails

It works fine for me, are you using the latest nightly build?

I thought so, but I wasn't. With OpenModelica-v1.11.0-dev-288-g2ccad20-64bit, it works fine for me also :)

comment:13 by Per Östlund, 8 years ago

Description: modified (diff)

comment:14 by Per Östlund, 8 years ago

Description: modified (diff)

comment:15 by Adrian Pop, 8 years ago

Component: *unknown*NF - New FrontEnd
Description: modified (diff)

comment:16 by Adrian Pop, 8 years ago

Description: modified (diff)

comment:17 by Adrian Pop, 8 years ago

Description: modified (diff)

comment:18 by Adrian Pop, 8 years ago

Description: modified (diff)
Summary: NF coreNew FrontEnd

comment:19 by Adrian Pop, 8 years ago

Milestone: Future2.0.0
Priority: highblocker
Type: defecttask

comment:20 by Adrian Pop, 8 years ago

Description: modified (diff)

comment:21 by Per Östlund, 8 years ago

Description: modified (diff)

Initial support for enumerations is now implemented.

Last edited 8 years ago by Per Östlund (previous) (diff)

comment:22 by Francesco Casella, 8 years ago

Description: modified (diff)

Added link to wiki page

comment:23 by Adrian Pop, 8 years ago

Description: modified (diff)

Small status update.

comment:24 by Adrian Pop, 8 years ago

Description: modified (diff)

comment:25 by Adrian Pop, 8 years ago

Description: modified (diff)

comment:26 by Adrian Pop, 8 years ago

Description: modified (diff)

comment:27 by Adrian Pop, 8 years ago

Description: modified (diff)

comment:28 by Adrian Pop, 8 years ago

Description: modified (diff)

comment:29 by Adrian Pop, 8 years ago

Description: modified (diff)

comment:30 by Adrian Pop, 8 years ago

Description: modified (diff)

comment:31 by Adrian Pop, 8 years ago

Description: modified (diff)

comment:32 by Adrian Pop, 8 years ago

Description: modified (diff)

comment:33 by Adrian Pop, 8 years ago

Description: modified (diff)

comment:34 by Adrian Pop, 8 years ago

Description: modified (diff)

comment:35 by Adrian Pop, 8 years ago

Description: modified (diff)

comment:36 by Adrian Pop, 8 years ago

Description: modified (diff)

comment:37 by Adrian Pop, 8 years ago

Description: modified (diff)

comment:38 by Adrian Pop, 8 years ago

Description: modified (diff)

comment:39 by Adrian Pop, 8 years ago

Description: modified (diff)

comment:40 by Francesco Casella, 8 years ago

I just tried out ScalableTestSuite.Elementary.SimpleODE.Models.CascadedFirstOrder:

model CascadedFirstOrder
  parameter Integer N = 10 "Order of the system";
  parameter Modelica.SIunits.Time T = 1 "System delay";
  final parameter Modelica.SIunits.Time tau = T/N "Individual time constant";
  Real x[N] (each start = 0, each fixed = true);
equation
  tau*der(x[1]) = 1 - x[1];
  for i in 2:N loop
    tau*der(x[i]) = x[i-1] - x[i];
  end for;
end CascadedFirstOrder;

but it still doesn't work, I get

Error: Type mismatch for positional argument 1 in der(x=x[1]).
The argument has type: Real[10]
expected type: Real

This is a very basic model, and it doesn't use arrays in any fancy way. This error looks to me more like a bug than a missing feature.

Would you mind fixing this issue so we can start getting some results from testing the ScalableTestSuite with the new front-end?

Thanks

Francesco

in reply to:  40 comment:41 by Per Östlund, 8 years ago

Replying to casella:

This is a very basic model, and it doesn't use arrays in any fancy way. This error looks to me more like a bug than a missing feature.

Subscripting is not implemented yet, so it is actually a missing feature. It's high up on my todo list, but other things currently has higher priority for me.

comment:42 by Francesco Casella, 8 years ago

OK. I interpreted "Subscripting needs to be improved" as "there is already some subscripting implemented" :)

comment:43 by Mahder Alemseged Gebremedhin, 7 years ago

Description: modified (diff)

comment:44 by Per Östlund, 7 years ago

Description: modified (diff)

Updated description for redeclares (better in general, but class extends/element redeclares currently broken) and imports.

in reply to:  40 comment:45 by Per Östlund, 7 years ago

Replying to casella:

Would you mind fixing this issue so we can start getting some results from testing the ScalableTestSuite with the new front-end?

This model should start working in about five minutes, once Hudson pulls in my latest changes.

comment:46 by Francesco Casella, 7 years ago

Very good!

comment:47 by Adrian Pop, 7 years ago

Description: modified (diff)

comment:48 by Adrian Pop, 7 years ago

Description: modified (diff)

comment:49 by Per Östlund, 7 years ago

Description: modified (diff)

comment:50 by Adrian Pop, 7 years ago

Description: modified (diff)

comment:51 by Adrian Pop, 7 years ago

Description: modified (diff)

comment:52 by Per Östlund, 7 years ago

Description: modified (diff)

comment:53 by Per Östlund, 7 years ago

Description: modified (diff)

comment:54 by Per Östlund, 7 years ago

Component: NF - New FrontEndNew Instantiation

Move all tickets from NF - New Frontend to New Instantiation so we don't have two different categories for the same thing.

comment:55 by Adrian Pop, 7 years ago

Description: modified (diff)

comment:56 by Francesco Casella, 7 years ago

Description: modified (diff)

comment:57 by Adrian Pop, 7 years ago

Description: modified (diff)

comment:58 by Adrian Pop, 7 years ago

Description: modified (diff)

comment:59 by Adrian Pop, 7 years ago

Description: modified (diff)

comment:60 by Adrian Pop, 7 years ago

Description: modified (diff)

comment:61 by Per Östlund, 7 years ago

Description: modified (diff)

comment:62 by Per Östlund, 7 years ago

Description: modified (diff)

comment:63 by Adrian Pop, 7 years ago

Description: modified (diff)

comment:64 by Adrian Pop, 7 years ago

Description: modified (diff)

comment:65 by Adrian Pop, 7 years ago

Description: modified (diff)

comment:66 by Mahder Alemseged Gebremedhin, 7 years ago

Description: modified (diff)

comment:67 by Per Östlund, 7 years ago

Description: modified (diff)

comment:68 by Per Östlund, 7 years ago

Description: modified (diff)

comment:69 by Per Östlund, 7 years ago

Description: modified (diff)

comment:70 by Adrian Pop, 7 years ago

Description: modified (diff)

comment:71 by Adrian Pop, 7 years ago

Description: modified (diff)

comment:72 by Adrian Pop, 7 years ago

Description: modified (diff)

comment:73 by Adrian Pop, 7 years ago

Description: modified (diff)

comment:74 by Adrian Pop, 7 years ago

Description: modified (diff)

comment:75 by Francesco Casella, 7 years ago

Description: modified (diff)

comment:76 by Francesco Casella, 7 years ago

Description: modified (diff)

comment:77 by Adrian Pop, 7 years ago

Description: modified (diff)

comment:78 by Adrian Pop, 6 years ago

Description: modified (diff)

Overconstrained connection graph is now implemented via #4966.

Note: See TracTickets for help on using tickets.