Skip to content
Snippets Groups Projects
Commit 5e608261 authored by Ralf Jung's avatar Ralf Jung
Browse files

fix clear pattern in destruct pattern

parent 045c2d15
No related branches found
No related tags found
No related merge requests found
...@@ -587,6 +587,12 @@ Proof. ...@@ -587,6 +587,12 @@ Proof.
iIntros "?". iExists _. iApply modal_if_lemma2. done. iIntros "?". iExists _. iApply modal_if_lemma2. done.
Qed. Qed.
Lemma test_iDestruct_clear P Q R :
P -∗ (Q R) -∗ True.
Proof.
iIntros "HP HQR". iDestruct "HQR" as "{HP} [HQ HR]". done.
Qed.
End tests. End tests.
(** Test specifically if certain things print correctly. *) (** Test specifically if certain things print correctly. *)
......
...@@ -1102,19 +1102,19 @@ Local Ltac iDestructHypGo Hz pat := ...@@ -1102,19 +1102,19 @@ Local Ltac iDestructHypGo Hz pat :=
| IModalElim ?pat => iModCore Hz; iDestructHypGo Hz pat | IModalElim ?pat => iModCore Hz; iDestructHypGo Hz pat
| _ => fail "iDestruct:" pat "invalid" | _ => fail "iDestruct:" pat "invalid"
end. end.
Local Ltac iDestructHypFindPat H pat found pats := Local Ltac iDestructHypFindPat Hgo pat found pats :=
lazymatch pats with lazymatch pats with
| [] => | [] =>
lazymatch found with lazymatch found with
| true => pm_prettify (* post-tactic prettification *) | true => pm_prettify (* post-tactic prettification *)
| false => fail "iDestruct:" pat "should contain exactly one proper introduction pattern" | false => fail "iDestruct:" pat "should contain exactly one proper introduction pattern"
end end
| ISimpl :: ?pats => simpl; iDestructHypFindPat H pat found pats | ISimpl :: ?pats => simpl; iDestructHypFindPat Hgo pat found pats
| IClear ?H :: ?pats => iClear H; iDestructHypFindPat H pat found pats | IClear ?H :: ?pats => iClear H; iDestructHypFindPat Hgo pat found pats
| IClearFrame ?H :: ?pats => iFrame H; iDestructHypFindPat H pat found pats | IClearFrame ?H :: ?pats => iFrame H; iDestructHypFindPat Hgo pat found pats
| ?pat :: ?pats => | ?pat :: ?pats =>
lazymatch found with lazymatch found with
| false => iDestructHypGo H pat; iDestructHypFindPat H pat true pats | false => iDestructHypGo Hgo pat; iDestructHypFindPat Hgo pat true pats
| true => fail "iDestruct:" pat "should contain exactly one proper introduction pattern" | true => fail "iDestruct:" pat "should contain exactly one proper introduction pattern"
end end
end. end.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment