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

trouble proving derive PartialEq with v0.1 #1023

Open
Emilie-Thome opened this issue Jun 14, 2024 · 8 comments
Open

trouble proving derive PartialEq with v0.1 #1023

Emilie-Thome opened this issue Jun 14, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@Emilie-Thome
Copy link

Unless I did something wrong, I can not prove #[derive(creusot_contracts::prelude::PartialEq)] with why3 and Creusot v0.1.
Here is an extract of something I want proved:

use creusot_contracts::{ensures, logic, open, prelude, requires, DeepModel};
#[derive(prelude :: Clone, Copy, prelude :: PartialEq, prelude :: Default, DeepModel)]
pub enum Braking {
    #[default]
    NoBrake,
    SoftBrake,
    UrgentBrake,
}

To my knowledge, only the PartialEq is not proved by why3.

@xldenis xldenis added the bug Something isn't working label Jun 21, 2024
@xldenis
Copy link
Collaborator

xldenis commented Jun 21, 2024

Hmm, that's weird, I'm not able to reproduce the issue, can you provide exactly the commands that you used to create the files ?

@Emilie-Thome
Copy link
Author

Yep, it's cargo creusot why3 ide.
I reproduced it with another computer (but it's still the same person who runs it, me...).

@xldenis
Copy link
Collaborator

xldenis commented Jun 24, 2024

That's the whole file?

@Emilie-Thome
Copy link
Author

That's the whole file?

Yes, that's my lib.rs file. There is nothing else in src/.

@Emilie-Thome
Copy link
Author

test_creusot.txt
Here is the mlcfg file, in case it might help.
(I just converted it into a txt because github does not want to attach mlcfg files.)

@xldenis
Copy link
Collaborator

xldenis commented Jun 24, 2024

Aha, this is an occurence of #1014. We need to backport this patch and push a v0.1.1

@xldenis
Copy link
Collaborator

xldenis commented Jun 24, 2024

Until 0.1.1 comes out you can use the stable branch instead. Note: you need to manually implement Default since we don't actually handle that one automatically.

@Emilie-Thome
Copy link
Author

Ok thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants