-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Model
should consider all type dependencies
#1074
Comments
I think parsing the generated specification should lead to an identical model. So I would propose to add this automatic dependency resolution to the constructor of |
@treiher
|
I think that can be solved algorithmically. When sequentially analyzing the types, the types which are not yet part of the model, but are dependencies, are added in front of the current analyzed type.
A simple option would be removing duplicates in the resulting list after the dependency resolution. Just keep the first instance of a type - the |
Model.create_specifications
should consider all type dependenciesModel
should consider all type dependencies
I think it's probably better not to make the distinction according to whether the type dependency is in the |
Apart from the fix for #1074, this commit also includes the following changes: * Fix `split_disjunctions` in `Validator._create_model` * (BREAKING) Make `Type.*dependencies` list deps in postorder * Correct the definition of `Refinement.*dependencies`
Apart from the fix for #1074, this commit also includes the following changes: * Fix `split_disjunctions` in `Validator._create_model` * (BREAKING) Make `Type.*dependencies` list deps in postorder * Correct the definition of `Refinement.*dependencies`
Now it's possible to have manually-generated
Model
s without all the type dependencies in theModel
itself.For example, when
[t, v, m]
in L161 is changed to[v, m]
in the snippet below:https://github.com/Componolit/RecordFlux/blob/625853660cfa6074d2862be14bd4729cf8855a27/tests/unit/model/model_test.py#L157-L161
AFAIK, omitting dependencies in the
Model
itself won’t affect its functionality inPyRFLX
. However, this might cause problems when exporting suchModel
s, since the exported files will lack necessary type declarations which will affect their validity.Ideally, when exporting a Model to
.rflx
files, no manual management of type dependencies should be required, i.e. RecordFlux should be able to automatically find all dependencies and add them to the exported files.In the example above, that would mean the exported files should always contain
[t, v, m]
regardless of whethert
is actually included in the list, becausev
andm
depends ont
.The text was updated successfully, but these errors were encountered: