Skip to content

Resolved Silver issue #586#587

Merged
alexanderjsummers merged 4 commits into
viperproject:masterfrom
dewert99:wand-let
Jun 16, 2022
Merged

Resolved Silver issue #586#587
alexanderjsummers merged 4 commits into
viperproject:masterfrom
dewert99:wand-let

Conversation

@dewert99

@dewert99 dewert99 commented Jun 7, 2022

Copy link
Copy Markdown
Contributor

Fixes #586

@alexanderjsummers alexanderjsummers left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me - indeed, let expressions should be treated analogously to quantified variables (inside wands).

Minor but could you add to the test a case that is supposed to fail (with appropriate test annotations)? Maybe mixing two lets/quantifiers in different orders, but renaming them so that syntactically the inner assertions look identical?

Comment thread src/test/resources/all/issues/silver/0586.vpr Outdated
@dewert99

dewert99 commented Jun 7, 2022

Copy link
Copy Markdown
Contributor Author

I've fixed the 'x' vs 'y' issue, and added an intentionally failing test.
I didn't give a test that mixes let and forall because

method test3(xs: Set[Bool]) {
  package (forall b1: Bool :: let ys == (xs) in (b1 in ys ==> true)) --* true
}

Gives java.lang.RuntimeException: Internal Error: variable ys is not defined. independently of the changes made here which should probably be it's own issue
Edit: The error is only in Carbon

@alexanderjsummers alexanderjsummers left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, thanks!

Please do file a Carbon issue for the crash you found when mixing binders.

@alexanderjsummers alexanderjsummers merged commit 119564b into viperproject:master Jun 16, 2022
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.

Wands nesting let bindings treated too syntactically

3 participants