Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
83756a2
Copy snapshot of atomic specs
pgiarrusso-sl Aug 19, 2026
3e1ce8c
Notation -> Abbreviation
pgiarrusso-sl Aug 19, 2026
06eeefa
Spec: add missing modes
pgiarrusso-sl Aug 19, 2026
9fd1809
Add UnOp instance for num ++
pgiarrusso-sl Aug 20, 2026
779b857
TMP build rules (to redo)
pgiarrusso-sl Aug 19, 2026
97a7931
tweak
pgiarrusso-sl Aug 19, 2026
d086280
Remove __1
pgiarrusso-sl Aug 19, 2026
7468a36
TMP for move from tests
pgiarrusso-sl Aug 19, 2026
0c3d6a0
WIP on merging base classes
pgiarrusso-sl Aug 19, 2026
b07bed7
test_cpp_proof: adapt to alternative implementation
pgiarrusso-sl Aug 19, 2026
60f6bd7
Disable pointer tests
pgiarrusso-sl Aug 20, 2026
2360d14
WIP on thread id
pgiarrusso-sl Aug 20, 2026
e2e5e34
atomic: fix namespacing
pgiarrusso-sl Aug 20, 2026
d17add6
WIP on thread_id proofs
pgiarrusso-sl Aug 20, 2026
c328fe8
[mutex.v]: change token to user; comment out with_RepFor section
dkxb Aug 31, 2026
462cb75
replace appearance of mutex.token to user
dkxb Aug 31, 2026
bcb91f7
check in layout of a custom mutex proof
dkxb Aug 31, 2026
af6eb73
[custom_mutex_hpp_proof.v] add do_lock lemma statement
dkxb Sep 1, 2026
41318df
Tweak spec and client proof
pgiarrusso-sl Sep 1, 2026
2e24af5
Drop trailing whitespace
pgiarrusso-sl Sep 1, 2026
18d609b
cleanups
pgiarrusso-sl Sep 1, 2026
a4e43a3
Fix parentheses in Rep
pgiarrusso-sl Sep 1, 2026
65013f9
custom_mutex: atomic<bool> -> atomic<int>
pgiarrusso-sl Sep 1, 2026
0e35894
Proof sketch
pgiarrusso-sl Sep 1, 2026
9b60f53
progress on custom mutex proof
dkxb Sep 1, 2026
ff74e69
custom mutex proof mostly done
dkxb Sep 2, 2026
8392c6c
Import linearity, drop unused lemmas
pgiarrusso-sl Sep 2, 2026
acf9463
Proof tweaks
pgiarrusso-sl Sep 2, 2026
9e975fe
More proof tweaks
pgiarrusso-sl Sep 2, 2026
930e3ba
Spec tweaks
pgiarrusso-sl Sep 4, 2026
deda9a6
change mutex to use a fractional used_threads and another separate pi…
dkxb Sep 4, 2026
41dbfb3
mutex proof WIP
dkxb Sep 4, 2026
213bfc7
complete mutex ghost refactor
dkxb Sep 6, 2026
ec5892b
refactor mutex specs, std::mutex and custom mutex are both implemntation
dkxb Sep 7, 2026
1c16450
better model for my_mutex, all properties described in MUTEX_SETS
dkxb Sep 9, 2026
04bf5ed
mutex ghost state module instantiation is now associated with impleme…
dkxb Sep 9, 2026
1711628
rename MUTEX_STATE to MUTEX_PREDS
dkxb Sep 9, 2026
8020b9b
code clean up
dkxb Sep 9, 2026
8182147
more clean up
dkxb Sep 9, 2026
0d81ece
add instances to MUTEX_PREDS
dkxb Sep 9, 2026
250308e
add comments
dkxb Sep 9, 2026
4d84fa4
make lock_guard and scoped_lock compile
dkxb Sep 10, 2026
e1d8387
change my_mutexes to track opened masks
dkxb Sep 12, 2026
1ed2edf
add mutex client
dkxb Sep 14, 2026
e389cec
[mutex.v] move mutex predicates to MUTEX_PREDS if they are not specif…
dkxb Sep 16, 2026
8592e13
move thread specs to [thread/spec.v], fix [custom_mutex_hpp_proof.v]
dkxb Sep 16, 2026
745c734
add double_incr example and proof from paper as a mutex client; add s…
dkxb Sep 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions rocq-brick-libstdcpp/proof/atomic/inc_int.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#include <atomic>
template<> class std::atomic<int>;
55 changes: 55 additions & 0 deletions rocq-brick-libstdcpp/proof/atomic/pred.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
(**
* Copyright (C) 2025 SkyLabs AI, Inc.
* All rights reserved.
*
* SPDX-License-Identifier: LGPL-2.1 WITH BlueRock Exception for use over network, see repository root for details.
*)
Require Import skylabs.auto.cpp.spec.
Require Import skylabs.bi.weakly_objective.
Require Import skylabs.cpp.spec.concepts.
Require skylabs.brick.libstdcpp.atomic.inc_int_cpp.

Require Import skylabs.cpp.spec.concepts.

(** * Interface to Atomic<T> *)
(**
These specifications assume that all memory order parameters (template,
function arguments) are _SEQ_CST. In the C++ code, redefine the other
memory order macros to __ATOMIC_SEQ_CST.
*)

cpp.enum "std::memory_order" from (inc_int_cpp.source) variant.
#[global] Abbreviation Tmemory_order := {%cpp_type[inc_int_cpp.source] "std::memory_order"} (only parsing).

Module Type ATOMIC_PREDS.

(** Type [t] indexing our spec models the type name T in Atomic<T>. *)

(** The type where the actual methods are implemented *)
#[global] Abbreviation base_name ty :=
(Ninst "std::__atomic_base" [Atype ty]).
(** The type <<std::atomic<T>>> *)
#[global] Abbreviation class_name ty := (Ninst "std::atomic" [Atype ty]).
#[global] Abbreviation T ty := (Tnamed (class_name ty)).

(** Abstract predicates *)

(** Fraction [q] ownership of atomically accessible value [v]. *)
Parameter R : ∀ `{Σ : cpp_logic} {σ : genv} (ty : type) `{PV : @PrimVal ty A} (q : cQp.t) (x : A), Rep.

Section R_props.
Context `{Σ : cpp_logic} {σ : genv} `{PV : @PrimVal ty A}.
Abbreviation R := (R ty (PV:=PV)).

#[global] Declare Instance R_frac : CFractional1 R.
#[global] Declare Instance R_timeless : Timeless2 R.
#[global] Declare Instance R_frac_valid : CFracValid1 R.
#[global] Declare Instance R_agree : Cbn (Learn (any ==> learn_eq ==> learn_hints.fin) R).
#[global] Declare Instance R_type : Typed2 (class_name ty) R.
#[global] Declare Instance R_weakly_objective q x p :
WeaklyObjective (R q x p).
End R_props.

End ATOMIC_PREDS.

Declare Module atomic : ATOMIC_PREDS.
Loading