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

Declaration of generic extreme predicate causes crash #2947

Closed
RustanLeino opened this issue Oct 29, 2022 · 0 comments · Fixed by #2984
Closed

Declaration of generic extreme predicate causes crash #2947

RustanLeino opened this issue Oct 29, 2022 · 0 comments · Fixed by #2984
Assignees
Labels
crash Dafny crashes on this input, or generates malformed code that can not be executed kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label part: verifier Translation from Dafny to Boogie (translator)

Comments

@RustanLeino
Copy link
Collaborator

The following program declarations cause the verifier to emit malformed Boogie:

codatatype Stream<X> = Nil | Cons(head: X, tail: Stream<X>)

least predicate Finite<X>(s: Stream<X>) {
  s == Nil || Finite(s.tail)
}

Note that the least predicate is defined with a type parameter.

Here is the output, where the error messages are coming from Boogie.

test.dfy(5,25): Error: undeclared identifier: _module._default.Finite$X
test.dfy(5,25): Error: undeclared identifier: _module._default.Finite$X
test.dfy(5,25): Error: undeclared identifier: _module._default.Finite$X
test.dfy(5,25): Error: undeclared identifier: _module._default.Finite$X
test.dfy(5,25): Error: undeclared identifier: _module._default.Finite$X
test.dfy(5,25): Error: undeclared identifier: _module._default.Finite$X
test.dfy(5,25): Error: undeclared identifier: _module._default.Finite$X
test.dfy(5,25): Error: undeclared identifier: _module._default.Finite$X
test.dfy(5,25): Error: undeclared identifier: _module._default.Finite$X
@RustanLeino RustanLeino added kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label part: verifier Translation from Dafny to Boogie (translator) crash Dafny crashes on this input, or generates malformed code that can not be executed labels Oct 29, 2022
@RustanLeino RustanLeino self-assigned this Nov 3, 2022
keyboardDrummer added a commit that referenced this issue Nov 28, 2022
Fixes #2947

This PR fixes some missing type substitutions that affected the Boogie
translation of extreme predicates.

<small>By submitting this pull request, I confirm that my contribution
is made under the terms of the [MIT
license](https://github.com/dafny-lang/dafny/blob/master/LICENSE.txt).</small>

Co-authored-by: Remy Willems <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crash Dafny crashes on this input, or generates malformed code that can not be executed kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label part: verifier Translation from Dafny to Boogie (translator)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant