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

Review logic/expectations for management of named expressions #416

Closed
whart222 opened this issue Apr 4, 2018 · 1 comment
Closed

Review logic/expectations for management of named expressions #416

whart222 opened this issue Apr 4, 2018 · 1 comment

Comments

@whart222
Copy link
Member

whart222 commented Apr 4, 2018

Using Pyomo5 expressions, the named expression objects are the only sub-expressions that are mutable. This form of mutability explicitly represents user expectations that these sub-expressions can change after being used to form an expression tree.

There are two contexts where the implication of this mutability are not clear:

  1. Replacing a terms in an expression with a walker: If we descend into a named expression and replace terms there, then is that named expression replaced in the original expression or preserved?

  2. Cloning an expression: When cloning an expression, when we clone a sub-expression that is a named expression, do we create separate clones for that expression object, or replace the named expression itself? If the latter, then how do we manage those cloned named expressions in the model?

@mrmundt
Copy link
Contributor

mrmundt commented Jan 3, 2024

In an effort to clean up old issues, we are moving some design discussions to our Archived Design Discussions wiki.

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

No branches or pull requests

8 participants