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

Excluding bound variables of match expressions when computing free variables #363

Merged
merged 1 commit into from
Aug 26, 2019

Conversation

amaurremi
Copy link
Contributor

When we compute the free variables of an expression we need to exclude its bound variables. At the moment, the computation of the free variables of an expression only excludes bound variables of "comprehension" expressions (which include lambdas, forall statements, etc.) but does not take into account the bound variables that can be introduced in the cases of pattern matching. This PR fixes this.

@RustanLeino @samuelgruetter

@amaurremi
Copy link
Contributor Author

This bug manifested itself when compiling the StateMonad.dfy test without the compile:0 option, resulting in a runtime exception. I now disabled that option, so the extensive pattern matching in the state-monad test serves as a test case for this fix.

@RustanLeino RustanLeino merged commit 5f69eca into dafny-lang:master Aug 26, 2019
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.

None yet

2 participants