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

Inline let-expressions before collecting quantifiers for trigger selection #171

Merged

Conversation

jamesbornholt
Copy link
Collaborator

Let expressions can change trigger selections in undesirable ways. For example, this expression:

var p := map n: nat | n in env :: n;
map n: nat | n in p :: n

has n in p selected as a trigger, but if we manually inline p there is no trigger found. n in p isn't a valid trigger here, since p will get inlined into the trigger later.

To fix this, we (temporarily) inline all lets before collecting the set of quantifiers to select triggers for. In some sense this is the converse of #130 -- here we inline lets appearing outside a quantifier.

Fixes #167.

Let expressions make some invalid triggers appear to be valid, so we should
inline them before collecting the quantifiers from their bodies.

Fixes dafny-lang#167
@RustanLeino RustanLeino merged commit 08d40c6 into dafny-lang:master Feb 1, 2018
@jamesbornholt jamesbornholt deleted the inline-before-triggers branch February 1, 2018 18:35
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.

Invalid triggers when using let expressions
2 participants