Skip to content

Commit 202d164

Browse files
Merge pull request #35 from SkyLabsAI/paolo/fix-own-weakly-objective
Stop admitting own_WeaklyObjective
2 parents 6898fa4 + 4555404 commit 202d164

2 files changed

Lines changed: 7 additions & 12 deletions

File tree

rocq-brick-libstdcpp/proof/mutex/demo_cpp_proof.v

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Definition P `{Σ : cpp_logic, σ : genv} (this : ptr) : TT -t> mpred :=
3434

3535
sl.lock
3636
Definition CR
37-
`{Σ : cpp_logic, σ : genv, HasOwn mpredI recursive_mutex.cmraR}
37+
`{Σ : cpp_logic, σ : genv, HasOwn (iPropI _) recursive_mutex.cmraR}
3838
(γ : recursive_mutex.rmutex_gname) (q : cQp.t) : Rep :=
3939
structR "C" q **
4040
_field "C::mut" |-> recursive_mutex.R γ.(recursive_mutex.lock_gname) q **
@@ -48,7 +48,7 @@ Section recursive_mutex.
4848
Import recursive_mutex.
4949
Context `{Σ : cpp_logic, σ : genv}.
5050
Context {HAS_THREADS : HasStdThreads Σ}.
51-
Context {has_rmutex : HasOwn mpredI recursive_mutex.cmraR}.
51+
Context {has_rmutex : HasOwn (iPropI _) recursive_mutex.cmraR}.
5252

5353
Lemma acquireable_update_equiv {TT : tele} γ th f t1 t2 P :
5454
acquire t1 t2 ->
@@ -65,7 +65,7 @@ End recursive_mutex.
6565
Section with_cpp.
6666
Context `{Σ : cpp_logic, σ : genv}.
6767
Context {HAS_THREADS : HasStdThreads Σ}.
68-
Context {has_rmutex : HasOwn mpredI recursive_mutex.cmraR}.
68+
Context {has_rmutex : HasOwn (iPropI _) recursive_mutex.cmraR}.
6969

7070
#[global] Instance: LearnEq2 CR'.
7171
Proof. solve_learnable. Qed.

rocq-brick-libstdcpp/proof/mutex/spec.v

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,6 @@ Section with_cpp.
100100
End with_cpp.
101101
End mutex.
102102

103-
(* TODO upstream *)
104-
#[global] Declare Instance
105-
own_WeaklyObjective `{Σ : cpp_logic} {A : cmra} `{!HasOwn mpredI A} γ (a : A) :
106-
WeaklyObjective (PROP := iPropI _) (own γ a).
107-
108103
Module recursive_mutex.
109104

110105
(** <<locked γ th n>> <<th>> owns the mutex <<γ>> <<n>> times. *)
@@ -124,7 +119,7 @@ Module recursive_mutex.
124119
Canonical Structure cmraR := (excl_authR (prodO natO thread_idTO)).
125120

126121
sl.lock
127-
Definition inv_rmutex `{Σ : cpp_logic} `{!HasOwn mpredI cmraR} (g : rmutex_gname) (P : mpred) : mpred :=
122+
Definition inv_rmutex `{Σ : cpp_logic} `{!HasOwn (iPropI _) cmraR} (g : rmutex_gname) (P : mpred) : mpred :=
128123
inv rmutex_namespace
129124
(Exists n th, own g.(level_gname) (●E (n, th)) **
130125
match n with
@@ -172,7 +167,7 @@ Module recursive_mutex.
172167
end.
173168

174169
sl.lock
175-
Definition acquireable `{Σ : cpp_logic, !HasStdThreads Σ, !HasOwn mpredI cmraR} (g : rmutex_gname) (th : thread_idT) {TT: tele} (t : acquire_state TT) (P : TT -t> mpred) : mpred :=
170+
Definition acquireable `{Σ : cpp_logic, !HasStdThreads Σ, !HasOwn (iPropI _) cmraR} (g : rmutex_gname) (th : thread_idT) {TT: tele} (t : acquire_state TT) (P : TT -t> mpred) : mpred :=
176171
current_thread th **
177172
match t with
178173
| NotHeld => locked g.(lock_gname) th 0
@@ -188,7 +183,7 @@ Module recursive_mutex.
188183
Axiom locked_excl_different_thread : forall g th th' n m,
189184
locked g th n ** locked g th' m |-- [| n = 0 \/ m = 0 |] ** True.
190185

191-
Context `{!HasOwn mpredI cmraR, !HasStdThreads Σ}.
186+
Context `{!HasOwn (iPropI _) cmraR, !HasStdThreads Σ}.
192187

193188
#[global] Instance acquireable_learn γ th TT : LearnEq2 (acquireable γ th (TT := TT)).
194189
Proof. solve_learnable. Qed.
@@ -297,7 +292,7 @@ Section with_cpp.
297292
- exists (S n). naive_solver.
298293
Qed.
299294

300-
Context `{!HasOwn mpredI cmraR}.
295+
Context `{!HasOwn (iPropI _) cmraR}.
301296

302297
#[program]
303298
Definition acquireable_is_acquired_C {TT} g th t t' P

0 commit comments

Comments
 (0)