refactor: rename WP.wpTrans to WP.trans and the wp_consequence family to wp_monotone - #15171
Merged
Merged
Conversation
This PR renames the `WP.wpTrans` projection to `WP.trans` and the derived `wpTrans_apply_eq` lemmas to `trans_apply_eq`. This is a mechanical rename with no behavioral change.
This PR renames the `WP.wp_trans_monotone` monotonicity field to `trans_monotone`, matching the `trans` projection.
… deprecations This PR renames the `WP.wp_consequence`/`wp_econs` weakest-precondition monotonicity lemmas to a uniform `wp_monotone` family (`wp_monotone`, `wp_monotone_post`, `wp_monotone_epost`, `wp_monotone_bot`, and their `_le` variants), and adds deprecated aliases for every renamed name, including the earlier `WP.wpTrans`, `WP.wp_trans_monotone` and `WP.wpTrans_apply_eq` renames.
This PR keeps `WP.wpTrans`/`WP.wp_trans_monotone` as deprecated fields alongside the new `WP.trans`/`WP.trans_monotone`, with mutual default values so an instance can define either name. Existing `WP` instances that construct with the old field names keep compiling, and reading the old projections warns.
This PR makes the program and pre-/postcondition arguments of `WP.wp_monotone`, `wp_monotone_post`, `wp_monotone_epost` and `wp_monotone_bot` implicit, since they are recovered from the goal by `apply`; only the entailment hypotheses stay explicit. The `_le` variants keep explicit arguments, as they are applied by `mkAppM` in vcgen.
This PR drops the explicit `x`/`epost` hints at the `WP.wp_monotone_post` call in `WPMonad.withFrameClosure`; the surrounding `PartialOrder.rel_trans` already determines them.
sgraf812
marked this pull request as ready for review
September 18, 2026 08:38
|
The adaptation PR for this PR is leanprover/downstream-lean4#84. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR renames several
Std.WPnames for consistency and deprecates the old ones. TheWP.wpTransprojection becomesWP.trans, its monotonicity fieldWP.wp_trans_monotonebecomesWP.trans_monotone, and thewpTrans_apply_eqlemma becomestrans_apply_eq. The weakest-precondition monotonicity lemmasWP.wp_consequence/wp_econsbecome a uniformwp_monotonefamily:wp_monotonefor both channels,wp_monotone_postandwp_monotone_epostfor one channel,wp_monotone_botfor the empty exception postcondition, and the_letransitivity variants.