Skip to content

feat: Add ihave : Q tactic #120

Merged
markusdemedeiros merged 4 commits intomasterfrom
msammler/add_have
Jan 29, 2026
Merged

feat: Add ihave : Q tactic #120
markusdemedeiros merged 4 commits intomasterfrom
msammler/add_have

Conversation

@MackieLoeffel
Copy link
Collaborator

Builds on #119

Add the ihave : Q tactic that allows asserting new separation logic
hypothesis

Closes #116

@lzy0505 lzy0505 self-requested a review January 20, 2026 13:53
@MackieLoeffel MackieLoeffel force-pushed the msammler/add_have branch 4 times, most recently from f125708 to 42ae19e Compare January 22, 2026 07:42
@markusdemedeiros markusdemedeiros changed the title Add ihave : Q tactic feat: Add ihave : Q tactic Jan 22, 2026
@MackieLoeffel MackieLoeffel force-pushed the msammler/add_have branch 3 times, most recently from 739e01f to e7160b5 Compare January 22, 2026 15:34
@MackieLoeffel
Copy link
Collaborator Author

@lzy0505 This PR is ready to review when you have time.

Copy link
Collaborator

@lzy0505 lzy0505 left a comment

Choose a reason for hiding this comment

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

Looks good! I pushed some docstrings and comments. Another feature that is nice to have is destructing the asserted hypothesis. Do you think you can also add this?

@MackieLoeffel
Copy link
Collaborator Author

Another feature that is nice to have is destructing the asserted hypothesis. Do you think you can also add this?

Indeed, this is a nice feature. Lean is a bit weird since it has have x : P which does not allow destructuring and obtain <a, b> : P which allows destructuring. Should we match this in Iris Lean (i.e. have ihave x : Q that does not allow destructuring and iobtain <a, b> : Q that allows destructuring) or should we also allow destructing patterns for ihave?
(I am not sure what the best option is since I think both having less tactics to remember is good, but also consistency with the standard lean tactics.)
Also pinging @markusdemedeiros if he has an opinion.

MackieLoeffel and others added 2 commits January 26, 2026 15:05
Add the ihave : Q tactic that allows asserting new separation logic
hypothesis

Add ihave to tactics.md and update tactics.md

Improve error message of iapply and add test

Closes #116
@MackieLoeffel
Copy link
Collaborator Author

I added support for destructuring to ihave and added an alias iobtain for ihave. This means that the user can use whatever tactic / spelling they like. Let me know if you have other suggestions, otherwise I will merge this PR.

@lzy0505
Copy link
Collaborator

lzy0505 commented Jan 26, 2026

Good to go.

@markusdemedeiros
Copy link
Collaborator

You actually can destruct with both have and obtain, the difference is whether or not the proposition remains in the context (so spatial destruction is like obtain but intuitionistic destruction is like have). I think for this reason, we should just remove the obtain spelling.

https://live.lean-lang.org/#codez=KYDwhgtgDgNsAEBvE8Ce8Bc9CohPA6zgL6bwAqATgK4IYC88ARqgFDzwAWYAbgoBfkIARgA08APqBL8kz0QreAHsGAFzABLAHbxeqYWMl00sgLSH4KcsAiq1AZ3jr4i9ggDGctYtCKR6ACZzgtmpyirLWcuTkqEA

Otherwise, I haven't looked through it closely, but I trust Zongyuan's review and am excited to play around with it!

@MackieLoeffel
Copy link
Collaborator Author

Interesting, I thought I tried it in other settings and there have did not support destructuring patterns. But I am happy to remove the iobtain spelling, this is just one less thing to worry about.

@lzy0505
Copy link
Collaborator

lzy0505 commented Jan 29, 2026

Are we merging this?

@markusdemedeiros
Copy link
Collaborator

I think we're all good to go I'll just do it

@markusdemedeiros markusdemedeiros merged commit 129db2b into master Jan 29, 2026
1 check passed
@markusdemedeiros markusdemedeiros deleted the msammler/add_have branch January 29, 2026 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Asserting iProps with ihave

3 participants