-
Notifications
You must be signed in to change notification settings - Fork 76
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
Generalized lemma broadcast, implements #37 #1022
Conversation
they do not yet have any effect
…fn` syntax in vstd, and in the docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#[verifier::hidden_unless_this_module_is_used] which instructs prune to remove the broadcasted axioms if this broadcast group was used indirectly but nothing else in the module was used (this is to preserve the existing pruning mechanism in vstd);
I don't get what this means. What does it mean for a group to be used "indirectly"? What's an example where this changes behavior?
That could have been phrased better (by me). A crate has a In fact, I meant to rename that to |
…prune_unless_this_module_is_used]
This will be mergeable once verus-lang/verusfmt#48 is merged so that |
…use` (#48) This syntax is being introduced in verus-lang/verus#1022
verus-lang/verusfmt#48 is merged (thanks for making the PR @utaal-b!), and new version of verusfmt (v0.2.10) is released, so the CI should now pass here. Triggered a re-run of the failed CI, hopefully should be a green! |
This implements #37:
broadcast proof fn
s,broadcast use
) at either the module or function level, andbroadcast proof fn
s that can bebroadcast use
d (broadcast group
).The underlying implementation uses the
fuel
mechanism that was already implemented forbroadcast_forall
, but extends it to allow the construction of groups and the ability tobroadcast use
at the module level.Here's an example:
A significant part of this PR are syntax additions.
The most important from a soundness perspective are the additional function graph nodes and edges that represent groups and module-level reveals, to prevent circular reasoning. In particular:
https://github.com/verus-lang/verus/pull/1022/files#diff-b7fce60d4dba89afe470adb93f36bbc6d33da444e711c78c476970e52dee9105R322-R351
verus/source/vir/src/context.rs
Lines 322 to 351 in 852db35
and
https://github.com/verus-lang/verus/pull/1022/files#diff-b7fce60d4dba89afe470adb93f36bbc6d33da444e711c78c476970e52dee9105R602-R622
verus/source/vir/src/context.rs
Lines 602 to 622 in 852db35
The PR also introduces two attributes for broadcast groups:
#[verifier::hidden_unless_this_module_is_used]
which instructs prune to remove the broadcasted axioms if this broadcast group wasuse
d indirectly but nothing else in the module was used (this is to preserve the existing pruning mechanism invstd
);#[verifier::broadcast_use_by_default_when_this_crate_is_imported]
which can be used to tag a default broadcast group for a crate (currently intended for vstd) that will be automaticallybroadcast use
d in dependent crates.A follow-on PR, #1023, uses this mechanism to replace the existing, unconditional broadcast via
#[verifier::broadcast_forall] #[verifier::external_body]
.