Nothing Special   »   [go: up one dir, main page]

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

Fix env usage #700

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open

Fix env usage #700

wants to merge 19 commits into from

Conversation

enmag
Copy link
Contributor
@enmag enmag commented Jul 27, 2021

I tried to make the naming of environment more uniform: now it should always appear as env.
This breaks backward compatibility since a call like pippo(environment=my_env) should be modified to pippo(env=my_env).

In addition, I tried to reduce the number of places where the code ends up calling get_env to obtain an environment.
I am using multiple environments and this behavior was causing some issues.
In some classes and methods I have added an optional env parameter so that they should work within the given environment if any.
I should have "fixed" al the calls to get_free_variables, simplify and substitute, and most of the calls to get_type.

enmag added 14 commits July 27, 2021 17:45
Replace calls to FNode member functions `substitute`, `simplify` and `get_free_variables` with corresponding calls to the `substituter`, `fvo` and `simplifier` objects in the environment.
…ce different from the one at the top of the stack.

Remove direct calls to `get_free_variables`, `simplify` and `substitute` of FNode.
Replace calls to `get_free_variables`, `simplify` and `substitute` on FNode with the corresponding calls on the `fvo`, `simplifier`, `substituter` instances in the environment.
@marcogario
Copy link
Contributor

👋 Is this something that we still want to do?

If so, I would probably separate the "cosmetic" breaking change of renaming environment to env from the "correctness" change of avoiding the global environment when there is one that is more appropriate.

We can also look into making the rename non-breaking by introducing a secondary keyword argument, but I am not sure this is worth the effort.

@mikand
Copy link
Contributor
mikand commented Jul 8, 2022

I second @marcogario: the aesthetic fix is secondary compared to add the customizability of the environment.

I think very few users are using custom environments, so the breaking change should not be too disruptive

@enmag
Copy link
Contributor Author
enmag commented Jul 8, 2022

At the moment I don't exactly remember the status of this PR.
I believe I might have already changed "all" environment to env.

In the next few days I will try to check its status and update it.

@enmag
Copy link
Contributor Author
enmag commented Jul 17, 2022

It appears there is at least 1 test case failing: yices on macos.

I am unable to reproduce the error on my linux machine.

Any suggestions?
@mikand

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.

3 participants