Tactic Notation "replace_SEP" constr(n) constr(R) :=
first [apply (replace_SEP' (nat_of_Z n) R) | apply (replace_SEP'' (nat_of_Z n) R)];
unfold my_nth,replace_nth; simpl nat_of_Z;
repeat simpl_nat_of_P; cbv beta iota; cbv beta iota.
Tactic Notation "replace_SEP" constr(n) constr(R) "by" tactic1(t):=
first [apply (replace_SEP' (nat_of_Z n) R) | apply (replace_SEP'' (nat_of_Z n) R)];
unfold my_nth,replace_nth; simpl nat_of_Z;
repeat simpl_nat_of_P; cbv beta iota; cbv beta iota; [ now t | ].

Lemma replace_SEP''_bupd:
forall n R' Delta P Q Rs Post,
ENTAIL Delta, PROPx P (LOCALx Q (SEPx (my_nth n Rs TT ::  nil))) |-- `(|==> R') ->
ENTAIL Delta, PROPx P (LOCALx Q (SEPx (replace_nth n Rs R'))) |-- |==> Post ->
ENTAIL Delta, PROPx P (LOCALx Q (SEPx Rs)) |-- |==> Post.