Skip to content
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

Deriving a unit for a lambda expression may cause an out of bounds exception #248

Open
draeger opened this issue May 5, 2022 · 0 comments
Labels

Comments

@draeger
Copy link
Member

draeger commented May 5, 2022

Lambda expressions are placeholders that are filled with arguments when the expression is called. Consequently, their units can in many cases not directly be derived if arguments are passed to the expression. The reason is that SBML does not restrict assignable types in lambda expressions. Consequently, various objects (such as species, compartments, or parameters) could be passed to a lambda expression when a function is called. If used in muliple places, the same function may result in varying derived units. In its current form, the attempt to derive units of a lambda expression itself (i.e., not within a call hierarchy but the structure itself) may result in an out of bounds exception because the lambda expression itself does not know which arguments are possibly passed to it. Those have to be filled in when the expression is called. More specifically, the in methods such as astNodeToTree wihtin ASTNode units are derived for the node and for lambda nodes the children are necessary for this derivation. The children are not present at that time, however, because addChild() is responsible for adding them.

Consequently, the derivation of units from lambda expressions in the corresponding units compiler needs to be revised.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant