Set Bullet Behavior "Strict Subproofs".

(* Specifications: *)
Lemma body_surely_malloc: semax_body Vprog Gprog f_surely_malloc surely_malloc_spec.
Lemma body_memset : semax_body Vprog Gprog f_memset memset_spec.
Opaque upto.
Lemma body_initialize_channels : semax_body Vprog Gprog f_initialize_channels initialize_channels_spec.
Lemma body_reader : semax_body Vprog Gprog f_reader reader_spec.
Lemma sepcon_filter_combine : forall {A} P (l : list A) l', Zlength l' = Zlength l ->
fold_right sepcon emp (map P l) =
fold_right sepcon emp (map P (map snd (filter fst (combine l' l)))) *
fold_right sepcon emp (map P (map snd (filter (fun '(b, _) => negb b) (combine l' l)))).
Lemma data_at_shares_join' : forall {cs} sh v p shs sh1
(Hsplit : sepalg_list.list_join sh1 shs sh), readable_share sh1 ->
@data_at cs sh1 tint (Vint v) p *
fold_right_sepcon (map (fun sh => EX v : _, data_at sh tint (Vint v) p) shs) =
data_at sh tint (Vint v) p.
Lemma map_snd_filter_fst : forall {A B C} f (g : B -> C) (l : list (A * B)),
filter (fun '(a, _) => f a) (map (fun '(a, b) => (a, g b)) l) =
map (fun '(a, b) => (a, g b)) (filter (fun '(a, _) => f a) l).
Lemma body_writer : semax_body Vprog Gprog f_writer writer_spec.
Lemma comm_loc_share_join : forall good lsh1 lsh2 lsh comm g g0 g1 g2 bufs sh gsh h1 h2 h
(Hsh : sepalg.join lsh1 lsh2 lsh) (Hh : Permutation.Permutation (h1 ++ h2) h)
(Hsh1 : lsh1 <> Share.bot) (Hsh2 : lsh2 <> Share.bot) (Hdisj : disjoint h1 h2),
comm_loc good lsh1 comm g g0 g1 g2 bufs sh gsh h1 *
comm_loc good lsh2 comm g g0 g1 g2 bufs sh gsh h2 =
comm_loc good lsh comm g g0 g1 g2 bufs sh gsh h.
Lemma body_main : semax_body Vprog Gprog f_main main_spec.
Definition extlink := ext_link_prog prog.
Lemma body_initialize_reader : semax_body Vprog Gprog f_initialize_reader initialize_reader_spec.
Lemma body_start_read : semax_body Vprog Gprog f_start_read start_read_spec.
Lemma body_finish_read : semax_body Vprog Gprog f_finish_read finish_read_spec.
Lemma body_surely_malloc: semax_body Vprog Gprog f_surely_malloc surely_malloc_spec.
Lemma body_memset : semax_body Vprog Gprog f_memset memset_spec.
Opaque upto.
Lemma malloc_compatible_isptr:
forall {cs: compspecs} t p, malloc_compatible (sizeof t) p -> isptr p.
Lemma body_initialize_reader : semax_body Vprog Gprog f_initialize_reader initialize_reader_spec.
Lemma body_start_read : semax_body Vprog Gprog f_start_read start_read_spec.
Lemma body_finish_read : semax_body Vprog Gprog f_finish_read finish_read_spec.
Lemma resource_decay_LK {b phi phi'} :
resource_decay b phi phi' ->
forall  loc rsh sh n i pp,
phi @ loc = YES rsh sh (LK n i) pp ->
phi' @ loc = YES rsh sh (LK n i) (preds_fmap (approx (level phi')) (approx (level phi')) pp).
Lemma resource_decay_LK_inv {b phi phi'} :
resource_decay b phi phi' ->
forall { loc rsh sh n i pp'},
phi' @ loc = YES rsh sh (LK n i) pp' ->
exists pp,
pp' = preds_fmap (approx (level phi')) (approx (level phi')) pp /\
phi @ loc = YES rsh sh (LK n i) pp.
Lemma resource_decay_identity {b phi phi' loc} :
resource_decay b phi phi' ->
(fst loc < b)%positive ->
identity (phi @ loc) ->
identity (phi' @ loc).
Lemma resource_decay_LK_at {b phi phi' R sh loc} :
resource_decay b phi phi' ->
(fst loc < b)%positive ->
(LK_at R sh loc) phi ->
(LK_at (approx (level phi) R) sh loc) phi'.
Lemma resource_decay_lkat' {b phi phi' R loc} :
resource_decay b phi phi' ->
(fst loc < b)%positive ->
(lkat R loc) phi ->
(lkat (approx (level phi) R) loc) phi'.
Lemma resource_decay_lkat'' {b phi phi' R loc} :
resource_decay b phi phi' ->
(fst loc < b)%positive ->
(lkat R loc) phi ->
(lkat R loc) phi'.
Lemma resource_decay_lkat {b phi phi' R loc} :
resource_decay b phi phi' ->
(fst loc < b)%positive ->
(lkat R loc) phi ->
(lkat (approx (level phi') R) loc) phi'.
Lemma resource_decay_LK_at' {b phi phi' R sh loc} :
resource_decay b phi phi' ->
(fst loc < b)%positive ->
(LK_at R sh loc) phi ->
(LK_at (approx (level phi') R) sh loc) phi'.
Lemma resource_decay_PURE {b phi phi'} :
resource_decay b phi phi' ->
forall loc sh P,
phi @ loc = PURE sh P ->
phi' @ loc = PURE sh (preds_fmap (approx (level phi')) (approx (level phi')) P).
Lemma resource_decay_PURE_inv {b phi phi'} :
resource_decay b phi phi' ->
forall loc sh P',
phi' @ loc = PURE sh P' ->
exists P,
phi @ loc = PURE sh P /\
P' = preds_fmap (approx (level phi')) (approx (level phi')) P.
Lemma resource_decay_func_at' {b phi phi'} :
resource_decay b phi phi' ->
forall loc fs,
seplog.func_at' fs loc phi ->
seplog.func_at' fs loc phi'.
Lemma resource_decay_func_at'_inv {b phi phi'} :
resource_decay b phi phi' ->
forall loc fs,
seplog.func_at' fs loc phi' ->
seplog.func_at' fs loc phi.
Lemma resource_decay_same_locks {b phi phi'} :
resource_decay b phi phi' -> same_locks phi phi'.
Lemma Clight_new_Clight_safety_gen:
forall n sch tr tp m tp' (Hmem: mem_ok tp m),
csafe
(Sem := Clight_newSem ge)
(machineSig:= HybridMachine.DryHybridMachine.DryHybridMachineSig)
(sch, tr, tp) m (n * 2) ->
match_st tp tp' ->
csafe
(Sem := ClightSem ge)
(ThreadPool:= OrdinalPool.OrdinalThreadPool(Sem:=ClightSem ge))
(machineSig:= HybridMachine.DryHybridMachine.DryHybridMachineSig)
(sch, tr, tp') m n.
Lemma jsafeN_age Z Jspec ge ora q n jm jmaged :
ext_spec_stable age (JE_spec _ Jspec) ->
age jm jmaged ->
le n (level jmaged) ->
@jsafeN Z Jspec ge n ora q jm ->
@jsafeN Z Jspec ge n ora q jmaged.
Lemma pred_hered {A} {_ : ageable A} (P : pred A) : hereditary age (app_pred P).
Lemma hereditary_necR {phi phi' : rmap} {P} :
necR phi phi' ->
hereditary age P ->
P phi -> P phi'.
Lemma anti_hereditary_necR {phi phi' : rmap} {P} :
necR phi phi' ->
hereditary (fun x y => age y x) P ->
P phi' -> P phi.
Lemma app_pred_age {R} {phi phi' : rmap} :
age phi phi' ->
app_pred R phi ->
app_pred R phi'.
Lemma age_yes_sat {Phi Phi' phi phi' l z z' sh sh'} (R : pred rmap) :
level Phi = level phi ->
age Phi Phi' ->
age phi phi' ->
app_pred R phi ->
Phi  @ l = YES sh sh' (LK z z') (SomeP rmaps.Mpred (fun _ => R)) ->
app_pred (approx (S (level phi')) R) phi' /\
Phi' @ l = YES sh sh' (LK z z') (SomeP rmaps.Mpred (fun _ => approx (level Phi') R)).
Lemma age_resource_at {phi phi' loc} :
age phi phi' ->
phi' @ loc = resource_fmap (approx (level phi')) (approx (level phi')) (phi @ loc).
Lemma age_to_resource_at phi n loc : age_to n phi @ loc = resource_fmap (approx n) (approx n) (phi @ loc).
Lemma age_to_ghost_of phi n : ghost_of (age_to n phi) = ghost_fmap (approx n) (approx n) (ghost_of phi).