Instance CompSpecs : compspecs.Definition Vprog : varspecs.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.Notation sum := (fold_right Z.add 0).Definition thread_lock_R sh lg i ctr lockc :=
  lock_inv sh lockc (cptr_lock_inv lg ctr) * ghost_var gsh2 1 (Znth i lg).Definition thread_lock_inv tsh sh lg i ctr lockc lockt :=
  selflock (thread_lock_R sh lg i ctr lockc) tsh lockt.

(* Specifications: *)
Lemma ctr_inv_exclusive : forall lg p, exclusive_mpred (cptr_lock_inv lg p).
Lemma thread_inv_exclusive : forall tsh sh lg i ctr lock lockt, exclusive_mpred (thread_lock_inv tsh sh lg i ctr lock lockt).
Lemma sum_repeat: forall i n, sum (repeat i n) = (i * Z.of_nat n)%Z.