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.

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.