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

Least opaque predicates #3504

Open
stefan-aws opened this issue Feb 10, 2023 · 1 comment
Open

Least opaque predicates #3504

stefan-aws opened this issue Feb 10, 2023 · 1 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

Comments

@stefan-aws
Copy link
Collaborator

stefan-aws commented Feb 10, 2023

Dafny version

3.11.0.50201

Code to produce this issue

least predicate {:opaque} P(x: int) {
  x == 0
}

lemma L(n: nat) 
{
  reveal P();
  assert P(0);
}

Command to run and resulting output

(1,26): Error: wrong number of arguments to function: _module.__default.P (1 instead of 2)
...
4 type checking errors detected in /var/folders/0j/f_c89qx51zxd2f1wpyqqtclm0000gr/T/fail_example_1__module.bpl

*** Encountered internal translation error - re-running Boogie to get better debug information

/var/folders/0j/f_c89qx51zxd2f1wpyqqtclm0000gr/T/fail_example_1__module.bpl(3235,6): Error: wrong number of arguments to function: _module.__default.P (1 instead of 2)

What happened?

Without {:opaque}, the code verifies and compiles:

least predicate P(x: int) {
  x == 0
}

lemma L(n: nat) 
{
  assert P(0);
}

It seems as if least predicates with opaque require a recursive call. For example, this snippet goes through:

// even naturals
least predicate {:opaque} P(x: int) {
  (x == 0) || (x > 0 && P(x-2))
} 
lemma L() {
  reveal P();
  assert P(0);
}

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

Mac

@stefan-aws stefan-aws added the kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label label Feb 10, 2023
@MikaelMayer MikaelMayer added the incompleteness Things that Dafny should be able to prove, but can't label Feb 14, 2023
@MikaelMayer
Copy link
Member

Related to
#3506

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