Commit dfefb918 authored by Joseph Tassarotti's avatar Joseph Tassarotti

Remove context duplication from tac_exist_destruct.

parent 5c38c76b
...@@ -631,14 +631,17 @@ Qed. ...@@ -631,14 +631,17 @@ Qed.
Lemma tac_exist_destruct {A} Δ i p j P (Φ : A PROP) Q : Lemma tac_exist_destruct {A} Δ i p j P (Φ : A PROP) Q :
envs_lookup i Δ = Some (p, P) IntoExist P Φ envs_lookup i Δ = Some (p, P) IntoExist P Φ
( a, Δ', ( a,
envs_simple_replace i p (Esnoc Enil j (Φ a)) Δ = Some Δ' match envs_simple_replace i p (Esnoc Enil j (Φ a)) Δ with
envs_entails Δ' Q) | Some Δ' => envs_entails Δ' Q
| None => False
end)
envs_entails Δ Q. envs_entails Δ Q.
Proof. Proof.
rewrite envs_entails_eq => ?? HΦ. rewrite envs_lookup_sound //. rewrite envs_entails_eq => ?? HΦ. rewrite envs_lookup_sound //.
rewrite (into_exist P) intuitionistically_if_exist sep_exist_r. 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. rewrite envs_simple_replace_singleton_sound' //; simpl. by rewrite wand_elim_r.
Qed. Qed.
......
...@@ -1232,13 +1232,14 @@ Local Tactic Notation "iExistDestruct" constr(H) ...@@ -1232,13 +1232,14 @@ Local Tactic Notation "iExistDestruct" constr(H)
|iSolveTC || |iSolveTC ||
let P := match goal with |- IntoExist ?P _ => P end in let P := match goal with |- IntoExist ?P _ => P end in
fail "iExistDestruct: cannot destruct" P|]; fail "iExistDestruct: cannot destruct" P|];
let y := fresh in let y := fresh in
intros y; eexists; split; intros y; pm_reduce;
[pm_reflexivity || match goal with
let Hx := pretty_ident Hx in | |- False =>
fail "iExistDestruct:" Hx "not fresh" let Hx := pretty_ident Hx in
|revert y; intros x fail "iExistDestruct:" Hx "not fresh"
(* subgoal *)]. | _ => revert y; intros x (* subgoal *)
end.
(** * Modality introduction *) (** * Modality introduction *)
Tactic Notation "iModIntro" uconstr(sel) := 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