Skip to content
Snippets Groups Projects
Commit 196cf83e authored by Ralf Jung's avatar Ralf Jung
Browse files

notice some type properties that still need proving

parent fc672cbd
No related branches found
No related tags found
No related merge requests found
Pipeline #
...@@ -87,6 +87,8 @@ Section mutex. ...@@ -87,6 +87,8 @@ Section mutex.
Global Instance mutex_wf ty `{!TyWf ty} : TyWf (mutex ty) := Global Instance mutex_wf ty `{!TyWf ty} : TyWf (mutex ty) :=
{ ty_lfts := ty.(ty_lfts); ty_wf_E := ty.(ty_wf_E) }. { ty_lfts := ty.(ty_lfts); ty_wf_E := ty.(ty_wf_E) }.
(* TODO: Non-expansiveness, compat with eqtype, Send+Sync if ty is Send. *)
End mutex. End mutex.
Section code. Section code.
......
...@@ -79,6 +79,9 @@ Section mguard. ...@@ -79,6 +79,9 @@ Section mguard.
Global Instance mutexguard_wf α ty `{!TyWf ty} : TyWf (mutexguard α ty) := Global Instance mutexguard_wf α ty `{!TyWf ty} : TyWf (mutexguard α ty) :=
{ ty_lfts := [α]; ty_wf_E := ty.(ty_wf_E) ++ ty.(ty_outlives_E) α }. { ty_lfts := [α]; ty_wf_E := ty.(ty_wf_E) ++ ty.(ty_outlives_E) α }.
(* TODO: Contractivity, compat with lft_incl and eqtype.
MutexGuard is Sync if T is Send. *)
End mguard. End mguard.
Section code. Section code.
......
...@@ -112,6 +112,8 @@ Section rwlockreadguard. ...@@ -112,6 +112,8 @@ Section rwlockreadguard.
lctx_lft_eq E L α1 α2 eqtype E L ty1 ty2 lctx_lft_eq E L α1 α2 eqtype E L ty1 ty2
eqtype E L (rwlockreadguard α1 ty1) (rwlockreadguard α2 ty2). eqtype E L (rwlockreadguard α1 ty1) (rwlockreadguard α2 ty2).
Proof. intros. by eapply rwlockreadguard_proper. Qed. Proof. intros. by eapply rwlockreadguard_proper. Qed.
(* TODO: In Rust, the read guard is Sync if ty is Send+Sync. *)
End rwlockreadguard. End rwlockreadguard.
Hint Resolve rwlockreadguard_mono' rwlockreadguard_proper' : lrust_typing. Hint Resolve rwlockreadguard_mono' rwlockreadguard_proper' : lrust_typing.
...@@ -115,6 +115,8 @@ Section rwlockwriteguard. ...@@ -115,6 +115,8 @@ Section rwlockwriteguard.
lctx_lft_eq E L α1 α2 eqtype E L ty1 ty2 lctx_lft_eq E L α1 α2 eqtype E L ty1 ty2
eqtype E L (rwlockwriteguard α1 ty1) (rwlockwriteguard α2 ty2). eqtype E L (rwlockwriteguard α1 ty1) (rwlockwriteguard α2 ty2).
Proof. intros. by eapply rwlockwriteguard_proper. Qed. Proof. intros. by eapply rwlockwriteguard_proper. Qed.
(* TODO: In Rust, the read guard is Sync if ty is Send+Sync. *)
End rwlockwriteguard. End rwlockwriteguard.
Hint Resolve rwlockwriteguard_mono' rwlockwriteguard_proper' : lrust_typing. Hint Resolve rwlockwriteguard_mono' rwlockwriteguard_proper' : lrust_typing.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment