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

Fault tree variable redefinition allowance breaks the declarative language #50

Open
rakhimov opened this Issue Jul 30, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@rakhimov
Member

rakhimov commented Jul 30, 2017

From the MEF Fault Tree description (chapter 4, section 1):

If a variable or a parameter is declared more than once,
tools should emit a warning
and consider only the last definition as the good one (the previous ones are just ignored).

This is strange for a declarative modeling language
since now the order of declarations matters.
It is more like assignments of imperative languages.

As tested with XFTA,
it doesn't allow 'redefinition'.
I went this direction as well with SCRAM.

I could imagine many subtle analysis discrepancies
due to the allowance of redefinitions.
Imagine working with multi-file models.
Now if the order of files is changed or not remembered,
the analysis may be inconsistent
if it contains redefinitions spread across files.

@cfolleau

This comment has been minimized.

Member

cfolleau commented Jul 31, 2017

Totally agree.
For a modelling language it is dangerous to allow multiple declaration. Albizia (our computation engine) send a error iin this case.

The only use I see is for people who would like to use open-psa format as a scripting language to do computation. But it is not the purpose.

@rakhimov rakhimov referenced a pull request that will close this issue Jan 8, 2018

Open

Disallow variable redefinition in fault trees #57

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment