Skip to content

Conversation

@ahuoguo
Copy link
Contributor

@ahuoguo ahuoguo commented Dec 11, 2025

The motivation for this alternative definition can be found here: https://gitlab.mpi-sws.org/iris/iris/-/merge_requests/211 https://gitlab.mpi-sws.org/iris/iris/-/merge_requests/186

Questions and TODOs:

  • Should this file be place in src/Iris/BI/? I was in iris/base_logic/ in the iris-rocq repo?
  • For own_updateP, the variable own_updateP_plainly disappears after := by. So I have to state it as a parameter. nvm
  • #iris-lean > pure propositions @ 💬

@ahuoguo ahuoguo changed the title WIP: Bupdalt Bupdalt Dec 11, 2025
@ahuoguo ahuoguo marked this pull request as ready for review December 11, 2025 07:03
@markusdemedeiros
Copy link
Collaborator

Good stuff!

Some notes:

  • Use Mathlib style docstrings instead of -- ...
  • For definitions, use the syntax typeclasses: BIBase instead of BI and Plainly instead of BIPlainly
  • I moved around the code. Since this amounts to a helper function for constructing BUpd instances, I moved it to the ProofMode folder and split it into two files (the generic construction, and the compatibility with the UPred instance)
  • Opening frequently namespaces in sections
  • Removing unused names
  • General cleanup of the proofs. I think it's nice that you used the proofmode here, I wouldn't have done the same but it's a great test case.
    • The AI proofs were really obvious. They seem to generate lots of "have" statements that are only used once, these should typically be inlined. Doing so for some proofs (eg. own_updateP) revealed plenty of unnecessary have statements and calc statements that could be combined. In the future, it is good practice to try doing this yourself.

Look over my changes, and let me know when you think it's good to go.

@ahuoguo
Copy link
Contributor Author

ahuoguo commented Dec 20, 2025

I moved around the code. Since this amounts to a helper function for constructing BUpd instances, I moved it to the ProofMode folder and split it into two files (the generic construction, and the compatibility with the UPred instance)

Why does the generic construction of BupdAlt goes into proof mode? Isn't this a syntactic construct on top of BI?

@markusdemedeiros
Copy link
Collaborator

markusdemedeiros commented Dec 20, 2025

I was running into some cyclic dependency problems because you used Iris tactics instead of doing a plain Lean proof. There's already a dependency on all of BI in some of the tactics, so if I added the BUpdPlain to the top-level import of BI it creates a cycle. I figured this would be a one-off problem, but now that you brought it up again, I looked closer through Iris-Rocq and realized many files will run into this problem.

I pushed a change to have a separate Lib folder in BI that is not included in the top-level import. This avoids the cycle, and in fact, I think Iris-Rocq ends up doing the same thing too. I always wondered why some things were in Lib folders!

@ahuoguo
Copy link
Contributor Author

ahuoguo commented Dec 20, 2025

Thanks for looking into this! LGTM to merge now.

@markusdemedeiros markusdemedeiros merged commit 5be1904 into leanprover-community:master Dec 20, 2025
1 check passed
@markusdemedeiros
Copy link
Collaborator

Another one in the books, great work!

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.

2 participants