Skip to content

Extend Verus with Logical Atomicity#2326

Open
slerpyyy wants to merge 159 commits into
mainfrom
logatom
Open

Extend Verus with Logical Atomicity#2326
slerpyyy wants to merge 159 commits into
mainfrom
logatom

Conversation

@slerpyyy
Copy link
Copy Markdown
Collaborator

This PR extends Verus with a built-in notion of logical atomicity, heavily inspired by its implementation in Iris.

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

Comment thread source/vir/src/ast.rs
Comment thread source/vir/src/ast.rs Outdated
/// Placeholder expression for the atomic update argument in the atomic function call
AtomicUpdateInitDummy,
/// Atomic function call
Atomically(AtomicCallInfo, VarIdent, Expr, bool),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the meaning of all these arguments?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've replaced the bool with an AtomicallyKind enum, so it should be easier to read now

Comment thread source/vir/src/ast.rs
pub fndef_axioms: Option<Exprs>,
/// MaskSpec that specifies what invariants the function is allowed to open
pub mask_spec: Option<MaskSpec>,
pub atomic_update: Option<Expr>,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel this should be a binder or a Param or something, rather than an arbitrary Expr.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We get this from the verus_builtin::atomic_spec<A>(_a: A) header function, so it is just an expression

Comment thread source/vir/src/ast.rs Outdated
Comment thread source/vir/src/headers.rs Outdated
Comment thread source/vir/src/modes.rs Outdated
@slerpyyy slerpyyy requested a review from tjhance May 13, 2026 15:46
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