Canonical mutexEqType := Eval hnf in EqType (mutex T) mutexEqMix.
End Equality.
Module Exports.
Canonical mutexPCM.
Canonical mutexCPCM.
Canonical mutexEqType.
Canonical mutexTPCM.
Notation mutex := mutex.
Notation mx := mx.
Notation mx_undef := undef.
Notation nown := nown.
Notation own := own.
Notation mutexPCM := mutexPCM.
Notation mutexTPCM := mutexTPCM.
Arguments mx_undef [T].
Arguments nown [T].
Arguments own [T].
(* binary mutexes can be obtained with T = Empty_set *)
Notation mtx := (mutex Empty_set).
End Exports.
End GeneralizedMutex.
Export GeneralizedMutex.Exports.
(* some lemmas for generalized mutexes *)
Section MutexLemmas.
Variable T : Type.
Implicit Types (t : T) (x y : mutex T).
CoInductive mutex_spec x : mutex T -> Type :=
| mutex_undef of x = mx_undef : mutex_spec x mx_undef
| mutex_nown of x = Unit : mutex_spec x Unit
| mutex_own of x = own : mutex_spec x own
| mutex_mx t of x = mx t : mutex_spec x (mx t).

(* Specifications: *)
Lemma mxP x : mutex_spec x x.
Lemma mx_valid t : valid (mx t).