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

hide statements don't work with recursive functions defined in different modules #5763

Closed
dschoepe opened this issue Sep 11, 2024 · 0 comments · Fixed by #5764
Closed

hide statements don't work with recursive functions defined in different modules #5763

dschoepe opened this issue Sep 11, 2024 · 0 comments · Fixed by #5764
Assignees
Labels
kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label

Comments

@dschoepe
Copy link
Collaborator

Dafny version

4.8.0-7af458b24f4511a54dc33b456b3711fe12f7ecd6

Code to produce this issue

module M1 {
    ghost opaque function RecFunc(x: nat): nat { 
        if x == 0 then 0
        else 1 + RecFunc(x - 1)
    }
}
module M2 {
    import opened M1
    lemma Lemma(x: nat) 
    ensures RecFunc(0) == 0 
    {
        hide *;
        reveal RecFunc;
        // reveal *
        // ^ this makes the assertion pass
    }
}

Command to run and resulting output

dafny verify --type-system-refresh --general-traits=datatype

What happened?

I expected Lemma to be successfully verified. However, verification fails. To get verification to succeed, one needs to either put the lemma and function into the same module or use reveal *.

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

Mac

@dschoepe dschoepe added the kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label label Sep 11, 2024
@keyboardDrummer keyboardDrummer self-assigned this Sep 11, 2024
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
Development

Successfully merging a pull request may close this issue.

2 participants