Ltac sep_solve :=
unfold star, himp, heq, emp, inj, ex in *; intuition; cancel; auto.

(* Specifications: *)
Lemma heq_star_frame : forall P Q R S,
P <===> Q -> R <===> S -> (star P R) <===> (star Q S).
Lemma himp_subst_p : forall P Q R S,
P ===> S -> (star S Q) ===> R ->
(star P Q) ===> R.
Lemma himp_subst_c : forall P Q R S,
S ===> Q -> P ===> (star S R) ->
P ===> (star Q R).
Lemma heq_subst : forall P Q R S,
P <===> S -> (star S Q) <===> R ->
(star P Q) <===> R.
Lemma himp_star_cancel : forall P Q R,
Q ===> R -> (star P Q) ===> (star P R).
Lemma heq_star_cancel : forall P Q R,
Q <===> R -> (star P Q) <===> (star P R).
(** pure lemmas **)
Lemma himp_star_pure_p : forall P Q F,
(star (inj F) P) ===> Q -> (F -> P ===> Q).
Lemma himp_star_pure_c : forall P Q (F : Prop),
(F -> P ===> Q) -> (star (inj F) P) ===> Q.
Lemma himp_star_pure_cc : forall P Q (p : Prop),
p ->
P ===> Q ->
P ===> (star (inj p) Q).
(** ex lemmas **)
Lemma himp_ex_p : forall T (P : T -> _) Q,
(forall v, (P v) ===> Q) -> (ex T P) ===> Q.
Lemma himp_ex_c : forall T (P : T -> _) Q,
(exists v, Q ===> (P v)) -> Q ===> (ex T P).
Lemma heq_ex : forall T (P Q : T -> _),
(forall v, P v <===> Q v) ->
ex T P <===> ex T Q.
Lemma himp_ex : forall T (P Q : T -> _),
(forall v, P v ===> Q v) ->
ex T P ===> ex T Q.
Lemma heq_ex_star : forall T (P : T -> _) Q,
(star (ex T P) Q) <===> (ex T (fun x => star (P x) Q)).
Lemma himp_ex_star : forall T (P : T -> _) Q,
(star (ex T P) Q) ===> (ex T (fun x => star (P x) Q)).