(* Inspired by: Subjective Auxiliary State for Coarse-Grained Concurrency, Ley-Wild and Nanevski, POPL 2013. *)
Instance CompSpecs : compspecs. make_compspecs prog. Defined.
Definition Vprog : varspecs. mk_varspecs prog. Defined.
Definition acquire_spec := DECLARE _acquire acquire_spec.
Definition release_spec := DECLARE _release release_spec.
Definition makelock_spec := DECLARE _makelock (makelock_spec _).
Definition freelock_spec := DECLARE _freelock (freelock_spec _).
Definition spawn_spec := DECLARE _spawn spawn_spec.
Definition freelock2_spec := DECLARE _freelock2 (freelock2_spec _).
Definition release2_spec := DECLARE _release2 release2_spec.
Instance sum_ghost : Ghost :=
{ G := nat; valid g := True; Join_G a b c := c = (a + b)%nat }.
Hint Resolve ctr_inv_exclusive.

Lemma thread_inv_exclusive : forall tsh sh gsh g ctr lock lockt,
exclusive_mpred (thread_lock_inv tsh sh gsh g ctr lock lockt).