Ltac replace_in_pre S S' :=
 match goal with |- @semax _ _ _ ?P _ _ =>
  match P with context C[S] =>
     let P' := context C[S'] in
      apply semax_pre with P'; [ | ]
  end
 end.

(* Specifications: *)
Lemma semax_extract_PROP_True: forall Espec {cs: compspecs} Delta (PP: Prop) P QR c Post, PP -> @semax cs Espec Delta (PROPx P QR) c Post -> @semax cs Espec Delta (PROPx (PP::P) QR) c Post.
Lemma semax_extract_PROP: forall Espec {cs: compspecs} Delta (PP: Prop) P QR c Post, (PP -> @semax cs Espec Delta (PROPx P QR) c Post) -> @semax cs Espec Delta (PROPx (PP::P) QR) c Post.
Lemma local_lift0: forall P, local (lift0 P) = prop P.
Lemma extract_exists_post: forall {Espec: OracleKind} {cs: compspecs} {A: Type} (x: A) Delta (P: environ -> mpred) c (R: A -> environ -> mpred), semax Delta P c (normal_ret_assert (R x)) -> semax Delta P c (normal_ret_assert (exp R)).