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.*)
Definition makecond_spec := DECLARE _makecond (makecond_spec _).(*Definition freecond_spec := DECLARE _freecond (freecond_spec _).*)
Definition wait_spec := DECLARE _waitcond (wait_spec _).Definition signal_spec := DECLARE _signalcond (signal_spec _).Definition trequest := Tstruct _request_t noattr.Definition MAX := 10.Definition lock_pred buf len := Exp _ (fun reqs =>
  Pred_list (Data_at _ Ews (tarray (tptr trequest) MAX) (complete MAX reqs) buf ::
             Data_at _ Ews tint (Vint (Int.repr (Zlength reqs))) len ::
             Pred_prop (Forall isptr reqs /\ Zlength reqs <= MAX) ::
             map (fun r => Exp _ (fun data => Data_at _ Tsh trequest (Vint (Int.repr data)) r)) reqs)).

(* Specifications: *)
Lemma body_process : semax_body Vprog Gprog f_process process_spec.
Lemma body_get_request : semax_body Vprog Gprog f_get_request get_request_spec.
Lemma body_process_request : semax_body Vprog Gprog f_process_request process_request_spec.
Lemma body_add : semax_body Vprog Gprog f_add add_spec.
Lemma body_remove : semax_body Vprog Gprog f_remove remove_spec.
Lemma precise_reqs : forall reqs, precise (fold_right_sepcon (map Interp (map (fun r => Exp _ (fun d => Data_at _ Tsh trequest (Vint (Int.repr d)) r)) reqs))).
Lemma inv_precise : forall buf len, precise (Interp (lock_pred buf len)).
Lemma inv_positive : forall buf len, positive_mpred (Interp (lock_pred buf len)).
Lemma body_producer : semax_body Vprog Gprog f_producer producer_spec.
Lemma body_consumer : semax_body Vprog Gprog f_consumer consumer_spec.
Lemma body_main: semax_body Vprog Gprog f_main main_spec.