Commit dfefb918 authored by Joseph Tassarotti's avatar Joseph Tassarotti

Remove context duplication from tac_exist_destruct.

parent 5c38c76b
......@@ -631,14 +631,17 @@ Qed.
Lemma tac_exist_destruct {A} Δ i p j P (Φ : A PROP) Q :
envs_lookup i Δ = Some (p, P) IntoExist P Φ
( a, Δ',
envs_simple_replace i p (Esnoc Enil j (Φ a)) Δ = Some Δ'
envs_entails Δ' Q)
( a,
match envs_simple_replace i p (Esnoc Enil j (Φ a)) Δ with
| Some Δ' => envs_entails Δ' Q
| None => False
end)
envs_entails Δ Q.
Proof.
rewrite envs_entails_eq => ?? HΦ. rewrite envs_lookup_sound //.
rewrite (into_exist P) intuitionistically_if_exist sep_exist_r.
apply exist_elim=> a; destruct (HΦ a) as (Δ'&?&?).
apply exist_elim=> a; specialize (HΦ a) as Hmatch.
destruct (envs_simple_replace _ _ _ _) as [Δ'|] eqn:Hrep; last done.
rewrite envs_simple_replace_singleton_sound' //; simpl. by rewrite wand_elim_r.
Qed.
......
......@@ -1233,12 +1233,13 @@ Local Tactic Notation "iExistDestruct" constr(H)
let P := match goal with |- IntoExist ?P _ => P end in
fail "iExistDestruct: cannot destruct" P|];
let y := fresh in
intros y; eexists; split;
[pm_reflexivity ||
intros y; pm_reduce;
match goal with
| |- False =>
let Hx := pretty_ident Hx in
fail "iExistDestruct:" Hx "not fresh"
|revert y; intros x
(* subgoal *)].
| _ => revert y; intros x (* subgoal *)
end.
(** * Modality introduction *)
Tactic Notation "iModIntro" uconstr(sel) :=
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment