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

Error proving override check #4812

Closed
MikaelMayer opened this issue Nov 21, 2023 · 0 comments · Fixed by #4813
Closed

Error proving override check #4812

MikaelMayer opened this issue Nov 21, 2023 · 0 comments · Fixed by #4813
Assignees
Labels
kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label

Comments

@MikaelMayer
Copy link
Member

Dafny version

latest-nightly

Code to produce this issue

trait ProblemHolder<T(!new, ==)> {
  ghost function Solution(): T

  predicate Problem(solution: T)
    ensures Solution() == solution
}

trait Instantiation extends ProblemHolder<int> {
  ghost function Solution(): int

  predicate Problem(solution: int)
    ensures Solution() == solution
}

Command to run and resulting output

Dafny verify or paste in VSCode

What happened?

I see this:

ProblemReproducedConcurrencyYIeld.dfy(10,23): Error: invalid argument types (int and Box) to binary operator ==
1 type checking errors detected in problem__module.bpl

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

problem__module.bpl(3222,60): Error: invalid argument types (int and Box) to binary opera
tor ==
1 type checking errors detected in problem__module.bpl

I wanted the above to verify.

After investigation, it turns out that the override check is converting the ProblemHolder's postcondition to the Instantiation's functions and types, but the type of the function application is unchanged, resulting in a type parameter being boxed in one side of the equality and not the other one. Will fix soon.

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

Windows

@MikaelMayer MikaelMayer added the kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label label Nov 21, 2023
@MikaelMayer MikaelMayer self-assigned this Nov 21, 2023
MikaelMayer added a commit that referenced this issue Nov 21, 2023
MikaelMayer added a commit that referenced this issue Nov 21, 2023
…ters and equality (#4813)

This PR fixes #4812
I added the corresponding test.

<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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label
Projects
None yet
1 participant