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

Unexpected order of verification errors #1489

Open
fpoli opened this issue Jan 15, 2024 · 0 comments
Open

Unexpected order of verification errors #1489

fpoli opened this issue Jan 15, 2024 · 0 comments
Labels
error-reporting Something needs to be fixed in the error reporting

Comments

@fpoli
Copy link
Member

fpoli commented Jan 15, 2024

While preparing a Prusti demo last week, I found that the order of the reported errors is a bit counter-intuitive. In the second function below, I'd expect the verification error in the second branch of the implementation to be reported before the verification error of a failing postcondition. Since Silicon only reports one error per function, the result is that verification errors jump around the code when working on it with Prusti. I don't think this was always the case. Was it perhaps the result of some Viper change?

use prusti_contracts::*;

#[ensures(false)]
fn good(b: bool) {
    if b {
        assert!(false); // <-- an error is reported here, as expected
    } else {
        assert!(true);
    }
}

#[ensures(false)] // <-- an error is reported here
fn bad(b: bool) {
    if b {
        assert!(true);
    } else {
        assert!(false); // <-- the expected error is this one
    }
}
@fpoli fpoli added the error-reporting Something needs to be fixed in the error reporting label Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error-reporting Something needs to be fixed in the error reporting
Projects
None yet
Development

No branches or pull requests

1 participant