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

Rewrite prof:variables() to preserve known variables #2380

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

GuntherRademacher
Copy link
Member

This is an attempt to solve #1115, based on the suggestion made there to rewrite the call to prof:variables() by fixing the set of variables early.

The approach taken here is to evaluate the VarScope obtained from cc.vs() at optimization time and replace prof:variables() with a new function call that takes the values of the known variables as arguments. The new function is instantiated with the corresponding list of variable names.

One problem with VarScope is that it may contain additional variables that are undefined where prof:variables() is called. Their references are carried along, but they cannot be evaluated. This is handled by allowing them to be evaluated to Java null and filtering them out on that basis. Admittedly, it would be nicer if one could only handle defined variables, but I have not found an equally simple and isolated solution for this.

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

Successfully merging this pull request may close these issues.

1 participant