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

Cannot verify postcondition in lambda #6117

Open
alexstaeding opened this issue Feb 19, 2025 · 0 comments
Open

Cannot verify postcondition in lambda #6117

alexstaeding opened this issue Feb 19, 2025 · 0 comments
Labels
incompleteness Things that Dafny should be able to prove, but can't kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label

Comments

@alexstaeding
Copy link

Dafny version

4.10.0

Code to produce this issue

function Foo(x: int): int requires x > 4 { x + 1 }
type F1 = f: int --> int | forall x :: f.requires(x) ==> f(x) > 5 witness Foo
type F2 = f: int --> int | forall x :: f.requires(x) ==> f(x) > 5 witness x requires x > 4 => x + 1

Command to run and resulting output

dafny verify Test.dfy
Test.dfy(20,74): Error: the given witness expression might not satisfy constraint
   |
20 | type F2 = f: int --> int | forall x :: f.requires(x) ==> f(x) > 5 witness x requires x > 4 => x + 1

What happened?

Dafny seems to be unable to verify that the postcondition f(x) > 5 holds, but only when the type is instantiated by a lambda. Instantiating the type with Foo verifies as expected.

I asked on zulip first, but this does now seem to be a bug.

What type of operating system are you experiencing the problem on?

Mac

@alexstaeding alexstaeding added the kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label label Feb 19, 2025
@fabiomadge fabiomadge added the incompleteness Things that Dafny should be able to prove, but can't label Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
incompleteness Things that Dafny should be able to prove, but can't kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label
Projects
None yet
Development

No branches or pull requests

2 participants