Commit e785e4a0 authored by Robbert Krebbers's avatar Robbert Krebbers
Browse files

Merge branch 'robbert/iApply_pretty' into 'master'

Fix bug in `iApply` prettification.

See merge request !788
parents 9d04874f 854dcaaf
Pipeline #65347 passed with stage
in 10 minutes and 11 seconds
...@@ -1240,8 +1240,7 @@ Local Ltac iApplyHypLoop H := ...@@ -1240,8 +1240,7 @@ Local Ltac iApplyHypLoop H :=
[eapply tac_apply with H _ _ _; [eapply tac_apply with H _ _ _;
[pm_reflexivity [pm_reflexivity
|iSolveTC |iSolveTC
|pm_reduce; |pm_reduce]
pm_prettify (* reduce redexes created by instantiation *)]
|iSpecializePat H "[]"; last iApplyHypLoop H]. |iSpecializePat H "[]"; last iApplyHypLoop H].
Tactic Notation "iApplyHyp" constr(H) := Tactic Notation "iApplyHyp" constr(H) :=
...@@ -1253,7 +1252,9 @@ Tactic Notation "iApplyHyp" constr(H) := ...@@ -1253,7 +1252,9 @@ Tactic Notation "iApplyHyp" constr(H) :=
end]. end].
Tactic Notation "iApply" open_constr(lem) := Tactic Notation "iApply" open_constr(lem) :=
iPoseProofCore lem as false (fun H => iApplyHyp H). iPoseProofCore lem as false (fun H => iApplyHyp H);
pm_prettify. (* reduce redexes created by instantiation; this is done at the
very end after all type classes have been solved. *)
(** * Disjunction *) (** * Disjunction *)
Tactic Notation "iLeft" := Tactic Notation "iLeft" :=
......
...@@ -385,6 +385,18 @@ No applicable tactic. ...@@ -385,6 +385,18 @@ No applicable tactic.
"HP" : default emp mP "HP" : default emp mP
--------------------------------------∗ --------------------------------------∗
default emp mP default emp mP
"test_iApply_prettification3"
: string
1 goal
PROP : bi
Ψ, Φ : nat → PROP
HP : ∀ (f : nat → nat) (y : nat),
TCEq f (λ x : nat, x + 10) → Ψ (f 1) -∗ Φ y
============================
"H" : Ψ 11
--------------------------------------∗
Ψ (1 + 10)
1 goal 1 goal
PROP : bi PROP : bi
......
...@@ -1109,6 +1109,17 @@ Proof. ...@@ -1109,6 +1109,17 @@ Proof.
iIntros "?". iExists _. iApply modal_if_lemma2. done. iIntros "?". iExists _. iApply modal_if_lemma2. done.
Qed. Qed.
Check "test_iApply_prettification3".
Lemma test_iApply_prettification3 (Ψ Φ : nat PROP) :
( f y, TCEq f (λ x, x + 10) Ψ (f 1) - Φ y)
Ψ 11 - Φ 10.
Proof.
iIntros (HP) "H".
iApply HP. (* should be [Ψ (1 + 10)], without a beta redex *)
Show.
iApply "H".
Qed.
Lemma test_iDestruct_clear P Q R : Lemma test_iDestruct_clear P Q R :
P - (Q R) - True. P - (Q R) - True.
Proof. Proof.
......
Supports Markdown
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