Automatic Specification of 'small' closures #1759
rsofaer
started this conversation in
Feature requests
Replies: 2 comments
-
|
Yes, I was thinking about inferring For example, the inferred requires might look like |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
I'll second that this would be extremely useful. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Idiomatic Rust includes significant use of higher order functions. One very simple example might be as follows:
Verus example: https://play.verus-lang.org/?version=stable&mode=basic&edition=2021&gist=071d0a0ce566bf4100a681caea2bfa35
Another example would be the vec map with closure page in the Verus docs: https://verus-lang.github.io/verus/guide/exec_closures.html
From the perspective of someone integrating Verus into an existing codebase, annotating very simple closures with spec definitions is making code quality and readability worse, and we would prefer for this kind of code to go unmodified.
@dschoepe mentioned that @Chris-Hawblitzel was considering an approach to this. Maybe the dual exec/spec work could be extended to closures? Maybe a triggering annotation
#[autospec]|x,y|{..}would be best at least at first to avoid excessive symbolic execution?Beta Was this translation helpful? Give feedback.
All reactions