Skip to content

feat: irevert tactic#74

Open
oliversoeser wants to merge 8 commits intoleanprover-community:masterfrom
oliversoeser:irevert
Open

feat: irevert tactic#74
oliversoeser wants to merge 8 commits intoleanprover-community:masterfrom
oliversoeser:irevert

Conversation

@oliversoeser
Copy link
Contributor

Implements the irevert tactic, closes #69.

@oliversoeser oliversoeser marked this pull request as draft July 5, 2025 07:25
@oliversoeser oliversoeser marked this pull request as ready for review July 7, 2025 08:53
Copy link
Collaborator

@MackieLoeffel MackieLoeffel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked over the MR and noticed some minor points.

λ x => h.trans (forall_elim x)

theorem pure_revert [BI PROP] {P Q : PROP} {φ : Prop}
(h : P ⊢ ⌜φ⌝ -∗ Q) : φ → P ⊢ Q :=
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should use the MakeAffinely ⌜ φ ⌝ P to add the <affine> modality in front of ⌜ φ ⌝ for logics that require it. Otherwise, irevert can make the goal unprovable. See
https://gitlab.mpi-sws.org/iris/iris/-/blob/306d8d024f9d6522c0e733fd7eb27b0af676d4ca/iris/proofmode/coq_tactics.v

end intro

-- revert
namespace revert
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would also be good to have tests for the failing cases:

  1. What happens when the name is not used?
  2. What happens when a pure hypothesis is used in another hypothesis?

For the second point: When I try the following test,

theorem fail [BI PROP] (Φ : Bool → PROP) : ⊢ ∀ x, <affine> ⌜x = true⌝ -∗ Φ x -∗ Φ x := by
  iintro x %_ H
  irevert x

something very weird happens:

Goals (1)
PROP : Type u_1
inst : BI PROP
Φ : Bool → PROP
⊢ 
  ∗H : Φ _fvar.2200
  ⊢ «forall» fun x x_1 => Φ x

@markusdemedeiros
Copy link
Collaborator

Sorry for letting this PR go stale. @MackieLoeffel or @lzy0505 could you look at this again, given the changes to the proofmode?

@MackieLoeffel
Copy link
Collaborator

Will do, I have it on my list to update this PR to master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

iRevert tactic

3 participants