Skip to content
Draft
Changes from all commits
Commits
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
37 changes: 37 additions & 0 deletions rocq-brick-libstdcpp/proof/mutex/proof/scoped_lock.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
Require Import skylabs.auto.cpp.prelude.proof.
Require Import skylabs.brick.libstdcpp.mutex.spec.scoped_lock.
Require Import skylabs.brick.libstdcpp.mutex.spec.unique_lock.

Require Import skylabs.brick.libstdcpp.mutex.inc_hpp.

Import linearity.

Section with_cpp.
Context `{Σ : cpp_logic, σ : genv}.
Context {HAS_THREADS : HasStdThreads Σ}.

Import scoped_lock.

cpp.spec "std::tie<...<std::mutex, std::mutex>>(std::mutex&, std::mutex&)" from source inline.
cpp.spec "std::tuple<...<std::mutex&, std::mutex&>>::tuple<1b, 1b>(std::mutex&, std::mutex&)" from source inline.
cpp.spec "std::lock<std::mutex, std::mutex, ...<>>(std::mutex&, std::mutex&)" from source inline.

Lemma ctor_ok : verify?[source] ctor_spec.
Proof.
verify_spec; go.
iExists _; go.
by rewrite left_id_L.
Qed.

Lemma dtor_ok : verify[source] dtor_spec.
Proof.
verify_spec.
rewrite !R.unlock.
go; try by ego.
iExists _; go.
rewrite !left_id_L.
go.
Qed.

End with_cpp.

Loading