Definition check_one_temp_spec (Q: PTree.t val) (idv: ident * val) : Prop :=
(Q ! (fst idv)) = Some (snd idv).
Definition check_gvars_spec (GV: option globals) (GV': option globals) : Prop :=
match GV' with Some _ => GV = GV' | _ => True end.
Definition strong_cast (t1 t2: type) (v: val) : val :=
force_val (sem_cast t1 t2 v).

(* Specifications: *)
Lemma extract_trivial_liftx_e:
forall (R: list (environ->mpred)) (R': list mpred),
extract_trivial_liftx R R' -> R = map liftx R'.
Lemma isolate_LOCAL_lem1:
forall Q, PROPx nil (LOCALx Q (SEPx (TT::nil))) = local (fold_right `(and) `(True) (map locald_denote Q)).
Lemma Forall_ptree_elements_e:
forall A (F: ident * A -> Prop) m i v,
Forall F (PTree.elements m) ->
m ! i = Some v ->
F (i,v).
Lemma pTree_from_elements_e1:
forall rho fl vl i v,
Forall (fun v => v <> Vundef) vl ->
(pTree_from_elements (combine fl vl)) ! i = Some v ->
v = eval_id i (make_args fl vl rho) /\ v <> Vundef.
Lemma ve_of_make_args: forall i fl vl rho ,
length fl = length vl ->
Map.get (ve_of (make_args fl vl rho)) i = None.
Lemma ge_of_make_args: forall i fl vl rho,
Map.get (ge_of (make_args fl vl rho)) i = Map.get (ge_of rho) i.
Lemma check_specs_lemma:
forall Qtemp Qpre_temp Qvar GV GV' rho fl vl
(LEN: length fl = length vl)
(UNDEF: Forall (fun v => v <> Vundef) vl),
check_gvars_spec GV GV' ->
Forall (check_one_temp_spec (pTree_from_elements (combine fl vl)))
(PTree.elements Qpre_temp) ->
fold_right `(and) `(True) (map locald_denote (LocalD Qtemp Qvar GV)) rho ->
fold_right `(and) `(True) (map locald_denote (LocalD Qpre_temp (PTree.empty _) GV')) (make_args fl vl rho).
Lemma PROP_combine:
forall P P' Q Q' R R',
PROPx P (LOCALx Q (SEPx R)) * PROPx P' (LOCALx Q' (SEPx R')) =
PROPx (P++P') (LOCALx (Q++Q') (SEPx (R++R'))).