Ltac grab_indexes_SEP ns :=
  rewrite (grab_indexes_SEP ns);
    unfold grab_indexes; simpl grab_calc;
   unfold grab_indexes', insert;
   repeat simpl_nat_of_P; cbv beta iota;
   unfold app_alt; fold @app_alt.(* The simpl_nat_of_P tactic is a complete hack,
  needed for compatibility between Coq 8.3/8.4,
  because the name of the thing to unfold varies
  between the two versions *)
Ltac simpl_nat_of_P :=
match goal with |- context [nat_of_P ?n] =>
  match n with xI _ => idtac | xO _ => idtac | xH => idtac | _ => fail end;
  let N := fresh "N" in
  set (N:= nat_of_P n);
  compute in N;
  unfold N; clear N
end.

(* Specifications: *)
Lemma lower_sepcon: forall P Q rho, @sepcon (environ->mpred) _ _ P Q rho = sepcon (P rho) (Q rho).
Lemma lower_andp: forall P Q rho, @andp (environ->mpred) _ P Q rho = andp (P rho) (Q rho).
Lemma lift_prop_unfold: forall P z, @prop (environ->mpred) _ P z = @prop mpred Nveric P.
Lemma andp_unfold: forall (P Q: environ->mpred) rho, @andp (environ->mpred) _ P Q rho = @andp mpred Nveric (P rho) (Q rho).
Lemma refold_andp: forall (P Q: environ -> mpred), (fun rho: environ => P rho && Q rho) = (P && Q).
Lemma exp_unfold : forall A P rho, @exp (environ->mpred) _ A P rho = @exp mpred Nveric A (fun x => P x rho).