Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Iris/Iris/ProofMode/Instances.lean
Original file line number Diff line number Diff line change
Expand Up @@ -414,12 +414,13 @@ instance (priority := default + 10) fromSep_persistently [BI PROP] (P Q1 Q2 : PR
from_sep := persistently_sep_mpr.trans (persistently_mono h.1)

-- AndIntoSep
@[ipm_class, rocq_alias AndIntoSep]
@[ipm_backtrack, rocq_alias AndIntoSep]
Comment thread
MackieLoeffel marked this conversation as resolved.
Outdated
class inductive AndIntoSep {PROP} [BI PROP] : PROP → outParam PROP → PROP → outParam PROP → Prop
| affine (P Q Q' : PROP) [Affine P] [h : FromAffinely Q' Q] : AndIntoSep P P Q Q'
| affinely (P Q : PROP) : AndIntoSep P iprop(<affine> P) Q Q

attribute [instance] AndIntoSep.affine AndIntoSep.affinely
attribute [instance (default + 10)] AndIntoSep.affine
attribute [instance] AndIntoSep.affinely

-- IntoSep
@[rocq_alias into_sep_sep]
Expand Down
19 changes: 19 additions & 0 deletions Iris/Iris/Tests/Tactics.lean
Original file line number Diff line number Diff line change
Expand Up @@ -1892,6 +1892,25 @@ example [BI PROP] (Q : PROP) : □ Q ⊢ Q := by
iintro H
icases H with ⟨HA, HB⟩

/- Tests `AndIntoSep` instances -/
/--
error: unsolved goals
PROP : Type u_1
inst✝¹ : BI PROP
inst✝ : BIAffine PROP
P Q : PROP
□x✝ : P
∗R : <pers> Q
⊢ Q
-/
#guard_msgs in
example [BI PROP] [BIAffine PROP] (P Q : PROP) :
(□ P) ∧ <pers> Q ⊢ Q := by
iintro H
icases H with ⟨#_, R⟩


/-- Tests `icases` with a case destruction pattern for rewriting pure equalities -/
example [BI PROP] (m n : Nat) (a b c : Prop) :
⊢@{PROP} ⌜m = 2⌝ -∗ ⌜3 = n⌝ -∗ ⌜a = b⌝ -∗ ⌜b = c⌝ -∗ ⌜m.succ = n ∧ a = c⌝ := by
Expand Down