-
Notifications
You must be signed in to change notification settings - Fork 21
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
17.1.2 Connections with self permitted in parser and validator #300
Comments
I would say that the parser should allow this (since it respects CellML's syntax), but the validator should definitely report connections with self (since it doesn't respect CellML's semantics). |
This part of the code is not the problem with the validation. The job of this part of the code is to set variable equivalence and that's it. The section of code that deals with validation is in the The parser should definitely allow this to parse. |
@hsorby I'd thought that the point of the I've added code to the validator to return an error if self-equivalence is found: |
Yes it is to prevent duplicate equivalences from occurring but it is not for preventing self equivalences. |
... but is there a reason it can't do both? I mean, if the code is already preventing one error (instead of letting the validator do it) is there a design rationale that says it can't prevent others too? |
There is a design rationale it's to stop you adding the same equivalence over and over again once you have added it there is no need to add any more. A smaller stack of equivalent variables is easier to manage and iterate over. The intent of the function is to set one variable equivalent to another not to prevent self equivalence. I think it is also important to note that we are not trying to stop users from creating self-equivalences. The less we dictate how the library is used the better in my opinion. |
Self-equivalence is now tested and reported by the validator (against 17.1.2 "component_1 must not equal component_2") in #304 but not prevented from happening elsewhere. |
We don't close the issue until the code in this repository actually has the fix. That is to say once the PR that addresses this issue is merged. |
Validator checks this now in PR #355 |
See 17.1.2: Just wanted to check that the situation of a connection having identical component_1=component_2 is not permitted? Currently this is getting through the parser and the validator:
Parser:
Validator:
... because of this bit of code. First time around it's set, second time does not enter the if statement.
Thoughts?
The text was updated successfully, but these errors were encountered: