Hint Resolve thread_inv_exclusive.

(* Specifications: *)
Lemma body_incr: semax_body Vprog Gprog f_incr incr_spec.
Lemma body_read : semax_body Vprog Gprog f_read read_spec.
Lemma body_thread_func : semax_body Vprog Gprog f_thread_func thread_func_spec.
Lemma body_main:  semax_body Vprog Gprog f_main main_spec.
Definition extlink := ext_link_prog prog.
Lemma sum_repeat: forall i n, sum (repeat i n) = (i * Z.of_nat n)%Z.
Corollary sum_0: forall n, sum (repeat 0 n) = 0.
Corollary sum_1: forall n, sum (repeat 1 n) = Z.of_nat n.
Lemma body_init_ctr: semax_body Vprog Gprog f_init_ctr init_ctr_spec.
Lemma body_dest_ctr: semax_body Vprog Gprog f_dest_ctr dest_ctr_spec.
Lemma sum_add: forall l n, fold_right Z.add n l = sum l + n.
Lemma upd_Znth_sum: forall l i n, 0 <= i < Zlength l ->
sum (upd_Znth i l n) = sum l + n - Znth i l.
Lemma body_incr: semax_body Vprog Gprog f_incr incr_spec.
Lemma body_thread_func : semax_body Vprog Gprog f_thread_func thread_func_spec.
Definition N := 5.
Lemma body_init_ctr: semax_body Vprog Gprog f_init_ctr init_ctr_spec.
Lemma body_dest_ctr: semax_body Vprog Gprog f_dest_ctr dest_ctr_spec.
Lemma body_incr: semax_body Vprog Gprog f_incr incr_spec.
Lemma body_thread_func : semax_body Vprog Gprog f_thread_func thread_func_spec.
Definition N := 5.
Lemma ghost_part_share_join : forall g sh1 sh2 sh n1 n2, sh1 <> Share.bot -> sh2 <> Share.bot ->
sepalg.join sh1 sh2 sh ->
ghost_part g sh1 n1 * ghost_part g sh2 n2 = ghost_part g sh (n1 + n2)%nat.
Lemma body_main:  semax_body Vprog Gprog f_main main_spec.
Definition extlink := ext_link_prog prog.
Lemma body_incr: semax_body Vprog Gprog f_incr incr_spec.
Lemma body_read : semax_body Vprog Gprog f_read read_spec.
Lemma body_thread_func : semax_body Vprog Gprog f_thread_func thread_func_spec.
Ltac cancel_for_forward_call ::=
match goal with
| gv: globals |- _ =>
repeat
match goal with
| x := gv ?i |- context [gv ?i] =>
change (gv i) with x
end
| _ => idtac
end;
cancel_for_evar_frame.
Lemma body_main:  semax_body Vprog Gprog f_main main_spec.
Definition extlink := ext_link_prog prog.