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

change the deep model of Box<T> to Box<T::DeepModelTy> #908

Merged
merged 1 commit into from
Nov 10, 2023

Conversation

xldenis
Copy link
Collaborator

@xldenis xldenis commented Nov 10, 2023

This enables the usage of the derive macro on recursive types. It's absolutely essential that this functions, as for 99% of people deep model should be transparent. I already think that imposing a derive macro quasi-systeatically is already tedious. However, this also suggests that we should change the deep models for other pointer types like Rc or Arc to be Box<T::DeepModel> as well, which, I'm not sure how I feel about that. Finally, I've been thinking we might want to rename DeepModel to EqModel or something which more clearly relates its purpose.

@xldenis xldenis merged commit 9203a59 into master Nov 10, 2023
4 checks passed
@xldenis xldenis deleted the deep-model-fixes branch November 10, 2023 08:30
@jhjourdan
Copy link
Collaborator

1- Recursive types are not so common
2- I think it is wrong that we need deep-models quasi systematically for every types
3- This changes requires that we add instances of every logical trait for Box

@xldenis
Copy link
Collaborator Author

xldenis commented Nov 10, 2023

1- Recursive types are not so common

Not true, honestly, tree structures are very common, especially in verified software.
Moreover, it is not acceptable to just 'bail' completely on these.

2- I think it is wrong that we need deep-models quasi systematically for every types

Again, false, as types quasi-systematically impleemnt PartialEq in Rust which thus requires DeepModel with Creusot.

3- This changes requires that we add instances of every logical trait for Box

No because of auto-deref. If you have OrdLogic for T then Box<T>.cmp will auto-deref in the expected manner.

xldenis added a commit that referenced this pull request Dec 5, 2023
change the deep model of Box<T> to Box<T::DeepModelTy>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants